/* ─────────────────────────────────────────────────────────────────────────
   Backup-Master · dark theme natif · palette Siweb #005DEC
   ──────────────────────────────────────────────────────────────────────── */

:root {
    /* Marque */
    --brand:        #005DEC;
    --brand-hover:  #1a6ff4;
    --brand-active: #004DC3;
    --brand-soft:   rgba(0, 93, 236, 0.18);
    --brand-light:  #4f8eff;

    /* Fonds */
    --bg-base:     #0b0f1a;
    --bg-surface:  #111929;
    --bg-elevated: #1c2640;
    --bg-input:    #0d1525;

    /* Borders */
    --border-subtle:  rgba(255, 255, 255, 0.06);
    --border-default: rgba(255, 255, 255, 0.11);

    /* Texte */
    --ink:   #f1f5f9;
    --ink-2: #001D49;
    --ink-3: #e2e8f0;
    --text-body:        #c8d3e0;
    --text-label:       #8895a9;
    --text-muted:       #7a8fa8;    /* bumped #5d7089→#7a8fa8 pour WCAG AA (5.26:1 sur bg-surface) */
    --text-dimmed:      #3a4f6a;
    --text-placeholder: #4a5e7a;
    --text-timestamp:   #4a5e7a;

    /* Surfaces (alias sémantiques) */
    --surface:    #1c2640;
    --gray-50:    #1a2236;
    --gray-200:   rgba(255, 255, 255, 0.09);

    /* Orange accent */
    --orange:       #F8593B;
    --orange-hover: #E63C1C;

    /* Typographie */
    --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;

    /* États sémantiques */
    --success:      #16a34a;
    --warning:      #d97706;
    --danger:       #dc2626;
    --danger-hover: #b91c1c;

    /* Terminal */
    --log-err:  #fca5a5;
    --log-warn: #fcd34d;
    --log-dry:  #a5b4fc;
    --log-info: #e2e8f0;

    /* Annulation */
    --cancel-bg: #fbbf24;

    /* Soft states */
    --success-soft:   rgba(22, 163, 74, 0.15);
    --success-text:   #4ade80;
    --danger-soft:    rgba(220, 38, 38, 0.15);
    --danger-text:    #fca5a5;
    --info-soft:      rgba(79, 142, 255, 0.12);
    --info-border:    rgba(79, 142, 255, 0.28);
    --info-text:      #60a5fa;
    --info-accent:    #38bdf8;
    --sky-soft:       rgba(56, 189, 248, 0.10);
    --sky-border:     rgba(56, 189, 248, 0.25);

    /* Modal */
    --modal-width:  720px;
    --modal-height: min(82vh, 680px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--brand-light); outline-offset: 2px; }

/* ── Scrollbar dark ── */
::-webkit-scrollbar              { width: 6px; height: 6px; }
::-webkit-scrollbar-track        { background: var(--bg-elevated); }
::-webkit-scrollbar-thumb        { background: rgba(255,255,255,0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover  { background: rgba(255,255,255,0.28); }
*                                { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.15) var(--bg-elevated); }

body {
    font-family: var(--font-sans);
    background: var(--bg-base);
    color: var(--text-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

@keyframes shimmer { 0% { background-position: 200% 0 } 100% { background-position: -200% 0 } }
@keyframes pulse   { 0%, 100% { opacity: 1 } 50% { opacity: .35 } }
@keyframes spin    { to { transform: rotate(360deg) } }

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

.wrap {
    max-width: 960px;
    margin: 0 auto;
    padding: 28px 24px 60px;
}
@media (min-width: 1280px) { .wrap { max-width: 1200px; } }
@media (min-width: 1536px) { .wrap { max-width: 1480px; } }

.main-area { flex: 1; min-width: 0; }
@media (min-width: 1024px) { .main-area { margin-left: 220px; } }
@media (max-width: 1023px) {
    .main-area { margin-left: 0 !important; padding-bottom: 62px; }
    .wrap { padding: 16px 14px 20px; }
    .page-title { font-size: 18px; }
    .page-header { flex-wrap: wrap; gap: 8px; }
}

/* ── Sidebar ── */
.sidebar {
    width: 220px;
    flex-shrink: 0;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    background: var(--bg-base);
    border-right: 1px solid var(--border-subtle);
    overflow-y: auto;
    z-index: 40;
    flex-direction: column;
}

.sidebar-logo {
    padding: 18px 20px 14px;
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
    border-bottom: 1px solid var(--border-subtle);
}
.sidebar-logo-img {
    height: 28px;
    display: block;
    margin-bottom: 10px;
    filter: brightness(0) invert(1);
}
.sidebar-logo small {
    display: block;
    font-weight: 400;
    font-family: monospace;
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
}

.sidebar-nav { padding: 6px 0; flex: 1; }

.sidebar-tab {
    display: block;
    width: 100%;
    text-align: left;
    padding: 9px 20px;
    border: none;
    background: none;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-label);
    cursor: pointer;
    transition: all .15s;
    border-left: 3px solid transparent;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-tab:hover  { background: rgba(255,255,255,0.04); color: var(--text-body); }
.sidebar-tab.active { color: var(--ink); background: var(--brand-soft); border-left-color: var(--brand); font-weight: 600; }

.sidebar-sep  { height: 1px; background: var(--border-subtle); margin: 6px 14px; }
.sidebar-foot { padding: 14px 16px; border-top: 1px solid var(--border-subtle); display: flex; flex-direction: column; align-items: center; }
.sidebar-user   { font-size: 12px; font-weight: 600; color: var(--text-body); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 6px; width: 100%; text-align: center; }
.sidebar-status { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-muted); }

/* ── Mobile header ── */
.mobile-header {
    display: flex;
    align-items: center;
    padding: 0 16px;
    height: 52px;
    background: var(--bg-base);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 50;
    gap: 12px;
    flex-shrink: 0;
}
@media (min-width: 1024px) { .mobile-header { display: none; } }

.mobile-header-logo   { font-size: 13px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.mobile-header-title  { flex: 1; font-size: 14px; font-weight: 600; color: var(--text-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.mobile-header-status { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-muted); white-space: nowrap; }

/* ── Bottom nav (mobile) ── */
.bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    display: flex;
    background: var(--bg-base);
    border-top: 1px solid var(--border-subtle);
    z-index: 50;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (min-width: 1024px) { .bottom-nav { display: none; } }

.bottom-nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px 4px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    transition: color .15s;
    min-height: 54px;
    border-top: 2px solid transparent;
}
.bottom-nav-btn.active { color: var(--brand-light); border-top-color: var(--brand); font-weight: 700; }

.sidebar.hidden { display: none; }
@media (min-width: 1024px) { .sidebar.lg\:flex { display: flex; } }

/* ── Dot SSE ── */
.dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dot.on  { background: var(--success); }
.dot.off { background: var(--danger); }

/* ── Auth screen ── */
.auth-screen {
    position: fixed;
    inset: 0;
    background: var(--bg-base);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--text-muted);
}
.auth-link { color: var(--brand-light); margin-left: 6px; }

/* ── Page header ── */
.page-header         { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.page-header-content { flex: 1; min-width: 0; }
.page-title          { font-size: 22px; font-weight: 700; color: var(--ink); }
.page-subtitle       { font-size: 13px; color: var(--text-label); margin-top: 2px; }

/* ── Disk widget ── */
.disk-widget           { margin-top: 8px; width: 100%; }
.disk-widget-row       { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 3px; }
.disk-widget-free      { font-size: 11px; font-weight: 600; color: var(--text-body); }
.disk-widget-pct       { font-size: 10px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.disk-widget-track     { height: 4px; background: rgba(255,255,255,0.09); border-radius: 2px; overflow: hidden; }
.disk-widget-fill      { height: 100%; border-radius: 2px; transform: scaleX(var(--disk-scale, 0)); transform-origin: left; transition: transform .6s ease-out; }
.disk-widget-fill--ok  { background: var(--success); }
.disk-widget-fill--warn   { background: var(--warning); }
.disk-widget-fill--danger { background: var(--danger); }
.disk-widget-label     { font-size: 10px; color: var(--text-muted); margin-top: 3px; }

/* ── Modal title variant ── */
.modal-title--danger { color: var(--danger); }

/* ── Search bar ── */
.search-wrap { position: relative; flex: 1; }
.search-wrap .icon {
    position: absolute;
    left: 12px; top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 15px;
    pointer-events: none;
}
.search-wrap input {
    width: 100%;
    padding: 10px 36px;
    border: 1px solid var(--border-default);
    border-radius: 8px;
    font-size: 14px;
    color: var(--ink);
    background: var(--bg-input);
    outline: none;
    transition: border-color .15s;
}
.search-wrap input:focus { border-color: var(--brand-light); }
.search-wrap .clear {
    position: absolute;
    right: 10px; top: 50%;
    transform: translateY(-50%);
    background: var(--bg-elevated);
    border: none;
    border-radius: 50%;
    width: 20px; height: 20px;
    cursor: pointer;
    font-size: 11px;
    color: var(--text-label);
}

/* ── Badges ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    line-height: 1.4;
    white-space: nowrap;
}
.badge.sm { font-size: 10px; padding: 1px 6px; }

.badge-done       { color: var(--success-text); background: var(--success-soft); }
.badge-running    { color: var(--info-text);    background: var(--info-soft); }
.badge-pending    { color: var(--text-muted);   background: rgba(255,255,255,0.05); }
.badge-failed     { color: var(--danger-text);  background: var(--danger-soft); }
.badge-cancelled  { color: var(--text-dimmed);  background: rgba(255,255,255,0.04); }
.badge-ok         { color: var(--success-text); background: var(--success-soft); }
.badge-warn       { color: var(--warning);      background: rgba(217,119,6,0.15); }
.badge-missing    { color: var(--warning);      background: rgba(217,119,6,0.15); }
.badge-no_restore { color: var(--text-muted);   background: rgba(255,255,255,0.05); }
.badge-ok_lr_warn { color: var(--warning);      background: rgba(217,119,6,0.15); }

/* ── Progress bar ── */
.bar-track {
    flex: 1;
    height: 4px;
    background: rgba(255,255,255,0.10);
    border-radius: 4px;
    overflow: hidden;
}
.bar-fill {
    width: 100%;
    height: 100%;
    border-radius: 4px;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .4s ease-out;
}
.bar-fill.running   { background: var(--brand-light); background-image: linear-gradient(90deg, transparent, rgba(255,255,255,.3), transparent); background-size: 200% 100%; animation: shimmer 1.5s infinite; }
.bar-fill.done      { background: var(--success); }
.bar-fill.failed    { background: var(--danger); }
.bar-fill.cancelled { background: var(--text-muted); }

/* ── Boutons ── */
.btn { padding: 7px 16px; border-radius: 6px; border: none; cursor: pointer; font-size: 13px; font-weight: 600; transition: background .15s; }
.btn-ghost          { background: rgba(255,255,255,0.07); color: var(--text-body); }
.btn-ghost:hover    { background: rgba(255,255,255,0.12); }
.btn-primary        { background: var(--brand); color: #fff; }
.btn-primary:hover  { background: var(--brand-hover); }
.btn-primary:active { background: var(--brand-active); }
.btn-primary:disabled { background: var(--bg-elevated); color: var(--text-dimmed); cursor: default; }
.btn-danger         { background: var(--danger); color: #fff; }
.btn-danger:hover   { background: var(--danger-hover); }

.cancel-btn {
    background: none;
    border: 1px solid var(--cancel-bg);
    border-radius: 4px;
    color: var(--warning);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    cursor: pointer;
    transition: all .15s;
}
.cancel-btn:hover { background: rgba(251,191,36,0.10); border-color: var(--warning); }

/* ── Modal ── */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}
.modal {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: 12px;
    padding: 24px;
    width: 380px;
    box-shadow: 0 24px 80px rgba(0,0,0,.55);
}
.modal-wide { width: 780px; max-width: 92vw; }
.modal-job  { width: var(--modal-width); max-width: 96vw; height: var(--modal-height); display: flex; flex-direction: column; }
@media (max-width: 767px) {
    .overlay { align-items: flex-end; }
    .modal { width: 100% !important; max-width: 100% !important; max-height: 92vh; overflow-y: auto; border-radius: 16px 16px 0 0; padding: 20px 16px; }
    .modal-wide { width: 100%; max-width: 100%; }
}
.modal-title { font-size: 15px; font-weight: 700; margin-bottom: 16px; color: var(--ink); }
.modal label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-label);
    margin-bottom: 4px;
    margin-top: 14px;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.modal label:first-of-type { margin-top: 0; }
.modal-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-default);
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    color: var(--ink);
    background: var(--bg-input);
}
.modal-input:focus { border-color: var(--brand-light); background: var(--bg-elevated); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.confirm-msg   { font-size: 14px; color: var(--text-body); line-height: 1.5; margin-top: 4px; }
.alert-danger      { padding: 10px 12px; background: var(--danger-soft); border: 1px solid var(--log-err); border-radius: 6px; color: var(--danger-text); font-size: 13px; margin-bottom: 10px; }
.alert-danger--top { margin-top: 14px; }
.error-title   { color: var(--danger-text); margin-bottom: 8px; font-weight: 600; font-size: 14px; }
.error-box     { color: var(--danger-text); font-size: 13px; padding: 12px; background: var(--danger-soft); border-radius: 6px; }

/* ── Modal tabs ── */
.modal-tabs                   { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--border-subtle); }
.modal-tab                    { padding: 8px 14px; border: none; background: none; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-label); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s, border-color .15s; }
.modal-tab.active             { color: var(--brand-light); border-bottom-color: var(--brand); }
.modal-tab:hover:not(.active) { color: var(--text-body); }

/* ── Modal info blocks ── */
.modal-info-note    { padding: 10px 12px; margin-bottom: 14px; background: var(--bg-elevated); border: 1px solid var(--border-subtle); border-radius: 6px; font-size: 12px; color: var(--text-label); }
.modal-depot-banner { margin-top: 10px; padding: 7px 11px; background: var(--sky-soft); border: 1px solid var(--sky-border); border-radius: 6px; font-size: 12px; color: var(--info-accent); }
.modal-info-block   { margin-top: 10px; padding: 10px 14px; background: var(--info-soft); border: 1px solid var(--info-border); border-radius: 6px; }
.modal-info-heading { font-weight: 700; color: var(--info-text); font-size: 13px; margin-bottom: 6px; }
.modal-info-list    { color: var(--text-body); line-height: 1.7; word-break: break-all; max-height: 68px; overflow-y: auto; }
.modal-info-note-sm { margin-top: 6px; }

/* ── Modal label + InfoTip row ── */
.modal-label-row       { display: flex; align-items: center; gap: 4px; margin-top: 12px; margin-bottom: 4px; }
.modal-label-row label { margin: 0; }

/* ── Modal checkbox options ── */
.modal-options-row        { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 16px; }
.modal-check-label        { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; font-weight: 500; color: var(--text-body); cursor: pointer; }
.modal-check-label--safe  { font-weight: 600; color: var(--success-text); }
.modal-check-label--live  { font-weight: 600; color: var(--danger-text); }

/* ── ClientFormModal ── */
.modal-note-italic  { font-size: 11.5px; color: var(--text-label); font-style: italic; margin-bottom: 4px; }
.modal-field-row    { display: flex; gap: 12px; }
.modal-field--wide  { flex: 2; min-width: 0; }
.modal-field--narrow { flex: 1; min-width: 0; }

/* ── BackupRelaunchModal ── */
.modal-configure-btn       { margin-top: 10px; padding: 6px 12px; border: 1px solid var(--brand); background: var(--bg-elevated); color: var(--brand-light); border-radius: 4px; font-size: 12px; font-weight: 600; cursor: pointer; transition: background .15s; display: inline-block; }
.modal-configure-btn:hover { background: var(--brand-soft); }

/* ── JobLiveModal ── */
.modal-title--tight       { margin-bottom: 4px; }
.job-header               { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.job-progress-row         { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.job-progress-pct         { width: 50px; text-align: right; font-size: 13px; font-weight: 600; color: var(--text-body); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.job-terminal             { flex: 1; min-height: 0; overflow: auto; background: var(--ink-2); color: var(--log-info); font-family: var(--font-mono); font-size: 11.5px; line-height: 1.45; padding: 10px; border-radius: 6px; margin-bottom: 14px; }
.job-terminal-placeholder { color: var(--text-placeholder); font-style: italic; }
.log-line                 { color: var(--log-info); white-space: pre-wrap; word-break: break-all; }
.log-line--err            { color: var(--log-err); }
.log-line--warn           { color: var(--log-warn); }
.log-line--dry            { color: var(--log-dry); }
.job-footer               { display: flex; justify-content: space-between; align-items: center; }
.job-footer-actions       { display: flex; gap: 8px; }

/* ── Disconnect overlay ── */
.disconnect-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0,0,0,0.70);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}
.disconnect-card    { background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: 12px; padding: 32px 40px; text-align: center; box-shadow: 0 16px 48px rgba(0,0,0,.55); max-width: 360px; }
.disconnect-spinner { width: 36px; height: 36px; border: 3px solid var(--border-default); border-top-color: var(--brand); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 18px; }
.disconnect-title   { font-size: 16px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.disconnect-sub     { font-size: 13px; color: var(--text-label); }

/* ── LogViewer ── */
.logviewer-bar               { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; padding: 10px 12px; background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: 6px; }
.logviewer-search            { flex: 1 1 240px; min-width: 180px; padding: 6px 10px; border: 1px solid var(--border-default); border-radius: 4px; font-size: 13px; color: var(--ink); background: var(--bg-input); outline: none; transition: border-color .15s; }
.logviewer-search:focus      { border-color: var(--brand-light); }
.logviewer-levels            { display: flex; gap: 4px; }
.logviewer-btn               { padding: 4px 10px; font-size: 12px; border: 1px solid var(--border-default); background: none; border-radius: 4px; cursor: pointer; font-weight: 600; color: var(--text-label); transition: color .1s, border-color .1s; }
.logviewer-btn.active        { color: var(--brand-light); border-color: var(--brand); }
.logviewer-btn:hover:not(.active) { color: var(--text-body); }
.logviewer-export            { margin-left: auto; }
.logviewer-terminal          { background: var(--ink-2); color: var(--log-info); font-family: var(--font-mono); font-size: 11.5px; line-height: 1.5; padding: 14px; border-radius: 6px; max-height: 70vh; overflow: auto; }
.log-ts                      { color: var(--text-timestamp); }
.log-lvl                     { font-weight: 600; }

/* ── LogsPage ── */
.logs-header        { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.logs-day-row       { display: flex; align-items: center; gap: 8px; }
.select-sm          { padding: 6px 10px; font-size: 13px; }
.logs-mode-switcher { display: flex; gap: 4px; padding: 2px; background: var(--bg-elevated); border-radius: 6px; }
.logs-mode-btn      { padding: 6px 14px; border: none; border-radius: 4px; font-size: 13px; font-weight: 600; cursor: pointer; background: transparent; color: var(--text-label); transition: background .1s, color .1s; }
.logs-mode-btn.active { background: var(--bg-surface); color: var(--brand-light); box-shadow: 0 1px 2px rgba(0,0,0,0.15); }
.logs-file-row      { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.logs-file-select   { padding: 6px 10px; font-size: 13px; font-family: var(--font-mono); flex: 1; max-width: 600px; }

/* ── Score donut ── */
.score-donut {
    --donut-size: 80px;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: var(--donut-size);
    height: var(--donut-size);
}
.score-donut-svg {
    display: block;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}
.score-donut-track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 8;
}
.score-donut-arc {
    fill: none;
    stroke-width: 8;
    stroke-linecap: butt;
    stroke-dasharray: 226.2;
    stroke-dashoffset: var(--score-offset, 226.2);
    transition: stroke-dashoffset .6s ease-out;
}
.score-donut-arc.score-good { stroke: var(--success); }
.score-donut-arc.score-mid  { stroke: var(--warning); }
.score-donut-arc.score-bad  { stroke: var(--danger); }
.score-donut-label {
    position: absolute;
    font-family: var(--font-sans);
    font-size: calc(var(--donut-size) * 0.28);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--ink);
    line-height: 1;
    letter-spacing: -.02em;
    pointer-events: none;
}
.score-donut-label--check {
    font-size: calc(var(--donut-size) * 0.36);
    color: var(--success-text);
    letter-spacing: 0;
}
@media (max-width: 767px) { .score-donut { --donut-size: 56px; } }

/* ── Cards ── */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 16px;
    transition: border-color .15s;
    cursor: pointer;
}
.card:hover   { border-color: var(--brand-light); }
.card-title   { font-size: 15px; font-weight: 700; margin-bottom: 6px; color: var(--ink); }
.card-sub     { font-size: 12px; color: var(--text-label); }

.card-mini {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.card-mini:hover      { border-color: var(--brand-light); background: var(--brand-soft); }
.card-mini-icon       { width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #fff; }
.card-mini-body       { flex: 1; min-width: 0; }
.card-mini-title      { font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-mini-sub        { font-size: 11px; color: var(--text-label); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-mini-sub.danger { color: var(--danger-text); }

/* ── Tables ── */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 8px; border: 1px solid var(--border-subtle); }
.tbl-wrap .tbl { border: none; }
@media (max-width: 767px) { .col-hide-mobile { display: none; } }

.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
    text-align: left;
    padding: 8px 10px;
    background: var(--bg-elevated);
    color: var(--text-label);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 1px solid var(--border-default);
}
.tbl td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-body);
    vertical-align: middle;
    white-space: nowrap;
}
.tbl tbody tr:last-child td           { border-bottom: none; }
.tbl tbody tr.row-clickable           { cursor: pointer; transition: background-color 0.12s; }
.tbl tbody tr.row-clickable:hover     { background: rgba(255,255,255,0.03); }
.tbl-jobs                             { table-layout: fixed; }
.tbl-jobs th                          { padding: 10px 12px; white-space: nowrap; }
.tbl-jobs td                          { overflow: hidden; text-overflow: ellipsis; }
.tbl tr:hover td                      { background: rgba(255,255,255,0.03); }
.tbl-bg                               { background: var(--bg-surface); }

/* ── DbDetail extras ── */
.section-hint  { margin-bottom: 8px; font-size: 12px; color: var(--text-muted); font-style: italic; }
.th-tbl-pk     { width: 100px; }
.th-tbl-rows   { width: 90px; text-align: right; }
.error-item    { color: var(--danger-text); padding: 4px 0; }

/* ── JobsPage ── */
.jobs-bar              { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; padding: 10px 12px; background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: 6px; }
.jobs-search           { flex: 1 1 240px; min-width: 200px; padding: 6px 10px; border: 1px solid var(--border-default); border-radius: 4px; font-size: 13px; color: var(--ink); background: var(--bg-input); outline: none; transition: border-color .15s; }
.jobs-search:focus     { border-color: var(--brand-light); }
.jobs-select           { padding: 6px 10px; border: 1px solid var(--border-default); border-radius: 4px; font-size: 13px; color: var(--ink); background: var(--bg-input); outline: none; }
.jobs-count            { margin-left: auto; font-size: 12px; color: var(--text-label); white-space: nowrap; }
.badge-cell            { display: inline-block; min-width: 76px; text-align: center; }
.th-j-status           { width: 100px; }
.th-j-type             { width: 150px; }
.th-j-prefix           { width: 80px;  text-align: right; }
.th-j-day              { width: 110px; }
.th-j-started          { width: 150px; }
.th-j-duration         { width: 80px;  text-align: right; }
.th-j-id               { width: 90px;  text-align: right; }

/* ── Top sync ── */
.top-sync       { background: none; border: 1px solid var(--border-default); border-radius: 4px; color: var(--text-label); font-size: 11px; padding: 2px 8px; cursor: pointer; transition: all .15s; }
.top-sync:hover { border-color: var(--brand-light); color: var(--text-body); }

/* ── InfoTip ── */
.infotip         { position: relative; display: inline-flex; align-items: center; vertical-align: middle; }
.infotip-icon    { display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; border-radius: 50%; background: var(--bg-elevated); color: var(--text-label); font-size: 9px; font-weight: 700; cursor: default; user-select: none; margin-left: 5px; line-height: 1; }
.infotip-tooltip { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); background: var(--ink-3); color: var(--bg-surface); padding: 7px 11px; border-radius: 6px; font-size: 12px; width: 230px; line-height: 1.55; z-index: 300; box-shadow: 0 4px 16px rgba(0,0,0,.5); pointer-events: none; white-space: normal; }

/* ── PrefixDrill ── */
.drill-action-msg      { padding: 10px 14px; margin-bottom: 16px; background: var(--success-soft); border: 1px solid var(--success); border-radius: 8px; font-size: 13px; color: var(--success-text); }
.drill-summary         { display: flex; align-items: center; gap: 20px; padding: 16px; margin-bottom: 16px; background: var(--bg-surface); border-radius: 10px; border: 1px solid var(--border-subtle); }
.drill-summary-body    { flex: 1; min-width: 0; }
.drill-run-id          { font-size: 11px; font-weight: 600; color: var(--text-label); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; font-family: var(--font-mono); }
.drill-stats           { font-size: 15px; }
.drill-summary-actions { display: flex; gap: 8px; flex-shrink: 0; }
.drill-filter          { margin-bottom: 12px; }

.drill-selection-bar     { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px; margin-bottom: 10px; background: var(--info-soft); border: 1px solid var(--info-border); border-radius: 8px; font-size: 13px; }
.drill-selection-count   { color: var(--info-text); font-weight: 600; }
.drill-selection-actions { display: flex; gap: 8px; }

.btn.btn-sm { font-size: 12px; padding: 3px 10px; }

.row-selected td { background: var(--info-soft) !important; }

.tbl-sort-th         { cursor: pointer; user-select: none; white-space: nowrap; }
.th-cb               { width: 32px; }
.th-status           { width: 100px; }
.th-dump             { width: 100px; text-align: right; }
.th-compressed       { width: 110px; text-align: right; }
.th-actions          { width: 150px; text-align: right; }
.sort-arrow          { opacity: .35; font-size: 10px; margin-left: 3px; }
.sort-arrow.active   { opacity: 1; }

.tbl-link            { color: var(--brand-light); font-weight: 500; text-decoration: none; }
.tbl-link:hover      { text-decoration: underline; text-decoration-color: var(--border-default); }
.tbl-link-meta       { margin-left: 8px; }
.td-right            { text-align: right; }
.td-num              { text-align: right; color: var(--text-label); }
.td-tabular          { font-variant-numeric: tabular-nums; }
.td-actions          { text-align: right; white-space: nowrap; }

.strong-ok   { color: var(--success-text); }
.strong-fail { color: var(--danger-text); }
.strong-warn { color: var(--warning); }

.drill-pipeline-note { margin-top: 8px; padding: 6px 12px; background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 6px; font-size: 12px; color: var(--text-muted); }

/* ── Section (DbDetail) ── */
.section        { margin-bottom: 16px; border: 1px solid var(--border-subtle); border-radius: 10px; overflow: hidden; }
.section-header { background: var(--bg-elevated); padding: 10px 14px; font-size: 12px; font-weight: 700; color: var(--text-label); text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--border-subtle); }
.section-body   { padding: 14px; }
.section-empty  { font-style: italic; }

/* ── KeyVal (DbDetail) ── */
.kv-row            { display: flex; padding: 4px 0; border-bottom: 1px solid var(--border-subtle); font-size: 13px; }
.kv-row:last-child { border-bottom: none; }
.kv-key            { width: 180px; flex-shrink: 0; color: var(--text-label); font-weight: 500; }
.kv-val            { flex: 1; color: var(--ink); word-break: break-all; }

/* ── DbTablePage ── */
.dbtable-header         { display: flex; align-items: center; gap: 16px; padding: 16px; margin-bottom: 16px; background: var(--bg-surface); border-radius: 10px; border: 1px solid var(--border-subtle); flex-wrap: wrap; }
.dbtable-header-body    { flex: 1; min-width: 0; }
.label-upper            { font-size: 11px; font-weight: 600; color: var(--text-label); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.dbtable-name           { font-size: 18px; font-weight: 700; color: var(--ink); }
.dbtable-file           { margin-top: 2px; }
.dbtable-header-actions { display: flex; gap: 8px; flex-shrink: 0; }

.dbtable-sel-bar   { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--border-subtle); flex-wrap: wrap; }
.dbtable-sel-label { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; font-weight: 500; color: var(--text-body); cursor: pointer; }
.dbtable-no-tables { font-size: 13px; color: var(--text-body); margin-bottom: 6px; }

.th-tbl-cb   { width: 36px; text-align: center; }
.th-tbl-size { width: 120px; text-align: right; }
.td-center   { text-align: center; }
.td-bold     { font-weight: 600; }

/* ── DbInfoModal ── */
.modal-full        { max-height: 85vh; display: flex; flex-direction: column; }
.modal-header      { display: flex; align-items: center; justify-content: space-between; padding-bottom: 14px; margin-bottom: 16px; border-bottom: 1px solid var(--border-subtle); flex-shrink: 0; }
.modal-title--flush { margin-bottom: 0; }
.modal-scroll-body { overflow-y: auto; flex: 1; }

/* ── Utils ── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); font-size: 14px; }
.muted       { color: var(--text-muted); }
.mono        { font-family: var(--font-mono); }
.text-sm     { font-size: 12px; }
.text-xs     { font-size: 11px; }

/* ── PrefixCard icon states ── */
.card-mini-icon--ok     { background: var(--success); color: #fff; }
.card-mini-icon--warn   { background: var(--warning); color: #fff; }
.card-mini-icon--danger { background: var(--danger);  color: #fff; }
.card-mini-icon--muted  { background: var(--bg-elevated); color: var(--text-label); }
.card-mini-icon--err    { background: var(--danger-soft); color: var(--danger-text); }

/* ── Overview ── */
.overview-day-row      { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.overview-day-label    { font-size: 12px; font-weight: 600; color: var(--text-label); text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.select-auto           { width: auto; min-width: 180px; }

.overview-summary        { display: flex; align-items: center; gap: 24px; margin-bottom: 24px; padding: 20px; background: var(--bg-surface); border-radius: 12px; border: 1px solid var(--border-subtle); }
.overview-summary-body   { flex: 1; min-width: 0; }
.overview-summary-eyebrow { font-size: 11px; font-weight: 600; color: var(--text-label); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.overview-summary-count  { font-size: 20px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.overview-worst          { font-weight: 600; color: var(--text-body); }

.prefix-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
