:root {
    /* Design tokens — type scale */
    --text-xs: 0.7rem;
    --text-sm: 0.75rem;
    --text-base: 0.8rem;
    --text-md: 0.85rem;
    --text-lg: 0.95rem;

    /* Design tokens — spacing scale */
    --space-xs: 0.15rem;
    --space-sm: 0.25rem;
    --space-md: 0.4rem;
    --space-lg: 0.6rem;
    --space-xl: 0.85rem;
    --space-2xl: 1.25rem;

    /* Colors */
    --accent: #505050;
    --accent-hover: #1a1a1a;
    --accent-light: #f2f2f2;
    --text-primary: #1a1a1a;
    --text-secondary: #555555;
    --text-muted: #767676;
    --bg-page: #f8f8f8;
    --bg-card: #ffffff;
    --bg-muted: #f0f0f0;
    --border: #e5e5e5;
    --border-focus: #505050;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.06);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --danger: #dd4444;
    --danger-bg: #fef2f2;
    --warning: #cc8800;
    --warning-bg: #fefce8;
    --success: #22aa55;
    --success-bg: #f0fdf4;
    --badge-lavender: #666666;
    --badge-lavender-bg: #f0f0f0;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --accent: #b0b0b0;
        --accent-hover: #d0d0d0;
        --accent-light: #2a2a2a;
        --text-primary: #e8e8e8;
        --text-secondary: #aaaaaa;
        --text-muted: #8a8a8a;
        --bg-page: #161616;
        --bg-card: #1c1c1c;
        --bg-muted: #262626;
        --border: #333333;
        --border-focus: #a0aec0;
        --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
        --shadow-md: 0 4px 6px rgba(0,0,0,0.4);
        --danger: #e06060;
        --danger-bg: #2a1c1c;
        --warning: #dda030;
        --warning-bg: #2a2618;
        --success: #55cc77;
        --success-bg: #1a2a1c;
        --badge-lavender: #aaaaaa;
        --badge-lavender-bg: #2a2a2a;
    }
}

:root[data-theme="dark"] {
    --accent: #b0b0b0;
    --accent-hover: #d0d0d0;
    --accent-light: #2a2a2a;
    --text-primary: #e8e8e8;
    --text-secondary: #aaaaaa;
    --text-muted: #666666;
    --bg-page: #161616;
    --bg-card: #1c1c1c;
    --bg-muted: #262626;
    --border: #333333;
    --border-focus: #a0aec0;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.4);
    --danger: #e06060;
    --danger-bg: #2a1c1c;
    --warning: #dda030;
    --warning-bg: #2a2618;
    --success: #55cc77;
    --success-bg: #1a2a1c;
    --badge-lavender: #aaaaaa;
    --badge-lavender-bg: #2a2a2a;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: none;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
    background: var(--bg-page);
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: var(--text-md);
}

/* Typography */
h1 { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); margin-bottom: 1.25rem; }
h2 { font-size: 1.15rem; font-weight: 600; color: var(--text-primary); margin-bottom: 0.75rem; }
h3 { font-size: 1rem; font-weight: 600; color: var(--text-primary); margin-bottom: 0.5rem; }
a { color: var(--accent); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

/* Sidebar */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 240px;
    min-width: 240px;
    background: var(--bg-card);
    transition: width 0.15s ease, min-width 0.15s ease;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
}
.sidebar-brand {
    padding: 1.5rem 1.25rem 1rem;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
}
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    padding-right: 0.75rem;
}
.sidebar-collapse-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: var(--space-md);
    border-radius: var(--radius-sm);
    transition: color 0.1s, background 0.1s;
    display: flex;
    align-items: center;
}
.sidebar-collapse-btn:hover { color: var(--text-primary); background: var(--bg-muted); }
.sidebar.sidebar-collapsed .sidebar-header { flex-direction: column; justify-content: center; padding-right: 0; padding-bottom: 0.5rem; }
.sidebar.sidebar-collapsed .sidebar-brand { padding: 1rem 0.25rem 0.25rem; font-size: 0.7rem; }
.sidebar.sidebar-collapsed .sidebar-collapse-btn { transform: rotate(180deg); }
.sidebar-nav { padding: 1rem 0; flex: 1; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: var(--space-lg) 1.25rem;
    color: var(--text-secondary);
    font-size: var(--text-md);
    font-weight: 500;
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all 0.15s;
}
.sidebar-nav a:hover { color: var(--text-primary); background: var(--bg-muted); text-decoration: none; }
.sidebar-nav a.active { color: var(--text-primary); border-left-color: var(--accent); background: var(--bg-muted); }
.sidebar-icon { width: 18px; height: 18px; vertical-align: middle; flex-shrink: 0; }

/* Sidebar collapsible group */
.sidebar-group { margin: 0.25rem 0; }
.sidebar-group-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
    padding: var(--space-sm) 1.25rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: color 0.15s;
}
.sidebar-group-toggle:hover { color: var(--text-secondary); }
.sidebar-group-toggle .sidebar-icon { width: 10px; height: 10px; transition: transform 0.2s; }
.sidebar-group.collapsed .sidebar-group-toggle .sidebar-icon { transform: rotate(-90deg); }
.sidebar-group-items { padding-left: 0.5rem; }
.sidebar-group-items a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: var(--space-md) 1.25rem;
    color: var(--text-secondary);
    font-size: var(--text-base);
    font-weight: 500;
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all 0.15s;
}
.sidebar-group-items a:hover { color: var(--text-primary); background: var(--bg-muted); }
.sidebar-group-items a.active { color: var(--text-primary); border-left-color: var(--accent); background: var(--bg-muted); }
.sidebar-group-items .sidebar-icon { width: 16px; height: 16px; }
.sidebar-group.collapsed .sidebar-group-items { display: none; }

/* Sidebar collapsed state */
.sidebar.sidebar-collapsed {
    width: 56px;
    min-width: 56px;
}
.sidebar.sidebar-collapsed .sidebar-nav a span,
.sidebar.sidebar-collapsed .sidebar-group-toggle span { display: none; }
.sidebar.sidebar-collapsed .sidebar-nav a {
    justify-content: center;
    padding: var(--space-lg) 0;
    border-left: none;
    gap: 0;
}
.sidebar.sidebar-collapsed .sidebar-nav a.active { background: var(--bg-muted); border-left: none; box-shadow: inset 3px 0 0 var(--accent); }
.sidebar.sidebar-collapsed .sidebar-group-toggle { justify-content: center; padding: var(--space-sm) 0; }
.sidebar.sidebar-collapsed .sidebar-group-items a { justify-content: center; padding: var(--space-md) 0; border-left: none; gap: 0; }
.sidebar.sidebar-collapsed .sidebar-group-items a.active { box-shadow: inset 3px 0 0 var(--accent); }
.sidebar.sidebar-collapsed .sidebar-group-items { padding-left: 0; }
.sidebar.sidebar-collapsed .sidebar-footer { padding: 0.5rem; }
.sidebar.sidebar-collapsed .sidebar-footer .sidebar-logout span { display: none; }
.sidebar.sidebar-collapsed .sidebar-footer .sidebar-logout { justify-content: center; padding: var(--space-md) 0; gap: 0; }
.sidebar-collapsed ~ .main-content { margin-left: 56px; }

/* Sidebar footer */
.sidebar-footer { padding: 0.75rem 1rem; border-top: 1px solid var(--border); }

/* Bulk select */
.bulk-cell { width: 2rem; padding: var(--space-sm) var(--space-lg) !important; }
.bulk-cb {
    appearance: none; -webkit-appearance: none;
    width: 15px; height: 15px; cursor: pointer;
    border: 1.5px solid var(--text-muted);
    border-radius: 3px;
    background: transparent;
    transition: background 0.1s, border-color 0.1s;
    position: relative;
}
.bulk-cb:checked {
    background: var(--accent);
    border-color: var(--accent);
}
.bulk-cb:checked::after {
    content: '';
    position: absolute;
    left: 4px; top: 1px;
    width: 4px; height: 8px;
    border: solid var(--bg-card);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.bulk-cell { opacity: 0; transition: opacity 0.1s; }
.clickable-row:hover .bulk-cell,
.bulk-active .bulk-cell { opacity: 1; }
.bulk-bar {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: var(--space-lg) 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    z-index: 90;
    font-size: var(--text-base);
}
.bulk-bar-count { font-weight: 600; color: var(--text-primary); }
.bulk-bar-btn {
    padding: var(--space-sm) var(--space-xl);
    border: 1.5px solid var(--text-primary);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-primary);
    font-size: var(--text-base);
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.bulk-bar-btn:hover { background: var(--text-primary); color: var(--bg-card); }
.bulk-bar-btn--danger { border-color: var(--danger); color: var(--danger); }
.bulk-bar-btn--danger:hover { background: var(--danger); color: #fff; }
.bulk-bar-dismiss { border: none; color: var(--text-muted); font-size: var(--text-sm); }
.bulk-bar-dismiss:hover { color: var(--text-primary); background: none; }

/* Custom views */
.view-picker { display: inline-flex; align-items: center; gap: var(--space-sm); margin-left: 0.5rem; }
.view-select {
    font-size: var(--text-sm);
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    width: auto;
}
.view-select:focus { border-color: var(--border-focus); }
.view-save-btn { color: var(--text-muted); padding: var(--space-sm); }
.view-save-btn:hover { color: var(--text-primary); }

/* Muted add button (context-dependent creation) */
.sync-add-btn--muted {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
    position: relative;
}

.toast-undo { display: flex; align-items: center; gap: 0.75rem; }
.undo-btn {
    background: none;
    border: 1px solid var(--text-muted);
    color: var(--text-primary);
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: var(--text-sm);
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}
.undo-btn:hover { background: var(--text-primary); color: var(--bg-card); }

.sidebar-footer form { margin: 0; }
.sidebar-footer button[type="submit"] {
    all: unset;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: var(--text-base);
    cursor: pointer;
    transition: color 0.15s;
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-sm);
}
.sidebar-footer button[type="submit"]:hover { color: var(--text-primary); background: var(--bg-muted); }
.main-content {
    flex: 1;
    margin-left: 240px;
    transition: margin-left 0.15s ease;
    padding: 2rem;
    max-width: 100%;
    overflow-x: hidden;
}
.main-content.layout-list {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    padding-bottom: 0;
}
.layout-list [data-sync-table] {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}
.layout-list .page-header,
.layout-list .table-controls,
.layout-list .sync-subcontrols,
.layout-list .filter-pills { flex-shrink: 0; }
.layout-list .sync-table-wrap {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}
.layout-list .sync-table-wrap::-webkit-scrollbar { width: 6px; }
.layout-list .sync-table-wrap::-webkit-scrollbar-track { background: transparent; }
.layout-list .sync-table-wrap::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.layout-list .sync-table-wrap::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}
.theme-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-sm) var(--space-md);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: auto;
    color: var(--text-muted);
    transition: color 0.1s;
}
.theme-toggle-btn:hover { color: var(--text-primary); }
.theme-track {
    display: inline-block;
    width: 32px;
    height: 18px;
    background: var(--border);
    border-radius: 9px;
    position: relative;
    transition: background 0.15s;
}
.theme-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: var(--text-primary);
    border-radius: 50%;
    transition: transform 0.15s;
}
[data-theme="dark"] .theme-thumb { transform: translateX(14px); }
[data-theme="dark"] .theme-track { background: var(--text-muted); }
.hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: var(--space-md);
    color: var(--text-primary);
}

/* Main (public pages) */
main { max-width: 960px; margin: 2rem auto; padding: 0 1.5rem; }

/* Buttons — 5 classes: .btn, .btn-ghost, .btn-danger, .btn-icon, .btn-pill */
/* Button system — 4 tiers × 3 sizes, built on design tokens */
.btn {
    display: inline-block;
    background: transparent;
    color: var(--text-primary);
    padding: var(--space-md) var(--space-xl);
    border: 1.5px solid var(--text-primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: var(--text-base);
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    line-height: 1.4;
}
.btn:hover { background: var(--text-primary); color: var(--bg-card); text-decoration: none; }
.btn:disabled, .btn[disabled] { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

.btn-ghost, .btn--ghost {
    display: inline-block;
    background: none;
    border: none;
    color: var(--accent);
    padding: var(--space-md) var(--space-xl);
    font-size: var(--text-base);
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.15s;
}
.btn-ghost:hover, .btn--ghost:hover { text-decoration: underline; color: var(--accent-hover); }

.btn-danger, .btn--danger {
    display: inline-block;
    background: none;
    border: none;
    color: var(--text-muted);
    padding: var(--space-md) var(--space-xl);
    font-size: var(--text-base);
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.15s;
    opacity: 0.6;
}
.btn-danger:hover, .btn--danger:hover { color: var(--danger); opacity: 1; }

.btn-icon, .btn--icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.75rem;
    height: 1.75rem;
    font-size: var(--text-md);
    color: var(--text-muted);
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
    padding: 0;
    opacity: 0.5;
}
.btn-icon:hover, .btn--icon:hover { opacity: 1; color: var(--accent); text-decoration: none; }
.btn-icon-warn:hover { color: var(--warning); }
.btn-icon-danger:hover, .btn--icon-danger:hover { color: var(--danger); }

.btn-pill, .btn--pill {
    display: inline-block;
    background: none;
    border: 1px dashed var(--border);
    color: var(--text-muted);
    padding: var(--space-xs) var(--space-lg);
    font-size: var(--text-sm);
    border-radius: 20px;
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.15s, color 0.15s;
}
.btn-pill:hover, .btn--pill:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* Sizes */
.btn--sm { font-size: var(--text-sm); padding: var(--space-xs) var(--space-md); }
.btn--lg { font-size: var(--text-md); padding: var(--space-md) var(--space-2xl); font-weight: 600; }

/* Modifiers */
.btn--full { width: 100%; text-align: center; }
.btn--loading { opacity: 0.6; pointer-events: none; }

/* Legacy compat — aliases (remove after full migration) */
.btn-secondary { background: none; border: none; color: var(--accent); padding: var(--space-md) var(--space-xl); font-size: var(--text-base); font-weight: 500; cursor: pointer; text-decoration: none; }
.btn-secondary:hover { text-decoration: underline; color: var(--accent-hover); transform: none; }
.btn-copy { opacity: 0.5; background: none; border: none; color: var(--text-muted); font-size: var(--text-xs); padding: var(--space-xs) var(--space-sm); cursor: pointer; }
.btn-copy:hover { opacity: 1; color: var(--accent); }
.btn-score { display: inline-block; background: none; border: none; color: var(--accent); padding: var(--space-md) var(--space-xl); font-size: var(--text-base); font-weight: 500; cursor: pointer; text-decoration: none; }
.btn-score:hover { text-decoration: underline; color: var(--accent-hover); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 1.75rem; height: 1.75rem; font-size: var(--text-md); color: var(--text-muted); background: none; border: none; border-radius: var(--radius-sm); cursor: pointer; text-decoration: none; opacity: 0.5; padding: 0; transition: all 0.15s; }
.icon-btn:hover { opacity: 1; color: var(--accent); text-decoration: none; transform: none; }
.icon-btn.icon-btn-warn:hover { color: var(--warning); }
.icon-btn.icon-btn-danger:hover { color: var(--danger); }
.btn-danger-sm { opacity: 0.5; background: none; border: none; color: var(--text-muted); font-size: var(--text-xs); padding: var(--space-xs) var(--space-sm); cursor: pointer; }
.btn-danger-sm:hover { opacity: 1; color: var(--danger); transform: none; }

/* Page header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}
.page-header h1 { margin-bottom: 0; }

/* Action row */
.action-row { display: flex; gap: 0.5rem; align-items: center; margin-top: 1rem; }

/* Form actions (legacy + new) */
.form-actions { display: flex; align-items: center; gap: 0.75rem; margin-top: 1.5rem; }
.form-actions .btn { width: auto; }

.form-card button[type="submit"],
.form-container button[type="submit"],
.add-pipeline-form button[type="submit"],
.submit-btn {
    padding: var(--space-md) var(--space-2xl);
    background: transparent;
    color: var(--text-primary);
    border: 1.5px solid var(--text-primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: var(--text-md);
    font-weight: 600;
    transition: background 0.15s, color 0.15s;
}
.form-card button[type="submit"]:hover,
.form-container button[type="submit"]:hover,
.add-pipeline-form button[type="submit"]:hover,
.submit-btn:hover { background: var(--text-primary); color: var(--bg-card); }
/* Override for buttons inside action groups — never full-width */
.action-row button, .summary-block button, .detail-section button.btn-ghost, .detail-section button.btn {
    width: auto;
    margin-top: 0;
    padding: var(--space-md) var(--space-xl);
    font-size: var(--text-base);
    font-weight: 500;
}
/* Ensure .btn-ghost always overrides submit styling */
button.btn-ghost {
    background: none;
    color: var(--accent);
    border: none;
    width: auto;
    margin-top: 0;
    padding: var(--space-md) var(--space-xl);
    font-size: var(--text-base);
    font-weight: 500;
}
button.btn-ghost:hover { text-decoration: underline; color: var(--accent-hover); }
nav button[type="submit"] {
    all: unset;
    color: var(--text-muted);
    cursor: pointer;
    font-size: var(--text-md);
    font-weight: 500;
    transition: color 0.15s;
}
nav button[type="submit"]:hover { color: var(--text-primary); }

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Tables */
.table-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.25rem;
    flex-wrap: wrap;
}
.sync-subcontrols {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.sync-add-btn {
    opacity: 1;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: var(--space-sm);
    margin-left: auto;
}
.sync-add-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.table-search {
    flex: 0 1 240px;
    min-width: 140px;
    padding: var(--space-md) var(--space-lg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: var(--text-base);
}
.table-search:focus { outline: none; border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1); }
.table-filter {
    padding: var(--space-md) var(--space-xl);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: var(--text-base);
    background: var(--bg-card);
    color: var(--text-secondary);
}
.sortable { user-select: none; position: relative; }
.sortable:hover { color: var(--accent); }
.sortable.sort-asc::after { content: " ▲"; font-size: var(--text-xs); }
.sortable.sort-desc::after { content: " ▼"; font-size: var(--text-xs); }

table { width: 100%; border-collapse: collapse; background: var(--bg-card); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-sm); }
th, td { padding: var(--space-lg) var(--space-xl); text-align: left; border-bottom: none; font-size: var(--text-md); }
th { background: var(--bg-muted); font-weight: 600; color: var(--text-primary); font-size: var(--text-base); text-transform: uppercase; letter-spacing: 0.03em; border-bottom: 1px solid var(--border); }
tr:hover td { background: var(--bg-muted); }

/* Badges — 4 semantic colors: success, danger, warning, active */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: var(--space-xs) var(--space-lg);
    font-size: var(--text-xs);
    font-weight: 500;
    border-radius: 20px;
    letter-spacing: 0.02em;
    text-transform: capitalize;
    color: var(--text-muted);
    background: var(--bg-muted);
}
.badge::before {
    font-size: var(--text-xs);
    line-height: 1;
}
/* Pending — hollow circle, grey */
.badge-pending, .badge-urgent, .badge-late {
    background: var(--bg-muted); color: var(--text-muted);
}
.badge-pending::before { content: '◌'; color: var(--text-muted); }
.badge-urgent::before { content: '◌'; color: var(--warning); }
.badge-late::before { content: '◌'; color: var(--warning); }
/* Active — filled dot, accent */
.badge-screening::before, .badge-test::before, .badge-open::before,
.badge-opened::before, .badge-submitted::before, .badge-normal::before,
.badge-high::before { content: '●'; color: var(--text-primary); }
.badge-screening, .badge-test, .badge-open,
.badge-opened, .badge-submitted, .badge-normal,
.badge-high { background: var(--bg-muted); color: var(--text-secondary); }
/* In-progress — half-filled, accent */
.badge-interview::before, .badge-offer::before,
.badge-on_hold::before { content: '◐'; color: var(--text-primary); }
.badge-interview, .badge-offer, .badge-on_hold {
    background: var(--bg-muted); color: var(--text-secondary);
}
/* Success — checkmark, green */
.badge-completed::before, .badge-hired::before, .badge-closed::before { content: '✓'; color: var(--success); }
.badge-completed, .badge-hired, .badge-closed {
    background: var(--success-bg); color: var(--success);
}
/* Danger — cross, red */
.badge-cancelled::before, .badge-rejected::before { content: '✕'; color: var(--danger); }
.badge-cancelled, .badge-rejected {
    background: var(--danger-bg); color: var(--danger);
}
/* Neutral — no icon emphasis */
.badge-withdrawn::before, .badge-low::before { content: '○'; color: var(--text-muted); }
.badge-withdrawn, .badge-low { background: var(--bg-muted); color: var(--text-muted); }
/* Plain badge — no status icon (for scores, counts) */
.badge--plain::before { content: none; }

/* Cell type standards — computed badge opacity */
.badge { opacity: 0.85; }
.badge-overflow { opacity: 0.6; font-size: var(--text-xs); }

/* Band pills — salary positioning indicators */
.band-pill { display: inline-block; padding: 0.15rem 0.5rem; border-radius: var(--radius-sm); font-size: var(--text-xs); font-weight: 500; white-space: nowrap; }
.band-well-below { background: var(--success-bg); color: var(--success); }
.band-below { background: var(--success-bg); color: var(--success); opacity: 0.75; }
.band-market { background: var(--bg-muted); color: var(--text-muted); }
.band-above { background: var(--warning-bg); color: var(--warning); }
.band-well-above { background: var(--danger-bg); color: var(--danger); }
.band-none { background: transparent; border: 1px dashed var(--border); color: var(--text-muted); }

/* Cell type standards — fixed column widths */
.cell-ratio { width: 60px; text-align: right; white-space: nowrap; }
.cell-date { width: 90px; text-align: right; white-space: nowrap; }
.cell-multi-badge { white-space: nowrap; overflow: hidden; max-width: 200px; }
.peek-trigger { width: 40px; }

/* Cell type — person (initials avatar + text) */
.cell-person { display: flex; align-items: center; gap: var(--space-lg); }
.cell-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 50%;
    font-size: var(--text-xs);
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.02em;
}

/* Searchable picker (combobox) */
[data-picker-name] { position: relative; }
.picker-search { width: 100%; }
.picker-list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 200px;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    z-index: 50;
    box-shadow: var(--shadow-md);
}
.picker-option {
    padding: var(--space-md) var(--space-xl);
    cursor: pointer;
    font-size: var(--text-base);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.picker-option:hover, .picker-option--active { background: var(--bg-muted); }
.picker-option--selected { font-weight: 600; }
.picker-option-meta { font-size: var(--text-sm); color: var(--text-muted); }
.picker-empty { padding: var(--space-xl); text-align: center; color: var(--text-muted); font-size: var(--text-sm); }
.picker-add { border-top: 1px solid var(--border); color: var(--accent); font-weight: 500; font-size: var(--text-sm); }

/* Cell type — link (truncated URL with icon) */
.cell-link a, .cell-link-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    text-decoration: none;
}
.cell-link a:hover, .cell-link-inline:hover { color: var(--text-primary); text-decoration: underline; }
.cell-link svg, .cell-link-inline svg { opacity: 0.5; flex-shrink: 0; }
.cell-link a:hover svg, .cell-link-inline:hover svg { opacity: 1; }

/* Mutable select — full opacity, hover affordance */
.inline-select { opacity: 1; }
.inline-select:hover { border-color: var(--border-focus); }

/* Inline expand (action bar → form below) */
.inline-expand { margin-bottom: 1.5rem; }
.inline-expand:not([open]) .inline-expand-body { display: none; }
.inline-expand[open] .inline-expand-body {
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-top: 0.75rem;
    background: var(--bg-muted);
}

.inline-select {
    appearance: none;
    -webkit-appearance: none;
    padding: var(--space-xs) 1.2rem 0.15rem 0.5rem;
    font-size: var(--text-xs);
    font-weight: 500;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--bg-muted) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 0.4rem center;
    color: var(--text-muted);
    cursor: pointer;
    text-transform: capitalize;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.inline-select:hover { background-color: var(--border); }
.inline-select:focus { outline: none; background-color: var(--border); }
/* Stage-aware coloring */
.inline-select[data-stage="screening"],
.inline-select[data-stage="test"],
.inline-select[data-stage="open"] { color: var(--text-secondary); border-color: var(--text-muted); }
.inline-select[data-stage="interview"],
.inline-select[data-stage="offer"],
.inline-select[data-stage="on_hold"] { color: var(--text-primary); border-color: var(--text-primary); }
.inline-select[data-stage="hired"],
.inline-select[data-stage="completed"] { color: var(--success); border-color: var(--success); }
.inline-select[data-stage="rejected"],
.inline-select[data-stage="cancelled"] { color: var(--danger); border-color: var(--danger); }
.inline-select[data-stage="withdrawn"] { color: var(--text-muted); border-color: var(--border); }

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: var(--shadow-md);
    min-width: 200px;
    z-index: 100;
    padding: var(--space-sm) 0;
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.1s ease;
}
.dropdown-menu.show {
    display: block;
    transform: scaleY(1);
}
.dropdown-menu a {
    display: block;
    padding: var(--space-lg) var(--space-xl);
    font-size: var(--text-md);
    text-decoration: none;
    color: inherit;
}
.dropdown-menu a:hover { background: var(--bg-muted); }


.link-subtle {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    text-decoration: none;
}
.link-subtle:hover {
    color: var(--accent);
    text-decoration: underline;
}


.score-grid {
    display: grid;
    gap: 1rem;
}
.score-item label {
    font-weight: 600;
    font-size: var(--text-md);
}

.score-summary-card {
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: var(--space-xl) 1.25rem;
    text-align: center;
}
.score-big {
    font-size: 1.5rem;
    font-weight: 700;
}
.score-label {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-left: 0.25rem;
}

.score-table {
    width: 100%;
    font-size: var(--text-base);
    border-collapse: collapse;
}
.score-table th, .score-table td {
    padding: var(--space-md) var(--space-lg);
    text-align: center;
    border-bottom: 1px solid var(--border, #e5e7eb);
}
.score-table th:first-child, .score-table td:first-child {
    text-align: left;
}
.score-table .avg-row {
    background: var(--bg-muted);
}

.breadcrumb {
    font-size: var(--text-base);
    color: var(--text-muted);
    margin-bottom: 1rem;
}
.breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
}
.breadcrumb a:hover {
    color: var(--text-primary);
    text-decoration: underline;
}
.breadcrumb span {
    color: var(--text-primary);
}

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

.clickable-row {
    transition: background 0.08s ease-in, background 0.15s ease-out;
}
.clickable-row:hover {
    background: var(--bg-muted);
}
.clickable-row.row-focused {
    background: var(--bg-muted);
    box-shadow: inset 3px 0 0 var(--accent);
}

.ctx-menu {
    position: absolute;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    min-width: 160px;
    z-index: 200;
    padding: var(--space-sm) 0;
    font-size: var(--text-base);
}
.ctx-item {
    display: block;
    width: 100%;
    padding: var(--space-md) var(--space-xl);
    font-size: var(--text-base);
    color: var(--text-secondary);
    text-decoration: none;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.1s;
}
.ctx-item:hover {
    background: var(--bg-muted);
    color: var(--text-primary);
    text-decoration: none;
}
.ctx-danger {
    color: var(--danger);
}
.ctx-danger:hover {
    background: var(--danger-bg);
    color: var(--danger);
}
td.col-primary, .col-primary {
    font-weight: 600;
    color: var(--text-primary);
}

.row-meta {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-top: 0.1rem;
}

.table-clean {
    width: 100%;
    border-collapse: collapse;
}
.table-clean td {
    padding: var(--space-lg) var(--space-xl);
    border-bottom: none;
    vertical-align: middle;
}
.table-clean td a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
}
.table-clean td a:hover {
    color: var(--accent);
    text-decoration: none;
}
.group-header td {
    background: var(--bg-muted);
    font-weight: 600;
    font-size: var(--text-base);
    color: var(--text-secondary);
    padding: var(--space-md) var(--space-xl);
    border-bottom: none;
}
.group-header { cursor: pointer; user-select: none; }
.group-toggle { display: inline-block; width: 1em; text-align: center; opacity: 0.6; }
.group-count {
    font-weight: 400;
    color: var(--text-muted);
    margin-left: 0.5rem;
}

/* Actions row */
.actions { margin-bottom: 1.25rem; }

/* Forms — system */
.form-card {
    max-width: var(--form-width, 640px);
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}
.form-card--narrow { --form-width: 480px; }
.form-card--wide { --form-width: 760px; }

.form-field {
    margin-bottom: 1rem;
}
.form-group { margin-bottom: 1rem; }

.form-label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 500;
    font-size: var(--text-base);
    color: var(--text-primary);
}
.form-label .required { color: var(--danger); margin-left: 0.15rem; }

label {
    display: block;
    margin-top: 1rem;
    margin-bottom: 0.3rem;
    font-weight: 500;
    font-size: var(--text-md);
    color: var(--text-primary);
}

.form-input, input[type="text"], input[type="password"], input[type="number"], input[type="date"], input[type="email"], input[type="url"], input[type="tel"], input[type="datetime-local"], select, textarea {
    width: 100%;
    padding: var(--space-lg) var(--space-xl);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: var(--text-md);
    transition: border-color 0.15s, box-shadow 0.15s;
    background: var(--bg-card);
    color: var(--text-primary);
}
.form-input:focus, input[type="text"]:focus, input[type="password"]:focus, input[type="number"]:focus, input[type="date"]:focus, input[type="email"]:focus, input[type="url"]:focus, input[type="tel"]:focus, input[type="datetime-local"]:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px rgba(80, 80, 80, 0.25);
}
textarea { resize: vertical; min-height: 80px; }

/* Form rows — grid layouts */
.form-row { display: grid; gap: 1rem; margin-bottom: 1rem; }
.form-row--2col { grid-template-columns: 1fr 1fr; }
.form-row--3col { grid-template-columns: 1fr 1fr 1fr; }
.form-row .form-field { margin-bottom: 0; }
.form-row .form-group { margin-bottom: 0; }

/* Form footer — actions */
.form-footer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

/* Form contextual elements */
.form-hint { font-size: var(--text-xs); color: var(--text-muted); margin-top: 0.2rem; line-height: 1.3; }
.hint { font-size: var(--text-xs); color: var(--text-muted); margin-top: 0.2rem; }
.form-info {
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: var(--space-xl) 1rem;
    margin-bottom: 1.25rem;
    font-size: var(--text-base);
    color: var(--text-secondary);
    line-height: 1.45;
}
.form-info a { color: var(--text-primary); font-weight: 500; }
.form-error { background: var(--danger-bg); border: 1px solid var(--danger); color: var(--danger); padding: var(--space-lg) var(--space-xl); border-radius: var(--radius-sm); margin-bottom: 1rem; font-size: var(--text-base); }
.form-field-error { font-size: var(--text-xs); color: var(--danger); margin-top: 0.2rem; }
.form-divider { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

.error { color: var(--danger); margin-bottom: 1rem; text-align: center; font-size: var(--text-md); }
.optional { font-weight: 400; color: var(--text-muted); font-size: var(--text-sm); }

/* Perceived performance — submit states */
.form-footer .btn[disabled],
.form-card button[type="submit"][disabled] {
    opacity: 0.55;
    pointer-events: none;
    cursor: not-allowed;
}
@keyframes btn-pulse {
    0%, 100% { opacity: 0.55; }
    50% { opacity: 0.75; }
}
.btn--loading {
    animation: btn-pulse 1.2s ease-in-out infinite;
    pointer-events: none;
}

/* Legacy compat */
.form-container {
    max-width: 640px;
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

/* Responsive forms */
@media (max-width: 640px) {
    .form-row--2col, .form-row--3col { grid-template-columns: 1fr; }
    .form-card, .form-container { padding: 1.25rem; }
    .form-footer { flex-direction: column; align-items: stretch; }
    .form-footer .btn { width: 100%; }
    .form-footer .btn-ghost { text-align: center; }
}

/* Candidate search */
#candidate_results {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    max-height: 200px;
    overflow-y: auto;
    margin-top: 0.25rem;
}
#candidate_results:empty { border: none; }
.candidate-item {
    padding: var(--space-lg) var(--space-xl);
    cursor: pointer;
    border-bottom: none;
    transition: background 0.1s;
}
.candidate-item:hover { background: var(--accent-light); }
.selected-hint { color: var(--accent); font-size: var(--text-md); margin-top: 0.4rem; font-weight: 500; }

/* Toggle group */
.toggle-group {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    padding: var(--space-xl) 0;
    border-bottom: 1px solid var(--border);
}
.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    font-size: var(--text-md);
    font-weight: 500;
    color: var(--text-secondary);
}
.toggle-label input:checked + span { color: var(--accent); }

/* Checkbox label */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    cursor: pointer;
    font-size: var(--text-md);
    margin-top: 1rem;
}
.checkbox-label input[type="checkbox"] {
    appearance: none; -webkit-appearance: none;
    width: 15px; height: 15px; margin-top: 0.15rem;
    border: 1.5px solid var(--text-muted);
    border-radius: 3px;
    background: transparent;
    cursor: pointer;
    position: relative;
    transition: background 0.1s, border-color 0.1s;
}
.checkbox-label input[type="checkbox"]:checked {
    background: var(--accent);
    border-color: var(--accent);
}
.checkbox-label input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 4px; top: 1px;
    width: 4px; height: 8px;
    border: solid var(--bg-card);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Interview form */
.interview-container {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.candidate-card {
    background: var(--bg-muted);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--accent);
    border-radius: var(--radius-sm);
}
.candidate-card h2 { margin-bottom: 0.5rem; font-size: 1.1rem; }
.candidate-card p { font-size: var(--text-md); margin-bottom: 0.3rem; color: var(--text-secondary); }

.question-block {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--bg-muted);
}
.question-block:last-of-type { border-bottom: none; }
.question-block .example { font-style: italic; color: var(--text-muted); font-size: var(--text-base); margin-bottom: 0.75rem; }
.interviewer-guide { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 0.5rem; line-height: 1.5; padding: 0.4rem 0.6rem; background: var(--bg-muted); border-radius: 4px; }
.interviewer-guide strong { color: var(--text-primary); font-size: 0.78rem; }

/* Rating group */
.rating-group { display: flex; gap: 0.6rem; margin-bottom: 0.3rem; flex-wrap: wrap; }
.rating-label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
    padding: var(--space-md) var(--space-xl);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: var(--text-md);
    transition: all 0.15s;
}
.rating-label:hover { border-color: var(--text-primary); }
.rating-label:has(input:checked) { background: var(--text-primary); color: var(--bg-card); border-color: var(--text-primary); }
.rating-label input { display: none; }
.anchor-hint { font-size: var(--text-xs); color: var(--text-muted); margin-top: 0.2rem; }

/* Select group */
.select-group { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 0.5rem; }
.select-label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    cursor: pointer;
    font-size: var(--text-md);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-sm);
    transition: background 0.1s;
}
.select-label:hover { background: var(--bg-muted); }
.select-label input {
    appearance: none; -webkit-appearance: none;
    width: 15px; height: 15px; margin-top: 0.2rem;
    border: 1.5px solid var(--text-muted);
    border-radius: 3px;
    background: transparent;
    cursor: pointer;
    position: relative;
    transition: background 0.1s, border-color 0.1s;
}
.select-label input:checked {
    background: var(--accent);
    border-color: var(--accent);
}
.select-label input:checked::after {
    content: '';
    position: absolute;
    left: 4px; top: 1px;
    width: 4px; height: 8px;
    border: solid var(--bg-card);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.select-label:has(input:checked) { background: var(--bg-muted); font-weight: 500; }

/* Consent block */
.consent-block {
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    border-radius: var(--radius-sm);
}
.consent-block ul { margin: 0.5rem 0 0 1.2rem; font-size: var(--text-base); line-height: 1.7; color: var(--text-secondary); }

/* Template badge */
.template-badge {
    font-size: var(--text-sm);
    color: var(--accent);
    background: var(--accent-light);
    display: inline-block;
    padding: var(--space-sm) var(--space-xl);
    border-radius: 20px;
    margin-bottom: 1rem;
    font-weight: 500;
}

/* Dashboard */
.dash-grid { display: flex; flex-direction: column; gap: 1.25rem; }
.dash-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.dash-stat {
    flex: 1;
    min-width: 120px;
    text-align: center;
    padding: 1rem 0.75rem;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.dash-stat-value { display: block; font-size: 1.75rem; font-weight: 700; color: var(--text-primary); }
.dash-stat-label { display: block; font-size: var(--text-xs); color: var(--text-muted); margin-top: 0.2rem; }

.dash-quick-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.dash-quick-actions a {
    font-size: var(--text-sm);
    color: var(--text-muted);
    text-decoration: none;
    padding: var(--space-sm) var(--space-lg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: background 0.1s, color 0.1s;
}
.dash-quick-actions a:hover { background: var(--bg-muted); color: var(--text-primary); }

.dash-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }

.dash-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}
.dash-section-header .detail-section-label { margin-bottom: 0; }

.dash-list { display: flex; flex-direction: column; gap: 0.125rem; }
.dash-list-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.6rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: background 0.1s;
}
.dash-list-item:hover { background: var(--bg-muted); }
.dash-list-content { flex: 1; min-width: 0; }
.dash-list-content .col-primary {
    font-size: var(--text-base);
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dash-list-content .row-meta {
    font-size: var(--text-xs);
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 0.1rem;
}
.dash-list-date { font-size: var(--text-xs); color: var(--text-muted); flex-shrink: 0; white-space: nowrap; }

.cell-avatar--sm { width: 24px; height: 24px; font-size: 0.55rem; line-height: 24px; }

.dash-widget-link { font-size: var(--text-sm); color: var(--text-muted); text-decoration: none; }
.dash-widget-link:hover { color: var(--text-primary); }

/* Attention items */
.dash-attention { display: flex; flex-direction: column; gap: 0.3rem; }
.dash-attention-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: var(--text-base);
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.1s;
}
.dash-attention-item:hover { background: var(--bg-muted); }
.dash-attention-icon { font-size: var(--text-md); color: var(--warning); flex-shrink: 0; }
.dash-attention-item--muted .dash-attention-icon { color: var(--text-muted); }
.dash-attention-item--muted .col-primary { color: var(--text-secondary); }


/* Peek panel */
#peek-panel {
    position: fixed;
    top: 0;
    right: -380px;
    width: 360px;
    height: 100vh;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    box-shadow: -4px 0 12px rgba(0,0,0,0.05);
    z-index: 100;
    transition: right 0.2s ease;
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    overflow-y: auto;
}
#peek-panel.peek-open { right: 0; }
.peek-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.peek-header h3 { font-size: var(--text-lg); font-weight: 600; margin: 0; }
.peek-close { background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 1.1rem; padding: var(--space-sm); }
.peek-close:hover { color: var(--text-primary); }
.peek-summary { font-size: var(--text-base); margin-bottom: 1.25rem; border-bottom: 1px solid var(--border); padding-bottom: 1rem; }
.peek-meta-row { display: flex; justify-content: space-between; padding: var(--space-sm) 0; }
.peek-meta-label { color: var(--text-muted); }
.peek-trail { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.75rem; flex: 1; }
.peek-trigger { width: 2.5rem; text-align: center; cursor: pointer; }
.peek-icon { font-size: var(--text-xs); color: var(--text-muted); transition: color 0.1s; display: inline-flex; align-items: center; gap: 0.25rem; }
.peek-trigger:hover .peek-icon { color: var(--text-primary); }

/* Detail page section cards */
.detail-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}
.detail-section-label {
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}
.detail-section-empty {
    font-size: var(--text-sm);
    color: var(--text-muted);
    padding: 0.5rem 0;
}
.detail-section-empty a {
    color: var(--text-secondary);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.detail-section-empty a:hover { color: var(--text-primary); }

/* Scorecard summary tables */
.score-totals {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}
.score-totals-item { display: flex; align-items: baseline; gap: 0.3rem; }
.score-totals-item strong { font-size: var(--text-lg); color: var(--text-primary); }
.score-table-wrap { margin-bottom: 1rem; }
.score-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}
.score-table th {
    text-align: left;
    font-weight: 500;
    color: var(--text-muted);
    padding: 0.3rem 0.6rem;
    border-bottom: 1px solid var(--border);
}
.score-table td {
    padding: 0.35rem 0.6rem;
    color: var(--text-primary);
}
.score-table td:first-child { font-weight: 500; min-width: 100px; }
.score-cell { text-align: center; font-variant-numeric: tabular-nums; }
.score-table th:not(:first-child) { text-align: center; }
.score-avg-row td {
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-style: italic;
}

/* Trail items (shared between peek + detail pages) */
.trail { margin-top: 2rem; }
.trail-title { font-size: var(--text-md); font-weight: 600; margin-bottom: 0.75rem; }
.trail-list { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.75rem; }
.trail-list--capped { max-height: 200px; overflow: hidden; position: relative; }
.trail-list--capped::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(transparent, var(--bg-card));
    pointer-events: none;
}
.trail-show-more { font-size: var(--text-xs); margin-top: 0.25rem; }
.trail-item { display: flex; gap: 0.6rem; font-size: var(--text-sm); padding: var(--space-sm) 0; align-items: baseline; }
.trail-item--activity { color: var(--text-muted); font-style: italic; }
.trail-item--comment { color: var(--text-primary); }
.trail-time { color: var(--text-muted); font-size: var(--text-xs); min-width: 4.5rem; flex-shrink: 0; }

@media (max-width: 768px) {
    #peek-panel { width: 100%; right: -100%; }
}

@media (max-width: 768px) {
    .dash-stats { flex-direction: column; }
    .dash-columns { grid-template-columns: 1fr; }
}

/* Advanced filter pills */
.filter-pills { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; margin-bottom: 0.75rem; }
.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: var(--space-sm) var(--space-lg);
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: 99px;
    font-size: var(--text-sm);
    color: var(--text-secondary);
}
.filter-pill button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: var(--text-md);
    color: var(--text-muted);
    padding: 0;
    line-height: 1;
}
.filter-pill button:hover { color: var(--text-primary); }
.filter-add-btn {
    padding: var(--space-md) var(--space-lg);
    font-size: var(--text-base);
    border-radius: var(--radius-sm);
    border: 1px dashed var(--border);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}
.filter-add-btn:hover { border-color: var(--border-focus); color: var(--text-primary); }
.filter-popover {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    z-index: 100;
    min-width: 200px;
}
.sync-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    z-index: 100;
    min-width: 200px;
}
.sync-menu select, .sync-menu input {
    font-size: var(--text-base);
    padding: var(--space-md) var(--space-lg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    width: 100%;
}
.sync-menu .btn {
    margin-top: 0.25rem;
    padding: var(--space-sm) var(--space-lg);
    font-size: var(--text-sm);
    width: 100%;
}
.sync-menu-label {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: var(--space-sm) var(--space-md) 0.1rem;
}
.sync-menu-item {
    padding: var(--space-md) var(--space-lg);
    font-size: var(--text-base);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.1s;
}
.sync-menu-item:hover {
    background: var(--bg-muted);
    color: var(--text-primary);
}
.sync-menu-item.active {
    background: var(--accent-light);
    color: var(--accent);
}
.filter-popover select, .filter-popover input {
    font-size: var(--text-base);
    padding: var(--space-sm) var(--space-lg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
}
.filter-popover button {
    padding: var(--space-sm) var(--space-lg);
    font-size: var(--text-base);
    border: none;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: #fff;
    cursor: pointer;
}

/* Custom views */
.view-pills { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.5rem; align-items: center; }
.view-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: var(--space-sm) var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 99px;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    cursor: pointer;
}
.view-pill:hover { border-color: var(--border-focus); }
.view-pill--active { border-color: var(--accent); color: var(--text-primary); }
.view-pill .view-del {
    background: none;
    border: none;
    cursor: pointer;
    font-size: var(--text-md);
    color: var(--text-muted);
    padding: 0;
    line-height: 1;
}
.view-pill .view-del:hover { color: var(--text-primary); }
.view-save-link {
    font-size: var(--text-sm);
    color: var(--text-muted);
    cursor: pointer;
    border: none;
    background: none;
    text-decoration: underline;
}
.view-save-link:hover { color: var(--text-primary); }

/* Keyboard shortcuts overlay */
.shortcuts-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 999;
    align-items: center;
    justify-content: center;
}
.shortcuts-overlay-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 1.5rem 2rem;
    min-width: 300px;
}
.shortcuts-overlay-card h3 { margin: 0 0 1rem; font-size: 1rem; }
.shortcuts-overlay-card table { width: 100%; }
.shortcuts-overlay-card td { padding: var(--space-md) var(--space-lg); font-size: var(--text-md); }
.shortcuts-overlay-card td:first-child { text-align: right; width: 40%; }
.shortcuts-overlay-card kbd {
    display: inline-block;
    padding: var(--space-xs) var(--space-md);
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: 3px;
    font-size: var(--text-sm);
    font-family: monospace;
}

/* Bulk selection */
.row-selected { background: color-mix(in srgb, var(--accent) 10%, var(--bg-card)); }
.bulk-bar {
    display: none;
    align-items: center;
    gap: 1rem;
    padding: var(--space-lg) var(--space-xl);
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    font-size: var(--text-md);
}
.bulk-delete-btn {
    padding: var(--space-sm) var(--space-xl);
    font-size: var(--text-base);
    border: none;
    border-radius: var(--radius-sm);
    background: var(--danger);
    color: #fff;
    cursor: pointer;
}
.bulk-delete-btn:hover { background: var(--danger); opacity: 0.85; }
.col-select { width: 2rem; text-align: center; padding: var(--space-md) !important; }
.col-select input[type="checkbox"] {
    appearance: none; -webkit-appearance: none;
    width: 15px; height: 15px; cursor: pointer;
    border: 1.5px solid var(--text-muted);
    border-radius: 3px;
    background: transparent;
    transition: background 0.1s, border-color 0.1s;
    position: relative;
    vertical-align: middle;
}
.col-select input[type="checkbox"]:checked {
    background: var(--accent);
    border-color: var(--accent);
}
.col-select input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 4px; top: 1px;
    width: 4px; height: 8px;
    border: solid var(--bg-card);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
tbody .col-select input[type="checkbox"] { opacity: 0; transition: opacity 0.15s; }
tr:hover .col-select input[type="checkbox"],
tr.row-selected .col-select input[type="checkbox"] { opacity: 1; }
.table-selecting { user-select: none; -webkit-user-select: none; }

/* Confirm dialog */
.confirm-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    animation: confirm-fade-in 0.1s ease;
}
.confirm-overlay.confirm-open { display: flex; }
@keyframes confirm-fade-in { from { opacity: 0; } to { opacity: 1; } }
.confirm-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    max-width: 380px;
    width: 90%;
    box-shadow: var(--shadow-md);
}
.confirm-message {
    color: var(--text-primary);
    font-size: var(--text-md);
    line-height: 1.5;
    margin-bottom: 1.25rem;
}
.confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}
.confirm-cancel {
    padding: var(--space-md) var(--space-xl);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: none;
    color: var(--text-secondary);
    font-size: var(--text-base);
    cursor: pointer;
    transition: background 0.1s, color 0.1s;
}
.confirm-cancel:hover { background: var(--bg-muted); color: var(--text-primary); }
.confirm-ok {
    padding: var(--space-md) var(--space-xl);
    border: 1px solid var(--text-primary);
    border-radius: var(--radius-sm);
    background: var(--text-primary);
    color: var(--bg-card);
    font-size: var(--text-base);
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.1s;
}
.confirm-ok:hover { opacity: 0.85; }
.confirm-ok.confirm-danger {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}
.confirm-ok.confirm-danger:hover { opacity: 0.85; }

/* Done page */
.done-container { text-align: center; padding: 4rem 2rem; background: var(--bg-card); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.done-container h1 { margin-bottom: 1rem; color: var(--accent); }

/* Detail grid */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-bottom: 1.5rem; }
.detail-section {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}
.detail-section p { font-size: var(--text-md); margin-bottom: 0.3rem; }
.detail-section.results { grid-column: 1 / -1; }

/* Detail page actions — 4 semantic clusters */
.detail-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.detail-actions-nav {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.detail-actions-nav a {
    font-size: var(--text-base);
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.15s;
}
.detail-actions-nav a:hover { color: var(--text-primary); }

.detail-actions-export {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-left: auto;
}
.detail-actions-export a,
.detail-actions-export button {
    font-size: var(--text-sm);
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    transition: color 0.15s, background 0.15s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
}
.detail-actions-export a:hover,
.detail-actions-export button:hover {
    color: var(--text-primary);
    background: var(--bg-muted);
}

.detail-actions-mutate {
    display: flex;
    gap: var(--space-md);
    align-items: center;
    margin-left: 1rem;
}
.detail-actions-mutate a,
.detail-actions-mutate button {
    font-size: var(--text-base);
    font-weight: 500;
    color: var(--text-primary);
    background: transparent;
    border: 1.5px solid var(--text-primary);
    border-radius: var(--radius-sm);
    padding: var(--space-md) var(--space-xl);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}
.detail-actions-mutate a:hover,
.detail-actions-mutate button:hover {
    background: var(--text-primary);
    color: var(--bg-card);
}

.detail-actions-destruct {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
    margin-left: 1rem;
}
.detail-actions-destruct button,
.detail-actions-destruct a {
    font-size: var(--text-base);
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    opacity: 0.5;
    transition: opacity 0.15s, color 0.15s, background 0.15s;
    text-decoration: none;
}
.detail-actions-destruct button:hover,
.detail-actions-destruct a:hover {
    opacity: 1;
    color: var(--danger);
    background: var(--danger-bg);
}

/* Scores */
.scores-row { display: flex; gap: 0.75rem; margin-bottom: 1rem; flex-wrap: wrap; }
.score-card {
    text-align: center;
    padding: var(--space-xl) 1rem;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    min-width: 80px;
    flex: 0 1 auto;
    border-top: 3px solid var(--accent);
    box-shadow: var(--shadow-sm);
}
.score-label { font-size: var(--text-xs); color: var(--text-muted); margin-bottom: 0.2rem; text-transform: uppercase; letter-spacing: 0.03em; }
.score-value { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); }

/* Interviewer results */
.interviewer-result {
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background: var(--bg-muted);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--accent);
}
.interviewer-result:last-child { margin-bottom: 0; }
.interviewer-result h3 { margin-bottom: 0.75rem; }
.detail-field { margin-top: 0.75rem; padding: var(--space-lg) 0; border-top: 1px solid var(--border); }
.detail-field-label { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); margin-bottom: 0.2rem; }
.detail-field-value { font-size: var(--text-md); color: var(--text-primary); line-height: 1.5; }

/* Note & summary blocks */
.note-block, .summary-block { margin-bottom: 1rem; }
.summary-block {
    background: var(--accent-light);
    padding: 1.25rem;
    border-radius: var(--radius-sm);
}
.summary-block h3 { color: var(--accent-hover); }
.summary-block p { line-height: 1.7; color: var(--text-primary); }
.no-summary { color: var(--text-muted); font-style: italic; }

.timestamp { font-size: var(--text-xs); color: var(--text-muted); margin-top: 0.5rem; }
hr { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

/* HTMX indicators */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: block; }
.htmx-request button[type="submit"] { opacity: 0.7; pointer-events: none; }

.sidebar-close {
    display: none;
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: var(--space-sm);
}
.sidebar-close:hover { color: var(--text-primary); }

/* Responsive */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); transition: transform 0.2s ease; }
    .sidebar.sidebar-open { transform: translateX(0); }
    .sidebar-close { display: block; }
    .main-content { margin-left: 0; padding: 1.25rem; }
    .hamburger { display: block; }
    .sidebar-collapse-btn { display: none; }
}
@media (max-width: 640px) {
    main { padding: 0 1rem; margin: 1rem auto; }
    .detail-grid { grid-template-columns: 1fr; }
    .scores-row { display: grid; grid-template-columns: 1fr 1fr; }
    .form-container { padding: 1.25rem; }
    .interview-container { padding: 1.25rem; }
    .rating-group { gap: 0.4rem; }
    .rating-label { padding: var(--space-md) var(--space-xl); font-size: var(--text-base); }
    .page-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
    .table-search { flex: none; width: 100%; }
    .table-controls { gap: 0.4rem; flex-wrap: wrap; }
    .detail-actions { flex-wrap: wrap; gap: 0.5rem; }
    .detail-actions-export { margin-left: 0; }
    .detail-actions-mutate { margin-left: 0; }
    .detail-actions-destruct { margin-left: auto; }

    /* List tables — hide lower-priority columns */
    .table-clean td:nth-child(n+4),
    .table-clean th:nth-child(n+4) { display: none; }
    .table-clean { display: table; width: 100%; }
    .sync-table-wrap { overflow-x: hidden; }

    /* Touch targets */
    .btn, .btn-ghost, .btn--ghost, .btn-danger, .btn--danger, .btn-icon, .btn--icon, .bulk-bar-btn, .undo-btn, button, .archive-pill { min-height: 2.25rem; }
    .inline-select { min-height: 2rem; font-size: var(--text-md); }
    .peek-trigger { width: 3rem; min-height: 2.5rem; display: flex; align-items: center; justify-content: center; }
    .ctx-item { padding: var(--space-lg) 1rem; min-height: 2.5rem; }

    /* Breadcrumb compact */
    .breadcrumb { font-size: var(--text-xs); }
    .breadcrumb a { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: bottom; }

    /* Trail compact */
    .trail-item { font-size: var(--text-sm); }
    .trail-time { min-width: 3.5rem; font-size: var(--text-xs); }

    /* Candidate card on detail */
    .candidate-card { padding: 1rem; }
    .candidate-card p { font-size: var(--text-base); }

    /* Dashboard widget */
    .dash-stat { min-width: 0; }
    .dash-stat-value { font-size: 1.4rem; }

    /* Settings shell stacks on mobile */
    .settings-shell { grid-template-columns: 1fr; gap: 1rem; }
    .settings-nav { flex-direction: row; flex-wrap: wrap; gap: 0.25rem; }

    /* Score tables scroll horizontally */
    .score-table-wrap { overflow-x: auto; }
    .score-table { min-width: 320px; }
    .score-totals { flex-wrap: wrap; gap: 0.75rem; }

    /* Quick actions wrap */
    .dash-quick-actions { gap: 0.4rem; }
}

/* Toast notifications */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse;
    gap: 0.5rem;
    pointer-events: none;
}
.toast {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-sm);
    padding: var(--space-lg) var(--space-xl);
    font-size: var(--text-base);
    max-width: 280px;
    box-shadow: var(--shadow-md);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.12s ease, transform 0.12s ease;
    pointer-events: auto;
}
.toast-success { border-left-color: var(--success); }
.toast-error { border-left-color: var(--danger); }
.toast-warning { border-left-color: var(--warning); }
.toast.show {
    opacity: 1;
    transform: translateY(0);
}
.toast.hide {
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

/* Search highlight */
mark.search-hl {
    background: none;
    color: var(--accent);
    font-weight: 600;
}

/* Table count */
.table-count {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-left: auto;
    align-self: center;
}
.sync-table-wrap .table-count {
    display: block;
    margin-left: 0;
    padding: var(--space-lg) var(--space-xl);
    text-align: right;
}

/* Active sort indicator */
.table-filter.sort-active {
    color: var(--accent);
    border-color: var(--accent);
    font-weight: 600;
}

/* Archive toggle pill */
.archive-pill {
    font-size: var(--text-sm);
    color: var(--text-muted);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: var(--space-sm) var(--space-lg);
    cursor: pointer;
    white-space: nowrap;
    transition: background 150ms, color 150ms, border-color 150ms;
}
.archive-pill:hover {
    color: var(--text-primary);
    border-color: var(--text-muted);
}
.archive-pill--active {
    background: var(--bg-muted);
    color: var(--text-primary);
    border-color: var(--text-muted);
}
.archive-pill--active:hover {
    opacity: 0.85;
}

/* Row reveal transition */
.row-reveal {
    animation: rowFadeIn 150ms ease-out;
}
@keyframes rowFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Filter empty state */
.filter-empty-row td {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: var(--text-md);
}
.filter-clear-btn {
    margin-left: 0.5rem;
    font-size: var(--text-base);
    color: var(--accent);
    cursor: pointer;
}

/* Report result */
.report-result { position: relative; }
.report-result .detail-section-label { margin-bottom: 0.5rem; }
.report-result iframe { display: block; }

/* Report history peek panel */
.report-peek {
    position: fixed;
    top: 0;
    right: 0;
    width: 420px;
    max-width: 90vw;
    height: 100vh;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    box-shadow: -4px 0 24px rgba(0,0,0,0.2);
    z-index: 200;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.2s ease;
}
.report-peek.peek-open { transform: translateX(0); }
.report-peek-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.report-peek-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 1.25rem;
}

/* Report progress bar */
.report-progress { padding: 1.5rem 0; }
.report-progress-bar {
    width: 100%;
    height: 4px;
    background: var(--bg-muted);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}
.report-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.3s ease-out;
}
.report-progress-label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

@keyframes skeleton-pulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 0.6; } }
.skeleton-row td { padding: 0.6rem 1rem; vertical-align: middle; }
.sk-line { height: 0.7rem; border-radius: 4px; background: var(--bg-muted); animation: skeleton-pulse 1.2s ease-in-out infinite; }
.sk-sub { margin-top: 0.35rem; height: 0.55rem; opacity: 0.6; }
