:root {
    --navy: #071b34;
    --navy-2: #0a2547;
    --blue: #07408c;
    --blue-2: #0b5bc4;
    --blue-soft: #eaf1fb;
    --green: #aac634;
    --green-dark: #7d9520;
    --paper: #f4f6fa;
    --panel: #ffffff;
    --ink: #152033;
    --muted: #6f7787;
    --line: #e5e9f0;
    --line-strong: #d7dde8;
    --danger: #d64545;
    --warning: #d8891c;
    --success: #2f8f5b;
    --radius: 16px;
    --sidebar: 270px;
    --shadow: 0 10px 30px rgba(15, 35, 65, 0.06);
    --shadow-lg: 0 20px 50px rgba(15, 35, 65, 0.12);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .brand strong {
    font-family: 'Poppins', 'Inter', sans-serif;
    letter-spacing: -0.02em;
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-2); }

/* App shell */
.app-shell { min-height: 100vh; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: var(--sidebar);
    padding: 24px 18px 18px;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(circle at 10% 0%, rgba(170, 198, 52, 0.16), transparent 28%),
        linear-gradient(180deg, #071b34 0%, #0a2547 100%);
    color: #fff;
    overflow-y: auto;
}

.sidebar-brand { padding: 4px 8px 26px; }

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}
.brand strong { display: block; font-size: 15px; line-height: 1.1; }
.brand small { display: block; margin-top: 4px; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.62; }
.brand-light { color: #fff; }
.brand-light:hover { color: #fff; }
.brand-dark { color: var(--ink); }
.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: linear-gradient(145deg, var(--green), #c5de52);
    color: var(--navy);
    font-weight: 800;
    font-size: 14px;
    letter-spacing: -0.04em;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25);
}

.sidebar-nav { display: flex; flex-direction: column; gap: 3px; padding-bottom: 20px; }
.nav-section {
    margin: 20px 12px 7px;
    color: rgba(255,255,255,0.38);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}
.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: 11px;
    color: rgba(255,255,255,0.72);
    font-size: 13px;
    font-weight: 500;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.sidebar-nav .nav-link i { font-size: 16px; width: 18px; text-align: center; opacity: 0.85; }
.sidebar-nav .nav-link:hover { color: #fff; background: rgba(255,255,255,0.07); }
.sidebar-nav .nav-link.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(170,198,52,0.20), rgba(170,198,52,0.07));
    box-shadow: inset 3px 0 0 var(--green);
}
.sidebar-nav .nav-link.active i { color: var(--green); opacity: 1; }

.sidebar-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 10px 4px;
    border-top: 1px solid rgba(255,255,255,0.10);
}
.user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: 50%;
    background: rgba(170,198,52,0.16);
    color: var(--green);
    font-weight: 700;
    font-size: 11px;
}
.user-avatar.sm { width: 30px; height: 30px; flex-basis: 30px; font-size: 10px; }
.user-meta { min-width: 0; flex: 1; }
.user-meta strong { display: block; font-size: 12px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta small { display: block; font-size: 10px; color: rgba(255,255,255,0.5); }
.logout-link { color: rgba(255,255,255,0.6); font-size: 17px; padding: 6px; border-radius: 8px; }
.logout-link:hover { color: #fff; background: rgba(255,255,255,0.08); }

.main {
    min-height: 100vh;
    margin-left: var(--sidebar);
    display: flex;
    flex-direction: column;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 16px;
    height: 78px;
    padding: 0 32px;
    background: rgba(255,255,255,0.92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
}
.topbar-title { flex: 1; min-width: 0; }
.topbar-eyebrow { display: block; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.topbar-title h1 { margin: 2px 0 0; font-size: 19px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--ink);
}
.btn-icon:hover { border-color: var(--line-strong); background: var(--paper); color: var(--blue); }
.notification-dot { position: absolute; top: 9px; right: 10px; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px #fff; }
.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 5px 10px 5px 5px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--ink);
    font-size: 12px;
    font-weight: 600;
}
.user-chip:hover { border-color: var(--line-strong); color: var(--blue); }

.content {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 30px 32px 42px;
}

/* Page headings */
.page-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}
.page-heading h2 { margin: 3px 0 6px; font-size: clamp(24px, 2.4vw, 32px); line-height: 1.1; }
.page-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.page-actions form { display: inline-flex; }
.eyebrow {
    margin: 0;
    color: var(--blue);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.eyebrow.light { color: var(--green); }

/* Buttons */
.btn { border-radius: 10px; font-weight: 600; font-size: 13px; padding: 9px 16px; }
.btn-lg { padding: 12px 20px; font-size: 14px; }
.btn-primary { --bs-btn-bg: var(--blue); --bs-btn-border-color: var(--blue); --bs-btn-hover-bg: #063574; --bs-btn-hover-border-color: #063574; --bs-btn-active-bg: #052e66; }
.btn-outline-primary { --bs-btn-color: var(--blue); --bs-btn-border-color: #b8c8df; --bs-btn-hover-bg: var(--blue); --bs-btn-hover-border-color: var(--blue); }
.btn-outline-secondary { --bs-btn-color: #4c5566; --bs-btn-border-color: var(--line-strong); --bs-btn-hover-bg: #eef1f6; --bs-btn-hover-border-color: #cbd3df; --bs-btn-hover-color: var(--ink); }
.btn-outline-danger { --bs-btn-color: var(--danger); --bs-btn-border-color: #efc4c4; --bs-btn-hover-bg: var(--danger); --bs-btn-hover-border-color: var(--danger); }

/* Stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
    position: relative;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.stat-card::after { content: ''; position: absolute; right: -30px; bottom: -50px; width: 110px; height: 110px; border-radius: 50%; background: var(--blue-soft); opacity: 0.6; }
.stat-card-primary { border-color: transparent; background: linear-gradient(145deg, #07408c, #0a2b5d); color: #fff; }
.stat-card-primary::after { background: rgba(170,198,52,0.18); opacity: 1; }
.stat-card-primary .stat-label, .stat-card-primary .stat-hint { color: rgba(255,255,255,0.66); }
.stat-card-primary .stat-value { color: #fff; }
.stat-icon { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 11px; margin-bottom: 16px; background: var(--blue-soft); color: var(--blue); font-size: 17px; }
.stat-icon.warning { background: #fff4e2; color: var(--warning); }
.stat-icon.danger { background: #fdeeee; color: var(--danger); }
.stat-card-primary .stat-icon { background: rgba(255,255,255,0.12); color: var(--green); }
.stat-label { position: relative; z-index: 1; display: block; color: var(--muted); font-size: 11px; font-weight: 600; }
.stat-value { position: relative; z-index: 1; display: block; margin: 4px 0 3px; font-family: 'Poppins', sans-serif; font-size: 24px; font-weight: 600; letter-spacing: -0.04em; }
.stat-hint { position: relative; z-index: 1; display: block; color: var(--muted); font-size: 10px; }

/* Panels */
.panel { min-width: 0; max-width: 100%; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); margin-bottom: 24px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.panel-head h3 { margin: 0 0 3px; font-size: 15px; font-weight: 600; }
.panel-head p { margin: 0; color: var(--muted); font-size: 11px; }
.panel-link { color: var(--blue); font-size: 11px; font-weight: 600; white-space: nowrap; }
.panel-link i { font-size: 10px; margin-left: 2px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 24px; }
.dashboard-grid > *,
.stat-grid > * { min-width: 0; }
.dashboard-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dashboard-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.chart-wrap { position: relative; height: 280px; }
.chart-wrap-doughnut { height: 250px; }
.panel-chart-sm { min-width: 0; }

/* Lists */
.list-stack { display: flex; flex-direction: column; }
.list-row { min-width: 0; display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--ink); }
.list-row:last-child { border-bottom: 0; }
.list-row:hover { color: var(--blue); }
.list-avatar { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex: 0 0 34px; border-radius: 10px; background: var(--blue-soft); color: var(--blue); font-size: 14px; }
.list-avatar.danger { background: #fdeeee; color: var(--danger); }
.list-main { min-width: 0; flex: 1; }
.list-main strong { display: block; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-main small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-side { flex: 0 0 auto; font-size: 11px; color: var(--muted); }
.empty-inline { padding: 16px 0; color: var(--muted); font-size: 12px; }

/* Activity */
.activity-feed { display: flex; flex-direction: column; gap: 15px; }
.activity-item { display: flex; gap: 12px; }
.activity-dot { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(170,198,52,0.14); flex: 0 0 8px; }
.activity-item div strong { font-size: 12px; }
.activity-item div { color: var(--muted); font-size: 11px; line-height: 1.55; }
.activity-item div small { display: block; margin-top: 2px; color: #9aa1ad; font-size: 9px; }

/* Quick actions */
.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quick-action { display: flex; align-items: center; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); font-size: 12px; font-weight: 600; background: #fff; transition: border-color .2s, background .2s, color .2s; }
.quick-action i { color: var(--blue); font-size: 16px; }
.quick-action:hover { border-color: #b9c9df; background: var(--blue-soft); color: var(--blue); }

/* Tables */
.panel-table { padding: 0; overflow: hidden; }
.panel-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.search-form { position: relative; display: flex; align-items: center; flex: 1; max-width: 380px; }
.search-form > i { position: absolute; left: 13px; color: #9aa1ad; font-size: 13px; }
.search-form input { width: 100%; padding: 10px 36px 10px 36px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfe; font-size: 12px; outline: none; }
.search-form input:focus { border-color: #a9bfdd; background: #fff; box-shadow: 0 0 0 3px rgba(7,64,140,0.08); }
.search-clear { position: absolute; right: 10px; color: #9aa1ad; font-size: 11px; }
.toolbar-meta { color: var(--muted); font-size: 11px; white-space: nowrap; }
.app-table { margin: 0; }
.app-table thead th { padding: 12px 18px; border-bottom: 1px solid var(--line); background: #fafbfd; color: #858d9c; font-size: 9px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; white-space: nowrap; }
.app-table tbody td { padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: 12px; vertical-align: middle; }
.app-table tbody tr:last-child td { border-bottom: 0; }
.app-table tbody tr:hover { background: #fbfcff; }
.table-title { color: var(--ink); font-weight: 600; }
.table-title:hover { color: var(--blue); }
.panel-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 22px; border-top: 1px solid var(--line); }
.pagination { margin: 0; }
.page-link { border: 0; color: var(--ink); font-size: 11px; padding: 7px 11px; border-radius: 8px !important; }
.page-item.active .page-link { background: var(--blue); color: #fff; }
.page-item.disabled .page-link { color: #b9bec8; background: transparent; }

/* Empty and error states */
.empty-state, .error-state { text-align: center; padding: 64px 24px; }
.empty-icon { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; margin-bottom: 16px; border-radius: 18px; background: var(--blue-soft); color: var(--blue); font-size: 26px; }
.empty-state h3, .error-state h2 { margin: 0 0 6px; font-size: 18px; }
.empty-state p, .error-state p { margin: 0 0 18px; color: var(--muted); font-size: 12px; }
.error-code { display: block; margin-bottom: 10px; color: var(--blue); font-family: 'Poppins', sans-serif; font-size: 56px; font-weight: 700; line-height: 1; }

/* Badges */
.badge-soft { padding: 0.45em 0.7em; border-radius: 999px; font-size: 9px; font-weight: 700; letter-spacing: 0.02em; }
.text-bg-success.badge-soft { background: #e8f6ee !important; color: #1d6b43 !important; }
.text-bg-warning.badge-soft { background: #fff4e2 !important; color: #a55e09 !important; }
.text-bg-danger.badge-soft { background: #fdeaea !important; color: #b02f2f !important; }
.text-bg-info.badge-soft { background: #eaf1fb !important; color: #17569f !important; }
.text-bg-secondary.badge-soft { background: #eef0f4 !important; color: #5e6573 !important; }

/* Forms */
.form-panel { padding: 28px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.form-field-wide { grid-column: 1 / -1; }
.form-label { margin-bottom: 6px; color: #3c4555; font-size: 12px; font-weight: 600; }
.required { color: var(--danger); }
.form-control, .form-select { min-height: 42px; padding: 9px 13px; border-color: var(--line-strong); border-radius: 10px; font-size: 13px; color: var(--ink); }
.form-control:focus, .form-select:focus { border-color: #9db6da; box-shadow: 0 0 0 3px rgba(7,64,140,0.08); }
textarea.form-control { min-height: 100px; }
.form-text { margin-top: 5px; color: var(--muted); font-size: 10px; }
.invalid-feedback { font-size: 10px; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.form-panel-flat { padding: 0; border: 0; box-shadow: none; margin: 0; }
.form-panel-flat .form-actions { margin-top: 18px; }
.password-field { position: relative; }
.password-field .form-control { padding-right: 44px; }
.password-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); }
.password-toggle:hover { background: var(--paper); color: var(--blue); }

/* Detail pages */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.panel-side { position: sticky; top: 102px; }
.detail-list { display: flex; flex-direction: column; }
.detail-row { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.detail-row:last-child { border-bottom: 0; }
.detail-row dt { color: var(--muted); font-size: 11px; font-weight: 600; }
.detail-row dd { margin: 0; font-size: 12px; color: var(--ink); overflow-wrap: anywhere; }
.detail-text { line-height: 1.7; }

/* Invoice */
.invoice-panel { padding: 34px; }
.invoice-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.invoice-brand { display: block; margin-bottom: 6px; color: var(--blue); font-family: 'Poppins', sans-serif; font-size: 16px; font-weight: 600; }
.invoice-header p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.invoice-client { padding: 24px 0; }
.invoice-client span { display: block; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.invoice-client strong { display: block; margin-top: 4px; font-size: 15px; }
.invoice-client p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.invoice-table th { color: var(--muted); font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; border-bottom: 1px solid var(--line); }
.invoice-table td { font-size: 12px; border-bottom: 1px solid var(--line); }
.invoice-totals { width: min(320px, 100%); margin-left: auto; padding-top: 18px; }
.invoice-totals div { display: flex; justify-content: space-between; gap: 20px; padding: 5px 0; color: var(--muted); font-size: 12px; }
.invoice-totals strong { color: var(--ink); }
.invoice-total { margin-top: 8px; padding-top: 12px !important; border-top: 1px solid var(--line); font-size: 15px !important; }
.invoice-total strong { color: var(--blue); font-size: 18px; }
.invoice-notes { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.6; }
.invoice-items-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin: 24px 0 12px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}
.invoice-items-head h3 { margin: 0 0 3px; font-size: 15px; }
.invoice-items-head p { margin: 0; color: var(--muted); font-size: 11px; }
.invoice-items { display: flex; flex-direction: column; gap: 10px; }
.invoice-item-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 90px 130px 110px 36px;
    gap: 10px;
    align-items: end;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fbfcfe;
}
.invoice-item-row .form-label { margin-bottom: 4px; font-size: 10px; }
.invoice-item-row .form-control { min-height: 38px; padding: 7px 10px; font-size: 12px; }
.invoice-item-total .line-total {
    display: flex;
    align-items: center;
    min-height: 38px;
    color: var(--blue);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.invoice-item-remove {
    align-self: end;
    width: 36px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    color: var(--muted);
}
.invoice-item-remove:hover { background: #fdeeee; border-color: #efc4c4; color: var(--danger); }
.invoice-preview { display: flex; align-items: center; justify-content: flex-end; gap: 26px; margin-top: 22px; padding: 16px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.invoice-preview div { display: flex; flex-direction: column; gap: 2px; min-width: 92px; }
.invoice-preview span { color: var(--muted); font-size: 10px; }
.invoice-preview strong { font-size: 13px; }
.invoice-preview-total strong { color: var(--blue); font-size: 17px; }

/* Tickets */
.ticket-thread { display: flex; flex-direction: column; gap: 14px; }
.ticket-message { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcfe; }
.ticket-message.internal { background: #fff9ea; border-color: #f1dfb5; }
.ticket-message-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.ticket-message-head strong { display: block; font-size: 12px; }
.ticket-message-head small { display: block; color: var(--muted); font-size: 9px; }
.ticket-message-body { color: #3c4555; font-size: 12px; line-height: 1.7; }
.ticket-reply { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.ticket-reply-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 12px; }
.ticket-reply-actions .form-check { margin: 0; color: var(--muted); font-size: 11px; }

/* Auth */
.auth-body { background: var(--navy); }
.auth-shell { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); min-height: 100vh; }
.auth-brand-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 52px;
    color: #fff;
    background:
        radial-gradient(circle at 15% 15%, rgba(170,198,52,0.20), transparent 30%),
        radial-gradient(circle at 85% 80%, rgba(11,91,196,0.34), transparent 36%),
        linear-gradient(145deg, #071b34 0%, #0a2b5d 100%);
    overflow: hidden;
}
.auth-brand-panel::after { content: ''; position: absolute; right: -120px; bottom: -160px; width: 460px; height: 460px; border: 1px solid rgba(255,255,255,0.08); border-radius: 50%; }
.auth-brand-top { position: relative; z-index: 1; }
.auth-brand-copy { position: relative; z-index: 1; max-width: 520px; margin: auto 0; padding: 60px 0; }
.auth-brand-copy h1 { margin: 12px 0 20px; font-size: clamp(34px, 4.2vw, 58px); line-height: 1.02; letter-spacing: -0.05em; }
.auth-brand-copy > p:not(.eyebrow) { max-width: 46ch; color: rgba(255,255,255,0.66); font-size: 14px; line-height: 1.8; }
.auth-brand-stats { display: flex; gap: 30px; margin-top: 38px; }
.auth-brand-stats div { display: flex; flex-direction: column; }
.auth-brand-stats strong { font-family: 'Poppins', sans-serif; font-size: 22px; color: var(--green); }
.auth-brand-stats span { margin-top: 2px; color: rgba(255,255,255,0.45); font-size: 9px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }
.auth-brand-footer { position: relative; z-index: 1; color: rgba(255,255,255,0.35); font-size: 10px; }
.auth-form-panel { display: flex; align-items: center; justify-content: center; padding: 40px; background: #f7f9fc; }
.auth-form-wrap { width: 100%; max-width: 410px; padding: 36px; border: 1px solid var(--line); border-radius: 22px; background: #fff; box-shadow: var(--shadow-lg); }
.auth-heading { margin-bottom: 24px; }
.auth-heading h2 { margin: 6px 0 5px; font-size: 26px; }
.auth-heading p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 12px; }
.auth-form .form-label { font-size: 11px; }
.auth-form .form-control { min-height: 48px; }
.auth-help { display: flex; align-items: flex-start; gap: 8px; margin-top: 18px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.auth-help i { color: var(--blue); font-size: 13px; }
.auth-help a { color: var(--blue); font-weight: 600; text-decoration: none; }
.auth-help a:hover { text-decoration: underline; }
.auth-help-split { flex-direction: column; gap: 6px; }
.auth-fallback { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--paper); }
.auth-fallback-card { width: 100%; max-width: 560px; padding: 32px; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: var(--shadow-lg); }

/* Offcanvas */
.sidebar-mobile { background: var(--navy); color: #fff; }
.sidebar-mobile .offcanvas-header { padding: 18px 20px; border-bottom: 1px solid rgba(255,255,255,0.10); }
.sidebar-mobile .sidebar-nav { padding: 0 18px 20px; }
.sidebar-mobile .sidebar-footer { margin: 0 18px; }


/* Social calendar */
.calendar-panel { padding: 24px; }
.calendar-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 18px; color: var(--muted); font-size: 11px; }
.legend-dot { display: inline-block; width: 9px; height: 9px; margin-right: 5px; border-radius: 3px; }
#socialCalendar { font-size: 12px; }
#socialCalendar .fc-toolbar-title { font-family: 'Poppins', sans-serif; font-size: 17px; font-weight: 600; letter-spacing: -0.03em; }
#socialCalendar .fc-button { padding: 6px 10px; border-radius: 8px; background: var(--blue); border-color: var(--blue); font-size: 11px; font-weight: 600; text-transform: capitalize; box-shadow: none; }
#socialCalendar .fc-button:hover, #socialCalendar .fc-button-active { background: #052e66 !important; border-color: #052e66 !important; }
#socialCalendar .fc-daygrid-event { border-radius: 5px; padding: 2px 4px; font-size: 9px; }
#socialCalendar .fc-col-header-cell-cushion { color: var(--muted); font-size: 10px; font-weight: 600; text-transform: uppercase; }
#socialCalendar .fc-daygrid-day-number { color: var(--muted); font-size: 10px; }
#socialCalendar .fc-scrollgrid { border-color: var(--line); }
#socialCalendar .fc-theme-standard td, #socialCalendar .fc-theme-standard th { border-color: var(--line); }

/* Responsive */
@media (max-width: 1280px) {
    .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .dashboard-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 991.98px) {
    .main { margin-left: 0; }
    .topbar { padding: 0 20px; height: 70px; }
    .content { padding: 22px 20px 36px; }
    .detail-grid { grid-template-columns: 1fr; }
    .panel-side { position: static; }
}
@media (max-width: 767.98px) {
    .invoice-items-head { flex-direction: column; align-items: flex-start; }
    .invoice-item-row { grid-template-columns: 1fr 1fr; }
    .invoice-item-description { grid-column: 1 / -1; }
    .invoice-item-remove { grid-column: 2; justify-self: end; }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-grid-3, .dashboard-grid-2 { grid-template-columns: 1fr; }
    .page-heading { flex-direction: column; gap: 14px; }
    .page-actions { width: 100%; justify-content: flex-start; }
    .form-grid { grid-template-columns: 1fr; }
    .form-field-wide { grid-column: auto; }
    .panel { padding: 18px; }
    .panel-table { padding: 0; }
    .panel-toolbar { flex-direction: column; align-items: stretch; }
    .search-form { max-width: none; }
    .panel-footer { flex-direction: column; align-items: flex-start; }
    .auth-shell { grid-template-columns: 1fr; }
    .auth-brand-panel { display: none; }
    .auth-form-panel { min-height: 100vh; padding: 24px; background: var(--navy); }
    .auth-form-wrap { padding: 26px 22px; }
    .invoice-header { flex-direction: column; }
    .invoice-panel { padding: 22px; }
    .ticket-reply-actions { flex-direction: column; align-items: stretch; }
    .ticket-reply-actions .btn { width: 100%; }
    .detail-row { grid-template-columns: 105px minmax(0, 1fr); }
}
@media (max-width: 575.98px) {
    .stat-grid { grid-template-columns: 1fr; }
    .content { padding: 18px 15px 32px; }
    .topbar { padding: 0 15px; }
    .topbar-title h1 { font-size: 17px; }
    .quick-grid { grid-template-columns: 1fr; }
    .invoice-preview { flex-direction: column; align-items: stretch; gap: 10px; }
    .invoice-preview div { flex-direction: row; justify-content: space-between; min-width: 0; }
}
