@font-face {
    font-family: 'Plus Jakarta Sans';
    src: url('../fonts/plus-jakarta-sans-latin-400-normal.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Plus Jakarta Sans';
    src: url('../fonts/plus-jakarta-sans-latin-500-normal.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Plus Jakarta Sans';
    src: url('../fonts/plus-jakarta-sans-latin-600-normal.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Plus Jakarta Sans';
    src: url('../fonts/plus-jakarta-sans-latin-700-normal.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Plus Jakarta Sans';
    src: url('../fonts/plus-jakarta-sans-latin-800-normal.woff2') format('woff2');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

:root {
    --app-font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --brand-1: #4f46e5;
    --brand-2: #0ea5e9;
    --brand-3: #14b8a6;
    --brand-soft: rgba(79, 70, 229, .10);
    --app-bg: #f3f6fc;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --surface-3: #eef2f9;
    --border: #e4e9f3;
    --text: #0f172a;
    --muted: #667085;
    --shadow-sm: 0 4px 14px rgba(15, 23, 42, .05);
    --shadow: 0 16px 40px rgba(15, 23, 42, .08);
    --radius: 18px;
    --radius-sm: 12px;
    --sidebar-w: 276px;
    --sidebar-collapsed: 88px;
    --topbar-h: 78px;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #0ea5e9;
}

[data-bs-theme="dark"] {
    --brand-soft: rgba(99, 102, 241, .20);
    --app-bg: #080f1c;
    --surface: #0f1a2e;
    --surface-2: #0b1426;
    --surface-3: #152238;
    --border: #1e2e4a;
    --text: #e8eefb;
    --muted: #93a3bd;
    --shadow-sm: 0 4px 14px rgba(0, 0, 0, .28);
    --shadow: 0 18px 44px rgba(0, 0, 0, .42);
}

* { box-sizing: border-box; }

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

body {
    font-family: var(--app-font);
    background: var(--app-bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    letter-spacing: -.01em;
}

body.app-body {
    background:
        radial-gradient(1100px 500px at 105% -10%, rgba(14, 165, 233, .08), transparent 60%),
        radial-gradient(900px 420px at -5% 105%, rgba(79, 70, 229, .08), transparent 60%),
        var(--app-bg);
    min-height: 100vh;
}

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

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted) 28%, transparent); border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }

/* =========================================================
   Sidebar
   ========================================================= */
.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: width .28s cubic-bezier(.2, .7, .2, 1), transform .28s cubic-bezier(.2, .7, .2, 1);
    overflow: hidden;
    box-shadow: 6px 0 24px rgba(15, 23, 42, .03);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 20px 18px;
    min-height: var(--topbar-h);
    white-space: nowrap;
}

.brand-mark {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 22px;
    background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
    box-shadow: 0 10px 22px rgba(79, 70, 229, .35);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.05; overflow: hidden; }
.brand-text strong { font-size: 14px; font-weight: 800; letter-spacing: .01em; }
.brand-text span { font-size: 10px; letter-spacing: .28em; color: var(--brand-2); font-weight: 700; margin-top: 4px; }

.sidebar-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 8px 14px 18px; }
.sidebar-section { font-size: 10px; text-transform: uppercase; letter-spacing: .18em; color: var(--muted); font-weight: 700; padding: 18px 12px 8px; white-space: nowrap; }

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 11px 13px;
    border-radius: 13px;
    color: var(--muted);
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 3px;
    white-space: nowrap;
    transition: background .18s ease, color .18s ease, transform .18s ease;
    position: relative;
}
.sidebar-link i { font-size: 19px; min-width: 22px; text-align: center; }
.sidebar-link:hover { background: var(--surface-3); color: var(--text); transform: translateX(2px); }
.sidebar-link.active {
    color: #fff;
    background: var(--brand-1);
    box-shadow: 0 10px 24px rgba(79, 70, 229, .28);
}
.sidebar-link.active::after {
    content: '';
    position: absolute;
    right: 12px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
}

.sidebar-footer { padding: 12px 16px 18px; border-top: 1px solid var(--border); }
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px;
    border-radius: 14px;
    background: var(--surface-2);
    white-space: nowrap;
    overflow: hidden;
}
.sidebar-user .meta { min-width: 0; }
.sidebar-user .meta strong { display: block; font-size: 13px; text-overflow: ellipsis; overflow: hidden; }
.sidebar-user .meta span { display: block; font-size: 11px; color: var(--muted); text-overflow: ellipsis; overflow: hidden; }

body.sidebar-collapsed .app-sidebar { width: var(--sidebar-collapsed); }
body.sidebar-collapsed .sidebar-text,
body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .sidebar-section,
body.sidebar-collapsed .sidebar-user .meta,
body.sidebar-collapsed .sidebar-collapse-label { display: none; }
body.sidebar-collapsed .sidebar-brand { justify-content: center; padding-inline: 0; }
body.sidebar-collapsed .sidebar-link { justify-content: center; padding-inline: 0; }
body.sidebar-collapsed .sidebar-link i { font-size: 21px; }
body.sidebar-collapsed .sidebar-link.active::after { display: none; }
body.sidebar-collapsed .sidebar-user { justify-content: center; background: transparent; padding: 4px; }
body.sidebar-collapsed .sidebar-footer { padding-inline: 12px; }
body.sidebar-collapsed .app-main { margin-left: var(--sidebar-collapsed); }

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(4, 10, 22, .55);
    backdrop-filter: blur(2px);
    z-index: 1035;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
}

/* =========================================================
   Main / topbar
   ========================================================= */
.app-main {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left .28s cubic-bezier(.2, .7, .2, 1);
}

.app-topbar {
    height: var(--topbar-h);
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 28px;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface) 82%, transparent);
    backdrop-filter: blur(14px);
}

.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.topbar-title { font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title span { color: var(--brand-2); }
.topbar-right { display: flex; align-items: center; gap: 10px; }

.icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    display: inline-grid;
    place-items: center;
    font-size: 19px;
    transition: all .18s ease;
    position: relative;
}
.icon-btn:hover { color: var(--brand-1); border-color: color-mix(in srgb, var(--brand-1) 35%, var(--border)); background: var(--brand-soft); transform: translateY(-1px); }
.icon-btn .badge-dot { position: absolute; top: 9px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); }

.user-dropdown {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 10px 5px 5px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    color: var(--text);
    transition: all .18s ease;
}
.user-dropdown:hover { border-color: color-mix(in srgb, var(--brand-1) 35%, var(--border)); background: var(--brand-soft); color: var(--text); }
.user-dropdown .name { font-size: 13px; font-weight: 700; line-height: 1.1; }
.user-dropdown .role { font-size: 10px; color: var(--muted); line-height: 1.2; }

.avatar {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 12px;
    display: inline-grid;
    place-items: center;
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, var(--brand-1), var(--brand-3));
    overflow: hidden;
    letter-spacing: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 30px; height: 30px; min-width: 30px; border-radius: 9px; font-size: 10px; }
.avatar-lg { width: 48px; height: 48px; min-width: 48px; border-radius: 15px; font-size: 15px; }

.app-content { padding: 28px; flex: 1; width: 100%; max-width: 1680px; margin: 0 auto; }

/* =========================================================
   Components
   ========================================================= */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(1.45rem, 2vw, 1.9rem); font-weight: 800; margin: 0 0 4px; letter-spacing: -.03em; }
.page-head p { margin: 0; color: var(--muted); font-size: 14px; }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.card-surface {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.card-surface .card-head { padding: 20px 22px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-surface .card-head h2, .card-surface .card-head h3 { font-size: 16px; font-weight: 800; margin: 0; letter-spacing: -.02em; }
.card-surface .card-body { padding: 20px 22px; }
.card-surface .card-foot { padding: 0 22px 20px; }

.stat-card {
    position: relative;
    padding: 20px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    height: 100%;
    transition: transform .2s ease, box-shadow .2s ease;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.stat-card::after { content: ''; position: absolute; inset: auto -30px -45px auto; width: 120px; height: 120px; border-radius: 50%; background: var(--brand-soft); pointer-events: none; }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; position: relative; z-index: 1; }
.stat-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 21px; color: #fff; background: linear-gradient(135deg, var(--brand-1), var(--brand-2)); box-shadow: 0 8px 18px rgba(79, 70, 229, .25); }
.stat-icon.teal { background: linear-gradient(135deg, #0d9488, #2dd4bf); box-shadow: 0 8px 18px rgba(13, 148, 136, .22); }
.stat-icon.amber { background: linear-gradient(135deg, #d97706, #fbbf24); box-shadow: 0 8px 18px rgba(217, 119, 6, .22); }
.stat-icon.rose { background: linear-gradient(135deg, #e11d48, #fb7185); box-shadow: 0 8px 18px rgba(225, 29, 72, .22); }
.stat-icon.slate { background: linear-gradient(135deg, #475569, #94a3b8); box-shadow: 0 8px 18px rgba(71, 85, 105, .22); }
.stat-value { font-size: 30px; font-weight: 800; letter-spacing: -.04em; margin-top: 14px; position: relative; z-index: 1; }
.stat-label { font-size: 12px; color: var(--muted); font-weight: 600; position: relative; z-index: 1; }
.stat-trend { font-size: 11px; font-weight: 700; color: var(--success); margin-top: 8px; position: relative; z-index: 1; }

.btn { font-family: var(--app-font); font-weight: 700; border-radius: 12px; padding: .62rem 1rem; font-size: 13.5px; transition: all .18s ease; }
.btn-brand { color: #fff; border: 0; background: var(--brand-1); box-shadow: 0 10px 22px rgba(79, 70, 229, .25); }
.btn-brand:hover, .btn-brand:focus { color: #fff; background: #4338ca; transform: translateY(-1px); box-shadow: 0 14px 28px rgba(79, 70, 229, .32); }
.btn-soft { background: var(--brand-soft); color: var(--brand-1); border: 1px solid transparent; }
.btn-soft:hover { background: color-mix(in srgb, var(--brand-1) 18%, transparent); color: var(--brand-1); }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }
.btn-danger-soft { background: rgba(239, 68, 68, .1); color: var(--danger); border: 1px solid transparent; }
.btn-danger-soft:hover { background: rgba(239, 68, 68, .18); color: var(--danger); }
.btn-icon { width: 38px; height: 38px; padding: 0; display: inline-grid; place-items: center; border-radius: 11px; }

.badge { font-weight: 700; border-radius: 99px; padding: .42em .72em; font-size: 10.5px; letter-spacing: .01em; }
.badge-status { display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent; }
.badge-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-open { color: #0369a1; background: #e0f2fe; border-color: #bae6fd; }
.status-progress { color: #6d28d9; background: #ede9fe; border-color: #ddd6fe; }
.status-waiting { color: #b45309; background: #fef3c7; border-color: #fde68a; }
.status-closed { color: #047857; background: #d1fae5; border-color: #a7f3d0; }
[data-bs-theme="dark"] .status-open { color: #7dd3fc; background: rgba(14, 165, 233, .16); border-color: rgba(14, 165, 233, .35); }
[data-bs-theme="dark"] .status-progress { color: #c4b5fd; background: rgba(139, 92, 246, .16); border-color: rgba(139, 92, 246, .35); }
[data-bs-theme="dark"] .status-waiting { color: #fcd34d; background: rgba(245, 158, 11, .16); border-color: rgba(245, 158, 11, .35); }
[data-bs-theme="dark"] .status-closed { color: #6ee7b7; background: rgba(16, 185, 129, .16); border-color: rgba(16, 185, 129, .35); }

.priority-low { color: #475569; background: var(--surface-3); }
.priority-normal { color: #0369a1; background: rgba(14, 165, 233, .12); }
.priority-high { color: #b45309; background: rgba(245, 158, 11, .15); }
.priority-urgent { color: #b91c1c; background: rgba(239, 68, 68, .14); }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); font-size: 11px; font-weight: 600; color: var(--muted); }
.chip i { font-size: 13px; }

.table-modern { margin: 0; --bs-table-bg: transparent; --bs-table-color: var(--text); }
.table-modern thead th { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 800; border-bottom: 1px solid var(--border); padding: 12px 14px; white-space: nowrap; background: var(--surface-2); }
.table-modern tbody td { padding: 14px; border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent); vertical-align: middle; font-size: 13px; }
.table-modern tbody tr { transition: background .15s ease; }
.table-modern tbody tr:hover { background: var(--surface-2); }
.table-modern tbody tr:last-child td { border-bottom: 0; }
.table-modern tr[data-href] { cursor: pointer; }
.table-modern .cell-title { font-weight: 700; color: var(--text); }
.table-modern .cell-sub { font-size: 11.5px; color: var(--muted); }
.table-modern .table-actions { display: flex; gap: 6px; justify-content: flex-end; }
.table-responsive { border-radius: var(--radius); }

.filter-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.filter-bar .search-wrap { position: relative; flex: 1; min-width: 210px; max-width: 360px; }
.filter-bar .search-wrap i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 17px; }
.filter-bar .search-wrap input { padding-left: 42px; }
.form-control, .form-select {
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    padding: .68rem .9rem;
    font-size: 13.5px;
    font-family: var(--app-font);
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.form-control:focus, .form-select:focus {
    border-color: color-mix(in srgb, var(--brand-1) 55%, var(--border));
    box-shadow: 0 0 0 4px var(--brand-soft);
    background: var(--surface);
    color: var(--text);
}
.form-control::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
.form-label { font-size: 12px; font-weight: 700; color: var(--text); margin-bottom: 7px; }
.form-label .req { color: var(--danger); margin-left: 2px; }
.form-text { font-size: 11.5px; color: var(--muted); }
.form-check-input { border-radius: 6px; border-color: var(--border); }
.form-check-input:checked { background-color: var(--brand-1); border-color: var(--brand-1); }
.form-check-input:focus { box-shadow: 0 0 0 4px var(--brand-soft); }
.form-switch .form-check-input { width: 2.6em; height: 1.35em; }
.input-icon { position: relative; }
.input-icon > i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 17px; pointer-events: none; }
.input-icon > .form-control, .input-icon > .form-select { padding-left: 42px; }
.input-icon .toggle-pass { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--muted); font-size: 17px; }
.invalid-feedback { font-size: 11.5px; font-weight: 600; }
.is-invalid { border-color: var(--danger) !important; box-shadow: 0 0 0 4px rgba(239, 68, 68, .08) !important; }
.error-text { display: block; min-height: 16px; color: var(--danger); font-size: 11.5px; font-weight: 600; margin-top: 5px; }

.drop-zone { border: 1.5px dashed var(--border); border-radius: 14px; padding: 22px; text-align: center; background: var(--surface-2); transition: all .18s ease; cursor: pointer; }
.drop-zone:hover, .drop-zone.dragover { border-color: var(--brand-1); background: var(--brand-soft); }
.drop-zone i { font-size: 30px; color: var(--brand-1); }
.drop-zone strong { display: block; font-size: 13px; margin-top: 6px; }
.drop-zone span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.nav-tabs-modern { display: flex; gap: 8px; flex-wrap: wrap; border: 0; padding: 4px; background: var(--surface-2); border-radius: 14px; }
.nav-tabs-modern .nav-link { border: 0; border-radius: 11px; color: var(--muted); font-size: 12.5px; font-weight: 700; padding: 9px 14px; }
.nav-tabs-modern .nav-link:hover { color: var(--text); background: color-mix(in srgb, var(--surface) 70%, transparent); }
.nav-tabs-modern .nav-link.active { color: #fff; background: var(--brand-1); box-shadow: 0 8px 18px rgba(79, 70, 229, .22); }

.pagination { gap: 5px; margin: 0; }
.page-link { border: 1px solid var(--border); border-radius: 10px !important; color: var(--muted); font-size: 12.5px; font-weight: 700; min-width: 36px; text-align: center; padding: .48rem .65rem; background: var(--surface); }
.page-link:hover { color: var(--brand-1); background: var(--brand-soft); border-color: transparent; }
.page-item.active .page-link { background: var(--brand-1); border-color: transparent; color: #fff; }
.page-item.disabled .page-link { background: var(--surface-2); color: var(--muted); opacity: .55; }

.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-state .icon { width: 74px; height: 74px; border-radius: 22px; display: grid; place-items: center; margin: 0 auto 16px; font-size: 32px; color: var(--brand-1); background: var(--brand-soft); }
.empty-state h3 { font-size: 16px; color: var(--text); font-weight: 800; margin-bottom: 5px; }
.empty-state p { font-size: 13px; margin-bottom: 18px; }

/* =========================================================
   Rich content & timeline
   ========================================================= */
.rich-content { font-size: 13.5px; line-height: 1.7; color: var(--text); word-wrap: break-word; }
.rich-content > :first-child { margin-top: 0; }
.rich-content > :last-child { margin-bottom: 0; }
.rich-content h1, .rich-content h2, .rich-content h3, .rich-content h4 { font-weight: 800; letter-spacing: -.02em; margin: 1.1em 0 .5em; }
.rich-content h1 { font-size: 1.45rem; }
.rich-content h2 { font-size: 1.25rem; }
.rich-content h3 { font-size: 1.1rem; }
.rich-content p { margin: 0 0 .85em; }
.rich-content ul, .rich-content ol { margin: 0 0 .9em; padding-left: 1.35em; }
.rich-content li { margin-bottom: .3em; }
.rich-content blockquote { border-left: 4px solid var(--brand-2); margin: 1em 0; padding: .6em 1em; background: var(--surface-2); border-radius: 0 12px 12px 0; color: var(--muted); }
.rich-content code { background: var(--surface-3); color: var(--brand-1); padding: .15em .4em; border-radius: 6px; font-size: .9em; }
.rich-content pre { background: #0b1426; color: #dbeafe; padding: 14px 16px; border-radius: 12px; overflow-x: auto; }
.rich-content pre code { background: transparent; color: inherit; padding: 0; }
.rich-content img { max-width: 100%; height: auto; border-radius: 12px; margin: 6px 0; }
.rich-content table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: 13px; }
.rich-content table th, .rich-content table td { border: 1px solid var(--border); padding: 8px 10px; }
.rich-content table th { background: var(--surface-2); font-weight: 800; }
.rich-content a { font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.rich-content hr { border-color: var(--border); opacity: .8; }

.timeline { position: relative; padding-left: 30px; }
.timeline::before { content: ''; position: absolute; left: 14px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(to bottom, var(--brand-2), var(--border)); opacity: .35; }
.timeline-item { position: relative; margin-bottom: 20px; }
.timeline-item:last-child { margin-bottom: 0; }
.timeline-dot { position: absolute; left: -30px; top: 2px; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); color: var(--brand-1); font-size: 13px; z-index: 1; }
.timeline-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; }
.timeline-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.timeline-head .who { font-size: 12.5px; font-weight: 800; }
.timeline-head .when { font-size: 11px; color: var(--muted); }
.timeline-body { font-size: 13px; }
.timeline-attachments { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.attachment-pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-size: 11.5px; color: var(--text); }
.attachment-pill:hover { border-color: var(--brand-1); color: var(--brand-1); }

.detail-list { display: grid; gap: 14px; }
.detail-list .item { display: flex; gap: 10px; align-items: flex-start; }
.detail-list .item i { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--brand-1); font-size: 15px; flex-shrink: 0; }
.detail-list .label { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 800; }
.detail-list .value { font-size: 12.5px; font-weight: 600; }

.chart-box { position: relative; height: 280px; }
.chart-box.sm { height: 220px; }
.chart-box canvas { max-width: 100%; }

/* =========================================================
   Auth
   ========================================================= */
.auth-body {
    min-height: 100vh;
    background:
        radial-gradient(900px 500px at 8% 10%, rgba(79, 70, 229, .35), transparent 60%),
        radial-gradient(800px 520px at 92% 90%, rgba(14, 165, 233, .28), transparent 60%),
        #070d19;
    color: #e8eefb;
    display: grid;
    place-items: center;
    padding: 24px;
}
.auth-shell { width: 100%; max-width: 1050px; display: grid; grid-template-columns: 1.05fr .95fr; background: rgba(15, 26, 46, .72); border: 1px solid rgba(148, 163, 184, .18); border-radius: 28px; overflow: hidden; box-shadow: 0 40px 90px rgba(0, 0, 0, .45); backdrop-filter: blur(18px); }
.auth-shell-single { max-width: 470px; grid-template-columns: 1fr; }
.auth-shell-single .auth-form-wrap { padding: 42px; }
.auth-simple-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 30px; }
.auth-simple-brand strong { display: block; color: #fff; font-size: 15px; font-weight: 800; letter-spacing: .02em; line-height: 1.1; }
.auth-simple-brand small { display: block; color: #7dd3fc; font-size: 10px; font-weight: 700; letter-spacing: .26em; margin-top: 5px; }
.auth-form-wrap a { color: #7dd3fc; }
.auth-form-wrap a:hover { color: #bae6fd; }
.auth-hero { position: relative; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; background: linear-gradient(145deg, rgba(79, 70, 229, .35), rgba(14, 165, 233, .16)); }
.auth-hero::before, .auth-hero::after { content: ''; position: absolute; border-radius: 50%; filter: blur(2px); opacity: .5; }
.auth-hero::before { width: 280px; height: 280px; right: -90px; top: -90px; background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.28), transparent 60%); }
.auth-hero::after { width: 220px; height: 220px; left: -80px; bottom: -80px; background: radial-gradient(circle at 60% 40%, rgba(20, 184, 166, .45), transparent 60%); }
.auth-hero .brand { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.auth-hero .brand .brand-mark { box-shadow: 0 12px 26px rgba(0,0,0,.28); }
.auth-hero h1 { position: relative; z-index: 1; font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 800; letter-spacing: -.04em; line-height: 1.08; margin: 34px 0 16px; }
.auth-hero p { position: relative; z-index: 1; color: rgba(232, 238, 251, .72); font-size: 14px; line-height: 1.7; max-width: 340px; }
.auth-features { position: relative; z-index: 1; display: grid; gap: 12px; margin-top: 30px; }
.auth-features .feature { display: flex; align-items: center; gap: 11px; font-size: 12.5px; color: rgba(232, 238, 251, .82); }
.auth-features .feature i { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.12); color: #7dd3fc; }
.auth-form-wrap { padding: 48px; background: rgba(8, 15, 28, .55); display: flex; flex-direction: column; justify-content: center; }
.auth-form-wrap h2 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.03em; margin-bottom: 6px; }
.auth-form-wrap .sub { color: rgba(232, 238, 251, .6); font-size: 13px; margin-bottom: 26px; }
.auth-form-wrap .form-label { color: rgba(232, 238, 251, .86); }
.auth-form-wrap .form-control, .auth-form-wrap .form-select { background: rgba(255,255,255,.05); border-color: rgba(148,163,184,.25); color: #e8eefb; }
.auth-form-wrap .form-control:focus { background: rgba(255,255,255,.07); color: #fff; }
.auth-form-wrap .form-control::placeholder { color: rgba(232,238,251,.35); }
.auth-form-wrap .input-icon > i { color: rgba(232,238,251,.45); }
.auth-form-wrap .btn-brand { width: 100%; padding: .8rem 1rem; }
.auth-divider { display: flex; align-items: center; gap: 12px; color: rgba(232,238,251,.42); font-size: 11px; margin: 18px 0; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: rgba(148,163,184,.2); }
.btn-google { width: 100%; background: #fff; color: #1f2937; border: 1px solid rgba(148,163,184,.2); display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-weight: 700; }
.btn-google:hover { background: #f1f5f9; color: #0f172a; }
.auth-note { margin-top: 20px; padding: 12px 14px; border-radius: 12px; background: rgba(14, 165, 233, .1); border: 1px solid rgba(14, 165, 233, .2); font-size: 11.5px; color: rgba(232,238,251,.75); }
.auth-theme-toggle { position: fixed; top: 20px; right: 20px; z-index: 10; }

.auth-body.auth-login {
    background: #f3f4f6;
    color: #111827;
}
.login-shell { width: 100%; max-width: 430px; }
.login-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 22px;
    padding: 42px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .08);
}
.login-logo { display: block; width: 100%; max-width: 210px; height: auto; margin: 0 auto 26px; }
.login-title {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: .03em;
    text-align: center;
    color: #111827;
    margin: 0 0 26px;
}
.login-card .form-label { color: #374151; }
.login-card .form-control,
.login-card .form-select {
    background: #ffffff;
    border-color: #d1d5db;
    color: #111827;
}
.login-card .form-control:focus,
.login-card .form-select:focus {
    border-color: var(--brand-1);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, .12);
}
.login-card .input-icon > i { color: #9ca3af; }
.login-card .form-text { color: #6b7280; }
.login-card .auth-note {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e3a8a;
}
.login-card .auth-note a { color: #1d4ed8; }
.login-card .btn-brand { width: 100%; padding: .8rem 1rem; }
.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #9ca3af;
    font-size: 11px;
    margin: 18px 0;
}
.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}
.btn-google-official {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #ffffff;
    color: #3c4043;
    border: 1px solid #dadce0;
    border-radius: 12px;
    padding: .75rem 1rem;
    font-family: var(--app-font);
    font-weight: 600;
    font-size: 13.5px;
    cursor: pointer;
    transition: background .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.btn-google-official:focus-visible {
    outline: 2px solid var(--brand-1);
    outline-offset: 2px;
}
.btn-google-official:hover {
    background: #f8fafc;
    border-color: #c7cbd1;
    color: #202124;
    box-shadow: 0 2px 8px rgba(60, 64, 67, .12);
}
.btn-google-official img { width: 18px; height: 18px; flex-shrink: 0; }
.btn-google-official:disabled { opacity: .6; cursor: not-allowed; }
.login-footer {
    text-align: center;
    font-size: 11.5px;
    color: #6b7280;
    margin: 22px 0 0;
    line-height: 1.6;
}

@media (max-width: 575.98px) {
    .login-card { padding: 30px 22px; border-radius: 18px; }
    .login-logo { max-width: 180px; margin-bottom: 22px; }
    .login-title { font-size: 1.2rem; }
}

/* =========================================================
   Modals / SweetAlert / TinyMCE
   ========================================================= */
.modal-content { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow); }
.modal-header { border-bottom: 1px solid var(--border); padding: 18px 22px; }
.modal-title { font-size: 16px; font-weight: 800; }
.modal-body { padding: 22px; }
.modal-footer { border-top: 1px solid var(--border); padding: 16px 22px; }
.btn-close { filter: var(--bs-btn-close-filter, none); }

.swal2-popup { font-family: var(--app-font) !important; border-radius: 20px !important; background: var(--surface) !important; color: var(--text) !important; border: 1px solid var(--border) !important; box-shadow: var(--shadow) !important; }
.swal2-title { font-size: 19px !important; font-weight: 800 !important; color: var(--text) !important; }
.swal2-html-container { font-size: 13.5px !important; color: var(--muted) !important; }
.swal2-confirm { background: var(--brand-1) !important; border-radius: 11px !important; font-weight: 700 !important; box-shadow: 0 10px 22px rgba(79,70,229,.25) !important; }
.swal2-confirm:hover { background: #4338ca !important; }
.swal2-cancel { background: var(--surface-3) !important; color: var(--text) !important; border-radius: 11px !important; font-weight: 700 !important; }
.swal2-toast { border-radius: 14px !important; padding: 12px 16px !important; }
.swal2-toast .swal2-title { font-size: 13px !important; font-weight: 700 !important; }

.tox-tinymce { border-radius: 12px !important; border-color: var(--border) !important; }
.tox .tox-toolbar, .tox .tox-toolbar__overflow, .tox .tox-toolbar__primary { background: var(--surface-2) !important; }
.tox .tox-edit-area__iframe { background: var(--surface) !important; }
[data-bs-theme="dark"] .tox .tox-toolbar, [data-bs-theme="dark"] .tox .tox-menubar, [data-bs-theme="dark"] .tox .tox-statusbar { background: var(--surface-2) !important; color: var(--text) !important; }

/* =========================================================
   Helpers / responsive
   ========================================================= */
.text-muted-2 { color: var(--muted) !important; }
.fw-800 { font-weight: 800; }
.rounded-4 { border-radius: var(--radius) !important; }
.section-gap { margin-bottom: 22px; }
.small-muted { font-size: 11.5px; color: var(--muted); }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.hover-lift { transition: transform .2s ease, box-shadow .2s ease; }
.hover-lift:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

@media (max-width: 1199.98px) {
    .app-content { padding: 22px; }
    .auth-hero { padding: 36px; }
    .auth-form-wrap { padding: 36px; }
}

@media (max-width: 991.98px) {
    .app-sidebar { transform: translateX(-105%); box-shadow: none; }
    body.sidebar-open .app-sidebar { transform: translateX(0); box-shadow: 24px 0 60px rgba(0,0,0,.3); }
    body.sidebar-open .sidebar-backdrop { opacity: 1; visibility: visible; }
    body.sidebar-collapsed .app-sidebar { width: var(--sidebar-w); }
    body.sidebar-collapsed .sidebar-text, body.sidebar-collapsed .brand-text, body.sidebar-collapsed .sidebar-section, body.sidebar-collapsed .sidebar-user .meta { display: block; }
    body.sidebar-collapsed .sidebar-brand { justify-content: flex-start; padding-inline: 20px; }
    body.sidebar-collapsed .sidebar-link { justify-content: flex-start; padding-inline: 13px; }
    body.sidebar-collapsed .sidebar-user { justify-content: flex-start; background: var(--surface-2); padding: 9px; }
    .app-main, body.sidebar-collapsed .app-main { margin-left: 0; }
    .app-topbar { padding: 0 18px; }
    .topbar-title { display: none; }
    .auth-shell { grid-template-columns: 1fr; max-width: 560px; }
    .auth-hero { display: none; }
    .user-dropdown .name, .user-dropdown .role { display: none; }
}

@media (max-width: 767.98px) {
    .app-content { padding: 16px; }
    .app-topbar { height: 66px; padding: 0 14px; }
    .page-head { margin-bottom: 18px; }
    .page-head .actions { width: 100%; }
    .page-head .actions .btn { flex: 1; }
    .card-surface .card-body { padding: 16px; }
    .card-surface .card-head { padding: 16px 16px 0; }
    .stat-value { font-size: 25px; }
    .chart-box { height: 240px; }
    .timeline { padding-left: 26px; }
    .timeline-dot { left: -26px; width: 26px; height: 26px; }
    .auth-form-wrap, .auth-shell-single .auth-form-wrap { padding: 28px 22px; }
    .auth-body { padding: 12px; }
    .modal-body { padding: 18px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
