:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --bg: #f4f6f9;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 1px 1px, rgba(37, 99, 235, 0.10) 1px, transparent 0),
    linear-gradient(135deg, #eef2ff 0%, #f4f6f9 35%, #f4f6f9 65%, #fdf2f8 100%);
  background-size: 22px 22px, 100% 100%;
  background-attachment: fixed, fixed;
  min-height: 100vh;
}

a { color: var(--primary); }

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px;
}

header.topbar {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

header.topbar::before {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(90deg, #2563eb, #7c3aed, #db2777, #f59e0b);
}

header.topbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  padding-bottom: 12px;
}

header.topbar h1 {
  font-size: 1.1rem;
  margin: 0;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar-chip {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
}

.card h2 {
  margin-top: 0;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.h2-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: #eff6ff;
  color: var(--primary);
  flex-shrink: 0;
}

.h2-icon-wrap svg { width: 18px; height: 18px; }

.grid {
  display: grid;
  gap: 16px;
}

.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

.stat-tile {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.stat-tile .value {
  font-size: 1.6rem;
  font-weight: 600;
}

.stat-tile .label {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ── Mini grafico a barre (es. storico buste paga) ───────────────────── */
.mini-bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 130px;
  padding: 4px 2px 0;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.mini-bar-chart-col {
  flex: 1 0 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  min-width: 28px;
}
.mini-bar-chart-value {
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 3px;
  white-space: nowrap;
}
.mini-bar-chart-bar {
  width: 100%;
  max-width: 26px;
  background: var(--primary);
  border-radius: 4px 4px 0 0;
  transition: opacity 0.15s;
}
.mini-bar-chart-bar:hover { opacity: 0.75; }
.mini-bar-chart-label {
  font-size: 0.66rem;
  color: var(--text-muted);
  margin-top: 5px;
  white-space: nowrap;
}

/* ── Dashboard admin ──────────────────────────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
  align-items: start;
}

.presence-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.presence-tile {
  border-radius: 10px;
  padding: 12px 14px;
  text-align: center;
}
.presence-tile.presenti { background: #dcfce7; color: #166534; }
.presence-tile.assenti { background: #fee2e2; color: #991b1b; }
.presence-tile .value { font-size: 1.5rem; font-weight: 700; }
.presence-tile .label { font-size: 0.78rem; }

.agenda-item {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.agenda-item:last-child { border-bottom: none; }
.agenda-item .agenda-data {
  flex-shrink: 0;
  width: 46px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  line-height: 1.3;
  padding-top: 2px;
}
.agenda-item .agenda-data strong { display: block; font-size: 1rem; color: var(--text); }

button, .btn {
  font-family: inherit;
  font-size: 0.9rem;
  border: none;
  border-radius: 8px;
  padding: 9px 16px;
  cursor: pointer;
  background: var(--primary);
  color: white;
  transition: background 0.15s;
}

button:hover, .btn:hover { background: var(--primary-dark); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

button.secondary { background: #e2e8f0; color: var(--text); }
button.secondary:hover { background: #cbd5e1; }

button.danger { background: var(--danger); }
button.danger:hover { background: #b91c1c; }

button.success { background: var(--success); }
button.success:hover { background: #15803d; }

.btn-block { width: 100%; }

input, select, textarea {
  font-family: inherit;
  font-size: 0.95rem;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 100%;
  background: white;
  color: var(--text);
}

label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  margin-top: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

th { color: var(--text-muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; }

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge.da_fare, .badge.in_corso { background: #fef3c7; color: #92400e; }
.badge.completata, .badge.completato { background: #dcfce7; color: #166534; }
.badge.admin { background: #ede9fe; color: #5b21b6; }
.badge.dipendente { background: #dbeafe; color: #1e40af; }
.badge.inattivo { background: #fee2e2; color: #991b1b; }
.badge.malattia { background: #fce7f3; color: #9d174d; }
.badge.novita { background: #dbeafe; color: #1e40af; }

.version-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  padding: 2px 8px;
  margin-left: 8px;
  vertical-align: middle;
}
.badge.miglioria { background: #ede9fe; color: #5b21b6; }
.badge.importante { background: #fee2e2; color: #991b1b; }
.badge.manutenzione { background: #fef3c7; color: #92400e; }
.badge.comunicazione { background: #f1f5f9; color: #475569; }

.sidebar-layout {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 210px;
  flex-shrink: 0;
}

.side-nav-block {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
}

.side-nav-block.push-bottom { margin-top: auto; }

.side-nav-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 6px 10px 8px;
}

.side-nav .tab-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  justify-content: flex-start;
  background: none;
  color: var(--text-muted);
  border-radius: 8px;
  padding: 10px 12px;
  white-space: nowrap;
}

.side-nav .tab-btn:hover { background: #f1f5f9; color: var(--text); }

.side-nav .tab-btn.active {
  color: var(--primary);
  background: #eff6ff;
  font-weight: 600;
}

.profile-photo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 6px;
}

.profile-photo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.3rem;
  overflow: hidden;
}

.profile-photo img { width: 100%; height: 100%; object-fit: cover; }

.profile-photo-upload {
  font-size: 0.78rem;
  color: var(--primary);
  cursor: pointer;
  font-weight: 600;
}
.profile-photo-upload:hover { text-decoration: underline; }

.main-content { flex: 1; min-width: 0; }

@media (max-width: 860px) {
  .sidebar-layout { flex-direction: column; align-items: stretch; }
  .side-nav { width: 100%; flex-direction: row; overflow-x: auto; min-width: 0; }
  .side-nav-block { flex-shrink: 0; }
  .side-nav-block.push-bottom { margin-top: 0; margin-left: auto; }
  .side-nav-label { display: none; }
  .profile-photo-wrap { flex-direction: row; padding: 6px 10px; }
  .profile-photo { width: 40px; height: 40px; font-size: 0.9rem; flex-shrink: 0; }
  .profile-photo-upload { white-space: nowrap; }
  .main-content { min-width: 0; }
}

.tabs {
  display: flex;
  gap: 4px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 5px;
  margin-bottom: 18px;
  overflow-x: auto;
}

.tabs button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: none;
  color: var(--text-muted);
  border-radius: 8px;
  padding: 9px 14px;
  white-space: nowrap;
}

.tabs button:hover { background: #f1f5f9; color: var(--text); }

.tabs button.active {
  color: var(--primary);
  background: #eff6ff;
  font-weight: 600;
}

.tab-icon-svg { width: 16px; height: 16px; flex-shrink: 0; }

.tab-dropdown-wrap { position: relative; }

.tab-chevron-svg { width: 13px; height: 13px; flex-shrink: 0; opacity: 0.7; transition: transform 0.15s; }
.tab-dropdown-wrap.open .tab-chevron-svg { transform: rotate(180deg); }

.tab-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.14);
  padding: 5px;
  min-width: 190px;
  z-index: 20;
}

.tab-dropdown-option {
  display: flex;
  align-items: center;
  width: 100%;
  text-align: left;
  background: none;
  color: var(--text);
  border-radius: 7px;
  padding: 8px 10px;
  font-size: 0.9rem;
  font-weight: 400;
}
.tab-dropdown-option:hover { background: #f1f5f9; }
.tab-dropdown-option.active { color: var(--primary); background: #eff6ff; font-weight: 600; }

.progress-bar {
  width: 100%;
  height: 10px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar .fill {
  height: 100%;
  background: var(--success);
  transition: width 0.2s;
}

.clock-btn {
  width: 100%;
  padding: 28px;
  font-size: 1.3rem;
  border-radius: var(--radius);
}

.board {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.board-col {
  flex: 1 1 0;
  min-width: 240px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  transition: background 0.15s;
}

.board-col.drag-over { background: #eff6ff; }

.board-col h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  margin: 2px 6px 10px;
}

.board-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: grab;
}

.board-card:active { cursor: grabbing; }
.board-card.dragging { opacity: 0.4; }

.board-card .titolo { font-weight: 600; font-size: 0.9rem; }
.board-card .meta { color: var(--text-muted); font-size: 0.78rem; margin-top: 4px; }

.board-card.ok { border-left: 4px solid var(--success); }
.board-card.attenzione { border-left: 4px solid var(--warning); background: #fffbeb; }
.board-card.rischio { border-left: 4px solid var(--danger); background: #fef2f2; }

.board-card .progress-bar { margin-top: 8px; height: 6px; }
.board-card .progresso-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.board-card .progresso-row input[type="range"] { flex: 1; }
.board-card .progresso-row .valore { font-size: 0.75rem; color: var(--text-muted); min-width: 30px; text-align: right; }

.board-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.board-legend .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }

.board-card .dettagli-btn { width: 100%; margin-top: 8px; padding: 6px; font-size: 0.78rem; }

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  max-width: 480px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
}
.modal-box.wide { max-width: 960px; }
.modal-box h2 { margin-top: 0; }
.modal-close { float: right; }

.checklist-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.checklist-item span { flex: 1; font-size: 0.9rem; }
.checklist-item.completato span { text-decoration: line-through; color: var(--text-muted); }

.note-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.note-item .autore { font-weight: 600; }
.note-item .quando { color: var(--text-muted); font-size: 0.75rem; }
.board-legend .dot.ok { background: var(--success); }
.board-legend .dot.attenzione { background: var(--warning); }
.board-legend .dot.rischio { background: var(--danger); }

.comunicazione-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.comunicazione-item.non-letta { border-left: 3px solid var(--primary); }
.comunicazione-item .testo { white-space: pre-wrap; margin: 8px 0 0; }

.file-drop {
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  background: white;
}

.hidden { display: none !important; }

.error-msg {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 8px;
}

.success-msg {
  color: var(--success);
  font-size: 0.85rem;
  margin-top: 8px;
}

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.login-card {
  width: 100%;
  max-width: 380px;
}

.login-card h1 {
  text-align: center;
  margin-bottom: 4px;
}

.login-card p.subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.muted { color: var(--text-muted); }
.text-center { text-align: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.flex-gap { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 640px) {
  table, thead, tbody, th, td, tr { display: block; }
  thead tr { position: absolute; top: -9999px; left: -9999px; }
  tr { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 10px; padding: 6px 0; }
  td { border: none; padding: 6px 12px; display: flex; justify-content: space-between; gap: 10px; }
  td::before { content: attr(data-label); font-weight: 600; color: var(--text-muted); }
}

/* ── Striscia mesi (stile Dipendenti in Cloud) ─────────────────────────── */
.mese-strip {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
  background: var(--card-bg);
  margin-bottom: 14px;
}
.mese-tile {
  flex: 1;
  min-width: 74px;
  text-align: center;
  padding: 8px 4px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  user-select: none;
}
.mese-tile:hover { background: #f1f5f9; }
.mese-tile.attivo { background: #dcfce7; border-color: var(--success); }
.mese-tile .nome { font-size: 0.8rem; font-weight: 600; }
.mese-tile .conteggio { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }
.mese-tile .totale { font-size: 0.8rem; font-weight: 600; color: var(--success); margin-top: 2px; }
.mese-tile.vuoto .totale { color: var(--text-muted); font-weight: normal; }

.anno-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.anno-nav .anno { font-size: 1.05rem; font-weight: 700; min-width: 58px; text-align: center; }

/* ── Matrice presenze mensile ──────────────────────────────────────────── */
.matrice-wrap, .table-wrap { overflow-x: auto; }
table.nowrap th, table.nowrap td { white-space: nowrap; }
.matrice-presenze { border-collapse: collapse; font-size: 0.75rem; width: 100%; }
.matrice-presenze th, .matrice-presenze td {
  border: 1px solid var(--border);
  padding: 4px 3px;
  text-align: center;
  min-width: 28px;
  white-space: nowrap;
}

.matrice-presenze td.cliccabile-cella { cursor: pointer; }
.matrice-presenze td.cliccabile-cella:hover { outline: 2px solid var(--primary); outline-offset: -2px; }
.matrice-presenze th:first-child, .matrice-presenze td:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  background: var(--card-bg);
  min-width: 140px;
  font-weight: 600;
  z-index: 1;
}
.matrice-presenze .weekend { background: #f1f5f9; color: var(--text-muted); }
.matrice-presenze .ferie { background: #dcfce7; color: #166534; font-weight: 700; }
.matrice-presenze .permesso { background: #fef3c7; color: #92400e; font-weight: 700; }
.matrice-presenze .malattia { background: #fce7f3; color: #9d174d; font-weight: 700; }
.matrice-presenze .tot { font-weight: 700; background: #f8fafc; }
.matrice-legenda { display: flex; gap: 14px; font-size: 0.78rem; color: var(--text-muted); margin-top: 8px; flex-wrap: wrap; }
.matrice-legenda .q { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }

/* ── Matrice riepilogo dipendente × mese (importi) ──────────────────────── */
.matrice-riepilogo { border-collapse: collapse; width: 100%; font-size: 0.85rem; }
.matrice-riepilogo th, .matrice-riepilogo td {
  padding: 8px 12px;
  text-align: right;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.matrice-riepilogo th:first-child, .matrice-riepilogo td:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  background: var(--card-bg);
  min-width: 150px;
  font-weight: 600;
  z-index: 1;
}
.matrice-riepilogo td.vuota { color: var(--border); }
.matrice-riepilogo td:last-child, .matrice-riepilogo th:last-child {
  font-weight: 700;
  border-left: 1px solid var(--border);
  background: #f8fafc;
}
.matrice-riepilogo tbody tr:hover td { background: #f8fafc; }
.matrice-riepilogo tbody tr:hover td:first-child { background: #f1f5f9; }

/* ── Vista calendario ──────────────────────────────────────────────────── */
.calendario {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.cal-day-header {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  padding: 2px 0 8px;
}
.cal-day {
  min-height: 78px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
  background: var(--card-bg);
  overflow: hidden;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.cal-day.altro-mese { visibility: hidden; }
.cal-day.cliccabile { cursor: pointer; }
.cal-day.cliccabile:hover { border-color: var(--primary); box-shadow: 0 3px 10px rgba(37, 99, 235, .12); }
.cal-day.festivo { background: #fef2f2; border-color: #fecaca; }
.cal-day .numero { font-size: 0.78rem; font-weight: 600; margin-bottom: 4px; color: var(--text-muted); }
.cal-day.festivo .numero { color: var(--danger); }
.cal-day .numero.oggi {
  display: inline-flex; align-items: center; justify-content: center;
  width: 21px; height: 21px; border-radius: 50%;
  background: var(--primary); color: white; font-weight: 700;
}
.cal-chip {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 5px;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-chip.ferie { background: #dbeafe; color: #1e40af; }
.cal-chip.permesso { background: #fef3c7; color: #92400e; }
.cal-chip.straordinario { background: #ede9fe; color: #5b21b6; }
.cal-chip.malattia { background: #fce7f3; color: #9d174d; }
.cal-chip.scadenza { background: #fee2e2; color: #991b1b; }
.cal-chip.presenza { background: #dcfce7; color: #166534; }
.cal-chip.festivo { background: #fee2e2; color: #991b1b; font-weight: 700; }
.cal-piu { display: block; font-size: 0.64rem; color: var(--text-muted); font-weight: 600; margin-top: 3px; }

.cal-legenda { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.cal-legenda span {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.74rem; color: var(--text-muted); font-weight: 500;
  background: var(--bg-soft, #f4f6f9); border: 1px solid var(--border);
  padding: 3px 10px 3px 8px; border-radius: 999px;
}
.cal-legenda .q { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }

.mese-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.mese-nav .etichetta { font-size: 1.05rem; font-weight: 700; min-width: 140px; text-align: center; text-transform: capitalize; }
.mese-nav button { padding: 6px 12px; }

/* ── Vista settimanale timeline per dipendente ───────────────────────────── */
.settimana-dipendente {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
}
.settimana-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px;
  cursor: pointer;
  background: var(--card-bg);
}
.settimana-header:hover { background: #f8fafc; }
.settimana-stats { display: flex; gap: 16px; font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; }
.settimana-stats strong { color: var(--text); }
.settimana-toggle { color: var(--text-muted); font-size: 0.8rem; }
.settimana-body { padding: 6px 14px 14px; border-top: 1px solid var(--border); overflow-x: auto; }
.settimana-giorni { display: grid; grid-template-columns: 60px repeat(7, minmax(70px, 1fr)); }
.settimana-giorni .col-header { text-align: center; padding: 6px 2px; }
.settimana-giorni .col-header .data { font-size: 0.75rem; font-weight: 600; }
.settimana-giorni .col-header .contratto { font-size: 0.7rem; color: var(--text-muted); }
.settimana-timeline { display: flex; }
.settimana-ore-label { width: 60px; flex-shrink: 0; }
.settimana-ore-label div { height: 24px; font-size: 0.66rem; color: var(--text-muted); text-align: right; padding-right: 6px; transform: translateY(-7px); }
.settimana-colonna {
  flex: 1;
  min-width: 70px;
  position: relative;
  border-left: 1px solid var(--border);
  background-image: repeating-linear-gradient(to bottom, var(--border) 0, var(--border) 1px, transparent 1px, transparent 24px);
}
.settimana-barra {
  position: absolute;
  left: 3px;
  right: 3px;
  background: #fed7aa;
  border-top: 2px solid var(--warning);
  border-bottom: 2px solid var(--warning);
  border-radius: 3px;
  min-height: 4px;
}

/* ── Marchio Velico ─────────────────────────────────────────────────── */
.brand-logo { height: 34px; width: auto; flex-shrink: 0; }
.login-logo { display: block; height: 84px; width: auto; margin: 0 auto 10px; }
.login-card h1, .login-card .subtitle { text-align: center; }
