﻿    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    :root {
      --primary: #111827; --primary-dark: #000000; --accent: #374151;
      --sidebar-bg: #111827; --sidebar-text: #9ca3af;
      --bg: #f3f4f6; --card: #ffffff; --border: #e5e7eb;
      --text: #111827; --text-muted: #6b7280;
      --danger: #ef4444; --success: #22c55e; --warning: #f59e0b;
      --slot-active: #22c55e; --slot-active-text: #ffffff;
      --slot-ferie: #111827; --slot-malattia: #ef4444;
      --slot-permesso: #f97316;
      --slot-riposo: #d1d5db;
    }
    html { overflow-x: hidden; max-width: 100vw; }
    body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; -webkit-user-select:none; user-select:none; overflow-x: hidden; max-width: 100vw; }

    /* ===== LOGIN ===== */
    #login-screen { display:none; align-items:center; justify-content:center; min-height:100vh; background:#111827; }
    #login-screen.active { display:flex; }
    .login-card { background:white; border-radius:20px; padding:48px 40px; width:100%; max-width:400px; box-shadow:0 30px 60px rgba(0,0,0,0.35); }
    .login-logo { text-align:center; margin-bottom:32px; }
    .login-logo .brand { font-size:22px; font-weight:800; color:#111827; }
    .login-logo .sub { font-size:12px; color:var(--text-muted); margin-top:4px; }
    .form-group { margin-bottom:18px; }
    .form-group label { display:block; font-size:11px; font-weight:700; color:var(--text-muted); margin-bottom:6px; text-transform:uppercase; letter-spacing:.5px; }
    .form-group input:not([type=checkbox]), .form-group select { width:100%; padding:10px 14px; border:1.5px solid var(--border); border-radius:10px; font-size:15px; transition:border .15s,box-shadow .15s; }
    .form-group input:not([type=checkbox]):focus, .form-group select:focus { outline:none; border-color:#6b7280; box-shadow:0 0 0 3px rgba(107,114,128,.15); }
    .form-group input[type=checkbox]:focus { outline:none; box-shadow:none; }
    .btn { display:inline-flex; align-items:center; gap:6px; padding:10px 20px; border:none; border-radius:10px; font-size:14px; font-weight:600; cursor:pointer; transition:all .15s; }
    /* interruttore stile iOS (verde = attivo) */
    .toggle-switch { display:inline-flex; align-items:center; gap:8px; cursor:pointer; user-select:none; font-size:12px; font-weight:700; color:var(--text-muted); }
    .toggle-switch .ts-track { width:40px; height:22px; border-radius:11px; background:#cbd5e1; position:relative; transition:background .2s; flex-shrink:0; }
    .toggle-switch .ts-knob { position:absolute; top:2px; left:2px; width:18px; height:18px; border-radius:50%; background:white; transition:left .2s; box-shadow:0 1px 3px rgba(0,0,0,.25); }
    .toggle-switch.on .ts-track { background:#22c55e; }
    .toggle-switch.on .ts-knob { left:20px; }
    .toggle-switch.on { color:#16a34a; }
    .btn-primary { background:#111827; color:white; }
    .btn-primary:hover { background:#000; transform:translateY(-1px); box-shadow:0 4px 12px rgba(0,0,0,.25); }
    .btn-full { width:100%; justify-content:center; padding:12px; }
    .btn-sm { padding:6px 12px; font-size:13px; }
    .btn-danger { background:#ef4444; color:white; }
    .btn-danger:hover { background:#dc2626; transform:translateY(-1px); }
    .btn-ghost { background:transparent; color:var(--text-muted); border:1.5px solid var(--border); }
    .btn-ghost:hover { background:var(--bg); color:var(--text); }
    .error-msg { color:var(--danger); font-size:13px; margin-top:6px; display:none; }

    /* ===== LAYOUT ===== */
    #app { display:none; height:100svh; }
    #app.active { display:flex; }
    .sidebar { width:230px; min-width:230px; background:#111827; display:flex; flex-direction:column; height:100svh; position:sticky; top:0; box-shadow:2px 0 12px rgba(0,0,0,.15); transition:transform .25s ease; z-index:200; }
    .sidebar-header { padding:24px 20px 18px; border-bottom:1px solid rgba(255,255,255,.07); }
    .sidebar-brand { font-size:14px; font-weight:800; color:white; letter-spacing:.3px; }
    .sidebar-sub { font-size:11px; color:var(--sidebar-text); margin-top:3px; opacity:.7; }
    .sidebar-nav { flex:1; padding:12px 0; overflow-y:auto; }
    .nav-section-label { padding:12px 20px 4px; font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:1.2px; color:#4b5563; }
    .nav-item { display:flex; align-items:center; gap:10px; padding:10px 20px; color:var(--sidebar-text); cursor:pointer; font-size:13px; font-weight:500; transition:all .15s; margin:1px 8px; border-radius:8px; }
    .nav-item:hover { background:rgba(255,255,255,.07); color:white; }
    .nav-item.active { background:rgba(255,255,255,.12); color:white; border-left:3px solid white; border-radius:0 8px 8px 0; margin-left:0; padding-left:17px; }
    .nav-item svg { width:16px; height:16px; flex-shrink:0; }
    .sidebar-footer { padding:16px 20px; padding-bottom:calc(16px + env(safe-area-inset-bottom)); border-top:1px solid rgba(255,255,255,.07); }
    .user-avatar { width:34px; height:34px; border-radius:10px; background:#374151; display:flex; align-items:center; justify-content:center; font-size:13px; font-weight:700; color:white; flex-shrink:0; }
    .user-info { display:flex; align-items:center; gap:10px; }
    .user-name { font-size:12px; font-weight:700; color:white; }
    .user-role { font-size:11px; color:var(--sidebar-text); }
    .logout-btn { margin-top:10px; width:100%; background:rgba(255,255,255,.06); color:var(--sidebar-text); border:1px solid rgba(255,255,255,.08); border-radius:8px; padding:8px; font-size:12px; cursor:pointer; transition:all .15s; }
    .logout-btn:hover { background:rgba(239,68,68,.18); color:#fca5a5; border-color:rgba(239,68,68,.25); }

    /* Overlay mobile */
    #sidebar-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,.5); z-index:150; }
    #sidebar-overlay.open { display:block; }

    /* Hamburger button */
    .hamburger { display:none; flex-direction:column; gap:5px; background:none; border:none; cursor:pointer; padding:6px; border-radius:8px; }
    .hamburger span { display:block; width:22px; height:2px; background:#111827; border-radius:2px; transition:all .2s; }

    /* ===== MAIN ===== */
    .main { flex:1; display:flex; flex-direction:column; min-width:0; overflow:hidden; }
    .topbar { background:#ffffff; border-bottom:1px solid var(--border); padding:13px 24px; display:flex; align-items:center; justify-content:space-between; flex-shrink:0; box-shadow:0 1px 4px rgba(0,0,0,.06); gap:12px; }
    .topbar-title { font-size:16px; font-weight:800; color:var(--text); letter-spacing:-.2px; }
    .topbar-actions { display:flex; gap:8px; align-items:center; }
    .content { flex:1; overflow-y:auto; padding:22px; }

    /* ===== TIMBRATURE – layout unico ===== */
    /* header negozio */
    .timb-neg-header { background:#111827; color:white; padding:13px 20px; display:flex; align-items:center; justify-content:space-between; gap:12px; flex-shrink:0; flex-wrap:wrap; }
    .timb-neg-name  { font-size:15px; font-weight:800; }
    .timb-neg-clock { font-size:22px; font-weight:800; font-variant-numeric:tabular-nums; color:white; }
    .timb-neg-date  { font-size:11px; color:rgba(255,255,255,.5); }
    .timb-neg-badge { display:flex; align-items:center; gap:5px; font-size:11px; padding:3px 9px; border-radius:20px; }
    .timb-neg-badge.ok      { background:rgba(34,197,94,.2);  color:#86efac; }
    .timb-neg-badge.err     { background:rgba(239,68,68,.2);  color:#fca5a5; }
    .timb-neg-badge.loading { background:rgba(255,255,255,.08); color:#9ca3af; }
    .timb-neg-select { background:rgba(255,255,255,.1); border:1px solid rgba(255,255,255,.2); color:white; border-radius:8px; padding:5px 10px; font-size:12px; cursor:pointer; }
    .timb-neg-select option { background:#111827; }
    /* ── TASK ── */
    .task-wrap { display:flex; flex-direction:column; height:100%; overflow:hidden; background:#f8fafc; }
    .task-topbar { background:#111827; color:white; padding:10px 20px; display:flex; align-items:center; gap:12px; flex-shrink:0; }
    .task-neg-select { background:rgba(255,255,255,.1); border:1px solid rgba(255,255,255,.2); color:white; border-radius:8px; padding:5px 10px; font-size:12px; }
    .task-neg-select option { background:#111827; }
    .task-neg-label { font-size:13px; font-weight:700; color:white; }
    .task-neg-msg { font-size:11px; color:#fca5a5; font-weight:600; margin-left:4px; }
    .task-week-nav { display:flex; align-items:center; gap:8px; margin-left:auto; }
    .task-nav-btn { background:rgba(255,255,255,.1); border:1px solid rgba(255,255,255,.2); color:white; border-radius:8px; width:30px; height:30px; cursor:pointer; font-size:16px; display:flex; align-items:center; justify-content:center; }
    .task-nav-btn:hover { background:rgba(255,255,255,.22); }
    .task-week-label { font-size:12px; font-weight:600; min-width:180px; text-align:center; }
    .task-today-btn { background:rgba(255,255,255,.1); border:1px solid rgba(255,255,255,.2); color:white; border-radius:8px; padding:0 12px; font-size:11px; font-weight:600; cursor:pointer; height:30px; display:flex; align-items:center; }
    .task-today-btn:hover { background:rgba(255,255,255,.22); }
    #task-clock { font-size:20px; font-weight:700; color:white; letter-spacing:1px; font-variant-numeric:tabular-nums; margin-left:auto; }
    .task-new-btn { position:absolute; bottom:24px; right:24px; background:#111827; color:white; border:none; border-radius:50px; padding:11px 20px; font-size:13px; font-weight:700; cursor:pointer; display:flex; align-items:center; gap:7px; box-shadow:0 4px 16px rgba(0,0,0,.25); z-index:10; transition:background .15s, transform .1s; }
    .task-new-btn:hover { background:#000; transform:translateY(-1px); }
    /* layout body */
    .task-body { flex:1; display:flex; overflow:hidden; }
    /* mini calendar sidebar */
    /* weekly view */
    /* ── Task calendar layout ── */
    .task-week-view { flex:1; display:flex; flex-direction:column; overflow:hidden; }
    /* sticky header row */
    .task-cal-header { display:grid; grid-template-columns:repeat(7,1fr); border-bottom:1px solid #e5e7eb; background:white; flex-shrink:0; z-index:2; }
    .task-cal-header-gutter { display:none; }
    .task-cal-head-cell { padding:10px 6px 11px; text-align:center; border-right:2px solid #e5e7eb; background:white; }
    .task-cal-head-cell:last-child { border-right:none; }
    .task-day-name { font-size:10px; font-weight:700; color:#9ca3af; text-transform:uppercase; letter-spacing:.5px; }
    .task-day-num { width:34px; height:34px; border-radius:50%; display:flex; align-items:center; justify-content:center; margin:4px auto 0; font-size:17px; font-weight:700; color:#111827; }
    .task-cal-head-cell.today .task-day-num { background:#111827; color:white; }
    .task-cal-head-cell.weekend .task-day-name { color:#f87171; }
    .task-cal-head-cell.weekend .task-day-num { color:#ef4444; }
    .task-cal-head-cell.today.weekend .task-day-num { background:#ef4444; color:white; }
    /* scrollable timeline */
    .task-cal-body { flex:1; overflow-y:auto; display:grid; grid-template-columns:repeat(7,1fr); background:white; }
    /* time gutter */
    .task-time-gutter { display:none; }
    /* day columns */
    .task-day-tcol { position:relative; border-right:2px solid #e5e7eb; background:white; }
    .task-day-tcol:last-child { border-right:none; }
    .task-hour-row { height:56px; border-bottom:1px solid #f3f4f6; }
    /* opening hours band */
    .task-open-band { position:absolute; left:0; right:0; background:transparent; pointer-events:none; }
    .task-day-tcol.chiuso { background:#fafafa; }
    .task-closed-label { position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); font-size:10px; color:#d1d5db; font-weight:700; letter-spacing:1px; text-transform:uppercase; pointer-events:none; }
    /* task cards inside timeline */
    .task-cards-layer { position:absolute; left:4px; right:4px; top:0; display:flex; flex-direction:column; gap:4px; padding-top:4px; }
    .task-card { background:white; border:1.5px solid #e5e7eb; border-radius:7px; padding:6px 7px; display:flex; align-items:flex-start; gap:7px; cursor:default; transition:box-shadow .15s; }
    .task-card:hover { box-shadow:0 2px 8px rgba(0,0,0,.08); }
    .task-card.done { background:#f0fdf4; border-color:#bbf7d0; }
    .task-card.done .task-card-title { text-decoration:line-through; color:#9ca3af; }
    .task-card-cb { width:16px; height:16px; border-radius:4px; border:2px solid #d1d5db; cursor:pointer; display:flex; align-items:center; justify-content:center; flex-shrink:0; margin-top:1px; transition:all .15s; background:white; }
    .task-card-cb.checked { background:#16a34a; border-color:#16a34a; }
    .task-card-cb svg { display:none; }
    .task-card-cb.checked svg { display:block; }
    .task-card-body { flex:1; min-width:0; }
    .task-card-title { font-size:11px; font-weight:600; color:#111827; line-height:1.3; word-break:break-word; }
    .task-card-by { font-size:10px; color:#16a34a; margin-top:2px; }
    .task-card-del { background:none; border:none; cursor:pointer; color:#e5e7eb; padding:1px; border-radius:4px; flex-shrink:0; line-height:0; }
    .task-card-del:hover { color:#ef4444; }
    /* modal task */
    #task-modal-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,.5); z-index:500; align-items:center; justify-content:center; }
    #task-modal-overlay.open { display:flex; }
    #task-modal-box { background:white; border-radius:16px; padding:28px; width:100%; max-width:440px; box-shadow:0 20px 60px rgba(0,0,0,.3); }
    #task-modal-box h3 { margin:0 0 20px; font-size:16px; color:#111827; }
    .task-form-field { display:flex; flex-direction:column; gap:6px; margin-bottom:16px; }
    .task-form-field label { font-size:12px; font-weight:600; color:#374151; }
    .task-form-field input, .task-form-field select { border:1.5px solid #d1d5db; border-radius:8px; padding:9px 12px; font-size:14px; outline:none; }
    .task-form-field input:focus, .task-form-field select:focus { border-color:#111827; }
    .task-giorni-wrap { display:flex; gap:6px; flex-wrap:wrap; }
    .task-gg-btn { border:1.5px solid #d1d5db; background:white; border-radius:8px; padding:6px 10px; font-size:12px; font-weight:600; cursor:pointer; color:#6b7280; }
    .task-gg-btn.sel { background:#111827; color:white; border-color:#111827; }
    .task-modal-actions { display:flex; gap:8px; justify-content:flex-end; margin-top:20px; }
    .task-orario-toggle { display:flex; align-items:center; gap:8px; cursor:pointer; user-select:none; font-size:13px; color:#374151; font-weight:600; }
    .task-orario-toggle input[type=checkbox] { width:16px; height:16px; accent-color:#111827; cursor:pointer; }
    .task-orario-row { display:flex; gap:12px; }
    .task-orario-row .task-form-field { flex:1; margin-bottom:0; }
    .task-card-time { font-size:10px; color:#6366f1; font-weight:700; margin-bottom:2px; }
    .task-card.done .task-card-time { color:#9ca3af; }
    /* modal PIN task */
    #task-pin-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,.55); z-index:600; align-items:center; justify-content:center; }
    #task-pin-overlay.open { display:flex; }
    #access-pin-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,.55); z-index:700; align-items:center; justify-content:center; }
    #access-pin-overlay.open { display:flex; }
    #task-pin-box { background:white; border-radius:20px; padding:28px 24px 22px; width:100%; max-width:320px; box-shadow:0 24px 64px rgba(0,0,0,.3); text-align:center; }
    #task-pin-box h3 { margin:0 0 4px; font-size:15px; color:#111827; }
    #task-pin-task-name { font-size:12px; color:#6b7280; margin-bottom:20px; }
    .task-pin-dots { display:flex; justify-content:center; gap:14px; margin-bottom:12px; }
    .task-pin-dot { width:20px; height:20px; border-radius:50%; border:2px solid #d1d5db; background:white; transition:all .12s; }
    .task-pin-dot.filled { background:#111827; border-color:#111827; }
    .task-pin-err { font-size:12px; color:#ef4444; text-align:center; min-height:16px; margin-bottom:10px; }
    .task-pin-pad { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin:0 auto 16px; }
    .task-pin-key { padding:18px 8px; border:1.5px solid #e5e7eb; border-radius:12px; background:white; font-size:22px; font-weight:700; cursor:pointer; transition:all .1s; touch-action:manipulation; }
    .task-pin-key:active { background:#f3f4f6; transform:scale(.94); }
    .task-pin-key.del { font-size:16px; background:#f3f4f6; color:#374151; }
    .task-pin-key.empty { visibility:hidden; }
    .task-pin-cancel { background:none; border:none; color:#9ca3af; font-size:12px; font-weight:600; cursor:pointer; padding:6px 12px; }
    .task-pin-cancel:hover { color:#374151; }
    .task-modal-cancel { background:#f3f4f6; color:#374151; border:none; border-radius:8px; padding:9px 16px; font-size:13px; font-weight:600; cursor:pointer; }
    .task-modal-save { background:#111827; color:white; border:none; border-radius:8px; padding:9px 20px; font-size:13px; font-weight:600; cursor:pointer; }
    .task-modal-save:hover { background:#000; }
    .task-fab { display:none; }
    /* spinner GPS */
    .timb-loading-wrap { display:flex; flex-direction:column; align-items:center; justify-content:center; height:100%; gap:16px; color:var(--text-muted); }
    .timb-spinner { width:36px; height:36px; border:3px solid #e5e7eb; border-top-color:#111827; border-radius:50%; animation:spin .7s linear infinite; }
    .timb-riep-table { table-layout:fixed; width:100%; }
    .timb-riep-table th, .timb-riep-table td { border:1px solid #e5e7eb; padding:6px 2px; text-align:center; overflow:hidden; height:36px; }
    .timb-riep-table th { background:#111827; color:white; font-weight:700; font-size:10px; position:sticky; top:0; z-index:2; }
    .timb-riep-table th.th-name { position:sticky; left:0; z-index:3; width:160px; min-width:160px; text-align:left; padding-left:8px; }
    .timb-riep-table th.th-weekend { color:#fca5a5; }
    .timb-riep-table th.th-noday { background:#374151; color:#6b7280; }
    .timb-riep-table th.th-tot { width:46px; min-width:46px; }
    .timb-riep-table th.th-nott { width:44px; min-width:44px; }
    .timb-riep-table th.th-premio { width:52px; min-width:52px; }
    .timb-riep-table td.td-name { position:sticky; left:0; background:white; font-weight:700; font-size:11px; text-align:left; z-index:1; padding-left:8px; white-space:nowrap; width:160px; min-width:160px; }
    .timb-riep-table td.td-ore { font-size:11px; font-weight:600; }
    .timb-riep-table td.td-vuoto { color:#d1d5db; font-size:10px; }
    .timb-riep-table td.td-clickable { cursor:pointer; position:relative; }
    .timb-riep-table td.td-clickable:hover { background:#f0f9ff !important; }
    .timb-riep-table td.td-corretto { background:#dbeafe !important; }
    .timb-riep-table td.td-corretto:hover { background:#bfdbfe !important; }
    .td-corr-badge { position:absolute; top:2px; right:2px; font-size:8px; color:#d97706; line-height:1; }
    .om-table td.td-corretto { background:#dbeafe !important; }
    .om-table td.td-corretto:hover { background:#bfdbfe !important; }
    /* timb-om-table: layout copiato da timb-riep-table (Ore Mese) */
    #timb-om-table th, #timb-om-table td { height:36px; padding:6px 2px; }
    #timb-om-table thead th.om-th-name { width:160px; min-width:160px; }
    #timb-om-table td.om-td-name       { width:160px; min-width:160px; font-size:11px; height:36px; max-height:36px; }
    #timb-om-table thead th.om-th-tot              { width:80px; min-width:80px; position:static; }
    #timb-om-table td.om-td-tot                    { height:36px; max-height:36px; position:static; border-left:1px solid #e5e7eb; }
    #timb-om-table .om-tfoot td.om-tf-tot          { position:static; border-left:1px solid #cbd5e1; }
    #timb-om-table tr                  { height:36px; max-height:36px; }
    /* modale correzione */
    #corr-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,.5); z-index:1000; align-items:center; justify-content:center; }
    #corr-overlay.open { display:flex; }
    #corr-box { background:white; border-radius:16px; padding:28px; width:100%; max-width:440px; box-shadow:0 20px 60px rgba(0,0,0,.3); }
    #corr-box h3 { margin:0 0 4px; font-size:15px; color:#111827; }
    #corr-box .corr-sub { font-size:12px; color:#6b7280; margin-bottom:16px; }
    #corr-pianificato { align-items:center; gap:8px; font-size:12px; color:#0369a1; background:#f0f9ff; border:1px solid #bae6fd; border-radius:8px; padding:8px 12px; margin-bottom:16px; }
    .corr-pair { display:flex; justify-content:space-between; align-items:center; padding:8px 12px; background:#f9fafb; border-radius:8px; margin-bottom:6px; font-size:12px; }
    .corr-pair-times { color:#374151; font-weight:600; }
    .corr-pair-ore { color:#6b7280; }
    .corr-divider { border:none; border-top:1px solid #e5e7eb; margin:16px 0; }
    .corr-field { display:flex; flex-direction:column; gap:6px; margin-bottom:16px; }
    .corr-field label { font-size:12px; font-weight:600; color:#374151; }
    .corr-field input { border:1.5px solid #d1d5db; border-radius:8px; padding:8px 12px; font-size:14px; outline:none; }
    .corr-field input:focus { border-color:#111827; }
    .corr-hint { font-size:11px; color:#9ca3af; }
    .corr-actions { display:flex; gap:8px; justify-content:flex-end; }
    .corr-btn-del { background:#fee2e2; color:#dc2626; border:none; border-radius:8px; padding:8px 14px; font-size:12px; font-weight:600; cursor:pointer; margin-right:auto; }
    .corr-btn-del:hover { background:#fecaca; }
    .corr-btn-cancel { background:#f3f4f6; color:#374151; border:none; border-radius:8px; padding:8px 14px; font-size:12px; font-weight:600; cursor:pointer; }
    .corr-btn-save { background:#111827; color:white; border:none; border-radius:8px; padding:8px 18px; font-size:12px; font-weight:600; cursor:pointer; }
    .corr-btn-save:hover { background:#000; }
    .corr-time-input { border:1.5px solid #d1d5db; border-radius:8px; padding:7px 10px; font-size:14px; outline:none; width:100%; box-sizing:border-box; }
    .corr-time-input:focus { border-color:#111827; }
    /* tab orario / stato */
    .corr-mode-tabs { display:flex; gap:6px; margin-bottom:14px; }
    .corr-mode-tab { flex:1; padding:8px; border:1.5px solid #e5e7eb; border-radius:8px; font-size:12px; font-weight:600; cursor:pointer; background:white; color:#6b7280; transition:all .12s; }
    .corr-mode-tab.active { background:#111827; color:white; border-color:#111827; }
    /* pulsanti stato correzione */
    .corr-stato-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-bottom:4px; }
    .corr-stato-btn { padding:12px 8px; border:2px solid transparent; border-radius:10px; font-size:12px; font-weight:700; cursor:pointer; text-align:center; transition:all .12s; }
    .corr-stato-btn:hover { filter:brightness(.95); }
    .corr-stato-btn.sel { box-shadow:0 0 0 3px #111827; }
    .corr-stato-btn-riposo   { background:#f3f4f6; color:#374151; border-color:#d1d5db; }
    .corr-stato-btn-ferie    { background:#e5e7eb; color:#111827; border-color:#9ca3af; }
    .corr-stato-btn-malattia { background:#fee2e2; color:#dc2626; border-color:#fca5a5; }
    .corr-stato-btn-permesso { background:#ffedd5; color:#c2410c; border-color:#fdba74; }
    .corr-stato-btn-chiuso   { background:#f1f5f9; color:#475569; border-color:#cbd5e1; }
    /* badge stato confermato nella tabella */
    .corr-stato-badge { display:inline-block; font-size:9px; font-weight:700; padding:1px 5px; border-radius:3px; border-style:solid; border-width:1px; letter-spacing:.3px; }
    .corr-stato-badge-riposo   { background:#e5e7eb; color:#374151; border-color:#9ca3af; }
    .corr-stato-badge-ferie    { background:#d1d5db; color:#111827; border-color:#6b7280; }
    .corr-stato-badge-malattia { background:#fecaca; color:#dc2626; border-color:#ef4444; }
    .corr-stato-badge-permesso { background:#fed7aa; color:#c2410c; border-color:#f97316; }
    .corr-stato-badge-chiuso   { background:#e2e8f0; color:#475569; border-color:#94a3b8; }
    .timb-riep-table td.td-noday { background:#f3f4f6; }
    .timb-riep-table tr:hover td { background:#f9fafb; }
    .timb-riep-table tr:hover td.td-name { background:#f3f4f6; }
    .timb-riep-table tfoot td { background:#f3f4f6; font-weight:700; font-size:11px; }
    /* badge "da coperture, da confermare" */
    .cop-hint { display:inline-block; font-size:9px; font-weight:700; padding:1px 4px; border-radius:3px; border-style:dashed; border-width:1px; opacity:.75; letter-spacing:.3px; }
    .cop-hint-riposo   { background:#f3f4f6; color:#6b7280; border-color:#9ca3af; }
    .cop-hint-ferie    { background:#e5e7eb; color:#111827; border-color:#374151; }
    .cop-hint-malattia { background:#fee2e2; color:#dc2626; border-color:#ef4444; }
    .cop-hint-permesso { background:#ffedd5; color:#c2410c; border-color:#f97316; }
    .cop-hint-chiuso   { background:#f1f5f9; color:#6b7280; border-color:#94a3b8; }
    /* layout principale: 2 colonne affiancate */
    #timb-main  { flex:1; overflow:hidden; display:flex; }
    .timb-left  { flex:1; overflow:hidden; display:flex; flex-direction:column; border-right:1px solid var(--border); }
    .timb-left .timb-emp-grid { flex:1; overflow-y:auto; }
    .timb-right { width:340px; flex-shrink:0; overflow-y:auto; background:#f9fafb; display:flex; flex-direction:column; }
    /* sezione dipendenti */
    .timb-section-hdr { padding:14px 18px 8px; font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.8px; color:var(--text-muted); }
    /* griglia bottoni dipendenti */
    .timb-emp-grid { padding:16px; display:grid; grid-template-columns:repeat(auto-fill, minmax(180px,1fr)); gap:14px; align-content:start; }
    .timb-emp-btn { display:flex; flex-direction:column; gap:10px; padding:26px 20px; border:2px solid var(--border); border-radius:16px; background:white; cursor:pointer; text-align:center; transition:all .15s; width:100%; align-items:center; }
    .timb-emp-btn:hover   { border-color:#93c5fd; background:#f0f7ff; }
    .timb-emp-btn.sel     { border-color:#0ea5e9; background:#eff6ff; box-shadow:0 0 0 3px rgba(59,130,246,.12); }
    .timb-emp-btn-name    { font-size:17px; font-weight:800; color:#111827; line-height:1.3; max-width:100%; overflow:hidden; }
    .timb-emp-btn-name span { display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
    .timb-emp-btn-status  { display:flex; align-items:center; justify-content:center; gap:6px; font-size:12px; }
    .timb-emp-btn-dot     { width:9px; height:9px; border-radius:50%; flex-shrink:0; }
    .timb-emp-btn-dot.in  { background:#22c55e; }
    .timb-emp-btn-dot.out { background:#d1d5db; }
    /* placeholder colonna PIN */
    .timb-pin-placeholder { display:flex; flex-direction:column; align-items:center; justify-content:center; flex:1; color:var(--text-muted); font-size:13px; padding:40px 16px; text-align:center; gap:10px; }
    /* pannello PIN (colonna destra fissa) */
    #timb-pin-shared { padding:24px 22px 28px; }
    .timb-pin-dip-label  { text-align:center; font-size:17px; font-weight:800; color:#111827; margin-bottom:16px; }
    .timb-pin-geo { display:flex; align-items:center; gap:6px; font-size:12px; padding:7px 12px; border-radius:8px; margin-bottom:14px; }
    .timb-pin-geo.ok      { background:#f0fdf4; color:#16a34a; }
    .timb-pin-geo.err     { background:#fef2f2; color:#dc2626; }
    .timb-pin-geo.loading { background:#f3f4f6; color:#6b7280; }
    /* PIN dots + pad */
    .pin-dots { display:flex; justify-content:center; gap:14px; margin-bottom:16px; }
    .pin-dot  { width:22px; height:22px; border-radius:50%; border:2px solid #d1d5db; background:white; transition:all .12s; }
    .pin-dot.filled { background:#111827; border-color:#111827; }
    .pin-err  { font-size:13px; color:#ef4444; text-align:center; min-height:18px; margin-bottom:10px; }
    .pin-pad  { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; width:100%; margin:0 auto 16px; }
    .pin-key  { padding:22px 10px; border:1.5px solid var(--border); border-radius:14px; background:white; font-size:26px; font-weight:700; cursor:pointer; text-align:center; transition:all .1s; touch-action:manipulation; }
    .pin-key:active { background:#f3f4f6; transform:scale(.94); }
    .pin-key.del   { font-size:18px; background:#f3f4f6; color:#374151; }
    .pin-key.empty { visibility:hidden; }
    .timb-act-btns { display:flex; gap:12px; width:100%; margin:0 auto; }
    .timb-act-btn  { flex:1; padding:18px; border-radius:14px; font-size:15px; font-weight:700; border:none; cursor:pointer; transition:all .12s; letter-spacing:.2px; }
    .timb-act-btn:disabled { opacity:.3; cursor:not-allowed; }
    .timb-act-btn.entrata { background:#22c55e; color:white; }
    .timb-act-btn.uscita  { background:#111827; color:white; }
    /* striscia movimenti in fondo alla colonna sx */
    .timb-moves-bar  { flex-shrink:0; border-top:2px solid var(--border); background:white; }
    .timb-moves-hdr  { padding:10px 18px 6px; font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.8px; color:var(--text-muted); }
    .timb-moves-scroll { display:flex; flex-direction:column; overflow-y:auto; gap:0; }
    .timb-move-chip  { display:flex; align-items:center; gap:10px; padding:14px 20px; border-right:1px solid var(--border); flex-shrink:0; }
    .timb-move-tipo  { font-size:11px; font-weight:700; padding:3px 9px; border-radius:10px; flex-shrink:0; }
    .timb-move-tipo.entrata { background:#dcfce7; color:#16a34a; }
    .timb-move-tipo.uscita  { background:#f3f4f6; color:#374151; }
    .timb-move-ora   { font-size:13px; font-weight:700; color:#111827; }
    .timb-move-nome  { font-size:12px; color:var(--text-muted); }
    .timb-moves-empty { padding:12px 18px; font-size:12px; color:var(--text-muted); }
    /* no-gps */
    .timb-nogps-wrap { padding:32px 20px; text-align:center; }
    /* responsive mobile */
    @media (max-width:700px) {
      #timb-main  { flex-direction:column; }
      .timb-right { width:100%; border-top:2px solid var(--border); }
      .timb-left  { border-right:none; flex:unset; }
      .pin-pad    { max-width:100%; }
      .timb-act-btns { max-width:100%; }
    }
    /* log riga */
    .timb-log-row { display:flex; align-items:center; gap:10px; padding:8px 12px; background:#f9fafb; border-radius:8px; margin-bottom:6px; }
    .timb-log-tipo { font-size:11px; font-weight:700; padding:2px 8px; border-radius:12px; flex-shrink:0; }
    .timb-log-tipo.entrata { background:#dcfce7; color:#16a34a; }
    .timb-log-tipo.uscita  { background:#f3f4f6; color:#374151; }
    .timb-log-time { font-size:14px; font-weight:700; }
    .timb-log-nome { font-size:12px; color:var(--text-muted); flex:1; text-align:left; }
    /* fallback no-gps */
    .timb-nogps-wrap { padding:28px 22px; text-align:center; }
    /* Pulsanti entrata/uscita già nel PIN */
    .timb-geo { display:flex; align-items:center; gap:8px; justify-content:center; font-size:12px; margin-bottom:14px; padding:8px 14px; border-radius:8px; }
    .timb-geo.ok  { background:#f0fdf4; color:#16a34a; }
    .timb-geo.err { background:#fef2f2; color:#dc2626; }
    .timb-geo.loading { background:#f9fafb; color:#6b7280; }

    /* ===== ORE MESE ===== */
    .om-filters { display:flex; align-items:center; gap:8px; margin-bottom:10px; flex-wrap:wrap; }
    .om-filters select, .om-filters input[type=month] { padding:5px 10px; border:1.5px solid var(--border); border-radius:8px; font-size:12px; background:white; }
    .om-legend { display:flex; gap:14px; margin-left:auto; }
    .om-leg-item { display:flex; align-items:center; gap:5px; font-size:11px; color:var(--text-muted); }
    .om-leg-dot  { width:12px; height:12px; border-radius:3px; border:1.5px solid; flex-shrink:0; }
    .om-wrap  { overflow-x:auto; border-radius:10px; border:1px solid var(--border); box-shadow:0 1px 4px rgba(0,0,0,.05); }
    .om-table { border-collapse:collapse; font-size:10px; width:100%; table-layout:fixed; }
    .om-table th, .om-table td { border:1px solid #e5e7eb; text-align:center; white-space:nowrap; }
    .om-table thead th { background:#111827; color:white; font-weight:700; padding:5px 2px; font-size:10px; position:sticky; top:0; z-index:2; }
    .om-table thead th.om-th-name { text-align:left; padding-left:8px; width:110px; min-width:110px; position:sticky; left:0; z-index:3; background:#111827; }
    .om-table thead th.om-th-day { width:30px; min-width:30px; }
    .om-table thead th.om-th-tot { background:#1f2937; width:48px; min-width:48px; position:sticky; right:0; z-index:3; }
    .om-table tbody tr:hover td { filter:brightness(.97); }
    .om-table tr  { height:40px; max-height:40px; }
    .om-table td  { overflow:hidden; box-sizing:border-box; }
    .om-table td.om-td-name { text-align:left; padding:0 8px; font-weight:700; font-size:10px; color:#111827; background:white; position:sticky; left:0; z-index:1; border-right:2px solid #d1d5db; width:110px; min-width:110px; height:40px; max-height:40px; }
    .om-table td.om-td-tot  { background:white; font-weight:700; position:sticky; right:0; z-index:1; border-left:2px solid #d1d5db; padding:0 4px; font-size:10px; height:40px; max-height:40px; }
    .om-td-cell { padding:1px; height:40px; max-height:40px; vertical-align:middle; font-size:10px; }
    .om-cell-inner { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:1px; height:100%; overflow:hidden; }
    .om-pian  { font-size:9px; color:#9ca3af; line-height:1; }
    .om-eff   { font-size:12px; font-weight:700; color:#111827; line-height:1; }
    .om-td-ok     { background:white; }
    .om-td-warn   { background:#fee2e2; }
    .om-td-alert  { background:#fee2e2; }
    .om-td-off    { background:#f9fafb; }
    .om-td-nodata { background:white; }
    .om-td-future { background:#f8f9fb; opacity:.55; }
    .om-badge-off { font-size:9px; font-weight:700; color:#9ca3af; letter-spacing:.5px; }
    .om-tot-inner { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:1px; padding:2px 0; height:100%; overflow:hidden; }
    .om-tot-pian  { font-size:9px; color:#6b7280; line-height:1; }
    .om-tot-eff   { font-size:12px; font-weight:800; color:#111827; line-height:1; }
    .om-tot-diff  { font-size:9px; font-weight:700; line-height:1; }
    .om-tot-diff.pos { color:#16a34a; }
    .om-tot-diff.neg { color:#dc2626; }
    .om-tfoot td  { background:#f1f5f9; font-weight:700; border-top:2px solid #cbd5e1; }
    .om-tfoot td.om-tf-name { text-align:left; padding-left:14px; position:sticky; left:0; background:#e2e8f0; z-index:1; }
    .om-tfoot td.om-tf-tot  { position:sticky; right:0; background:#e2e8f0; border-left:2px solid #cbd5e1; z-index:1; }
    /* ===== RESPONSIVE ===== */
    /* Schermate medie: 900–1280px (laptop HD, 1366×768, ecc.) */
    /* Sidebar a scomparsa su tutti i desktop: solo icone, si espande all'hover */
    @media (min-width:901px) {
      .sidebar {
        position:fixed; left:0; top:0; height:100svh;
        width:64px; min-width:64px;
        overflow:hidden; white-space:nowrap;
        transition:width .2s ease;
        z-index:200;
      }
      .sidebar:hover { width:230px; box-shadow:4px 0 24px rgba(0,0,0,.35); }
      /* niente scroll orizzontale nella nav quando collassata */
      .sidebar-nav { overflow-x:hidden; }
      /* riserva lo spazio del menu collassato */
      .main { margin-left:64px; }
      /* header: clip del testo quando collassato */
      .sidebar-header { padding:24px 0 18px; text-align:center; }
      .sidebar:hover .sidebar-header { padding:24px 20px 18px; text-align:left; }
      /* nav item: icona centrata quando collassato (gap:0 perché il testo a font-size:0
         con gap:10px sposterebbe l'icona a sinistra) */
      .nav-item { padding:10px 0; justify-content:center; gap:0; }
      .sidebar:hover .nav-item { padding:10px 20px; justify-content:flex-start; gap:10px; }
      /* voce attiva: da collassata come le altre (icona centrata, niente bordo sx);
         il bordo/evidenziazione torna all'hover */
      .nav-item.active { margin-left:8px !important; padding:10px 0 !important; justify-content:center; gap:0; border-left:none !important; border-radius:8px !important; }
      .sidebar:hover .nav-item.active { margin-left:0 !important; padding:10px 20px 10px 17px !important; justify-content:flex-start; gap:10px; border-left:3px solid white !important; border-radius:0 8px 8px 0 !important; }
      /* footer: solo avatar quando collassato */
      .sidebar-footer { padding:16px 0; padding-bottom:calc(16px + env(safe-area-inset-bottom)); text-align:center; }
      .sidebar:hover .sidebar-footer { padding:16px 20px; padding-bottom:calc(16px + env(safe-area-inset-bottom)); text-align:left; }
      .user-info { justify-content:center; gap:0; }
      .sidebar:hover .user-info { justify-content:flex-start; gap:10px; }
      .user-avatar { margin:0 auto; }
      .sidebar:hover .user-avatar { margin:0; }
      /* header e label sezione: nascosti MANTENENDO l'altezza (visibility),
         così le voci nav non si spostano verticalmente fra aperto e chiuso */
      .sidebar-brand, .sidebar-sub,
      .nav-section-label { visibility:hidden; }
      .sidebar:hover .sidebar-brand,
      .sidebar:hover .sidebar-sub,
      .sidebar:hover .nav-section-label { visibility:visible; }
      /* footer: nome/ruolo/Esci rimossi dal flusso (display:none) così il footer
         si restringe al solo avatar e non viene tagliato */
      .user-name, .user-role, .logout-btn { display:none; }
      .sidebar:hover .user-name,
      .sidebar:hover .user-role { display:block; }
      .sidebar:hover .logout-btn { display:block; }
      /* voci nav: testo nascosto con font-size:0 (la visibility nasconderebbe anche
         l'icona SVG). line-height:16px fissa l'altezza in entrambi gli stati. */
      .nav-item { font-size:0 !important; line-height:16px !important; }
      .sidebar:hover .nav-item { font-size:13px !important; }
    }

    @media (min-width:901px) and (max-width:1280px) {
      .content { padding:14px; }
      .dash-wrap > *:not(:first-child) { padding:0 14px; }
      .dash-wrap > *:last-child { padding-bottom:14px; }
      .dash-card-body { min-height:200px; max-height:300px; }
      /* tabella ore mese più compatta */
      .om-td-cell { min-width:36px; }
    }

    @media (max-width: 900px) {
      .hamburger { display:flex; }
      .sidebar {
        position:fixed;
        left:0; top:0;
        height:100svh;
        transform:translateX(-100%);
        z-index:200;
      }
      .sidebar.open { transform:translateX(0); }
      .topbar { padding:11px 16px; }
      .topbar-title { font-size:14px; }
      .content { padding:14px; }
      body, #app, .main { max-width:100vw; overflow-x:hidden; }

      /* Dashboard */
      .stats-grid { grid-template-columns:repeat(2,1fr); gap:10px; margin-bottom:14px; }
      .stat-value { font-size:22px; }

      /* Coperture controls */
      .cop-controls { flex-direction:column; gap:10px; padding:12px 14px; width:100%; box-sizing:border-box; }
      .ctrl-group { width:100%; min-width:0; }
      .ctrl-group select, .ctrl-group input { width:100% !important; max-width:100% !important; box-sizing:border-box !important; min-width:0 !important; }
      #cop-settimana { width:100% !important; max-width:100% !important; min-width:0 !important; }
      .cop-controls > div { margin-left:0 !important; }

      /* Riepilogo */
      .riepilogo-wrap { border-radius:10px; margin-bottom:14px; }
      .riepilogo-scroll { overflow-x:auto; -webkit-overflow-scrolling:touch; }

      /* Giorno blocks */
      .giorno-block { border-radius:10px; margin-bottom:12px; }
      .giorno-scroll { overflow-x:auto; -webkit-overflow-scrolling:touch; }
      .giorno-header { padding:10px 14px; }
      .giorno-info-bar { flex-wrap:wrap; gap:8px; padding:8px 14px; }

      /* Tabelle dipendenti/negozi */
      .table-wrap { overflow-x:auto; -webkit-overflow-scrolling:touch; }
      .hide-mobile { display:none !important; }
      /* tabelle compatte su mobile */
      #view-dipendenti .table-card,
      #view-negozi .table-card,
      #view-utenti .table-card { overflow-x:auto; border-radius:10px; }
      #view-dipendenti .data-table,
      #view-negozi .data-table,
      #view-utenti .data-table { font-size:12px; min-width:0; width:100%; }
      #view-dipendenti .data-table th, #view-dipendenti .data-table td,
      #view-negozi .data-table th, #view-negozi .data-table td,
      #view-utenti .data-table th, #view-utenti .data-table td { padding:8px 10px; }
      #view-dipendenti .data-table td:last-child,
      #view-negozi .data-table td:last-child,
      #view-utenti .data-table td:last-child { display:flex; flex-direction:column; gap:4px; align-items:flex-end; border-bottom:none; }
      #view-dipendenti .data-table td:last-child .btn,
      #view-negozi .data-table td:last-child .btn,
      #view-utenti .data-table td:last-child .btn { width:68px; text-align:center; justify-content:center; }
      /* Colonna nome fissa su mobile */
      .giorno-table td.c-name, .giorno-table th.c-name {
        position:-webkit-sticky;
        position:sticky;
        left:0;
        z-index:12;
        box-shadow:2px 0 4px rgba(0,0,0,.08);
      }
      .giorno-table tr.row-hdr th.c-name { z-index:13; }
      .giorno-table tr.row-hdr2 th.c-name { z-index:13; }
      .row-emp td.c-name { background:#f9fafb !important; }
      .row-presidio td.c-name { background:#f3f4f6 !important; overflow:hidden; text-overflow:ellipsis; max-width:110px; white-space:nowrap; }

      /* Modal */
      .modal { max-width:100% !important; margin:10px; padding:20px; border-radius:14px; max-height:85vh; }
    }

    @media (max-width: 900px) {
      /* Colonna nome: abbastanza larga da mostrare il nome */
      .giorno-table td.c-name, .giorno-table th.c-name {
        min-width:110px !important;
        max-width:120px !important;
      }
      .name-text {
        max-width:72px;
        overflow:hidden;
        text-overflow:ellipsis;
        white-space:nowrap;
        display:block;
      }
      /* Colonne ore più compatte */
      .giorno-table td.c-bdg, .giorno-table th.c-bdg,
      .giorno-table td.c-ore, .giorno-table th.c-ore {
        min-width:32px !important;
        width:32px !important;
        font-size:10px !important;
        padding:4px 2px !important;
      }
      /* Celle slot leggermente più strette */
      .giorno-table th.slot { min-width:28px !important; width:28px !important; font-size:8px !important; }
      .giorno-table td.slot { min-width:28px !important; width:28px !important; }
      .name-cell-inner { gap:4px; }
    }

    @media (max-width: 480px) {
      .topbar { padding:10px 12px; }
      .topbar-title { font-size:13px; }
      .content { padding:10px; }
      .stats-grid { grid-template-columns:repeat(2,1fr); gap:8px; }
      .stat-card { padding:14px; }
      .stat-value { font-size:20px; }
      .stat-label { font-size:10px; }
      .cop-controls { padding:10px 12px; }
      .giorno-header { flex-direction:column; align-items:flex-start; gap:2px; }
      .btn-sm { padding:6px 10px; font-size:11px; }

      .giorno-table td.c-name, .giorno-table th.c-name {
        min-width:95px !important;
        max-width:100px !important;
        padding:4px 5px !important;
      }
      .name-text { max-width:58px; font-size:11px; }
      .giorno-table td.c-bdg, .giorno-table th.c-bdg,
      .giorno-table td.c-ore, .giorno-table th.c-ore {
        min-width:26px !important; width:26px !important;
        font-size:9px !important; padding:3px 1px !important;
      }
      .giorno-table th.slot { min-width:24px !important; width:24px !important; font-size:7px !important; }
      .giorno-table td.slot { min-width:24px !important; width:24px !important; }
      .status-btn { font-size:9px !important; padding:1px 4px !important; }
    }

    /* ===== VIEWS ===== */
    .view { display:none !important; }
    .view.active { display:block !important; }
    #view-timbrature.active { display:flex !important; flex-direction:column; overflow:hidden; height:100%; }

    /* ===== DASHBOARD ===== */
    .stats-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(160px,1fr)); gap:16px; margin-bottom:22px; }
    .stat-card { background:var(--card); border-radius:14px; padding:20px; border:1px solid var(--border); box-shadow:0 1px 4px rgba(0,0,0,.05); transition:box-shadow .15s,transform .15s; }
    .stat-card:hover { box-shadow:0 4px 16px rgba(0,0,0,.1); transform:translateY(-2px); }
    .stat-label { font-size:11px; font-weight:700; color:var(--text-muted); text-transform:uppercase; letter-spacing:.5px; }
    .stat-value { font-size:28px; font-weight:800; color:#111827; margin-top:6px; }
    /* ── Dashboard ── */
    .dash-wrap { display:flex; flex-direction:column; gap:16px; height:100%; overflow-y:auto; box-sizing:border-box; }
    .dash-wrap > *:not(:first-child) { padding:0 20px; }
    .dash-wrap > *:last-child { padding-bottom:20px; }
    /* le griglie si adattano al contenitore */
    .dash-grid, .dash-grid-3, .dash-grid-full { width:100%; box-sizing:border-box; }
    .dash-date { font-size:13px; color:#6b7280; font-weight:600; margin-bottom:2px; }
    .dash-title { font-size:22px; font-weight:800; color:#111827; margin-bottom:20px; }
    .dash-grid { display:grid; grid-template-columns:1fr 1fr; gap:20px; }
    .dash-grid-3 { display:grid; grid-template-columns:1fr 1fr 1fr; gap:20px; }
    .dash-grid-4 { display:grid; grid-template-columns:1fr 1fr 1fr 1fr; gap:20px; width:100%; box-sizing:border-box; align-items:stretch; }
    /* il budget del giorno si mostra per intero, senza scroll interno */
    #dash-bud-body { max-height:none !important; overflow:visible !important; min-height:0 !important; }
    .dash-grid-full { display:grid; grid-template-columns:1fr; gap:20px; }
    /* icona arancione */
    .dash-card-icon.orange { background:#fff7ed; color:#ea580c; }
    /* navigazione calendario */
    .dash-cal-nav { background:none; border:1.5px solid #e5e7eb; border-radius:7px; width:26px; height:26px; cursor:pointer; font-size:14px; color:#374151; display:flex; align-items:center; justify-content:center; line-height:1; transition:background .12s; }
    .dash-cal-nav:hover { background:#f3f4f6; }
    /* griglia giorni */
    .dash-mini-cal { width:100%; border-collapse:collapse; }
    .dash-mini-cal th { font-size:10px; font-weight:700; color:#9ca3af; text-align:center; padding:0 0 6px; text-transform:uppercase; }
    .dash-mini-cal td { text-align:center; padding:2px 0; }
    .dash-mini-cal .dcell { width:30px; height:30px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; font-size:12px; font-weight:500; color:#374151; cursor:default; margin:0 auto; transition:background .1s; }
    .dash-mini-cal .dcell.other-month { color:#d1d5db; }
    .dash-mini-cal .dcell.today { background:#111827; color:white; font-weight:700; }
    .dash-mini-cal .dcell.has-task { position:relative; }
    .dash-mini-cal .dcell.has-task::after { content:''; position:absolute; bottom:3px; left:50%; transform:translateX(-50%); width:4px; height:4px; border-radius:50%; background:#6366f1; }
    .dash-mini-cal .dcell.today.has-task::after { background:white; }
    .dash-card { background:white; border-radius:14px; border:1px solid #e5e7eb; box-shadow:0 1px 4px rgba(0,0,0,.05); overflow:hidden; }
    .dash-card-header { padding:14px 18px; border-bottom:1px solid #f3f4f6; display:flex; align-items:center; gap:10px; }
    .dash-card-icon { width:32px; height:32px; border-radius:8px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
    .dash-card-icon.blue  { background:#eff6ff; color:#0ea5e9; }
    .dash-card-icon.green { background:#f0fdf4; color:#16a34a; }
    .dash-card-icon.purple{ background:#f5f3ff; color:#7c3aed; }
    .dash-card-title { font-size:13px; font-weight:700; color:#111827; }
    .dash-card-sub   { font-size:11px; color:#9ca3af; margin-top:1px; }
    .dash-card-body  { padding:0; min-height:240px; max-height:340px; overflow-y:auto; }
    /* tabella coperture dashboard */
    .dash-cop-table { width:100%; border-collapse:collapse; font-size:12px; }
    .dash-cop-table th { padding:8px 12px; background:#f9fafb; color:#6b7280; font-weight:700; font-size:10px; text-transform:uppercase; letter-spacing:.4px; border-bottom:1px solid #f3f4f6; text-align:left; }
    .dash-cop-table td { padding:9px 12px; border-bottom:1px solid #f9fafb; color:#374151; vertical-align:middle; }
    .dash-cop-table tr:last-child td { border-bottom:none; }
    .dash-cop-slot { display:inline-block; background:#111827; color:white; border-radius:5px; padding:2px 7px; font-size:11px; font-weight:600; margin:1px; }
    .dash-cop-slot.riposo { background:#f3f4f6; color:#9ca3af; }
    .dash-cop-slot.ferie  { background:#fef3c7; color:#92400e; }
    .dash-cop-slot.permesso { background:#e0e7ff; color:#3730a3; }
    .dash-cop-dip { font-weight:600; color:#111827; white-space:nowrap; }
    /* task dashboard */
    .dash-task-item { display:flex; align-items:center; gap:10px; padding:10px 16px; border-bottom:1px solid #f9fafb; cursor:pointer; transition:background .12s; }
    .dash-task-item:last-child { border-bottom:none; }
    .dash-task-item:hover { background:#f9fafb; }
    .dash-task-cb { width:18px; height:18px; border-radius:5px; border:2px solid #d1d5db; flex-shrink:0; display:flex; align-items:center; justify-content:center; }
    .dash-task-cb.done { background:#16a34a; border-color:#16a34a; }
    .dash-task-name { font-size:13px; color:#111827; font-weight:500; flex:1; }
    .dash-task-name.done { text-decoration:line-through; color:#9ca3af; }
    .dash-task-by { font-size:11px; color:#16a34a; white-space:nowrap; }
    /* operatori in turno */
    .dash-op-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(110px,1fr)); gap:10px; padding:12px; }
    .dash-op-btn  { display:flex; flex-direction:column; gap:8px; padding:18px 10px; border:2px solid var(--border); border-radius:14px; background:white; text-align:center; align-items:center; width:100%; box-sizing:border-box; }
    .dash-op-btn-name { font-size:14px; font-weight:800; color:#111827; line-height:1.3; width:100%; }
    .dash-op-btn-name span { display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
    .dash-op-btn-status { display:flex; align-items:center; justify-content:center; gap:5px; font-size:11px; color:#16a34a; }
    .dash-op-btn-dot { width:8px; height:8px; border-radius:50%; background:#22c55e; flex-shrink:0; }
    .dash-empty { padding:20px 16px; font-size:12px; color:#9ca3af; text-align:center; }
    /* barra ora corrente nelle coperture dashboard — linea verticale */
    .dash-cop-timebar-wrap { position:relative; }
    /* riabilita scroll touch sul giorno-scroll dentro dashboard cop (il wrapper è pointer-events:none) */
    #dash-cop-body .giorno-scroll { pointer-events:auto; overflow-x:auto; -webkit-overflow-scrolling:touch; }
    .dash-neg-sel { font-size:12px; font-weight:600; background:white; border:1.5px solid #e5e7eb; border-radius:8px; padding:4px 10px; color:#374151; outline:none; cursor:pointer; }
    /* Dashboard responsive */
    @media(max-width:1280px) {
      .dash-grid-3 { grid-template-columns:1fr 1fr; }
      .dash-grid-4 { grid-template-columns:1fr 1fr; }
    }
    @media(max-width:900px) {
      .dash-grid-3 { grid-template-columns:1fr; }
      .dash-grid   { grid-template-columns:1fr; }
      .dash-card-body { min-height:180px; max-height:260px; }
      .dash-wrap > *:not(:first-child) { padding:0 12px; }
      .dash-wrap > *:last-child { padding-bottom:12px; }
    }
    @media(max-width:768px)  {
      .dash-grid, .dash-grid-3, .dash-grid-4 { grid-template-columns:1fr; }
    }
    @media(max-width:768px) {
      /* ── Timbrature Riepilogo mensile mobile ── */
      #timb-riepilogo > div:first-child { flex-wrap:wrap; gap:6px; padding:6px 12px; justify-content:flex-start; }
      #timb-riepilogo .om-wrap { overflow-x:auto; -webkit-overflow-scrolling:touch; padding:0 0 12px; }
      #timb-om-table { table-layout:fixed; width:1120px; }

      /* header timbrature su mobile: compatta filtri riepilogo */
      .timb-neg-header { padding:10px 14px; gap:8px; }
      .timb-neg-header > div:last-child { flex-wrap:nowrap; gap:6px; align-items:center; }
      #timb-riep-filters { gap:6px; }
      #timb-riep-filters select, #timb-riep-filters input { flex:1; min-width:0; font-size:11px; padding:4px 6px; }
      .timb-neg-clock { font-size:18px; }
      .timb-neg-name { font-size:14px; }
      .timb-neg-date { font-size:10px; }

      /* ── Ore Mese mobile ── */
      #view-oremese { padding:10px 10px 0; }
      #view-oremese .page-header { margin-bottom:6px; }

      /* filtri: riga 1 = select+mese, riga 2 = bottoni, riga 3 = legenda */
      #view-oremese .om-filters { gap:6px; margin-bottom:8px; flex-wrap:wrap; }
      #view-oremese .om-filters select,
      #view-oremese .om-filters input[type=month] { flex:1 1 calc(50% - 3px); min-width:0; }
      #view-oremese .om-filters .btn { flex:1 1 calc(50% - 4px); max-width:calc(50% - 4px); margin-left:0 !important; font-size:11px; justify-content:center; }
      #view-oremese .om-filters > div { flex-basis:100%; margin-left:0 !important; }

      /* tabella: scroll orizzontale, colonne uniformi */
      #view-oremese .om-wrap { overflow-x:auto; -webkit-overflow-scrolling:touch; }
      /* 110px nome + 31×38px giorni + 80px totale = 1368px */
      #om-table { table-layout:fixed; width:1368px; }

      /* ── Task section mobile ── */

      /* topbar: compatta su due righe */
      .task-topbar { padding:8px 12px; gap:8px; flex-wrap:wrap; }
      .task-neg-label, .task-neg-msg { font-size:12px; }
      .task-week-label { min-width:0; font-size:11px; }
      .task-week-nav { margin-left:0; flex:1; justify-content:flex-end; }
      #task-clock { font-size:14px; order:99; width:100%; text-align:right; padding-top:2px; }

      /* permetti scroll orizzontale sulla griglia 7 giorni */
      .task-body { overflow-x:auto; -webkit-overflow-scrolling:touch; overflow-y:hidden; }
      .task-week-view { min-width:1120px; }
      .task-cal-header { grid-template-columns:repeat(7, minmax(160px,1fr)); }
      .task-cal-body   { grid-template-columns:repeat(7, minmax(160px,1fr)); }

      /* colonna giorno: min-height per vedere almeno qualcosa */
      .task-day-tcol { min-height:160px; }

      /* ── Impostazioni mobile: layout verticale ── */
      .imp-layout { flex-direction:column; min-height:0; }
      .imp-menu { width:100%; border-right:none; border-bottom:1px solid var(--border); display:flex; flex-direction:row; overflow-x:auto; }
      .imp-menu-item { white-space:nowrap; border-bottom:none; border-right:1px solid var(--border); flex-shrink:0; }
      .imp-menu-item.active { border-left:none; border-bottom:3px solid var(--primary); padding-left:16px; background:#eff6ff; }
      .imp-panel { padding:16px 0 0 0; }
      .imp-neg-row { flex-direction:column; align-items:flex-start; gap:8px; }
      .imp-neg-label { min-width:0; }
      .imp-neg-emails { width:100%; }
      .imp-email-input { width:100%; box-sizing:border-box; }

      /* "Nuovo Task" FAB: fisso in viewport, non scorre con la tabella */
      .task-new-btn { position:fixed; bottom:20px; right:16px; padding:9px 14px; font-size:11px; z-index:50; }

      /* modal task e PIN: full width su mobile */
      #task-modal-box { padding:20px 16px; border-radius:12px; }
      #task-pin-box   { padding:22px 16px 18px; }
    }

    /* ===== COPERTURE CONTROLS ===== */
    .cop-controls { background:var(--card); border-radius:14px; padding:16px 20px; border:1px solid var(--border); margin-bottom:18px; display:flex; gap:14px; align-items:flex-end; flex-wrap:wrap; box-shadow:0 1px 4px rgba(0,0,0,.05); }
    .ctrl-group { display:flex; flex-direction:column; gap:4px; }
    .ctrl-label { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.5px; color:var(--text-muted); }
    .ctrl-group select, .ctrl-group input[type="date"], .ctrl-group input[type="week"] { padding:8px 12px; border:1.5px solid var(--border); border-radius:9px; font-size:13px; background:white; color:var(--text); transition:border .15s; }
    .ctrl-group select:focus, .ctrl-group input:focus { outline:none; border-color:#6b7280; box-shadow:0 0 0 3px rgba(107,114,128,.12); }

    /* ===== RIEPILOGO TABLE ===== */
    .riepilogo-wrap { background:var(--card); border-radius:14px; border:1px solid var(--border); margin-bottom:22px; overflow:hidden; box-shadow:0 1px 4px rgba(0,0,0,.05); }
    .riepilogo-title { padding:12px 18px; font-size:13px; font-weight:700; text-transform:uppercase; letter-spacing:.5px; color:var(--text-muted); background:#f9fafb; border-bottom:1px solid var(--border); display:flex; align-items:center; gap:8px; }
    .riepilogo-scroll { overflow-x:auto; }
    .riepilogo-table { border-collapse:collapse; width:100%; font-size:12px; min-width:700px; table-layout:fixed; }
    .riepilogo-table th { background:#1f2937; color:white; padding:9px 10px; text-align:center; font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.3px; border:1px solid #374151; white-space:nowrap; overflow:hidden; width:60px; }
    .riepilogo-table th.th-staff { text-align:left; width:130px; }
    .riepilogo-table th.th-day { background:#374151; width:64px; }
    .riepilogo-table td { padding:7px 10px; border:1px solid var(--border); text-align:center; overflow:hidden; white-space:nowrap; }
    .riepilogo-table td.td-staff { text-align:left; font-weight:600; font-size:12px; background:#f9fafb; position:sticky; left:0; z-index:1; }
    .riepilogo-table tr.row-totale td { background:#111827; color:white; font-weight:700; border-color:#1f2937; }
    .riepilogo-table tr.row-totale td.td-staff { background:#111827; color:white; }
    .riepilogo-table tr:not(.row-totale):hover td { background:#f3f4f6; }
    .riepilogo-table tr:not(.row-totale):hover td.td-staff { background:#e5e7eb; }
    .diff-pos  { color:var(--success); font-weight:700; }
    .diff-neg  { color:var(--danger);  font-weight:700; }
    .diff-zero { color:#9ca3af;        font-weight:700; }
    .day-ore { color:#111827; font-weight:700; }
    .badge-status { display:inline-block; padding:2px 7px; border-radius:20px; font-size:9px; font-weight:700; text-transform:uppercase; }
    .bs-ferie    { background:#e5e7eb; color:#111827; }
    .bs-malattia { background:#fee2e2; color:#dc2626; }
    .bs-permesso { background:#ffedd5; color:#c2410c; }
    .bs-riposo   { background:#f3f4f6; color:#6b7280; }
    .bs-chiuso   { background:#f9fafb; color:#6b7280; }

    /* ===== GIORNO BLOCKS ===== */
    .giorno-block { background:var(--card); border-radius:14px; border:1px solid var(--border); margin-bottom:18px; overflow:hidden; box-shadow:0 1px 4px rgba(0,0,0,.06); }
    .giorno-header { padding:12px 18px; background:#1f2937; color:white; display:flex; align-items:center; gap:12px; }
    .giorno-title { font-size:14px; font-weight:800; letter-spacing:.5px; }
    .giorno-date { font-size:14px; font-weight:600; opacity:.9; }
    .giorno-info-bar { display:flex; background:#f9fafb; border-bottom:1px solid var(--border); font-size:11px; padding:8px 14px; gap:20px; flex-wrap:wrap; align-items:center; }
    .giorno-info-item { display:flex; align-items:center; gap:4px; }
    .giorno-info-label { font-weight:700; color:#6b7280; text-transform:uppercase; font-size:10px; letter-spacing:.3px; }
    .giorno-info-val { color:#111827; font-weight:600; }
    .ore-apertura-tot { margin-left:auto; font-weight:800; color:#111827; font-size:12px; }

    .giorno-scroll { overflow-x:auto; -webkit-overflow-scrolling:touch; }
    .giorno-table { border-collapse:separate; border-spacing:0; font-size:11px; white-space:nowrap; width:100%; }
    /* fixed cols */
    .giorno-table td.c-name, .giorno-table th.c-name { white-space:nowrap; text-align:left; padding:5px 8px; font-weight:600; border:1px solid var(--border); }
    .giorno-table td.c-bdg, .giorno-table th.c-bdg { width:44px; min-width:44px; text-align:center; border:1px solid var(--border); padding:4px 2px; font-size:12px; }
    .giorno-table td.c-ore, .giorno-table th.c-ore { width:48px; min-width:48px; text-align:center; border:1px solid var(--border); padding:4px 2px; font-weight:700; color:#111827; font-size:12px; }

    /* header rows */
    .giorno-table tr.row-hdr th { background:#1f2937; color:white; padding:6px 3px; text-align:center; font-size:10px; border:1px solid #374151; }
    .giorno-table tr.row-hdr th.c-name { background:#1f2937; color:white; text-align:left; }
    .giorno-table tr.row-hdr th.c-bdg { background:#1f2937; color:white; }
    .giorno-table tr.row-hdr th.c-ore { background:#1f2937; color:white; }
    .giorno-table tr.row-hdr2 th { background:#f3f4f6; color:#374151; padding:3px; text-align:center; font-size:9px; border:1px solid var(--border); font-weight:600; }
    .giorno-table tr.row-hdr2 th.c-name { background:#f3f4f6; color:#374151; }

    /* slot cells */
    .slot { width:34px; min-width:34px; max-width:34px; height:34px; text-align:center; vertical-align:middle; cursor:pointer; border:1px solid var(--border); user-select:none; transition:background .1s; font-size:11px; font-weight:700; }
    .slot:hover { background:#d1d5db !important; }
    .slot.on { color:#ffffff; }
    .slot.on::after { content:'X'; font-size:12px; font-weight:900; }

    /* slot col highlights for opening hours */
    .slot.in-orario { background:#ffffff; }
    .slot.pausa { background:#ffffff; }
    .slot.fuori-orario { background:#ffffff; }

    /* status row */
    .row-status td.status-cell { text-align:center; }
    .status-full-row { display:flex; align-items:center; justify-content:center; gap:6px; }

    /* employee rows */
    .row-emp td.c-name { background:#f9fafb !important; }
    .row-emp:hover td.c-name { background:#f3f4f6 !important; }
    .row-emp td { height:36px; }

    /* status row cells */
    .row-emp.st-riposo .slot { background:var(--slot-riposo) !important; cursor:default; }
    .row-emp.st-riposo .slot:hover { background:var(--slot-riposo) !important; }
    .row-emp.st-ferie .slot { background:var(--slot-ferie) !important; opacity:.5; cursor:default; }
    .row-emp.st-ferie .slot:hover { background:var(--slot-ferie) !important; }
    .row-emp.st-malattia .slot { background:var(--slot-malattia) !important; opacity:.5; cursor:default; }
    .row-emp.st-malattia .slot:hover { background:var(--slot-malattia) !important; }
    .row-emp.st-permesso .slot { background:var(--slot-permesso) !important; opacity:.5; cursor:default; }
    .row-emp.st-chiuso .slot { background:#6b7280 !important; opacity:.4; cursor:default; }

    /* nome cell con status badge */
    .name-cell-inner { display:flex; align-items:center; justify-content:space-between; gap:6px; }
    .name-text { font-weight:600; font-size:12px; white-space:nowrap; }
    .status-btn { padding:3px 7px; border-radius:5px; font-size:11px; font-weight:800; cursor:pointer; border:1.5px solid transparent; text-transform:uppercase; letter-spacing:.3px; transition:all .15s; white-space:nowrap; }
    .status-btn:hover { filter:brightness(.88); transform:scale(1.06); }
    .sbtn-lavoro   { background:#22c55e; color:#fff; border-color:#16a34a; }
    .sbtn-riposo   { background:#6b7280; color:#fff; border-color:#4b5563; }
    .sbtn-ferie    { background:#111827; color:#fff; border-color:#000000; }
    .sbtn-malattia { background:#ef4444; color:#fff; border-color:#dc2626; }
    .sbtn-permesso { background:#f97316; color:#fff; border-color:#ea580c; }
    .sbtn-chiuso   { background:#9ca3af; color:#fff; border-color:#6b7280; }

    /* presidio row */
    .row-presidio td { background:#f3f4f6; text-align:center; padding:3px 0; border:1px solid var(--border); }
    .row-presidio td.c-name { background:#f3f4f6 !important; font-size:10px; color:#374151; font-weight:700; text-transform:uppercase; letter-spacing:.3px; }
    .pres-badge { display:inline-flex; align-items:center; justify-content:center; width:20px; height:20px; border-radius:6px; font-size:10px; font-weight:800; background:#22c55e; color:white; }
    .pres-badge.zero { background:#d1d5db; color:#6b7280; }
    .pres-badge.low { background:#22c55e; }

    /* separatori orari */
    .slot-sep { border-left:2px solid #9ca3af !important; }

    /* legenda */
    .legenda { display:flex; gap:10px; flex-wrap:wrap; padding:10px 14px; border-top:1px solid var(--border); background:#f9fafb; font-size:11px; }
    .leg-item { display:flex; align-items:center; gap:4px; color:var(--text-muted); }
    .leg-dot { width:10px; height:10px; border-radius:2px; }

    /* ===== TABLES (generic) ===== */
    .table-card { background:var(--card); border-radius:14px; border:1px solid var(--border); overflow:hidden; box-shadow:0 1px 4px rgba(0,0,0,.05); }
    .data-table { width:100%; border-collapse:collapse; font-size:13px; }
    .data-table th { background:#f9fafb; padding:11px 16px; text-align:left; font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.5px; color:var(--text-muted); border-bottom:1px solid var(--border); }
    .data-table td { padding:11px 16px; border-bottom:1px solid var(--border); }
    .data-table tr:last-child td { border-bottom:none; }
    .data-table tr:hover td { background:#f3f4f6; }
    .badge-role { display:inline-block; padding:3px 10px; border-radius:20px; font-size:11px; font-weight:700; text-transform:uppercase; }
    .role-admin    { background:#fee2e2; color:#dc2626; }
    .role-manager  { background:#e5e7eb; color:#374151; }
    .role-employee { background:#f0fdf4; color:#16a34a; }

    /* ===== MODAL ===== */
    .modal-overlay { position:fixed; inset:0; background:rgba(0,0,0,.5); backdrop-filter:blur(4px); z-index:1000; display:none; align-items:center; justify-content:center; }
    .modal-overlay.open { display:flex; }
    .modal { background:white; border-radius:18px; padding:30px; width:100%; max-width:460px; max-height:90vh; overflow-y:auto; box-shadow:0 30px 60px rgba(0,0,0,.25); border:1px solid var(--border); }
    .modal-title { font-size:17px; font-weight:800; margin-bottom:20px; color:var(--text); }
    .modal-actions { display:flex; gap:8px; justify-content:flex-end; margin-top:22px; }
    .modal-grid2 { display:grid; grid-template-columns:1fr 1fr; gap:12px; }

    /* ===== STATUS POPUP ===== */
    .status-popup { position:absolute; background:white; border:1px solid var(--border); border-radius:14px; box-shadow:0 12px 36px rgba(0,0,0,.16); z-index:500; padding:8px; min-width:170px; }
    .status-popup button { display:flex; align-items:center; gap:10px; width:100%; text-align:left; padding:8px 12px; border:none; background:none; border-radius:8px; font-size:13px; font-weight:700; cursor:pointer; transition:background .12s; }
    .status-popup button:hover { background:#f3f4f6; }
    .status-popup button .sp-dot { width:12px; height:12px; border-radius:50%; flex-shrink:0; }
    .sp-dot-lavoro   { background:#22c55e; }
    .sp-dot-riposo   { background:#6b7280; }
    .sp-dot-ferie    { background:#111827; }
    .sp-dot-malattia { background:#ef4444; }
    .sp-dot-permesso { background:#f97316; }
    .sp-dot-chiuso   { background:#9ca3af; }

    /* ===== MISC ===== */
    .page-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; }
    .page-title { font-size:15px; font-weight:700; }
    .hidden { display:none !important; }
    .alert { padding:12px 16px; border-radius:10px; font-size:13px; margin-bottom:16px; font-weight:500; }
    .alert-info { background:#f3f4f6; color:#374151; border:1px solid #e5e7eb; }

    @media print {
      @page { size: A4 portrait; margin: 10mm 10mm; }

      /* Modalità stampa Ore Mese */
      body.om-print-mode .sidebar,
      body.om-print-mode .topbar,
      body.om-print-mode .page-header,
      body.om-print-mode .om-filters { display: none !important; }
      body.om-print-mode .content { padding: 0 !important; overflow: visible !important; height: auto !important; }
      body.om-print-mode .view { display: block !important; overflow: visible !important; height: auto !important; padding: 0 !important; }
      body.om-print-mode .view:not(#view-oremese) { display: none !important; }
      body.om-print-mode .om-wrap { overflow: visible !important; height: auto !important; }
      body.om-print-mode #app { display: block !important; height: auto !important; overflow: visible !important; }
      body.om-print-mode { background: white !important; }

      /* Nascondi elementi UI */
      .sidebar, .topbar, .cop-controls, .legenda,
      .btn, button, #section-negozi, #section-dipendenti,
      #section-utenti, #section-dashboard { display:none !important; }

      body, html { background: white !important; margin:0; padding:0; font-family: Arial, sans-serif; height:auto !important; overflow:visible !important; }
      #app { display:block !important; height:auto !important; overflow:visible !important; }
      .sidebar, .topbar { display:none !important; }
      .content { overflow:visible !important; height:auto !important; padding:0 !important; }
      #section-coperture { display:block !important; padding:0 !important; height:auto !important; }
      #cop-content { display:block !important; height:auto !important; overflow:visible !important; }

      /* ── RIEPILOGO ── */
      .riepilogo-wrap { display:block !important; box-shadow:none !important; border:none !important; padding:0 !important; margin:0 0 4mm 0 !important; }
      .riepilogo-scroll { overflow:visible !important; }
      .riepilogo-title {
        font-size:10px !important; font-weight:700 !important;
        padding:0 0 3px 0 !important; margin-bottom:4px !important;
        border-bottom:1.5px solid #111827 !important;
        background:none !important; color:#111827 !important; display:flex !important;
      }
      .riepilogo-table {
        width:100% !important; min-width:unset !important;
        font-size:7px !important; border-collapse:collapse !important; table-layout:auto !important;
      }
      .riepilogo-table th {
        background:#111827 !important; color:white !important;
        padding:3px 2px !important; font-size:6.5px !important;
        border:1px solid #374151 !important;
        -webkit-print-color-adjust:exact; print-color-adjust:exact;
      }
      .riepilogo-table th.th-day { background:#374151 !important; }
      .riepilogo-table td { padding:2px 2px !important; border:1px solid #d1d5db !important; font-size:7px !important; }
      .riepilogo-table td.td-staff { position:static !important; background:#f9fafb !important; font-size:7px !important; -webkit-print-color-adjust:exact; print-color-adjust:exact; }
      .riepilogo-table tr.row-totale td { background:#111827 !important; color:white !important; -webkit-print-color-adjust:exact; print-color-adjust:exact; }
      .riepilogo-table tr.row-totale td.td-staff { background:#111827 !important; color:white !important; }

      /* ── GIORNO BLOCKS – 2 colonne, continuano sotto il riepilogo ── */
      #cop-content { display:flex !important; flex-wrap:wrap !important; gap:2mm !important; align-items:flex-start !important; }
      .riepilogo-wrap { width:100% !important; }

      .giorno-block {
        display:block !important;
        width:100% !important;
        box-sizing:border-box !important;
        margin:0 !important;
        box-shadow:none !important;
        border:1px solid #d1d5db !important;
        border-radius:3px !important;
        overflow:hidden !important;
        break-inside:avoid !important;
        page-break-inside:avoid !important;
      }
      .giorno-header { padding:2px 6px !important; background:#111827 !important; -webkit-print-color-adjust:exact; print-color-adjust:exact; display:flex !important; justify-content:space-between !important; align-items:center !important; }
      .giorno-title { font-size:8px !important; color:white !important; }
      .giorno-date  { font-size:7px !important; color:#9ca3af !important; }
      .giorno-info-bar { padding:1px 5px !important; font-size:6.5px !important; gap:5px !important; background:#f9fafb !important; -webkit-print-color-adjust:exact; print-color-adjust:exact; }
      .giorno-info-label { font-size:6px !important; }
      .giorno-info-val   { font-size:6.5px !important; }
      .ore-apertura-tot  { font-size:6px !important; }

      .giorno-scroll { overflow:visible !important; }
      .giorno-table  { border-collapse:collapse !important; width:100% !important; table-layout:fixed !important; }
      .giorno-table th, .giorno-table td { padding:1px 0 !important; font-size:5.5px !important; border:1px solid #e5e7eb !important; text-align:center !important; }
      .giorno-table th { background:#1f2937 !important; color:white !important; -webkit-print-color-adjust:exact; print-color-adjust:exact; }
      .c-name { width:38px !important; font-size:6px !important; text-align:left !important; padding-left:2px !important; white-space:nowrap; overflow:hidden; }
      .c-bdg, .c-ore { width:14px !important; font-size:5.5px !important; }
      .slot { width:7px !important; min-width:unset !important; padding:1px 0 !important; }
      .giorno-table th.slot { font-size:4.5px !important; }
      .giorno-table td.slot { font-size:0px !important; }
      .name-cell-inner { display:flex !important; align-items:center !important; gap:2px !important; }
      .name-text { font-size:6px !important; overflow:hidden; white-space:nowrap; max-width:24px; }
      .status-btn { font-size:4.5px !important; padding:1px 2px !important; border-radius:2px !important; min-width:unset !important; -webkit-print-color-adjust:exact; print-color-adjust:exact; }
      td.slot.on { -webkit-print-color-adjust:exact; print-color-adjust:exact; }
      .presidio-row td { font-size:5px !important; }
      [style*="background"] { -webkit-print-color-adjust:exact; print-color-adjust:exact; }
    }
@keyframes spin{to{transform:rotate(360deg)}}

.om-neg-title {
  font-size: 15px;
  font-weight: 800;
  color: #111827;
  padding: 8px 0 10px;
  border-bottom: 2px solid #111827;
  margin-bottom: 0;
}

/* ── DOCUMENTI ──────────────────────────────────────────────────── */
.doc-topbar {
  background: #111827;
  color: #fff;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}
.doc-topbar-title {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  flex: 1;
}
.doc-neg-select {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.doc-neg-select option { background: #1f2937; color: #fff; }
.doc-tabs-bar {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  background: #fff;
  padding: 0 20px;
  flex-shrink: 0;
}
.doc-tab {
  padding: 11px 18px;
  border: none;
  background: none;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .15s, border-color .15s;
}
.doc-tab.active {
  color: #111827;
  border-bottom-color: #111827;
}
.doc-tab:hover:not(.active) { color: #374151; }

.doc-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.doc-breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  flex-wrap: wrap;
  font-size: 14px;
}
.doc-bread-item {
  color: #2563eb;
  cursor: pointer;
  font-weight: 500;
  padding: 2px 4px;
  border-radius: 4px;
}
.doc-bread-item:hover { background: #eff6ff; }
.doc-bread-sep { color: #9ca3af; font-size: 16px; }
.doc-bread-current { color: #111827; font-weight: 600; padding: 2px 4px; }

.doc-toolbar-actions { display: flex; gap: 8px; flex-shrink: 0; }
.doc-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid #d1d5db;
  background: #fff;
  color: #374151;
  transition: background .15s, border-color .15s;
}
.doc-btn:hover { background: #f3f4f6; border-color: #9ca3af; }
.doc-btn-upload { cursor: pointer; }

.doc-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.doc-empty {
  text-align: center;
  color: #9ca3af;
  font-size: 14px;
  padding: 48px 0;
}
.doc-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: default;
  transition: background .12s;
}
.doc-item:hover { background: #f9fafb; }
.doc-root-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #9ca3af;
  font-size: 13px;
  font-weight: 500;
}

/* ── IMPOSTAZIONI ── */
.imp-layout {
  display: flex;
  gap: 0;
  height: 100%;
  min-height: 400px;
}
.imp-menu {
  width: 220px;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
  align-self: flex-start;
}
.imp-menu-item {
  padding: 13px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.imp-menu-item:last-child { border-bottom: none; }
.imp-menu-item:hover { background: var(--hover); }
.imp-menu-item.active {
  background: #eff6ff;
  border-left: 3px solid var(--primary);
  padding-left: 13px;
}
.imp-panel {
  flex: 1;
  padding: 0 0 0 24px;
}
.imp-neg-row { display:flex; align-items:center; gap:12px; padding:12px 16px; }
.imp-neg-label { font-size:13px; font-weight:600; min-width:150px; }
.imp-neg-emails { display:flex; flex-wrap:wrap; align-items:center; gap:6px; flex:1; }
.imp-email-input { width:260px; }
.doc-row-icon { flex-shrink: 0; }
.doc-row-folder { color: #6b7280; }
.doc-row-file { font-size: 17px; line-height: 1; }
.doc-item-info { flex: 1; min-width: 0; }
.doc-item-name {
  font-size: 14px;
  font-weight: 500;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.doc-item-meta { font-size: 12px; color: #9ca3af; margin-top: 1px; }
.doc-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0;
  transition: opacity .15s;
}
.doc-item:hover .doc-item-actions { opacity: 1; }
.doc-item-open {
  font-size: 12px;
  font-weight: 600;
  color: #2563eb;
  background: none;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  text-decoration: none;
  transition: background .12s;
}
.doc-item-open:hover { background: #eff6ff; }
.doc-neg-check-lbl {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 5px 8px;
  border-radius: 6px;
  transition: background .12s;
}
.doc-neg-check-lbl:hover { background: #f3f4f6; }
.doc-vis-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  vertical-align: middle;
  margin-left: 6px;
}
.doc-vis-all { background: #e0f2fe; color: #0369a1; }
.doc-vis-neg { background: #f0fdf4; color: #166534; }
.doc-item-dl {
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 6px;
  color: #6b7280;
  background: none;
  border: none;
  cursor: pointer;
  transition: color .12s, background .12s;
}
.doc-item-dl:hover { color: #2563eb; background: #eff6ff; }
.doc-item-vis-edit {
  background: none;
  border: none;
  cursor: pointer;
  color: #9ca3af;
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 6px;
  transition: color .12s, background .12s;
}
.doc-item-vis-edit:hover { color: #2563eb; background: #eff6ff; }
.doc-item-del {
  background: none;
  border: none;
  cursor: pointer;
  color: #9ca3af;
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 6px;
  transition: color .12s, background .12s;
}
.doc-item-del:hover { color: #ef4444; background: #fef2f2; }

/* ===== FERIE ===== */
/* ===== BUDGET ===== */
/* sezioni solo-PC: su mobile visibili unicamente agli admin */
@media (max-width: 900px) {
  body:not(.is-admin) .nav-item[data-nav="budget"] { display: none !important; }
}
/* tab Fasce Orarie: una tabella per settimana, colonne Lun→Dom */
.bud-table { border-collapse: collapse; width: 100%; font-size: 11px; table-layout: fixed; margin-bottom: 18px; }
.bud-th-lbl { background: #111827; color: #fff; font-weight: 800; font-size: 10px; padding: 4px 6px; border: 1px solid #374151; width: 84px; text-align: left; }
.bud-th-week { vertical-align: middle; }
.bud-week-sub { font-size: 9px; font-weight: 600; color: #bfdbfe; }
.bud-th-day { background: #111827; color: #fff; font-weight: 700; font-size: 10px; text-align: center; padding: 4px 2px; border: 1px solid #374151; border-left: 2px solid #6b7280; }
.bud-th-num { background: #1f2937; color: #e5e7eb; font-weight: 800; font-size: 11px; text-align: center; padding: 2px; border: 1px solid #374151; border-left: 2px solid #6b7280; }
.bud-th-day.bud-we, .bud-th-num.bud-we { color: #fca5a5; }
/* giorno corrente: stessa palette degli altri, ma colonna con bordi spessi verdi */
.bud-th-day.bud-col-oggi { border-top: 4px solid #22c55e; }
th.bud-col-oggi { border-left: 4px solid #22c55e !important; border-right: 4px solid #22c55e !important; }
td.bud-col-oggi { border-left: 4px solid #22c55e !important; border-right: 4px solid #22c55e !important; }
td.bud-col-oggi-last { border-bottom: 4px solid #22c55e !important; }
.bud-td-lbl { border: 1px solid var(--border); background: var(--surface); font-weight: 700; font-size: 10px; color: #374151; padding: 3px 6px; }
.bud-td { border: 1px solid var(--border); padding: 1px; background: white; border-left: 2px solid #cbd5e1; }
.bud-td-off { border: 1px solid var(--border); background: #d1d5db; border-left: 2px solid #cbd5e1; }
.bud-td-info { border: 1px solid var(--border); background: #eff6ff; text-align: center; font-weight: 700; color: #1e40af; font-size: 11px; padding: 3px 2px; border-left: 2px solid #cbd5e1; }
.bud-row-fascia .bud-td-fascia { background: #1f2937; color: #fff; font-weight: 800; font-size: 10px; letter-spacing: .5px; padding: 3px 2px; border: 1px solid #374151; border-left: 2px solid #6b7280; text-align: center; }
.bud-td-tot { border: 1px solid var(--border); background: var(--surface); text-align: center; font-weight: 800; font-size: 11px; padding: 4px 2px; border-left: 2px solid #cbd5e1; }
.bud-inp { width: 100%; border: none; background: transparent; text-align: center; font-size: 11px; font-weight: 600; color: #111827; padding: 4px 2px; outline: none; box-sizing: border-box; display: block; }
.bud-inp:focus { background: #f3f4f6; border-radius: 2px; }
.bud-inp:disabled { background: transparent; color: #6b7280; }
/* tab Budget Giornaliero */
.bud-bdg-wrap { max-width: 860px; margin: 0 auto; }
.bud-bdg-table { border-collapse: collapse; width: 100%; font-size: 12px; table-layout: fixed; }
.bud-bdg-table th { background: #111827; color: #fff; font-weight: 700; font-size: 11px; padding: 7px 8px; border: 1px solid #374151; text-align: center; }
.bud-bdg-table th:first-child { width: 90px; }
.bud-bdg-table td { border: 1px solid var(--border); padding: 4px 8px; text-align: center; background: white; }
.bud-bdg-day { text-align: left !important; }
.bud-bdg-inp { padding: 1px !important; background: #eff6ff !important; }
.bud-bdg-real { font-weight: 700; background: var(--surface) !important; }
.bud-bdg-we td { background: #f8f9fb; }
.bud-bdg-we .bud-bdg-day strong { color: #dc2626; }
.bud-bdg-oggi td { border-top: 2px solid #111827; border-bottom: 2px solid #111827; }
.bud-bdg-week td { background: #f3f4f6; font-weight: 800; font-size: 11px; color: #374151; }
.bud-bdg-mese td { background: #111827; color: #fff; font-weight: 800; padding: 8px; }
@media (max-width: 900px) {
  .bud-table { min-width: 860px; }
  .bud-bdg-table { min-width: 640px; }
}

/* ===== VERSAMENTI ===== */
@media (max-width: 900px) {
  body:not(.is-admin) .nav-item[data-nav="versamenti"] { display: none !important; }
}
.vers-form-card { max-width: 560px; margin: 20px auto; background: white; border: 1px solid var(--border); border-radius: 14px; padding: 22px 26px; box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.vers-form-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.vers-form-title { font-size: 16px; font-weight: 800; color: #111827; }
.vers-form-sub { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-top: 2px; }
.vers-form-fields { display: flex; gap: 10px; flex-wrap: wrap; }
.vers-form-fields label, .vers-form-footer label { display: flex; flex-direction: column; gap: 3px; font-size: 11px; font-weight: 600; color: var(--text-muted); }
.vers-form-fields input, .vers-form-footer input { padding: 6px 8px; border: 1.5px solid var(--border); border-radius: 7px; font-size: 12px; outline: none; }
.vers-table { border-collapse: collapse; width: 100%; font-size: 13px; table-layout: fixed; }
.vers-table th { background: #111827; color: white; font-size: 11px; font-weight: 700; padding: 7px 10px; border: 1px solid #374151; text-align: center; }
.vers-td-taglio { border: 1px solid var(--border); padding: 6px 10px; font-weight: 800; color: #111827; }
.vers-td { border: 1px solid var(--border); padding: 1px; }
.vers-td-imp { border: 1px solid var(--border); padding: 6px 10px; text-align: right; font-weight: 700; color: #111827; background: var(--surface); }
.vers-inp { width: 100%; border: none; background: transparent; text-align: center; font-size: 13px; font-weight: 700; color: #111827; padding: 6px 4px; outline: none; box-sizing: border-box; display: block; }
.vers-inp:focus { background: #f3f4f6; border-radius: 2px; }
.vers-table tfoot td { border: 1px solid var(--border); background: var(--surface); font-weight: 800; padding: 7px 10px; text-align: center; }
.vers-table tfoot td:first-child { text-align: left; }
.vers-table tfoot td:last-child { text-align: right; }
.vers-tot-row { display: flex; justify-content: space-between; align-items: center; background: #111827; color: white; border-radius: 9px; padding: 10px 14px; margin-top: 14px; font-size: 14px; font-weight: 800; letter-spacing: .3px; }
.vers-form-footer { display: flex; gap: 10px; align-items: flex-end; margin-top: 18px; flex-wrap: wrap; }
.vers-form-footer input { width: 100%; box-sizing: border-box; }

/* ===== CHIUSURA ===== */
/* sezione solo-PC: su mobile visibile unicamente agli admin */
@media (max-width: 900px) {
  body:not(.is-admin) .nav-item[data-nav="chiusura"] { display: none !important; }
}
.chiu-table { border-collapse: collapse; width: 100%; font-size: 11px; }
.chiu-th-grp { background: #111827; color: #fff; font-weight: 800; font-size: 10px; letter-spacing: .4px; text-align: center; padding: 5px 4px; border: 1px solid #374151; }
.chiu-th-grp.chiu-grp-tot  { background: #111827; }
.chiu-th-grp.chiu-grp-diff { background: #111827; }
.chiu-th { background: #1f2937; color: #e5e7eb; font-weight: 600; font-size: 10px; text-align: center; padding: 4px 2px; border: 1px solid #374151; width: 44px; min-width: 40px; }
.chiu-th-calc { width: 64px; min-width: 58px; color: #fff; font-weight: 700; }
.chiu-th-tot  { width: 68px; min-width: 62px; color: #fff; font-weight: 700; }
.chiu-th-diff { width: 58px; min-width: 52px; }
.chiu-td-day { text-align: center; font-weight: 800; font-size: 12px; border: 1px solid var(--border); background: var(--surface); color: #111827; min-width: 36px; }
.chiu-td-day .chiu-dow { font-size: 9px; font-weight: 600; color: var(--text-muted); }
.chiu-td-cassa { text-align: center; font-weight: 700; font-size: 9px; color: var(--text-muted); border: 1px solid var(--border); white-space: nowrap; padding: 2px 4px; background: white; }
.chiu-td { border: 1px solid var(--border); padding: 1px; background: white; }
.chiu-td-calc { border: 1px solid var(--border); background: var(--surface); text-align: center; font-weight: 700; color: #111827; }
.chiu-td-tot { border: 1px solid var(--border); background: var(--surface); text-align: center; font-weight: 800; color: #111827; }
.chiu-td-diff { border: 1px solid var(--border); background: white; text-align: center; font-weight: 600; color: #9ca3af; }
.chiu-td-diff.chiu-diff-err { background: #fee2e2; color: #dc2626; font-weight: 800; }
.chiu-td-check { border: 1px solid var(--border); text-align: center; font-weight: 800; font-size: 10px; }
.chiu-td-check.chiu-ok  { background: #dcfce7; color: #16a34a; }
.chiu-td-check.chiu-err { background: #fee2e2; color: #dc2626; }
/* weekend: solo la cella della data in rosso */
.chiu-row.chiu-we .chiu-td-day { color: #dc2626; }
.chiu-row.chiu-we .chiu-td-day .chiu-dow { color: #dc2626; }
/* giorno attuale: contorno spesso su tutta la riga */
.chiu-row.chiu-oggi-first td { border-top: 2.5px solid #111827; }
.chiu-row.chiu-oggi-last td { border-bottom: 2.5px solid #111827; }
.chiu-row.chiu-oggi-first td[rowspan] { border-bottom: 2.5px solid #111827; }
.chiu-row.chiu-oggi-first .chiu-td-day { border-left: 2.5px solid #111827; }
.chiu-row.chiu-oggi td:last-child { border-right: 2.5px solid #111827; }
.chiu-inp { width: 100%; border: none; background: transparent; text-align: center; font-size: 11px; font-weight: 600; color: #111827; padding: 3px 1px; outline: none; box-sizing: border-box; display: block; }
.chiu-inp:focus { background: #f3f4f6; border-radius: 2px; }
.chiu-tfoot td { background: #111827; color: #fff; font-weight: 800; font-size: 11px; text-align: center; padding: 6px 3px; border: 1px solid #374151; }
.chiu-tfoot td:first-child { text-align: left; padding-left: 10px; letter-spacing: .5px; }

/* ===== FERIE ===== */
.ferie-neg-sel { background:rgba(255,255,255,.1); border:1px solid rgba(255,255,255,.2); color:white; border-radius:8px; padding:5px 10px; font-size:12px; cursor:pointer; }
.ferie-neg-sel option { background:#111827; }
.ferie-nav-btn { background:#f3f4f6; border:1.5px solid var(--border); color:#374151; border-radius:8px; width:30px; height:30px; cursor:pointer; font-size:16px; display:flex; align-items:center; justify-content:center; }
.ferie-nav-btn:hover { background:#e5e7eb; }
.ferie-table { border-collapse: collapse; width: 100%; table-layout: fixed; margin-bottom: 12px; }
.ferie-th-nome { position: sticky; left: 0; z-index: 3; background: #111827; color: #fff; font-weight: 700; font-size: 11px; padding: 4px 8px; border: 1px solid #374151; white-space: nowrap; width: 190px; text-align: left; }
.ferie-th-g { background: #111827; color: #e5e7eb; font-weight: 600; font-size: 10px; text-align: center; padding: 2px 0; border: 1px solid #374151; line-height: 1.3; cursor: pointer; user-select: none; }
.ferie-th-g:hover { background: #1e3a5f; }
.ferie-th-g.ferie-we { background: #1f2937; color: #e5e7eb; }
.ferie-th-g.ferie-chiuso-h { background: #991b1b !important; color: #fecaca !important; }
.ferie-cell.ferie-chiuso { background: #fee2e2 !important; }
.ferie-th-tot { position: sticky; right: 0; z-index: 3; background: #111827; color: #fff; font-weight: 700; font-size: 10px; text-align: center; padding: 4px 4px; border: 1px solid #374151; }
.ferie-dow { font-size: 9px; font-weight: 400; }
.ferie-td-nome { position: sticky; left: 0; z-index: 1; background: #fff; font-weight: 600; font-size: 12px; padding: 2px 8px; border: 1px solid #e5e7eb; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 190px; }
.ferie-td-tot { position: sticky; right: 0; z-index: 1; background: #f0fdf4; font-weight: 700; font-size: 12px; text-align: center; padding: 2px 4px; border: 1px solid #e5e7eb; color: #166534; }
.ferie-td-tot-col { text-align: center; font-size: 11px; font-weight: 600; color: #374151; padding: 2px 0; border: 1px solid #e5e7eb; background: #f9fafb; }
.ferie-cell { border: 1px solid #e5e7eb; padding: 1px; }
.ferie-cell.ferie-we { background: #f3f4f6; }
.ferie-tfoot .ferie-td-nome { background: #f9fafb; font-size: 11px; font-weight: 700; color: #374151; }
.ferie-tfoot td { border-top: 2px solid #d1d5db; }
.ferie-tot-mese { background: #dcfce7 !important; color: #166534 !important; }
.ferie-input { width: 100%; border: none; background: transparent; text-align: center; font-size: 11px; font-weight: 600; color: #111827; padding: 2px 0; outline: none; -moz-appearance: textfield; display: block; }
.ferie-input::-webkit-outer-spin-button, .ferie-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ferie-input:focus { background: #dbeafe; border-radius: 2px; }
/* mobile: la tabella mantiene una larghezza minima e si scorre in orizzontale */
@media (max-width: 900px) {
  .ferie-table { min-width: 1000px; }
  .ferie-th-nome { width: 110px; }
  .ferie-td-nome { max-width: 110px; }
  /* niente padding laterale: la colonna sticky dei nomi aderisce al bordo,
     così le date non sbucano alla sua sinistra durante lo scroll */
  #ferie-pane-planning { padding: 10px 0 !important; }
  #ferie-pane-riepilogo { padding: 12px 0 !important; }
  /* riepilogo: larghezza minima e scroll orizzontale, come il planning */
  .ferie-riep-table { min-width: 1100px; }
}
.ferie-cell.ferie-we .ferie-input { color: #9ca3af; }
