/*
 * theme.css — Layout e stili personalizzati GestVolontari Admin
 *
 * Per personalizzare colori, sfondo, logo: modificare appsettings.json > ThemeConfig
 * Le CSS custom properties vengono generate da ThemeService e iniettate via _Host.cshtml
 *
 * Palette di default:
 *   --color-primary:      #1a237e  (navy sidebar)
 *   --color-accent:       #e8520a  (arancio bottoni/badge)
 *   --color-bg:           #f0f2f5  (sfondo pagina)
 */

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--color-bg, #f0f2f5);
    color: #1a1a2e;
    margin: 0;
}

/* ─── Shell Layout ──────────────────────────────────────────────────────────── */
.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-body {
    display: flex;
    flex: 1;
    min-height: 0;
}

/* ─── Top Bar ───────────────────────────────────────────────────────────────── */
.topbar {
    background: var(--color-topbar-bg, #ffffff);
    border-bottom: 1px solid #e8e8e8;
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
    z-index: 100;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    font-weight: 700;
    font-size: 15px;
    color: #1a1a2e;
}

.topbar-brand .brand-icon { font-size: 22px; }
.topbar-brand .brand-name { font-weight: 800; }

.topbar-search {
    flex: 1;
    max-width: 400px;
    position: relative;
}

.topbar-search input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border: 1.5px solid #e8e8e8;
    border-radius: 10px;
    font-size: 13px;
    background: #f8f9fa;
    outline: none;
    transition: border-color .15s, background .15s;
}

.topbar-search input:focus {
    border-color: var(--color-accent, #e8520a);
    background: white;
}

.topbar-search .search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    opacity: .5;
}

.topbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-page-info .page-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
}

.topbar-page-info .page-subtitle {
    font-size: 12px;
    color: #888;
    margin-top: 1px;
}

/* Live indicator */
.live-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    color: #2e7d32;
    cursor: default;
}

.live-dot {
    width: 6px;
    height: 6px;
    background: #43a047;
    border-radius: 50%;
    animation: livePulse 1.5s infinite;
}

.live-dot.offline {
    background: #e53935;
    animation: none;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ─── Sidebar ───────────────────────────────────────────────────────────────── */
.sidebar {
    width: 220px;
    background: var(--color-sidebar-bg, #1a237e);
    color: white;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transition: width .25s ease;
}

.sidebar.collapsed { width: 58px; }

.sidebar-brand {
    padding: 16px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.sidebar-brand .brand-icon { font-size: 22px; flex-shrink: 0; }
.sidebar-brand .brand-text { font-size: 13px; font-weight: 700; line-height: 1.3; white-space: nowrap; overflow: hidden; }
.sidebar-brand .brand-sub  { font-size: 10px; opacity: .6; white-space: nowrap; overflow: hidden; }

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

.nav-group-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.5px;
    opacity: .5;
    text-transform: uppercase;
    padding: 10px 18px 5px;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar.collapsed .nav-group-label { opacity: 0; height: 0; padding: 0; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 18px;
    font-size: 13px;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: background .15s, color .15s;
    position: relative;
    white-space: nowrap;
    overflow: hidden;
}

.nav-item:hover {
    background: rgba(255,255,255,0.08);
    color: white;
}

.nav-item.active {
    background: rgba(255,255,255,0.15);
    color: white;
    border-left-color: var(--color-accent, #e8520a);
    font-weight: 600;
}

.nav-item .nav-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.nav-badge {
    margin-left: auto;
    background: var(--color-accent, #e8520a);
    color: white;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 8px;
    flex-shrink: 0;
}

.sidebar.collapsed .nav-badge { display: none; }
.sidebar.collapsed .nav-item span:not(.nav-icon) { display: none; }

.sidebar-user {
    padding: 14px 18px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    overflow: hidden;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.user-name { font-size: 12px; font-weight: 600; white-space: nowrap; }
.user-role { font-size: 10px; opacity: .6; white-space: nowrap; }

.sidebar.collapsed .user-name,
.sidebar.collapsed .user-role { display: none; }

/* ─── Content Area ──────────────────────────────────────────────────────────── */
.main-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.content-area {
    padding: 20px 24px;
    flex: 1;
}

/* ─── Cards ─────────────────────────────────────────────────────────────────── */
.gv-card {
    background: var(--color-surface, #fff);
    border-radius: var(--radius-card, 14px);
    box-shadow: var(--shadow-card, 0 2px 8px rgba(0,0,0,0.06));
    overflow: hidden;
}

.gv-card-header {
    padding: 14px 18px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gv-card-title {
    font-size: 13px;
    font-weight: 700;
    color: #1a1a2e;
}

.gv-card-action {
    margin-left: auto;
    font-size: 11px;
    color: var(--color-accent, #e8520a);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.gv-card-action:hover { text-decoration: underline; }

.gv-card-body { padding: 14px 18px; }

/* ─── KPI Cards ─────────────────────────────────────────────────────────────── */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

@media (max-width: 1200px) { .kpi-row { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px)  { .kpi-row { grid-template-columns: 1fr; } }

.kpi-card {
    background: white;
    border-radius: var(--radius-card, 14px);
    padding: 16px 18px;
    box-shadow: var(--shadow-card);
    display: flex;
    align-items: flex-start;
    gap: 14px;
    cursor: pointer;
    transition: box-shadow .15s, transform .15s;
}

.kpi-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.kpi-icon  { font-size: 28px; }
.kpi-value { font-size: 28px; font-weight: 800; color: #1a1a2e; line-height: 1; }
.kpi-label { font-size: 11px; color: #888; margin-top: 3px; }
.kpi-trend { font-size: 10px; margin-top: 4px; }
.kpi-trend.up      { color: var(--color-success, #43a047); }
.kpi-trend.down    { color: var(--color-error,   #e53935); }
.kpi-trend.neutral { color: #888; }

/* ─── Buttons ────────────────────────────────────────────────────────────────── */
.btn-primary {
    background: linear-gradient(135deg, var(--color-accent, #e8520a), var(--color-accent-dark, #d84315));
    color: white;
    border: none;
    padding: 9px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 3px 10px rgba(232,82,10,0.3);
    text-decoration: none;
    transition: box-shadow .15s, transform .1s;
}

.btn-primary:hover {
    box-shadow: 0 5px 16px rgba(232,82,10,0.4);
    transform: translateY(-1px);
    color: white;
}

.btn-secondary {
    background: white;
    color: #555;
    border: 1.5px solid #e0e0e0;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: border-color .15s;
}

.btn-secondary:hover { border-color: var(--color-accent, #e8520a); color: var(--color-accent, #e8520a); }

.btn-ghost {
    background: none;
    color: #888;
    border: none;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 13px;
    cursor: pointer;
}

.btn-ghost:hover { background: #f5f5f5; color: #333; }

.btn-icon-only {
    background: none;
    border: none;
    padding: 6px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    position: relative;
    color: #555;
    transition: background .15s;
}

.btn-icon-only:hover { background: #f5f5f5; }

.btn-icon-only .notif-dot {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    background: var(--color-accent, #e8520a);
    border-radius: 50%;
    border: 2px solid white;
}

/* ─── Status Badges ─────────────────────────────────────────────────────────── */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
}

.s-bozza    { background: #f5f5f5; color: #757575; }
.s-inviato  { background: #e3f2fd; color: #1565c0; }
.s-in-corso { background: #fff3e0; color: #e65100; }
.s-compl    { background: #e8f5e9; color: #2e7d32; }
.s-annull   { background: #fce4ec; color: #c62828; }

/* Priority dots */
.priority-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 4px;
    flex-shrink: 0;
}
.p-ordinario { background: #bdbdbd; }
.p-urgente   { background: var(--color-warning, #ffb300); }
.p-emergenza { background: var(--color-error, #e53935); }

/* Stato volontario */
.vol-status { padding: 3px 8px; border-radius: 8px; font-size: 9px; font-weight: 700; }
.disponibile { background: #e8f5e9; color: #2e7d32; }
.in-servizio { background: #fff3e0; color: #e65100; }
.non-disp    { background: #f5f5f5; color: #999; }

/* Gravità segnalazione */
.sev-alta  { background: #ffebee; color: #c62828; }
.sev-media { background: #fff8e1; color: #e65100; }
.sev-bassa { background: #e8f5e9; color: #2e7d32; }

/* ─── Progress Bar Risposte ─────────────────────────────────────────────────── */
.replies-bar-wrap { min-width: 90px; }
.replies-text { font-size: 11px; font-weight: 600; color: #1a1a2e; }
.replies-bar  { height: 5px; background: #f0f0f0; border-radius: 3px; margin-top: 4px; overflow: hidden; }
.replies-fill { height: 100%; border-radius: 3px; background: var(--color-success, #43a047); transition: width .4s; }
.replies-sub  { font-size: 10px; color: #888; }

/* ─── Tables ─────────────────────────────────────────────────────────────────── */
.table-card {
    background: white;
    border-radius: var(--radius-card, 14px);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

table { width: 100%; border-collapse: collapse; }
thead tr { background: #f8f9fa; border-bottom: 2px solid #f0f0f0; }
thead th {
    padding: 11px 16px;
    font-size: 11px;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: .5px;
    text-align: left;
    white-space: nowrap;
}
thead th.sortable { cursor: pointer; user-select: none; }
thead th.sortable:hover { color: var(--color-accent, #e8520a); }

tbody tr { border-bottom: 1px solid #f5f5f5; transition: background .1s; }
tbody tr:hover { background: #fafafa; }
tbody tr:last-child { border-bottom: none; }
tbody td { padding: 12px 16px; font-size: 13px; color: #333; vertical-align: middle; }

.ods-code { font-family: 'Cascadia Code', 'Consolas', monospace; font-size: 12px; font-weight: 700; color: var(--color-primary-light, #3949ab); }

/* ─── Filter Bar ─────────────────────────────────────────────────────────────── */
.filter-bar {
    background: white;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    box-shadow: 0 1px 6px rgba(0,0,0,0.05);
}

.filter-input {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    border: 1.5px solid #e8e8e8;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    transition: border-color .15s;
}

.filter-input:focus { border-color: var(--color-accent, #e8520a); }

.filter-select {
    padding: 8px 28px 8px 12px;
    border: 1.5px solid #e8e8e8;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    color: #555;
    background: white;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M6 8L0 0h12z' fill='%23888'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    cursor: pointer;
    transition: border-color .15s;
}

.filter-select:focus { border-color: var(--color-accent, #e8520a); }

/* ─── Summary Chips ──────────────────────────────────────────────────────────── */
.summary-row { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }

.summary-chip {
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all .15s;
    user-select: none;
}

.summary-chip:hover { filter: brightness(.95); }
.summary-chip.selected { box-shadow: 0 2px 8px rgba(0,0,0,0.15); }

.chip-all     { background: #e8eaf6; color: #3949ab; border-color: #c5cae9; }
.chip-bozza   { background: #f5f5f5; color: #757575; }
.chip-inviato { background: #e3f2fd; color: #1565c0; }
.chip-in-corso{ background: #fff3e0; color: #e65100; }
.chip-compl   { background: #e8f5e9; color: #2e7d32; }
.chip-annull  { background: #fce4ec; color: #c62828; }
.chip-num { background: rgba(0,0,0,0.1); border-radius: 10px; padding: 1px 6px; font-size: 10px; }

/* ─── Action Buttons in table rows ──────────────────────────────────────────── */
.actions-cell { display: flex; gap: 5px; flex-wrap: wrap; }

.action-btn {
    padding: 5px 10px;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid transparent;
    white-space: nowrap;
    transition: filter .1s;
}

.action-btn:hover { filter: brightness(.92); }
.ab-view   { background: #e8eaf6; color: #3949ab; border-color: #c5cae9; }
.ab-edit   { background: #fff3e0; color: #e65100; border-color: #ffcc80; }
.ab-report { background: #e8f5e9; color: #2e7d32; border-color: #a5d6a7; }
.ab-danger { background: #fce4ec; color: #c62828; border-color: #ef9a9a; }

/* ─── Wizard ─────────────────────────────────────────────────────────────────── */
.wizard-steps {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
    background: white;
    border-radius: var(--radius-card, 14px);
    padding: 16px 20px;
    box-shadow: var(--shadow-card);
}

.step { display: flex; align-items: center; gap: 8px; flex: 1; }
.step-circle {
    width: 30px; height: 30px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 800; flex-shrink: 0;
}
.step-circle.done    { background: var(--color-success, #43a047); color: white; }
.step-circle.active  { background: var(--color-accent, #e8520a); color: white; box-shadow: 0 0 0 3px rgba(232,82,10,0.2); }
.step-circle.pending { background: #f0f0f0; color: #999; }

.step-label { font-size: 12px; font-weight: 600; }
.step-label.active  { color: var(--color-accent, #e8520a); }
.step-label.done    { color: var(--color-success, #43a047); }
.step-label.pending { color: #bbb; }

.step-connector { flex: 1; height: 2px; background: #f0f0f0; margin: 0 8px; }
.step-connector.done { background: var(--color-success, #43a047); }

/* ─── Form Elements ─────────────────────────────────────────────────────────── */
.form-card {
    background: white;
    border-radius: var(--radius-card, 14px);
    padding: 20px;
    box-shadow: var(--shadow-card);
    margin-bottom: 16px;
}

.form-card-title {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-label {
    font-size: 11px;
    font-weight: 700;
    color: #666;
    letter-spacing: .3px;
    margin-bottom: 4px;
    display: block;
}

.form-label .req { color: var(--color-accent, #e8520a); }

.form-input {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid #e8e8e8;
    border-radius: 9px;
    font-size: 13px;
    color: #1a1a2e;
    outline: none;
    background: #fafafa;
    transition: border-color .15s, background .15s;
    font-family: inherit;
}

.form-input:focus { border-color: var(--color-accent, #e8520a); background: white; }
textarea.form-input { resize: vertical; min-height: 80px; }

.hint-text { font-size: 10px; color: #aaa; margin-top: 3px; }

/* Priorità pills */
.priority-row { display: flex; gap: 8px; }
.priority-pill {
    flex: 1;
    padding: 9px;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    color: #bbb;
    transition: all .15s;
}
.priority-pill.pp-ordinario.sel { border-color: #9e9e9e; background: #f5f5f5; color: #555; }
.priority-pill.pp-urgente.sel   { border-color: #ffb300; background: #fff8e1; color: #e65100; }
.priority-pill.pp-emergenza.sel { border-color: #e53935; background: #ffebee; color: #c62828; }

/* ─── Action Bar (form footer) ───────────────────────────────────────────────── */
.action-bar {
    background: white;
    border-top: 1px solid #e8e8e8;
    padding: 14px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
}

/* ─── Map placeholder ────────────────────────────────────────────────────────── */
.map-area {
    height: 220px;
    background: linear-gradient(135deg, #c8e6c9, #a5d6a7, #81c784);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.map-grid {
    position: absolute;
    inset: 0;
    opacity: .3;
    background-image: linear-gradient(rgba(255,255,255,.3) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255,255,255,.3) 1px, transparent 1px);
    background-size: 30px 30px;
}

.map-marker {
    position: absolute;
    font-size: 22px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,.4));
    cursor: pointer;
    transition: transform .15s;
}
.map-marker:hover { transform: scale(1.2); }

.map-legend {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: white;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.legend-item { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.legend-item:last-child { margin-bottom: 0; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }

/* ─── Activity Feed ──────────────────────────────────────────────────────────── */
.activity-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
}
.activity-item:last-child { border-bottom: none; }

.activity-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}
.av-blue   { background: #e8eaf6; }
.av-orange { background: #fff3e0; }
.av-red    { background: #ffebee; }
.av-green  { background: #e8f5e9; }

.activity-text { font-size: 12px; color: #444; line-height: 1.5; flex: 1; }
.activity-text strong { color: #1a1a2e; }
.activity-time { font-size: 10px; color: #bbb; flex-shrink: 0; white-space: nowrap; }

/* ─── Login Page ─────────────────────────────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--color-primary-dark, #0d1454) 0%, var(--color-primary, #1a237e) 50%, var(--color-primary-light, #3949ab) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 20px;
    padding: 36px 40px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-logo { text-align: center; margin-bottom: 24px; }
.login-logo .logo-icon { font-size: 48px; }
.login-logo .logo-name { font-size: 18px; font-weight: 800; color: #1a1a2e; margin-top: 6px; }
.login-logo .logo-org  { font-size: 12px; color: #888; }

.login-card h2 { font-size: 20px; font-weight: 700; color: #1a1a2e; margin-bottom: 20px; text-align: center; }

/* ─── Preview Card ODS ───────────────────────────────────────────────────────── */
.preview-ods {
    background: linear-gradient(145deg, var(--color-primary, #1a237e), var(--color-primary-light, #3949ab));
    color: white;
    border-radius: var(--radius-card, 14px);
    padding: 18px;
    margin-bottom: 14px;
}

.preview-ods .preview-label { font-size: 9px; font-weight: 700; letter-spacing: 1px; opacity: .65; margin-bottom: 10px; }
.preview-ods .preview-num   { font-size: 11px; opacity: .7; font-family: monospace; }
.preview-ods .preview-title { font-size: 15px; font-weight: 800; margin: 3px 0 8px; }
.preview-ods .preview-row   { display: flex; align-items: center; gap: 6px; font-size: 11px; opacity: .85; margin-bottom: 5px; }

.urgency-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255,179,0,0.3);
    border: 1px solid rgba(255,179,0,.5);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    margin-bottom: 10px;
}

/* ─── Upload Zone ────────────────────────────────────────────────────────────── */
.upload-zone {
    border: 2px dashed #e0e0e0;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    color: #bbb;
    font-size: 12px;
    cursor: pointer;
    transition: border-color .15s, color .15s;
}
.upload-zone:hover { border-color: var(--color-accent, #e8520a); color: var(--color-accent, #e8520a); }

/* ─── Destination Selector ───────────────────────────────────────────────────── */
.dest-tabs {
    display: flex;
    gap: 4px;
    background: #f0f0f0;
    padding: 4px;
    border-radius: 10px;
    margin-bottom: 12px;
}

.dest-tab {
    flex: 1;
    padding: 7px 4px;
    border: none;
    background: none;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    text-align: center;
    transition: all .15s;
}

.dest-tab.active {
    background: white;
    color: var(--color-accent, #e8520a);
    box-shadow: 0 1px 4px rgba(0,0,0,.1);
}

.dest-list { max-height: 220px; overflow-y: auto; }
.dest-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f5f5f5;
}
.dest-item:last-child { border-bottom: none; }

.dest-check {
    width: 16px; height: 16px;
    border: 2px solid var(--color-accent, #e8520a);
    border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; color: white; flex-shrink: 0;
}
.dest-check.checked { background: var(--color-accent, #e8520a); }
.dest-name { font-size: 12px; font-weight: 600; color: #1a1a2e; flex: 1; }
.dest-meta { font-size: 10px; color: #888; }
.dest-avail { font-size: 10px; font-weight: 600; }

/* ─── Tab Navigation ─────────────────────────────────────────────────────────── */
.page-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 20px;
}

.page-tab {
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all .15s;
    white-space: nowrap;
}

.page-tab:hover { color: #555; }
.page-tab.active { color: var(--color-accent, #e8520a); border-bottom-color: var(--color-accent, #e8520a); }

/* ─── Empty State ────────────────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: #bbb;
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state .empty-title { font-size: 16px; font-weight: 700; color: #888; margin-bottom: 6px; }
.empty-state .empty-sub   { font-size: 13px; color: #bbb; }

/* ─── Skeleton Loading ───────────────────────────────────────────────────────── */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeletonWave 1.5s infinite;
    border-radius: 6px;
}

@keyframes skeletonWave {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ─── Paginazione ────────────────────────────────────────────────────────────── */
.pagination-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    font-size: 12px;
    color: #888;
}

.pagination-btns { display: flex; gap: 4px; }
.pag-btn {
    padding: 5px 10px;
    border: 1.5px solid #e0e0e0;
    border-radius: 7px;
    background: white;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    transition: all .1s;
}
.pag-btn:hover { border-color: var(--color-accent); color: var(--color-accent); }
.pag-btn.active { background: var(--color-accent); border-color: var(--color-accent); color: white; }
.pag-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ─── Utilities ──────────────────────────────────────────────────────────────── */
.flex-1 { flex: 1; }
.text-muted { color: #888; }
.text-small { font-size: 11px; }
.text-mono  { font-family: 'Cascadia Code', 'Consolas', monospace; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.mb-0 { margin-bottom: 0 !important; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.grid-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 12px; }

@media (max-width: 900px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .content-area { padding: 14px 16px; }
    .kpi-row { grid-template-columns: repeat(2, 1fr); }
}
