/* ═══════════════════════════════════════════════
   TIMBRATURE — Raffaella's World
   Stili specifici di pages/timbrature/index.html
   ═══════════════════════════════════════════════ */

/* ── Controls bar ── */
.controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 20px;
  margin-bottom: 16px;
  opacity: 0;
  animation: fadeUp 0.8s 0.5s ease forwards;
}

.month-sel {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.month-sel label {
  font-size: 0.82rem;
  color: var(--text-light);
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
}
.month-sel select {
  border: 1.5px solid var(--petal);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: "Lato", sans-serif;
  color: var(--bark);
  background: var(--cream);
  cursor: pointer;
  outline: none;
}
.month-sel select:focus { border-color: var(--rose); }

.controls-btns { display: flex; gap: 8px; flex-wrap: wrap; }

/* Override nomi bottoni per questa pagina */
.btn-save  { background: var(--bark); color: var(--cream); }
.btn-save.unsaved { background: var(--c-orange); animation: pulse 0.8s infinite alternate; }
.btn-clear { background: transparent; color: var(--c-red); border: 1.5px solid rgba(168, 50, 50, 0.3); }
.btn-calc  { background: linear-gradient(135deg, var(--deep-rose), var(--c-purple)); color: #fff; }

@keyframes pulse { from { opacity: 1; } to { opacity: 0.65; } }

/* ── Summary cards ── */
.summary {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 16px;
  opacity: 0;
  animation: fadeUp 0.8s 0.6s ease forwards;
}
@media (max-width: 900px) { .summary { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .summary { grid-template-columns: repeat(2, 1fr); } }

.sum-card   { padding: 14px 12px; text-align: center; }
.sum-emoji  { font-size: 1.25rem; margin-bottom: 5px; }
.sum-label  { font-size: 0.62rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-light); margin-bottom: 3px; }
.sum-val    { font-family: "Playfair Display", serif; font-size: 1.4rem; font-weight: 700; }
.sum-sub    { font-size: 0.65rem; color: var(--text-light); margin-top: 3px; }

.sw-bar-wrap { margin-top: 7px; height: 5px; background: rgba(138, 171, 140, 0.2); border-radius: 99px; overflow: hidden; }
.sw-bar-fill { height: 100%; border-radius: 99px; transition: width 0.4s; }

/* Colori di default per i sum-val statici */
.sum-val--red    { color: var(--c-red); }
.sum-val--green  { color: var(--c-green); }
.sum-val--blue   { color: var(--c-blue); }

/* ── Pannello calcola uscita ── */
.calc-box {
  display: none;
  padding: 18px 22px;
  margin-bottom: 16px;
  border-color: rgba(106, 27, 154, 0.22);
}
.calc-box h3 {
  font-family: "Playfair Display", serif;
  font-size: 1rem;
  font-style: italic;
  color: var(--c-purple);
  margin-bottom: 12px;
}
.calc-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.calc-row label { font-size: 0.8rem; font-weight: 700; color: var(--text-light); white-space: nowrap; }
.calc-row input {
  border: 1.5px solid var(--petal);
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 0.88rem;
  width: 90px;
  text-align: center;
  outline: none;
  font-family: "Lato", sans-serif;
  background: var(--cream);
  color: var(--text);
}
.calc-row input:focus { border-color: var(--rose); }

.calc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}
@media (max-width: 480px) { .calc-grid { grid-template-columns: 1fr; } }

.calc-mini {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  text-align: center;
}
.calc-mini .cm-l { font-size: 0.62rem; color: var(--text-light); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.calc-mini .cm-v { font-family: "Playfair Display", serif; font-size: 1.05rem; font-weight: 700; color: var(--c-purple); margin-top: 2px; }

.calc-result {
  background: rgba(106, 27, 154, 0.06);
  border: 1px solid rgba(106, 27, 154, 0.14);
  border-radius: 12px;
  padding: 12px 16px;
  margin-top: 10px;
}
.calc-result .r-label { font-size: 0.7rem; color: var(--text-light); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 3px; }
.calc-result .r-val   { font-family: "Playfair Display", serif; font-size: 1.8rem; font-weight: 700; color: var(--c-purple); }
.calc-result .r-sub   { font-size: 0.76rem; color: var(--text-light); margin-top: 5px; }

/* ── Sezione tabella ── */
.table-section {
  opacity: 0;
  animation: fadeUp 0.8s 0.7s ease forwards;
}

.scroll-hint {
  display: none;
  text-align: right;
  font-size: 0.7rem;
  color: var(--text-light);
  font-style: italic;
  padding: 6px 4px 4px;
}
@media (max-width: 860px) { .scroll-hint { display: block; } }

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 16px;
}
.table-wrap::-webkit-scrollbar       { height: 4px; }
.table-wrap::-webkit-scrollbar-thumb { background: var(--petal); border-radius: 99px; }

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
  font-size: 0.8rem;
}

thead th {
  background: var(--bark);
  color: var(--cream);
  padding: 10px 8px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  white-space: nowrap;
}
thead th:first-child { text-align: left; padding-left: 16px; border-radius: 14px 0 0 0; }
thead th:last-child  { border-radius: 0 14px 0 0; }

tbody tr               { border-bottom: 1px solid rgba(242, 196, 184, 0.28); transition: background 0.15s; }
tbody tr.weekend       { background: rgba(0, 0, 0, 0.015); }
tbody tr.weekend td    { color: #bbb; }
tbody tr.da-assegnare  { background: rgba(200, 169, 110, 0.1); }
tbody tr:not(.weekend):not(.da-assegnare):hover { background: rgba(242, 196, 184, 0.13); }

td            { padding: 7px 8px; text-align: center; vertical-align: middle; }
td:first-child{ text-align: left; padding-left: 16px; }

.day-num  { font-weight: 700; color: var(--bark); }
.day-name { font-size: 0.68rem; color: var(--text-light); margin-left: 3px; }

/* ── Input tabella ── */
.time-input {
  border: 1.5px solid var(--border);
  border-radius: 7px;
  padding: 4px;
  font-size: 0.76rem;
  width: 70px;
  text-align: center;
  outline: none;
  font-family: "Lato", sans-serif;
  background: rgba(253, 246, 238, 0.8);
  color: var(--text);
  transition: border-color 0.2s;
}
.time-input:focus { border-color: var(--rose); background: #fff; }

.tipo-sel {
  border: 1.5px solid var(--border);
  border-radius: 7px;
  padding: 4px 5px;
  font-size: 0.72rem;
  font-weight: 700;
  outline: none;
  font-family: "Lato", sans-serif;
  background: rgba(253, 246, 238, 0.8);
  cursor: pointer;
  max-width: 130px;
  color: var(--text);
}
.tipo-sel.sw    { background: rgba(42,  82,  152, 0.07); color: var(--c-blue);   border-color: rgba(42,  82,  152, 0.2); }
.tipo-sel.ferie { background: rgba(196, 122, 26,  0.07); color: var(--c-orange); border-color: rgba(196, 122, 26,  0.25); }
.tipo-sel.mal   { background: rgba(168, 50,  50,  0.07); color: var(--c-red);    border-color: rgba(168, 50,  50,  0.2); }

.note-input {
  border: 1.5px solid var(--border);
  border-radius: 7px;
  padding: 4px 6px;
  font-size: 0.72rem;
  width: 100px;
  outline: none;
  font-family: "Lato", sans-serif;
  background: rgba(253, 246, 238, 0.8);
  color: var(--text);
}
.note-input:focus { border-color: var(--rose); background: #fff; }

/* ── Badge ── */
.badge-gray {
  display: inline-block;
  background: rgba(0, 0, 0, 0.05);
  color: #bbb;
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 0.7rem;
  font-weight: 700;
}
.extra-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(200, 169, 110, 0.13);
  color: var(--c-orange);
  border: 1px solid rgba(200, 169, 110, 0.35);
  border-radius: 7px;
  padding: 3px 7px;
  font-size: 0.72rem;
  font-weight: 700;
}
.extra-badge.zero { background: rgba(58,  122, 58,  0.07); color: var(--c-green); border-color: rgba(58,  122, 58,  0.22); }
.extra-badge.neg  { background: rgba(168, 50,  50,  0.07); color: var(--c-red);   border-color: rgba(168, 50,  50,  0.22); }

/* ── Override cells ── */
.ov-wrap  { display: flex; align-items: center; gap: 2px; justify-content: center; }
.ov-input {
  border: 1.5px solid var(--border);
  border-radius: 7px;
  padding: 4px;
  font-size: 0.72rem;
  width: 54px;
  text-align: center;
  outline: none;
  font-family: "Lato", sans-serif;
  background: rgba(253, 246, 238, 0.8);
  color: var(--text);
}
.ov-input:focus { border-color: var(--rose); background: #fff; }
.ov-input.mod   { border-color: var(--c-orange) !important; background: rgba(200, 169, 110, 0.1); font-weight: 700; }

.ov-reset {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.72rem;
  color: #ccc;
  padding: 0 2px;
  transition: color 0.2s;
}
.ov-reset:hover { color: var(--c-red); }

/* ── Legenda ── */
.legend {
  margin-top: 14px;
  font-size: 0.72rem;
  color: var(--text-light);
  line-height: 1.9;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--border);
}

/* ── Footer override ── */
footer { padding: 22px; margin-top: 16px; }

/* ── Classi utility celle tabella ── */
.cell-disabled { color: #ddd; }
.cell-tipo     { text-align: center; font-weight: 700; font-size: 0.76rem; }
.cell-usc-pers { font-size: 0.68rem; color: var(--text-light); }
.cell-ok       { color: var(--c-green); font-size: 1rem; }
.cell-precup   { color: var(--c-red); font-weight: 700; }
.cell-detail-red { font-size: 0.65rem; color: var(--c-red); }

/* ── Classi utility legenda ── */
.leg-red    { color: var(--c-red);    font-weight: 700; }
.leg-green  { color: var(--c-green);  font-weight: 700; }
.leg-blue   { color: var(--c-blue);   font-weight: 700; }
.leg-orange { color: var(--c-orange); font-weight: 700; }

/* ── Classi utility calc-mini ── */
.cm-v--orange { color: var(--c-orange); }
.cm-v--purple { color: var(--c-purple); }
