/* ============================================================================
   ZeeApps — "Aurora" Component Layer
   Depends on zee-tokens.css. Load that first.

   Every rule here reads tokens and never hard-codes a colour, radius or
   duration. If you find yourself wanting a literal value in a page, the value
   probably belongs in zee-tokens.css instead.
   ========================================================================= */

/* ── Base ───────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: var(--fs-md);
    line-height: var(--lh-normal);
    color: var(--ink);
    background: var(--canvas);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--accent-soft); color: var(--accent-ink); }

/* One focus treatment for the whole app. :focus-visible only, so mouse users
   never see a ring but keyboard users always do. */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: none;
    box-shadow: var(--ring);
    border-radius: var(--r-sm);
}

/* Respect the OS "reduce motion" setting. Decorative animation stops; state
   transitions shrink to near-instant rather than vanishing, so feedback that
   depends on a transition still reads. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ── Scrollbars ─────────────────────────────────────────────────────────── */

.zee-scroll { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.zee-scroll::-webkit-scrollbar { width: 8px; height: 8px; }
.zee-scroll::-webkit-scrollbar-track { background: transparent; }
.zee-scroll::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: var(--r-full);
    border: 2px solid transparent;
    background-clip: content-box;
}
.zee-scroll::-webkit-scrollbar-thumb:hover { background: var(--ink-faint); background-clip: content-box; }

/* Hide the bar but keep the scrolling — for horizontal chip rails. */
.zee-scroll-hidden { scrollbar-width: none; -ms-overflow-style: none; }
.zee-scroll-hidden::-webkit-scrollbar { display: none; }

/* ============================================================================
   MOTION LIBRARY
   Named keyframes plus .zee-in-* entrance helpers. Entrances read
   --i (the item index) so a list staggers with one inline style.
   ========================================================================= */

@keyframes zee-fade-up   { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes zee-fade-in   { from { opacity: 0; } to { opacity: 1; } }
@keyframes zee-fade-down { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes zee-scale-in  { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: none; } }
@keyframes zee-slide-right { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes zee-slide-left  { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }

@keyframes zee-pulse-dot {
    0%, 100% { opacity: 1;   transform: scale(1); }
    50%      { opacity: 0.45; transform: scale(0.86); }
}
@keyframes zee-pulse-ring {
    0%   { box-shadow: 0 0 0 0 rgb(var(--accent-rgb) / 0.45); }
    70%  { box-shadow: 0 0 0 10px rgb(var(--accent-rgb) / 0); }
    100% { box-shadow: 0 0 0 0 rgb(var(--accent-rgb) / 0); }
}
@keyframes zee-shimmer {
    from { background-position: -200% 0; }
    to   { background-position:  200% 0; }
}
@keyframes zee-gradient-sweep {
    0%   { background-position:   0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position:   0% 50%; }
}
@keyframes zee-spin { to { transform: rotate(360deg); } }
@keyframes zee-float {
    0%, 100% { transform: translateY(0)     rotate(0deg); }
    50%      { transform: translateY(-14px) rotate(2deg); }
}
@keyframes zee-blob-drift {
    0%   { transform: translate(0, 0) scale(1); }
    33%  { transform: translate(4%, -3%) scale(1.06); }
    66%  { transform: translate(-3%, 3%) scale(0.96); }
    100% { transform: translate(0, 0) scale(1); }
}
@keyframes zee-count-blur {
    from { opacity: 0; filter: blur(6px); transform: translateY(6px); }
    to   { opacity: 1; filter: blur(0);   transform: none; }
}

.zee-in         { animation: zee-fade-up var(--dur-slow) var(--ease-out) both;
                  animation-delay: calc(var(--i, 0) * var(--stagger)); }
.zee-in-fade    { animation: zee-fade-in var(--dur-slow) var(--ease-out) both;
                  animation-delay: calc(var(--i, 0) * var(--stagger)); }
.zee-in-scale   { animation: zee-scale-in var(--dur-base) var(--ease-spring) both;
                  animation-delay: calc(var(--i, 0) * var(--stagger)); }
.zee-in-right   { animation: zee-slide-right var(--dur-base) var(--ease-out) both; }
.zee-in-down    { animation: zee-fade-down var(--dur-base) var(--ease-out) both; }

.zee-float      { animation: zee-float 9s var(--ease-in-out) infinite; }
.zee-spin       { animation: zee-spin 1s linear infinite; }

/* ============================================================================
   PAGE BACKDROP
   .zee-aurora paints the pastel wash; the drifting blobs are children so they
   can sit behind content without affecting layout.
   ========================================================================= */

/* The legacy app.css sheet loads after this one and restates body font/colour
   for the un-migrated admin pages, so every Aurora shell re-asserts its own
   typography rather than inheriting whichever sheet won. */
.zee-aurora, .zee-surface-root {
    font-family: var(--font-sans);
    font-size: var(--fs-md);
    line-height: var(--lh-normal);
    color: var(--ink);
}

.zee-aurora {
    position: relative;
    min-height: 100vh;
    background-color: var(--canvas);
    background-image: var(--aurora);
    background-attachment: fixed;
}

.zee-aurora > .zee-blobs {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}
.zee-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.42;
    animation: zee-blob-drift 26s var(--ease-in-out) infinite;
    will-change: transform;
}
.zee-blob-1 { width: 46vw; height: 46vw; top: -14vw; left: -10vw;
              background: radial-gradient(circle, var(--violet-300), transparent 70%); }
.zee-blob-2 { width: 38vw; height: 38vw; bottom: -12vw; right: -8vw;
              background: radial-gradient(circle, var(--sky-300), transparent 70%);
              animation-duration: 32s; animation-delay: -9s; }
.zee-blob-3 { width: 26vw; height: 26vw; top: 42%; left: 58%;
              background: radial-gradient(circle, var(--fuchsia-200), transparent 70%);
              animation-duration: 38s; animation-delay: -18s; }

/* Faint dotted grid, for pages that want more texture than the wash alone. */
.zee-dotgrid::before {
    content: '';
    position: fixed; inset: 0;
    background-image: radial-gradient(circle, rgb(var(--accent-rgb) / 0.10) 1px, transparent 1px);
    background-size: 34px 34px;
    pointer-events: none;
    z-index: 0;
}

/* Content must sit above the decoration. */
.zee-layer { position: relative; z-index: var(--z-base); }

/* ============================================================================
   CARDS
   ========================================================================= */

.zee-card {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

/* Frosted variant — for anything floating over the aurora. */
.zee-card-glass {
    background: var(--glass-bg);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-md), var(--shadow-inset-top);
}

/* Lift on hover. Only for cards that are actually clickable. */
.zee-card-interactive {
    cursor: pointer;
    transition: transform var(--dur-base) var(--ease-out),
                box-shadow var(--dur-base) var(--ease-out),
                border-color var(--dur-base) var(--ease-out);
}
.zee-card-interactive:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-accent);
}
.zee-card-interactive:active { transform: translateY(-1px); }

/* Coloured top edge, driven by the container's --grad-hue. */
.zee-card-topbar { position: relative; }
.zee-card-topbar::before {
    content: '';
    position: absolute; inset: 0 0 auto 0;
    height: 3px;
    background: var(--grad-hue);
}

/* Animated spectrum edge, for hero panels. */
.zee-card-spectrum { position: relative; }
.zee-card-spectrum::before {
    content: '';
    position: absolute; inset: 0 0 auto 0;
    height: 3px;
    background: var(--grad-spectrum);
    background-size: 300% 100%;
    animation: zee-gradient-sweep 6s var(--ease-in-out) infinite;
}

.zee-card-head {
    display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
    padding: var(--s-4) var(--s-5);
    border-bottom: 1px solid var(--border-soft);
}
.zee-card-title { font-size: var(--fs-md); font-weight: var(--fw-bold); letter-spacing: var(--ls-tight); }
.zee-card-sub   { font-size: var(--fs-sm); color: var(--ink-muted); font-weight: var(--fw-normal); }
.zee-card-body  { padding: var(--s-5); }

/* ============================================================================
   BUTTONS
   ========================================================================= */

.zee-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
    height: 38px;
    padding: 0 var(--s-4);
    border: 1px solid transparent;
    border-radius: var(--r-md);
    font-family: inherit;
    font-size: var(--fs-base);
    font-weight: var(--fw-semibold);
    letter-spacing: var(--ls-tight);
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none;
    transition: transform var(--dur-fast) var(--ease-out),
                box-shadow var(--dur-fast) var(--ease-out),
                background var(--dur-fast) var(--ease-out),
                border-color var(--dur-fast) var(--ease-out),
                color var(--dur-fast) var(--ease-out);
}
.zee-btn:disabled, .zee-btn[aria-disabled="true"] {
    opacity: 0.5; cursor: not-allowed; transform: none !important; box-shadow: none !important;
}
.zee-btn > svg { width: 15px; height: 15px; flex-shrink: 0; }

.zee-btn-primary {
    background: var(--grad-accent);
    color: var(--ink-on-accent);
    box-shadow: var(--glow-soft);
}
.zee-btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: var(--glow-accent); }
.zee-btn-primary:active:not(:disabled) { transform: translateY(0); }

.zee-btn-secondary {
    background: var(--surface);
    color: var(--ink);
    border-color: var(--border);
    box-shadow: var(--shadow-xs);
}
.zee-btn-secondary:hover:not(:disabled) {
    transform: translateY(-2px);
    border-color: var(--accent);
    color: var(--accent-ink);
    box-shadow: var(--shadow-md);
}

.zee-btn-soft {
    background: var(--accent-soft);
    color: var(--accent-ink);
}
.zee-btn-soft:hover:not(:disabled) { background: var(--accent-softer); transform: translateY(-1px); }

.zee-btn-ghost { background: transparent; color: var(--ink-secondary); }
.zee-btn-ghost:hover:not(:disabled) { background: var(--surface-hover); color: var(--ink); }

.zee-btn-danger { background: var(--danger); color: #fff; }
.zee-btn-danger:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 24px rgb(244 63 94 / 0.32); }

.zee-btn-xs { height: 26px; padding: 0 var(--s-2); font-size: var(--fs-xs); border-radius: var(--r-xs); }
.zee-btn-sm { height: 32px; padding: 0 var(--s-3); font-size: var(--fs-sm); }
.zee-btn-lg { height: 46px; padding: 0 var(--s-6); font-size: var(--fs-md); border-radius: var(--r-lg); }
.zee-btn-block { width: 100%; }

/* Square icon-only button. */
.zee-icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px;
    border: 1px solid var(--border-soft);
    border-radius: var(--r-md);
    background: var(--surface);
    color: var(--ink-secondary);
    cursor: pointer;
    transition: all var(--dur-fast) var(--ease-out);
}
.zee-icon-btn:hover { color: var(--accent-ink); border-color: var(--border-accent); background: var(--accent-softer); transform: translateY(-1px); }
.zee-icon-btn > svg { width: 17px; height: 17px; }

/* ============================================================================
   FORMS
   ========================================================================= */

.zee-field { display: flex; flex-direction: column; gap: var(--s-2); }

.zee-label {
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    color: var(--ink-secondary);
    letter-spacing: var(--ls-tight);
}
.zee-label-req::after { content: ' *'; color: var(--danger); }

.zee-input, .zee-select, .zee-textarea {
    width: 100%;
    min-height: 42px;
    padding: 0 var(--s-4);
    font-family: inherit;
    font-size: var(--fs-md);
    color: var(--ink);
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--r-md);
    transition: border-color var(--dur-fast) var(--ease-out),
                box-shadow var(--dur-fast) var(--ease-out),
                background var(--dur-fast) var(--ease-out);
}
.zee-textarea { min-height: 96px; padding: var(--s-3) var(--s-4); line-height: var(--lh-normal); resize: vertical; }

.zee-input::placeholder, .zee-textarea::placeholder { color: var(--ink-faint); }

.zee-input:hover, .zee-select:hover, .zee-textarea:hover { border-color: var(--border-strong); }

.zee-input:focus, .zee-select:focus, .zee-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--ring);
}
.zee-input:disabled, .zee-select:disabled, .zee-textarea:disabled {
    background: var(--surface-sunken); color: var(--ink-muted); cursor: not-allowed;
}
.zee-input-error { border-color: var(--danger) !important; }

.zee-hint  { font-size: var(--fs-sm); color: var(--ink-muted); }
.zee-error { font-size: var(--fs-sm); color: var(--danger-ink); font-weight: var(--fw-medium); }

/* Input with a leading icon. */
.zee-input-group { position: relative; display: flex; align-items: center; }
.zee-input-group > svg {
    position: absolute; left: var(--s-4);
    width: 16px; height: 16px;
    color: var(--ink-faint);
    pointer-events: none;
    transition: color var(--dur-fast) var(--ease-out);
}
.zee-input-group > .zee-input { padding-left: 42px; }
.zee-input-group:focus-within > svg { color: var(--accent); }

/* Trailing affordance (a reveal-password eye, a clear button). */
.zee-input-affix {
    position: absolute; right: var(--s-2);
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px;
    border: none; background: transparent;
    color: var(--ink-faint);
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: all var(--dur-fast) var(--ease-out);
}
.zee-input-affix:hover { color: var(--accent); background: var(--accent-softer); }
.zee-input-group:has(> .zee-input-affix) > .zee-input { padding-right: 42px; }

/* Segmented one-time-code entry. */
.zee-otp { display: flex; gap: var(--s-2); justify-content: center; }
.zee-otp input {
    width: 46px; height: 56px;
    text-align: center;
    font-family: var(--font-mono);
    font-size: var(--fs-2xl);
    font-weight: var(--fw-bold);
    color: var(--ink);
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--r-md);
    transition: all var(--dur-fast) var(--ease-out);
}
.zee-otp input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--ring);
    transform: translateY(-2px);
}
.zee-otp input:not(:placeholder-shown) { border-color: var(--accent); background: var(--accent-softer); }

/* Toggle switch. */
.zee-switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.zee-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.zee-switch-track {
    position: absolute; inset: 0;
    background: var(--border-strong);
    border-radius: var(--r-full);
    transition: background var(--dur-base) var(--ease-out);
    pointer-events: none;
}
.zee-switch-track::before {
    content: '';
    position: absolute; top: 3px; left: 3px;
    width: 18px; height: 18px;
    background: #fff;
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
    transition: transform var(--dur-base) var(--ease-spring);
}
.zee-switch input:checked + .zee-switch-track { background: var(--accent); }
.zee-switch input:checked + .zee-switch-track::before { transform: translateX(18px); }
.zee-switch input:focus-visible + .zee-switch-track { box-shadow: var(--ring); }
.zee-switch input:disabled + .zee-switch-track { opacity: 0.5; }

/* Checkbox. */
.zee-check { display: inline-flex; align-items: center; gap: var(--s-2); cursor: pointer; font-size: var(--fs-md); }
.zee-check input {
    appearance: none; -webkit-appearance: none;
    width: 18px; height: 18px; margin: 0;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--r-xs);
    background: var(--surface);
    cursor: pointer;
    transition: all var(--dur-fast) var(--ease-out);
    flex-shrink: 0;
}
.zee-check input:checked {
    background: var(--accent) center / 11px no-repeat
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8.5l3.5 3.5L13 4'/%3E%3C/svg%3E");
    border-color: var(--accent);
}
.zee-check input:focus-visible { box-shadow: var(--ring); }

/* ============================================================================
   BADGES, PILLS, CHIPS
   ========================================================================= */

.zee-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px;
    border-radius: var(--r-full);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    letter-spacing: var(--ls-tight);
    white-space: nowrap;
    line-height: 1.5;
}
.zee-badge-accent  { background: var(--accent-soft);  color: var(--accent-ink); }
.zee-badge-success { background: var(--success-soft); color: var(--success-ink); }
.zee-badge-warning { background: var(--warning-soft); color: var(--warning-ink); }
.zee-badge-danger  { background: var(--danger-soft);  color: var(--danger-ink); }
.zee-badge-info    { background: var(--info-soft);    color: var(--info-ink); }
.zee-badge-neutral { background: var(--surface-sunken); color: var(--ink-secondary); }
.zee-badge-outline { background: transparent; border: 1px solid var(--border); color: var(--ink-secondary); }

/* Small caps eyebrow label. */
.zee-eyebrow {
    font-size: var(--fs-2xs);
    font-weight: var(--fw-bold);
    letter-spacing: var(--ls-widest);
    text-transform: uppercase;
    color: var(--ink-muted);
}

/* Live status dot. */
.zee-dot {
    display: inline-block; width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--ink-faint);
    flex-shrink: 0;
}
.zee-dot-live    { background: var(--success); animation: zee-pulse-dot 2s var(--ease-in-out) infinite; }
.zee-dot-warning { background: var(--warning); animation: zee-pulse-dot 2s var(--ease-in-out) infinite; }
.zee-dot-danger  { background: var(--danger);  animation: zee-pulse-dot 1.2s var(--ease-in-out) infinite; }
.zee-dot-idle    { background: var(--ink-faint); }

/* Filter chip / segmented tab. */
.zee-chip {
    display: inline-flex; align-items: center; gap: 6px;
    height: 32px; padding: 0 var(--s-3);
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    background: var(--surface);
    color: var(--ink-secondary);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--dur-fast) var(--ease-out);
}
.zee-chip:hover { border-color: var(--border-accent); color: var(--accent-ink); transform: translateY(-1px); }
.zee-chip-active {
    background: var(--grad-accent);
    border-color: transparent;
    color: var(--ink-on-accent);
    box-shadow: var(--glow-soft);
}
.zee-chip-count {
    padding: 0 5px; min-width: 18px;
    border-radius: var(--r-full);
    background: var(--surface-sunken);
    font-size: var(--fs-2xs);
    font-weight: var(--fw-bold);
    text-align: center;
}
.zee-chip-active .zee-chip-count { background: rgb(255 255 255 / 0.25); color: inherit; }

/* Monospace code token, for slugs, IPs and ids. */
.zee-code {
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    padding: 2px 6px;
    border-radius: var(--r-xs);
    background: var(--surface-sunken);
    color: var(--ink-secondary);
    border: 1px solid var(--border-soft);
}

/* ============================================================================
   AVATARS & ICON TILES
   ========================================================================= */

.zee-avatar {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px;
    border-radius: var(--r-full);
    background: var(--grad-accent);
    color: var(--ink-on-accent);
    font-size: var(--fs-base);
    font-weight: var(--fw-bold);
    letter-spacing: var(--ls-tight);
    flex-shrink: 0;
    overflow: hidden;
    user-select: none;
}
.zee-avatar img { width: 100%; height: 100%; object-fit: cover; }
.zee-avatar-sm { width: 28px; height: 28px; font-size: var(--fs-xs); }
.zee-avatar-lg { width: 48px; height: 48px; font-size: var(--fs-lg); }
.zee-avatar-xl { width: 72px; height: 72px; font-size: var(--fs-2xl); }

/* Rounded-square tile — used for app icons and metric glyphs. */
.zee-tile {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px;
    border-radius: var(--r-md);
    background: var(--grad-hue);
    color: #fff;
    flex-shrink: 0;
    transition: transform var(--dur-base) var(--ease-spring);
}
.zee-tile > svg { width: 21px; height: 21px; }
.zee-tile-sm { width: 34px; height: 34px; border-radius: var(--r-sm); }
.zee-tile-sm > svg { width: 17px; height: 17px; }
.zee-tile-lg { width: 56px; height: 56px; border-radius: var(--r-lg); }
.zee-tile-lg > svg { width: 26px; height: 26px; }

/* Pastel tile — a wash rather than a saturated fill. Better in a dense grid. */
.zee-tile-soft { background: var(--accent-soft); color: var(--accent-ink); }

.zee-card-interactive:hover .zee-tile { transform: scale(1.08) rotate(-4deg); }

/* ============================================================================
   METRIC TILES
   ========================================================================= */

.zee-metric {
    position: relative;
    display: flex; flex-direction: column; gap: var(--s-2);
    padding: var(--s-4) var(--s-5);
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.zee-metric:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.zee-metric::before {
    content: '';
    position: absolute; inset: 0 auto 0 0;
    width: 3px;
    background: var(--accent);
}
.zee-metric-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-3); }
.zee-metric-label {
    font-size: var(--fs-xs);
    font-weight: var(--fw-bold);
    letter-spacing: var(--ls-wide);
    text-transform: uppercase;
    color: var(--ink-muted);
}
.zee-metric-value {
    font-family: var(--font-display);
    font-size: var(--fs-3xl);
    font-weight: var(--fw-black);
    letter-spacing: var(--ls-tighter);
    line-height: var(--lh-tight);
    color: var(--ink);
    animation: zee-count-blur var(--dur-slow) var(--ease-out) both;
}
.zee-metric-foot { display: flex; align-items: center; gap: 5px; font-size: var(--fs-sm); color: var(--ink-muted); }
.zee-metric-trend-up   { color: var(--success-ink); font-weight: var(--fw-semibold); }
.zee-metric-trend-down { color: var(--danger-ink);  font-weight: var(--fw-semibold); }

/* ============================================================================
   TABLES
   ========================================================================= */

.zee-table { width: 100%; border-collapse: collapse; font-size: var(--fs-base); }
.zee-table thead th {
    position: sticky; top: 0; z-index: 2;
    padding: var(--s-3) var(--s-4);
    text-align: left;
    font-size: var(--fs-2xs);
    font-weight: var(--fw-bold);
    letter-spacing: var(--ls-wide);
    text-transform: uppercase;
    color: var(--ink-muted);
    background: var(--surface-sunken);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.zee-table tbody td {
    padding: var(--s-3) var(--s-4);
    border-bottom: 1px solid var(--border-soft);
    color: var(--ink-secondary);
    vertical-align: middle;
}
.zee-table tbody tr { transition: background var(--dur-fast) var(--ease-out); }
.zee-table tbody tr:hover { background: var(--surface-hover); }
.zee-table tbody tr:last-child td { border-bottom: none; }
.zee-table-strong td { color: var(--ink); font-weight: var(--fw-medium); }
.zee-table-num { text-align: right; font-variant-numeric: tabular-nums; }

/* ============================================================================
   SKELETONS & LOADERS
   ========================================================================= */

.zee-skeleton {
    background: linear-gradient(90deg,
        var(--surface-sunken) 25%,
        var(--accent-softer)  50%,
        var(--surface-sunken) 75%);
    background-size: 200% 100%;
    animation: zee-shimmer 1.4s linear infinite;
    border-radius: var(--r-sm);
}
.zee-skeleton-text  { height: 11px; }
.zee-skeleton-title { height: 16px; width: 55%; }
.zee-skeleton-tile  { height: 44px; width: 44px; border-radius: var(--r-md); }

.zee-spinner {
    width: 18px; height: 18px;
    border: 2px solid rgb(var(--accent-rgb) / 0.25);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: zee-spin 0.7s linear infinite;
    flex-shrink: 0;
}
.zee-spinner-on-accent { border-color: rgb(255 255 255 / 0.35); border-top-color: #fff; }

/* Determinate progress bar. */
.zee-progress { height: 6px; border-radius: var(--r-full); background: var(--surface-sunken); overflow: hidden; }
.zee-progress-fill {
    height: 100%;
    border-radius: var(--r-full);
    background: var(--grad-hue);
    transition: width var(--dur-slower) var(--ease-out);
}

/* ============================================================================
   EMPTY STATE
   ========================================================================= */

.zee-empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: var(--s-3);
    padding: var(--s-16) var(--s-6);
    text-align: center;
    border: 1.5px dashed var(--border);
    border-radius: var(--r-xl);
    background: var(--surface-sunken);
}
.zee-empty-glyph {
    display: flex; align-items: center; justify-content: center;
    width: 60px; height: 60px;
    border-radius: var(--r-full);
    background: var(--accent-soft);
    color: var(--accent-ink);
}
.zee-empty-glyph > svg { width: 26px; height: 26px; }
.zee-empty-title { font-size: var(--fs-lg); font-weight: var(--fw-bold); color: var(--ink); }
.zee-empty-text  { font-size: var(--fs-md); color: var(--ink-muted); max-width: 380px; }

/* ============================================================================
   MODAL & DRAWER
   ========================================================================= */

.zee-overlay {
    position: fixed; inset: 0;
    z-index: var(--z-overlay);
    display: flex; align-items: center; justify-content: center;
    padding: var(--s-6);
    background: rgb(15 23 42 / 0.45);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    animation: zee-fade-in var(--dur-fast) var(--ease-out) both;
}
.zee-modal {
    width: 100%; max-width: 520px;
    max-height: calc(100vh - var(--s-12));
    display: flex; flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-2xl);
    overflow: hidden;
    animation: zee-scale-in var(--dur-base) var(--ease-spring) both;
}
.zee-modal-lg { max-width: 760px; }
.zee-modal-head {
    display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
    padding: var(--s-5);
    border-bottom: 1px solid var(--border-soft);
}
.zee-modal-body { padding: var(--s-5); overflow-y: auto; }
.zee-modal-foot {
    display: flex; align-items: center; justify-content: flex-end; gap: var(--s-2);
    padding: var(--s-4) var(--s-5);
    border-top: 1px solid var(--border-soft);
    background: var(--surface-sunken);
}

.zee-drawer {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: min(540px, 100vw);
    z-index: var(--z-drawer);
    display: flex; flex-direction: column;
    background: var(--surface);
    border-left: 1px solid var(--border);
    box-shadow: var(--shadow-2xl);
    animation: zee-slide-right var(--dur-base) var(--ease-out) both;
}

/* ============================================================================
   TABS
   ========================================================================= */

.zee-tabs {
    display: flex; gap: 2px;
    padding: 3px;
    border-radius: var(--r-md);
    background: var(--surface-sunken);
    border: 1px solid var(--border-soft);
}
.zee-tab {
    flex: 1;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 32px; padding: 0 var(--s-3);
    border: none;
    border-radius: var(--r-sm);
    background: transparent;
    color: var(--ink-muted);
    font-family: inherit;
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--dur-fast) var(--ease-out);
}
.zee-tab:hover { color: var(--ink); }
.zee-tab-active {
    background: var(--surface);
    color: var(--accent-ink);
    box-shadow: var(--shadow-xs);
}

/* Underline variant, for page-level sections. */
.zee-tabs-underline { display: flex; gap: var(--s-5); border-bottom: 1px solid var(--border); background: none; border-radius: 0; padding: 0; }
.zee-tabs-underline .zee-tab {
    flex: 0 0 auto;
    height: 40px; padding: 0;
    border-radius: 0;
    border-bottom: 2px solid transparent;
    font-size: var(--fs-md);
    background: none;
}
.zee-tabs-underline .zee-tab-active {
    color: var(--accent-ink);
    border-bottom-color: var(--accent);
    box-shadow: none;
    background: none;
}

/* ============================================================================
   ALERTS & TOASTS
   ========================================================================= */

.zee-alert {
    display: flex; align-items: flex-start; gap: var(--s-3);
    padding: var(--s-3) var(--s-4);
    border-radius: var(--r-md);
    border: 1px solid transparent;
    font-size: var(--fs-md);
    animation: zee-fade-down var(--dur-base) var(--ease-out) both;
}
.zee-alert > svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.zee-alert-info    { background: var(--info-soft);    color: var(--info-ink);    border-color: rgb(14 165 233 / 0.22); }
.zee-alert-success { background: var(--success-soft); color: var(--success-ink); border-color: rgb(16 185 129 / 0.22); }
.zee-alert-warning { background: var(--warning-soft); color: var(--warning-ink); border-color: rgb(245 158 11 / 0.24); }
.zee-alert-danger  { background: var(--danger-soft);  color: var(--danger-ink);  border-color: rgb(244 63 94 / 0.22); }
.zee-alert-title   { font-weight: var(--fw-bold); }

.zee-toast-stack {
    position: fixed; bottom: var(--s-6); right: var(--s-6);
    z-index: var(--z-toast);
    display: flex; flex-direction: column; gap: var(--s-2);
    pointer-events: none;
}
.zee-toast {
    display: flex; align-items: center; gap: var(--s-3);
    min-width: 280px; max-width: 400px;
    padding: var(--s-3) var(--s-4);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-xl);
    font-size: var(--fs-md);
    pointer-events: auto;
    animation: zee-slide-right var(--dur-base) var(--ease-spring) both;
}

/* ============================================================================
   TYPOGRAPHY HELPERS
   ========================================================================= */

.zee-h1 { font-family: var(--font-display); font-size: var(--fs-3xl); font-weight: var(--fw-black); letter-spacing: var(--ls-tighter); line-height: var(--lh-tight); margin: 0; }
.zee-h2 { font-family: var(--font-display); font-size: var(--fs-2xl); font-weight: var(--fw-bold);  letter-spacing: var(--ls-tighter); line-height: var(--lh-tight); margin: 0; }
.zee-h3 { font-size: var(--fs-lg); font-weight: var(--fw-bold); letter-spacing: var(--ls-tight); margin: 0; }

/* Gradient-filled display text. Keep to one per screen — it stops being
   special the moment there are two. */
.zee-gradient-text {
    background: linear-gradient(120deg, var(--ink) 0%, var(--accent) 55%, var(--fuchsia-500) 100%);
    background-size: 250% 250%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: zee-gradient-sweep 7s var(--ease-in-out) infinite;
}

.zee-muted     { color: var(--ink-muted); }
.zee-secondary { color: var(--ink-secondary); }
.zee-truncate  { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zee-clamp-2   { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.zee-mono      { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* Decorative rule with a centre diamond. */
.zee-rule { display: flex; align-items: center; gap: var(--s-3); }
.zee-rule::before, .zee-rule::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.zee-rule-gem { width: 6px; height: 6px; background: var(--accent); transform: rotate(45deg); flex-shrink: 0; }

/* ============================================================================
   LAYOUT HELPERS
   Deliberately minimal — enough to avoid inline flex soup, not a utility
   framework. Anything structural belongs in the page's own scoped CSS.
   ========================================================================= */

.zee-row   { display: flex; align-items: center; gap: var(--s-3); }
.zee-row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.zee-col   { display: flex; flex-direction: column; gap: var(--s-3); }
.zee-wrap  { flex-wrap: wrap; }
.zee-grow  { flex: 1; min-width: 0; }
.zee-spacer{ flex: 1; }

.zee-grid       { display: grid; gap: var(--s-4); }
.zee-grid-auto  { grid-template-columns: repeat(auto-fill, minmax(264px, 1fr)); }
.zee-grid-2     { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.zee-grid-3     { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.zee-grid-4     { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.zee-page { max-width: var(--content-max); margin: 0 auto; padding: var(--s-8) var(--s-8) var(--s-20); }

.zee-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-4); margin-bottom: var(--s-4); }

@media (max-width: 1200px) {
    .zee-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .zee-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
    .zee-grid-4, .zee-grid-3, .zee-grid-2 { grid-template-columns: minmax(0, 1fr); }
    .zee-page { padding: var(--s-5) var(--s-4) var(--s-16); }
    .zee-section-head { flex-direction: column; align-items: flex-start; }
}
