:root,
:root[data-theme="dark"] {
    --bg: #0b1018;
    --surface: #111823;
    --surface-2: #161f2c;
    --surface-3: #1b2635;
    --sidebar: #0d131d;
    --topbar: rgba(11, 16, 24, .92);
    --text: #eef4fb;
    --text-2: #c5d0df;
    --muted: #8694a8;
    --border: #263245;
    --border-soft: #1c2736;
    --input: #0d1520;
    --accent: #53d6e8;
    --accent-2: #8e7df4;
    --accent-soft: rgba(83, 214, 232, .12);
    --success: #36c991;
    --success-soft: rgba(54, 201, 145, .12);
    --danger: #fb7185;
    --danger-soft: rgba(251, 113, 133, .12);
    --warning: #f2c45d;
    --warning-soft: rgba(242, 196, 93, .12);
    --shadow: 0 16px 40px rgba(0, 0, 0, .20);
    --overlay: rgba(3, 7, 14, .68);
}

:root[data-theme="light"] {
    --bg: #f3f6fa;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --surface-3: #eef3f8;
    --sidebar: #ffffff;
    --topbar: rgba(255, 255, 255, .94);
    --text: #182538;
    --text-2: #40516a;
    --muted: #718096;
    --border: #dce5ee;
    --border-soft: #e9eef4;
    --input: #ffffff;
    --accent: #079db3;
    --accent-2: #6c5adc;
    --accent-soft: rgba(7, 157, 179, .10);
    --success: #128b65;
    --success-soft: rgba(18, 139, 101, .10);
    --danger: #cf4d63;
    --danger-soft: rgba(207, 77, 99, .10);
    --warning: #9b710c;
    --warning-soft: rgba(155, 113, 12, .10);
    --shadow: 0 12px 34px rgba(38, 57, 81, .08);
    --overlay: rgba(19, 31, 47, .44);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    transition: background .18s ease, color .18s ease;
}
body.modal-open,
body.sidebar-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
.text-muted, .muted { color: var(--muted); }
.optional { color: var(--muted); font-weight: 500; }

/* App shell */
.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
}
.main { min-width: 0; }

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 18px 14px 14px;
    background: var(--sidebar);
    border-right: 1px solid var(--border);
    z-index: 80;
    overflow: hidden;
}
.sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 4px;
    margin-bottom: 16px;
}
.brand {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 11px;
}
.brand-mark {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #07111c;
    font-weight: 900;
    letter-spacing: -.03em;
}
.brand-mark.large { width: 62px; height: 62px; border-radius: 18px; font-size: 20px; }
.brand-copy { min-width: 0; }
.brand-copy strong { display: block; font-size: 14px; }
.brand-copy small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.sidebar-close { display: none !important; }

.demo-badge {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 11px;
    margin: 0 3px 14px;
    border: 1px solid rgba(242, 196, 93, .26);
    border-radius: 11px;
    background: var(--warning-soft);
}
.demo-badge > i { color: var(--warning); font-size: 18px; }
.demo-badge strong { display: block; color: var(--warning); font-size: 10px; letter-spacing: .08em; }
.demo-badge span { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }

.nav {
    min-height: 0;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding-right: 2px;
    scrollbar-width: thin;
}
.nav a {
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border-radius: 10px;
    color: var(--text-2);
    font-size: 13px;
    font-weight: 600;
    transition: .16s ease;
}
.nav a i { width: 20px; color: var(--muted); font-size: 18px; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active {
    background: var(--accent-soft);
    color: var(--text);
    box-shadow: inset 3px 0 0 var(--accent);
}
.nav a.active i { color: var(--accent); }
.nav-label {
    padding: 16px 11px 5px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.sidebar-footer {
    flex: 0 0 auto;
    padding-top: 12px;
    margin-top: 10px;
    border-top: 1px solid var(--border-soft);
}
.sidebar-profile { display: flex; align-items: center; gap: 10px; padding: 5px; }
.avatar {
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 800;
}
.profile-copy { min-width: 0; }
.profile-copy strong,
.profile-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-copy strong { font-size: 12px; }
.profile-copy span { margin-top: 2px; color: var(--muted); font-size: 11px; }

/* Topbar */
.topbar {
    min-height: 72px;
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 24px;
    background: var(--topbar);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(14px);
}
.topbar-left,
.topbar-actions { min-width: 0; display: flex; align-items: center; gap: 10px; }
.topbar h1 { margin: 2px 0 0; font-size: 19px; line-height: 1.2; letter-spacing: -.02em; }
.breadcrumb-mini { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.desktop-user { padding: 0 4px; text-align: right; }
.desktop-user strong,
.desktop-user span { display: block; }
.desktop-user strong { font-size: 12px; }
.desktop-user span { margin-top: 1px; color: var(--muted); font-size: 10px; }
.menu-btn { display: none !important; }

.icon-btn {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text-2);
    cursor: pointer;
    transition: .16s ease;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn i { font-size: 19px; }
.theme-icon-dark { display: none; }
:root[data-theme="light"] .theme-icon-light { display: none; }
:root[data-theme="light"] .theme-icon-dark { display: block; }

/* General content */
.content {
    width: min(1500px, 100%);
    margin: 0 auto;
    padding: 26px;
}
.eyebrow {
    color: var(--accent);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
}
.page-header,
.page-intro {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}
.page-heading h2,
.page-intro h2 { margin: 5px 0 5px; font-size: 26px; letter-spacing: -.025em; }
.page-heading p,
.page-intro p { margin: 0; color: var(--muted); font-size: 13px; }
.page-actions,
.panel-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.panel,
.hero-card,
.stat {
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow);
}
.panel { padding: 20px; border-radius: 16px; }
.panel-head,
.panel-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}
.panel-head { margin-bottom: 16px; }
.panel-head h3,
.panel-toolbar h3 { margin: 0; font-size: 16px; }
.panel-toolbar { margin-bottom: 16px; }
.panel-toolbar p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.panel-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 19px;
}

.btn {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 13px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 750;
    white-space: nowrap;
    cursor: pointer;
    transition: .16s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .65; cursor: wait; transform: none; }
.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #07111c;
}
.btn-secondary,
.btn-soft {
    border-color: var(--border);
    background: var(--surface-2);
    color: var(--text-2);
}
.btn-secondary:hover,
.btn-soft:hover { border-color: var(--accent); color: var(--text); }
.btn-danger { border-color: rgba(251,113,133,.25); background: var(--danger-soft); color: var(--danger); }
.btn-sm { min-height: 34px; padding: 6px 10px; font-size: 11px; }
.btn-lg { min-height: 46px; font-size: 13px; }
.full { width: 100%; }

/* Dashboard */
.hero-card {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 24px;
    padding: 26px;
    border-radius: 18px;
    margin-bottom: 18px;
}
.hero-copy h2 { margin: 6px 0 8px; font-size: clamp(24px, 3vw, 34px); letter-spacing: -.035em; }
.hero-copy p { max-width: 850px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.75; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.hero-tags span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 9px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text-2);
    font-size: 11px;
    font-weight: 700;
}
.hero-status {
    min-width: 190px;
    padding: 18px;
    border: 1px solid rgba(54,201,145,.22);
    border-radius: 15px;
    background: var(--success-soft);
    text-align: center;
}
.status-orb {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    margin: 0 auto 10px;
    border-radius: 50%;
    background: rgba(54,201,145,.14);
    color: var(--success);
    font-size: 24px;
}
.hero-status span,
.hero-status strong,
.hero-status small { display: block; }
.hero-status span { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .1em; }
.hero-status strong { margin-top: 3px; color: var(--success); font-size: 17px; }
.hero-status small { margin-top: 3px; color: var(--muted); font-size: 10px; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}
.stat {
    min-width: 0;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 16px;
    border-radius: 14px;
}
.stat-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 18px;
}
.stat span,
.stat strong,
.stat small { display: block; }
.stat span { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.stat strong { margin: 2px 0; font-size: 21px; letter-spacing: -.02em; }
.stat small { color: var(--muted); font-size: 10px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.scenario-list { display: grid; gap: 9px; }
.scenario-list > div { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--border-soft); border-radius: 11px; background: var(--surface-2); }
.scenario-icon { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 9px; background: var(--accent-soft); color: var(--accent); }
.scenario-list strong,
.scenario-list span { display: block; }
.scenario-list strong { font-size: 12px; }
.scenario-list div div span { margin-top: 2px; color: var(--muted); font-size: 11px; }
.info-note { display: flex; gap: 7px; margin: 12px 0 0; font-size: 11px; }
.activity-list { display: grid; gap: 4px; }
.activity-item { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border-soft); }
.activity-item:last-child { border-bottom: 0; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.activity-copy strong,
.activity-copy span { display: block; }
.activity-copy strong { font-size: 12px; }
.activity-copy span,
.activity-item small { color: var(--muted); font-size: 10px; }

/* Forms */
.form-grid { display: grid; gap: 16px; }
.field-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { min-width: 0; }
.field label { display: block; margin-bottom: 7px; color: var(--text-2); font-size: 12px; font-weight: 700; }
.field input,
.field textarea,
.field select {
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: 0;
    background: var(--input);
    color: var(--text);
    font-size: 13px;
    transition: border-color .16s ease, box-shadow .16s ease;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.field input::placeholder,
.field textarea::placeholder { color: var(--muted); opacity: .75; }
.input-icon { position: relative; }
.input-icon > i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-icon input { padding-left: 38px; }
.password-input input { padding-right: 44px; }
.password-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}
.password-toggle:hover { background: var(--surface-2); color: var(--text); }

/* DataTables */
.table-panel { padding: 18px; }
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.admin-table { min-width: 880px; }
table.dataTable { width: 100% !important; margin: 0 !important; border-collapse: collapse !important; color: var(--text); }
table.dataTable thead th,
table.dataTable thead td {
    padding: 11px 12px !important;
    border-bottom: 1px solid var(--border) !important;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
    white-space: nowrap;
}
table.dataTable tbody td {
    padding: 12px !important;
    border-bottom: 1px solid var(--border-soft) !important;
    background: transparent !important;
    color: var(--text-2);
    font-size: 12px;
    vertical-align: middle;
    white-space: nowrap;
}
table.dataTable tbody tr:hover { background: var(--accent-soft) !important; }
.dataTables_wrapper { width: 100%; color: var(--text); }
.dt-top,
.dt-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.dt-top { margin-bottom: 13px; }
.dt-bottom { margin-top: 13px; }
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate { float: none !important; margin: 0 !important; color: var(--muted) !important; font-size: 11px; }
.dataTables_wrapper .dataTables_filter { margin-left: auto !important; }
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    min-height: 38px;
    border: 1px solid var(--border) !important;
    border-radius: 9px;
    background: var(--input) !important;
    color: var(--text) !important;
    outline: 0;
}
.dataTables_wrapper .dataTables_filter input { min-width: 230px; padding: 7px 10px; margin-left: 0 !important; }
.dataTables_wrapper .dataTables_length select { width: auto; min-width: 66px; padding: 5px 8px; }
.dataTables_wrapper .dataTables_paginate .paginate_button {
    min-width: 34px;
    padding: 6px 9px !important;
    margin-left: 4px;
    border: 1px solid var(--border) !important;
    border-radius: 8px !important;
    background: var(--surface-2) !important;
    color: var(--text-2) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    border-color: var(--accent) !important;
    background: var(--accent-soft) !important;
    color: var(--accent) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover { border-color: var(--accent) !important; color: var(--accent) !important; }
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled { opacity: .45; }
.admin-cell { min-width: 180px; }
.admin-cell strong,
.admin-cell small { display: block; }
.admin-cell strong { color: var(--text); font-size: 12px; }
.admin-cell small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.pill,
.status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
}
.pill { background: var(--accent-soft); color: var(--accent); }
.status.on { background: var(--success-soft); color: var(--success); }
.status.off { background: var(--danger-soft); color: var(--danger); }
.action-column { width: 190px; }
.table-actions { display: flex; align-items: center; gap: 6px; }
.table-action {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 6px 9px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--text-2);
    font-size: 10px;
    font-weight: 750;
    cursor: pointer;
}
.table-action.edit:hover { border-color: var(--accent); color: var(--accent); }
.table-action.danger { border-color: rgba(251,113,133,.24); background: var(--danger-soft); color: var(--danger); }
.table-action.success { border-color: rgba(54,201,145,.24); background: var(--success-soft); color: var(--success); }
.table-legend { display: flex; gap: 12px; color: var(--muted); font-size: 10px; }
.table-legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; }
.legend-dot.active { background: var(--success); }
.legend-dot.inactive { background: var(--danger); }

/* Select2 */
.select2-container { width: 100% !important; }
.select2-container--default .select2-selection--single {
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--input);
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    padding-left: 11px;
    padding-right: 34px;
    line-height: 40px;
    color: var(--text);
    font-size: 13px;
}
.select2-container--default .select2-selection--single .select2-selection__placeholder { color: var(--muted); }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 40px; right: 6px; }
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.select2-dropdown {
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow);
}
.select2-search--dropdown { padding: 8px; }
.select2-container--default .select2-search--dropdown .select2-search__field {
    min-height: 36px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--input);
    color: var(--text);
}
.select2-results__option { padding: 9px 10px; font-size: 12px; }
.select2-container--default .select2-results__option[aria-selected=true] { background: var(--surface-3); }
.select2-container--default .select2-results__option--highlighted[aria-selected] { background: var(--accent-soft); color: var(--accent); }

/* Modal */
.app-modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
}
.app-modal.is-open { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: var(--overlay); backdrop-filter: blur(3px); }
.modal-dialog {
    position: relative;
    z-index: 1;
    width: min(680px, 100%);
    max-height: calc(100dvh - 36px);
    overflow-y: auto;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: 0 30px 90px rgba(0,0,0,.35);
}
.modal-dialog.modal-sm { width: min(480px, 100%); }
.modal-dialog.modal-md { width: min(680px, 100%); }
.modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 16px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--border-soft);
}
.modal-head h3 { margin: 4px 0 3px; font-size: 19px; }
.modal-head p { margin: 0; color: var(--muted); font-size: 12px; }
.modal-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    padding-top: 2px;
}

/* Empty / placeholder */
.empty {
    min-height: 130px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 7px;
    border: 1px dashed var(--border);
    border-radius: 12px;
    color: var(--muted);
    text-align: center;
    font-size: 12px;
}
.empty i { color: var(--accent); font-size: 26px; }
.placeholder { max-width: 760px; margin: 3vh auto 0; padding: 34px; text-align: center; }
.placeholder-icon { width: 58px; height: 58px; margin: 0 auto 15px; display: grid; place-items: center; border-radius: 16px; background: var(--accent-soft); color: var(--accent); font-size: 26px; }
.placeholder h2 { margin: 7px 0; font-size: 24px; }
.placeholder p { max-width: 600px; margin: 0 auto; color: var(--muted); font-size: 13px; line-height: 1.7; }
.code-chip { display: inline-block; margin-top: 14px; padding: 6px 9px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--muted); font: 11px ui-monospace, SFMono-Regular, Menlo, monospace; }
.mobile-overlay { display: none; }

/* SweetAlert2 */
.swal2-popup {
    border: 1px solid var(--border) !important;
    border-radius: 16px !important;
    background: var(--surface) !important;
    color: var(--text) !important;
    box-shadow: var(--shadow) !important;
    font-family: Inter, sans-serif !important;
}
.swal2-title { color: var(--text) !important; font-size: 19px !important; }
.swal2-html-container { color: var(--muted) !important; font-size: 13px !important; line-height: 1.6 !important; }
.swal2-confirm {
    border-radius: 9px !important;
    background: linear-gradient(135deg, var(--accent), var(--accent-2)) !important;
    color: #07111c !important;
    font-weight: 800 !important;
    font-size: 12px !important;
}
.swal2-cancel {
    border-radius: 9px !important;
    background: var(--surface-3) !important;
    color: var(--text-2) !important;
    font-weight: 700 !important;
    font-size: 12px !important;
}
.swal2-timer-progress-bar { background: var(--accent) !important; }

/* Login */
.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 10% 8%, rgba(83,214,232,.10), transparent 30rem),
        radial-gradient(circle at 90% 90%, rgba(142,125,244,.09), transparent 30rem),
        var(--bg);
}
.login-theme { position: fixed; top: 18px; right: 18px; z-index: 10; }
.login-wrap {
    width: min(960px, 100%);
    display: grid;
    grid-template-columns: 1.06fr .94fr;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: var(--surface);
    box-shadow: 0 28px 80px rgba(0,0,0,.22);
}
.login-visual {
    min-height: 540px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 40px;
    background: var(--surface-2);
    border-right: 1px solid var(--border);
}
.login-brand-row { display: flex; align-items: center; gap: 12px; }
.login-brand-row strong,
.login-brand-row span { display: block; }
.login-brand-row strong { font-size: 15px; }
.login-brand-row span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.login-copy h1 { margin: 9px 0 12px; font-size: clamp(30px, 4vw, 46px); line-height: 1.08; letter-spacing: -.045em; }
.login-copy p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.75; }
.warning-card {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    max-width: 480px;
    padding: 13px;
    border: 1px solid rgba(242,196,93,.28);
    border-radius: 12px;
    background: var(--warning-soft);
}
.warning-card > i { color: var(--warning); font-size: 20px; }
.warning-card strong,
.warning-card span { display: block; }
.warning-card strong { color: var(--warning); font-size: 10px; letter-spacing: .1em; }
.warning-card span { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.login-card { display: flex; flex-direction: column; justify-content: center; padding: 48px; }
.login-card-head h2 { margin: 6px 0 5px; font-size: 26px; letter-spacing: -.025em; }
.login-card-head p { margin: 0; color: var(--muted); font-size: 12px; }
.login-form { margin-top: 25px; }
.login-note { display: flex; gap: 7px; align-items: flex-start; margin-top: 17px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.login-note i { color: var(--accent); }

/* Responsive */
@media (max-width: 1280px) {
    .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1060px) {
    .app-shell { grid-template-columns: 230px minmax(0, 1fr); }
    .content { padding: 22px; }
    .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .app-shell { display: block; }
    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(290px, 86vw);
        height: 100dvh;
        transform: translateX(-105%);
        transition: transform .20s ease;
        box-shadow: 24px 0 60px rgba(0,0,0,.24);
    }
    body.sidebar-open .sidebar { transform: translateX(0); }
    .sidebar-close,
    .menu-btn { display: inline-grid !important; }
    .mobile-overlay { position: fixed; inset: 0; z-index: 70; background: var(--overlay); }
    body.sidebar-open .mobile-overlay { display: block; }
    .topbar { min-height: 66px; padding: 10px 14px; }
    .topbar h1 { font-size: 17px; }
    .breadcrumb-mini,
    .desktop-user { display: none; }
    .content { padding: 18px; }
    .login-wrap { grid-template-columns: 1fr; }
    .login-visual { min-height: auto; gap: 32px; border-right: 0; border-bottom: 1px solid var(--border); }
}

@media (max-width: 680px) {
    .topbar-actions { gap: 7px; }
    .logout-link { width: 40px; padding: 0; }
    .logout-link span { display: none; }
    .content { padding: 14px; }
    .page-header,
    .page-intro { flex-direction: column; align-items: stretch; gap: 13px; }
    .page-actions { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .page-actions .btn { width: 100%; padding-inline: 9px; }
    .page-actions .btn span { overflow: hidden; text-overflow: ellipsis; }
    .page-heading h2,
    .page-intro h2 { font-size: 23px; }
    .panel { padding: 15px; }
    .panel-toolbar { align-items: flex-start; }
    .table-legend { display: none; }
    .hero-card { grid-template-columns: 1fr; padding: 20px; }
    .hero-status { min-width: 0; width: 100%; display: grid; grid-template-columns: auto 1fr; gap: 0 11px; align-items: center; text-align: left; }
    .hero-status .status-orb { grid-row: 1 / 4; margin: 0; }
    .hero-status span,
    .hero-status strong,
    .hero-status small { grid-column: 2; }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
    .field-grid-2 { grid-template-columns: 1fr; }
    .dt-top,
    .dt-bottom { align-items: stretch; flex-direction: column; }
    .dataTables_wrapper .dataTables_filter { width: 100%; margin-left: 0 !important; }
    .dataTables_wrapper .dataTables_filter input { width: 100%; min-width: 0; }
    .dataTables_wrapper .dataTables_length { width: 100%; }
    .dataTables_wrapper .dataTables_paginate { text-align: left !important; overflow-x: auto; white-space: nowrap; padding-bottom: 2px; }
    .dataTables_wrapper .dataTables_info { width: 100%; }
    .modal-dialog {
        width: 100% !important;
        max-height: calc(100dvh - 20px);
        padding: 17px;
        border-radius: 14px;
    }
    .app-modal { padding: 10px; align-items: flex-end; }
    .modal-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .modal-actions .btn { width: 100%; }
    .login-page { padding: 12px; align-items: start; }
    .login-theme { top: 12px; right: 12px; }
    .login-wrap { margin-top: 52px; border-radius: 17px; }
    .login-visual,
    .login-card { padding: 24px; }
    .login-copy h1 { font-size: 29px; }
}

@media (max-width: 460px) {
    .page-actions { grid-template-columns: 1fr 1fr; }
    .page-actions .btn:first-child { grid-column: 1 / -1; }
    .stats-grid { grid-template-columns: 1fr; }
    .table-action span { display: none; }
    .table-action { width: 34px; padding: 0; }
    .action-column { width: 90px; }
    .modal-actions { grid-template-columns: 1fr; }
}
