/* =====================================================================
   DWARG — global visual design system
   Brand from the logo: ink, wave, sun, leaf, flame. Plus Jakarta Sans.
   Pages inherit these tokens; do not restyle the logo asset.
   ===================================================================== */
:root {
    /* Color — legacy aliases onto theme.css tokens (Bae Laban palette) */
    --ink: var(--text-primary);
    --ink-2: var(--text-strong);
    --ink-3: var(--n-800);
    --muted: var(--text-secondary);
    --line: var(--n-200);
    --line-2: var(--n-100);
    --bg: var(--background);
    --card: var(--surface);
    --surface-2: var(--surface-soft);

    --brand: var(--primary);
    --wave: var(--primary);
    --brand-400: var(--primary-light);
    --brand-600: var(--primary-dark);
    --brand-700: var(--primary-darker);
    --brand-50: var(--primary-softer);
    --brand-100: var(--primary-soft);
    --sun: var(--accent);
    --sun-600: var(--warning);
    --sun-50: var(--warning-soft);
    --leaf: var(--success);
    --leaf-600: var(--success);
    --leaf-50: var(--success-soft);
    --flame: var(--danger);
    --flame-600: var(--danger-dark);
    --flame-50: var(--danger-soft);

    --sidebar: var(--bl-navy-900);
    --sidebar-2: var(--bl-navy-800);

    /* Type */
    --font: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    --text-xs: .6875rem;
    --text-sm: .8125rem;
    --text-md: .9375rem;
    --text-lg: 1.0625rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.85rem;
    --leading: 1.55;
    --leading-tight: 1.25;
    --tracking: -.011em;
    --tracking-tight: -.028em;
    --tracking-wide: .08em;
    --weight-medium: 500;
    --weight-semibold: 600;
    --weight-bold: 700;

    /* Space */
    --space-1: .25rem;
    --space-2: .5rem;
    --space-3: .75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;

    /* Radii */
    --radius-xs: 8px;
    --radius-sm: 10px;
    --radius-btn: 11px;
    --radius: 16px;
    --radius-lg: 20px;
    --radius-full: 999px;

    /* Elevation — whisper, not dramatic */
    --shadow-xs: 0 1px 1px rgba(var(--shadow-rgb), .03);
    --shadow-sm: 0 1px 2px rgba(var(--shadow-rgb), .04), 0 8px 20px -12px rgba(var(--shadow-rgb), .1);
    --shadow: 0 1px 2px rgba(var(--shadow-rgb), .04), 0 16px 40px -20px rgba(var(--shadow-rgb), .18);
    --shadow-md: 0 10px 28px -14px rgba(var(--shadow-rgb), .2);
    --shadow-lg: 0 30px 80px -30px rgba(var(--shadow-rgb), .45);
    --shadow-hover: 0 2px 6px rgba(var(--shadow-rgb), .06), 0 24px 56px -24px rgba(var(--shadow-rgb), .32);
    --glow: var(--shadow-glow);
    --brand-strip: var(--grad-line);
    --border-whisper: 1px solid var(--border-soft);

    /* Motion */
    --ease: cubic-bezier(.2, .75, .2, 1);
    --ease-out: var(--ease-lux);
    --duration: .2s;
    --duration-fast: .14s;
    --duration-sheet: .28s;

    /* Controls */
    --control-h: 2.5rem;
    --control-h-sm: 2.125rem;
    --control-h-lg: 2.875rem;
    --touch: 44px;
    --ring: 0 0 0 3px rgba(var(--primary-light-rgb), .28);
    --ring-danger: 0 0 0 3px rgba(var(--danger-rgb), .22);
    --ring-success: 0 0 0 3px rgba(var(--success-rgb), .22);

    /* Bootstrap bridges */
    --bs-primary: var(--brand);
    --bs-primary-rgb: var(--primary-rgb);
    --bs-body-font-family: var(--font);
    --bs-body-color: var(--ink);
    --bs-border-color: var(--line);
    --bs-border-radius: var(--radius);
    --bs-link-color: var(--brand);
    --bs-link-color-rgb: var(--primary-rgb);
    --bs-link-hover-color: var(--brand-600);
    --bs-link-hover-color-rgb: 38, 42, 134;
    --bs-success-rgb: var(--success-rgb);
    --bs-danger-rgb: var(--danger-rgb);
    --bs-warning-rgb: var(--warning-rgb);
    --bs-secondary-rgb: 93, 97, 128;
    --bs-body-bg: var(--bg);
}

* { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    font-size: var(--text-md);
    font-weight: 450;
    line-height: var(--leading);
    color: var(--ink);
    background: var(--bg);
    letter-spacing: var(--tracking);
}
h1, h2, h3 { font-weight: 750; letter-spacing: var(--tracking-tight); color: var(--ink); line-height: var(--leading-tight); }
h4, h5, h6 { font-weight: var(--weight-bold); letter-spacing: -.02em; color: var(--ink); line-height: var(--leading-tight); }
a { text-decoration: none; transition: color .15s var(--ease); }
::selection { background: var(--accent); color: var(--secondary); }
.text-muted { color: var(--muted) !important; }
.text-primary { color: var(--brand) !important; }
.text-success { color: var(--leaf-600) !important; }
.text-danger { color: var(--flame) !important; }
.text-warning { color: var(--sun-600) !important; }
.bg-primary { background-color: var(--brand) !important; }
.fw-semibold { font-weight: 600 !important; }
.small-caps { font-size: var(--text-xs); letter-spacing: .1em; text-transform: uppercase; font-weight: 700; color: var(--muted); }
.mono { font-family: var(--font-mono); font-size: .85em; font-variant-numeric: tabular-nums; }
.brand-strip { height: 3px; border-radius: var(--radius-full); background: var(--brand-strip); }
.logo { height: 34px; width: auto; display: block; }
.logo-sm { height: 26px; }
.logo-lg { height: 48px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--n-300); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--n-300); border: 3px solid transparent; background-clip: content-box; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    min-height: var(--control-h);
    font-weight: var(--weight-semibold);
    font-size: var(--text-sm);
    line-height: 1.2;
    border-radius: var(--radius-btn);
    padding: .5rem 1.05rem;
    letter-spacing: -.01em;
    box-shadow: none;
    transform: translateZ(0);
    transition: background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), color var(--duration-fast) var(--ease), box-shadow var(--duration) var(--ease), transform .12s var(--ease-out), opacity var(--duration-fast) var(--ease);
}
.btn > .me-1 { margin-right: 0 !important; }
.btn > i, .btn > .bi { font-size: 1.05em; line-height: 1; flex-shrink: 0; }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn-sm { min-height: var(--control-h-sm); padding: .32rem .75rem; font-size: .78rem; border-radius: var(--radius-sm); }
.btn-lg { min-height: var(--control-h-lg); padding: .7rem 1.35rem; border-radius: 12px; font-size: .95rem; }
@media (hover: hover) and (pointer: fine) {
    .btn:hover:not(:disabled):not(.disabled):not(.btn-link) { transform: translateY(-1px); }
    .btn-primary:hover:not(:disabled):not(.disabled),
    .btn-dark:hover:not(:disabled):not(.disabled),
    .btn-ink:hover:not(:disabled):not(.disabled) { transform: translateY(-1px); }
}
.btn:active:not(:disabled):not(.disabled):not(.btn-link) { transform: scale(.98); }
.btn:disabled, .btn.disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
    pointer-events: none;
}
.btn-primary {
    background: var(--brand);
    border: 1px solid transparent;
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), var(--glow);
}
.btn-primary:hover, .btn-primary:focus-visible { background: var(--brand-600); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 12px 24px -12px rgba(var(--primary-light-rgb), .55); }
.btn-primary:disabled, .btn-primary.disabled { background: var(--brand-400); color: #fff; opacity: .55; }
.btn-secondary, .btn-light {
    background: #fff;
    border: 1px solid var(--line);
    color: var(--ink-2);
    box-shadow: var(--shadow-xs);
}
.btn-secondary:hover, .btn-light:hover { background: var(--surface-2); border-color: var(--n-300); color: var(--ink); }
.btn-dark, .btn-ink { background: var(--ink); border: 1px solid transparent; color: #fff; box-shadow: 0 8px 18px -12px rgba(var(--shadow-rgb), .55); }
.btn-dark:hover, .btn-ink:hover { background: var(--n-800); color: #fff; }
.btn-ghost, .btn-outline-light.btn-ghost {
    background: transparent;
    border: 1px solid transparent;
    color: var(--ink-2);
    box-shadow: none;
}
.btn-ghost:hover { background: var(--line-2); color: var(--ink); }
.btn-soft { background: var(--brand-50); color: var(--brand-600); border: 1px solid transparent; }
.btn-soft:hover { background: var(--brand-100); color: var(--brand-700); }
.btn-success { background: var(--leaf-600); border: 1px solid transparent; color: #fff; box-shadow: 0 8px 18px -12px rgba(var(--success-rgb), .4); }
.btn-success:hover { background: var(--success); color: #fff; }
.btn-danger { background: var(--flame); border: 1px solid transparent; color: #fff; box-shadow: 0 8px 18px -12px rgba(var(--danger-rgb), .4); }
.btn-danger:hover, .btn-danger:focus-visible { background: var(--flame-600); color: #fff; }
.btn-danger:focus-visible { box-shadow: var(--ring-danger); }
.btn-warning { background: var(--warning-soft); border: 1px solid rgba(var(--warning-rgb), .22); color: var(--warning-dark); }
.btn-warning:hover { background: var(--bl-ice-200); color: var(--ink); }
.btn-outline-primary { color: var(--brand); border-color: var(--bl-ice-200); background: #fff; }
.btn-outline-primary:hover { background: var(--brand-50); border-color: var(--brand-400); color: var(--brand-700); }
.btn-outline-danger { color: var(--flame); border-color: var(--danger-light); background: #fff; }
.btn-outline-danger:hover { background: var(--flame-50); border-color: var(--flame); color: var(--flame-600); }
.btn-outline-secondary { border-color: var(--line); color: var(--ink-2); background: #fff; }
.btn-outline-secondary:hover { background: var(--surface-2); border-color: var(--n-300); color: var(--ink); }
.btn-link { color: var(--brand); font-weight: 600; min-height: auto; padding: .2rem .35rem; box-shadow: none; transform: none; }
.btn-link:hover { color: var(--brand-700); }
.btn-icon { width: 40px; height: 40px; min-height: 40px; padding: 0; gap: 0; border-radius: var(--radius-sm); border: 0; background: transparent; color: var(--ink-2); font-size: 1.15rem; box-shadow: none; }
.btn-icon:hover { background: var(--line-2); color: var(--ink); }
.btn-group > .btn { box-shadow: none; }
.btn-group > .btn:hover, .btn-group > .btn:active { transform: none; }
.btn .spinner-border { width: 1rem; height: 1rem; border-width: .15em; }

/* ---------- Forms ---------- */
.form-control, .form-select, textarea.form-control {
    border-radius: var(--radius-sm);
    border: 1px solid var(--n-200);
    font-size: var(--text-sm);
    min-height: var(--control-h);
    padding: .5rem .85rem;
    background-color: #fff;
    color: var(--ink);
    box-shadow: none;
    transition: border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease);
}
textarea.form-control { min-height: 6.5rem; height: auto; line-height: 1.5; }
.form-control::placeholder, .form-select::placeholder { color: var(--n-400); }
.form-control:hover, .form-select:hover { border-color: var(--n-300); }
.form-control:focus, .form-select:focus, textarea.form-control:focus {
    border-color: var(--wave);
    box-shadow: var(--ring);
    outline: none;
}
.form-control:disabled, .form-select:disabled, textarea.form-control:disabled {
    background: var(--surface-2);
    color: var(--muted);
    opacity: 1;
    cursor: not-allowed;
}
.form-control-sm, .form-select-sm { min-height: var(--control-h-sm); border-radius: var(--radius-sm); padding: .32rem .65rem; font-size: .8rem; }
.form-control-lg, .form-select-lg { min-height: var(--control-h-lg); border-radius: 12px; padding: .7rem 1rem; font-size: 1rem; }
.form-label, label.form-label {
    font-weight: var(--weight-semibold);
    font-size: .78rem;
    color: var(--ink-2);
    margin-bottom: .38rem;
    letter-spacing: .01em;
}
.form-text { font-size: .74rem; color: var(--muted); }
.form-check { min-height: 1.5rem; }
.form-check-input {
    width: 1.1rem;
    height: 1.1rem;
    margin-top: .15rem;
    border-color: var(--n-300);
    border-radius: 5px;
    transition: background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease);
}
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { box-shadow: var(--ring); border-color: var(--wave); }
.form-check-label { font-weight: 500; color: var(--ink-2); }
.form-switch .form-check-input { width: 2.35em; height: 1.28em; border-radius: var(--radius-full); }
.input-group-text { background: var(--surface-2); border-color: var(--n-200); border-radius: var(--radius-sm); color: var(--muted); font-weight: 600; font-size: var(--text-sm); }
.input-group > .form-control, .input-group > .form-select { box-shadow: none; }
.input-group:focus-within { box-shadow: var(--ring); border-radius: var(--radius-sm); }
.input-group:focus-within > .form-control:focus,
.input-group:focus-within > .form-select:focus { box-shadow: none; }
.required::after, label.required::after, .form-label.required::after { content: ' *'; color: var(--flame); font-weight: 700; }
.required-mark { color: var(--flame); font-weight: 700; }
.is-invalid, .form-control.is-invalid, .form-select.is-invalid { border-color: var(--flame) !important; }
.form-control.is-invalid:focus, .form-select.is-invalid:focus { box-shadow: var(--ring-danger) !important; }
.is-valid, .form-control.is-valid, .form-select.is-valid { border-color: var(--leaf-600); }
.form-control.is-valid:focus, .form-select.is-valid:focus { box-shadow: var(--ring-success); }
.invalid-feedback { color: var(--flame); font-weight: 600; font-size: .75rem; }
.valid-feedback { color: var(--leaf-600); font-weight: 600; font-size: .75rem; }

/* ---------- App shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 280px; flex-shrink: 0; background: var(--bl-navy-900); color: var(--n-300); display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; z-index: 1040; transform: translate3d(0, 0, 0); will-change: width; transition: transform .3s var(--ease-out), width .32s var(--ease-out); }
.sidebar-brand { display: flex; align-items: center; justify-content: space-between; padding: 1.15rem 1rem .35rem 1rem; gap: .5rem; }
.brand { display: flex; align-items: center; gap: .7rem; color: #fff; min-width: 0; }
.brand .logo { height: 32px; }
.brand .logo.logo-lg { height: 46px; }
.brand .logo-mark { display: none; width: 34px; height: 34px; object-fit: cover; border-radius: 10px; }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; background: var(--ink); display: grid; place-items: center; overflow: hidden; flex-shrink: 0; box-shadow: 0 8px 20px -10px rgba(var(--shadow-rgb), .9); }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.brand-text { font-weight: 800; font-size: 1.05rem; letter-spacing: -.01em; line-height: 1.15; min-width: 0; }
.brand-text small { display: block; font-weight: 600; font-size: .72rem; color: var(--n-500); letter-spacing: 0; max-width: 170px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tenant-head { display: flex; align-items: center; gap: .8rem; min-width: 0; color: #fff; flex: 1; padding: .15rem .15rem .15rem .1rem; }
.tenant-head .tc-avatar { width: 46px; height: 46px; border-radius: 14px; background: #fff; color: var(--brand-700); display: grid; place-items: center; font-weight: 800; font-size: .85rem; flex-shrink: 0; overflow: hidden; box-shadow: 0 8px 20px -12px rgba(0, 0, 0, .5); }
.tenant-head .tc-avatar img { width: 100%; height: 100%; object-fit: cover; background: #fff; }
.tenant-head-copy { min-width: 0; }
.tenant-head-copy strong { display: block; font-size: .92rem; font-weight: 800; letter-spacing: -.01em; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: uppercase; }
.tenant-head-copy small { display: block; margin-top: .12rem; font-size: .68rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--brand-400); }
.tenant-chip { margin: .9rem 1rem .35rem; display: flex; align-items: center; gap: .65rem; padding: .6rem .7rem; border-radius: 14px; background: rgba(255, 255, 255, .045); border: 1px solid rgba(255, 255, 255, .06); }
.tenant-chip .tc-avatar { width: 32px; height: 32px; border-radius: 10px; background: linear-gradient(135deg, var(--brand-400), var(--brand-600)); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: .75rem; flex-shrink: 0; overflow: hidden; }
.tenant-chip .tc-avatar img { width: 100%; height: 100%; object-fit: cover; background: #fff; }
.tenant-chip > div { min-width: 0; }
.tenant-chip strong { display: block; color: #fff; font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tenant-chip small { color: var(--n-500); font-size: .7rem; }
.nav-search { position: relative; margin: .85rem 1rem .55rem; }
.nav-search > i { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--n-500); font-size: .95rem; pointer-events: none; }
.nav-search input { width: 100%; height: 42px; border: 0; border-radius: 999px; background: var(--bl-navy-800); color: var(--n-100); padding: 0 1rem 0 2.4rem; font-size: .84rem; font-weight: 600; outline: none; }
.nav-search input::placeholder { color: var(--n-500); }
.nav-search input:focus { box-shadow: 0 0 0 2px rgba(var(--primary-light-rgb), .35); }
.nav-now { display: flex; align-items: center; gap: .7rem; margin: 0 1rem .7rem; padding: .7rem .85rem; border-radius: 16px; background: var(--bl-navy-800); color: #fff; }
.nav-now > i { color: var(--brand-400); font-size: 1.05rem; }
.nav-now span { display: block; font-size: .62rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--n-500); }
.nav-now strong { display: block; font-size: .92rem; font-weight: 800; letter-spacing: -.015em; margin-top: .05rem; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: .15rem .7rem 1rem; scrollbar-width: thin; scrollbar-color: var(--bl-navy-700) transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--bl-navy-700); border: 3px solid transparent; background-clip: content-box; }
.nav-section { margin-bottom: .15rem; }
.nav-group { width: 100%; display: flex; align-items: center; gap: .7rem; font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--n-300); padding: .72rem .85rem; border: 0; background: transparent; border-radius: 16px; cursor: pointer; text-align: left; transition: background .18s, color .18s; }
.nav-group:hover { color: #fff; background: rgba(255, 255, 255, .04); }
.nav-group-ic { font-size: 1.15rem; width: 22px; text-align: center; letter-spacing: 0; text-transform: none; color: var(--primary-light); }
.nav-group-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-group-chev { margin-left: auto; font-size: .85rem; letter-spacing: 0; color: var(--n-500); transition: transform .28s cubic-bezier(.2, .8, .2, 1); }
.nav-section.is-open .nav-group-chev { transform: rotate(180deg); }
.nav-section.is-open > .nav-group,
.nav-section.is-current > .nav-group { background: var(--bl-navy-800); color: #fff; position: relative; }
.nav-section.is-open > .nav-group .nav-group-ic,
.nav-section.is-current > .nav-group .nav-group-ic { color: var(--bl-ice-300); }
.nav-section.is-open > .nav-group::after { content: ''; position: absolute; left: 1.35rem; bottom: -7px; width: 18px; height: 10px; background: var(--bl-navy-800); clip-path: polygon(0 0, 100% 0, 50% 100%); }
.nav-items { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .32s cubic-bezier(.2, .8, .2, 1); }
.nav-section.is-open .nav-items { grid-template-rows: 1fr; }
.nav-items-inner { overflow: hidden; min-height: 0; padding: .55rem 0 .2rem .35rem; }
.nav-fly-h { display: none; }
.sidebar .nav-link { position: relative; display: flex; align-items: center; gap: .7rem; color: var(--n-400); padding: .48rem .7rem .48rem .85rem; border-radius: 12px; font-weight: 600; font-size: .84rem; margin-bottom: 1px; transition: background .15s var(--ease), color .15s var(--ease); }
.sidebar .nav-link i { font-size: 1.05rem; width: 20px; text-align: center; color: var(--n-500); flex-shrink: 0; }
.sidebar .nav-link span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar .nav-link:hover { background: rgba(255, 255, 255, .04); color: #fff; }
.sidebar .nav-link:hover i { color: var(--bl-ice-200); }
.sidebar .nav-link.active { background: rgba(var(--primary-light-rgb), .16); color: #fff; }
.sidebar .nav-link.active i { color: var(--brand-400); }
.sidebar .nav-link.active::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 14px;
    border-radius: 99px;
    background: var(--brand-400);
}
.nav-section.is-hidden { display: none; }
.sidebar-footer { padding: .85rem 1rem 1.1rem; }
.sidebar-collapse { width: 100%; display: flex; align-items: center; justify-content: center; gap: .55rem; height: 46px; border: 0; border-radius: 999px; background: var(--bl-navy-800); color: var(--bl-ice-150); font-weight: 800; font-size: .92rem; letter-spacing: -.01em; }
.sidebar-collapse:hover { background: var(--bl-navy-800); color: #fff; }
.sidebar-collapse i { font-size: .95rem; transition: transform .28s cubic-bezier(.2, .8, .2, 1); }
html.sidebar-rail .sidebar-collapse i { transform: rotate(180deg); }
.plan-chip { display: flex; gap: .75rem; align-items: center; background: linear-gradient(135deg, rgba(var(--accent-rgb), .12), rgba(255, 255, 255, .03)); border: 1px solid rgba(var(--accent-rgb), .16); border-radius: 14px; padding: .75rem .85rem; color: inherit; }
.plan-chip:hover { border-color: rgba(var(--accent-rgb), .35); }
.plan-chip i { color: var(--sun); font-size: 1.25rem; }
.plan-chip strong { display: block; color: #fff; font-size: .82rem; }
.plan-chip small { color: var(--n-400); font-size: .72rem; }
.main { flex: 1; margin-left: 280px; min-width: 0; display: flex; flex-direction: column; transform: translate3d(0, 0, 0); transition: margin-left .32s var(--ease-out); }
.topbar { position: sticky; top: 0; z-index: 1030; display: flex; align-items: center; gap: .75rem; padding: .75rem 1.75rem; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px); border-bottom: 1px solid rgba(225, 228, 240, .7); }
.topbar-logo { display: none; }
.topbar-brand { display: none; }
.global-search { position: relative; flex: 1; max-width: 560px; }
.global-search > i { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; z-index: 1; }
.global-search input { width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: .62rem 3.4rem .62rem 2.6rem; font-size: .86rem; outline: none; transition: border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease); box-shadow: none; }
.global-search input:focus { border-color: var(--wave); box-shadow: var(--ring); }
.global-search::after {
    content: '/';
    position: absolute;
    right: .7rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .02em;
    color: var(--muted);
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: .14rem .42rem;
    pointer-events: none;
    line-height: 1.2;
    font-family: var(--font);
}
html[data-mod="cmd"] .global-search::after { content: '⌘K'; }
html[data-mod="ctrl"] .global-search::after { content: 'Ctrl K'; }
.search-results { position: absolute; top: calc(100% + 8px); left: 0; right: 0; background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); border: var(--border-whisper); display: none; max-height: 440px; overflow-y: auto; z-index: 1050; padding: .4rem; }
.search-results.show { display: block; animation: pop .16s var(--ease); }
.search-results .sr-group { padding: .55rem .75rem .25rem; font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.search-results a { display: flex; align-items: center; gap: .7rem; padding: .55rem .75rem; color: var(--ink); border-radius: 10px; min-height: 44px; }
.search-results a:hover, .search-results a.focus { background: var(--brand-50); }
.search-results a i { color: var(--brand); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.branch-switch { min-width: 160px; border-radius: 12px; }
.user-btn { display: flex; align-items: center; gap: .6rem; padding: .25rem .6rem .25rem .25rem; border-radius: 14px; border: 1px solid transparent; background: transparent; }
.user-btn:hover { background: #fff; border-color: var(--line); }
.user-btn small { font-size: .72rem; }
.avatar { width: 36px; height: 36px; border-radius: 12px; background: linear-gradient(135deg, var(--brand-400), var(--brand-600)); color: #fff; display: inline-grid; place-items: center; font-weight: 800; font-size: .78rem; flex-shrink: 0; letter-spacing: .02em; }
.avatar-lg { width: 60px; height: 60px; border-radius: 18px; font-size: 1.2rem; }
.avatar-ink { background: linear-gradient(135deg, var(--n-700), var(--ink)); box-shadow: inset 0 -3px 0 var(--leaf); }
.avatar-soft { background: var(--brand-50); color: var(--brand-600); }
.notif-dot { position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--flame); color: #fff; font-size: .62rem; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--bg); }
.notif-menu { width: 380px; border-radius: 18px; overflow: hidden; }
.notif-list { max-height: 400px; overflow-y: auto; }
.notif-item { display: flex; gap: .75rem; padding: .8rem 1rem; border-bottom: 1px solid var(--line-2); color: var(--ink); }
.notif-item:hover { background: var(--surface-soft); }
.notif-item.unread { background: var(--brand-50); }
.notif-item .ni-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.notif-item .ni-title { font-weight: 700; font-size: .83rem; }
.notif-item .ni-msg { font-size: .78rem; color: var(--muted); }
.trial-banner { background: linear-gradient(90deg, var(--primary-soft), var(--primary-softer)); color: var(--primary-darker); padding: .6rem 1.75rem; font-size: .84rem; border-bottom: 1px solid var(--accent-soft); }
.trial-banner a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.announce-banner { background: linear-gradient(90deg, var(--brand-50), var(--bl-ice-50)); color: var(--brand-700); border-bottom-color: var(--brand-100); }
.content { padding: 1.75rem; flex: 1; min-width: 0; max-width: 100%; animation: contentIn .2s var(--ease) both; }
.sidebar-backdrop { display: none; }
:root { --tabbar-h: 0px; }
.mobile-tabbar { display: none; }
.more-sheet, .more-backdrop { display: none; }
@keyframes contentIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }

@media (max-width: 991.98px) {
    :root { --tabbar-h: calc(56px + env(safe-area-inset-bottom, 0px)); }
    html, body.app-body { overflow-x: hidden; max-width: 100%; }
    html:has(.mobile-tabbar), body.app-body:has(.mobile-tabbar) { background: var(--sidebar); }
    .sidebar, .sidebar-backdrop { display: none !important; }
    .main { margin-left: 0; min-width: 0; padding-bottom: 0; }
    body.app-body:has(.mobile-tabbar) .main { background: var(--bg); }
    .content { padding: 1rem .9rem var(--tabbar-h); }
    .topbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-rows: auto auto;
        align-items: center;
        column-gap: .5rem;
        row-gap: .55rem;
        padding: calc(.5rem + env(safe-area-inset-top, 0px)) max(.9rem, env(safe-area-inset-right)) .6rem max(.9rem, env(safe-area-inset-left));
    }
    .topbar-logo { display: block; }
    .topbar-logo img { height: 24px; }
    .topbar-brand {
        display: flex;
        align-items: center;
        gap: .6rem;
        min-width: 0;
        grid-column: 1;
        grid-row: 1;
        color: var(--ink);
        -webkit-tap-highlight-color: transparent;
    }
    .topbar-brand:hover { color: var(--ink); }
    .topbar-brand-mark {
        width: 36px;
        height: 36px;
        border-radius: 10px;
        background: #fff;
        color: var(--brand-700);
        border: 1px solid var(--line);
        box-shadow: var(--shadow-xs);
        display: grid;
        place-items: center;
        font-weight: 800;
        font-size: .72rem;
        letter-spacing: .02em;
        flex-shrink: 0;
        overflow: hidden;
    }
    .topbar-brand-mark img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        background: #fff;
    }
    .topbar-brand-copy { min-width: 0; flex: 1; }
    .topbar-brand-name {
        display: block;
        font-family: inherit;
        font-size: .95rem;
        font-weight: 600;
        letter-spacing: -.02em;
        line-height: 1.2;
        color: var(--ink);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .topbar-actions {
        grid-column: 2;
        grid-row: 1;
        margin-left: 0;
        display: flex;
        flex-wrap: nowrap;
        flex-shrink: 0;
        gap: .35rem;
    }
    .topbar-actions .pwa-topbar-btn {
        width: 40px;
        height: 40px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
    }
    .topbar-actions .pwa-topbar-btn span { display: none; }
    .topbar-actions .topbar-create {
        width: 40px;
        height: 40px;
        padding: 0;
        border-radius: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .topbar-actions .topbar-create span { display: none; }
    .topbar-actions .btn-icon { width: 40px; height: 40px; border-radius: 50%; }
    .topbar-actions .user-btn { padding: 0; border: 0; background: transparent; }
    .topbar-actions .user-btn:hover { background: transparent; border-color: transparent; }
    .topbar-actions .avatar {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        font-size: .72rem;
        box-shadow: 0 8px 16px -10px rgba(var(--primary-light-rgb), .7);
    }
    .global-search {
        grid-column: 1 / -1;
        grid-row: 2;
        max-width: none;
        width: 100%;
    }
    .global-search input { font-size: 16px; padding-top: .55rem; padding-bottom: .55rem; padding-right: 1rem; }
    .global-search::after { display: none; }
    .trial-banner { padding: .55rem .9rem; }
    .notif-menu { width: min(380px, calc(100vw - 1.5rem)); }
    html.sidebar-rail .sidebar { width: 280px; }
    html.sidebar-rail .main { margin-left: 0; }
    .row { --bs-gutter-x: .75rem; }
    .card, .stat-card, .table-responsive { max-width: 100%; }
    .page-header .actions { width: 100%; }
    .page-header .actions .btn { min-height: 44px; }

    .mobile-tabbar {
        display: flex;
        position: fixed;
        left: 0; right: 0; bottom: 0;
        z-index: 1045;
        height: var(--tabbar-h);
        box-sizing: border-box;
        margin: 0;
        padding: 4px 0 env(safe-area-inset-bottom, 0px);
        background: color-mix(in srgb, var(--bl-navy-900) 86%, transparent);
        backdrop-filter: saturate(180%) blur(20px);
        -webkit-backdrop-filter: saturate(180%) blur(20px);
        border-top: 1px solid rgba(255, 255, 255, .08);
        align-items: flex-start;
    }
    .mobile-tabbar a, .mobile-tabbar .tab-more {
        flex: 1 1 0;
        min-width: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: .15rem;
        height: 48px;
        min-height: var(--touch);
        padding: 0 .15rem;
        border: 0;
        background: none;
        color: var(--n-500);
        font-size: .62rem;
        font-weight: 700;
        letter-spacing: -.01em;
        line-height: 1.1;
        text-align: center;
        border-radius: 12px;
        -webkit-tap-highlight-color: transparent;
        position: relative;
        transition: color var(--duration-fast) var(--ease);
    }
    .mobile-tabbar a span, .mobile-tabbar .tab-more span {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .mobile-tabbar i { font-size: 1.22rem; line-height: 1; }
    .mobile-tabbar a.active, .mobile-tabbar a:active, .mobile-tabbar .tab-more.active { color: #fff; }
    .mobile-tabbar a.active i, .mobile-tabbar .tab-more.active i { color: var(--brand-400); }
    .mobile-tabbar a.active::before, .mobile-tabbar .tab-more.active::before {
        content: '';
        width: 22px;
        height: 3px;
        border-radius: 99px;
        background: var(--brand-400);
        position: absolute;
        top: 3px;
        box-shadow: 0 0 0 3px rgba(var(--primary-light-rgb), .16);
    }
    @supports not (background: color-mix(in srgb, #000 50%, transparent)) {
        .mobile-tabbar { background: var(--bl-navy-900); }
    }

    .more-backdrop {
        display: block;
        position: fixed; inset: 0;
        z-index: 1046;
        background: rgba(var(--secondary-rgb), .45);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        opacity: 0; visibility: hidden;
        transition: opacity var(--duration-sheet) var(--ease), visibility var(--duration-sheet);
    }
    .more-backdrop.is-open { opacity: 1; visibility: visible; }
    .more-sheet {
        display: flex;
        flex-direction: column;
        position: fixed;
        left: 0; right: 0;
        bottom: var(--tabbar-h);
        z-index: 1047;
        height: calc(100dvh - var(--tabbar-h));
        max-height: calc(100dvh - var(--tabbar-h));
        background: var(--bl-navy-900);
        border-radius: 22px 22px 0 0;
        transform: translate3d(0, 110%, 0);
        opacity: 0;
        pointer-events: none;
        will-change: transform, opacity;
        transition: transform .32s var(--ease-out), opacity .24s var(--ease);
        padding: 0;
        overflow: hidden;
        color: var(--bl-ice-150);
    }
    .more-sheet.is-open { transform: translate3d(0, 0, 0); opacity: 1; pointer-events: auto; }
    .more-handle { width: 40px; height: 4px; border-radius: 99px; background: rgba(255,255,255,.22); margin: .55rem auto .15rem; flex-shrink: 0; }
    .more-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; padding: .55rem 1rem .7rem; flex-shrink: 0; }
    .more-kicker { font-size: .62rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--brand-400); }
    .more-head h2 { font-size: 1.12rem; margin: .1rem 0 0; letter-spacing: -.03em; color: #fff; }
    .more-close { width: 40px; height: 40px; border: 0; border-radius: 12px; background: rgba(255,255,255,.08); color: #fff; }
    .more-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0 .7rem .4rem; }
    .more-group { margin-bottom: .45rem; }
    .more-group-h {
        width: 100%; display: flex; align-items: center; gap: .5rem;
        font-size: .64rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
        color: var(--n-500); padding: .62rem .7rem; border: 0; background: transparent;
        border-radius: 14px; cursor: pointer; text-align: left; font-family: inherit;
        -webkit-appearance: none; appearance: none;
        transition: background .18s, color .18s;
    }
    .more-group-h:hover, .more-group-h:focus-visible { color: #fff; background: rgba(255, 255, 255, .04); outline: none; }
    .more-group-ic { font-size: .95rem; width: 18px; text-align: center; letter-spacing: 0; text-transform: none; color: var(--bl-ice-300); }
    .more-group-label { flex: 1; min-width: 0; }
    .more-group-chev { margin-left: auto; font-size: .85rem; letter-spacing: 0; color: var(--n-500); transition: transform .28s cubic-bezier(.2, .8, .2, 1); }
    .more-group.is-open .more-group-chev { transform: rotate(180deg); }
    .more-group.is-open > .more-group-h,
    .more-group.is-current > .more-group-h { background: var(--bl-navy-800); color: #fff; }
    .more-group.is-open > .more-group-h .more-group-ic,
    .more-group.is-current > .more-group-h .more-group-ic { color: var(--bl-ice-300); }
    .more-items { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .32s cubic-bezier(.2, .8, .2, 1); }
    .more-group.is-open .more-items { grid-template-rows: 1fr; }
    .more-items-inner { overflow: hidden; min-height: 0; padding: .15rem 0 .2rem; }
    .more-row { display: flex; align-items: center; gap: .75rem; padding: .7rem .7rem; border-radius: 14px; color: var(--n-100); font-weight: 700; font-size: .9rem; min-height: 48px; }
    .more-row:hover, .more-row:active { background: rgba(255,255,255,.06); color: #fff; }
    .more-row.active { background: var(--bl-navy-800); color: #fff; }
    .more-row .more-ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: rgba(var(--primary-light-rgb), .16); color: var(--brand-400); font-size: 1.05rem; flex-shrink: 0; }
    .more-row.active .more-ic { background: var(--brand); color: #fff; }
    .more-chev { margin-left: auto; color: var(--n-600); font-size: .8rem; }
    .more-logout { margin: 0; padding: .55rem .7rem .7rem; flex-shrink: 0; background: var(--bl-navy-900); }
    .more-logout button {
        width: 100%; min-height: 48px;
        border: 0; border-radius: 14px;
        background: rgba(var(--danger-rgb), .16); color: var(--danger-light);
        font-weight: 800; display: flex; align-items: center; justify-content: center; gap: .5rem;
    }
    body.more-open { overflow: hidden; }
}

@media (min-width: 992px) {
    html.sidebar-rail .sidebar { width: 84px; transform: translate3d(0, 0, 0); }
    html.sidebar-rail .main { margin-left: 84px; transform: translate3d(0, 0, 0); }
    html.sidebar-rail .tenant-head { justify-content: center; padding: .2rem; }
    html.sidebar-rail .tenant-head-copy,
    html.sidebar-rail .nav-search,
    html.sidebar-rail .nav-now,
    html.sidebar-rail .nav-group-label,
    html.sidebar-rail .nav-group-chev,
    html.sidebar-rail [data-rail-label] { display: none; }
    html.sidebar-rail .sidebar-brand { justify-content: center; padding: 1.1rem .6rem .4rem; }
    html.sidebar-rail .tenant-head .tc-avatar { width: 40px; height: 40px; }
    html.sidebar-rail .sidebar-nav { overflow: visible; padding: .4rem .55rem 1rem; }
    html.sidebar-rail .sidebar-footer { padding: .7rem; }
    html.sidebar-rail .sidebar-collapse { width: 46px; height: 46px; margin: 0 auto; padding: 0; }
    html.sidebar-rail .nav-group { justify-content: center; padding: .72rem .4rem; position: relative; }
    html.sidebar-rail .nav-group-ic { font-size: 1.2rem; }
    html.sidebar-rail .nav-section { position: relative; }
    html.sidebar-rail .nav-section.is-open > .nav-group::after { display: none; }
    html.sidebar-rail .nav-section.is-current > .nav-group { background: var(--bl-navy-800); color: #fff; }
    html.sidebar-rail .nav-items { position: fixed; left: 94px; width: 248px; display: block; grid-template-rows: none; z-index: 1080; opacity: 0; visibility: hidden; pointer-events: none; transform: translate3d(-8px, 0, 0); will-change: transform, opacity; transition: opacity .2s var(--ease), transform .22s var(--ease-out), visibility .2s; }
    html.sidebar-rail .nav-section.is-fly .nav-items { opacity: 1; visibility: visible; pointer-events: auto; transform: translate3d(0, 0, 0); }
    html.sidebar-rail .nav-items-inner { overflow: visible; padding: .55rem; border-radius: 18px; background: var(--bl-navy-800); border: 1px solid rgba(255, 255, 255, .08); box-shadow: 0 28px 60px -24px rgba(var(--shadow-rgb), .75); }
    html.sidebar-rail .nav-fly-h { display: block; font-size: .64rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--n-500); padding: .35rem .7rem .55rem; }
    html.sidebar-rail .sidebar .nav-link { padding: .55rem .7rem; }
    html.sidebar-rail .sidebar .nav-link span { display: inline; }
    html.sidebar-rail .nav-group[data-tip]::before {
        content: attr(data-tip);
        position: absolute;
        left: calc(100% + 12px);
        top: 50%;
        transform: translateY(-50%) translateX(-4px);
        background: var(--ink);
        color: #fff;
        font-size: .72rem;
        font-weight: 600;
        letter-spacing: -.01em;
        text-transform: none;
        white-space: nowrap;
        padding: .38rem .65rem;
        border-radius: 8px;
        box-shadow: var(--shadow-md);
        opacity: 0;
        pointer-events: none;
        z-index: 1090;
        transition: opacity .14s var(--ease), transform .14s var(--ease);
    }
    html.sidebar-rail .nav-group[data-tip]:hover::before,
    html.sidebar-rail .nav-group[data-tip]:focus-visible::before {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
    html.sidebar-rail .nav-section.is-fly .nav-group[data-tip]::before { opacity: 0; }
}

/* ---------- Page header ---------- */
.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; }
.page-header h1 { font-size: var(--text-2xl); margin: 0; letter-spacing: var(--tracking-tight); font-weight: 750; }
.page-header .subtitle { color: var(--muted); font-size: var(--text-sm); margin-top: .3rem; font-weight: 500; line-height: 1.45; }
.page-header .actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.breadcrumb-lite { font-size: .75rem; color: var(--muted); margin-bottom: .4rem; font-weight: 600; letter-spacing: .01em; }
.breadcrumb-lite a { color: var(--muted); }
.breadcrumb-lite a:hover { color: var(--brand); }
.page-section-title, .card .section-title { font-size: 1.02rem; font-weight: 700; letter-spacing: -.02em; margin: 0; }
@media (max-width: 575.98px) {
    .page-header { align-items: stretch; margin-bottom: 1.1rem; }
    .page-header h1 { font-size: 1.35rem; }
    .page-header .actions { width: 100%; }
    .page-header .actions > .btn, .page-header .actions > a.btn, .page-header .actions > .dropdown { flex: 1 1 auto; }
    .page-header .actions > .dropdown > .btn { width: 100%; }
}

/* ---------- Cards ---------- */
.card { border: var(--border-whisper); border-radius: var(--radius); box-shadow: var(--shadow-xs); background: var(--card); }
.card-header { background: transparent; border-bottom: 1px solid var(--line-2); padding: .95rem 1.2rem; display: flex; align-items: center; justify-content: space-between; gap: .75rem; font-weight: 650; font-size: .92rem; color: var(--ink); }
.card-header:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.card-header h5, .card-header h6 { margin: 0; font-size: .95rem; font-weight: 700; }
.card-body { padding: 1.2rem; }
.card-footer { background: var(--surface-2); border-top: 1px solid var(--line-2); padding: .8rem 1.2rem; border-radius: 0 0 var(--radius) var(--radius); }
.card-hover { transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease); }
.card-hover:hover, a.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: var(--n-200); }
a.card { color: inherit; transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease); }
.card .card, .card .well, .well .well { box-shadow: none; background: var(--surface-2); border-color: var(--line-2); }
.well, .well-sm, .well-lg {
    background: var(--surface-2);
    border: 1px solid var(--line-2);
    box-shadow: none;
    border-radius: var(--radius-sm);
    padding: 1rem 1.1rem;
    margin-bottom: 1rem;
}
.list-group { border-radius: var(--radius-sm); }
.list-group-item { border-color: var(--line-2); padding: .8rem 1.1rem; }
.list-group-item-action:hover { background: var(--surface-2); }
.list-group-flush > .list-group-item:last-child { border-bottom-left-radius: var(--radius); border-bottom-right-radius: var(--radius); }

.stat-card { position: relative; overflow: hidden; padding: 1.2rem 1.25rem; border-radius: var(--radius); background: #fff; border: var(--border-whisper); box-shadow: var(--shadow-xs); height: 100%; transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.stat-card .stat-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 1.25rem; }
.stat-card .stat-label { font-size: .76rem; color: var(--muted); font-weight: 700; margin-top: .9rem; }
.stat-card .stat-value { font-size: 1.65rem; font-weight: 800; letter-spacing: -.04em; line-height: 1.2; color: var(--ink); font-variant-numeric: tabular-nums; }
[data-count] { font-variant-numeric: tabular-nums lining-nums; }
.stat-card .stat-foot { font-size: .74rem; color: var(--muted); margin-top: .2rem; }
.stat-card::after { content: ''; position: absolute; right: -36px; top: -36px; width: 120px; height: 120px; border-radius: 50%; background: currentColor; opacity: .07; }
.stat-card::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: currentColor; opacity: .75; }
.tone-indigo, .tone-sky { color: var(--brand); } .tone-indigo .stat-icon, .tone-sky .stat-icon { background: var(--brand-50); color: var(--brand); }
.tone-teal, .tone-green { color: var(--leaf-600); } .tone-teal .stat-icon, .tone-green .stat-icon { background: var(--leaf-50); color: var(--leaf-600); }
.tone-amber { color: var(--warning-bright); } .tone-amber .stat-icon { background: var(--sun-50); color: var(--sun-600); }
.tone-rose { color: var(--flame); } .tone-rose .stat-icon { background: var(--flame-50); color: var(--flame); }
.tone-violet { color: var(--ink); } .tone-violet .stat-icon { background: var(--n-100); color: var(--ink); }
.stat-card .stat-label { color: var(--muted); }

.hero-card { background:
        radial-gradient(60% 90% at 100% 0%, rgba(var(--primary-light-rgb), .55) 0%, transparent 60%),
        radial-gradient(40% 60% at 85% 110%, rgba(var(--success-light-rgb), .28) 0%, transparent 70%),
        radial-gradient(30% 50% at 0% 100%, rgba(var(--accent-rgb), .14) 0%, transparent 70%),
        var(--ink);
    color: #fff; border: 0; border-radius: 22px; padding: 1.6rem 1.75rem; position: relative; overflow: hidden; box-shadow: var(--shadow-lg); }
.hero-card::before { content: ''; position: absolute; left: 1.75rem; bottom: 0; width: 120px; height: 4px; border-radius: 4px 4px 0 0; background: var(--brand-strip); }
.hero-card h2, .hero-card h1, .hero-card h3 { color: #fff; font-size: 1.4rem; }
.hero-card .text-white-50 { color: rgba(255, 255, 255, .68) !important; }
.hero-card .btn-light { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .15); color: #fff; box-shadow: none; }
.hero-card .btn-light:hover { background: #fff; color: var(--ink); }

/* ---------- Tables ---------- */
.table { --bs-table-bg: transparent; --bs-table-hover-bg: var(--background); margin: 0; font-size: .86rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.table > :not(caption) > * > * { padding: .8rem 1.05rem; border-bottom-color: var(--line-2); vertical-align: middle; }
.table thead th {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    color: var(--muted);
    font-weight: 700;
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 2;
    box-shadow: inset 0 -1px 0 var(--line);
}
.table thead th:first-child { border-top-left-radius: 0; }
.table-hover tbody tr { transition: background .1s var(--ease); }
.table-hover tbody tr:hover { background: var(--background); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .cell-title { font-weight: 650; color: var(--ink); }
.table .cell-sub { font-size: .76rem; color: var(--muted); }
.table a.fw-semibold, .table td > a:not(.btn) { color: var(--ink); font-weight: 650; }
.table a.fw-semibold:hover, .table td > a:not(.btn):hover { color: var(--brand); }
.table-actions { white-space: nowrap; text-align: right; }
.table-actions .btn { padding: .28rem .55rem; min-height: 32px; }
.table-responsive { border-radius: 0 0 var(--radius) var(--radius); }
@media (min-width: 992px) {
    .content .table-responsive { overflow: visible; }
    .content .att-grid,
    .content .table-responsive:has(> .line-items),
    .content .table-responsive:has(> .perm-table) { overflow-x: auto; }
}
.table-sm > :not(caption) > * > * { padding: .5rem .7rem; }
.table-light, .table > thead.table-light > tr > th { --bs-table-bg: var(--surface-2); }

/* Mobile: tables become premium cards (labels come from the header via app.js) */
@media (max-width: 991.98px) {
    .table-cards { display: block; }
    .table-cards > thead { display: none; }
    .table-cards > tbody, .table-cards > tfoot { display: block; }
    .table-responsive:has(> .table-cards), .table-cards-wrap { overflow: visible !important; background: var(--bg); padding: .65rem; border-radius: 0 0 var(--radius) var(--radius); }
    .card > .table-responsive:first-child:has(> .table-cards) { border-radius: var(--radius); }
    .table-cards > tbody > tr { display: block; position: relative; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: .85rem 1rem .6rem; margin-bottom: .65rem; box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s; }
    .table-cards > tbody > tr:last-child { margin-bottom: 0; }
    .table-cards > tbody > tr:active { transform: scale(.99); }
    .table-cards > tbody > tr > td { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .38rem 0 !important; border: 0 !important; text-align: right !important; background: transparent !important; min-height: 0; }
    .table-cards > tbody > tr > td::before { content: attr(data-label); flex-shrink: 0; max-width: 45%; text-align: left; font-size: .66rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
    .table-cards > tbody > tr > td:not([data-label])::before, .table-cards > tbody > tr > td[data-label=""]::before { display: none; }
    .table-cards > tbody > tr > td > * { min-width: 0; }
    .table-cards > tbody > tr > td > .td-val { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: .15rem; }
    .table-cards > tbody > tr > td > .td-val > br { display: none; }
    .table-cards > tbody > tr > td.td-title { display: block; text-align: left !important; font-size: .95rem; padding: 0 0 .6rem !important; margin-bottom: .35rem; border-bottom: 1px dashed var(--line) !important; }
    .table-cards > tbody > tr > td.td-title::before { display: none; }
    .table-cards > tbody > tr > td.td-actions { justify-content: flex-end; flex-wrap: wrap; gap: .4rem; border-top: 1px solid var(--line-2) !important; margin-top: .45rem; padding-top: .65rem !important; }
    .table-cards > tbody > tr > td.td-actions::before { display: none; }
    .table-cards > tbody > tr > td.td-actions .btn { padding: .42rem .8rem; }
    .table-cards > tbody > tr > td.td-empty { display: none; }
    .table-cards > tbody > tr > td[colspan] { display: block; text-align: center !important; }
    .table-cards > tbody > tr > td[colspan]::before { display: none; }
    .table-cards > tbody > tr > td.td-check { position: absolute; top: .9rem; right: 1rem; padding: 0 !important; }
    .table-cards > tbody > tr > td.td-check::before { display: none; }
    .table-cards > tbody > tr.table-active, .table-cards > tbody > tr.table-warning, .table-cards > tbody > tr.table-danger { box-shadow: inset 4px 0 0 var(--warning-bright), var(--shadow-sm); }
    .table-cards > tfoot > tr { display: flex; justify-content: space-between; align-items: center; background: var(--ink); color: #fff; border-radius: 14px; padding: .7rem 1rem; margin-top: .65rem; }
    .table-cards > tfoot > tr + tr { margin-top: .35rem; }
    .table-cards > tfoot > tr > * { border: 0 !important; padding: 0 !important; background: transparent !important; color: inherit !important; }
    .table-cards > tfoot > tr > *:empty { display: none; }
    .table-cards .text-truncate { white-space: normal; }
}

/* ---------- Toolbar & filters ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; padding: .9rem 1.1rem; border-bottom: 1px solid var(--line-2); }
.toolbar .search-box { position: relative; flex: 1; min-width: 200px; max-width: 380px; }
.toolbar .search-box i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.toolbar .search-box input { padding-left: 2.3rem; }
.toolbar .form-select, .toolbar .form-control { width: auto; }
@media (max-width: 575.98px) {
    .toolbar { padding: .75rem; }
    .toolbar .search-box { max-width: none; flex-basis: 100%; }
    .toolbar .form-select, .toolbar .form-control:not(.search-box input) { flex: 1 1 calc(50% - .3rem); }
}
.pager-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem; padding: .8rem 1.1rem; border-top: 1px solid var(--line-2); font-size: .8rem; color: var(--muted); }
.pagination { gap: 4px; margin: 0; }
.pagination .page-link {
    border-radius: var(--radius-xs) !important;
    border: 1px solid var(--line);
    color: var(--ink-2);
    font-weight: 600;
    min-width: 36px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: #fff;
}
.pagination .page-link:hover { background: var(--brand-50); color: var(--brand-600); border-color: var(--brand-100); }
.pagination .page-item.active .page-link { background: var(--ink); border-color: var(--ink); color: #fff; }
.pagination .page-item.disabled .page-link { background: var(--surface-2); color: var(--n-400); }
@media (max-width: 575.98px) { .pager-bar { justify-content: center; text-align: center; } }

.tabs-pill { display: flex; gap: .25rem; flex-wrap: nowrap; overflow-x: auto; background: var(--n-100); padding: .3rem; border-radius: 14px; width: fit-content; max-width: 100%; scrollbar-width: none; }
.tabs-pill::-webkit-scrollbar { display: none; }
.tabs-pill a, .tabs-pill button { padding: .45rem .9rem; border-radius: 10px; color: var(--ink-2); font-weight: 700; font-size: .81rem; border: 0; background: transparent; white-space: nowrap; }
.tabs-pill a:hover, .tabs-pill button:hover { color: var(--ink); }
.tabs-pill a.active, .tabs-pill button.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.tabs-pill .count { background: rgba(var(--shadow-rgb), .08); border-radius: 6px; padding: 0 .38rem; font-size: .7rem; margin-left: .3rem; }
.tabs-pill a.active .count { background: var(--ink); color: #fff; }
.nav-tabs-line { border-bottom: 1px solid var(--line); gap: .25rem; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.nav-tabs-line::-webkit-scrollbar { display: none; }
.nav-tabs-line .nav-link { border: 0; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 700; padding: .8rem .95rem; border-radius: 0; white-space: nowrap; }
.nav-tabs-line .nav-link:hover { color: var(--ink); }
.nav-tabs-line .nav-link.active { color: var(--ink); border-bottom-color: var(--brand); background: transparent; }

/* ---------- Status badges ---------- */
.badge-status { display: inline-flex; align-items: center; gap: .35rem; padding: .22rem .62rem; border-radius: var(--radius-full); font-size: .7rem; font-weight: 650; white-space: nowrap; letter-spacing: .015em; }
.badge-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 16%, transparent); }
.badge-success { background: var(--leaf-50); color: var(--leaf-600); }
.badge-danger { background: var(--flame-50); color: var(--flame-600); }
.badge-warning { background: var(--warning-soft); color: var(--warning-dark); }
.badge-info { background: var(--bl-ice-100); color: var(--primary-dark); }
.badge-primary { background: var(--brand-50); color: var(--brand-600); }
.badge-purple { background: var(--n-100); color: var(--bl-blue-2); }
.badge-teal { background: var(--success-soft); color: var(--success); }
.badge-orange { background: var(--warning-soft); color: var(--warning); }
.badge-muted, .badge-secondary { background: var(--n-100); color: var(--n-700); }
.badge.text-bg-success { background: var(--leaf-600) !important; }
.badge.text-bg-danger { background: var(--flame) !important; }
.badge.text-bg-warning { background: var(--warning-soft) !important; color: var(--warning-dark) !important; }
.badge.text-bg-primary { background: var(--brand) !important; }
.badge.text-bg-secondary { background: var(--n-200) !important; color: var(--ink-2) !important; }
.badge { font-weight: 650; border-radius: 7px; padding: .28em .55em; letter-spacing: .01em; }
.chip { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .58rem; border-radius: 9px; background: var(--n-100); color: var(--ink-2); font-size: .74rem; font-weight: 700; }
.plate { display: inline-block; font-family: ui-monospace, Menlo, monospace; font-weight: 800; letter-spacing: .08em; padding: .16rem .55rem; border-radius: 7px; background: linear-gradient(180deg, #fff, var(--bl-ice-50)); border: 1.5px solid var(--ink); color: var(--ink); font-size: .76rem; text-transform: uppercase; box-shadow: inset 0 -1px 0 rgba(var(--shadow-rgb), .12); white-space: nowrap; }

/* ---------- Alerts ---------- */
.alert { border: 0; border-radius: 14px; font-weight: 500; padding: .85rem 1.05rem; }
.alert-warning { background: var(--warning-soft); color: var(--warning-dark); box-shadow: inset 3px 0 0 var(--warning-bright); }
.alert-info, .alert-primary { background: var(--brand-50); color: var(--brand-700); box-shadow: inset 3px 0 0 var(--brand-400); }
.alert-success { background: var(--leaf-50); color: var(--success); box-shadow: inset 3px 0 0 var(--leaf); }
.alert-danger { background: var(--flame-50); color: var(--flame-600); box-shadow: inset 3px 0 0 var(--flame); }
.alert-secondary, .alert-light { background: var(--n-100); color: var(--ink-2); }

/* ---------- Empty & loading states ---------- */
.empty-state { text-align: center; padding: 3.25rem 1.5rem; }
.empty-state .empty-icon { width: 72px; height: 72px; border-radius: 20px; background: linear-gradient(160deg, var(--brand-50), var(--leaf-50)); color: var(--brand); display: inline-grid; place-items: center; font-size: 1.85rem; margin-bottom: 1rem; position: relative; }
.empty-state .empty-icon::after { content: ''; position: absolute; right: -3px; top: -3px; width: 14px; height: 14px; border-radius: 50%; background: var(--primary-light); border: 3px solid #fff; }
.empty-state h5 { margin-bottom: .35rem; font-weight: 700; letter-spacing: -.02em; }
.empty-state p { color: var(--muted); max-width: 400px; margin: 0 auto 1.1rem; font-size: var(--text-sm); }
.skeleton, .skel {
    background: linear-gradient(105deg, var(--n-100) 0%, var(--background) 42%, var(--n-100) 84%);
    background-size: 220% 100%;
    animation: shimmer 1.6s var(--ease) infinite;
    border-radius: var(--radius-sm);
    display: block;
}
.skel-line { height: .75rem; width: 100%; margin: .4rem 0; }
.skel-line.w-75 { width: 75%; }
.skel-line.w-50 { width: 50%; }
.skel-block { height: 7.5rem; width: 100%; border-radius: var(--radius); }
.skel-avatar { width: 36px; height: 36px; border-radius: 12px; flex-shrink: 0; }
.skel-row { display: flex; align-items: center; gap: .75rem; padding: .7rem 0; }
.skel.is-hidden, html.app-ready .skel-boot, html.app-ready .skel[data-hide-on-ready] { display: none !important; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.loading-overlay { position: absolute; inset: 0; background: rgba(255, 255, 255, .72); display: grid; place-items: center; z-index: 5; border-radius: inherit; }

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 1.7rem; }
.timeline::before { content: ''; position: absolute; left: 9px; top: 4px; bottom: 4px; width: 2px; background: linear-gradient(180deg, var(--brand-100), var(--line)); }
.timeline-item { position: relative; padding-bottom: 1.15rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot { position: absolute; left: -1.7rem; top: 1px; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 2px solid var(--brand-400); display: grid; place-items: center; font-size: .6rem; color: var(--brand); box-shadow: 0 0 0 4px var(--card); }
.timeline-item .tl-title { font-weight: 650; font-size: .84rem; }
.timeline-item .tl-meta { font-size: .74rem; color: var(--muted); }

/* ---------- Workflow stepper ---------- */
.stepper, .wf-stepper { display: flex; gap: 0; overflow-x: auto; padding-bottom: .25rem; scrollbar-width: none; }
.stepper::-webkit-scrollbar, .wf-stepper::-webkit-scrollbar { display: none; }
.stepper .step, .wf-step {
    flex: 1;
    min-width: 92px;
    text-align: center;
    position: relative;
    font-size: .69rem;
    font-weight: 650;
    color: var(--muted);
    letter-spacing: .01em;
}
.stepper .step::before, .wf-step::before { content: ''; position: absolute; top: 14px; left: -50%; right: 50%; height: 2px; background: var(--line); z-index: 0; }
.stepper .step:first-child::before, .wf-step:first-child::before { display: none; }
.stepper .step .dot, .wf-step .dot {
    position: relative;
    z-index: 1;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--line-2);
    color: var(--n-400);
    display: grid;
    place-items: center;
    margin: 0 auto .4rem;
    font-size: .75rem;
    font-weight: 700;
    border: 2px solid transparent;
    transition: background .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease);
}
.stepper .step.done .dot, .wf-step.done .dot, .wf-step.is-done .dot { background: var(--leaf-600); color: #fff; border-color: var(--leaf-600); }
.stepper .step.done::before, .stepper .step.current::before,
.wf-step.done::before, .wf-step.current::before, .wf-step.is-done::before, .wf-step.is-current::before { background: linear-gradient(90deg, var(--leaf-600), var(--brand-400)); }
.stepper .step.current .dot, .wf-step.current .dot, .wf-step.is-current .dot {
    background: var(--ink);
    color: #fff;
    border-color: var(--ink);
    box-shadow: 0 0 0 4px rgba(var(--primary-light-rgb), .18);
}
.stepper .step.current, .wf-step.current, .wf-step.is-current { color: var(--ink); font-weight: 700; }

/* ---------- Kanban ---------- */
.kanban { display: flex; gap: 1rem; overflow-x: auto; padding-bottom: 1rem; align-items: flex-start; scroll-snap-type: x mandatory; }
.kanban-col { flex: 0 0 300px; background: var(--n-100); border-radius: 18px; padding: .8rem; max-height: calc(100vh - 220px); display: flex; flex-direction: column; scroll-snap-align: start; }
.kanban-col-head { display: flex; justify-content: space-between; align-items: center; padding: .15rem .35rem .7rem; font-weight: 800; font-size: .82rem; }
.kanban-col-body { overflow-y: auto; display: flex; flex-direction: column; gap: .6rem; }
.kanban-card { background: #fff; border-radius: 14px; padding: .85rem; box-shadow: var(--shadow-sm); border: 1px solid var(--n-200); display: block; color: var(--ink); transition: transform .15s, box-shadow .15s; }
.kanban-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); color: var(--ink); }
.kanban-card .kc-title { font-weight: 800; font-size: .84rem; }
.kanban-card .kc-sub { font-size: .76rem; color: var(--muted); }
.priority-urgent { border-left: 4px solid var(--flame); }
.priority-high { border-left: 4px solid var(--warning-bright); }
@media (max-width: 575.98px) { .kanban-col { flex-basis: 86vw; } }

/* ---------- Line items editor ---------- */
.line-items td { vertical-align: top; }
.line-items .form-control, .line-items .form-select { font-size: .82rem; padding: .42rem .6rem; border-radius: 10px; min-height: 0; }
.line-items .li-desc { min-width: 220px; }
.line-items .li-num { width: 92px; }
.line-items .li-total { min-width: 110px; text-align: right; font-weight: 700; padding-top: .9rem !important; }
.totals-box { background: linear-gradient(180deg, var(--surface-soft), var(--background)); border: 1px solid var(--line); border-radius: 16px; padding: 1.05rem 1.2rem; }
.totals-box .row-t { display: flex; justify-content: space-between; padding: .28rem 0; font-size: .86rem; }
.totals-box .row-t.grand { border-top: 1px dashed var(--n-300); margin-top: .45rem; padding-top: .65rem; font-size: 1.15rem; font-weight: 800; letter-spacing: -.02em; }

/* ---------- Remote select ---------- */
.remote-select { position: relative; }
.remote-select .rs-menu { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); z-index: 1070; max-height: 290px; overflow-y: auto; display: none; padding: .3rem; }
.remote-select .rs-menu.show { display: block; animation: pop .14s ease; }
.remote-select .rs-item { padding: .55rem .75rem; cursor: pointer; font-size: .84rem; border-radius: 10px; }
.remote-select .rs-item small { display: block; color: var(--muted); font-size: .74rem; }
.remote-select .rs-item:hover, .remote-select .rs-item.focus { background: var(--brand-50); }
.remote-select .rs-empty { padding: .7rem .8rem; color: var(--muted); font-size: .82rem; }
.remote-select .rs-clear { position: absolute; right: .5rem; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--muted); display: none; }
.remote-select.has-value .rs-clear { display: block; }

/* ---------- Inspection ---------- */
.insp-item { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; padding: .8rem 1rem; border-bottom: 1px solid var(--line-2); }
.insp-item:last-child { border-bottom: 0; }
.insp-item .insp-name { flex: 1; min-width: 160px; font-weight: 700; font-size: .85rem; }
.cond-group { display: inline-flex; background: var(--n-100); border-radius: 12px; padding: 3px; gap: 2px; }
.cond-group input { display: none; }
.cond-group label { padding: .4rem .75rem; border-radius: 9px; font-size: .75rem; font-weight: 800; cursor: pointer; color: var(--muted); user-select: none; transition: all .12s; }
.cond-group input:checked + label.c-ok { background: var(--leaf-600); color: #fff; }
.cond-group input:checked + label.c-attention { background: var(--warning-bright); color: var(--warning-dark); }
.cond-group input:checked + label.c-urgent { background: var(--flame); color: #fff; }
.cond-group input:checked + label.c-na { background: var(--n-400); color: #fff; }
@media (max-width: 575.98px) { .cond-group { width: 100%; } .cond-group label { flex: 1; text-align: center; } }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .65rem; }
.photo-grid .ph { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--n-100); }
.photo-grid .ph img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.photo-grid .ph:hover img { transform: scale(1.04); }
.photo-grid .ph .ph-del { position: absolute; top: 6px; right: 6px; }
.photo-grid .ph .ph-cap { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(transparent, rgba(var(--shadow-rgb), .75)); color: #fff; font-size: .7rem; padding: .8rem .5rem .35rem; }

/* ---------- Technician mobile ---------- */
.tech-card { border-radius: 20px; border: 1px solid var(--line); background: #fff; padding: 1.05rem; margin-bottom: .9rem; box-shadow: var(--shadow-sm); }
.tech-card .tc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
.tech-card .tc-task { display: flex; align-items: center; gap: .75rem; padding: .8rem 0; border-top: 1px solid var(--line-2); }
.tech-card .tc-task:first-of-type { border-top: 0; }
.tech-btn { min-width: 100px; padding: .65rem .95rem; font-size: .85rem; border-radius: 14px; }
.timer { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--brand); }

/* ---------- Calendar ---------- */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal-grid .cal-h { padding: .55rem; font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--surface-soft); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: center; }
.cal-grid .cal-d { min-height: 118px; padding: .4rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; overflow: hidden; }
.cal-grid .cal-d.other { background: var(--surface-soft); color: var(--n-400); }
.cal-grid .cal-d.today { background: var(--brand-50); }
.cal-grid .cal-d .dn { font-size: .76rem; font-weight: 800; margin-bottom: .25rem; display: flex; justify-content: space-between; }
.cal-grid .cal-d.today .dn span:first-child { background: var(--ink); color: #fff; border-radius: 7px; padding: 0 .4rem; }
.cal-ev { display: block; font-size: .7rem; font-weight: 700; padding: .16rem .4rem; border-radius: 7px; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
@media (max-width: 767.98px) { .cal-grid .cal-d { min-height: 60px; padding: .25rem; } .cal-ev { font-size: 0; height: 6px; padding: 0; } .cal-grid .cal-h { font-size: .6rem; padding: .4rem .1rem; } }

/* ---------- Misc ---------- */
.dl-grid { display: grid; grid-template-columns: 140px 1fr; gap: .5rem 1rem; font-size: .86rem; }
.dl-grid dt { color: var(--muted); font-weight: 600; }
.dl-grid dd { margin: 0; font-weight: 600; }
@media (max-width: 575.98px) { .dl-grid { grid-template-columns: 1fr; gap: .1rem; } .dl-grid dd { margin-bottom: .55rem; } }
.progress { height: 8px; border-radius: 99px; background: var(--n-100); }
.progress-bar { background: linear-gradient(90deg, var(--brand-400), var(--leaf)); border-radius: 99px; }
.list-clean { list-style: none; padding: 0; margin: 0; }
.list-row { display: flex; align-items: center; gap: .75rem; padding: .75rem 0; border-bottom: 1px solid var(--line-2); }
.list-row:last-child { border-bottom: 0; }
.icon-tile { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); flex-shrink: 0; }
.modal-content { border-radius: var(--radius-lg); border: 0; box-shadow: var(--shadow-lg); }
.modal-header { border-bottom: 1px solid var(--line-2); padding: 1.05rem 1.3rem; }
.modal-body { padding: 1.25rem 1.3rem; }
.modal-footer { border-top: 1px solid var(--line-2); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); padding: .85rem 1.3rem; gap: .5rem; }
.modal-title { font-weight: 700; font-size: 1.05rem; letter-spacing: -.02em; }
.modal.fade { transition: opacity .22s var(--ease); }
.modal.fade .modal-dialog { transition: transform .22s var(--ease-out); }
.modal-backdrop { background: var(--ink); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.modal-backdrop.fade { transition: opacity .22s var(--ease); }
.modal-backdrop.show { opacity: .48; }
@media (max-width: 575.98px) {
    .modal-dialog { margin: 0; max-width: 100%; min-height: 100%; display: flex; align-items: stretch; }
    .modal.fade .modal-dialog { transform: translate3d(0, 16px, 0); }
    .modal.show .modal-dialog { transform: none; }
    .modal-content { border-radius: 20px 20px 0 0; min-height: 100%; max-height: 100dvh; }
    .modal-dialog-scrollable .modal-content,
    .modal-dialog-centered .modal-content { max-height: 100dvh; min-height: 100%; }
    .modal-footer { border-radius: 0; padding-bottom: calc(.85rem + env(safe-area-inset-bottom)); }
    .modal-footer .btn { flex: 1; }
}
.dropdown-menu { border-radius: 12px; padding: .35rem; font-size: .86rem; border: 1px solid var(--line); box-shadow: var(--shadow-lg); animation: pop .12s var(--ease); }
.dropdown-item { border-radius: 8px; padding: .48rem .75rem; font-weight: 550; color: var(--ink-2); display: flex; align-items: center; gap: .45rem; }
.dropdown-item:hover, .dropdown-item:focus { background: var(--brand-50); color: var(--ink); }
.dropdown-item i { color: var(--muted); }
.dropdown-item.text-danger:hover { background: var(--flame-50); }
.dropdown-divider { margin: .3rem .35rem; border-color: var(--line-2); opacity: 1; }
.swal2-popup { border-radius: 18px !important; font-family: var(--font) !important; box-shadow: var(--shadow-lg) !important; padding: 1.5rem 1.4rem 1.35rem !important; }
.swal2-title { font-weight: 700 !important; letter-spacing: -.02em !important; font-size: 1.12rem !important; color: var(--ink) !important; line-height: 1.3 !important; }
.swal2-html-container { font-size: .9rem !important; color: var(--muted) !important; font-weight: 500 !important; line-height: 1.5 !important; margin: .45rem 0 .15rem !important; }
.swal2-styled { border-radius: var(--radius-btn) !important; font-weight: 600 !important; min-height: 42px; font-size: .84rem !important; letter-spacing: -.01em !important; }
.swal2-toast { border-radius: 12px !important; box-shadow: var(--shadow) !important; border: var(--border-whisper) !important; padding: .7rem 1rem !important; }
.swal2-toast .swal2-title { font-size: .84rem !important; font-weight: 600 !important; letter-spacing: -.01em !important; color: var(--ink) !important; }
.swal2-toast .swal2-html-container { font-size: .78rem !important; margin: .15rem 0 0 !important; }
.chart-box { position: relative; height: 290px; }
.chart-box-sm { position: relative; height: 220px; }
@media (max-width: 575.98px) { .chart-box { height: 240px; } }
.perm-table td, .perm-table th { text-align: center; }
.perm-table td:first-child, .perm-table th:first-child { text-align: left; }
.is-invalid ~ .invalid-feedback, .invalid-feedback.d-block { display: block; }
.sticky-actions {
    position: sticky;
    bottom: 0;
    background: rgba(243, 246, 252, .92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: .85rem 0;
    margin-top: 1rem;
    border-top: 1px solid var(--line);
    z-index: 10;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
}
@media (max-width: 991.98px) {
    .sticky-actions {
        bottom: var(--tabbar-h);
        border-radius: var(--radius);
        padding: .7rem;
        border: 1px solid var(--line);
        box-shadow: var(--shadow-sm);
    }
}
hr { border-color: var(--line); opacity: 1; }

/* ---------- Tooltips, toasts, touch, overflow ---------- */
.tooltip { --bs-tooltip-bg: var(--ink); --bs-tooltip-color: #fff; --bs-tooltip-opacity: 1; --bs-tooltip-padding-x: .65rem; --bs-tooltip-padding-y: .4rem; --bs-tooltip-font-size: .75rem; z-index: 1080; }
.tooltip.tooltip-dwarg, .tooltip { font-family: var(--font); }
.tooltip .tooltip-inner {
    background: var(--ink);
    color: #fff;
    font-weight: 600;
    letter-spacing: -.01em;
    border-radius: 8px;
    padding: .42rem .7rem;
    box-shadow: var(--shadow-md);
    max-width: 260px;
    line-height: 1.35;
}
.tooltip.bs-tooltip-top .tooltip-arrow::before { border-top-color: var(--ink); }
.tooltip.bs-tooltip-bottom .tooltip-arrow::before { border-bottom-color: var(--ink); }
.tooltip.bs-tooltip-start .tooltip-arrow::before { border-left-color: var(--ink); }
.tooltip.bs-tooltip-end .tooltip-arrow::before { border-right-color: var(--ink); }
.toast { border: var(--border-whisper); border-radius: 12px; box-shadow: var(--shadow); background: #fff; }
.toast-header { background: var(--surface-2); border-bottom-color: var(--line-2); font-weight: 650; font-size: .82rem; letter-spacing: -.01em; }
.toast-body { font-size: var(--text-sm); color: var(--ink-2); line-height: 1.45; }

@media (max-width: 991.98px) {
    .content .btn:not(.btn-sm):not(.btn-icon),
    .page-header .actions .btn,
    .sticky-actions .btn,
    .modal-footer .btn,
    .toolbar .btn:not(.btn-sm) {
        min-height: var(--touch);
    }
    .pagination .page-link { min-width: var(--touch); min-height: var(--touch); }
    .form-check { min-height: var(--touch); display: flex; align-items: center; }
    .form-check-input { margin-top: 0; }
}

/* ---------- Auth & public ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-side { background:
        radial-gradient(70% 55% at 100% 0%, rgba(var(--primary-light-rgb), .45) 0%, transparent 60%),
        radial-gradient(50% 40% at 0% 100%, rgba(var(--success-light-rgb), .18) 0%, transparent 70%),
        var(--ink);
    color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-side::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px); background-size: 22px 22px; mask-image: linear-gradient(180deg, transparent, #000 40%, transparent); -webkit-mask-image: linear-gradient(180deg, transparent, #000 40%, transparent); }
.auth-side::after { content: ''; position: absolute; left: 3rem; bottom: 0; width: 160px; height: 5px; border-radius: 5px 5px 0 0; background: var(--brand-strip); }
.auth-side h1 { color: #fff; font-size: 2.5rem; line-height: 1.1; letter-spacing: -.04em; }
.auth-side .feat { display: flex; gap: .9rem; align-items: flex-start; margin-bottom: 1.1rem; color: var(--n-300); }
.auth-side .feat i { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; font-size: 1rem; background: rgba(255, 255, 255, .06); color: var(--leaf); }
.auth-side .feat:nth-child(3) i { color: var(--sun); }
.auth-side .feat:nth-child(4) i { color: var(--brand-400); }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 2rem; background: #fff; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h2 { font-size: 1.7rem; letter-spacing: -.035em; }
.auth-mobile-logo { display: none; }
@media (max-width: 991.98px) {
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-side { display: none; }
    .auth-main { align-items: flex-start; padding: 2rem 1.25rem; background: radial-gradient(90% 30% at 50% 0%, var(--brand-50), #fff 70%); }
    .auth-mobile-logo { display: block; margin: .5rem auto 2rem; }
}

/* ---------- PWA install ---------- */
.pwa-install-card[hidden],
.pwa-topbar-btn[hidden],
.pwa-sheet[hidden] { display: none !important; }
.pwa-install-card {
    position: relative;
    margin: 0 0 1.5rem;
    padding: 1.15rem 1.15rem 1.2rem;
    border-radius: 20px;
    background: linear-gradient(180deg, #fff 0%, var(--surface-soft) 100%);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.pwa-install-card .brand-strip {
    position: absolute;
    top: 0;
    left: 1.15rem;
    right: 1.15rem;
    height: 3px;
    border-radius: 0 0 3px 3px;
}
.pwa-install-row { display: flex; align-items: flex-start; gap: .85rem; }
.pwa-install-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    flex-shrink: 0;
    box-shadow: 0 6px 16px -8px rgba(var(--shadow-rgb), .45);
    background: #fff;
}
.pwa-install-check {
    display: none;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    flex-shrink: 0;
    place-items: center;
    background: var(--leaf-50);
    color: var(--leaf-600);
    font-size: 1.35rem;
}
.pwa-install-card.is-inapp .pwa-install-icon,
.pwa-install-card.is-installed .pwa-install-icon { display: none; }
.pwa-install-card.is-inapp .pwa-install-check,
.pwa-install-card.is-installed .pwa-install-check { display: grid; }
.pwa-install-copy { min-width: 0; }
.pwa-install-wordmark { height: 22px; width: auto; display: block; margin-bottom: .35rem; }
.pwa-install-title { margin: 0; font-weight: 800; font-size: .98rem; letter-spacing: -.02em; color: var(--ink); }
.pwa-install-sub { margin: .2rem 0 0; font-size: .8rem; color: var(--muted); line-height: 1.4; }
.pwa-install-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    width: 100%;
    height: 48px;
    margin-top: 1rem;
    padding: 0 1.2rem;
    border: 0;
    border-radius: 99px;
    background: var(--ink);
    color: #fff;
    font-family: inherit;
    font-weight: 700;
    font-size: .92rem;
    letter-spacing: -.01em;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .12) inset, 0 10px 24px -12px rgba(var(--shadow-rgb), .7);
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.pwa-install-btn:hover {
    color: #fff;
    background: var(--n-800);
    transform: translateY(-1px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .12) inset, 0 16px 30px -14px rgba(var(--shadow-rgb), .8);
}
.pwa-install-btn:focus-visible {
    outline: 3px solid var(--brand-400);
    outline-offset: 2px;
}
.pwa-install-btn:disabled { opacity: .65; cursor: wait; transform: none; }
.pwa-install-card.is-inapp .pwa-install-btn,
.pwa-install-card.is-installed .pwa-install-btn { display: none; }

.pwa-topbar-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    height: 36px;
    padding: 0 .85rem;
    border: 1px solid var(--line);
    border-radius: 99px;
    background: #fff;
    color: var(--ink);
    font-family: inherit;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: -.01em;
    box-shadow: var(--shadow-xs);
    cursor: pointer;
}
.pwa-topbar-btn:hover { border-color: var(--n-300); background: var(--surface-soft); color: var(--ink); }
.pwa-topbar-btn:focus-visible { outline: 3px solid var(--brand-400); outline-offset: 2px; }
.pwa-topbar-btn i { color: var(--brand); font-size: 1rem; }

.pwa-sheet:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.pwa-sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(var(--shadow-rgb), .55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 0;
    padding: 0;
    cursor: pointer;
}
.pwa-sheet-panel {
    position: relative;
    z-index: 1;
    width: min(420px, 100%);
    background: #fff;
    border-radius: 24px;
    padding: 1.75rem 1.5rem 1.4rem;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.pwa-sheet-panel .brand-strip {
    position: absolute;
    top: 0;
    left: 1.5rem;
    right: 1.5rem;
    height: 3px;
    border-radius: 0 0 3px 3px;
}
.pwa-sheet-close {
    position: absolute;
    top: .85rem;
    right: .85rem;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 12px;
    background: var(--bg);
    color: var(--ink-2);
    display: inline-grid;
    place-items: center;
    cursor: pointer;
}
.pwa-sheet-close:hover { background: var(--line-2); color: var(--ink); }
.pwa-sheet-close:focus-visible { outline: 3px solid var(--brand-400); outline-offset: 2px; }
.pwa-sheet-logo { height: 36px; width: auto; display: block; margin-bottom: 1rem; }
.pwa-sheet-panel h2 { font-size: 1.25rem; letter-spacing: -.03em; margin-bottom: .4rem; }
.pwa-sheet-lead { color: var(--muted); font-size: .88rem; margin-bottom: 1.15rem; }
.pwa-sheet-steps { list-style: none; padding: 0; margin: 0 0 1.2rem; }
.pwa-sheet-steps li {
    display: flex;
    gap: .75rem;
    align-items: flex-start;
    padding: .7rem 0;
    border-top: 1px solid var(--line-2);
    font-size: .88rem;
    color: var(--ink-2);
}
.pwa-sheet-steps li:first-child { border-top: 0; }
.pwa-step-ic {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: var(--brand-50);
    color: var(--brand);
    display: grid;
    place-items: center;
    flex-shrink: 0;
    font-size: 1.05rem;
}
.pwa-sheet-steps li:nth-child(2) .pwa-step-ic { background: var(--leaf-50); color: var(--leaf-600); }
.pwa-sheet-steps li:nth-child(3) .pwa-step-ic { background: var(--sun-50); color: var(--sun-600); }
body.pwa-sheet-open { overflow: hidden; }
@media (max-width: 575.98px) {
    .pwa-sheet:not([hidden]) { align-items: flex-end; padding: 0; }
    .pwa-sheet-panel {
        width: 100%;
        border-radius: 24px 24px 0 0;
        padding: 1.6rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom));
    }
}
@media print {
    .pwa-install-card, .pwa-topbar-btn, .pwa-sheet { display: none !important; }
}

.public-nav { position: sticky; top: 0; z-index: 1030; background: rgba(255, 255, 255, .82); backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px); border-bottom: 1px solid rgba(225, 228, 240, .7); }
.public-nav .nav-link { font-weight: 700; color: var(--ink-2); font-size: .9rem; }
.public-nav .nav-link:hover { color: var(--ink); }
.public-nav .brand { color: var(--ink); }
.public-nav .navbar-toggler:focus { box-shadow: none; }
@media (max-width: 991.98px) {
    .public-nav .navbar-collapse { background: #fff; border-radius: 18px; margin-top: .75rem; padding: .75rem; box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
    .public-nav .navbar-collapse .d-flex { flex-direction: column; }
}
.hero { padding: 5.5rem 0 4.5rem; position: relative; overflow: hidden; background:
        radial-gradient(45% 55% at 85% 5%, rgba(var(--primary-light-rgb), .22), transparent 70%),
        radial-gradient(35% 45% at 5% 30%, rgba(var(--success-light-rgb), .22), transparent 70%),
        radial-gradient(30% 35% at 50% 100%, rgba(var(--accent-rgb), .2), transparent 70%); }
.hero h1 { font-size: clamp(2.3rem, 5.4vw, 3.9rem); line-height: 1.03; letter-spacing: -.05em; font-weight: 800; }
.hero .lead { font-size: 1.15rem; color: var(--ink-2); max-width: 580px; }
@media (max-width: 575.98px) { .hero { padding: 3rem 0 2.5rem; } .hero .lead { font-size: 1rem; } }
.gradient-text { background: linear-gradient(120deg, var(--brand) 10%, var(--brand-400) 45%, var(--leaf-600) 90%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eyebrow { display: inline-flex; align-items: center; gap: .5rem; padding: .35rem .85rem; border-radius: 99px; background: #fff; color: var(--ink); font-weight: 700; font-size: .78rem; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.eyebrow::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--leaf-600); box-shadow: 0 0 0 4px var(--leaf-50); }
.mock-window { border-radius: 20px; background: #fff; box-shadow: 0 50px 90px -40px rgba(var(--shadow-rgb), .5); border: 1px solid var(--line); overflow: hidden; }
.mock-window .mw-bar { display: flex; gap: 6px; padding: .75rem .95rem; background: var(--background); border-bottom: 1px solid var(--line); }
.mock-window .mw-bar span { width: 11px; height: 11px; border-radius: 50%; background: var(--n-200); }
.mock-window .mw-bar span:nth-child(1) { background: var(--flame); } .mock-window .mw-bar span:nth-child(2) { background: var(--warning-bright); } .mock-window .mw-bar span:nth-child(3) { background: var(--leaf); }
.feature-card { padding: 1.6rem; border-radius: 20px; border: 1px solid var(--line); background: #fff; height: 100%; transition: transform .2s, box-shadow .2s, border-color .2s; }
.feature-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); border-color: var(--n-200); }
.feature-card .fi { width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center; font-size: 1.35rem; margin-bottom: 1rem; }
.section { padding: 5.5rem 0; }
@media (max-width: 575.98px) { .section { padding: 3.25rem 0; } }
.section-title { font-size: clamp(1.75rem, 3.2vw, 2.5rem); font-weight: 800; letter-spacing: -.04em; }
.price-card { border-radius: 22px; border: 1px solid var(--line); padding: 2rem; background: #fff; height: 100%; position: relative; transition: transform .2s, box-shadow .2s; }
.price-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.price-card.featured { border: 0; background: var(--ink); color: var(--n-300); box-shadow: 0 40px 70px -35px rgba(var(--shadow-rgb), .7); }
.price-card.featured::before { content: ''; position: absolute; top: 0; left: 2rem; right: 2rem; height: 4px; border-radius: 0 0 4px 4px; background: var(--brand-strip); }
.price-card.featured h3, .price-card.featured h4, .price-card.featured h5, .price-card.featured .price { color: #fff; }
.price-card.featured .text-muted { color: var(--n-500) !important; }
.price-card.featured ul li i { color: var(--leaf); }
.price-card .price { font-size: 2.5rem; font-weight: 800; letter-spacing: -.04em; }
.price-card ul li { padding: .38rem 0; font-size: .9rem; }
.price-card ul li i { color: var(--leaf-600); margin-right: .45rem; }
.flow-step { text-align: center; }
.flow-step .fs-icon { width: 58px; height: 58px; border-radius: 18px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; margin: 0 auto .65rem; font-size: 1.4rem; color: var(--brand); box-shadow: var(--shadow-sm); transition: transform .2s; }
.flow-step:hover .fs-icon { transform: translateY(-3px) rotate(-3deg); }
.flow-step:nth-child(4n+2) .fs-icon { color: var(--leaf-600); } .flow-step:nth-child(4n+3) .fs-icon { color: var(--sun-600); } .flow-step:nth-child(4n+4) .fs-icon { color: var(--flame); }
.flow-step small { font-weight: 700; font-size: .78rem; }
.footer { background: var(--ink); color: var(--n-500); padding: 3.5rem 0 2rem; position: relative; }
.footer::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--brand-strip); }
.footer a { color: var(--n-300); }
.footer a:hover { color: #fff; }
.public-doc { max-width: 860px; margin: 2rem auto; }

/* ---------- Customer portal ---------- */
.portal-body { background: radial-gradient(80% 280px at 50% 0%, var(--brand-50), var(--bg) 100%) no-repeat, var(--bg); min-height: 100vh; }
.portal-body .public-nav { background: rgba(255, 255, 255, .75); }

/* ---------- Customer-facing signed pages ---------- */
.public-doc-body { background: radial-gradient(90% 300px at 50% 0%, var(--brand-50) 0, var(--bg) 100%) no-repeat, var(--bg); min-height: 100vh; }
.pd-wrap { max-width: 680px; margin: 0 auto; padding: 1rem .8rem 2rem; }
.pd-wrap.pd-wide { max-width: 980px; }
.pd-brand { display: flex; justify-content: space-between; align-items: center; padding: .8rem .2rem 1rem; }
.pd-logo { height: 48px; max-width: 140px; object-fit: contain; }
.pd-mark { width: 48px; height: 48px; border-radius: 15px; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 800; }
.pd-card { background: #fff; border-radius: 22px; box-shadow: 0 14px 40px -18px rgba(var(--shadow-rgb), .22); border: 1px solid var(--line); padding: 1.5rem; }
.pd-card .print-doc { box-shadow: none; margin: 0; }
.pd-items { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.pd-item { display: flex; gap: .85rem; align-items: flex-start; padding: .85rem 1rem; border-bottom: 1px solid var(--line-2); cursor: pointer; margin: 0; transition: background .12s; }
.pd-item:hover { background: var(--surface-soft); }
.pd-item:last-child { border-bottom: 0; }
.pd-item.readonly { cursor: default; }
.pd-item .form-check-input { margin-top: .25rem; width: 1.3rem; height: 1.3rem; flex-shrink: 0; }
.pd-total { background: var(--ink); color: #fff; border-radius: 16px; padding: 1rem 1.1rem; margin-top: 1rem; }
.pd-total .text-muted { color: var(--n-400) !important; }
.pd-thumb { width: 92px; height: 92px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }
.powered-by { display: flex; align-items: center; justify-content: center; gap: .45rem; color: var(--muted); font-size: .74rem; font-weight: 600; margin-top: 1.5rem; }
.powered-by img { height: 16px; }
.star-input { display: inline-flex; flex-direction: row-reverse; gap: .1rem; }
.star-input input { display: none; }
.star-input label { color: var(--n-200); cursor: pointer; line-height: 1; transition: color .1s, transform .1s; }
.star-input label:hover { transform: scale(1.1); }
.star-input input:checked ~ label, .star-input label:hover, .star-input label:hover ~ label { color: var(--rating); }
@media print { .public-doc-body { background: #fff; } .pd-brand, .pd-card:not(.p-0), .powered-by { display: none; } .pd-card { box-shadow: none; padding: 0; border: 0; } }

/* ---------- Print ---------- */
.print-doc { max-width: 900px; margin: 1.5rem auto; background: #fff; padding: 2.2rem; border-radius: 16px; box-shadow: var(--shadow); font-size: .85rem; }
.print-doc table { width: 100%; }
.print-doc .doc-title { font-size: 1.4rem; font-weight: 800; letter-spacing: .04em; }
.print-doc .table > :not(caption) > * > * { padding: .45rem .55rem; }
@media (max-width: 575.98px) { .print-doc { padding: 1.1rem; margin: .5rem; border-radius: 14px; } .print-doc .table-responsive, .print-doc { overflow-x: auto; } }
@media print {
    body { background: #fff !important; }
    .no-print, .sidebar, .topbar, .mobile-tabbar, .more-sheet, .more-backdrop { display: none !important; }
    .print-doc { box-shadow: none; margin: 0; padding: 0; max-width: 100%; }
    .main { margin: 0 !important; }
    .content { padding: 0 !important; animation: none; }
    a { color: inherit !important; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .content { animation: none !important; opacity: 1; }
    .btn:hover, .btn:active, .card-hover:hover, a.card:hover, .stat-card:hover { transform: none !important; }
}
