/* =============================================================
   Timbrature — Enterprise Design System
   Design tokens + component overrides on top of Bootstrap 5
   ============================================================= */

:root {
    /* ── Palette (slate neutrals + single primary accent) */
    --tb-bg:            #f6f7f9;
    --tb-surface:       #ffffff;
    --tb-surface-2:     #f9fafb;
    --tb-border:        #e5e7eb;
    --tb-border-strong: #d1d5db;

    --tb-text:          #111827;
    --tb-text-muted:    #6b7280;
    --tb-text-subtle:   #9ca3af;

    --tb-primary:       #2563eb;
    --tb-primary-hover: #1d4ed8;
    --tb-primary-soft:  #eff6ff;
    --tb-primary-ring:  rgba(37, 99, 235, .25);

    --tb-success:       #16a34a;
    --tb-success-soft:  #dcfce7;
    --tb-warning:       #d97706;
    --tb-warning-soft:  #fef3c7;
    --tb-danger:        #dc2626;
    --tb-danger-soft:   #fee2e2;
    --tb-info:          #0284c7;
    --tb-info-soft:     #e0f2fe;

    /* ── Typography */
    --tb-font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --tb-font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;

    /* ── Spacing scale (4px base) */
    --tb-s-1: .25rem;
    --tb-s-2: .5rem;
    --tb-s-3: .75rem;
    --tb-s-4: 1rem;
    --tb-s-5: 1.25rem;
    --tb-s-6: 1.5rem;
    --tb-s-8: 2rem;

    /* ── Radii */
    --tb-radius-sm: .375rem;
    --tb-radius:    .5rem;
    --tb-radius-lg: .75rem;
    --tb-radius-xl: 1rem;

    /* ── Shadows */
    --tb-shadow-xs: 0 1px 2px rgba(16,24,40,.05);
    --tb-shadow-sm: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
    --tb-shadow:    0 4px 6px -1px rgba(16,24,40,.06), 0 2px 4px -2px rgba(16,24,40,.06);
    --tb-shadow-md: 0 10px 15px -3px rgba(16,24,40,.08), 0 4px 6px -4px rgba(16,24,40,.05);

    /* ── Layout */
    --tb-sidebar-w: 260px;
    --tb-sidebar-w-collapsed: 72px;
    --tb-topbar-h: 60px;
}

/* ── Bootstrap var overrides ----------------------------------- */
:root {
    --bs-body-font-family: var(--tb-font-sans);
    --bs-body-color: var(--tb-text);
    --bs-body-bg: var(--tb-bg);
    --bs-primary: var(--tb-primary);
    --bs-primary-rgb: 37,99,235;
    --bs-border-color: var(--tb-border);
    --bs-border-radius: var(--tb-radius);
    --bs-border-radius-sm: var(--tb-radius-sm);
    --bs-border-radius-lg: var(--tb-radius-lg);
    --bs-link-color: var(--tb-primary);
    --bs-link-hover-color: var(--tb-primary-hover);
}

/* =============================================================
   Base
   ============================================================= */
html, body {
    font-family: var(--tb-font-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "cv11", "ss01", "ss03";
}

body {
    background: var(--tb-bg);
    color: var(--tb-text);
    font-size: 14px;
    line-height: 1.5;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-weight: 600;
    letter-spacing: -.01em;
    color: var(--tb-text);
}

h1, .h1 { font-size: 1.75rem; }
h2, .h2 { font-size: 1.5rem; }
h3, .h3 { font-size: 1.25rem; }
h4, .h4 { font-size: 1.125rem; }

a { text-decoration: none; }
a:hover { text-decoration: underline; }

/* =============================================================
   Sidebar layout (Office)
   ============================================================= */
.tb-app {
    display: flex;
    min-height: 100vh;
}

.tb-sidebar {
    width: var(--tb-sidebar-w);
    flex: 0 0 var(--tb-sidebar-w);
    background: var(--tb-surface);
    border-right: 1px solid var(--tb-border);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    z-index: 1030;
    transition: width .2s ease;
}

.tb-sidebar-brand {
    display: flex;
    align-items: center;
    gap: var(--tb-s-3);
    padding: var(--tb-s-5) var(--tb-s-5);
    border-bottom: 1px solid var(--tb-border);
    min-height: var(--tb-topbar-h);
}

.tb-sidebar-brand img {
    width: 28px;
    height: 28px;
    border-radius: var(--tb-radius-sm);
}

.tb-sidebar-brand-text {
    font-weight: 600;
    font-size: .95rem;
    color: var(--tb-text);
    white-space: nowrap;
}

.tb-sidebar-nav {
    padding: var(--tb-s-3) var(--tb-s-2);
    flex: 1;
}

.tb-sidebar-section {
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--tb-text-subtle);
    padding: var(--tb-s-4) var(--tb-s-3) var(--tb-s-2);
}

.tb-nav-item {
    display: flex;
    align-items: center;
    gap: var(--tb-s-3);
    padding: .5rem .75rem;
    border-radius: var(--tb-radius);
    color: var(--tb-text-muted);
    font-weight: 500;
    font-size: .9rem;
    transition: background-color .12s, color .12s;
    position: relative;
    white-space: nowrap;
    text-decoration: none !important;
}

.tb-nav-item:hover {
    background: var(--tb-surface-2);
    color: var(--tb-text);
}

.tb-nav-item.active {
    background: var(--tb-primary-soft);
    color: var(--tb-primary);
}

.tb-nav-item.active::before {
    content: "";
    position: absolute;
    left: -8px;
    top: 20%;
    bottom: 20%;
    width: 3px;
    background: var(--tb-primary);
    border-radius: 3px;
}

.tb-nav-item i.bi {
    font-size: 1.05rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.tb-nav-item .badge {
    margin-left: auto;
    font-size: .7rem;
    font-weight: 600;
    padding: .2rem .45rem;
}

.tb-sidebar-footer {
    padding: var(--tb-s-3) var(--tb-s-2);
    border-top: 1px solid var(--tb-border);
}

.tb-user-chip {
    display: flex;
    align-items: center;
    gap: var(--tb-s-3);
    padding: .5rem .5rem;
    border-radius: var(--tb-radius);
    color: var(--tb-text-muted);
    font-size: .85rem;
    text-decoration: none !important;
}

.tb-user-chip:hover {
    background: var(--tb-surface-2);
    color: var(--tb-text);
}

.tb-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--tb-primary-soft);
    color: var(--tb-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    font-weight: 600;
    flex-shrink: 0;
}

/* Main area */
.tb-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0; /* critical for flex children with tables */
}

.tb-topbar {
    height: var(--tb-topbar-h);
    background: var(--tb-surface);
    border-bottom: 1px solid var(--tb-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--tb-s-6);
    gap: var(--tb-s-4);
    position: sticky;
    top: 0;
    z-index: 1020;
}

.tb-topbar-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--tb-text);
    margin: 0;
}

.tb-topbar-toggle {
    display: none;
    background: transparent;
    border: 0;
    padding: .4rem .6rem;
    border-radius: var(--tb-radius);
    color: var(--tb-text-muted);
    font-size: 1.25rem;
}

.tb-topbar-toggle:hover {
    background: var(--tb-surface-2);
    color: var(--tb-text);
}

.tb-content {
    padding: var(--tb-s-6);
    flex: 1;
    min-width: 0; /* prevent flex-child from expanding past parent due to wide tables */
    overflow-x: hidden;
}

/* Wide report tables scroll horizontally inside their own container */
.tb-content .report-table,
.tb-content .tb-table-card {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
}

.tb-content .table-responsive {
    max-width: 100%;
}

/* Mobile drawer */
@media (max-width: 991.98px) {
    .tb-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        box-shadow: var(--tb-shadow-md);
    }

    .tb-sidebar.open {
        transform: translateX(0);
    }

    .tb-topbar-toggle {
        display: inline-flex;
        align-items: center;
    }

    .tb-content {
        padding: var(--tb-s-4);
    }

    .tb-sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(17,24,39,.4);
        z-index: 1029;
        display: none;
    }

    .tb-sidebar-backdrop.open {
        display: block;
    }
}

/* =============================================================
   Cards
   ============================================================= */
.card {
    background: var(--tb-surface);
    border: 1px solid var(--tb-border);
    border-radius: var(--tb-radius-lg);
    box-shadow: var(--tb-shadow-xs);
}

.card-body {
    padding: var(--tb-s-5);
}

.card-title {
    font-size: .95rem;
    font-weight: 600;
    color: var(--tb-text);
    margin: 0 0 var(--tb-s-3);
    display: flex;
    align-items: center;
    gap: var(--tb-s-2);
}

/* KPI card — dashboard */
.tb-kpi {
    display: flex;
    flex-direction: column;
    gap: var(--tb-s-2);
    min-height: 100%;
}

.tb-kpi-head {
    display: flex;
    align-items: center;
    gap: var(--tb-s-2);
    color: var(--tb-text-muted);
    font-size: .8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.tb-kpi-head i.bi {
    font-size: 1rem;
}

.tb-kpi-value {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--tb-text);
    line-height: 1.15;
}

.tb-kpi-value small {
    font-size: 1rem;
    font-weight: 500;
    color: var(--tb-text-muted);
    margin-left: .15rem;
}

.tb-kpi-sub {
    color: var(--tb-text-muted);
    font-size: .85rem;
}

.tb-kpi-accent-primary { border-left: 3px solid var(--tb-primary); }
.tb-kpi-accent-success { border-left: 3px solid var(--tb-success); }
.tb-kpi-accent-warning { border-left: 3px solid var(--tb-warning); }
.tb-kpi-accent-danger  { border-left: 3px solid var(--tb-danger); }

/* =============================================================
   Buttons (refined)
   ============================================================= */
.btn {
    font-weight: 500;
    border-radius: var(--tb-radius);
    padding: .45rem .9rem;
    transition: background-color .12s, border-color .12s, color .12s, box-shadow .12s;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}

.btn:focus-visible {
    box-shadow: 0 0 0 3px var(--tb-primary-ring);
}

.btn i.bi { font-size: 1rem; }

.btn-primary {
    background: var(--tb-primary);
    border-color: var(--tb-primary);
    color: #fff;
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--tb-primary-hover);
    border-color: var(--tb-primary-hover);
    color: #fff;
}

.btn-outline-secondary {
    color: var(--tb-text-muted);
    border-color: var(--tb-border-strong);
}

.btn-outline-secondary:hover {
    background: var(--tb-surface-2);
    color: var(--tb-text);
    border-color: var(--tb-border-strong);
}

.btn-sm {
    padding: .3rem .65rem;
    font-size: .825rem;
    border-radius: var(--tb-radius-sm);
}

.btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    justify-content: center;
}

/* =============================================================
   Forms
   ============================================================= */
.form-label {
    font-size: .85rem;
    font-weight: 500;
    color: var(--tb-text);
    margin-bottom: .3rem;
}

.form-control, .form-select {
    border-color: var(--tb-border-strong);
    border-radius: var(--tb-radius);
    padding: .5rem .75rem;
    font-size: .9rem;
    background: var(--tb-surface);
    color: var(--tb-text);
}

.form-control:focus, .form-select:focus {
    border-color: var(--tb-primary);
    box-shadow: 0 0 0 3px var(--tb-primary-ring);
}

.form-text {
    color: var(--tb-text-muted);
    font-size: .8rem;
}

.form-check-input:checked {
    background-color: var(--tb-primary);
    border-color: var(--tb-primary);
}

/* =============================================================
   Tables
   ============================================================= */
.table {
    --bs-table-bg: transparent;
    --bs-table-hover-bg: var(--tb-surface-2);
    color: var(--tb-text);
    border-color: var(--tb-border);
    margin-bottom: 0;
}

.table > :not(caption) > * > * {
    padding: .65rem .75rem;
    vertical-align: middle;
}

.table thead th {
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--tb-text-muted);
    background: var(--tb-surface-2);
    border-bottom: 1px solid var(--tb-border);
    white-space: nowrap;
}

.table-hover > tbody > tr:hover {
    --bs-table-hover-bg: var(--tb-surface-2);
}

.tb-table-card {
    background: var(--tb-surface);
    border: 1px solid var(--tb-border);
    border-radius: var(--tb-radius-lg);
    overflow: hidden;
    box-shadow: var(--tb-shadow-xs);
}

/* =============================================================
   Badges
   ============================================================= */
.badge {
    font-weight: 500;
    padding: .25rem .5rem;
    border-radius: var(--tb-radius-sm);
    font-size: .72rem;
    letter-spacing: .01em;
}

.badge.bg-primary { background: var(--tb-primary-soft) !important; color: var(--tb-primary) !important; }
.badge.bg-success { background: var(--tb-success-soft) !important; color: var(--tb-success) !important; }
.badge.bg-warning { background: var(--tb-warning-soft) !important; color: var(--tb-warning) !important; }
.badge.bg-danger  { background: var(--tb-danger-soft)  !important; color: var(--tb-danger)  !important; }
.badge.bg-info    { background: var(--tb-info-soft)    !important; color: var(--tb-info)    !important; }
.badge.bg-secondary { background: var(--tb-surface-2) !important; color: var(--tb-text-muted) !important; }

.tb-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: .4rem;
    vertical-align: middle;
}
.tb-dot-success { background: var(--tb-success); }
.tb-dot-warning { background: var(--tb-warning); }
.tb-dot-danger  { background: var(--tb-danger); }
.tb-dot-muted   { background: var(--tb-text-subtle); }

/* =============================================================
   Alerts
   ============================================================= */
.alert {
    border: 1px solid transparent;
    border-radius: var(--tb-radius);
    padding: .75rem 1rem;
    font-size: .875rem;
    display: flex;
    align-items: flex-start;
    gap: .6rem;
}

.alert i.bi { font-size: 1.1rem; flex-shrink: 0; }

.alert-success { background: var(--tb-success-soft); border-color: #bbf7d0; color: #166534; }
.alert-warning { background: var(--tb-warning-soft); border-color: #fde68a; color: #92400e; }
.alert-danger  { background: var(--tb-danger-soft);  border-color: #fecaca; color: #991b1b; }
.alert-info    { background: var(--tb-info-soft);    border-color: #bae6fd; color: #075985; }
.alert-secondary { background: var(--tb-surface-2); border-color: var(--tb-border); color: var(--tb-text-muted); }

/* =============================================================
   Modals (polish)
   ============================================================= */
.modal-content {
    border: 1px solid var(--tb-border);
    border-radius: var(--tb-radius-lg);
    box-shadow: var(--tb-shadow-md);
}

.modal-header {
    border-bottom: 1px solid var(--tb-border);
    padding: var(--tb-s-4) var(--tb-s-5);
}

.modal-title {
    font-size: 1.05rem;
    font-weight: 600;
}

.modal-footer {
    border-top: 1px solid var(--tb-border);
    padding: var(--tb-s-3) var(--tb-s-5);
    background: var(--tb-surface-2);
}

/* =============================================================
   Auth (Login) layout
   ============================================================= */
.tb-auth {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(ellipse at top, var(--tb-primary-soft) 0%, transparent 50%),
        var(--tb-bg);
    padding: var(--tb-s-6);
}

.tb-auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--tb-surface);
    border: 1px solid var(--tb-border);
    border-radius: var(--tb-radius-xl);
    box-shadow: var(--tb-shadow-md);
    padding: var(--tb-s-8);
}

.tb-auth-brand {
    display: flex;
    align-items: center;
    gap: var(--tb-s-3);
    margin-bottom: var(--tb-s-6);
}

.tb-auth-brand img {
    width: 36px; height: 36px;
    border-radius: var(--tb-radius);
}

.tb-auth-brand-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--tb-text);
}

.tb-auth-title {
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: .4rem;
}

.tb-auth-subtitle {
    color: var(--tb-text-muted);
    margin-bottom: var(--tb-s-6);
    font-size: .9rem;
}

/* =============================================================
   Utilities
   ============================================================= */
.text-muted { color: var(--tb-text-muted) !important; }
.text-subtle { color: var(--tb-text-subtle) !important; }

.tb-divider {
    height: 1px;
    background: var(--tb-border);
    margin: var(--tb-s-4) 0;
}

.tb-icon-box {
    width: 36px;
    height: 36px;
    border-radius: var(--tb-radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
}

.tb-icon-box-primary { background: var(--tb-primary-soft); color: var(--tb-primary); }
.tb-icon-box-success { background: var(--tb-success-soft); color: var(--tb-success); }
.tb-icon-box-warning { background: var(--tb-warning-soft); color: var(--tb-warning); }
.tb-icon-box-danger  { background: var(--tb-danger-soft);  color: var(--tb-danger); }
.tb-icon-box-info    { background: var(--tb-info-soft);    color: var(--tb-info); }
.tb-icon-box-muted   { background: var(--tb-surface-2);    color: var(--tb-text-muted); }

.tb-empty {
    text-align: center;
    padding: var(--tb-s-8) var(--tb-s-4);
    color: var(--tb-text-muted);
}

.tb-empty i.bi {
    font-size: 2.5rem;
    margin-bottom: var(--tb-s-3);
    display: block;
    color: var(--tb-text-subtle);
}

/* Scrollbar */
.tb-sidebar::-webkit-scrollbar { width: 6px; }
.tb-sidebar::-webkit-scrollbar-thumb { background: var(--tb-border-strong); border-radius: 3px; }
.tb-sidebar::-webkit-scrollbar-track { background: transparent; }

/* Turbo Drive progress bar */
.turbo-progress-bar {
    height: 2px;
    background-color: var(--tb-primary);
    box-shadow: 0 0 6px var(--tb-primary-ring);
}

/* =============================================================
   REVIEW REQUEST – enterprise compact layout (viewport-fit)
   ============================================================= */

.tb-review-page {
    display: flex;
    flex-direction: column;
    gap: var(--tb-s-3);
    padding-top: var(--tb-s-2);
    padding-bottom: var(--tb-s-2);
}

/* --- Header strip --------------------------------------------------------- */
.tb-page-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--tb-s-3);
    background: var(--tb-surface);
    border: 1px solid var(--tb-border);
    border-radius: var(--tb-radius);
    padding: var(--tb-s-3) var(--tb-s-4);
    box-shadow: var(--tb-shadow-xs);
}
.tb-page-header__breadcrumb {
    color: var(--tb-text-muted);
    font-size: .85rem;
    display: flex;
    align-items: center;
    gap: var(--tb-s-1);
}
.tb-page-header__breadcrumb .sep { color: var(--tb-text-subtle); }
.tb-page-header__title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    color: var(--tb-text);
}
.tb-page-header__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--tb-s-3);
    margin-left: auto;
    font-size: .9rem;
    color: var(--tb-text-muted);
}
.tb-page-header__meta strong { color: var(--tb-text); font-weight: 600; }

/* --- Status pill (più visibile dei badge bs) ------------------------------ */
.tb-status-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--tb-s-1);
    font-size: .8rem;
    font-weight: 600;
    padding: .15rem .55rem;
    border-radius: 999px;
    border: 1px solid transparent;
    line-height: 1.4;
}
.tb-status-pill--pending  { background: var(--tb-warning-soft); color: #92400e; border-color: #fcd34d; }
.tb-status-pill--approved { background: var(--tb-success-soft); color: #166534; border-color: #86efac; }
.tb-status-pill--rejected { background: var(--tb-danger-soft);  color: #991b1b; border-color: #fca5a5; }
.tb-status-pill--info     { background: var(--tb-info-soft);    color: #075985; border-color: #7dd3fc; }
.tb-status-pill--neutral  { background: var(--tb-surface-2);    color: var(--tb-text-muted); border-color: var(--tb-border); }

/* --- Inline callout (no border, soft surface) ----------------------------- */
.tb-callout-inline {
    display: flex;
    align-items: flex-start;
    gap: var(--tb-s-2);
    padding: var(--tb-s-2) var(--tb-s-3);
    border-radius: var(--tb-radius-sm);
    font-size: .85rem;
    line-height: 1.4;
}
.tb-callout-inline--info    { background: var(--tb-info-soft);    color: #075985; }
.tb-callout-inline--warning { background: var(--tb-warning-soft); color: #78350f; }
.tb-callout-inline i.bi { font-size: 1rem; margin-top: .1rem; }

/* --- Card densa per il review --------------------------------------------- */
.tb-review-card {
    background: var(--tb-surface);
    border: 1px solid var(--tb-border);
    border-radius: var(--tb-radius);
    box-shadow: var(--tb-shadow-xs);
    display: flex;
    flex-direction: column;
}
.tb-review-card__header {
    padding: var(--tb-s-3) var(--tb-s-4);
    border-bottom: 1px solid var(--tb-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--tb-s-2);
}
.tb-review-card__title {
    margin: 0;
    font-size: .95rem;
    font-weight: 600;
    color: var(--tb-text);
    display: flex;
    align-items: center;
    gap: var(--tb-s-2);
}
.tb-review-card__body { padding: var(--tb-s-3) var(--tb-s-4); flex: 1; }
.tb-review-card__footer {
    padding: var(--tb-s-3) var(--tb-s-4);
    border-top: 1px solid var(--tb-border);
    background: var(--tb-surface-2);
    border-bottom-left-radius: var(--tb-radius);
    border-bottom-right-radius: var(--tb-radius);
}

/* --- Compact data grid: Inizio | Fine | Durata --------------------------- */
.tb-data-grid {
    display: grid;
    grid-template-columns: 90px 1fr;
    row-gap: .35rem;
    column-gap: var(--tb-s-3);
    font-size: .9rem;
    align-items: baseline;
}
.tb-data-grid dt {
    color: var(--tb-text-muted);
    font-weight: 500;
    margin: 0;
}
.tb-data-grid dd {
    margin: 0;
    color: var(--tb-text);
    display: flex;
    align-items: baseline;
    gap: var(--tb-s-2);
    flex-wrap: wrap;
}
.tb-data-grid .tb-arrow {
    color: var(--tb-text-subtle);
    font-size: .85rem;
    margin: 0 .15rem;
}
.tb-data-grid .tb-original {
    color: var(--tb-text-muted);
    text-decoration: line-through;
    font-size: .85rem;
}
.tb-data-grid .tb-changed {
    color: var(--tb-danger);
    font-weight: 600;
}
.tb-data-grid .tb-delta {
    color: var(--tb-warning);
    font-size: .75rem;
    font-weight: 600;
    background: var(--tb-warning-soft);
    padding: 0 .35rem;
    border-radius: var(--tb-radius-sm);
}

/* --- Stat strip orizzontale (KPI compatti) -------------------------------- */
.tb-stat-strip {
    display: flex;
    flex-wrap: wrap;
    gap: var(--tb-s-3);
    padding: var(--tb-s-2) 0;
    margin: var(--tb-s-2) 0;
    border-top: 1px solid var(--tb-border);
    border-bottom: 1px solid var(--tb-border);
}
.tb-stat-strip__item {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}
.tb-stat-strip__label {
    font-size: .7rem;
    color: var(--tb-text-muted);
    text-transform: uppercase;
    letter-spacing: .03em;
}
.tb-stat-strip__value {
    font-size: .95rem;
    font-weight: 600;
    color: var(--tb-text);
}

/* --- Decision bar (azioni Approve/Reject) -------------------------------- */
.tb-decision-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--tb-s-3);
    flex-wrap: wrap;
}
.tb-decision-bar__hint {
    font-size: .8rem;
    color: var(--tb-text-muted);
    display: flex;
    align-items: center;
    gap: var(--tb-s-1);
}

/* --- Legenda dot collapsible --------------------------------------------- */
.tb-legend > summary {
    cursor: pointer;
    font-size: .8rem;
    color: var(--tb-text-muted);
    list-style: none;
    user-select: none;
    display: inline-flex;
    align-items: center;
    gap: var(--tb-s-1);
}
.tb-legend > summary::-webkit-details-marker { display: none; }
.tb-legend > summary::after { content: "▾"; transition: transform .15s; }
.tb-legend[open] > summary::after { transform: rotate(180deg); }
.tb-legend__items {
    display: flex;
    flex-wrap: wrap;
    gap: var(--tb-s-3);
    margin-top: var(--tb-s-2);
    padding-top: var(--tb-s-2);
    border-top: 1px dashed var(--tb-border);
    font-size: .8rem;
    color: var(--tb-text-muted);
}

/* --- Compact form spacing inside editor ---------------------------------- */
.tb-review-card .shift-editor-form {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    border-bottom: 0 !important;
}
.tb-review-card .shift-editor-form .row.g-3 { --bs-gutter-y: .5rem; }
.tb-review-card .shift-editor-form hr.my-3 { margin: .75rem 0 !important; }

/* --- Responsive (≤991px stack, ≤768px tighten) --------------------------- */
@media (max-width: 991.98px) {
    .tb-page-header__meta { margin-left: 0; }
}
@media (max-width: 767.98px) {
    .tb-data-grid { grid-template-columns: 80px 1fr; font-size: .85rem; }
    .tb-decision-bar { flex-direction: column; align-items: stretch; }
    .tb-decision-bar > * { width: 100%; }
}

/* tb-stat-strip end modifier (BEM, niente utility miscele) */
.tb-stat-strip__item--end { margin-left: auto; }

/* Mobile super stretto (≤480px) — header strip in 2 righe ergonomico */
@media (max-width: 479.98px) {
    .tb-page-header { padding: var(--tb-s-2) var(--tb-s-3); gap: var(--tb-s-2); }
    .tb-page-header__title { font-size: 1rem; }
    .tb-page-header__meta { gap: var(--tb-s-2); width: 100%; }
    .tb-page-header__meta .btn { margin-left: auto; }
    .tb-stat-strip { gap: var(--tb-s-2); }
}
