html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

:root {
    --primary: #2c3e50;
    --accent: #1abc9c;
    --bg: #f8f9fa;
    --card-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 0;
  background-color: var(--bg);
  font-family: 'Inter', sans-serif;
  color: #333;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

.ticket-card {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--accent);
    box-shadow: var(--card-shadow);
    transition: transform 0.2s;
}

.ticket-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

.ticket-id {
    color: #999;
    font-weight: 500;
}

.ticket-subject {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
}

.ticket-meta {
    font-size: 0.9rem;
    color: #666;
}

.filter-sidebar {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    height: fit-content;
    box-shadow: var(--card-shadow);
}

.badge-priority-low { background: #e0f2f1; color: #00897b; }
.badge-priority-medium { background: #fff3e0; color: #fb8c00; }
.badge-priority-high { background: #ffebee; color: #e53935; }

.status-dropdown {
    border: none;
    background: transparent;
    font-weight: 500;
    cursor: pointer;
}
#nprogress .bar { background: var(--accent) !important; height: 3px !important; }
#nprogress .peg { box-shadow: 0 0 10px var(--accent), 0 0 5px var(--accent) !important; }

#loader-wrapper { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255, 255, 255, 0.7); backdrop-filter: blur(8px); display: none; justify-content: center; align-items: center; z-index: 9999; }
.loader-container { text-align: center; }

.sla-info-trigger {
    line-height: 1;
    vertical-align: middle;
    text-decoration: none !important;
}
.sla-info-trigger .bi-info-circle {
    font-size: 0.95rem;
}
.popover .sla-info-popover-body ul,
.popover .sla-info-popover-body p {
    text-align: left;
}

.app-shell {
    display: flex;
    min-height: 100vh;
    transition: all 0.2s ease;
}

.app-sidebar {
    width: 260px;
    background: #ffffff;
    border-right: 1px solid #e9ecef;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    transition: width 0.2s ease, transform 0.2s ease;
}

.sidebar-brand {
    display: block;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    border-radius: 0.5rem;
}

.sidebar-user {
    margin: 0 0.5rem 0.75rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    background: #f8f9fa;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-section-title {
    margin: 0.75rem 0.75rem 0.25rem;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6c757d;
    font-weight: 700;
}

.sidebar-link {
    display: flex;
    align-items: center;
    color: #343a40;
    text-decoration: none;
    border-radius: 0.5rem;
    padding: 0.6rem 0.75rem;
    font-weight: 500;
}

.sidebar-link:hover {
    background: #eef2f7;
    color: var(--primary);
}

.sidebar-link.active {
    background: #1abc9c1f;
    color: #0f766e;
    font-weight: 600;
}

.sidebar-footer {
    margin-top: auto;
    padding: 0.75rem 0.5rem 0.25rem;
}

.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.sidebar-toggle-btn {
    position: fixed;
    top: 0.85rem;
    left: 0.85rem;
    z-index: 1102;
    border-radius: 0.6rem;
    width: 2.2rem;
    height: 2.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1098;
}

.sidebar-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

.app-main .container-fluid {
    padding-left: 3.5rem !important;
}

.app-shell.sidebar-collapsed .app-sidebar {
    width: 78px;
}

.app-shell.sidebar-collapsed .sidebar-brand,
.app-shell.sidebar-collapsed .sidebar-link {
    font-size: 0;
}

.app-shell.sidebar-collapsed .sidebar-brand i,
.app-shell.sidebar-collapsed .sidebar-link i {
    font-size: 1.2rem;
    margin-right: 0 !important;
}

.app-shell.sidebar-collapsed .sidebar-brand,
.app-shell.sidebar-collapsed .sidebar-link {
    justify-content: center;
}

.app-shell.sidebar-collapsed .sidebar-user,
.app-shell.sidebar-collapsed .sidebar-section-title {
    display: none;
}

.app-shell.sidebar-collapsed .sidebar-footer button {
    font-size: 0;
}

.app-shell.sidebar-collapsed .sidebar-footer button i {
    font-size: 1rem;
    margin-right: 0 !important;
}

.app-footer {
    margin-top: auto;
    background: transparent;
    position: static;
    padding: 0.75rem 0;
    line-height: 1.3;
    z-index: auto;
}

.public-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.public-header {
    position: sticky;
    top: 0;
    z-index: 100;
}

.public-main {
    flex: 1;
}

@media (max-width: 991.98px) {
    .app-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100vh;
        transform: translateX(-100%);
        z-index: 1100;
        border-right: 1px solid #e9ecef;
        border-bottom: none;
        box-shadow: 0 0.5rem 1.2rem rgba(0, 0, 0, 0.12);
    }

    .app-shell.sidebar-open .app-sidebar {
        transform: translateX(0);
    }

    .app-main .container-fluid {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}
