/* ============================================
   Maestro Dashboard -- Closet Maestro
   Enterprise-grade. Cabinet-maker simple.
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=IBM+Plex+Sans:wght@300;400;500;600;700&family=Outfit:wght@300;400;500;600;700&family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;0,6..72,600;1,6..72,400&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* Font roles -- overridable per-theme via /settings/theme. Default = Plus Jakarta Sans. */
:root {
    --font-display: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', 'Menlo', monospace;
}
[data-font="friendly"]     { --font-display: 'Plus Jakarta Sans', sans-serif; --font-body: 'Plus Jakarta Sans', sans-serif; }
[data-font="classic"]      { --font-display: 'Inter', sans-serif; --font-body: 'Inter', sans-serif; }
[data-font="modern"]       { --font-display: 'IBM Plex Sans', sans-serif; --font-body: 'IBM Plex Sans', sans-serif; }
[data-font="geometric"]    { --font-display: 'Outfit', sans-serif; --font-body: 'Outfit', sans-serif; }
[data-font="clean"]        { --font-display: 'DM Sans', sans-serif; --font-body: 'DM Sans', sans-serif; }
[data-font="technical"]    { --font-display: 'Space Grotesk', sans-serif; --font-body: 'Space Grotesk', sans-serif; }
[data-font="refined"]      { --font-display: 'Manrope', sans-serif; --font-body: 'Manrope', sans-serif; }
[data-font="editorial"]    { --font-display: 'Newsreader', Georgia, serif; --font-body: 'Inter', sans-serif; }
[data-font="modern-serif"] { --font-display: 'Fraunces', Georgia, serif; --font-body: 'Inter', sans-serif; }
[data-font="crafted"]      { --font-display: 'Newsreader', Georgia, serif; --font-body: 'Inter', sans-serif; } /* legacy alias */

:root {
    /* Brand */
    --brand-wine: #7B2D42;
    --brand-wine-light: #9B4D62;
    --brand-wine-subtle: #F5ECF0;
    --brand-gold: #C9A84C;
    --brand-gold-light: #E8D9A0;
    --brand-gold-subtle: #FBF6E8;

    /* Surfaces */
    --bg-page: #F8F7F5;
    --bg-card: #FFFFFF;
    --bg-card-elevated: #FFFFFF;
    --bg-sidebar: #FFFFFF;
    --bg-sidebar-hover: #F8F7F5;
    --bg-sidebar-active: var(--brand-wine-subtle);
    --bg-input: #FFFFFF;
    --bg-hover: #F8F7F5;

    /* Text */
    --text-primary: #1A1A1A;
    --text-secondary: #6B7280;
    --text-tertiary: #9CA3AF;
    --text-inverse: #FFFFFF;
    --text-on-brand: #FFFFFF;

    /* Borders */
    --border-light: #F0EEEB;
    --border-medium: #E5E2DD;
    --border-strong: #D1CDC6;
    --focus-ring: rgba(123, 45, 66, 0.25);

    /* Status */
    --status-good: #059669;
    --status-good-bg: #ECFDF5;
    --status-warning: #D97706;
    --status-warning-bg: #FFFBEB;
    --status-danger: #DC2626;
    --status-danger-bg: #FEF2F2;
    --status-info: #2563EB;
    --status-info-bg: #EFF6FF;
    --status-neutral: #6B7280;
    --status-neutral-bg: #F3F4F6;

    /* Layout */
    --sidebar-width: 260px;
    --header-height: 64px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);

    /* Spacing scale */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;

    /* Transitions */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: 120ms var(--ease);
    --transition-base: 200ms var(--ease);
}

/* ============================================
   Dark mode token overrides
   Activated by [data-theme="dark"] on <html>
   ============================================ */
[data-theme="dark"] {
    /* Brand -- lifted for legibility on dark surfaces */
    --brand-wine: #D17794;
    --brand-wine-light: #E29BAF;
    --brand-wine-subtle: rgba(209, 119, 148, 0.12);
    --brand-gold: #E8C66F;
    --brand-gold-light: #F1DA98;
    --brand-gold-subtle: rgba(232, 198, 111, 0.12);

    /* Surfaces -- deep gray-blue, not pure black */
    --bg-page: #0F1115;
    --bg-card: #181B22;
    --bg-card-elevated: #1F232C;
    --bg-sidebar: #14171D;
    --bg-sidebar-hover: #1F232C;
    --bg-sidebar-active: rgba(209, 119, 148, 0.10);
    --bg-input: #14171D;
    --bg-hover: #1F232C;

    /* Text */
    --text-primary: #F3F4F6;
    --text-secondary: #B0B5BF;
    --text-tertiary: #7B8090;
    --text-inverse: #1A1A1A;
    --text-on-brand: #1A1A1A;

    /* Borders */
    --border-light: rgba(255, 255, 255, 0.06);
    --border-medium: rgba(255, 255, 255, 0.10);
    --border-strong: rgba(255, 255, 255, 0.16);
    --focus-ring: rgba(209, 119, 148, 0.35);

    /* Status -- translucent backgrounds, brightened foregrounds */
    --status-good: #34D399;
    --status-good-bg: rgba(52, 211, 153, 0.12);
    --status-warning: #FBBF24;
    --status-warning-bg: rgba(251, 191, 36, 0.12);
    --status-danger: #F87171;
    --status-danger-bg: rgba(248, 113, 113, 0.12);
    --status-info: #60A5FA;
    --status-info-bg: rgba(96, 165, 250, 0.12);
    --status-neutral: #9CA3AF;
    --status-neutral-bg: rgba(255, 255, 255, 0.06);

    /* Shadows -- darker, more diffused on dark bg */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.30);
    --shadow-md: 0 2px 10px rgba(0, 0, 0, 0.35), 0 1px 3px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.30);
}

/* Honor OS preference when no explicit choice has been saved */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        color-scheme: dark;
    }
}

html {
    color-scheme: light;
    transition: background-color var(--transition-base);
}
html[data-theme="dark"] {
    color-scheme: dark;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-body, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
    background: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ---- Layout Shell ---- */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-brand svg,
.sidebar-brand-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
}

.sidebar-brand-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.sidebar-brand-label {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.sidebar-nav {
    padding: 1rem 0.75rem;
    flex: 1;
}

.sidebar-section {
    margin-bottom: 1.5rem;
}

.sidebar-section-flush {
    margin-bottom: 0.75rem;
}

.sidebar-section-title {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0 0.5rem;
    margin-bottom: 0.5rem;
}

.sidebar-collapse {
    margin-bottom: 1.5rem;
}

.sidebar-collapse > .sidebar-link {
    display: none;
}

.sidebar-collapse[open] > .sidebar-link {
    display: flex;
}

.sidebar-collapse-summary {
    cursor: pointer;
    list-style: none;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.sidebar-collapse-summary::-webkit-details-marker {
    display: none;
}

.sidebar-collapse-summary::after {
    content: "";
    width: 0;
    height: 0;
    border-left: 4px solid currentColor;
    border-top: 3px solid transparent;
    border-bottom: 3px solid transparent;
    margin-left: auto;
    opacity: 0.5;
    transition: transform 0.15s var(--ease);
}

.sidebar-collapse[open] > .sidebar-collapse-summary::after {
    transform: rotate(90deg);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.65rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.15s var(--ease);
    cursor: pointer;
}

.sidebar-link:hover {
    background: var(--bg-sidebar-hover);
    color: var(--text-primary);
}

.sidebar-link.active {
    background: var(--bg-sidebar-active);
    color: var(--brand-wine);
    font-weight: 600;
}

.sidebar-link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.6;
}

.sidebar-link.active svg {
    opacity: 1;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-light);
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* ---- Main Content ---- */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
}

.page-header {
    padding: 2rem 2.5rem 0;
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.page-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.35rem;
    font-weight: 400;
}

.page-body {
    padding: 0 2.5rem 3rem;
}

/* ---- Widget Grid ---- */
.widget-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.25rem;
}

.widget-grid-2 {
    grid-template-columns: repeat(auto-fill, minmax(480px, 1fr));
}

/* ---- Cards ---- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s var(--ease);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

/* Legacy widget-card compatibility */
.widget-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s var(--ease);
}

.widget-card:hover {
    box-shadow: var(--shadow-md);
}

/* Stacked widget-cards inside a page-body get vertical breathing room. */
.page-body > .widget-card + .widget-card {
    margin-top: 1.75rem;
}

/* Sum / total row at the bottom of a data-table. */
.data-table tfoot td {
    border-top: 2px solid var(--border-light);
    background: var(--bg-subtle, rgba(0,0,0,0.02));
    font-weight: 600;
    padding-top: 0.65rem;
}
.data-table tfoot td.label {
    text-align: right;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ---- Widget Styles (legacy compat) ---- */
.widget-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    margin-bottom: 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
}

.widget-title-action {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: none;
    letter-spacing: 0;
}

.widget-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
    letter-spacing: -0.02em;
}

.widget-value.good { color: var(--status-good); }
.widget-value.warning { color: var(--status-warning); }
.widget-value.danger { color: var(--status-danger); }

.widget-detail {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.widget-detail .row {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border-light);
}

.widget-detail .row:last-child {
    border-bottom: none;
}

.widget-detail .row .label {
    color: var(--text-secondary);
}

.widget-detail .row .value {
    font-weight: 600;
    color: var(--text-primary);
}

.widget-timestamp {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    text-align: right;
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-light);
}

.widget-stale-warning {
    font-size: 0.7rem;
    color: var(--warning, #e6a817);
    text-align: right;
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-light);
    font-weight: 600;
}

/* ---- Filter / Period Bar (shared) ---- */
.filter-bar,
.period-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.85rem;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.filter-bar-label,
.period-bar-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-right: 0.25rem;
}

.filter-btn,
.period-btn {
    padding: 0.35rem 0.85rem;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.15s var(--ease);
    cursor: pointer;
}

.filter-btn:hover,
.period-btn:hover {
    border-color: var(--brand-wine);
    color: var(--brand-wine);
}

.filter-btn.active,
.period-btn.active {
    background: var(--brand-wine);
    border-color: var(--brand-wine);
    color: var(--text-inverse);
    font-weight: 600;
}

/* ---- Two-column page grids ---- */
.util-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.util-grid .full-width {
    grid-column: 1 / -1;
}

@media (max-width: 900px) {
    .util-grid {
        grid-template-columns: 1fr;
    }
}

/* ---- Stats list (label/value rows inside a card) ---- */
.stats-list {
    display: grid;
    grid-template-columns: 1fr;
}

.stats-list-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--border-light);
    gap: 1rem;
}

.stats-list-row:last-child {
    border-bottom: 0;
}

.stats-list-label {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.stats-list-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.stats-list-value.good { color: var(--status-good); }
.stats-list-value.warning { color: var(--status-warning); }
.stats-list-value.danger { color: var(--status-danger); }

/* ---- Subnote / Empty / Log ---- */
.widget-subnote {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0 0 1rem 0;
    line-height: 1.5;
}

.empty-state {
    color: var(--text-tertiary);
    font-size: 0.875rem;
    padding: 1.5rem 0;
    text-align: center;
}

.log-pane {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.78rem;
    line-height: 1.7;
    color: var(--text-secondary);
    background: #FAFAF8;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    max-height: 320px;
    overflow: auto;
    white-space: pre-wrap;
    margin: 0;
}

/* ---- Data Tables ---- */
.data-table-scroll {
    max-height: 480px;
    overflow: auto;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--bg-card);
}

.data-table-scroll .data-table {
    border: 0;
    border-radius: 0;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
    color: var(--text-primary);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.data-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #FAFAF8;
    color: var(--text-tertiary);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.7rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-medium);
    white-space: nowrap;
}

.data-table tbody td {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
    white-space: nowrap;
}

.data-table tbody td.wrap {
    white-space: normal;
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.data-table tbody tr:nth-child(even) td {
    background: #FCFBFA;
}

.data-table tbody tr:hover td {
    background: var(--brand-wine-subtle);
}

.data-table .num,
.data-table th.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

.data-table .mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.data-table .strong {
    font-weight: 600;
}

.data-table .neg {
    color: var(--status-danger);
}

.data-table .pos {
    color: var(--status-good);
}

.data-table .muted {
    color: var(--text-tertiary);
    font-size: 0.8rem;
}

.job-link {
    display: inline-flex;
    align-items: baseline;
    gap: 0.4rem;
    text-decoration: none;
    color: inherit;
}

.job-link:hover .job-name {
    color: var(--brand-wine);
    text-decoration: underline;
}

.job-num {
    display: inline-block;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-tertiary);
    background: var(--bg-page);
    border: 1px solid var(--border-light);
    padding: 0.1rem 0.4rem;
    border-radius: var(--radius-sm);
}

.job-name {
    font-weight: 500;
    color: var(--text-primary);
}

/* ---- Badges ---- */
.badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 100px;
    letter-spacing: 0.02em;
}

.badge.good {
    background: var(--status-good-bg);
    color: var(--status-good);
}

.badge.warning {
    background: var(--status-warning-bg);
    color: var(--status-warning);
}

.badge.danger {
    background: var(--status-danger-bg);
    color: var(--status-danger);
}

.badge.info {
    background: var(--status-info-bg);
    color: var(--status-info);
}

.badge.neutral {
    background: var(--status-neutral-bg);
    color: var(--status-neutral);
}

.error-msg {
    color: var(--status-danger);
    font-size: 0.85rem;
    padding: 0.75rem;
    background: var(--status-danger-bg);
    border-radius: var(--radius-sm);
}

/* ---- Attention Block ---- */
.attention-block {
    margin-bottom: 1.75rem;
}

.attention-header {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.6rem;
}

.attention-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
}

.attention-item {
    display: block;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    background: var(--bg-card);
    border-left-width: 4px;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s var(--ease), transform 0.15s var(--ease);
}

.attention-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.attention-item.attention-danger {
    border-left-color: var(--status-danger);
}

.attention-item.attention-warning {
    border-left-color: var(--status-warning);
}

.attention-item-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
}

.attention-item-detail {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ---- Section Heading ---- */
.section-heading {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 2rem 0 1rem;
}

/* ---- Stat Cards ---- */
.stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-row-hero {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 0;
}

.stat-row-hero .stat-card {
    padding: 1.5rem 1.5rem 1.35rem;
}

.stat-row-hero .stat-value {
    font-size: 2.25rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.stat-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.35rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.stat-value.good, .stat-good { color: var(--status-good); }
.stat-value.warning, .stat-warning { color: var(--status-warning); }
.stat-value.danger, .stat-danger { color: var(--status-danger); }

.stat-note {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 0.25rem;
}

/* ---- Profile Cards ---- */
.profile-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.profile-card-primary {
    border-color: var(--brand-wine);
    border-width: 2px;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--brand-wine-subtle) 100%);
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-page);
    border: 2px solid var(--border-light);
}

.profile-card-primary .profile-avatar {
    border-color: var(--brand-wine);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}

.profile-info {
    flex: 1;
    min-width: 0;
}

.profile-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.profile-title {
    font-size: 0.8rem;
    color: var(--brand-wine);
    font-weight: 600;
    margin-top: 0.1rem;
}

.profile-bio {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-top: 0.5rem;
}

.profile-stats {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-light);
}

.profile-stat {
    display: flex;
    flex-direction: column;
}

.profile-stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.profile-stat-label {
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ---- Org Tree ---- */
.org-tree {
    position: relative;
    padding-left: 2.5rem;
    margin-bottom: 2rem;
}

.org-tree-trunk {
    position: absolute;
    left: 2.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-medium);
}

.org-tree-branches {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.org-tree-node {
    position: relative;
    padding-left: 1.5rem;
}

.org-tree-connector {
    position: absolute;
    left: 0;
    top: 50%;
    width: 1.5rem;
    height: 2px;
    background: var(--border-medium);
}

.org-tree-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.15s var(--ease);
}

.org-tree-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--brand-gold-light);
}

.org-tree-node.future .org-tree-card {
    border-style: dashed;
    opacity: 0.55;
}

.org-tree-node.future .org-tree-connector {
    background: repeating-linear-gradient(
        90deg,
        var(--border-medium) 0px,
        var(--border-medium) 4px,
        transparent 4px,
        transparent 8px
    );
}

.org-tree-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.org-tree-detail {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.1rem;
}

/* ---- Skill Cards ---- */
.skill-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.skill-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s var(--ease);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.skill-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--brand-gold-light);
}

.skill-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.skill-name code {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--brand-wine);
    background: var(--brand-wine-subtle);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

.skill-description {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.skill-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: auto;
}

.skill-date {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    font-style: italic;
    margin-top: 0.25rem;
}

/* ---- Filter Bar ---- */
.filter-bar {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.filter-btn {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--border-medium);
    border-radius: 100px;
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s var(--ease);
}

.filter-btn:hover {
    border-color: var(--brand-gold);
    color: var(--text-primary);
}

.filter-btn.active {
    background: var(--brand-wine);
    border-color: var(--brand-wine);
    color: var(--text-inverse);
}

/* ---- Project Cards ---- */
.project-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.project-row {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    transition: box-shadow 0.2s var(--ease);
}

.project-row:hover {
    box-shadow: var(--shadow-md);
}

.project-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.project-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.project-detail {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.project-status {
    flex-shrink: 0;
}

/* ---- Section Headers ---- */
.section-header {
    margin-bottom: 1.25rem;
    margin-top: 2rem;
}

.section-header:first-child {
    margin-top: 0;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.section-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}

/* ---- Empty States ---- */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-tertiary);
}

.empty-state-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    opacity: 0.4;
}

.empty-state-text {
    font-size: 0.9rem;
}

/* ---- Progress Bar ---- */
.progress-bar {
    background: var(--border-light);
    border-radius: 100px;
    height: 8px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 100px;
    transition: width 0.5s var(--ease);
}

.progress-fill.good { background: var(--status-good); }
.progress-fill.warning { background: var(--status-warning); }
.progress-fill.danger { background: var(--status-danger); }

/* ---- Integration Cards (Expandable) ---- */
.integration-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1rem;
}

.integration-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all 0.25s var(--ease);
    overflow: hidden;
}

.integration-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--brand-gold-light);
}

.integration-card.expanded {
    border-color: var(--brand-gold);
    box-shadow: var(--shadow-lg);
}

.integration-summary {
    padding: 1.25rem;
    position: relative;
}

.integration-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}

.integration-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.integration-badges {
    display: flex;
    gap: 0.35rem;
    flex-shrink: 0;
}

.integration-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.integration-checked {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    margin-top: 0.4rem;
    font-style: italic;
}

/* ---- Modal ---- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 200;
    pointer-events: none;
    transition: background 0.3s var(--ease);
}

.modal-backdrop.active {
    background: rgba(0, 0, 0, 0.2);
    pointer-events: all;
}

.modal-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 4px 16px rgba(0, 0, 0, 0.08);
    z-index: 201;
    width: 90%;
    max-width: 560px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 2rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}

.modal-panel.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: all;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 0.35rem;
    border-radius: var(--radius-sm);
    transition: all 0.15s var(--ease);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--bg-page);
    color: var(--text-primary);
}

.modal-header {
    margin-bottom: 1.5rem;
    padding-right: 2rem;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.modal-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.detail-section {
    margin-bottom: 1rem;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.35rem;
}

.detail-value {
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.5;
}

.detail-explain {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
    line-height: 1.5;
}

.detail-code {
    font-size: 0.75rem;
    font-family: 'SF Mono', 'Fira Code', monospace;
    background: var(--bg-page);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    color: var(--brand-wine);
}

.detail-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.detail-list li {
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding: 0.25rem 0;
    padding-left: 1rem;
    position: relative;
    line-height: 1.5;
}

.detail-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.65rem;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--brand-gold);
}

/* Data Flow */
.data-flow-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.data-flow-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.flow-arrow {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 100px;
    flex-shrink: 0;
    min-width: 65px;
    justify-content: center;
}

.flow-read {
    background: var(--status-info-bg);
    color: var(--status-info);
}

.flow-write {
    background: var(--status-good-bg);
    color: var(--status-good);
}

.flow-none {
    background: var(--status-neutral-bg);
    color: var(--status-neutral);
}

.flow-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
    padding-top: 0.05rem;
}

/* ---- Kanban Board ---- */
.kanban-board {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    min-height: 400px;
}

.kanban-column {
    flex: 1;
    min-width: 220px;
    max-width: 280px;
    display: flex;
    flex-direction: column;
}

.kanban-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    margin-bottom: 0;
}

.kanban-header-blocked { background: var(--status-danger-bg); }
.kanban-header-progress { background: #ECFDF5; }
.kanban-header-next { background: var(--status-info-bg); }
.kanban-header-backlog { background: var(--status-neutral-bg); }
.kanban-header-shipped { background: #F0FDF4; }

.kanban-column-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-primary);
}

.kanban-column-count {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary);
    background: var(--bg-card);
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.kanban-column-body {
    background: var(--bg-page);
    border: 1px solid var(--border-light);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    padding: 0.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.kanban-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-left: 3px solid var(--border-medium);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.75rem;
    cursor: pointer;
    transition: all 0.15s var(--ease);
}

.kanban-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.kanban-card-blocked { border-left-color: var(--status-danger); }
.kanban-card-progress { border-left-color: var(--status-good); }
.kanban-card-next { border-left-color: var(--status-info); }
.kanban-card-backlog { border-left-color: var(--border-medium); }
.kanban-card-shipped { border-left-color: var(--status-good); }

.kanban-card-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}

.kanban-card-desc {
    font-size: 0.7rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.kanban-card-blocker {
    font-size: 0.65rem;
    color: var(--status-danger);
    margin-top: 0.35rem;
    padding: 0.25rem 0.4rem;
    background: var(--status-danger-bg);
    border-radius: 3px;
    line-height: 1.4;
}

.kanban-card-date {
    font-size: 0.65rem;
    color: var(--text-tertiary);
    margin-top: 0.3rem;
    font-style: italic;
}

.kanban-empty {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-align: center;
    padding: 1.5rem 0.5rem;
    font-style: italic;
}

@media (max-width: 1024px) {
    .kanban-board {
        flex-wrap: nowrap;
    }
    .kanban-column {
        min-width: 200px;
    }
}

@media (max-width: 768px) {
    .kanban-board {
        flex-direction: column;
    }
    .kanban-column {
        max-width: 100%;
    }
}

/* ---- Pipeline Cards (legacy, kept for blocker style) ---- */
.pipeline-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pipeline-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-left: 3px solid var(--status-good);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s var(--ease);
}

.pipeline-card:hover {
    box-shadow: var(--shadow-md);
}

.pipeline-blocked {
    border-left-color: var(--status-danger);
    background: linear-gradient(90deg, var(--status-danger-bg) 0%, var(--bg-card) 30%);
}

.pipeline-queued {
    border-left-color: var(--status-info);
}

.pipeline-backlog {
    border-left-color: var(--border-medium);
    opacity: 0.8;
}

.pipeline-shipped {
    border-left-color: var(--status-good);
}

.pipeline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}

.pipeline-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.pipeline-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.pipeline-blocker {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    margin-top: 0.6rem;
    padding: 0.5rem 0.65rem;
    background: var(--status-danger-bg);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--status-danger);
    line-height: 1.5;
}

.pipeline-blocker svg {
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.pipeline-footer {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.6rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-light);
}

.pipeline-impact {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    line-height: 1.5;
    flex: 1;
}

.pipeline-date {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    font-style: italic;
    white-space: nowrap;
}

/* ---- Guide / How-To ---- */
.guide-section {
    padding: 0.5rem;
}

.guide-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.guide-subtitle {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 1.25rem;
    margin-bottom: 0.35rem;
}

.guide-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.guide-steps {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.guide-step {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.guide-step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--brand-wine);
    color: var(--text-inverse);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.guide-step-content {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.guide-step-content strong {
    color: var(--text-primary);
}

.guide-quote {
    border-left: 3px solid var(--brand-gold);
    padding: 1rem 1.25rem;
    margin: 1.25rem 0 0;
    background: var(--brand-gold-subtle);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.guide-quote-text {
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.6;
    font-style: italic;
}

.guide-quote-attr {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.35rem;
    font-style: normal;
}

/* ---- Forms ---- */
.form-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.form-row-group {
    display: flex;
    gap: 0.75rem;
}

.form-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-input {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    transition: border-color 0.15s var(--ease);
}

.form-input:focus {
    outline: none;
    border-color: var(--brand-wine);
    box-shadow: 0 0 0 3px var(--brand-wine-subtle);
}

.form-input::placeholder {
    color: var(--text-tertiary);
}

/* ---- Buttons ---- */
.btn-primary {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    background: var(--brand-wine);
    color: var(--text-inverse);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s var(--ease);
}

.btn-primary:hover {
    background: var(--brand-wine-light);
}

.btn-secondary {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s var(--ease);
}

.btn-secondary:hover {
    border-color: var(--text-tertiary);
    color: var(--text-primary);
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .sidebar {
        width: 220px;
    }
    .main-content {
        margin-left: 220px;
    }
    :root {
        --sidebar-width: 220px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    .main-content {
        margin-left: 0;
    }
    .page-header {
        padding: 1.5rem 1.25rem 0;
    }
    .page-body {
        padding: 0 1.25rem 2rem;
    }
    .widget-grid {
        grid-template-columns: 1fr;
    }
    .stat-row {
        grid-template-columns: repeat(2, 1fr);
    }
    .org-branches {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ---- Server Page ---- */

.server-policy {
    background: var(--status-info-bg);
    border: 1px solid #BFDBFE;
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    color: var(--status-info);
    margin-bottom: 1.5rem;
}

.cron-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cron-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    transition: border-color 0.15s var(--ease);
}

.cron-card:hover {
    border-color: var(--border-medium);
}

.cron-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.4rem;
}

.cron-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
}

.cron-schedule code {
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: var(--status-neutral-bg);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
}

.cron-description {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.cron-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cron-script {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.cron-includes {
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--border-light);
}

.cron-includes-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.cron-includes-list {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Timeline */

.timeline {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.timeline-row {
    display: flex;
    border-bottom: 1px solid var(--border-light);
    min-height: 2.5rem;
}

.timeline-row:last-child {
    border-bottom: none;
}

.timeline-hour {
    width: 5rem;
    flex-shrink: 0;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: #FAFAF8;
    display: flex;
    align-items: flex-start;
    padding-top: 0.65rem;
}

.timeline-events {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.5rem 0.75rem;
    align-items: center;
}

.timeline-event {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
}

.timeline-event-message {
    background: var(--status-info-bg);
    color: var(--status-info);
    border: 1px solid #BFDBFE;
}

.timeline-event-silent {
    background: var(--status-neutral-bg);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}

.timeline-event-name {
    font-weight: 500;
}

.timeline-event-note {
    font-size: 0.7rem;
    color: var(--text-tertiary);
}

.timeline-empty {
    height: 0.5rem;
}

/* ============================================
   Finance Page
   ============================================ */

.finance-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.view-toggle-wrap {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
}

.view-toggle-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.view-toggle {
    display: flex;
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    overflow: hidden;
    flex-shrink: 0;
}

.toggle-btn {
    padding: 0.5rem 1.25rem;
    font-size: 0.8rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s var(--ease);
}

.toggle-btn:hover {
    background: var(--bg-sidebar-hover);
}

.toggle-btn.active {
    background: var(--brand-wine);
    color: var(--text-inverse);
}

.finance-section {
    margin-bottom: 2rem;
}

.finance-section-header {
    margin-bottom: 0.5rem;
}

.finance-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.finance-explainer {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0 0 1rem 0;
    max-width: 720px;
}

.finance-insight {
    background: var(--brand-wine-subtle);
    border-left: 3px solid var(--brand-wine);
    padding: 0.75rem 1rem;
    font-size: 0.82rem;
    color: var(--text-primary);
    line-height: 1.5;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin-top: 1rem;
}

.finance-summary {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    margin-top: 0.75rem;
    text-align: right;
}

.finance-detail-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.finance-detail-grid.two-col {
    grid-template-columns: 1fr 1fr;
}

/* ---- Finance Tables ---- */

.finance-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.finance-table th {
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 0.5rem 0.75rem;
    border-bottom: 2px solid var(--border-medium);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.finance-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
}

.finance-table th.num,
.finance-table td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.finance-table .table-row-bold td,
.table-row-bold {
    font-weight: 600;
}

.finance-table.compact td,
.finance-table.compact th {
    padding: 0.4rem 0.75rem;
}

.finance-table tr:last-child td {
    border-bottom: none;
}

/* ---- Revenue Chart (Owner View) ---- */

.revenue-chart {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    height: 200px;
    padding: 1rem 0;
}

.revenue-bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.revenue-bar-value {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.25rem;
    font-variant-numeric: tabular-nums;
}

.revenue-bar-wrapper {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.revenue-bar {
    width: 70%;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    transition: height 0.5s var(--ease);
    min-height: 4px;
}

.revenue-bar.above-target {
    background: var(--brand-wine);
}

.revenue-bar.below-target {
    background: var(--brand-wine-light);
    opacity: 0.5;
}

.revenue-bar-label {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    margin-top: 0.35rem;
    font-weight: 500;
}

.chart-legend {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 0.5rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    display: inline-block;
}

.legend-dot.above-target {
    background: var(--brand-wine);
}

.legend-dot.below-target {
    background: var(--brand-wine-light);
    opacity: 0.5;
}

/* ---- Expense Bars (Owner View) ---- */

.expense-bar-list {
    padding: 0.5rem 0;
}

.expense-bar-row {
    display: grid;
    grid-template-columns: 200px 1fr 80px;
    align-items: center;
    gap: 0.75rem;
    padding: 0.35rem 0;
}

.expense-bar-label {
    font-size: 0.78rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.expense-bar-track {
    height: 18px;
    background: var(--border-light);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.expense-bar-fill {
    height: 100%;
    background: var(--brand-wine-light);
    border-radius: var(--radius-sm);
    transition: width 0.5s var(--ease);
}

.expense-bar-value {
    font-size: 0.78rem;
    color: var(--text-secondary);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* ---- Responsive ---- */

@media (max-width: 900px) {
    .finance-header-row {
        flex-direction: column;
    }
    .finance-detail-grid.two-col {
        grid-template-columns: 1fr;
    }
    .expense-bar-row {
        grid-template-columns: 140px 1fr 70px;
    }
    .finance-table {
        font-size: 0.75rem;
    }
}


/* ============================================
   Transcript Review Page
   ============================================ */

.transcript-table-wrap {
    overflow-x: auto;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
}

.transcript-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.transcript-table thead th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-medium);
    white-space: nowrap;
}

.transcript-table tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: top;
}

.transcript-row:last-child td {
    border-bottom: none;
}

.col-source { width: 70px; }
.col-date { width: 90px; }
.col-contributor { width: 90px; }
.col-duration { width: 80px; }
.col-quality { width: 110px; }
.col-size { width: 50px; }
.col-status { width: 90px; }
.transcript-duration { font-variant-numeric: tabular-nums; }
.col-actions { width: 260px; }
.col-job { width: 180px; }
.col-synced-date { width: 90px; }
.col-actions-sm { width: 80px; }

.transcript-date {
    font-variant-numeric: tabular-nums;
    color: var(--text-secondary);
}

.transcript-preview {
    color: var(--text-primary);
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.transcript-filename {
    color: var(--text-secondary);
    font-size: 0.8rem;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.transcript-size {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.transcript-actions {
    white-space: nowrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    transition: background-color 0.15s, opacity 0.15s;
}

.btn-sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.78rem;
}

.btn-view {
    background: var(--status-info-bg);
    color: var(--status-info);
    border: 1px solid var(--status-info);
}
.btn-view:hover {
    background: var(--status-info);
    color: var(--text-inverse);
}

.btn-classify {
    background: var(--brand-wine);
    color: var(--text-inverse);
}
.btn-classify:hover {
    background: var(--brand-wine-light);
}

.btn-approve {
    background: var(--status-good);
    color: var(--text-inverse);
}
.btn-approve:hover {
    opacity: 0.85;
}

.btn-skip {
    background: var(--status-neutral-bg);
    color: var(--text-secondary);
}
.btn-skip:hover {
    background: var(--border-medium);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-medium);
    color: var(--text-primary);
}
.btn-outline:hover {
    background: var(--bg-sidebar-hover);
}

/* Classification results */
.classify-result {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.classify-summary {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 0.25rem;
}

.classify-note {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.suggest-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.suggest-name {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-primary);
}

.suggest-reassign {
    margin-top: 0.25rem;
    padding-top: 0.4rem;
    border-top: 1px solid var(--border-light);
}

.reassign-select {
    font-size: 0.78rem;
    padding: 0.3rem 0.5rem;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    max-width: 200px;
    font-family: 'Inter', sans-serif;
}

.suggest-actions {
    margin-top: 0.25rem;
    padding-top: 0.4rem;
    border-top: 1px solid var(--border-light);
}

/* Synced/skipped confirmation rows */
.synced-confirmation {
    color: var(--status-good);
    font-weight: 500;
    text-align: center;
    padding: 0.75rem 1rem;
}

.skipped-confirmation {
    color: var(--text-tertiary);
    font-style: italic;
    text-align: center;
    padding: 0.75rem 1rem;
}

.synced-row, .skipped-row {
    opacity: 0.6;
}

.unskip-confirmation {
    color: var(--status-info);
    font-size: 0.82rem;
    text-align: center;
    padding: 0.75rem 1rem;
}

.unskip-confirmation a {
    color: var(--brand-wine);
    font-weight: 500;
}

.transcript-table-synced .transcript-row-synced td {
    color: var(--text-secondary);
}

/* HTMX loading indicator */
.htmx-indicator {
    display: none;
    font-size: 0.78rem;
    color: var(--text-tertiary);
    font-style: italic;
}
.htmx-request .htmx-indicator {
    display: inline;
}
.htmx-request .btn-classify {
    display: none;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
}

.empty-state-icon {
    color: var(--status-good);
    margin-bottom: 1rem;
}

.empty-state-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.empty-state-sub {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.transcript-error {
    color: var(--status-danger);
    font-size: 0.8rem;
    padding: 0.25rem 0;
}

.text-muted {
    color: var(--text-tertiary);
}

.stat-warning {
    color: var(--status-warning);
}

/* Log preview modal */
.log-modal {
    width: min(800px, 90vw);
    max-height: 85vh;
    overflow-y: auto;
}

.log-preview-header {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-light);
}

.log-preview-loading {
    color: var(--text-secondary);
    font-style: italic;
    padding: 2rem 0;
    text-align: center;
}

.log-preview-editor {
    width: 100%;
    min-height: 300px;
    padding: 0.75rem;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-page);
    resize: vertical;
}

.log-preview-editor:focus {
    outline: none;
    border-color: var(--brand-wine);
    box-shadow: 0 0 0 2px var(--brand-wine-subtle);
}

.log-preview-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-light);
}

.job-name {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-primary);
}

.transcript-contributor {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* Expandable transcript content */
.transcript-expand-row td {
    padding: 0 !important;
    border-bottom: 1px solid var(--border-light);
}

.transcript-content-wrap {
    background: var(--bg-page);
    border-top: 1px solid var(--border-light);
}

.transcript-content-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-card);
}

.transcript-content-label {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    font-family: monospace;
}

.transcript-content {
    max-height: 400px;
    overflow-y: auto;
    padding: 1rem 1.25rem;
    font-size: 0.82rem;
    line-height: 1.7;
}

.tc-heading {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    color: var(--text-primary);
}

.tc-subheading {
    font-size: 0.88rem;
    font-weight: 600;
    margin: 0.75rem 0 0.25rem;
    color: var(--text-primary);
}

.tc-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0.15rem 0;
}

.tc-speaker {
    margin: 0.5rem 0 0.15rem;
    color: var(--text-primary);
}

.tc-speaker strong {
    color: var(--brand-wine);
}

.tc-line {
    margin: 0.15rem 0;
    color: var(--text-primary);
}

.tc-divider {
    border: none;
    border-top: 1px solid var(--border-light);
    margin: 0.75rem 0;
}

.tc-quote {
    margin: 0.25rem 0;
    padding-left: 0.75rem;
    border-left: 3px solid var(--brand-wine-subtle);
    color: var(--text-secondary);
    font-style: italic;
}

/* =============================================
   Infrastructure Diagram
   ============================================= */

.infra-diagram {
    margin-bottom: 1.5rem;
    max-width: 700px;
}

/* Cloud layer */
.infra-layer-cloud {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0.75rem;
    background: rgba(178, 142, 90, 0.05);
    border: 2px dashed rgba(178, 142, 90, 0.4);
    border-radius: var(--radius-lg);
    margin-bottom: 0;
}

.infra-layer-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
}

/* Connection lines between cloud and locations */
.infra-connections {
    display: flex;
    justify-content: center;
    gap: 4rem;
    padding: 0.15rem 0;
}

.infra-conn {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.infra-conn-line {
    width: 2px;
    height: 28px;
    background: var(--brand-gold);
}

.infra-conn-label {
    font-size: 0.65rem;
    color: var(--brand-gold);
    white-space: nowrap;
    font-weight: 500;
}

/* Physical locations row */
.infra-locations {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 0.75rem;
}

.infra-location {
    background: var(--bg-card);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: visible;
}

.infra-location-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    padding: 0.6rem 0.85rem 0.3rem;
    border-bottom: 1px solid var(--border-light);
    background: rgba(123, 45, 66, 0.05);
}

.infra-location-remote .infra-location-label {
    background: rgba(178, 142, 90, 0.05);
}

.infra-location-body {
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Zones within a location (server cabinet, desk) */
.infra-zone {
    border: 1px solid var(--brand-wine-subtle, rgba(123, 45, 66, 0.3));
    border-radius: var(--radius-md);
    overflow: visible;
    position: relative;
}

.infra-zone-label {
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--text-tertiary);
    padding: 0.3rem 0.6rem;
    background: var(--bg-main);
    border-bottom: 1px solid var(--border-light);
}

.infra-zone-devices {
    display: flex;
    gap: 0.75rem;
    padding: 0.6rem;
    flex-wrap: wrap;
}

/* Individual device */
.infra-device {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    position: relative;
    cursor: default;
    padding: 0.3rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}

.infra-device:hover {
    background: rgba(178, 142, 90, 0.08);
}

.infra-icon {
    color: var(--text-secondary);
}

.infra-icon-server {
    color: var(--brand-wine-light);
}

.infra-device-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
}

.infra-device-sub {
    font-size: 0.68rem;
    color: var(--text-tertiary);
    text-align: center;
}

/* Hover tooltip */
.infra-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    width: 280px;
    background: var(--bg-card);
    border: 1px solid var(--brand-gold);
    border-radius: var(--radius-lg);
    padding: 0.85rem 1rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 200;
    cursor: default;
    font-family: 'Inter', sans-serif;
}

.infra-device:hover .infra-tooltip {
    display: block;
}

.infra-tooltip-title {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}

.infra-tooltip-desc {
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0.4rem;
}

.infra-tooltip-section {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    color: var(--text-primary);
    padding: 0.1rem 0;
}

.infra-tooltip-heading {
    font-family: 'Inter', sans-serif;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--brand-gold);
    margin-top: 0.5rem;
    padding-top: 0.4rem;
    border-top: 1px solid var(--border-light);
    margin-bottom: 0.15rem;
}

.infra-tooltip-item {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    color: var(--text-primary);
    padding: 0.1rem 0;
}

/* How changes go live */
.infra-howto {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1rem 1.15rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.infra-howto-steps {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.infra-howto-step {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.82rem;
    color: var(--text-primary);
}

.infra-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 50%;
    background: var(--brand-wine);
    color: var(--text-inverse);
    font-size: 0.7rem;
    font-weight: 600;
    flex-shrink: 0;
}

/* =============================================
   Procurement Page
   ============================================= */

/* Two-column top layout */
.proc-top-layout {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.proc-top-main {
    flex: 1;
    min-width: 0;
}

.proc-top-sidebar {
    width: 280px;
    flex-shrink: 0;
}

/* Summary Stat Sections */
.proc-stat-section {
    margin-bottom: 1.25rem;
    padding: 0;
    background: transparent;
    border: 0;
}

.proc-stat-title {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.55rem;
}

.proc-stat-row {
    display: flex;
    gap: 0.75rem;
}

.proc-stat-row .stat-card {
    flex: 1;
    min-width: 0;
    padding: 1rem 1.1rem;
    text-align: left;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    background: var(--bg-card);
}

.proc-stat-row .stat-label {
    font-size: 0.68rem;
    margin-bottom: 0.35rem;
    text-align: left;
}

.proc-stat-row .stat-value {
    font-size: 1.85rem;
    text-align: left;
}

.proc-stat-row .stat-note {
    font-size: 0.72rem;
    text-align: left;
}

/* Recent Activity Panel */
.proc-activity-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1rem;
    height: 100%;
}

.proc-activity-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    padding-bottom: 0.35rem;
    border-bottom: 2px solid var(--border-light);
}

.proc-activity-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
}

.proc-activity-item {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
}

.proc-activity-icon {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 0.35rem;
    flex-shrink: 0;
}

.proc-icon-delivered {
    background: var(--status-good);
}

.proc-icon-transit {
    background: var(--status-info);
}

.proc-icon-status {
    background: var(--text-tertiary);
}

/* Status color coding for Recent Activity */
.proc-activity-item[data-status="Pulled"] .proc-icon-status,
.proc-activity-item[data-status="Received"] .proc-icon-status,
.proc-activity-item[data-status="Shipped"] .proc-icon-status,
.proc-activity-item[data-status="Loaded"] .proc-icon-status { background: var(--status-good); }

.proc-activity-item[data-status="Pulled"] .proc-status-tag,
.proc-activity-item[data-status="Received"] .proc-status-tag,
.proc-activity-item[data-status="Shipped"] .proc-status-tag,
.proc-activity-item[data-status="Loaded"] .proc-status-tag { color: var(--status-good); }

.proc-activity-item[data-status="Ordered"] .proc-icon-status,
.proc-activity-item[data-status="In Production"] .proc-icon-status,
.proc-activity-item[data-status="Needs Manufacturing"] .proc-icon-status,
.proc-activity-item[data-status="Allocated"] .proc-icon-status,
.proc-activity-item[data-status="In Bin"] .proc-icon-status { background: var(--status-warning); }

.proc-activity-item[data-status="Ordered"] .proc-status-tag,
.proc-activity-item[data-status="In Production"] .proc-status-tag,
.proc-activity-item[data-status="Needs Manufacturing"] .proc-status-tag,
.proc-activity-item[data-status="Allocated"] .proc-status-tag,
.proc-activity-item[data-status="In Bin"] .proc-status-tag { color: var(--status-warning); }

.proc-activity-item[data-status="Not Started"] .proc-icon-status,
.proc-activity-item[data-status="Needed"] .proc-icon-status,
.proc-activity-item[data-status="Need to Order"] .proc-icon-status { background: var(--status-danger); }

.proc-activity-item[data-status="Not Started"] .proc-status-tag,
.proc-activity-item[data-status="Needed"] .proc-status-tag,
.proc-activity-item[data-status="Need to Order"] .proc-status-tag { color: var(--status-danger); }

.proc-activity-text {
    font-size: 0.78rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.proc-activity-text a {
    color: var(--status-info);
    text-decoration: none;
    font-weight: 500;
}

.proc-activity-text a:hover {
    text-decoration: underline;
}

.proc-activity-meta {
    font-size: 0.68rem;
    color: var(--text-tertiary);
    margin-top: 0.1rem;
}

.proc-activity-empty {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    text-align: center;
    padding: 1rem 0;
}

.proc-select {
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
}

.proc-select:focus {
    outline: none;
    border-color: var(--brand-wine);
}

.proc-vendor-group {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.proc-vendor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.15s;
}

.proc-vendor-header:hover {
    background: var(--bg-sidebar-active);
}

.proc-vendor-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.proc-chevron {
    transition: transform 0.2s;
    color: var(--text-secondary);
}

.proc-vendor-body {
    border-top: 1px solid var(--border-light);
}

.proc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.proc-table thead th {
    text-align: left;
    padding: 0.5rem 0.75rem;
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    background: var(--bg-main);
    border-bottom: 1px solid var(--border-light);
}

.proc-table tbody td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.proc-table tbody tr:last-child td {
    border-bottom: none;
}

.proc-table tbody tr:hover {
    background: var(--bg-sidebar-active);
}

.proc-col-check {
    width: 2rem;
    text-align: center;
}

.proc-col-qty {
    width: 3rem;
    text-align: center;
}

.proc-col-category {
    width: 8rem;
}

.proc-col-project {
    width: 10rem;
}

.proc-col-status {
    width: 6rem;
}

.proc-col-actions {
    width: 8rem;
}

.proc-project-vendor .proc-table {
    margin-left: 1rem;
    width: calc(100% - 1rem);
}

.proc-item-name {
    font-weight: 500;
    color: var(--text-primary);
    padding-left: 0.5rem;
}

.proc-product-id {
    display: block;
    font-size: 0.72rem;
    color: var(--text-tertiary);
    font-weight: 400;
    padding-left: 0.5rem;
}

.proc-qty {
    text-align: center;
    font-weight: 600;
}

.proc-project {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.proc-inv-note {
    display: block;
    font-size: 0.68rem;
    color: var(--text-tertiary);
    margin-top: 0.15rem;
}

.proc-status-select {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    padding: 0.25rem 0.4rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    width: 100%;
}

.proc-status-select:focus {
    outline: none;
    border-color: var(--brand-wine);
}

.btn-order {
    background: var(--brand-wine);
    color: var(--text-inverse);
    border: 1px solid var(--brand-wine);
    font-weight: 500;
}

.btn-order:hover {
    background: var(--brand-wine-light);
}

.stat-info {
    color: var(--status-info);
}

.stat-good {
    color: var(--status-good);
}

/* Project Cards */

.proc-project-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.proc-project-card.proc-project-unassigned {
    opacity: 0.7;
}

.proc-project-card.proc-project-completed {
    opacity: 0.6;
}

.proc-toggle-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.proc-toggle-label input[type="checkbox"] {
    cursor: pointer;
}

.proc-project-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 1rem;
    cursor: pointer;
    transition: background 0.15s;
}

.proc-project-header:hover {
    background: var(--bg-sidebar-active);
}

.proc-project-name {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--text-primary);
}

.proc-project-summary {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.proc-progress-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.proc-progress-bar {
    width: 100px;
    height: 6px;
    background: var(--border-light);
    border-radius: 100px;
    overflow: hidden;
}

.proc-progress-fill {
    height: 100%;
    border-radius: 100px;
    background: var(--border-medium);
    transition: width 0.4s var(--ease);
    min-width: 0;
}

.proc-progress-fill.good {
    background: var(--status-good);
}

.proc-progress-fill.warning {
    background: var(--status-warning);
}

.proc-progress-label {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.proc-project-stat {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.proc-stat-good {
    color: var(--status-good);
}

.proc-project-body {
    border-top: 1px solid var(--border-light);
}

.proc-project-vendor {
    border-bottom: 1px solid var(--border-light);
}

.proc-project-vendor:last-child {
    border-bottom: none;
}

.proc-section-label {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--brand-gold);
    padding: 0.6rem 0.85rem 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-light);
    background: rgba(178, 142, 90, 0.05);
}

/* Vendor logo */
.proc-vendor-logo {
    height: 24px;
    max-width: 140px;
    object-fit: contain;
    display: block;
}

.proc-section-label[data-vendor="Colonial Saw"] .proc-vendor-logo {
    height: 36px;
    max-width: 180px;
}

.proc-section-label[data-vendor="Richelieu"] .proc-vendor-logo,
.proc-section-label[data-vendor="Intermountain"] .proc-vendor-logo {
    height: 48px;
    max-width: 220px;
}

/* Per-vendor brand styling (best-known brand colors / font styles) */
.proc-section-label[data-vendor="Amazon"] {
    color: #232F3E;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    background: #FFF5E6;
}
.proc-section-label[data-vendor="Amazon"]::after {
    content: "";
    display: inline-block;
    width: 18px;
    height: 2px;
    background: #FF9900;
    margin-left: 0.25rem;
    border-radius: 1px;
}
.proc-section-label[data-vendor="Hafele"] {
    color: #E30613;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: rgba(227, 6, 19, 0.05);
}
.proc-section-label[data-vendor="Richelieu"] {
    color: #AC1F2D;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    background: rgba(172, 31, 45, 0.05);
}
.proc-section-label[data-vendor="Fastcap"] {
    color: #F58220;
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    background: rgba(245, 130, 32, 0.05);
}
.proc-section-label[data-vendor="Proslat"] {
    color: #00529B;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    background: rgba(0, 82, 155, 0.05);
}
.proc-section-label[data-vendor="Colonial Saw"] {
    color: #1B4965;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-style: italic;
    background: rgba(27, 73, 101, 0.05);
}
.proc-section-label[data-vendor="Frost CNC"] {
    color: #2C3E50;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(44, 62, 80, 0.05);
}
.proc-section-label[data-vendor="Intermountain"] {
    color: #2E5D3A;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    background: rgba(46, 93, 58, 0.05);
}
.proc-section-label[data-vendor="Star Fasteners"] {
    color: #0B3D91;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    background: rgba(11, 61, 145, 0.05);
}
.proc-section-label[data-vendor="Tools Today"] {
    color: #D32027;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    background: rgba(211, 32, 39, 0.05);
}
.proc-section-label[data-vendor="Closet Doctor"] {
    color: #7B2D42;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-style: italic;
    background: rgba(123, 45, 66, 0.05);
}

.proc-section-count {
    font-weight: 400;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.proc-project-tracking {
    padding: 0.25rem 0;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-main);
}

/* Shipment Tracking */

.proc-tracking-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.proc-tracking-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.proc-tracking-overdue {
    border-left: 3px solid var(--status-danger);
}

.proc-tracking-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--border-light);
}

.proc-tracking-order {
    font-weight: 600;
    font-size: 0.88rem;
    margin-right: 0.5rem;
}

.proc-tracking-count {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.proc-tracking-body {
    padding: 0.25rem 0;
}

.proc-tracking-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0.85rem;
}

.proc-tracking-row + .proc-tracking-row {
    border-top: 1px solid var(--border-light);
}

.proc-tracking-details {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.proc-tracking-link {
    font-family: 'Inter', monospace;
    font-size: 0.78rem;
    color: var(--brand-wine);
    text-decoration: none;
    font-weight: 500;
}

.proc-tracking-link:hover {
    text-decoration: underline;
}

.proc-tracking-meta {
    font-size: 0.7rem;
    color: var(--text-tertiary);
}

.section-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}

/* Inline tracking in item rows */

.proc-col-tracking {
    width: 10rem;
}

.proc-tracking-cell {
    vertical-align: middle;
}

.proc-tracking-inline {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-bottom: 0.15rem;
}

.proc-tracking-inline:last-child {
    margin-bottom: 0;
}

.proc-tracking-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.proc-dot-delivered {
    background: var(--status-good);
}

.proc-dot-transit {
    background: var(--status-info);
}

/* ============================================================
   Marketing module styles
   ============================================================ */

/* Sub-nav (used by every /marketing page) */
.sub-nav {
    display: flex;
    gap: 0.25rem;
    padding: 0 2rem;
    margin: -1rem 0 1.5rem 0;
    border-bottom: 1px solid var(--border-light, #e5e7eb);
}

.sub-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 1rem;
    color: var(--text-muted, #6b7280);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: color .15s, border-color .15s;
}

.sub-nav-link:hover {
    color: var(--text-primary, #111827);
}

.sub-nav-link.active {
    color: var(--brand-primary, #401211);
    border-bottom-color: var(--brand-primary, #401211);
    font-weight: 600;
}

.sub-nav-badge {
    background: var(--brand-primary, #401211);
    color: white;
    font-size: 0.72rem;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
}

/* Stat grid (4-column on top of perf page) */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-grid .stat-card {
    background: white;
    padding: 1.25rem;
    border-radius: 10px;
    border: 1px solid var(--border-light, #e5e7eb);
}

.stat-grid .stat-label {
    color: var(--text-muted, #6b7280);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.4rem;
}

.stat-grid .stat-value {
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--text-primary, #111827);
}

/* Review cards */
.review-card {
    background: white;
    border: 1px solid var(--border-light, #e5e7eb);
    border-radius: 12px;
    margin-bottom: 1.25rem;
    overflow: hidden;
}

.review-card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-light, #e5e7eb);
}

.review-card-title {
    margin: 0 0 0.4rem 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.review-card-meta {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.review-card-body {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.25rem;
    padding: 1.25rem;
}

@media (max-width: 800px) {
    .review-card-body { grid-template-columns: 1fr; }
}

.review-card-photos { min-width: 0; }

.review-card-content { min-width: 0; }

.review-label {
    display: block;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted, #6b7280);
    margin-bottom: 0.35rem;
    font-weight: 600;
}

.review-caption,
.review-hashtags {
    width: 100%;
    border: 1px solid var(--border-light, #e5e7eb);
    border-radius: 6px;
    padding: 0.6rem 0.75rem;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.45;
    resize: vertical;
}

.review-caption:focus,
.review-hashtags:focus {
    outline: none;
    border-color: var(--brand-primary, #401211);
    box-shadow: 0 0 0 3px rgba(64, 18, 17, .08);
}

.review-card-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0.85rem 1.25rem;
    background: #fafafa;
    border-top: 1px solid var(--border-light, #e5e7eb);
}

/* Photo strip (carousel preview) */
.photo-strip {
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.photo-strip-thumb {
    flex: 0 0 auto;
    width: 130px;
    height: 130px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-light, #e5e7eb);
    background: #f3f4f6;
}

.photo-strip-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Post list (used by JobTread Pull queue) */
.post-list {
    margin: 0.5rem 0 0 0;
    padding-left: 1.25rem;
    color: var(--text-primary, #111827);
}
.post-list li { margin-bottom: 0.25rem; }

/* Badges (extending existing system) */
.badge-muted {
    background: #f3f4f6;
    color: #4b5563;
    border-radius: 999px;
    padding: 0.15rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 500;
}

.badge-warn {
    background: #fef3c7;
    color: #92400e;
    border-radius: 999px;
    padding: 0.15rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 600;
}

.badge-ok {
    background: #dcfce7;
    color: #14532d;
    border-radius: 999px;
    padding: 0.15rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 600;
}

/* Buttons (extending existing) */
.btn-secondary {
    background: white;
    color: var(--text-primary, #111827);
    border: 1px solid var(--border-light, #d1d5db);
}
.btn-secondary:hover { background: #f9fafb; }

.btn-ghost {
    background: transparent;
    color: var(--text-muted, #6b7280);
    border: 1px solid transparent;
}
.btn-ghost:hover { background: #f3f4f6; color: var(--text-primary); }

.btn-link {
    background: transparent;
    color: var(--brand-primary, #401211);
    text-decoration: none;
    padding: 0.5rem 0.85rem;
    font-weight: 500;
}
.btn-link:hover { text-decoration: underline; }

/* ============ Procurement: Unassigned Ordered tab ============ */
.proc-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.4rem;
    margin-left: 0.4rem;
    font-size: 0.7rem;
    font-weight: 600;
    background: var(--status-warning, #f59e0b);
    color: #fff;
    border-radius: 999px;
    line-height: 1;
}

.proc-unassigned-intro {
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-light, #e5e7eb);
    border-left: 3px solid var(--status-warning, #f59e0b);
    border-radius: var(--radius-md, 8px);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.proc-unassigned-table .proc-col-tracking {
    width: 180px;
}

.proc-tracking-link {
    font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
    font-size: 0.8rem;
    color: var(--brand-primary, #401211);
    text-decoration: none;
}
.proc-tracking-link:hover { text-decoration: underline; }

.proc-tracking-empty {
    color: var(--text-muted, #9ca3af);
    font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
}

.proc-tracking-mock-tag {
    display: inline-block;
    margin-left: 0.4rem;
    padding: 1px 6px;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(245, 158, 11, 0.15);
    color: var(--status-warning, #b45309);
    border-radius: 3px;
    vertical-align: middle;
}

.proc-eta {
    margin-top: 0.2rem;
    font-size: 0.75rem;
    color: var(--text-secondary, #6b7280);
    font-weight: 500;
}

.proc-assign-btn,
.proc-split-btn {
    margin-left: 0.35rem;
}

/* ============ Modal extras (assign / split pickers) ============ */
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light, #e5e7eb);
}

.proc-modal-projects {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-height: 50vh;
    overflow-y: auto;
    padding: 0.25rem;
}

.proc-project-pick {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border-light, #e5e7eb);
    border-radius: var(--radius-md, 8px);
    cursor: pointer;
    transition: background 0.15s var(--ease, ease), border-color 0.15s var(--ease, ease);
}
.proc-project-pick:hover {
    background: var(--bg-page, #f9fafb);
    border-color: var(--brand-primary, #401211);
}
.proc-project-pick input[type=radio] {
    accent-color: var(--brand-primary, #401211);
}

.proc-project-pick-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}
.proc-project-pick-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.proc-project-pick-split {
    cursor: default;
}
.proc-project-pick-split:hover {
    background: transparent;
    border-color: var(--border-light, #e5e7eb);
}

.proc-split-qty {
    width: 70px;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--border-light, #e5e7eb);
    border-radius: var(--radius-sm, 4px);
    font-size: 0.85rem;
    text-align: right;
}
.proc-split-qty:focus {
    outline: none;
    border-color: var(--brand-primary, #401211);
}

.proc-split-summary {
    background: var(--bg-page, #f9fafb);
    border-radius: var(--radius-md, 8px);
    padding: 0.6rem 0.85rem;
    margin-bottom: 0.85rem;
    font-size: 0.85rem;
    color: var(--text-primary);
}
.proc-split-remaining {
    margin-left: 0.5rem;
    font-size: 0.8rem;
}

/* ============================================
   Platform v2 -- 2026-05-21 dashboard-platform project
   Component layer that powers settings/theme + migrated pages.
   Coexists with legacy classes during incremental migration.
   ============================================ */

/* ---- Buttons (unified) ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1;
    padding: 0.5625rem 0.875rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    user-select: none;
    transition: background var(--transition-fast),
                border-color var(--transition-fast),
                color var(--transition-fast),
                box-shadow var(--transition-fast),
                transform var(--transition-fast);
    white-space: nowrap;
}
.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--focus-ring);
}
.btn:active {
    transform: translateY(1px);
}
.btn[disabled],
.btn.is-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn--primary {
    background: var(--brand-wine);
    color: var(--text-on-brand);
    border-color: var(--brand-wine);
}
.btn--primary:hover {
    background: var(--brand-wine-light);
    border-color: var(--brand-wine-light);
}

.btn--secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-medium);
}
.btn--secondary:hover {
    background: var(--bg-hover);
    border-color: var(--border-strong);
}

.btn--ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
}
.btn--ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn--danger {
    background: var(--status-danger);
    color: #FFFFFF;
    border-color: var(--status-danger);
}
.btn--danger:hover {
    filter: brightness(0.93);
}

.btn--sm {
    font-size: 0.8125rem;
    padding: 0.375rem 0.625rem;
}
.btn--lg {
    font-size: 0.9375rem;
    padding: 0.75rem 1.125rem;
}
.btn--icon {
    padding: 0.5rem;
    width: 2.25rem;
    height: 2.25rem;
}

.btn svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

/* ---- Badge (unified) ---- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.1875rem 0.5rem;
    border-radius: 999px;
    line-height: 1.4;
    background: var(--status-neutral-bg);
    color: var(--status-neutral);
    border: 1px solid transparent;
}
.badge--good { background: var(--status-good-bg); color: var(--status-good); }
.badge--warning { background: var(--status-warning-bg); color: var(--status-warning); }
.badge--danger { background: var(--status-danger-bg); color: var(--status-danger); }
.badge--info { background: var(--status-info-bg); color: var(--status-info); }
.badge--brand { background: var(--brand-wine-subtle); color: var(--brand-wine); }
.badge--outline {
    background: transparent;
    border-color: var(--border-medium);
    color: var(--text-secondary);
}
.badge--dot::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
}

/* ---- Page header (unified) ---- */
.platform-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-6) var(--space-8);
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-card);
}
.platform-page-header__titleblock { min-width: 0; }
.platform-page-header__breadcrumb {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    margin-bottom: var(--space-2);
}
.platform-page-header__breadcrumb a { color: inherit; text-decoration: none; }
.platform-page-header__breadcrumb a:hover { color: var(--text-secondary); }
.platform-page-header__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    margin-bottom: var(--space-1);
}
.platform-page-header__subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}
.platform-page-header__actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-shrink: 0;
}

/* ---- Section (card with header + actions) ---- */
.platform-section {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: var(--space-6);
}
.platform-section__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border-light);
}
.platform-section__title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}
.platform-section__subtitle {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    margin-top: 2px;
}
.platform-section__actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}
.platform-section__body {
    padding: var(--space-5);
}
.platform-section__body--flush { padding: 0; }

/* ---- Stat card (refined) ---- */
.platform-stat {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: var(--space-4) var(--space-5);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.platform-stat:hover {
    border-color: var(--border-medium);
    box-shadow: var(--shadow-sm);
}
.platform-stat__label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: var(--space-2);
}
.platform-stat__value {
    font-size: 1.625rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
    letter-spacing: -0.02em;
}
.platform-stat__value--good { color: var(--status-good); }
.platform-stat__value--warning { color: var(--status-warning); }
.platform-stat__value--danger { color: var(--status-danger); }
.platform-stat__note {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: var(--space-2);
}
.platform-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

/* ---- Table (refined) ---- */
.platform-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.platform-table th {
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-tertiary);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-page);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 1;
}
.platform-table td {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    vertical-align: middle;
}
.platform-table tr:last-child td { border-bottom: none; }
.platform-table tbody tr {
    transition: background var(--transition-fast);
}
.platform-table tbody tr:hover {
    background: var(--bg-hover);
}
.platform-table .row-danger { background: var(--status-danger-bg); }
.platform-table .row-warning { background: var(--status-warning-bg); }
.platform-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.platform-table .muted { color: var(--text-tertiary); }

/* ---- Form controls (unified) ---- */
.platform-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    margin-bottom: var(--space-4);
}
.platform-field__label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.platform-field__hint {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}
.platform-input,
.platform-select,
.platform-textarea {
    width: 100%;
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-family: inherit;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.platform-input:focus,
.platform-select:focus,
.platform-textarea:focus {
    outline: none;
    border-color: var(--brand-wine);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

/* ---- Toggle switch (bigger, brighter, more obvious) ---- */
.platform-toggle {
    --w: 48px;
    --h: 28px;
    position: relative;
    display: inline-block;
    width: var(--w);
    height: var(--h);
    flex-shrink: 0;
}
.platform-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}
.platform-toggle__slider {
    position: absolute;
    inset: 0;
    background: var(--status-neutral);
    opacity: 0.6;
    border-radius: 999px;
    cursor: pointer;
    transition: background var(--transition-fast), opacity var(--transition-fast);
}
.platform-toggle__slider::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: calc(var(--h) - 6px);
    height: calc(var(--h) - 6px);
    background: #FFFFFF;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15), 0 1px 1px rgba(0, 0, 0, 0.08);
    transition: transform var(--transition-fast);
}
.platform-toggle input:checked + .platform-toggle__slider {
    background: var(--brand-wine);
    opacity: 1;
}
.platform-toggle input:checked + .platform-toggle__slider::before {
    transform: translateX(calc(var(--w) - var(--h)));
}
.platform-toggle input:focus-visible + .platform-toggle__slider {
    box-shadow: 0 0 0 3px var(--focus-ring);
}
.platform-toggle:hover .platform-toggle__slider { opacity: 1; }

/* ---- Color swatch input ---- */
.platform-color-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: var(--space-3);
    align-items: center;
    padding: var(--space-3);
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}
.platform-color-row:hover { background: var(--bg-hover); }
.platform-color-row__label {
    font-size: 0.875rem;
    color: var(--text-primary);
}
.platform-color-row__hint {
    display: block;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 2px;
}
.platform-color-row__hex {
    font-family: 'SF Mono', Menlo, monospace;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    width: 80px;
    background: var(--bg-input);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.5rem;
}
.platform-color-row__swatch {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-medium);
    cursor: pointer;
    padding: 0;
    background: none;
}
.platform-color-row__swatch input[type="color"] {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: none;
}

/* ---- Theme switcher (sidebar header chip) ---- */
.theme-switcher {
    display: inline-flex;
    background: var(--bg-page);
    border: 1px solid var(--border-light);
    border-radius: 999px;
    padding: 2px;
    gap: 2px;
}
.theme-switcher button {
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.theme-switcher button.is-active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}
.theme-switcher button svg {
    width: 14px;
    height: 14px;
}

/* ---- Settings layout ---- */
.settings-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: var(--space-8);
    padding: var(--space-6) var(--space-8);
    max-width: 1280px;
    margin: 0 auto;
}
.settings-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: sticky;
    top: var(--space-6);
    align-self: start;
}
.settings-nav a {
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background var(--transition-fast), color var(--transition-fast);
}
.settings-nav a:hover { background: var(--bg-hover); color: var(--text-primary); }
.settings-nav a.is-active {
    background: var(--brand-wine-subtle);
    color: var(--brand-wine);
}
.settings-content { min-width: 0; }
.settings-preview {
    background: var(--bg-page);
    border: 1px dashed var(--border-medium);
    border-radius: var(--radius-md);
    padding: var(--space-5);
    margin-top: var(--space-4);
}
.settings-preview__label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: var(--space-3);
}

/* ---- Misc dark-mode polish ---- */
[data-theme="dark"] .sidebar-link:hover { color: var(--text-primary); }
[data-theme="dark"] .stat-value.good { color: var(--status-good); }
[data-theme="dark"] .stat-value.warning { color: var(--status-warning); }
[data-theme="dark"] .stat-value.danger { color: var(--status-danger); }
[data-theme="dark"] .data-table thead { background: var(--bg-card-elevated); }
[data-theme="dark"] .widget-card { background: var(--bg-card); border-color: var(--border-light); }
[data-theme="dark"] .platform-page-header { background: var(--bg-sidebar); }

/* Apply distinctive type to platform components */
.platform-page-header__title {
    font-family: var(--font-display);
    font-size: 1.875rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.15;
}
.platform-stat__value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 500;
    line-height: 1.05;
    letter-spacing: -0.025em;
    font-variant-numeric: tabular-nums;
}
.platform-section__title {
    font-family: var(--font-display);
    font-size: 1.0625rem;
    font-weight: 500;
    letter-spacing: -0.01em;
}
.platform-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
}
.platform-table td.numeric, .platform-table .mono {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}
.platform-eyebrow {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--brand-wine);
}
.platform-display {
    font-family: var(--font-display);
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

/* ============================================
   Sidebar collapse + cleanup -- 2026-05-21
   ============================================ */
.sidebar-brand {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 16px;
    border-bottom: 1px solid var(--border-light);
}
.sidebar-brand-icon { width: 44px; height: 44px; flex-shrink: 0; }
.sidebar-brand-text { display: flex; flex-direction: column; min-width: 0; }
.sidebar-brand-name {
    font-family: var(--font-display, 'Inter', sans-serif);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-brand-label {
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-tertiary);
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-collapse-btn {
    position: absolute;
    right: 8px;
    top: 18px;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}
.sidebar-collapse-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-light);
}
.sidebar-collapse-btn svg { width: 14px; height: 14px; }

/* Collapsed state -- fully hide sidebar, slide off-screen, expand main content. */
.sidebar { transition: transform 220ms var(--ease); }
.main-content { transition: margin-left 220ms var(--ease); }
html[data-sidebar="collapsed"] .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
}
html[data-sidebar="collapsed"] .main-content {
    margin-left: 0;
}

/* Floating expand button -- only visible when sidebar is collapsed */
.sidebar-expand-btn {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 150;
    width: 38px;
    height: 38px;
    display: none;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
    border-radius: 9px;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}
.sidebar-expand-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-strong);
}
.sidebar-expand-btn:active { transform: translateY(1px); }
.sidebar-expand-btn svg { width: 18px; height: 18px; }
html[data-sidebar="collapsed"] .sidebar-expand-btn { display: inline-flex; }

/* Force the sidebar nav text to track the font variable (otherwise some browsers
   serve a cached metric and the change doesn't render until reload). */
.sidebar-link,
.sidebar-section-title,
.sidebar-collapse-summary {
    font-family: var(--font-body, 'Inter', sans-serif);
}

/* ============================================
   Sidebar v2 -- dark surface, brand-reactive
   2026-05-21 (Shop OS Platform direction)
   ============================================ */
.sidebar {
    background: color-mix(in srgb, var(--brand-wine) 8%, #11171F);
    color: rgba(255, 255, 255, 0.88);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    /* Subtle gradient overlay for depth -- top is slightly lighter */
    background-image: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(0,0,0,0.06));
    background-blend-mode: overlay;
}
[data-theme="dark"] .sidebar {
    background: color-mix(in srgb, var(--brand-wine) 6%, #060A11);
    background-image: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0.10));
}

.sidebar-brand {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}
.sidebar-brand-name {
    color: rgba(255, 255, 255, 0.96);
}
.sidebar-brand-label {
    color: rgba(255, 255, 255, 0.55);
}
.sidebar-section-title {
    color: rgba(255, 255, 255, 0.42);
    font-weight: 600;
}
.sidebar-link {
    color: rgba(255, 255, 255, 0.72);
}
.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.96);
}
.sidebar-link.active {
    background: color-mix(in srgb, var(--brand-wine) 22%, transparent);
    color: #FFFFFF;
    box-shadow: inset 2px 0 0 var(--brand-wine);
}
.sidebar-link svg {
    opacity: 0.75;
}
.sidebar-link:hover svg, .sidebar-link.active svg {
    opacity: 1;
}
.sidebar-collapse-btn {
    color: rgba(255, 255, 255, 0.55);
}
.sidebar-collapse-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.95);
    border-color: rgba(255, 255, 255, 0.10);
}

/* ---- Settings gear (bottom of sidebar) + popover ---- */
.sidebar-footer {
    margin-top: auto;
    padding: 12px 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
}
.sidebar-settings-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 12px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.72);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: background var(--transition-fast), color var(--transition-fast);
}
.sidebar-settings-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #FFFFFF;
}
.sidebar-settings-btn svg {
    width: 16px;
    height: 16px;
    opacity: 0.75;
    transition: transform 400ms var(--ease);
}
.sidebar-settings-btn:hover svg {
    opacity: 1;
    transform: rotate(60deg);
}

.sidebar-settings-menu {
    position: absolute;
    bottom: calc(100% + 4px);
    left: 12px;
    right: 12px;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    padding: 6px;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity 180ms var(--ease), transform 180ms var(--ease);
    z-index: 80;
}
.sidebar-settings-menu.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.sidebar-settings-menu__header {
    padding: 8px 10px 6px;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.sidebar-settings-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background var(--transition-fast);
}
.sidebar-settings-menu a:hover {
    background: var(--bg-hover);
}
.sidebar-settings-menu a svg {
    width: 14px;
    height: 14px;
    color: var(--text-tertiary);
}

/* When sidebar is collapsed, hide footer button text */
html[data-sidebar="collapsed"] .sidebar-settings-btn {
    justify-content: center;
}
html[data-sidebar="collapsed"] .sidebar-settings-btn span {
    display: none;
}

/* ---- Micro polish: page-header action zone ---- */
.platform-page-header__search {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-medium);
    border-radius: 8px;
    color: var(--text-tertiary);
    font-size: 0.8125rem;
    width: 240px;
    cursor: text;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.platform-page-header__search:hover { border-color: var(--border-strong); }
.platform-page-header__search:focus-within {
    border-color: var(--brand-wine);
    box-shadow: 0 0 0 3px var(--focus-ring);
}
.platform-page-header__search input {
    background: none;
    border: none;
    outline: none;
    width: 100%;
    color: var(--text-primary);
    font: inherit;
}
.platform-page-header__search svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Stat-card delta chip */
.platform-stat__delta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 8px;
    padding: 2px 7px;
    border-radius: 999px;
}
.platform-stat__delta--up   { background: var(--status-good-bg); color: var(--status-good); }
.platform-stat__delta--down { background: var(--status-danger-bg); color: var(--status-danger); }

/* ============================================
   Global demo banner (was scoped to /preview, needed everywhere)
   ============================================ */
.demo-banner {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%) translateY(140%);
    background: var(--brand-wine);
    color: #FFFFFF;
    padding: 10px 18px;
    border-radius: 999px;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.20), 0 2px 6px rgba(0, 0, 0, 0.15);
    display: inline-flex;
    align-items: center;
    gap: 14px;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: -0.005em;
    transition: transform 280ms cubic-bezier(0.34, 1.4, 0.64, 1);
    z-index: 999;
    max-width: calc(100vw - 32px);
}
.demo-banner.is-visible { transform: translateX(-50%) translateY(0); }
.demo-banner__dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #FFFFFF;
    animation: demoPulse 1.6s ease-in-out infinite;
}
@keyframes demoPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.demo-banner__off, a.demo-banner__off {
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.30);
    color: #FFFFFF;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 150ms;
}
.demo-banner__off:hover { background: rgba(255, 255, 255, 0.28); }

/* ============================================
   Page layout: data-dense pages fill available width
   (Stripe / Linear / Vercel pattern -- content expands with main-content area)
   ============================================ */
.platform-page-header {
    padding: var(--space-6) var(--space-8);
}
.platform-page-header__inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4);
    width: 100%;
}
.platform-content {
    padding: 24px var(--space-8) 48px;
}

/* ============================================
   Global theme toggle (bottom-right of viewport, out of the way of page actions)
   ============================================ */
.theme-toggle-btn {
    position: fixed;
    bottom: 16px;
    right: 16px;
    z-index: 120;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-medium);
    border-radius: 999px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: background var(--transition-fast), color var(--transition-fast),
                border-color var(--transition-fast), transform var(--transition-fast);
}
.theme-toggle-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-md);
}
.theme-toggle-btn:active { transform: translateY(1px); }
.theme-toggle-btn svg { width: 18px; height: 18px; }
.theme-toggle-btn .theme-toggle-btn__moon { display: none; }
.theme-toggle-btn .theme-toggle-btn__sun  { display: inline-block; }
[data-theme="dark"] .theme-toggle-btn .theme-toggle-btn__moon { display: inline-block; }
[data-theme="dark"] .theme-toggle-btn .theme-toggle-btn__sun  { display: none; }
