:root {
    --navy: #0A2540;
    --teal: #C1440E;
    --teal-dark: #9E360B;
    --teal-soft: #ecfdf5;
    --surface: #ffffff;
    --bg: #f0f4f8;
    --border: #e2e8f0;
    --muted: #64748b;
    --shadow-sm: 0 1px 2px rgba(10, 37, 64, 0.05);
    --shadow-md: 0 4px 16px rgba(10, 37, 64, 0.08);
    --shadow-lg: 0 12px 40px rgba(10, 37, 64, 0.1);
    --radius: 1rem;
    --radius-lg: 1.25rem;

    /* Sidebar command-center palette */
    --sidebar-bg: #0A1628;
    --sidebar-hover: #0F1F38;
    --sidebar-active: #C1440E;
    --sidebar-text: #94A3B8;
    --sidebar-text-active: #FFFFFF;
    --sidebar-divider: #1E293B;
    --gold: #9C7A3C;
    --content-bg: #F8FAFC;
    --card-bg: #FFFFFF;
    --card-border: #E2E8F0;
    --heading: #0A2540;
    --danger: #DC2626;
    --sidebar-width: 260px;
    --sidebar-rail-width: 72px;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--navy);
}

.heading-font {
    font-family: 'Playfair Display', serif;
}

/* ── Login ── */
.login-bg {
    background: linear-gradient(145deg, #0A2540 0%, #0f3d5c 45%, #9E360B 100%);
    position: relative;
    overflow: hidden;
}
.login-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% 80%, rgba(193, 68, 14, 0.35) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 85% 15%, rgba(255, 255, 255, 0.06) 0%, transparent 50%);
    pointer-events: none;
}
.login-card {
    background: var(--surface);
    border-radius: 1.5rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.login-logo {
    width: 4rem;
    height: 4rem;
    background: linear-gradient(135deg, var(--teal) 0%, #14b8a6 100%);
    border-radius: 1.25rem;
    box-shadow: 0 8px 24px rgba(193, 68, 14, 0.35);
}

/* ── Header ── */
.admin-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.admin-header-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}
.admin-header-icon {
    width: 2.25rem;
    height: 2.25rem;
    background: linear-gradient(135deg, var(--teal) 0%, #14b8a6 100%);
    border-radius: 0.625rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(193, 68, 14, 0.25);
}

/* ── Dashboard shell ── */
.dash-shell {
    max-width: 1440px;
    margin: 0 auto;
    padding: 1.25rem 1rem 2.5rem;
}
@media (min-width: 640px) {
    .dash-shell { padding: 1.5rem 1.5rem 3rem; }
}
@media (min-width: 1024px) {
    .dash-shell {
        display: grid;
        grid-template-columns: 220px 1fr;
        gap: 1.75rem;
        align-items: start;
        padding: 1.75rem 2rem 3rem;
    }
}

/* ── Sidebar nav ── */
.dash-nav {
    display: flex;
    gap: 0.375rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.dash-nav::-webkit-scrollbar { display: none; }
@media (min-width: 1024px) {
    .dash-nav {
        flex-direction: column;
        overflow: visible;
        position: sticky;
        top: 5.25rem;
        padding: 0.5rem;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-sm);
    }
}
.dash-nav-btn {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 1rem;
    border: none;
    background: transparent;
    color: var(--muted);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.75rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
    flex-shrink: 0;
}
.dash-nav-btn i {
    width: 1.125rem;
    text-align: center;
    font-size: 0.8125rem;
}
.dash-nav-btn:hover {
    background: #f1f5f9;
    color: var(--navy);
}
.dash-nav-btn.active {
    background: var(--teal-soft);
    color: var(--teal-dark);
    box-shadow: inset 0 0 0 1px rgba(193, 68, 14, 0.2);
}
@media (min-width: 1024px) {
    .dash-nav-btn { width: 100%; }
}

.dash-panel { display: none; }
.dash-panel.active { display: block; animation: panelIn 0.25s ease; }
@keyframes panelIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Cards ── */
.admin-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s;
}
.admin-card:hover { box-shadow: var(--shadow-md); }

.section-head {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    margin-bottom: 1.5rem;
}
.section-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ── Stats ── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}
@media (min-width: 640px) { .stats-row { gap: 1rem; } }

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.125rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    transition: transform 0.15s, box-shadow 0.15s;
}
.stat-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
.stat-card-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.875rem;
}
.stat-card-icon.total { background: #e0f2fe; color: #0369a1; }
.stat-card-icon.pdf { background: #fee2e2; color: #b91c1c; }
.stat-card-icon.video { background: #fef3c7; color: #b45309; }

/* ── Tool groups ── */
.tool-group { margin-bottom: 1.5rem; }
.tool-group:last-child { margin-bottom: 0; }
.tool-group-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 0.75rem;
    padding-left: 0.125rem;
}
.tool-grid {
    display: grid;
    gap: 0.75rem;
}
@media (min-width: 640px) {
    .tool-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
}
@media (min-width: 1280px) {
    .tool-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
}

.tool-card {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 1.125rem 1.25rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    position: relative;
    overflow: hidden;
}
.tool-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--teal);
    opacity: 0;
    transition: opacity 0.2s;
}
.tool-card:hover {
    transform: translateY(-2px);
    border-color: #99f6e4;
    box-shadow: 0 8px 24px rgba(193, 68, 14, 0.1);
}
.tool-card:hover::after { opacity: 1; }
.tool-card-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.625rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.9375rem;
}
.tool-card-arrow {
    color: var(--teal);
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 0.2s, transform 0.2s;
    font-size: 0.75rem;
}
.tool-card:hover .tool-card-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* ── Forms & buttons ── */
.input-field {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 0.6875rem 0.875rem;
    font-size: 0.875rem;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.input-field:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(193, 68, 14, 0.12);
}

/* `button.btn-primary` as well as `.btn-primary`: member pages load this sheet
   before assets/dist/member.css, whose preflight `[type=button]{background-color:
   transparent}` has the same specificity and won the tie, leaving white text on a
   white panel in light mode (member-signatures, 2026-09-13). The element selector
   lifts these to (0,1,1) regardless of sheet order. */
.btn-primary, button.btn-primary {
    background: var(--teal);
    color: #fff;
    font-weight: 600;
    padding: 0.6875rem 1.375rem;
    border-radius: 0.75rem;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background 0.15s, transform 0.1s;
    cursor: pointer;
    font-size: 0.875rem;
}
.btn-primary:hover:not(:disabled) { background: var(--teal-dark); }
.btn-primary:active:not(:disabled) { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-ghost, button.btn-ghost {
    border: 1px solid var(--border);
    background: #fff;
    color: var(--navy);
    font-weight: 600;
    padding: 0.5rem 0.875rem;
    border-radius: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    font-size: 0.8125rem;
}
.btn-ghost:hover { background: #f8fafc; border-color: #cbd5e1; }

.btn-danger-ghost {
    border: 1px solid #fecaca;
    background: #fff;
    color: #dc2626;
    font-weight: 600;
    padding: 0.5rem 0.875rem;
    border-radius: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.8125rem;
    transition: background 0.15s;
}
.btn-danger-ghost:hover { background: #fef2f2; }

.btn-amber {
    background: #f59e0b;
    color: #fff;
    font-weight: 600;
    padding: 0.6875rem 1.375rem;
    border-radius: 0.75rem;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background 0.15s;
}
.btn-amber:hover:not(:disabled) { background: #d97706; }
.btn-amber:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Dropzone ── */
.dropzone {
    transition: all 0.2s ease;
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}
.dropzone:hover { border-color: var(--teal); background: var(--teal-soft); }
.dropzone.dragover {
    background: #ecfdf5;
    border-color: var(--teal);
    border-style: solid;
    transform: scale(1.005);
    box-shadow: 0 0 0 4px rgba(193, 68, 14, 0.1);
}

.pending-files-wrap {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: #fafbfc;
}

/* ── Library ── */
.library-wrap {
    max-height: min(72vh, 680px);
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fafbfc;
}
.library-table {
    width: 100%;
    font-size: 0.8125rem;
    border-collapse: collapse;
}
.library-table thead {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f1f5f9;
}
.library-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.library-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    background: #fff;
}
.library-table tbody tr:nth-child(even) td { background: #f8fafc; }
.library-table tbody tr:hover td { background: #f1f5f9; }

/* Same alternating/hover treatment for the other plain data tables
   (Contracts, Generated Packages, Signatures) — additive only, no HTML/JS
   change needed since it just targets the existing markup those render
   functions already output. */
.admin-card table tbody tr:nth-child(even) td,
.lux-card table tbody tr:nth-child(even) td { background: #f8fafc; }
.admin-card table tbody tr:hover td,
.lux-card table tbody tr:hover td { background: #f1f5f9; }
.library-table .title-cell {
    font-weight: 500;
    color: var(--navy);
    max-width: 220px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 600;
    white-space: nowrap;
}
.badge-pdf { background: #fee2e2; color: #b91c1c; }
.badge-video { background: #fef3c7; color: #b45309; }
.badge-supabase { background: #d1fae5; color: #047857; }
.badge-r2 { background: #ffedd5; color: #c2410c; }
.badge-embed { background: #f1f5f9; color: #475569; }

.action-btn {
    padding: 0.3rem 0.625rem;
    font-size: 0.6875rem;
    font-weight: 600;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: #fff;
    cursor: pointer;
    transition: background 0.15s;
}
.action-btn:hover { background: #f8fafc; }
.action-btn-danger { border-color: #fecaca; color: #dc2626; }
.action-btn-danger:hover { background: #fef2f2; }

/* ── Upload layout ── */
.upload-stack {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
@media (min-width: 1024px) {
    .upload-stack {
        display: grid;
        grid-template-columns: 3fr 2fr;
        gap: 1.5rem;
        align-items: start;
    }
}

/* ── Misc ── */
.page-intro { margin-bottom: 0.25rem; }
.page-intro h1 {
    font-size: 1.75rem;
    line-height: 1.2;
}
@media (min-width: 640px) {
    .page-intro h1 { font-size: 2rem; }
}

.security-details summary { cursor: pointer; list-style: none; }
.security-details summary::-webkit-details-marker { display: none; }
.security-details[open] .sec-chevron { transform: rotate(180deg); }
.sec-chevron { transition: transform 0.2s; }

.toast { animation: slideUp 0.3s ease forwards; }
@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

#bulk-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    margin: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 0.5rem;
}
#bulk-bar.flex { display: flex; }

/* ── Library folders ── */
.library-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.folder-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    flex: 1;
    min-width: 0;
}
.folder-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.9rem;
    border: 1px solid var(--card-border);
    border-radius: 9999px;
    background: #fff;
    color: var(--muted);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.folder-tab:hover { border-color: #cbd5e1; color: var(--heading); }
.folder-tab.active {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff;
}
.folder-tab i { font-size: 0.6875rem; }
.create-folder-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
}
.create-folder-bar .input-field { flex: 1; min-width: 10rem; }
.folder-move-select {
    font-size: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: #fff;
    color: var(--navy);
    max-width: 9rem;
}
.badge-folder { background: #e0e7ff; color: #4338ca; }

/* ── Quick links (Overview) — flat rows, not cards: for tools admins already
   know by heart. Full tool-card treatment (icon+description+arrow) is
   reserved for less-frequent destinations tucked under "More tools". ── */
.quick-links-list { display: flex; flex-direction: column; }
.quick-link-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.25rem;
    color: var(--navy);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    border-bottom: 1px solid #f1f5f9;
    transition: color 0.15s;
}
.quick-links-list a:last-child { border-bottom: none; }
.quick-link-row i:first-child { width: 1.25rem; text-align: center; color: var(--teal); font-size: 0.8125rem; }
.quick-link-row .fa-arrow-right {
    margin-left: auto;
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 0.15s, transform 0.15s;
    font-size: 0.7rem;
    color: var(--teal);
}
.quick-link-row:hover { color: var(--teal-dark); }
.quick-link-row:hover .fa-arrow-right { opacity: 1; transform: translateX(0); }

.more-tools-toggle summary { cursor: pointer; list-style: none; font-size: 0.75rem; font-weight: 700; color: var(--muted); }
.more-tools-toggle summary::-webkit-details-marker { display: none; }
.more-tools-toggle[open] .sec-chevron { transform: rotate(180deg); }

/* ── Signatures: field-placement editor ── */
.sig-page-wrap {
    position: relative;
    background: #fff;
    box-shadow: 0 2px 8px rgba(10, 37, 64, 0.12);
    margin: 0 auto;
    line-height: 0;
}
.sig-page-wrap canvas { display: block; width: 100%; height: auto; }
.sig-field {
    position: absolute;
    border: 2px solid var(--teal);
    background: rgba(193, 68, 14, 0.12);
    border-radius: 4px;
    cursor: move;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--teal-dark);
    user-select: none;
    min-width: 24px;
    min-height: 16px;
}
.sig-field.type-signature { border-color: #7c3aed; background: rgba(124, 58, 237, 0.12); color: #6d28d9; }
.sig-field.type-initials { border-color: #db2777; background: rgba(219, 39, 119, 0.12); color: #be185d; }
.sig-field.type-date { border-color: #d97706; background: rgba(217, 119, 6, 0.12); color: #b45309; }
.sig-field-resize {
    position: absolute;
    right: -5px;
    bottom: -5px;
    width: 11px;
    height: 11px;
    background: var(--teal);
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: nwse-resize;
}
.sig-field-remove {
    position: absolute;
    top: -9px;
    right: -9px;
    width: 17px;
    height: 17px;
    background: #dc2626;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    cursor: pointer;
    line-height: 1;
}
.field-type-btn.active { background: var(--teal-soft); border-color: rgba(193, 68, 14, 0.4); color: var(--teal-dark); }
.field-type-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── Signatures: recipient list ── */
.sig-recipient-row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.55rem 0.6rem;
}
.sig-recipient-row .sig-recipient-swatch {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 0.5rem;
    flex-shrink: 0;
}
.sig-recipient-row .sig-recipient-fields {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.sig-recipient-row input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 0.35rem 0.5rem;
    font-size: 0.78rem;
}
.sig-recipient-remove {
    color: #dc2626;
    cursor: pointer;
    padding: 0.3rem;
    flex-shrink: 0;
}
.sig-recipient-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.7rem;
    padding: 0.15rem 0.55rem 0.15rem 0.4rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: #334155;
    margin: 0.1rem 0.25rem 0.1rem 0;
    white-space: nowrap;
}
.sig-recipient-chip .sig-recipient-swatch { width: 8px; height: 8px; border-radius: 50%; margin: 0; }

/* Setup modal */
.setup-modal-backdrop {
    background: rgba(10, 37, 64, 0.55);
    backdrop-filter: blur(4px);
}

/* =========================================================================
   LUXURY SIDEBAR COMMAND CENTER
   .admin-sidebar is position:fixed so widening it on hover (collapsed/rail
   state) never reflows .admin-content-wrap — only margin-left changes drive
   layout, everything else is a pure overlay. Existing JS only ever queries
   `.dash-nav-btn` / `.dash-panel` (never `.dash-nav` / `.dash-main`), so this
   whole shell can be restructured freely as long as those two class names
   and the data-dash-panel/id="panel-X" pairing stay intact.
   ========================================================================= */

.admin-shell { min-height: 100vh; background: var(--content-bg); }

.admin-sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    z-index: 40;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.08);
    transition: width 0.2s ease, transform 0.2s ease;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 1.25rem 1rem 1rem;
    flex-shrink: 0;
}
.sidebar-crown {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.625rem;
    background: linear-gradient(135deg, var(--gold) 0%, #b8901f 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #1a1305;
    font-size: 0.9375rem;
    box-shadow: 0 2px 10px rgba(156, 122, 60, 0.3);
}
.sidebar-header-text { flex: 1; min-width: 0; overflow: hidden; }
.sidebar-title {
    color: var(--sidebar-text-active);
    font-weight: 700;
    font-size: 0.8125rem;
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.sidebar-status {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.6875rem;
    color: var(--sidebar-text);
    white-space: nowrap;
    margin-top: 0.15rem;
}
.status-dot-sm {
    width: 6px; height: 6px; border-radius: 50%;
    background: #eab308;
    flex-shrink: 0;
    transition: background 0.2s;
}
.status-dot-sm.ok { background: #22c55e; }
.status-dot-sm.err { background: var(--danger); }

.sidebar-collapse-btn {
    background: transparent;
    border: 1px solid var(--sidebar-divider);
    color: var(--sidebar-text);
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    font-size: 0.6875rem;
    transition: all 0.2s ease;
}
.sidebar-collapse-btn:hover { background: var(--sidebar-hover); color: #fff; }

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.25rem 0.75rem 1rem;
    scrollbar-width: thin;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--sidebar-divider); border-radius: 4px; }

.sidebar-section-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--sidebar-text);
    opacity: 0.5;
    margin: 1.25rem 0.5rem 0.5rem;
    white-space: nowrap;
}
.sidebar-nav > *:first-child.sidebar-section-label { margin-top: 0.5rem; }

.sidebar-divider {
    height: 1px;
    background: var(--sidebar-divider);
    margin: 1rem 0.25rem;
}

/* .dash-nav-btn keeps its class name (JS-queried) but is fully restyled for
   the dark sidebar context via this descendant selector. */
.admin-sidebar .dash-nav-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border: none;
    background: transparent;
    color: var(--sidebar-text);
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: 0.625rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    position: relative;
    margin-bottom: 0.125rem;
    border-left: 3px solid transparent;
}
.admin-sidebar .dash-nav-btn i { width: 1.125rem; text-align: center; font-size: 0.8125rem; flex-shrink: 0; }
.admin-sidebar .dash-nav-btn:hover { background: var(--sidebar-hover); color: #fff; }
.admin-sidebar .dash-nav-btn.active {
    background: var(--sidebar-hover);
    color: var(--sidebar-text-active);
    border-left-color: var(--sidebar-active);
}
.admin-sidebar .dash-nav-btn.active i { color: var(--sidebar-active); }

/* Sidebar entries that open a standalone admin page (vs. an in-place panel
   switch) are plain anchors with a small trailing external-link marker. */
.admin-sidebar a.dash-nav-btn { text-decoration: none; }
.admin-sidebar .dash-nav-btn .ext-mark {
    margin-left: auto;
    width: auto;
    font-size: 0.5625rem;
    opacity: 0.45;
}
.admin-shell.sidebar-collapsed .dash-nav-btn .ext-mark { display: none; }

/* Library search stays reachable while scrolling a long table. */
.library-search-sticky {
    position: sticky;
    top: 0.5rem;
    z-index: 30;
    background: #fff;
    border-radius: 0.75rem;
}

.sidebar-footer {
    flex-shrink: 0;
    padding: 0.875rem;
    border-top: 1px solid var(--sidebar-divider);
}
.sidebar-footer-link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.625rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    margin-bottom: 0.5rem;
}
.sidebar-footer-link:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar-user-row {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.375rem 0.25rem;
}
.sidebar-user-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    background: var(--teal);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; overflow: hidden; }
.sidebar-user-email {
    color: var(--sidebar-text-active);
    font-size: 0.6875rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-logout-btn {
    background: transparent;
    border: none;
    color: var(--sidebar-text);
    cursor: pointer;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}
.sidebar-logout-btn:hover { background: rgba(220, 38, 38, 0.15); color: #f87171; }

.admin-content-wrap {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.2s ease;
}

.admin-topbar {
    display: none;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: var(--sidebar-bg);
    position: sticky;
    top: 0;
    z-index: 30;
}
.topbar-hamburger {
    background: var(--sidebar-hover);
    border: none;
    color: #fff;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.625rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}
.topbar-brand { color: #fff; font-weight: 700; font-size: 0.9375rem; }

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 22, 40, 0.55);
    z-index: 39;
}

.dash-main { padding: 1.25rem 1rem 2.5rem; max-width: 1320px; }
@media (min-width: 640px) { .dash-main { padding: 1.5rem 1.5rem 3rem; } }
@media (min-width: 1024px) { .dash-main { padding: 1.75rem 2.25rem 3rem; } }

/* Collapsed (rail) state — manual desktop toggle, persisted */
.admin-shell.sidebar-collapsed .admin-sidebar { width: var(--sidebar-rail-width); }
.admin-shell.sidebar-collapsed .admin-content-wrap { margin-left: var(--sidebar-rail-width); }
.admin-shell.sidebar-collapsed .sidebar-header-text,
.admin-shell.sidebar-collapsed .sidebar-section-label,
.admin-shell.sidebar-collapsed .sidebar-user-info,
.admin-shell.sidebar-collapsed .sidebar-footer-link span,
.admin-shell.sidebar-collapsed .admin-sidebar .dash-nav-btn span {
    display: none;
}
.admin-shell.sidebar-collapsed .admin-sidebar .dash-nav-btn { justify-content: center; padding: 0.625rem; }
.admin-shell.sidebar-collapsed .sidebar-collapse-btn i { transform: rotate(180deg); }

/* Tablet: always rail width, hover/focus-expand overlays content */
@media (min-width: 768px) and (max-width: 1023px) {
    .admin-sidebar { width: var(--sidebar-rail-width); }
    .admin-content-wrap { margin-left: var(--sidebar-rail-width); }
    .admin-sidebar .sidebar-header-text,
    .sidebar-section-label,
    .sidebar-user-info,
    .sidebar-footer-link span,
    .admin-sidebar .dash-nav-btn span {
        display: none;
    }
    .admin-sidebar .dash-nav-btn { justify-content: center; padding: 0.625rem; }
    .sidebar-collapse-btn { display: none; }
    .admin-sidebar:hover, .admin-sidebar:focus-within { width: var(--sidebar-width); }
    .admin-sidebar:hover .sidebar-header-text, .admin-sidebar:hover .sidebar-section-label,
    .admin-sidebar:hover .sidebar-user-info, .admin-sidebar:hover .sidebar-footer-link span,
    .admin-sidebar:hover .dash-nav-btn span,
    .admin-sidebar:focus-within .sidebar-header-text, .admin-sidebar:focus-within .sidebar-section-label,
    .admin-sidebar:focus-within .sidebar-user-info, .admin-sidebar:focus-within .sidebar-footer-link span,
    .admin-sidebar:focus-within .dash-nav-btn span {
        display: block;
    }
    .admin-sidebar:hover .dash-nav-btn, .admin-sidebar:focus-within .dash-nav-btn { justify-content: flex-start; padding: 0.625rem 0.75rem; }
}

/* Mobile: off-canvas drawer */
@media (max-width: 767px) {
    .admin-sidebar {
        width: 84vw;
        max-width: 300px;
        transform: translateX(-100%);
    }
    .admin-shell.mobile-nav-open .admin-sidebar { transform: translateX(0); }
    .admin-shell.mobile-nav-open .sidebar-backdrop { display: block; }
    .admin-content-wrap { margin-left: 0; }
    .admin-topbar { display: flex; }
    .admin-sidebar .sidebar-header-text,
    .sidebar-section-label,
    .sidebar-user-info,
    .sidebar-footer-link span,
    .admin-sidebar .dash-nav-btn span {
        display: block;
    }
    .admin-sidebar .dash-nav-btn { justify-content: flex-start; padding: 0.625rem 0.75rem; }
}

/* =========================================================================
   Page transitions — two-stage: fade the outgoing panel (100ms), swap,
   fade+lift the incoming panel in (200ms). Driven by switchDashPanel().
   ========================================================================= */
.dash-panel.panel-out { opacity: 0; transition: opacity 0.1s ease; }
.dash-panel.active { animation: panelIn 0.2s ease; }
@keyframes panelIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================================================
   Refined cards / badges / empty states / skeletons / slide-over — shared
   across every redesigned page.
   ========================================================================= */
.lux-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.stat-card-v2 {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.125rem 1.25rem;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    transition: all 0.2s ease;
}
.stat-card-v2:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(10, 37, 64, 0.08); }
.stat-card-v2::before {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 4px;
    background: var(--stripe, var(--teal));
}
.stat-card-v2 .stat-icon-circle {
    width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    background: var(--icon-bg, var(--teal-soft));
    color: var(--icon-color, var(--teal));
    font-size: 1rem;
}
.stat-card-v2 .stat-number { font-size: 2rem; font-weight: 800; color: var(--heading); line-height: 1.1; }
.stat-card-v2 .stat-label { font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-top: 0.25rem; }

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 700;
    white-space: nowrap;
}
.status-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-badge-slate { background: #f1f5f9; color: #475569; }
.status-badge-blue { background: #dbeafe; color: #1d4ed8; }
.status-badge-amber { background: #fef3c7; color: #b45309; }
.status-badge-green { background: #d1fae5; color: #047857; }
.status-badge-red { background: #fee2e2; color: #b91c1c; }

.pill-tabs { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.pill-tab {
    padding: 0.5rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--card-border);
    background: #fff;
    color: var(--muted);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.pill-tab:hover { border-color: #cbd5e1; color: var(--heading); }
.pill-tab.active { background: var(--navy); border-color: var(--navy); color: #fff; }

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--muted);
}
.empty-state .empty-icon {
    width: 3.5rem; height: 3.5rem; border-radius: 1rem;
    background: var(--teal-soft); color: var(--teal);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.375rem;
    margin: 0 auto 1rem;
}
.empty-state h3 { font-weight: 700; color: var(--heading); font-size: 0.9375rem; margin-bottom: 0.25rem; }
.empty-state p { font-size: 0.8125rem; margin-bottom: 1rem; }

.skeleton-bar {
    height: 0.875rem;
    border-radius: 0.375rem;
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 37%, #e2e8f0 63%);
    background-size: 400% 100%;
    animation: skeletonPulse 1.4s ease infinite;
}
@keyframes skeletonPulse {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

.slide-over-backdrop {
    background: rgba(10, 22, 40, 0.45);
    justify-content: flex-end !important;
    align-items: stretch !important;
    padding: 0 !important;
}
.slide-over-panel {
    width: 100%;
    max-width: 480px;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0 !important;
    overflow-y: auto;
    animation: slideOverIn 0.25s ease;
}
@keyframes slideOverIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

/* Three-dot row-action menu — used by Library (and reusable anywhere else
   a row has 2+ actions that don't need to be visible inline). */
.row-actions-menu { position: relative; display: inline-block; }
.row-actions-trigger {
    width: 1.75rem; height: 1.75rem;
    border-radius: 0.5rem;
    border: 1px solid var(--card-border);
    background: #fff;
    color: var(--muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}
.row-actions-trigger:hover { background: #f8fafc; color: var(--heading); }
.row-actions-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 140px;
    background: #fff;
    border: 1px solid var(--card-border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(10, 37, 64, 0.15);
    z-index: 15;
    overflow: hidden;
    padding: 0.25rem;
}
.row-actions-dropdown.hidden { display: none; }
.row-actions-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.45rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--heading);
    background: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease;
}
.row-actions-item:hover { background: #f1f5f9; }
.row-actions-item.danger { color: #dc2626; }
.row-actions-item.danger:hover { background: #fef2f2; }

/* Signature builder — status breadcrumb + floating field-type toolbar */
.sig-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-bottom: -0.25rem;
}
.sig-breadcrumb-step {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: #94a3b8;
}
.sig-breadcrumb-step.done { background: #d1fae5; color: #047857; }
.sig-breadcrumb-step.active { background: var(--navy); color: #fff; }
.sig-breadcrumb-arrow { color: #cbd5e1; font-size: 0.65rem; }

.sig-field-toolbar {
    position: sticky;
    /* .admin-header (admin-uploads.html) is also position:sticky at top:0
       with a higher z-index (40 vs this toolbar's 12) — at top:0 this
       toolbar (and the field-type buttons on it, which is what a user is
       actually trying to click while scrolling a multi-page document) got
       stuck directly underneath it instead of below it. 5.25rem matches
       .dash-nav's already-correct offset for the same header on this same
       page. member-signatures.html overrides this again for its own
       shorter .dash-header — see the inline <style> there. */
    top: 5.25rem;
    z-index: 12;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    background: #fff;
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 0.75rem 0.9rem;
    margin-bottom: 0.25rem;
    box-shadow: 0 4px 14px rgba(10, 37, 64, 0.06);
}
.sig-field-toolbar-recipient { display: flex; align-items: center; flex-shrink: 0; }
.sig-field-toolbar-recipient .input-field { min-width: 160px; padding: 0.4rem 0.6rem; font-size: 0.8rem; }
.sig-field-toolbar-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.sig-field-toolbar-buttons .field-type-btn {
    padding: 0.4rem 0.7rem;
    font-size: 0.75rem;
}
@media (max-width: 640px) {
    .sig-field-toolbar { position: static; }
}

/* Builder sidebar (title/webhook/recipients/fields/actions) follows scroll
   on long documents instead of scrolling out of view above the page list.
   align-self:start keeps its own box short (content-sized) while the grid
   row stays tall from the page-preview column, giving sticky room to move;
   the max-height + overflow-y keeps it fully reachable if it ever grows
   taller than the viewport (e.g. many recipients/fields on a 20-page doc). */
@media (min-width: 1024px) {
    .sig-builder-sidebar {
        position: sticky;
        top: 1rem;
        align-self: start;
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
    }
}

.sticky-bulk-bar {
    position: sticky;
    bottom: 1rem;
    margin: 1rem auto 0;
    max-width: fit-content;
    background: var(--navy);
    color: #fff;
    border-radius: 999px;
    padding: 0.625rem 0.625rem 0.625rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    box-shadow: 0 8px 24px rgba(10, 37, 64, 0.35);
    z-index: 20;
}

/* Signatures — folder sidebar / filter bar / grid view */
.sig-layout { display: flex; gap: 1.25rem; align-items: flex-start; }
.sig-folder-sidebar {
    flex-shrink: 0; width: 200px;
    display: flex; flex-direction: column; gap: 0.2rem;
    background: #fff; border: 1px solid var(--card-border); border-radius: 14px;
    padding: 0.6rem;
}
.sig-folder-btn {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.55rem 0.65rem; border-radius: 10px;
    font-size: 0.8125rem; font-weight: 600; color: var(--muted);
    background: none; border: none; cursor: pointer; text-align: left;
    transition: background 0.15s, color 0.15s;
}
.sig-folder-btn:hover { background: #f8fafc; color: var(--heading); }
.sig-folder-btn.active { background: var(--navy); color: #fff; }
.sig-folder-count {
    margin-left: auto; font-size: 0.6875rem; font-weight: 700;
    background: rgba(148, 163, 184, 0.18); color: inherit;
    border-radius: 999px; padding: 0.05rem 0.5rem; min-width: 1.4rem; text-align: center;
}
.sig-folder-btn.active .sig-folder-count { background: rgba(255, 255, 255, 0.2); }

.sig-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.9rem; }
.sig-filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.sig-view-toggle { display: flex; border: 1px solid var(--card-border); border-radius: 10px; overflow: hidden; flex-shrink: 0; }
.sig-view-btn {
    width: 2.25rem; height: 2.25rem; display: flex; align-items: center; justify-content: center;
    background: #fff; color: var(--muted); border: none; cursor: pointer; transition: all 0.15s;
}
.sig-view-btn + .sig-view-btn { border-left: 1px solid var(--card-border); }
.sig-view-btn:hover { background: #f8fafc; }
.sig-view-btn.active { background: var(--navy); color: #fff; }

.sig-thumb {
    width: 2.25rem; height: 2.25rem; border-radius: 8px; flex-shrink: 0;
    background: #fee2e2; color: #b91c1c;
    display: flex; align-items: center; justify-content: center; font-size: 0.9rem;
}
.sig-signer-chip { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.75rem; color: var(--muted); margin-right: 0.5rem; }
.sig-signer-chip i.fa-circle-check { color: #059669; }
.sig-signer-chip i.fa-clock { color: #cbd5e1; }

.sig-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.sig-grid-card {
    border: 1px solid var(--card-border); border-radius: 14px; padding: 1rem;
    display: flex; flex-direction: column; gap: 0.6rem; transition: box-shadow 0.15s, border-color 0.15s;
}
.sig-grid-card:hover { border-color: var(--teal); box-shadow: 0 6px 18px rgba(10, 37, 64, 0.08); }
.sig-grid-card-head { display: flex; align-items: center; gap: 0.6rem; }
.sig-grid-card h4 { font-size: 0.875rem; font-weight: 700; color: var(--heading); }
.sig-grid-card .sig-grid-meta { font-size: 0.75rem; color: var(--muted); }
.sig-grid-favorite { margin-left: auto; background: none; border: none; cursor: pointer; color: #cbd5e1; font-size: 0.9rem; }
.sig-grid-favorite.active, .sig-fav-btn.active { color: #f59e0b; }
.sig-fav-btn { background: none; border: none; cursor: pointer; color: #cbd5e1; font-size: 0.9rem; padding: 0.2rem; }

/* =========================================================================
   Phone pass — this dashboard was built desktop-first and just reflowed
   for narrow screens (see the max-width:767px block above, which only
   converts the sidebar into a drawer). Once admin-uploads.html became an
   installable Home Screen app (see admin-app.webmanifest / sw-admin.js /
   assets/vv-admin-push.js), that gap started actually mattering — the same
   desktop information density that's fine in a wide browser tab feels
   cramped as someone's *entire* phone screen. This block only loosens
   spacing/tap-target sizes; it doesn't rearrange or hide anything.
   ========================================================================= */
@media (max-width: 480px) {
    .dash-main { padding: 1rem 0.875rem 3rem; }
    .page-intro h1 { font-size: 1.625rem; }
    .page-intro p { font-size: 0.9rem; line-height: 1.5; }

    .lux-card, .admin-card { border-radius: 18px; }
    .lux-card.p-4, .admin-card.p-4 { padding: 1.125rem; }
    .lux-card.p-5, .admin-card.p-5 { padding: 1.25rem; }
    .lux-card.p-6, .admin-card.p-6 { padding: 1.375rem; }

    .section-head { gap: 0.75rem; margin-bottom: 1.125rem; }
    .section-icon { width: 2.5rem; height: 2.5rem; border-radius: 0.75rem; font-size: 0.9rem; }
    .section-head h2 { font-size: 1.0625rem; }
    .section-head p { font-size: 0.85rem; line-height: 1.45; }

    /* Comfortable Apple-HIG tap targets (~44pt) everywhere something is
       tappable — several buttons here were sized for a mouse pointer. */
    .btn-primary { padding: 0.8125rem 1.5rem; font-size: 0.9375rem; min-height: 44px; }
    .btn-ghost { padding: 0.75rem 1.125rem; font-size: 0.875rem; min-height: 44px; }
    .quick-link-row { padding-top: 0.9rem; padding-bottom: 0.9rem; font-size: 0.9375rem; min-height: 44px; }
    .dash-nav-btn { min-height: 46px; }
    .topbar-hamburger { width: 2.75rem; height: 2.75rem; }
    .notif-bell { width: 2.75rem; height: 2.75rem; font-size: 1.15rem; }
    .notif-dropdown { width: min(340px, calc(100vw - 1.5rem)); }

    .stats-row { gap: 0.625rem; }
    .stat-card-v2 { padding: 1rem; gap: 0.75rem; }
    .stat-card-v2 .stat-number { font-size: 1.625rem; }

    /* Recent Activity / Notary Requests rows (admin-uploads.html builds
       these with inline Tailwind utility classes at render time — this
       targets the same markup from the CSS side so both lists loosen up
       without duplicating the change in every JS template string). */
    #recent-activity-list > div, #notary-requests-list > div {
        padding-top: 0.8rem !important;
        padding-bottom: 0.8rem !important;
    }
    #recent-activity-list .text-sm, #notary-requests-list .text-sm { font-size: 0.9rem !important; }
    #recent-activity-list .w-8, #notary-requests-list .w-8 {
        width: 2.25rem !important; height: 2.25rem !important;
    }
}

/* Standalone PWA mode only (installed via Add to Home Screen, not a
   regular Safari tab) — with apple-mobile-web-app-status-bar-style set to
   black-translucent, page content draws *underneath* the status bar/notch
   unless it claims that space itself, so without this the very top row of
   the sidebar/topbar sits partly behind the clock/battery. env() falls
   back to 0 on devices without a notch, so this is a no-op elsewhere. */
@media (display-mode: standalone) {
    .sidebar-header { padding-top: max(1.25rem, env(safe-area-inset-top)); }
    .admin-topbar { padding-top: max(0.875rem, env(safe-area-inset-top)); }
    .sidebar-footer, .dash-main { padding-bottom: env(safe-area-inset-bottom); }
}

@media (max-width: 860px) {
    .sig-layout { flex-direction: column; }
    .sig-folder-sidebar {
        width: 100%; flex-direction: row; overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .sig-folder-btn { flex-shrink: 0; }
}
/* ---- Signatures list polish (2026-09-13): the recipients column used to wrap
   every name onto its own line and stretch rows to 400 px; dates broke
   mid-value. Columns now have real widths, signers stack as a capped list,
   dates are two fixed lines. ---- */
.lux-card table tbody td { vertical-align: middle; }
.sig-td-icon { width: 5.5rem; }
.sig-td-title { min-width: 260px; max-width: 460px; }
.sig-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; line-height: 1.35; }
.sig-td-signers { min-width: 200px; max-width: 260px; }
.sig-signers { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.sig-signer-chip { display: flex; align-items: center; gap: 0.35rem; font-size: 0.75rem; color: var(--muted); margin: 0; white-space: nowrap; min-width: 0; }
.sig-signer-chip .vv-fi { flex-shrink: 0; }
.sig-signer-name { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sig-signer-done { color: #059669; }
.sig-signer-wait { color: #cbd5e1; }
.sig-signer-more { font-size: 0.7rem; font-weight: 600; color: var(--teal); padding-left: 1.2rem; cursor: default; }
.sig-td-status, .sig-td-date { white-space: nowrap; }
.status-badge { white-space: nowrap; }
.sig-date { display: inline-flex; flex-direction: column; line-height: 1.25; white-space: nowrap; }
.sig-date b { font-weight: 600; color: var(--heading); font-size: 0.8rem; }
.sig-date small { color: var(--muted); font-size: 0.7rem; }
.sig-sent-summary { margin: 0 0 0.5rem; color: #065f46; }
.sig-toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translate(-50%, 16px); opacity: 0; background: var(--navy); color: #fff; font-size: 0.875rem; font-weight: 500; padding: 0.7rem 1.1rem; border-radius: 0.75rem; box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.5); z-index: 300; pointer-events: none; max-width: calc(100vw - 2rem); transition: opacity 0.2s ease-out, transform 0.2s ease-out; }
.sig-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.sig-toast.is-err { background: #b91c1c; }
@media (prefers-reduced-motion: reduce) { .sig-toast { transition: none; } }
