:root {
  --leaf: #2F6B3A;
  --leaf-dark: #1F4A27;
  --leaf-pale: #E4F0DC;
  --carrot: #E07B22;
  --ink: #1C2620;
  --muted: #5B6B60;
  --paper: #FFFFFF;
  --error: #B3261E;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--leaf-pale); min-height: 100vh; }

/* ---------- Student page ---------- */
.kiosk {
  max-width: 34rem;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}
.kiosk h1 {
  font-size: clamp(2rem, 6vw, 2.75rem);
  line-height: 1.1;
  margin: 0 0 .5rem;
  color: var(--leaf-dark);
}
.kiosk p.lead { font-size: 1.15rem; color: var(--muted); margin: 0 0 2rem; }

.card {
  background: var(--paper);
  border-radius: 18px;
  padding: 2rem;
  border: 2px solid #CFE2C3;
}
label { display: block; font-weight: 600; font-size: 1.05rem; margin-bottom: .5rem; }
input.id-input {
  width: 100%;
  font-size: 2.5rem;
  letter-spacing: .08em;
  padding: .6rem .9rem;
  border: 3px solid #BFD6B2;
  border-radius: 12px;
  font-variant-numeric: tabular-nums;
}
input.id-input:focus { outline: none; border-color: var(--leaf); box-shadow: 0 0 0 4px rgba(47,107,58,.2); }

button {
  font: inherit;
  font-weight: 600;
  font-size: 1.15rem;
  border: 0;
  border-radius: 12px;
  padding: .85rem 1.4rem;
  cursor: pointer;
}
button:focus-visible { outline: 3px solid var(--carrot); outline-offset: 3px; }
.btn-primary { background: var(--leaf); color: #fff; }
.btn-primary:hover { background: var(--leaf-dark); }
.btn-secondary { background: #EEF2EC; color: var(--ink); }
.btn-secondary:hover { background: #E1E8DD; }
.btn-wide { width: 100%; margin-top: 1.25rem; }
button:disabled { opacity: .6; cursor: wait; }

.message { margin-top: 1rem; font-size: 1.05rem; min-height: 1.5em; }
.message.error { color: var(--error); font-weight: 600; }

.success {
  text-align: center;
  padding: 2.5rem 1rem;
}
.success .big { font-size: 4rem; line-height: 1; }
.success h2 { font-size: 1.8rem; margin: .75rem 0 .25rem; color: var(--leaf-dark); }
.success p { color: var(--muted); margin: 0; }

dialog {
  border: 0;
  border-radius: 18px;
  padding: 2rem;
  width: min(28rem, 92vw);
  text-align: center;
}
dialog::backdrop { background: rgba(28,38,32,.55); }
dialog p.q { margin: 0; color: var(--muted); font-size: 1.1rem; }
dialog .name { font-size: 2rem; font-weight: 700; margin: .5rem 0 .25rem; color: var(--ink); }
dialog .note { color: var(--carrot); font-weight: 600; margin: .5rem 0 0; }
dialog .actions { display: flex; gap: .75rem; margin-top: 1.75rem; }
dialog .actions button { flex: 1; }

/* ---------- Manager page ---------- */
.manager { max-width: 52rem; margin: 0 auto; padding: 2rem 1.5rem 3rem; }
.manager header {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem;
  margin-bottom: 1.5rem;
}
.manager h1 { margin: 0; font-size: 1.75rem; color: var(--leaf-dark); }
.manager .date { color: var(--muted); margin: .25rem 0 0; }
.count { font-size: 3.5rem; font-weight: 700; line-height: 1; color: var(--leaf); text-align: right; }
.count small { display: block; font-size: 1rem; font-weight: 500; color: var(--muted); }
.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; }
.toolbar input[type=date] { font: inherit; padding: .5rem; border-radius: 8px; border: 2px solid #BFD6B2; }
.toolbar button, .toolbar a.btn { font-size: 1rem; padding: .55rem 1rem; text-decoration: none; display: inline-block; }

.table-wrap { overflow-x: auto; background: var(--paper); border-radius: 14px; border: 2px solid #CFE2C3; }
table { border-collapse: collapse; width: 100%; font-size: 1.05rem; }
th, td { text-align: left; padding: .7rem 1rem; border-bottom: 1px solid #E6EEE1; }
th { background: #F3F8EF; font-weight: 600; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
td.num { font-variant-numeric: tabular-nums; color: var(--muted); }
.empty { padding: 2.5rem 1rem; text-align: center; color: var(--muted); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; align-items: start; }
.group-head {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 1rem 1rem .9rem; border-bottom: 2px solid #CFE2C3; background: #F3F8EF;
}
.group-head h2 { margin: 0; font-size: 1.3rem; color: var(--leaf-dark); }
.group-head p { margin: .15rem 0 0; color: var(--muted); font-size: .95rem; }
.group-count { font-size: 2.5rem; font-weight: 700; line-height: 1; color: var(--leaf); text-align: right; }
.group-count small { display: block; font-size: .85rem; font-weight: 500; color: var(--muted); }
.group th { background: #fff; }
.group.other { margin-top: 1.25rem; }
@media (max-width: 40rem) { .split { grid-template-columns: 1fr; } }
.warn { color: var(--error); }

.login { max-width: 22rem; margin: 15vh auto; }
.login input[type=password] { width: 100%; font-size: 1.2rem; padding: .7rem; border-radius: 10px; border: 2px solid #BFD6B2; }

@media print {
  body { background: #fff; }
  .toolbar, .no-print { display: none !important; }
  .table-wrap { border: 1px solid #999; }
  .split { grid-template-columns: 1fr 1fr !important; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
