/* ============================================================
   InOrario — stile "Semplice" (design system)
   Un solo font sans, testo grande, card morbide, CTA enormi.
   Pensato per un collaboratore scolastico: zero ambiguità.
   Fonte: design_handoff_eduflow_redesign/mockups/simple.css
   ============================================================ */

:root {
  --paper:        oklch(0.97 0.006 80);
  --surface:      #ffffff;
  --surface-sunk: oklch(0.955 0.008 80);

  --ink-1: oklch(0.20 0.035 260);
  --ink-2: oklch(0.38 0.03 260);
  --ink-3: oklch(0.55 0.02 260);
  --ink-4: oklch(0.75 0.015 260);

  --rule:       oklch(0.90 0.01 80);
  --rule-soft:  oklch(0.94 0.007 80);

  --accent:      oklch(0.72 0.14 55);
  --accent-deep: oklch(0.58 0.15 45);
  --accent-soft: oklch(0.95 0.05 60);
  --accent-ink:  oklch(0.34 0.11 45);

  --ok:      oklch(0.58 0.12 155);
  --ok-soft: oklch(0.95 0.045 155);
  --ok-ink:  oklch(0.34 0.09 155);

  --danger:      oklch(0.56 0.17 27);
  --danger-soft: oklch(0.95 0.045 30);
  --danger-ink:  oklch(0.40 0.13 30);

  --font: "Geist", -apple-system, system-ui, sans-serif;

  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;
  --r-pill: 999px;

  --shadow-card: 0 1px 2px oklch(0.2 0.04 260 / 0.05), 0 8px 24px -6px oklch(0.2 0.04 260 / 0.08);
  --shadow-pop:  0 4px 8px oklch(0.2 0.04 260 / 0.06), 0 24px 48px -12px oklch(0.2 0.04 260 / 0.18);
  --ring: 0 0 0 4px oklch(0.72 0.14 55 / 0.22);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink-1);
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
  line-height: 1.45;
}
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
svg { display: block; flex-shrink: 0; }

/* ============================================================
   Top bar
   ============================================================ */
.topbar {
  height: 76px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 19px;
  flex-shrink: 0;
}
.brand .mark {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--ink-1);
  color: var(--paper);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700;
  overflow: hidden;
}
.brand .mark img { width: 100%; height: 100%; object-fit: cover; }
/* Marchio InOrario: niente riquadro scuro, il simbolo ha colori propri */
.brand .mark.mark-logo { background: transparent; border-radius: 0; overflow: visible; }
.brand .mark.mark-logo svg { display: block; }
.top-date {
  font-size: 14.5px;
  color: var(--ink-3);
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}
.top-user { flex-shrink: 0; }
.top-user {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 8px 6px 6px;
  border-radius: var(--r-pill);
}
.top-user:hover { background: var(--surface-sunk); }
.topbar .sep { width: 1px; height: 26px; background: var(--rule); margin: 0 4px; }
.topnav { display: flex; gap: 4px; }

/* ============================================================
   Avatar
   ============================================================ */
.avatar {
  border-radius: 999px;
  background: oklch(0.93 0.012 260);
  color: var(--ink-2);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}
.avatar.accent { background: var(--accent-soft); color: var(--accent-ink); }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 48px; padding: 0 22px;
  border-radius: var(--r-pill);
  font-weight: 600; font-size: 16px;
  transition: transform 100ms ease, background 120ms ease, box-shadow 120ms ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--ink-1); color: var(--paper); }
.btn-primary:hover { background: oklch(0.12 0.035 260); }
.btn-accent { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.btn-accent:hover { background: oklch(0.67 0.14 55); }
.btn-ghost { background: var(--surface-sunk); color: var(--ink-2); }
.btn-ghost:hover { background: oklch(0.92 0.01 80); }
.btn-outline { background: var(--surface); color: var(--ink-1); border: 1.5px solid var(--rule); }
.btn-outline:hover { background: var(--surface-sunk); }
.btn-danger { background: var(--danger-soft); color: var(--danger-ink); font-weight: 700; }
.btn-danger:hover { background: oklch(0.90 0.06 30); }
.btn-lg { height: 58px; padding: 0 28px; font-size: 17px; }
.btn-sm { height: 38px; padding: 0 16px; font-size: 14.5px; }
.btn-icon { width: 44px; height: 44px; padding: 0; border-radius: 999px; }
.btn:disabled { opacity: 0.4; pointer-events: none; }

/* ============================================================
   Inputs
   ============================================================ */
.input {
  width: 100%;
  height: 52px;
  padding: 0 18px;
  background: var(--surface);
  border: 1.5px solid var(--rule);
  border-radius: var(--r-md);
  font-size: 16px;
  color: var(--ink-1);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
select.input { appearance: none; -webkit-appearance: none; background-image:
  url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2379808A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 16px center; padding-right: 42px; }
.input::placeholder { color: var(--ink-4); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
textarea.input { height: auto; min-height: 96px; padding: 14px 18px; resize: vertical; }
.label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 8px;
}

/* ============================================================
   Card
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--rule-soft);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
}
a.card { transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease; display: block; }
a.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-pop); border-color: var(--rule); }

/* ============================================================
   Pills / badges
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 12px;
  border-radius: var(--r-pill);
  font-size: 13.5px; font-weight: 700;
}
.badge-amber { background: var(--accent-soft); color: var(--accent-ink); }
.badge-green { background: var(--ok-soft); color: var(--ok-ink); }
.badge-red   { background: var(--danger-soft); color: var(--danger-ink); }
.badge-ink   { background: oklch(0.93 0.012 260); color: var(--ink-2); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ============================================================
   Layout helpers
   ============================================================ */
.container { max-width: 1040px; margin: 0 auto; padding: 0 32px; }
.scroll { overflow-y: auto; height: 100%; }

/* ============================================================
   Modal
   ============================================================ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: oklch(0.20 0.04 260 / 0.45);
  backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
  padding: 24px;
}
.modal {
  width: 100%; max-width: 560px;
  background: var(--surface);
  border-radius: 24px;
  box-shadow: var(--shadow-pop);
  overflow: hidden;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.modal-body { padding: 32px; overflow-y: auto; }
.modal-footer {
  padding: 20px 32px;
  background: var(--surface-sunk);
  border-top: 1px solid var(--rule-soft);
  display: flex; justify-content: flex-end; gap: 10px;
}

/* ============================================================
   Report — tabs, KPI, grafici CSS puri, tabelle
   ============================================================ */
.seg { display: inline-flex; padding: 4px; background: var(--surface-sunk); border-radius: var(--r-pill); gap: 2px; }
.seg button, .seg a { height: 38px; padding: 0 18px; border-radius: var(--r-pill); font-size: 14.5px; font-weight: 600; color: var(--ink-3); display: inline-flex; align-items: center; }
.seg button.active, .seg a.active { background: var(--surface); color: var(--ink-1); box-shadow: var(--shadow-card); }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs .tab { height: 42px; padding: 0 20px; border-radius: var(--r-pill); font-size: 15px; font-weight: 600; color: var(--ink-3); background: var(--surface-sunk); display: inline-flex; align-items: center; gap: 8px; }
.tabs .tab.active { background: var(--ink-1); color: var(--paper); }
.kpi-value { font-size: 44px; font-weight: 800; letter-spacing: -0.02em; line-height: 1; }
.tab-panel { animation: fadein 180ms ease; }
.tab-panel.hidden { display: none; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.rtable { width: 100%; border-collapse: collapse; }
.rtable th { text-align: left; font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--ink-3); padding: 12px 16px; border-bottom: 1px solid var(--rule); }
.rtable td { padding: 14px 16px; border-bottom: 1px solid var(--rule-soft); font-size: 14.5px; }
.rtable tr:last-child td { border-bottom: none; }
.bar-track { height: 100%; background: var(--surface-sunk); border-radius: var(--r-pill); overflow: hidden; }
.bar-fill { height: 100%; border-radius: var(--r-pill); background: var(--accent); }

/* ============================================================
   Utility
   ============================================================ */
.hidden { display: none !important; }
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.fade-out { opacity: 0; transform: scale(0.97); transition: opacity 260ms ease, transform 260ms ease; }
.spin { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Toast */
#toast-wrap { position: fixed; right: 24px; bottom: 24px; z-index: 100; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-md); box-shadow: var(--shadow-pop); padding: 14px 18px; font-size: 14.5px; font-weight: 600; display: flex; align-items: center; gap: 10px; min-width: 240px; }
.toast.ok { border-left: 4px solid var(--ok); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--accent); }
