/* ==========================================================================
   Zikukim — Design System v2 (Premium SaaS layer)
   --------------------------------------------------------------------------
   This file is loaded AFTER style.css and elevates the whole product without
   touching any business logic or page markup. It is written as an additive
   layer: refined design tokens, premium card/button/table/form/modal/badge
   styling, scroll-reveal + stagger animations, animated counters/progress,
   micro-interactions, skeleton + empty states, and a mobile "table → cards"
   pattern.

   Architecture note: everything reads from CSS custom properties so a full
   Dark/Light toggle can be layered on later via [data-theme="dark"] with no
   markup changes.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens (additive — extend the ones already in style.css)
   -------------------------------------------------------------------------- */
:root {
    /* Brand accent ramp */
    --ds-accent: #0ea5e9;
    --ds-accent-2: #6366f1;
    --ds-accent-3: #8b5cf6;
    --ds-accent-grad: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
    --ds-accent-grad-soft: linear-gradient(135deg, rgba(14,165,233,.12), rgba(99,102,241,.12));

    /* Surfaces */
    --ds-surface: #ffffff;
    --ds-surface-2: #f8fafc;
    --ds-surface-glass: rgba(255,255,255,.72);
    --ds-border: rgba(15,23,42,.08);
    --ds-border-strong: rgba(15,23,42,.14);
    --ds-ink: #0f172a;
    --ds-ink-soft: #475569;
    --ds-ink-mute: #94a3b8;

    /* Radii */
    --ds-r-sm: 12px;
    --ds-r: 18px;
    --ds-r-lg: 24px;
    --ds-r-pill: 999px;

    /* Soft, layered shadows for the floating-card look */
    --ds-shadow-sm: 0 1px 2px rgba(15,23,42,.06), 0 2px 6px rgba(15,23,42,.05);
    --ds-shadow: 0 4px 12px rgba(15,23,42,.06), 0 10px 30px rgba(15,23,42,.07);
    --ds-shadow-lg: 0 12px 24px rgba(15,23,42,.08), 0 30px 60px rgba(15,23,42,.12);
    --ds-shadow-accent: 0 8px 22px rgba(14,165,233,.30);

    /* Motion */
    --ds-ease: cubic-bezier(.22,1,.36,1);
    --ds-ease-spring: cubic-bezier(.34,1.56,.64,1);
    --ds-t-fast: .16s var(--ds-ease);
    --ds-t: .28s var(--ds-ease);

    /* Spacing scale */
    --ds-gap: 16px;
    --ds-gap-lg: 24px;
}

/* --------------------------------------------------------------------------
   2. Premium page background (very subtle animated mesh)
   -------------------------------------------------------------------------- */
body.is-app {
    background:
        radial-gradient(1100px 620px at 15% -8%, rgba(14,165,233,.10), transparent 55%),
        radial-gradient(900px 520px at 108% 8%, rgba(139,92,246,.09), transparent 52%),
        radial-gradient(800px 520px at 50% 118%, rgba(99,102,241,.07), transparent 55%),
        var(--bg, #f5f7fb);
    background-attachment: fixed;
}

/* --------------------------------------------------------------------------
   3. Cards — the floating, glassy, hover-lift surface used everywhere
   -------------------------------------------------------------------------- */
.card {
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-r);
    box-shadow: var(--ds-shadow-sm);
    transition: transform var(--ds-t), box-shadow var(--ds-t), border-color var(--ds-t);
    overflow: hidden;
}
.card:hover {
    box-shadow: var(--ds-shadow);
    border-color: var(--ds-border-strong);
}
.card .card-header {
    background: linear-gradient(180deg, rgba(248,250,252,.9), rgba(248,250,252,.5));
    border-bottom: 1px solid var(--ds-border);
    font-weight: 700;
    color: var(--ds-ink);
}
.card .card-body { color: var(--ds-ink-soft); }

/* Elevate the dashboard stat cards with a hairline top accent + lift */
.stat-card {
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-r);
    box-shadow: var(--ds-shadow-sm);
    transition: transform var(--ds-t), box-shadow var(--ds-t), border-color var(--ds-t);
    position: relative;
}
.stat-card::before {
    content: "";
    position: absolute; inset: 0 0 auto 0;
    height: 3px;
    background: var(--ds-accent-grad);
    opacity: 0; transition: opacity var(--ds-t);
}
.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--ds-shadow);
    border-color: var(--ds-border-strong);
}
.stat-card:hover::before { opacity: 1; }
.stat-card .stat-value {
    background: linear-gradient(135deg, var(--ds-ink), #334155);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    font-variant-numeric: tabular-nums;
}

/* Generic elevated surface helper anyone can opt into */
.ds-glass {
    background: var(--ds-surface-glass);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    backdrop-filter: blur(16px) saturate(140%);
    border: 1px solid rgba(255,255,255,.5);
    border-radius: var(--ds-r);
    box-shadow: var(--ds-shadow);
}

/* --------------------------------------------------------------------------
   4. Buttons — micro-interactions (press, ripple, focus ring, gradient)
   -------------------------------------------------------------------------- */
.btn {
    border-radius: var(--ds-r-sm);
    font-weight: 700;
    letter-spacing: .1px;
    transition: transform var(--ds-t-fast), box-shadow var(--ds-t-fast), background var(--ds-t-fast), filter var(--ds-t-fast);
    position: relative;
    overflow: hidden;
    isolation: isolate;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px) scale(.985); }
.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(14,165,233,.35);
}
.btn-primary {
    background: var(--ds-accent-grad);
    border: none;
    box-shadow: var(--ds-shadow-accent);
}
.btn-primary:hover {
    background: var(--ds-accent-grad);
    filter: brightness(1.06);
    box-shadow: 0 12px 28px rgba(14,165,233,.42);
}
.btn-success { border: none; box-shadow: 0 8px 20px rgba(16,185,129,.28); }
.btn-danger  { border: none; box-shadow: 0 8px 20px rgba(239,68,68,.24); }
.btn-lg { border-radius: var(--ds-r); }

/* Ripple element injected by ui-animations.js */
.btn .ds-ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    background: rgba(255,255,255,.45);
    pointer-events: none;
    z-index: -1;
    animation: dsRipple .6s var(--ds-ease);
}
@keyframes dsRipple { to { transform: scale(2.6); opacity: 0; } }

/* --------------------------------------------------------------------------
   5. Forms — soft fields with a focus glow
   -------------------------------------------------------------------------- */
.form-control, .form-select {
    border-radius: var(--ds-r-sm);
    border: 1px solid var(--ds-border-strong);
    transition: border-color var(--ds-t-fast), box-shadow var(--ds-t-fast), background var(--ds-t-fast);
    background: var(--ds-surface);
}
.form-control:focus, .form-select:focus {
    border-color: var(--ds-accent);
    box-shadow: 0 0 0 4px rgba(14,165,233,.14);
}

/* --------------------------------------------------------------------------
   6. Badges — pill, subtle, tabular
   -------------------------------------------------------------------------- */
.badge {
    border-radius: var(--ds-r-pill);
    font-weight: 700;
    letter-spacing: .2px;
    padding: .38em .7em;
}

/* --------------------------------------------------------------------------
   7. Alerts — leading accent bar
   -------------------------------------------------------------------------- */
.alert {
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-r-sm);
    position: relative;
    padding-inline-start: 18px;
    box-shadow: var(--ds-shadow-sm);
}
.alert::before {
    content: "";
    position: absolute; inset-inline-start: 0; top: 0; bottom: 0;
    width: 4px;
    border-start-start-radius: var(--ds-r-sm);
    border-end-start-radius: var(--ds-r-sm);
    background: currentColor;
    opacity: .5;
}
.alert-success { color: #047857; }
.alert-warning { color: #b45309; }
.alert-danger  { color: #b91c1c; }
.alert-info    { color: #0369a1; }

/* --------------------------------------------------------------------------
   8. Modals — spring entrance + rounded glass header
   -------------------------------------------------------------------------- */
.modal-content {
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-r-lg);
    box-shadow: var(--ds-shadow-lg);
    overflow: hidden;
}
.modal-header {
    background: linear-gradient(180deg, rgba(248,250,252,.95), rgba(248,250,252,.6));
    border-bottom: 1px solid var(--ds-border);
}
.modal.fade .modal-dialog { transform: translateY(18px) scale(.97); transition: transform .32s var(--ds-ease-spring), opacity .3s ease; }
.modal.show .modal-dialog { transform: none; }

/* --------------------------------------------------------------------------
   9. Tables — refined header + row hover, and mobile "cards" transformation
   -------------------------------------------------------------------------- */
.table-card, .table-responsive { border-radius: var(--ds-r); }

/* Wide-table horizontal scrolling: keep the bottom scrollbar always visible,
   and add a matching one on top (synced by ui-animations.js) so tables can be
   dragged left/right even when the bottom bar is off screen. */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.table-responsive::-webkit-scrollbar,
.ds-topscroll::-webkit-scrollbar { height: 12px; }
.table-responsive::-webkit-scrollbar-thumb,
.ds-topscroll::-webkit-scrollbar-thumb {
    background: #94a3b8; border-radius: 999px; border: 3px solid transparent; background-clip: content-box;
}
.table-responsive::-webkit-scrollbar-thumb:hover,
.ds-topscroll::-webkit-scrollbar-thumb:hover { background: #64748b; background-clip: content-box; }
.table-responsive::-webkit-scrollbar-track,
.ds-topscroll::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 999px; }
.ds-topscroll {
    display: none; overflow-x: auto; overflow-y: hidden;
    scrollbar-width: thin; margin-bottom: 6px;
}
.ds-topscroll > div { height: 1px; }
[data-theme="dark"] .table-responsive::-webkit-scrollbar-track,
[data-theme="dark"] .ds-topscroll::-webkit-scrollbar-track { background: #1e293b; }
[data-theme="dark"] .table-responsive::-webkit-scrollbar-thumb,
[data-theme="dark"] .ds-topscroll::-webkit-scrollbar-thumb { background: #475569; background-clip: content-box; }
.table thead th {
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: .6px;
    color: var(--ds-ink-mute);
    font-weight: 700;
    border-bottom: 1px solid var(--ds-border);
}
.table tbody tr { transition: background var(--ds-t-fast); }
.table tbody td { vertical-align: middle; }

/* Mobile: turn data tables into stacked cards.
   ui-animations.js copies each column header into td[data-label]; here we
   render every row as its own card with label/value rows. Opt out with
   .no-cards on the table (or wrap in .keep-table). */
@media (max-width: 720px) {
    table.ds-cards { border: 0; background: transparent; }
    table.ds-cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    table.ds-cards tbody { display: block; }
    table.ds-cards tr {
        display: block;
        background: var(--ds-surface);
        border: 1px solid var(--ds-border);
        border-radius: var(--ds-r);
        box-shadow: var(--ds-shadow-sm);
        padding: 6px 14px;
        margin-bottom: 12px;
    }
    table.ds-cards td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        padding: 9px 0;
        border: 0;
        border-bottom: 1px solid var(--ds-border-light, #f1f5f9);
        text-align: start;
    }
    table.ds-cards tr td:last-child { border-bottom: 0; }
    table.ds-cards td::before {
        content: attr(data-label);
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .5px;
        color: var(--ds-ink-mute);
        flex: 0 0 auto;
    }
    table.ds-cards td[data-label=""]::before,
    table.ds-cards td.ds-nolabel::before { content: none; }
    /* action-only cells span the full width */
    table.ds-cards td.ds-nolabel { justify-content: flex-end; }
}

/* --------------------------------------------------------------------------
   9b. Smart Admin Table — reusable dense/grouped table system
   Add class `smart-table` alongside `table`. Group related fields into a
   single cell using .st-primary/.st-title/.st-sub/.st-meta, show status/risk
   as badges, and move row actions into a compact .st-actions dropdown.
   Mobile reuses the existing .ds-cards mechanism (each grouped cell becomes a
   labelled block).
   -------------------------------------------------------------------------- */
.smart-table { --st-pad-y: 11px; }
.smart-table.st-compact { --st-pad-y: 6px; font-size: 12.5px; }
.smart-table thead th { white-space: nowrap; }
.smart-table tbody td {
    padding-top: var(--st-pad-y);
    padding-bottom: var(--st-pad-y);
    vertical-align: middle;
}
.smart-table tbody tr { transition: background var(--ds-t-fast); }
.smart-table tbody tr:hover { background: rgba(14,165,233,.055); }
.smart-table tbody tr.is-selected { background: var(--ds-accent-grad-soft); }

/* Primary (identity) cell: bold title + stacked muted meta lines */
.st-primary { min-width: 190px; }
.st-title {
    font-weight: 700;
    color: var(--ds-ink);
    font-size: 13.5px;
    line-height: 1.25;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.st-title a { color: inherit; text-decoration: none; }
.st-title a:hover { color: var(--ds-accent); text-decoration: underline; }

/* Square "View as" shortcut button that sits right next to a name */
.st-viewas {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 7px;
    background: var(--ds-surface-2, #eef2f7);
    border: 1px solid var(--ds-border, #e2e8f0);
    color: var(--ds-accent, #2563eb) !important;
    font-size: 11px;
    text-decoration: none !important;
    transition: background .12s ease, transform .12s ease, box-shadow .12s ease;
}
.st-title a.st-viewas:hover {
    background: var(--ds-accent, #2563eb);
    color: #fff !important;
    text-decoration: none !important;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(37,99,235,.28);
}

/* Live entity links (worker names, etc.) inside any table cell */
.entity-link {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dotted rgba(37, 99, 235, .45);
    cursor: pointer;
    transition: color .12s ease, border-color .12s ease;
}
.entity-link:hover,
.entity-link:focus {
    color: var(--ds-accent, #2563eb);
    border-bottom-color: currentColor;
    text-decoration: none;
}
.st-sub { font-size: 11.5px; color: var(--ds-ink-mute); margin-top: 1px; }
.st-sub code { font-size: 11px; }

/* User name + avatar chip (shown next to names across the app) */
.uav-name { display: inline-flex; align-items: center; gap: 8px; vertical-align: middle; }
.entity-link.uav-name { border-bottom: none; }
.entity-link.uav-name .uav-name-txt { border-bottom: 1px dotted rgba(37, 99, 235, .45); transition: border-color .12s ease; }
.entity-link.uav-name:hover .uav-name-txt,
.entity-link.uav-name:focus .uav-name-txt { border-bottom-color: currentColor; }
.uav-chip {
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; overflow: hidden; flex: 0 0 auto;
    color: #fff; font-weight: 800; line-height: 1;
    box-shadow: 0 1px 3px rgba(0,0,0,.18); border: 1.5px solid rgba(255,255,255,.7);
}
.uav-chip img { width: 100%; height: 100%; object-fit: cover; display: block; }
.st-meta { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.st-meta-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    color: var(--ds-ink-soft);
    line-height: 1.3;
}
.st-meta-row > i:first-child { width: 13px; text-align: center; color: var(--ds-ink-mute); font-size: 11px; flex: 0 0 auto; }
.st-meta-row a { color: var(--ds-ink-soft); text-decoration: none; }
.st-meta-row a:hover { color: var(--ds-accent); text-decoration: underline; }
.st-truncate {
    display: inline-block;
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

/* Badge stacks (status / risk / money) */
.st-badges { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.st-money { font-weight: 700; color: var(--ds-ink); white-space: nowrap; }
.st-money-sub { font-size: 11px; color: var(--ds-ink-mute); }

/* Inline copy button for phone / email / link */
.st-copy {
    border: 0; background: transparent; color: var(--ds-ink-mute);
    cursor: pointer; padding: 1px 3px; font-size: 10.5px; line-height: 1;
    border-radius: 6px; vertical-align: middle;
}
.st-copy:hover { color: var(--ds-accent); background: var(--ds-surface-2); }

/* Row actions dropdown — default stack order; open row lifted via .is-actions-open / :has(.dropdown.show) */
.st-actions { display: flex; justify-content: flex-end; gap: 6px; align-items: center; position: relative; }
.st-more {
    border: 1px solid var(--ds-border); background: var(--ds-surface);
    color: var(--ds-ink-soft); border-radius: 10px;
    min-width: 34px; height: 32px; padding: 0 9px;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    cursor: pointer; font-size: 13px; font-weight: 600;
}
.st-more:hover, .st-more[aria-expanded="true"] { border-color: var(--ds-accent); color: var(--ds-accent); }
.st-more.dropdown-toggle::after { display: none; }
.st-more-label { font-size: 12.5px; }
.st-actions .dropdown-menu {
    --bs-dropdown-min-width: 12.5rem;
    font-size: 13px;
    box-shadow: var(--ds-shadow);
    border-color: var(--ds-border);
    max-height: min(70vh, 420px);
    overflow-y: auto;
}
.st-actions .dropdown-menu.show {
    z-index: 10050 !important;
}
.smart-table tbody td.ds-nolabel { overflow: visible; position: relative; }
.smart-table tbody tr.is-actions-open,
.smart-table tbody tr:has(.dropdown.show) {
    position: relative;
    z-index: 40;
}
.smart-table tbody tr.is-actions-open .st-actions,
.smart-table tbody tr:has(.dropdown.show) .st-actions {
    z-index: 41;
}
.table-card:has(.smart-table) { overflow: visible; }
.table-card:has(.smart-table) > .table-responsive { overflow-x: auto; overflow-y: visible; }
.st-actions .dropdown-item { display: flex; align-items: center; gap: 9px; padding: 7px 14px; }
.st-actions .dropdown-item > i { width: 16px; text-align: center; opacity: .8; }
.st-actions form { margin: 0; }
.st-actions form > button.dropdown-item { width: 100%; text-align: inherit; border: 0; background: transparent; }
.st-actions .dropdown-item.text-danger:hover { background: #fef2f2; color: #dc2626; }

/* Bulk action bar (revealed by JS when checkboxes are selected) */
.st-bulkbar {
    display: none; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 10px 16px; margin-bottom: 12px;
    background: var(--ds-accent-grad-soft); border: 1px solid var(--ds-border);
    border-radius: var(--ds-r-sm);
}
.st-bulkbar.is-active { display: flex; }
.st-bulkbar .st-bulkbar-count { font-weight: 700; color: var(--ds-ink); }

/* Fraud risk pill (users table + dashboards) */
.st-risk-tag {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 11px; border-radius: 999px;
    font-size: 11px; font-weight: 700; color: #fff;
    white-space: nowrap; line-height: 1.2;
    box-shadow: 0 1px 3px rgba(15,23,42,.12);
}
.st-risk-tag .st-risk-num { font-size: 13px; font-weight: 800; letter-spacing: -.02em; }
.st-risk-tag.st-risk-clean {
    background: #f1f5f9; color: #64748b;
    border: 1px solid #e2e8f0; box-shadow: none;
}
.st-row-focus {
    background: rgba(234,88,12,.07) !important;
    box-shadow: inset 4px 0 0 #ea580c;
    animation: stRowFocusPulse 2.2s ease-in-out 2;
}
@keyframes stRowFocusPulse {
    0%, 100% { background: rgba(234,88,12,.07); }
    50%      { background: rgba(234,88,12,.16); }
}
html[data-theme="dark"] .st-risk-tag.st-risk-clean { background: #1a2438; color: #94a3b8; border-color: rgba(255,255,255,.08); }
html[data-theme="dark"] .st-row-focus { background: rgba(234,88,12,.14) !important; }

/* Mobile: grouped cells stack as full-width labelled blocks */
@media (max-width: 720px) {
    table.smart-table.ds-cards td {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }
    table.smart-table.ds-cards td::before { margin-bottom: 1px; }
    table.smart-table.ds-cards td.ds-nolabel { align-items: stretch; }
    table.smart-table.ds-cards .st-actions { justify-content: flex-start; }
    table.smart-table.ds-cards .st-more { width: 100%; }
    .st-truncate { max-width: 62vw; }
}

/* --------------------------------------------------------------------------
   10. Scroll-reveal + stagger (progressive enhancement, JS-gated)
   Elements are only hidden when html.js-anim is present (set by JS on load),
   so if JS fails everything stays fully visible.
   -------------------------------------------------------------------------- */
html.js-anim .content-area .card,
html.js-anim .content-area .stat-card,
html.js-anim .reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .55s var(--ds-ease), transform .55s var(--ds-ease);
    will-change: opacity, transform;
}
html.js-anim .is-revealed,
html.js-anim .content-area .card.is-revealed,
html.js-anim .content-area .stat-card.is-revealed {
    opacity: 1;
    transform: none;
}
/* stagger delay steps applied inline by JS via --ds-delay */
html.js-anim [style*="--ds-delay"] { transition-delay: var(--ds-delay); }

/* --------------------------------------------------------------------------
   11. Animated counters / progress bars
   -------------------------------------------------------------------------- */
.ds-progress {
    height: 8px;
    border-radius: var(--ds-r-pill);
    background: rgba(15,23,42,.08);
    overflow: hidden;
}
.ds-progress > i {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: var(--ds-accent-grad);
    transition: width 1s var(--ds-ease);
}

/* --------------------------------------------------------------------------
   12. Skeleton loaders
   -------------------------------------------------------------------------- */
.skeleton {
    position: relative;
    overflow: hidden;
    background: #e9eef5;
    border-radius: var(--ds-r-sm);
}
.skeleton::after {
    content: "";
    position: absolute; inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.65), transparent);
    animation: dsShimmer 1.4s infinite;
}
.skeleton-text { height: 12px; margin: 8px 0; }
.skeleton-text.w-60 { width: 60%; }
.skeleton-text.w-40 { width: 40%; }
.skeleton-line { height: 12px; border-radius: var(--ds-r-pill); }
.skeleton-avatar { width: 44px; height: 44px; border-radius: 50%; }
@keyframes dsShimmer { 100% { transform: translateX(100%); } }

/* --------------------------------------------------------------------------
   13. Empty states — friendlier, centred, animated icon
   -------------------------------------------------------------------------- */
.empty-state {
    text-align: center;
    padding: 56px 24px;
    color: var(--ds-ink-mute);
}
.empty-state .es-illus,
.empty-state > i:first-child {
    display: inline-flex;
    align-items: center; justify-content: center;
    width: 84px; height: 84px;
    margin-bottom: 16px;
    border-radius: 24px;
    font-size: 34px;
    color: var(--ds-accent);
    background: var(--ds-accent-grad-soft);
    animation: dsFloat 4s ease-in-out infinite;
}
@keyframes dsFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.empty-state h5 { color: var(--ds-ink); font-weight: 800; }
.empty-state p { color: var(--ds-ink-soft); }

/* --------------------------------------------------------------------------
   14. App chrome polish — header / tabs / bottom-bar glass depth
   -------------------------------------------------------------------------- */
.app-header {
    box-shadow: 0 6px 24px rgba(6,20,40,.28);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}
.ah-tab { transition: background var(--ds-t-fast), color var(--ds-t-fast), transform var(--ds-t-fast); }
.ah-tab:hover { transform: translateY(-1px); }
.app-bottombar {
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    backdrop-filter: blur(18px) saturate(140%);
    box-shadow: 0 -6px 24px rgba(6,20,40,.14);
}
.abb-item { transition: color var(--ds-t-fast), transform var(--ds-t-fast); }
.abb-item.active .abb-ic { transform: translateY(-2px); }
.abb-item:active .abb-ic { transform: scale(.9); }

/* Notification bell gentle pulse when there are unread items */
.ah-bell .ah-bell-badge:not([hidden]) { animation: dsBadgePop .3s var(--ds-ease-spring); }
@keyframes dsBadgePop { from { transform: scale(0); } to { transform: scale(1); } }
.ah-bell.has-unread::after {
    content: "";
    position: absolute; inset: -3px;
    border-radius: 12px;
    border: 2px solid rgba(239,68,68,.45);
    animation: dsBellPulse 1.8s ease-out infinite;
    pointer-events: none;
}
@keyframes dsBellPulse {
    0% { transform: scale(.85); opacity: .7; }
    100% { transform: scale(1.25); opacity: 0; }
}

/* --------------------------------------------------------------------------
   15. Sticky action bar helper (for forms/detail pages on mobile)
   -------------------------------------------------------------------------- */
.ds-sticky-actions {
    position: sticky;
    bottom: calc(env(safe-area-inset-bottom) + 8px);
    z-index: 40;
    display: flex; gap: 10px;
    padding: 12px;
    margin-top: 20px;
    background: var(--ds-surface-glass);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-r);
    box-shadow: var(--ds-shadow);
}
.ds-sticky-actions .btn { flex: 1; }

/* --------------------------------------------------------------------------
   16. Section headings used across dashboards
   -------------------------------------------------------------------------- */
.ds-section-title {
    display: flex; align-items: center; gap: 10px;
    font-weight: 800; color: var(--ds-ink);
    font-size: 16px; margin: 4px 0 14px;
}
.ds-section-title i { color: var(--ds-accent); }

/* --------------------------------------------------------------------------
   17. Touch targets + readable text on phones
   -------------------------------------------------------------------------- */
@media (max-width: 720px) {
    .content-area { padding: 16px 14px calc(96px + env(safe-area-inset-bottom)); }
    .btn { min-height: 44px; }
    .btn-sm { min-height: 38px; }
    .card { border-radius: var(--ds-r); }
    .form-control, .form-select { min-height: 46px; font-size: 16px; } /* 16px avoids iOS zoom */
}

/* --------------------------------------------------------------------------
   18. Respect reduced-motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    html.js-anim .content-area .card,
    html.js-anim .content-area .stat-card,
    html.js-anim .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
    .empty-state .es-illus,
    .empty-state > i:first-child,
    .ah-bell.has-unread::after { animation: none !important; }
    .btn:hover, .stat-card:hover { transform: none; }
}
