@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --font: 'Inter', system-ui, sans-serif;
    --mono: 'JetBrains Mono', monospace;
    --white: #FFFFFF;
    --bg: #F5F6F8;
    --border: #E2E4E9;
    --border-light: #EDEDF0;
    --text: #111;
    --text-2: #666;
    --text-3: #999;
    --sky: #0066FF;
    --sky-bg: #EEF4FF;
    --amber: #D97706;
    --amber-bg: #FFFBEB;
    --green: #059669;
    --green-bg: #ECFDF5;
    --red: #DC2626;
    --violet: #7C3AED;
    --violet-bg: #F5F3FF;
    --orange: #EA580C;
    --orange-bg: #FFF7ED;
}

html, body { height: 100%; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
}

body.page-fs { overflow: hidden; }

/* ═══════════════════════════════════════
   TOP BAR
   ═══════════════════════════════════════ */
.topbar {
    height: 80px;
    min-height: 80px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: relative;
    z-index: 20;
}

.topbar-logo {
    display: flex; align-items: center; gap: 8px;
    text-decoration: none; color: var(--text-3);
    font-size: 0.72rem; font-weight: 500;
    flex-shrink: 0;
}
.topbar-logo:hover { color: var(--text); }
.topbar-logo svg { opacity: 0.4; }
.topbar-logo .logo-sep {
    width: 1px; height: 14px;
    background: var(--border);
    margin: 0 2px;
}
.topbar-logo .logo-section {
    font-weight: 600;
    color: var(--text-2);
}

.topbar-mid {
    display: flex; flex-direction: column; align-items: center;
    position: absolute; left: 50%; transform: translateX(-50%);
    line-height: 1;
}

.topbar-clock {
    font-family: var(--mono);
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.topbar-date {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-3);
    margin-top: 3px;
}

.topbar-stats {
    display: flex; align-items: center; gap: 8px;
    margin-top: 4px;
}

.topbar-stats .completion-pct {
    font-size: 0.9rem;
    margin-right: 0;
}

.topbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.completion-pct {
    font-family: var(--mono);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--green);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    margin-right: 4px;
}

.live-pill {
    display: flex; align-items: center; gap: 5px;
    padding: 3px 10px;
    border-radius: 99px;
    background: var(--green-bg);
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--green);
}

.live-dot {
    width: 5px; height: 5px;
    background: var(--green);
    border-radius: 50%;
    animation: blink 2s ease infinite;
}

@keyframes blink { 0%,100% { opacity:1; } 50% { opacity:0.15; } }

/* ── Custom date picker ── */
.date-picker {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--white);
    height: 30px;
}
.date-picker .dp-arrow {
    display: flex; align-items: center; justify-content: center;
    width: 28px; height: 100%;
    border: none; background: none;
    color: var(--text-3);
    cursor: pointer;
    transition: all 0.12s;
    flex-shrink: 0;
}
.date-picker .dp-arrow:hover { background: var(--bg); color: var(--text); }
.date-picker .dp-label {
    display: flex; align-items: center; gap: 6px;
    padding: 0 10px; height: 100%;
    border: none;
    border-left: 1px solid var(--border-light);
    border-right: 1px solid var(--border-light);
    background: none;
    font-family: var(--font);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.12s;
}
.date-picker .dp-label:hover { color: var(--sky); }
.date-picker .dp-today {
    display: flex; align-items: center; justify-content: center;
    width: 28px; height: 100%;
    border: none; background: none;
    color: var(--text-3);
    cursor: pointer;
    transition: all 0.12s;
    flex-shrink: 0;
}
.date-picker .dp-today:hover { background: var(--sky-bg); color: var(--sky); }

/* ── Calendar popup ── */
.cal-popup {
    display: none;
    position: fixed;
    width: 260px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    padding: 10px;
    z-index: 9999;
}
.cal-popup.open { display: block; }
.cal-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 8px;
}
.cal-title { font-size: 0.78rem; font-weight: 700; color: var(--text); }
.cal-nav {
    display: flex; align-items: center; justify-content: center;
    width: 26px; height: 26px;
    border: none; border-radius: 6px;
    background: none; color: var(--text-3);
    cursor: pointer; transition: all 0.12s;
}
.cal-nav:hover { background: var(--bg); color: var(--text); }
.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    text-align: center;
}
.cal-wday { font-size: 0.6rem; font-weight: 600; color: var(--text-3); padding: 4px 0; }
.cal-day {
    display: flex; align-items: center; justify-content: center;
    width: 100%; aspect-ratio: 1;
    border: none; border-radius: 6px;
    background: none;
    font-family: var(--font);
    font-size: 0.72rem; font-weight: 500;
    color: var(--text);
    cursor: pointer;
    transition: all 0.1s;
}
.cal-day:hover { background: var(--bg); }
.cal-day.today { font-weight: 700; color: var(--sky); background: var(--sky-bg); }
.cal-day.selected { background: var(--sky); color: #fff; font-weight: 700; }
.cal-day.selected.today { background: var(--sky); color: #fff; }

.btn-fs {
    display: flex; align-items: center; justify-content: center;
    width: 30px; height: 30px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--white);
    color: var(--text-3);
    cursor: pointer;
    transition: all 0.15s;
}
.btn-fs:hover { background: var(--bg); color: var(--text); }

.btn-action {
    display: flex; align-items: center; gap: 5px;
    padding: 5px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--white);
    font-family: var(--font);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-2);
    cursor: pointer;
    transition: all 0.15s;
}
.btn-action:hover { background: var(--bg); color: var(--text); }
.btn-action.btn-chiudi { border-color: var(--green); color: var(--green); }
.btn-action.btn-chiudi:hover { background: var(--green-bg); }
.btn-action.btn-riapri { border-color: var(--amber); color: var(--amber); }
.btn-action.btn-riapri:hover { background: var(--amber-bg); }
.btn-action.btn-export { border-color: var(--sky); color: var(--sky); }
.btn-action.btn-export:hover { background: var(--sky-bg); }

.badge-chiusa {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px;
    border-radius: 99px;
    background: var(--red);
    font-size: 0.62rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* Confirm overlay */
.confirm-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.confirm-box {
    background: var(--white);
    border-radius: 14px;
    padding: 28px 32px;
    max-width: 380px;
    width: 90%;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}
.confirm-box h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 6px;
}
.confirm-box p {
    font-size: 0.82rem;
    color: var(--text-2);
    margin-bottom: 20px;
    line-height: 1.5;
}
.confirm-btns {
    display: flex; gap: 8px; justify-content: center;
}
.confirm-btns button {
    padding: 8px 20px;
    border: none;
    border-radius: 8px;
    font-family: var(--font);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.12s;
}
.confirm-btns .cb-cancel {
    background: var(--bg);
    color: var(--text-2);
}
.confirm-btns .cb-cancel:hover { background: var(--border); }
.confirm-btns .cb-confirm {
    background: var(--green);
    color: #fff;
}
.confirm-btns .cb-confirm:hover { background: #047857; }
.confirm-btns .cb-warn {
    background: var(--amber);
    color: #fff;
}
.confirm-btns .cb-warn:hover { background: #B45309; }

.board-stats { display: flex; gap: 10px; flex-shrink: 0; }
.bs { font-size: 0.72rem; font-weight: 500; color: var(--text-3); }
.bs-n { font-family: var(--mono); font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.bs-n.amber { color: var(--amber); }
.bs-n.green { color: var(--green); }
.bs-sep { color: var(--text-3); font-weight: 400; margin: 0 1px; }

/* ═══════════════════════════════════════
   IMPORT DRAWER
   ═══════════════════════════════════════ */
.btn-import-toggle {
    display: flex; align-items: center; gap: 5px;
    padding: 4px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--white);
    font-family: var(--font);
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-2);
    cursor: pointer;
    transition: all 0.15s;
}
.btn-import-toggle:hover { background: var(--bg); }

.import-drawer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}
.import-drawer.open { max-height: 160px; }

.import-drawer-inner { padding: 10px 24px; display: flex; gap: 28px; }

.import-block { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.import-label { font-size: 0.7rem; font-weight: 600; min-width: 48px; }
.import-label.lbl-ing { color: var(--sky); }
.import-label.lbl-usc { color: var(--orange); }

.dropzone {
    position: relative;
    display: flex; align-items: center; gap: 6px;
    padding: 10px 16px;
    border: 1.5px dashed var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--white);
    min-width: 200px;
}
.dropzone:hover { border-color: var(--text-3); background: var(--bg); }
.dropzone.drag-over { border-color: var(--sky); background: rgba(0,102,255,0.04); }
.dropzone-usc.drag-over { border-color: var(--orange); background: rgba(234,88,12,0.04); }
.dropzone.has-file { border-style: solid; border-color: var(--green); background: rgba(22,163,74,0.04); }
.dropzone svg { color: var(--text-3); flex-shrink: 0; }
.dropzone.has-file svg { color: var(--green); }
.dropzone-text { font-size: 0.68rem; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.dropzone.has-file .dropzone-text { color: var(--text-1); font-weight: 500; }
.dropzone-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.btn {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px; border: none; border-radius: 6px;
    font-size: 0.7rem; font-weight: 600;
    cursor: pointer; transition: all 0.15s;
}
.btn:active { transform: scale(0.97); }
.btn-sky { background: var(--sky); color: #fff; }
.btn-sky:hover { background: #0055DD; }
.btn-ora { background: var(--orange); color: #fff; }
.btn-ora:hover { background: #D04500; }
.btn:disabled { opacity: 0.35; cursor: not-allowed; }

.import-msg { font-size: 0.7rem; font-weight: 500; padding: 5px 24px; display: none; }
.import-msg.ok { display: block; color: var(--green); }
.import-msg.err { display: block; color: var(--red); }

/* ═══════════════════════════════════════
   BOARD SPLIT — Two panels side by side
   ═══════════════════════════════════════ */
.board-split {
    flex: 1;
    display: flex;
    min-height: 0;
    background: var(--bg);
    gap: 0;
}

.panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    background: var(--white);
}

.panel-drag-over {
    outline: 2px dashed var(--sky);
    outline-offset: -4px;
    background: rgba(56,189,248,0.04);
}

.panel-divider {
    width: 3px;
    background: var(--bg);
    flex-shrink: 0;
}

/* ── Panel header ── */
.panel-head {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 20px;
    flex-shrink: 0;
}

.panel-head h2 {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.panel-head svg { flex-shrink: 0; }

.panel-head.ing {
    color: var(--sky);
    background: var(--sky-bg);
    border-bottom: 2px solid var(--sky);
}
.panel-head.usc {
    color: var(--orange);
    background: var(--orange-bg);
    border-bottom: 2px solid var(--orange);
}

.panel-cnt {
    font-family: var(--mono);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 99px;
    font-variant-numeric: tabular-nums;
    background: rgba(255,255,255,0.7);
}

.panel-head.ing .panel-cnt { color: var(--sky); }
.panel-head.usc .panel-cnt { color: var(--orange); }

/* ── Search bar ── */
.panel-search {
    flex-shrink: 0;
    padding: 6px 10px;
    background: var(--white);
}

.panel-search-input {
    width: 100%;
    padding: 6px 10px 6px 30px;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    font-family: var(--font);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text);
    background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") 10px center no-repeat;
    outline: none;
    transition: border-color 0.15s;
}
.panel-search-input:focus { border-color: var(--sky); background-color: var(--white); }
.panel-search-input::placeholder { color: var(--text-3); }

/* ── Panel body ── */
.panel-body {
    flex: 1;
    overflow: hidden;
    min-height: 0;
    padding: 6px 10px;
}

/* ── Page selector ── */
.panel-page {
    flex-shrink: 0;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border-top: 1px solid var(--border-light);
}

.pager {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 0;
}

.pager-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 6px;
    background: none;
    color: var(--text-3);
    cursor: pointer;
    transition: all 0.12s;
}
.pager-arrow:hover { background: var(--white); color: var(--text); }

.pager-dot {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    border: none;
    border-radius: 6px;
    background: none;
    font-family: var(--mono);
    font-size: 0.66rem;
    font-weight: 600;
    color: var(--text-3);
    cursor: pointer;
    transition: all 0.12s;
    padding: 0 4px;
}
.pager-dot:hover { background: var(--white); color: var(--text); }
.pager-dot.active {
    background: var(--text);
    color: var(--white);
}

/* ═══════════════════════════════════════
   CARDS
   ═══════════════════════════════════════ */
.card {
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    margin-bottom: 6px;
    background: var(--white);
    transition: all 0.12s;
}

.card.clickable { cursor: pointer; }
.card.clickable:hover {
    border-color: var(--sky);
    box-shadow: 0 0 0 1px var(--sky-bg);
}

.card[data-stato="RIMOSSO"] { opacity: 0.2; }
.card[data-stato="TERMINATO"] { opacity: 0.45; }

/* Card row: left + right */
.card-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.card-left {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.card-line1 {
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-line2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.card-buono {
    font-family: var(--mono);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
}

.card-note {
    font-size: 0.68rem;
    color: var(--text-3);
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.card-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.card-dest {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-art {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-2);
    white-space: nowrap;
}

.card-vett {
    font-size: 0.7rem;
    color: var(--text-3);
    white-space: nowrap;
}

/* ── Tags ── */
.tag {
    display: inline-flex;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 0.56rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    flex-shrink: 0;
}
.tag-corepla { background: var(--sky-bg); color: var(--sky); }
.tag-coripet { background: rgba(139,92,246,0.08); color: #7C3AED; }
.tag-nuovo { background: rgba(220,38,38,0.08); color: var(--red); }

/* ── Status pills ── */
.status {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 0.68rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.status-dot { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }

.status-PROGRAMMATO { background: var(--sky-bg); color: var(--sky); }
.status-PROGRAMMATO .status-dot { background: var(--sky); }

.status-IN_ATTESA { background: var(--violet-bg); color: var(--violet); }
.status-IN_ATTESA .status-dot { background: var(--violet); animation: blink 1.2s ease infinite; }

.status-IN_CORSO { background: var(--amber-bg); color: var(--amber); }
.status-IN_CORSO .status-dot { background: var(--amber); animation: blink 1.2s ease infinite; }

.status-TERMINATO { background: var(--green-bg); color: var(--green); }
.status-TERMINATO .status-dot { background: var(--green); }

.status-RIMOSSO { background: #F3F3F3; color: var(--text-3); }
.status-RIMOSSO .status-dot { background: var(--text-3); }

/* ── Empty state ── */
.empty-board {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 100px;
}
.empty-board p { font-size: 0.85rem; color: var(--text-3); font-weight: 500; }

/* ═══════════════════════════════════════
   LANDING — Split Board
   ═══════════════════════════════════════ */
.landing {
    background: #FAFBFC;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

.landing-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

/* ── Hero (left) ── */
.lg-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    position: relative;
    background: var(--text);
    overflow: hidden;
}
.lg-hero::before {
    content: '';
    position: absolute;
    width: 500px; height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0,102,255,0.15) 0%, transparent 70%);
    top: -20%; right: -15%;
    pointer-events: none;
}
.lg-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 59px,
        rgba(255,255,255,0.03) 59px,
        rgba(255,255,255,0.03) 60px
    );
    pointer-events: none;
}

.lg-hero-inner {
    position: relative; z-index: 1;
    display: flex; flex-direction: column;
    gap: 1.6rem;
}

/* Live tag */
.lg-tag {
    display: inline-flex; align-items: center; gap: 6px;
    font-family: var(--mono);
    font-size: 0.65rem;
    font-weight: 600;
    color: rgba(255,255,255,0.5);
    letter-spacing: 0.18em;
    text-transform: uppercase;
}
.lg-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #22c55e;
    animation: dotPulse 2s ease-in-out infinite;
}
@keyframes dotPulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34,197,94,0.4); }
    50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(34,197,94,0); }
}

/* Clock */
.lg-clock {
    display: flex;
    align-items: baseline;
    gap: 2px;
    line-height: 1;
}
.lg-h, .lg-m {
    font-family: var(--mono);
    font-size: 5.5rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
}
.lg-sep {
    font-family: var(--mono);
    font-size: 5rem;
    font-weight: 300;
    color: rgba(255,255,255,0.5);
    margin: 0 2px;
    transition: opacity 0.3s ease;
}
.lg-s {
    font-family: var(--mono);
    font-size: 1.4rem;
    font-weight: 500;
    color: rgba(255,255,255,0.3);
    margin-left: 6px;
    align-self: flex-end;
    margin-bottom: 0.55rem;
    font-variant-numeric: tabular-nums;
}

.lg-date {
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 500;
    color: rgba(255,255,255,0.4);
    letter-spacing: 0.01em;
    margin-top: -0.6rem;
}

/* Brand */
.lg-brand {
    display: flex; flex-direction: column; gap: 2px;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.lg-brand-name {
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 700;
    color: rgba(255,255,255,0.6);
    letter-spacing: 0.2em;
}
.lg-brand-sub {
    font-size: 0.68rem;
    font-weight: 500;
    color: rgba(255,255,255,0.25);
    letter-spacing: 0.02em;
}

/* ── Navigation (right) ── */
.lg-nav {
    display: flex; flex-direction: column;
    justify-content: center;
    padding: 3rem;
    gap: 16px;
}

.lg-card {
    display: flex; flex-direction: column;
    padding: 28px 28px 24px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 16px;
    text-decoration: none; color: var(--text);
    position: relative;
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.lg-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.lg-card:hover::before {
    transform: scaleX(1);
}
.lg-card-a::before { background: var(--sky); }
.lg-card-b::before { background: var(--orange); }

.lg-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.06);
    border-color: transparent;
}

/* Number */
.lg-card-num {
    font-family: var(--mono);
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-3);
    letter-spacing: 0.1em;
    margin-bottom: 20px;
    opacity: 0.5;
}

.lg-card-body {
    display: flex; align-items: flex-start; gap: 16px;
}

.lg-card-icon {
    width: 48px; height: 48px;
    border-radius: 14px;
    display: grid; place-items: center;
    flex-shrink: 0;
}
.lg-card-icon svg { width: 24px; height: 24px; }
.lg-card-a .lg-card-icon { background: var(--sky-bg); color: var(--sky); }
.lg-card-b .lg-card-icon { background: var(--orange-bg); color: var(--orange); }

.lg-card-text {
    display: flex; flex-direction: column; gap: 4px;
    flex: 1; min-width: 0;
    padding-top: 2px;
}
.lg-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.lg-card-desc {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-3);
    line-height: 1.4;
}

.lg-card-go {
    position: absolute;
    bottom: 24px; right: 24px;
    width: 36px; height: 36px;
    border-radius: 10px;
    background: var(--bg);
    display: grid; place-items: center;
    color: var(--text-3);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.lg-card-go svg { width: 18px; height: 18px; }
.lg-card-a:hover .lg-card-go { background: var(--sky); color: #fff; transform: translateX(3px); }
.lg-card-b:hover .lg-card-go { background: var(--orange); color: #fff; transform: translateX(3px); }

/* ── Footer ── */
.lg-footer {
    position: absolute;
    bottom: 16px; right: 24px;
    display: flex; align-items: center; gap: 8px;
    font-size: 0.62rem;
    font-weight: 500;
    color: var(--text-3);
    z-index: 2;
    letter-spacing: 0.02em;
}
.lg-footer-sep {
    width: 3px; height: 3px;
    border-radius: 50%;
    background: var(--border);
}

/* ── Mobile: stack vertically ── */
@media (max-width: 768px) {
    .landing-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }
    .lg-hero {
        padding: 2.5rem 2rem 2rem;
    }
    .lg-h, .lg-m { font-size: 3.8rem; }
    .lg-sep { font-size: 3.4rem; }
    .lg-s { font-size: 1rem; margin-bottom: 0.35rem; }
    .lg-nav {
        padding: 1.5rem;
        gap: 12px;
    }
    .lg-card { padding: 22px 22px 20px; }
    .lg-footer {
        position: relative;
        bottom: auto; right: auto;
        justify-content: center;
        padding-bottom: 1rem;
    }
}

/* ═══════════════════════════════════════
   FULLSCREEN OVERRIDES
   ═══════════════════════════════════════ */
.page-fs .topbar {
    height: 72px;
    min-height: 72px;
    border-bottom: none;
    background: #111;
}
.page-fs .topbar-logo { display: none; }
.page-fs .topbar-mid {
    position: static;
    transform: none;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    flex: 1;
}
.page-fs .topbar-clock {
    font-size: 3.2rem;
    color: var(--white);
    order: 2;
    flex: 1;
    text-align: center;
}
.page-fs .topbar-date {
    color: rgba(255,255,255,0.5);
    order: 3;
    display: none;
}
.page-fs .topbar-stats {
    display: flex;
    margin-top: 0;
    order: 1;
    flex-shrink: 0;
}
.page-fs .topbar-stats .completion-pct {
    font-size: 1.2rem;
    color: #4ADE80;
}
.page-fs .topbar-stats .bs { color: rgba(255,255,255,0.5); }
.page-fs .topbar-stats .bs-n { color: rgba(255,255,255,0.9); }
.page-fs .topbar-stats .bs-n.green { color: #4ADE80; }
.page-fs .topbar-stats .bs-n.amber { color: #FBBF24; }
.page-fs .topbar-stats .bs-sep { color: rgba(255,255,255,0.3); }
.page-fs .topbar-stats .live-pill { display: none; }
.page-fs .topbar-right { display: none; }
.page-fs .import-drawer { display: none; }
.page-fs .panel-search { display: none; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0s !important; transition-duration: 0s !important; }
}

/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */
@media (max-width: 1024px) {
    .topbar { padding: 0 12px; }
    .topbar-mid { position: static; transform: none; }
    .panel-head { padding: 10px 14px; }
    .panel-head h2 { font-size: 1.1rem; }
    .panel-body { padding: 4px 8px; }
    .card { padding: 8px 10px; }
    .card-buono { font-size: 0.82rem; }
    .card-dest { font-size: 0.78rem; }
}

@media (max-width: 768px) {
    .topbar-logo span { display: none; }
    .btn-action { padding: 5px 10px; font-size: 0.64rem; }
    .btn-action svg { display: none; }
}

@media (max-width: 640px) {
    .topbar-stats .live-pill { display: none; }
    .board-split { flex-direction: column; }
    .panel-divider { width: auto; height: 3px; }
    .import-block { flex-wrap: wrap; }
    .btn-action { padding: 4px 8px; font-size: 0.6rem; }
}

/* ═══════════════════════════════════════
   INFO PAGE
   ═══════════════════════════════════════ */
.page-info { display: flex; flex-direction: column; }

.info-tabs { display: flex; gap: 2px; background: var(--border); border-radius: 8px; padding: 2px; }
.info-tab {
    padding: 5px 14px; border: none; background: transparent; border-radius: 6px;
    font-family: var(--font); font-size: 0.72rem; font-weight: 600; color: var(--text-3);
    cursor: pointer; transition: all 0.15s;
}
.info-tab:hover { color: var(--text-2); }
.info-tab.active { background: var(--white); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }

.info-panel { flex: 1; display: flex; flex-direction: column; padding: 16px 24px; overflow: hidden; }
.info-panel.hidden { display: none; }

.info-toolbar {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 0; flex-shrink: 0;
}
.info-field-label { font-size: 0.72rem; font-weight: 600; color: var(--text-2); }
.info-date-input {
    font-family: var(--mono); font-size: 0.72rem; padding: 5px 10px;
    border: 1px solid var(--border); border-radius: 6px; background: var(--white); color: var(--text);
}
.info-count { font-size: 0.72rem; font-weight: 500; color: var(--text-3); margin-left: auto; }

.info-section { margin-top: 20px; }
.info-section-title { font-size: 0.8rem; font-weight: 700; color: var(--text); margin-bottom: 8px; }

.info-table-wrap { flex: 1; overflow: auto; border: 1px solid var(--border); border-radius: 8px; background: var(--white); }

.info-table { width: 100%; border-collapse: collapse; font-size: 0.72rem; }
.info-table thead { position: sticky; top: 0; z-index: 1; }
.info-table th {
    text-align: left; padding: 8px 12px; background: var(--bg);
    font-weight: 600; color: var(--text-2); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.03em;
    border-bottom: 1px solid var(--border);
}
.info-table td { padding: 7px 12px; border-bottom: 1px solid var(--border-light); color: var(--text); }
.info-table tbody tr:hover { background: var(--bg); }
.info-table tbody tr:last-child td { border-bottom: none; }

.cell-mono { font-family: var(--mono); font-size: 0.7rem; }
.cell-durata { font-weight: 600; color: var(--sky); }
.row-outlier { opacity: 0.4; }
.row-outlier .cell-durata { color: var(--red); }

/* Action badges */
.act-badge {
    display: inline-block; padding: 2px 8px; border-radius: 4px;
    font-size: 0.65rem; font-weight: 600; white-space: nowrap;
}
.act-import { background: var(--violet-bg); color: var(--violet); }
.act-corso { background: var(--amber-bg); color: var(--amber); }
.act-eff { background: var(--green-bg); color: var(--green); }
.act-revert { background: var(--orange-bg); color: var(--orange); }
.act-chiusura { background: var(--sky-bg); color: var(--sky); }
.act-riapri { background: var(--orange-bg); color: var(--orange); }

/* Percentage bar */
.pct-bar-wrap {
    position: relative; height: 18px; background: var(--bg); border-radius: 4px; overflow: hidden;
}
.pct-bar { height: 100%; border-radius: 4px; transition: width 0.3s; min-width: 2px; }
.pct-label {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-size: 0.65rem; font-weight: 700; color: var(--text);
}

/* PIN modal */
.pin-overlay {
    position: fixed; inset: 0; z-index: 2000;
    background: var(--bg);
    display: flex; align-items: center; justify-content: center;
}
.pin-box {
    background: var(--white); border: 1px solid var(--border); border-radius: 16px;
    padding: 36px 40px; text-align: center; width: 340px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.06);
}
.pin-icon { color: var(--text-3); margin-bottom: 12px; }
.pin-box h2 { font-size: 1.05rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.pin-box p { font-size: 0.75rem; color: var(--text-3); margin-bottom: 18px; }
.pin-field {
    display: block; width: 100%; padding: 10px 14px; margin-bottom: 10px;
    border: 1.5px solid var(--border); border-radius: 8px; font-family: var(--mono);
    font-size: 1.1rem; text-align: center; letter-spacing: 0.3em;
    background: var(--bg); color: var(--text); outline: none; transition: border-color 0.2s;
}
.pin-field:focus { border-color: var(--sky); }
.pin-btn { width: 100%; padding: 10px; font-size: 0.8rem; border-radius: 8px; margin-top: 4px; }
.pin-error { font-size: 0.72rem; color: var(--red); margin-top: 10px; min-height: 18px; }

.admin-sep { width: 1px; height: 22px; background: var(--border); margin: 0 6px; }

/* Tempi footer stats */
.tempi-footer {
    display: flex; gap: 20px; padding: 12px 16px; flex-shrink: 0;
    background: var(--white); border: 1px solid var(--border); border-radius: 8px; margin-top: 10px;
}
.tempi-footer:empty { display: none; }
.tempi-stat { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.tempi-stat-label { font-size: 0.62rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-3); }
.tempi-stat-value { font-family: var(--mono); font-size: 0.9rem; font-weight: 700; color: var(--sky); }
.tempi-stat-value.ing { color: var(--sky); }
.tempi-stat-value.usc { color: var(--orange); }
.tempi-stat-value.muted { color: var(--text-3); font-size: 0.8rem; }

.empty-cell { text-align: center; padding: 24px 12px !important; color: var(--text-3); line-height: 1.6; }

/* Admin gear + drawer */
.btn-gear {
    width: 30px; height: 30px; border: none; background: transparent; border-radius: 6px;
    color: var(--text-3); cursor: pointer; display: flex; align-items: center; justify-content: center;
    opacity: 0.3; transition: all 0.2s;
}
.btn-gear:hover { opacity: 1; color: var(--text-2); background: var(--bg); }

.admin-drawer {
    max-height: 0; overflow: hidden; transition: max-height 0.25s ease;
    background: var(--bg); border-bottom: 1px solid var(--border);
}
.admin-drawer.open { max-height: 60px; }
.admin-inner {
    display: flex; align-items: center; gap: 10px; padding: 10px 24px;
}
.admin-label { font-size: 0.72rem; font-weight: 600; color: var(--red); }
.btn-danger {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px; border: none; border-radius: 6px;
    font-size: 0.7rem; font-weight: 600; cursor: pointer;
    background: var(--red); color: #fff; transition: all 0.15s;
}
.btn-danger:hover { background: #b91c1c; }

/* No-show improved */
.noshow-toolbar {
    display: flex; align-items: center; gap: 10px; margin: 6px 0 4px;
}
.noshow-toolbar .panel-search-input {
    max-width: 280px; font-size: 0.72rem; padding: 5px 10px;
}
.noshow-wrap { max-height: 300px; }
.noshow-prov { font-weight: 600; }
.noshow-cnt {
    display: inline-block; min-width: 28px; padding: 2px 8px; border-radius: 10px;
    background: rgba(220,38,38,0.08); color: var(--red); font-weight: 700; text-align: center;
    font-size: 0.75rem;
}

/* Clickable riepilogo rows */
.riep-row { cursor: pointer; transition: background 0.15s; }
.riep-row:hover { background: var(--sky-bg) !important; }

/* Day detail popup */
.day-popup-overlay {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(0,0,0,0.4); backdrop-filter: blur(2px);
    display: flex; align-items: center; justify-content: center;
    animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.day-popup-inner {
    background: var(--white); border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    width: 90%; max-width: 820px; max-height: 85vh; display: flex; flex-direction: column;
    overflow: hidden;
}
.day-popup-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.day-popup-header h2 { font-size: 0.95rem; font-weight: 700; color: var(--text); }
.day-popup-close {
    width: 28px; height: 28px; border: none; background: var(--bg); border-radius: 6px;
    font-size: 1.1rem; color: var(--text-3); cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.day-popup-close:hover { background: var(--border); color: var(--text); }

.day-popup-stats {
    display: flex; align-items: center; gap: 16px; padding: 12px 20px;
    background: var(--bg); border-bottom: 1px solid var(--border);
}
.dps { font-size: 0.72rem; font-weight: 500; color: var(--text-2); }
.dps-n { font-weight: 700; font-size: 0.85rem; margin-right: 3px; }
.dps-n.green { color: var(--green); }
.dps-n.amber { color: var(--amber); }
.dps-n.red { color: var(--red); }
.dps-n.muted { color: var(--text-3); }
.dps-bar { margin-left: auto; }

.day-popup-body { padding: 16px 20px; overflow-y: auto; flex: 1; }
.day-popup-body h3 { font-size: 0.78rem; font-weight: 700; color: var(--text-2); margin-bottom: 6px; }
.day-popup-body .info-table { font-size: 0.7rem; }
.day-popup-body .info-table th { font-size: 0.65rem; }

/* ═══════════════════════════════════════
   COMPACT BOARD (Info page)
   ═══════════════════════════════════════ */
.compact-board {
    flex: 1; display: flex; gap: 0; min-height: 0; overflow: hidden;
    border: 1px solid var(--border); border-radius: 8px; background: var(--white);
}
.compact-col { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.compact-divider { width: 2px; background: var(--border); flex-shrink: 0; }

.compact-col-head {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 14px; font-size: 0.78rem; font-weight: 700;
    flex-shrink: 0; border-bottom: 2px solid;
}
.compact-col-head.ing { color: var(--sky); background: var(--sky-bg); border-color: var(--sky); }
.compact-col-head.usc { color: var(--orange); background: var(--orange-bg); border-color: var(--orange); }

.compact-cnt {
    font-family: var(--mono); font-size: 0.7rem; font-weight: 700;
    padding: 1px 7px; border-radius: 99px;
    background: rgba(255,255,255,0.7); font-variant-numeric: tabular-nums;
}

.compact-col-body { flex: 1; overflow-y: auto; padding: 4px 6px; }

.compact-row {
    display: flex; align-items: center; gap: 6px;
    padding: 4px 8px; border-radius: 5px;
    font-size: 0.7rem; transition: background 0.12s;
    border-bottom: 1px solid var(--border-light);
}
.compact-row:last-child { border-bottom: none; }
.compact-row:hover { background: var(--bg); }
.compact-row.row-new { background: rgba(220,38,38,0.12); }
.compact-row.row-new:hover { background: rgba(220,38,38,0.18); }

.cr-dot {
    width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
}
.s-PROGRAMMATO .cr-dot { background: var(--sky); }
.s-IN_ATTESA .cr-dot { background: var(--violet); animation: blink 1.2s ease infinite; }
.s-IN_CORSO .cr-dot { background: var(--amber); animation: blink 1.2s ease infinite; }
.s-TERMINATO .cr-dot { background: var(--green); }
.s-TERMINATO { opacity: 0.5; }

.cr-buono { font-family: var(--mono); font-weight: 700; font-size: 0.72rem; white-space: nowrap; }
.cr-dest { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.cr-vett { color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.cr-art { color: var(--text-2); font-size: 0.66rem; white-space: nowrap; }
.cr-note { color: var(--text-3); font-style: italic; font-size: 0.64rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100px; }

.cr-tag {
    display: inline-block; padding: 0 4px; border-radius: 3px;
    font-size: 0.54rem; font-weight: 700; text-transform: uppercase;
    background: var(--sky-bg); color: var(--sky); letter-spacing: 0.02em;
}
.cr-tag-new { background: rgba(220,38,38,0.08); color: var(--red); }

.cr-stato {
    margin-left: auto; font-size: 0.6rem; font-weight: 600;
    padding: 1px 6px; border-radius: 3px; white-space: nowrap; flex-shrink: 0;
}
.s-PROGRAMMATO .cr-stato { background: var(--sky-bg); color: var(--sky); }
.s-IN_ATTESA .cr-stato { background: var(--violet-bg); color: var(--violet); }
.s-IN_CORSO .cr-stato { background: var(--amber-bg); color: var(--amber); }
.s-TERMINATO .cr-stato { background: var(--green-bg); color: var(--green); }

.compact-empty {
    display: flex; align-items: center; justify-content: center;
    height: 100%; min-height: 60px;
    font-size: 0.75rem; color: var(--text-3); font-weight: 500;
}

/* Board mini stats */
.board-mini-stats {
    display: flex; align-items: center; gap: 10px; margin-left: auto;
}
.bms {
    font-family: var(--mono); font-size: 0.9rem; font-weight: 800;
    color: var(--sky); font-variant-numeric: tabular-nums;
}
.bms-d { font-size: 0.68rem; font-weight: 500; color: var(--text-3); }
.bms-n { font-family: var(--mono); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }
.bms-n.amber { color: var(--amber); }
.bms-n.green { color: var(--green); }

/* Log filter chips */
.log-filters { display: flex; gap: 3px; }
.log-chip {
    padding: 3px 10px; border: 1px solid var(--border); border-radius: 99px;
    background: var(--white); font-family: var(--font); font-size: 0.64rem;
    font-weight: 600; color: var(--text-3); cursor: pointer; transition: all 0.15s;
    white-space: nowrap;
}
.log-chip:hover { border-color: var(--text-3); color: var(--text-2); }
.log-chip.active { background: var(--text); border-color: var(--text); color: var(--white); }

/* Landing card-c (third card) */
.lg-card-c { --card-accent: var(--violet); }
.lg-card-c .lg-card-num { color: var(--violet); }
.lg-card-c .lg-card-icon { background: var(--violet-bg); color: var(--violet); }
.lg-card-c:hover { border-color: var(--violet); box-shadow: 0 0 0 1px var(--violet), 0 8px 32px rgba(124,58,237,0.08); }
.lg-card-c .lg-card-go { color: var(--violet); }

/* Landing card-d (Guardiania) */
.lg-card-d { --card-accent: var(--green); }
.lg-card-d .lg-card-num { color: var(--green); }
.lg-card-d .lg-card-icon { background: var(--green-bg); color: var(--green); }
.lg-card-d:hover { border-color: var(--green); box-shadow: 0 0 0 1px var(--green), 0 8px 32px rgba(16,185,129,0.08); }
.lg-card-d .lg-card-go { color: var(--green); }

/* Landing card-e (Logistics Team) */
.lg-card-e { --card-accent: var(--amber); }
.lg-card-e .lg-card-num { color: var(--amber); }
.lg-card-e .lg-card-icon { background: var(--amber-bg); color: var(--amber); }
.lg-card-e:hover { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber), 0 8px 32px rgba(245,158,11,0.10); }
.lg-card-e .lg-card-go { color: var(--amber); }

/* Landing grid: 3 cards */
@media (min-width: 769px) {
    .lg-nav { grid-template-columns: 1fr; }
}
