:root {
    --sidebar-width: 240px;
    --topbar-height: 52px;
    --primary: #0071e3;
    --primary-dark: #0058b0;
    --accent: #ff6b35;
    --sidebar-bg: #ffffff;
    --sidebar-border: #4e5d72;
    --sidebar-text: #374151;
    --sidebar-muted: #7a8494;
    --sidebar-hover: rgba(0,113,227,0.07);
    --sidebar-active-bg: rgba(0,113,227,0.10);
    --sidebar-active-text: #0071e3;
    --body-bg: #dce1eb;
    --card-bg: #ffffff;
    --border-color: #4e5d72;
    --text-primary: #1a1d23;
    --text-secondary: #4e5a6e;
    --topbar-bg: rgba(255,255,255,0.97);
}

/* ── Base ──────────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', sans-serif;
    background: var(--body-bg);
    margin: 0;
    color: var(--text-primary);
    font-size: 0.9rem;
    -webkit-font-smoothing: antialiased;
}

/* ── Sidebar ───────────────────────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    border-right: 1px solid #4e5d72;
    overflow-y: auto;
    z-index: 1040;
    transition: transform 0.25s ease;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.1rem;
    border-bottom: 1px solid #4e5d72;
    min-height: var(--topbar-height);
}

.brand-text { color: var(--text-primary); font-size: 1.05rem; font-weight: 600; letter-spacing: -0.3px; }
.brand-text strong { color: var(--primary); }

.sidebar-nav { padding: 0.5rem 0.5rem; flex: 1; }

.sidebar-nav .nav-link {
    color: var(--sidebar-text);
    padding: 0.45rem 0.8rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.85rem;
    font-weight: 450;
    transition: background 0.12s, color 0.12s;
    white-space: nowrap;
    margin-bottom: 1px;
    text-decoration: none;
}

.sidebar-nav .nav-link:hover  { background: var(--sidebar-hover); color: var(--primary); }
.sidebar-nav .nav-link.active { background: var(--sidebar-active-bg); color: var(--sidebar-active-text); font-weight: 600; }
.sidebar-nav .nav-link i      { font-size: 0.95rem; width: 16px; text-align: center; opacity: 0.85; }
.sidebar-nav .nav-link.active i { opacity: 1; }

/* Section label */
.sidebar-nav .nav-section {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--sidebar-muted);
    padding: 0.75rem 0.8rem 0.25rem;
}

/* Sub-menu */
.sidebar-nav .ms-3 .nav-link  { font-size: 0.82rem; padding: 0.38rem 0.7rem 0.38rem 1.1rem; }
.sidebar-nav .nav-group-toggle .bi-chevron-down { font-size: 0.65rem; transition: transform 0.2s; }
.sidebar-nav .nav-group-toggle[aria-expanded="true"] .bi-chevron-down { transform: rotate(180deg); }

/* ── Main wrapper ──────────────────────────────────────────────────────────── */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.25s ease;
}

/* ── Topbar ────────────────────────────────────────────────────────────────── */
.topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    height: var(--topbar-height);
    background: var(--topbar-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid #4e5d72;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
}

.topbar-left  { display: flex; align-items: center; gap: 0.75rem; }
.topbar-right { display: flex; align-items: center; gap: 0.6rem; }

/* ── Main content ──────────────────────────────────────────────────────────── */
.main-content { padding: 1.5rem; flex: 1; }

/* ── Avatar ────────────────────────────────────────────────────────────────── */
.avatar-circle {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

/* ── Page header ───────────────────────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}
.page-header h4, .page-header h5 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.4px;
}

/* ── Cards ─────────────────────────────────────────────────────────────────── */
.card {
    background: var(--card-bg);
    border: 1.5px solid #4e5d72 !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08), 0 6px 20px rgba(0,0,0,0.05) !important;
    transition: box-shadow 0.18s, transform 0.18s;
}
.card:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.11), 0 10px 28px rgba(0,0,0,0.06) !important; }
.card-header {
    background: #f2f5fa !important;
    border-bottom: 1.5px solid #4e5d72 !important;
    font-weight: 600;
    border-radius: 12px 12px 0 0 !important;
    padding: 0.85rem 1.1rem;
    color: var(--text-primary);
    font-size: 0.9rem;
}
.card-footer {
    border-top: 1.5px solid #4e5d72 !important;
    background: #f2f5fa !important;
    border-radius: 0 0 12px 12px !important;
}

/* ── Stats card ─────────────────────────────────────────────────────────────── */
.stat-card { border-left: 3px solid var(--primary) !important; }
.stat-card .stat-value { font-size: 1.9rem; font-weight: 800; color: var(--text-primary); letter-spacing: -1.5px; }
.stat-card .stat-label { font-size: 0.7rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.8px; font-weight: 700; }

/* ── Tables ────────────────────────────────────────────────────────────────── */
.table { font-size: 0.875rem; border-color: #4e5d72 !important; }
.table th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    font-weight: 700;
    border-bottom: 1.5px solid #4e5d72 !important;
    border-top: none !important;
    background: #e4e9f2;
    padding: 0.65rem 0.75rem;
}
.table td { vertical-align: middle; padding: 0.7rem 0.75rem; border-color: #4e5d72 !important; }
.table-bordered, .table-bordered td, .table-bordered th { border-color: #4e5d72 !important; border-width: 1px !important; }
.table > tbody > tr:nth-child(even) { background: rgba(0,0,0,0.018); }
.table > tbody > tr:hover { background: rgba(0,113,227,0.05) !important; }
.table-borderless td, .table-borderless th { border: none !important; }

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 8px;
    padding: 0.42rem 0.9rem;
    transition: all 0.15s;
}
.btn-primary   { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); box-shadow: 0 2px 8px rgba(0,113,227,0.25); }
.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); border-color: var(--primary); }
.btn-sm { font-size: 0.8rem; padding: 0.3rem 0.65rem; border-radius: 6px; }
.btn-outline-secondary { border-color: #4e5d72; color: var(--text-secondary); }
.btn-outline-secondary:hover { background: #e8ecf4; border-color: #4e5d72; color: var(--text-primary); }

/* ── Form controls ─────────────────────────────────────────────────────────── */
.form-control, .form-select {
    border-radius: 8px;
    border: 1.5px solid #4e5d72 !important;
    font-size: 0.875rem;
    padding: 0.45rem 0.75rem;
    color: var(--text-primary);
    background-color: #ffffff;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(0,113,227,0.18) !important;
    outline: none;
}
.form-control-sm, .form-select-sm { font-size: 0.82rem; padding: 0.32rem 0.65rem; }
.form-label { font-size: 0.83rem; font-weight: 600; color: var(--text-primary); margin-bottom: 0.35rem; }
.input-group-text { border: 1.5px solid #4e5d72 !important; background: #e8ecf4; font-size: 0.875rem; border-radius: 8px 0 0 8px; color: var(--text-secondary); }

/* ── Badges ────────────────────────────────────────────────────────────────── */
.badge {
    font-size: 0.72rem;
    font-weight: 500;
    padding: 0.28em 0.55em;
    border-radius: 5px;
    letter-spacing: 0.2px;
}

/* ── Dropdown ──────────────────────────────────────────────────────────────── */
.dropdown-menu {
    border: 1.5px solid #4e5d72 !important;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.16);
    padding: 0.4rem;
    font-size: 0.875rem;
}
.dropdown-item { border-radius: 6px; padding: 0.45rem 0.75rem; color: var(--text-primary); }
.dropdown-item:hover { background: var(--sidebar-hover); color: var(--primary); }

/* ── Modals ────────────────────────────────────────────────────────────────── */
.modal-content { border-radius: 14px; border: 1.5px solid #4e5d72 !important; box-shadow: 0 20px 60px rgba(0,0,0,0.20); }
.modal-header { border-bottom: 1.5px solid #4e5d72 !important; padding: 1rem 1.25rem; border-radius: 14px 14px 0 0; background: #f2f5fa; }
.modal-footer { border-top: 1.5px solid #4e5d72 !important; }
.modal-title { font-weight: 600; font-size: 1rem; }

/* ── Alerts ────────────────────────────────────────────────────────────────── */
.alert { border-left: 4px solid !important; border-radius: 10px; font-size: 0.875rem; }
.alert-success { background: #f0faf1; color: #1e6e31; border-color: #2a9744 !important; }
.alert-danger  { background: #fff2f2; color: #b91c1c; border-color: #dc2626 !important; }
.alert-warning { background: #fffbeb; color: #92400e; border-color: #d97706 !important; }
.alert-info    { background: #eff6ff; color: #1e40af; border-color: #3b82f6 !important; }

/* ── Nav pills / tabs ──────────────────────────────────────────────────────── */
.nav-pills .nav-link { border-radius: 8px; color: var(--text-secondary); font-size: 0.85rem; padding: 0.4rem 0.85rem; }
.nav-pills .nav-link.active { background: var(--primary); }
.nav-tabs { border-bottom: 1.5px solid #4e5d72; }
.nav-tabs .nav-link { font-weight: 500; padding: 0.55rem 1rem; border: none; border-bottom: 2px solid transparent; margin-bottom: -2px; border-radius: 0; transition: color 0.15s, border-color 0.15s; color: var(--text-secondary); font-size: 0.875rem; }
.nav-tabs .nav-link:hover { color: var(--primary); border-bottom-color: var(--primary); background: none; }
.nav-tabs .nav-link.active { color: var(--primary); font-weight: 700; border-bottom: 2px solid var(--primary); background: none; }

/* ── List group ────────────────────────────────────────────────────────────── */
.list-group-item { border-color: #4e5d72 !important; }

/* ── Sidebar toggle button ─────────────────────────────────────────────────── */
.sidebar-toggle { background: none; border: none; cursor: pointer; color: var(--text-secondary); padding: 0.3rem; }

/* ── Mobile ────────────────────────────────────────────────────────────────── */
@media (max-width: 991px) {
    .sidebar        { transform: translateX(-100%); }
    .sidebar.open   { transform: translateX(0); box-shadow: 4px 0 20px rgba(0,0,0,0.12); }
    .main-wrapper   { margin-left: 0; }
    .main-content   { padding: 1rem; }
}

/* ── Desktop sidebar collapse ──────────────────────────────────────────────── */
body.sidebar-collapsed .sidebar      { transform: translateX(-100%); }
body.sidebar-collapsed .main-wrapper { margin-left: 0; }

/* ── Utility ───────────────────────────────────────────────────────────────── */
.text-muted { color: var(--text-secondary) !important; }
.fw-semibold { font-weight: 600; }
.border-color { border-color: #4e5d72 !important; }
.bg-light { background: #edf0f6 !important; }
.rounded-10 { border-radius: 10px; }
.rounded-12 { border-radius: 12px; }

/* ── Dashboard greeting banner ─────────────────────────────────────────────── */
.greeting-banner {
    background: linear-gradient(135deg, #0288d1 0%, #03a9f4 55%, #29b6f6 100%);
    border-radius: 16px;
    padding: 1.4rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(3,169,244,0.35);
    margin-bottom: 1.5rem;
}
.greeting-banner::after {
    content: '';
    position: absolute;
    right: -60px; top: -60px;
    width: 220px; height: 220px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    pointer-events: none;
}
.greeting-left { color: #fff; }
.greeting-title { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.3px; line-height: 1.2; }
.greeting-title i { margin-right: 0.45rem; opacity: 0.9; }
.greeting-date { font-size: 0.875rem; opacity: 0.72; margin-top: 0.2rem; }
.greeting-clock {
    color: #fff;
    font-size: 2.1rem;
    font-weight: 700;
    letter-spacing: 3px;
    font-variant-numeric: tabular-nums;
    opacity: 0.95;
    font-family: 'SF Mono', 'Consolas', monospace;
}

/* ── Timeline (tickets history) ────────────────────────────────────────────── */
.timeline { position: relative; padding-left: 1.5rem; }
.timeline::before { content: ''; position: absolute; left: 0.5rem; top: 0; bottom: 0; width: 2px; background: #4e5d72; }
.timeline-item { position: relative; margin-bottom: 1rem; }
.timeline-item::before { content: ''; position: absolute; left: -1.1rem; top: 0.5rem; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); border: 2px solid #fff; box-shadow: 0 0 0 2px #4e5d72; }

/* ── Auth layout ──────────────────────────────────────────────────────────── */
body.auth-body { margin:0; padding:0; min-height:100vh; background:#f0f4f8; }

.auth-split { display:flex; min-height:100vh; }

/* ── Brand panel (left) ── */
.auth-brand {
    flex: 0 0 44%;
    background: linear-gradient(150deg, #0a1628 0%, #0e2347 45%, #1a3c6e 80%, #1e4d8c 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}
.auth-brand::before {
    content: '';
    position: absolute;
    width: 500px; height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle at center, rgba(100,181,246,0.1) 0%, transparent 65%);
    top: -180px; right: -180px;
}
.auth-brand::after {
    content: '';
    position: absolute;
    width: 360px; height: 360px;
    border-radius: 50%;
    background: radial-gradient(circle at center, rgba(100,181,246,0.07) 0%, transparent 65%);
    bottom: -110px; left: -90px;
}
.auth-brand-inner { text-align:center; color:#fff; position:relative; z-index:1; max-width:310px; }
.auth-brand-icon {
    font-size: 3.75rem;
    margin-bottom: 1.25rem;
    line-height: 1;
    color: #64b5f6;
    filter: drop-shadow(0 4px 16px rgba(100,181,246,0.35));
}
.auth-brand-name  { font-size:2.25rem; font-weight:800; letter-spacing:-1.5px; margin:0 0 0.4rem; line-height:1.1; }
.auth-brand-name span { color:#64b5f6; }
.auth-brand-tagline { font-size:0.88rem; color:rgba(255,255,255,0.55); margin-bottom:2.5rem; }
.auth-brand-divider {
    width: 48px; height: 2px;
    background: linear-gradient(90deg, transparent, rgba(100,181,246,0.5), transparent);
    margin: 0 auto 2.5rem; border-radius:2px;
}
.auth-features { display:flex; flex-direction:column; gap:0.7rem; }
.auth-feature-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: rgba(255,255,255,0.72);
    padding: 0.65rem 1rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    text-align: left;
}
.auth-feature-item i { color:#64b5f6; font-size:1rem; width:18px; flex-shrink:0; }

/* ── Form panel (right) ── */
.auth-form-panel {
    flex: 1;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2.5rem;
}
.auth-form-inner {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 18px;
    padding: 2.5rem 2.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.07), 0 20px 40px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.05);
}
.auth-form-header { margin-bottom:2rem; }
.auth-form-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.3rem;
    letter-spacing: -0.5px;
    line-height: 1.2;
}
.auth-form-subtitle { color:#6b7280; font-size:0.9rem; margin:0; }
.auth-form-footer { font-size:0.77rem; color:#c4c9d4; margin-top:2rem; text-align:center; }

/* ── Auth form labels ── */
.auth-form-inner .form-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.4rem;
    display: block;
}

/* ── Positioned-icon input ── */
.auth-input-wrap { position:relative; }

.auth-input-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 0.9rem;
    z-index: 2;
    pointer-events: none;
    line-height: 1;
}

.auth-input {
    padding-left: 2.5rem !important;
    border-color: #e5e7eb !important;
    border-radius: 10px !important;
    font-size: 0.9rem;
    height: 44px;
    color: #111827;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(0,113,227,0.12) !important;
    outline: none;
}
.auth-input.is-invalid { border-color: #ef4444 !important; }
.auth-input.is-invalid:focus { box-shadow: 0 0 0 3px rgba(239,68,68,0.12) !important; }
.auth-input-pr { padding-right: 3rem !important; }

.auth-input-toggle {
    position: absolute;
    right: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0;
    color: #9ca3af;
    cursor: pointer;
    z-index: 2;
    line-height: 1;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    transition: color 0.12s;
}
.auth-input-toggle:hover { color: #4b5563; }

/* ── Auth submit button ── */
.auth-submit-btn {
    height: 46px;
    border-radius: 10px !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.2px;
    box-shadow: 0 2px 8px rgba(0,113,227,0.25) !important;
    transition: all 0.18s !important;
}
.auth-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0,113,227,0.35) !important;
}
.auth-submit-btn:active { transform: translateY(0); }

/* ── Responsive ── */
@media (max-width: 768px) {
    .auth-brand { display:none; }
    .auth-form-panel { background:#fff; padding:2rem 1.5rem; }
    .auth-form-inner { box-shadow:none; border:none; padding:1.5rem 0.5rem; }
}
