/* =============== RESET =============== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

/* =============== PALETTE AMARANTO STEDA =============== */
:root {
  --amaranto-main:   #B02747;  /* amaranto principale, più chiaro */
  --amaranto-accent: #E03A66;  /* highlight */
  --amaranto-soft:   #C43C59;  /* tono intermedio */
  --panel-dark:      #20141C;
  --body-dark:       #1A0F14;
  --text-light:      #E5E7EB;
  --text-muted:      #9CA3AF;
}

/* =============== BODY / SFONDO =============== */
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
               "Segoe UI", Roboto, Arial, sans-serif;
  background:
    radial-gradient(circle at 10% 0%,  rgba(224,57,102,0.10), transparent 60%),
    radial-gradient(circle at 90% 100%, rgba(139,21,56,0.12), transparent 60%),
    linear-gradient(135deg, #1A0F14 0%, #1E1218 40%, #20131A 100%);
  color: var(--text-light);
}

/* =============== LAYOUT =============== */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 1rem 2rem;
  background: rgba(20,20,25,0.92);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(176,39,71,0.45);
}

.app-header-inner {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
}

.app-title {
  font-size: 1.1rem;
  letter-spacing: 0.20em;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-light);
}

.app-subtitle {
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: .2rem;
}

.app-main {
  flex: 1;
  padding: 1.2rem 2rem 2rem;
}

.app-container {
  max-width: 1600px;
  margin: 0 auto;
}

/* =============== CARD (AMARANTO DARK) =============== */
.card {
  position: relative;
  background: var(--panel-dark);
  border-radius: 1.2rem;
  border: 1px solid rgba(176,39,71,0.5);
  padding: 1.4rem 1.6rem;
  box-shadow:
    0 18px 40px rgba(0,0,0,0.65),
    0 0 0 1px rgba(80, 0, 20, 0.25);
  animation: fadeIn .45s ease-out;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: -50%;
  background:
    radial-gradient(circle at 10% 0%,  rgba(224,57,102,0.07), transparent 60%),
    radial-gradient(circle at 90% 100%, rgba(139,21,56,0.10), transparent 60%);
  opacity: .9;
  pointer-events: none;
  mix-blend-mode: soft-light;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =============== BOTTONI =============== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .45rem 1.1rem;
  border-radius: 999px;
  border: none;
  font-size: .82rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .15s ease, background .15s ease;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px) scale(0.98);
}

/* ==== Tasto "Completato" – Giallo Paglia Elegante ==== */
.btn-primary {
  background: linear-gradient(135deg, #FFF3C4, #FFE8A3);
  color: #4a3e2a; /* marroncino caldo e leggibile */
  border: 1px solid rgba(255, 232, 163, 0.9);
  box-shadow:
    0 6px 16px rgba(255, 232, 163, 0.25),
    0 0 6px rgba(255, 232, 163, 0.40);
  transition: all .15s ease-out;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #FFF7D1, #FFEFC2);
  box-shadow:
    0 10px 20px rgba(255, 232, 163, 0.35),
    0 0 10px rgba(255, 232, 163, 0.55);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0px) scale(0.97);
}

.btn-secondary {
  background: linear-gradient(135deg, #2563eb, #1e40af); /* blu + blu scuro */
  color: #fff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.45);
}

.btn-secondary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(37, 99, 235, 0.60);
}

.btn-ghost {
  background: transparent;
  border: 1px solid rgba(176,39,71,0.6);
  color: var(--text-light);
}

.btn-ghost:hover {
  background: rgba(176,39,71,0.18);
}

.btn-danger {
  background: linear-gradient(135deg, #e11d48, #b91c1c);
  color: #fff;
  box-shadow: 0 8px 18px rgba(220,38,38,0.5);
}

.btn-small {
  padding: .28rem .75rem;
  font-size: .78rem;
}

/* =============== RIGA AZIONI (bottoni completato / rinviato) =============== */
.actions-row {
  display: flex;
  flex-wrap: nowrap;       /* non andare a capo su desktop */
  gap: 0.45rem;
  align-items: center;
}

.actions-row form {
  display: inline-flex;
  margin: 0;
  padding: 0;
}

@media (max-width: 640px) {
  .actions-row {
    flex-wrap: wrap;       /* su mobile può andare a capo */
  }
}

/* =============== TABELLA LARGA (1600px) =============== */
.table-wrapper {
  margin-top: 1rem;
  border-radius: 1rem;
  overflow: hidden;
  background: linear-gradient(135deg, #151017 0%, #1A1219 40%, #1F151D 100%);
  border: 1px solid rgba(176,39,71,0.55);
}

.table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: .9rem;
}

.table thead {
  background: transparent;
}

.table th {
  background: linear-gradient(90deg, #23151F, #251621);
  color: var(--text-muted);
  padding: .6rem .7rem;
  font-weight: 500;
  border-bottom: 1px solid rgba(176,39,71,0.5);
}

.table td {
  padding: .65rem .7rem;
  border-bottom: 1px solid rgba(80,0,20,0.25);
  color: var(--text-light);
}
.table td input[type="time"] {
    width: 100%;
    max-width: 90px;    /* match con la colonna */
}

/* Gli input dentro la tabella devono occupare tutta la colonna */
.table td input[type="text"],
.table td input[type="time"],
.table td select {
  width: 100%;
  box-sizing: border-box;
}
/* Colonna ORA molto più piccola */
.table th:nth-child(1),
.table td:nth-child(1) {
    width: 90px !important;   /* larghezza perfetta */
    max-width: 90px !important;
    min-width: 100px !important;
}

/* distribuzione colonne su desktop */
@media (min-width: 900px) {
  /* Colonna ORA (sia dashboard che create/edit) */
  .table th:nth-child(1),
  .table td:nth-child(1) {
      width: 150px !important;
      max-width: 150px !important;
      min-width: 150px !important;
  }

  /* Colonna DESCRIZIONE: prende tutto lo spazio che resta */
  .table th:nth-child(2),
  .table td:nth-child(2) {
      width: auto !important;
  }

  /* Colonna MODALITÀ (solo nelle tabelle a 3 colonne) */
  .table th:nth-child(3),
  .table td:nth-child(3) {
      width: 220px !important;
      max-width: 220px !important;
  }

  /* Nella dashboard hai 5 colonne, quindi per quella puoi
     eventualmente tenere o aggiungere qui le width specifiche
     delle colonne 4 e 5, se ti servono.
  */
}
/* Override SPECIFICO per create/edit calendar (tabelle a 3 colonne) */
.card .table th:nth-child(1),
.card .table td:nth-child(1) {
    width: 150px !important;
    max-width: 150px !important;
    min-width: 150px !important;
}

.card .table th:nth-child(2),
.card .table td:nth-child(2) {
    width: auto !important;  /* si espande sempre */
}

.card .table th:nth-child(3),
.card .table td:nth-child(3) {
    width: 220px !important;
    max-width: 220px !important;
    min-width: 220px !important;
}

/* Input ora in create/edit */
.card .table td input[type="time"] {
    width: 100%;
    max-width: 150px !important;
    text-align: center;
}



/* Hover elegante per TV */
.table tbody tr {
  transition: background .18s ease, transform .18s ease, box-shadow .18s ease;
}
.table tbody tr:hover {
  background: rgba(176,39,71,0.22);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.7);
}
/* Colonna ORA piccola e fissa */
.table th:nth-child(1),
.table td:nth-child(1) {
    width: 80px !important;
    max-width: 80px !important;
    min-width: 80px !important;
}

/* =============== COLORI LOGICA ORARIA =============== */
.row-default { background: rgba(32,20,28,0.35); }
.row-yellow  { background: rgba(234,179,8,0.22); }
.row-red     { background: rgba(224,58,102,0.35); }
.row-green   { background: rgba(16,185,129,0.25); }
.row-gray    { background: rgba(148,163,184,0.25); }

.blink {
  animation: blink 1.1s linear infinite;
}

@keyframes blink {
  50% { opacity: 0.35; }
}
/* Lampeggio per il tasto "Completato" quando l'esame è oltre 60 min e non chiuso */
.btn-blink {
  animation: blink 1s linear infinite;
}

/* =============== BADGES STATO =============== */
.badge {
  display: inline-block;
  padding: .18rem .65rem;
  border-radius: 999px;
  font-size: .75rem;
}

.badge-planned {
  background: rgba(176,39,71,0.25);
  border: 1px solid rgba(176,39,71,0.6);
  color: var(--text-light);
}

.badge-completed {
  background: rgba(16,185,129,0.25);
  border: 1px solid rgba(16,185,129,0.6);
  color: #83f3c5;
}

.badge-postponed {
  background: rgba(148,163,184,0.25);
  border: 1px solid rgba(148,163,184,0.6);
  color: #e5e7eb;
}

/* =============== FORM GENERICI =============== */
.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: .8rem;
  align-items: center;
  position: relative;
  z-index: 1;
}
/* === Date picker nell'header della dashboard === */
.date-picker-form {
  display: flex;
  align-items: flex-end;
}

.date-picker {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  align-items: flex-end;
}

.date-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.date-input {
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(176,39,71,0.6);
  background: #1b151c;
  color: var(--text-light);
  font-size: 0.85rem;
  min-width: 145px;
}

.date-input:focus {
  outline: none;
  box-shadow: 0 0 0 1px rgba(224,58,102,0.7);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: .2rem;
}

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

input[type="text"],
input[type="time"],
input[type="date"],
select {
  padding: .4rem .55rem;
  border-radius: .6rem;
  border: 1px solid rgba(176,39,71,0.45);
  background: #1b151c;
  color: #f3f4f6;
  font-size: .84rem;
}

input::placeholder {
  color: #888;
}

/* =============== LINK =============== */
a {
  color: #f9a8d4;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* =============== RESPONSIVE TABELLA =============== */
@media (max-width: 768px) {
  .app-header {
    padding-inline: 1.2rem;
  }
  .app-main {
    padding-inline: 1.2rem;
  }
  .app-header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .table,
  .table thead,
  .table tbody,
  .table th,
  .table td,
  .table tr {
    display: block;
    width: 100%;
  }

  .table thead {
    display: none;
  }

  .table tr {
    border-bottom: 1px solid rgba(80,0,20,0.4);
  }

  .table td {
    border: none;
    border-bottom: 1px solid rgba(80,0,20,0.4);
    display: flex;
    justify-content: space-between;
    gap: .6rem;
    font-size: .8rem;
  }

  .table td::before {
    font-weight: 600;
    color: var(--text-muted);
  }

  .table td[data-label]::before {
    content: attr(data-label);
  }
}
/* === Stile tabella "Gestisci calendari" === */
.mgmt-table th {
    background: rgba(255,255,255,0.05);
    color: #cbd5e1;
}

.mgmt-table td {
    background: rgba(255,255,255,0.02);
}

/* Hover elegante */
.mgmt-table tr:hover td {
    background: rgba(255,255,255,0.06);
}

/* Bottone elimina */
.btn-danger {
    background: linear-gradient(135deg, #b91c1c, #7f1d1d);
    color: #fff;
    box-shadow: 0 6px 12px rgba(185,28,28,0.45);
}
.btn-danger:hover {
    box-shadow: 0 10px 20px rgba(185,28,28,0.6);
    transform: translateY(-1px);
}
/* =========================
   DESKTOP vs MOBILE
   ========================= */
.desktop-only {
  display: block;
}

.exam-cards-mobile {
  display: none;
}

/* =========================
   CARD MOBILE ESAME
   ========================= */
.exam-cards-mobile {
  margin-top: 1rem;
  display: none;
  flex-direction: column;
  gap: 0.7rem;
}

.exam-card {
  border-radius: 0.9rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid rgba(176,39,71,0.5);
  cursor: pointer;
}

.exam-card-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.exam-card-time {
  font-size: 1rem;
  font-weight: 600;
}

.exam-card-status {
  display: flex;
  align-items: center;
}

.exam-card-footer {
  margin-top: 0.35rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: #cbd5f5;
}

.exam-card-hint {
  opacity: 0.7;
}

.exam-card-actions {
  display: flex;
  gap: 0.3rem;
}

/* =========================
   MODALE MOBILE
   ========================= */
.exam-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.exam-modal-overlay.show {
  display: flex;
}

.exam-modal {
  background: #20141C;
  border-radius: 1rem;
  border: 1px solid rgba(176,39,71,0.7);
  padding: 0.9rem 1rem;
  max-width: 420px;
  width: 92%;
  box-shadow: 0 18px 45px rgba(0,0,0,0.8);
}

.exam-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}

.exam-modal-time {
  font-size: 1.1rem;
  font-weight: 600;
}

.exam-modal-close {
  background: transparent;
  border: none;
  color: #e5e7eb;
  font-size: 1.4rem;
  cursor: pointer;
}

.exam-modal-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
}

.modal-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.modal-label {
  font-weight: 500;
  color: #9ca3af;
}

/* =========================
   RESPONSIVE SWITCH
   ========================= */
@media (max-width: 768px) {
  .desktop-only {
    display: none;
  }
  .exam-cards-mobile {
    display: flex;
  }
}
/* =========================
/* =========================
   OVERVIEW ESAMI DI OGGI – VERSIONE SEMPLICE
   ========================= */

/* pagina a tutto schermo */
html, body {
  height: 100%;
}

body {
  overflow: hidden; /* niente scroll sul pannello TV */
}

/* contenitore principale del pannello */
.overview-page {
  height: 100vh;
  padding: 4vh 4vw;
  display: flex;
  flex-direction: column;
}

/* header e footer */
.overview-header {
  text-align: center;
  margin-bottom: 1vh;
}

.overview-title-main {
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0 0 0.6rem;
  font-size: 3vw;   /* proporzionale alla larghezza */
}

.overview-subtitle {
  font-size: 1.1rem;
  color: #e5e7eb;
  opacity: 0.85;
}

.overview-footer {
  text-align: center;
  margin-top: 1vh;
  font-size: 1rem;
}

/* contenitore dei tre cerchi */
.overview-circles {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 2vw;
}

/* card di ogni cerchio */
.overview-circle-card {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* cerchio base: dimensioni in vh così su una TV 1080p diventano GROSSI */
.overview-circle-card .circle {
  width: 32vh;
  height: 32vh;
  max-width: 30vw;   /* evita di uscire orizzontalmente */
  max-height: 30vw;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 6px solid rgba(148, 163, 184, 0.4);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.85);
  position: relative;
}

/* cerchi pieni (previsti, in corso) */
.overview-circle-card.circle-blue .circle {
  background: radial-gradient(circle at 30% 20%, #60a5fa, #1d4ed8);
  border-color: #60a5fa;
  color: #f9fafb;
}

.overview-circle-card.circle-amber .circle {
  background: radial-gradient(circle at 30% 20%, #facc15, #d97706);
  border-color: #fbbf24;
  color: #111827;
}

/* cerchio progress (completamento) */
.circle-progress {
  background:
    conic-gradient(#4ade80 calc(var(--percent) * 1%), rgba(15, 23, 42, 0.9) 0);
}

/* foro interno per creare l’anello */
.circle-progress::before {
  content: "";
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  background: radial-gradient(circle at 20% 0%, #020617, #020617 60%);
}

/* contenuto interno ai cerchi */
.circle-progress .circle-inner {
  position: relative;
  z-index: 1;
}

.circle-inner {
  text-align: center;
}

.circle-number {
  font-weight: 800;
  font-size: 10vh;   /* enorme, legibile dalla stanza */
}

.circle-label-small {
  display: none;
}

.circle-percent {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.95rem;
  opacity: 0.85;
}

.circle-caption {
  margin-top: 1.2rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 2.4vh;
}

.overview-footer .overview-claim {
  font-size: 1.2rem;
  line-height: 1.4;
}

/* layout mobile: cerchi impilati */
@media (max-width: 900px) {
  .overview-page {
    padding: 2rem 1rem;
  }

  .overview-circles {
    flex-direction: column;
    justify-content: center;
    gap: 1.5rem;
  }

  .overview-circle-card .circle {
    width: 55vw;
    height: 55vw;
    max-width: none;
    max-height: none;
  }

  .circle-number {
    font-size: 3rem;
  }

  .circle-caption {
    font-size: 1rem;
  }

  .overview-title-main {
    font-size: 2rem;
  }
}
/* Centra contenuto in verticale/orizzontale dentro la main */
.app-main {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* L’overview occupa tutto lo spazio disponibile in altezza */
.overview-page {
    width: 100%;
    height: 100%;
    padding: 4vh 4vw;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
/* =========================
   DISTRIBUZIONE 3 CERCHI FULL WIDTH
   ========================= */

/* Riga dei cerchi: occupa tutta la larghezza, spaziata in modo uniforme */
.overview-circles {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-evenly; /* equidistanti */
    gap: 2vw;
}

/* Ogni "colonna" prende 1/3 dello spazio e centra il cerchio */
.overview-circle-card {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Cerchio: dimensione in % della larghezza, con min e max per non esagerare */
.overview-circle-card .circle {
    width: 24vw;
    height: 24vw;

    min-width: 200px;
    min-height: 200px;
    max-width: 420px;
    max-height: 420px;

    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
