/* Abitur-Zeiterfassung – schlankes, druckfreundliches Stylesheet */
:root {
  --c-bg: #f5f6f8;
  --c-card: #ffffff;
  --c-text: #1d2230;
  --c-muted: #6a7286;
  --c-accent: #0b5394;
  --c-accent-dark: #073a6b;
  --c-ok: #1f7a3a;
  --c-err: #b3261e;
  --c-border: #dde1e8;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, system-ui, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: var(--c-bg); color: var(--c-text); line-height: 1.45;
}
.wrap { max-width: 1180px; margin: 0 auto; padding: 1.2rem 1.5rem; }
.topbar { background: var(--c-accent); color: #fff; }
.topbar .wrap { display: flex; align-items: center; gap: 1.2rem; padding: .9rem 1.5rem; }
.topbar a { color: #fff; text-decoration: none; }
.topbar .brand { font-weight: 600; margin-right: auto; }
.topbar nav { display: flex; gap: 1.1rem; align-items: center; flex-wrap: wrap; }
.topbar nav a:hover { text-decoration: underline; }
.topbar .user { color: #d6e3f3; font-size: .9rem; }

h1 { margin-top: .2rem; }
h2 { margin-top: 2rem; border-bottom: 1px solid var(--c-border); padding-bottom: .3rem; }

.card {
  background: var(--c-card); border: 1px solid var(--c-border);
  border-radius: var(--radius); padding: 1.3rem; margin: 1rem 0;
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
}
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin: 1rem 0; }
.card.action { text-decoration: none; color: inherit; transition: transform .1s; }
.card.action:hover { transform: translateY(-2px); border-color: var(--c-accent); }
.card.action h2 { border: 0; margin: 0 0 .3rem 0; color: var(--c-accent-dark); }

form label { display: block; margin: .6rem 0; font-size: .92rem; color: var(--c-muted); }
form input[type=text], form input[type=email], form input[type=password],
form input[type=number], form input[type=date], form select {
  display: block; width: 100%; padding: .55rem .7rem;
  border: 1px solid var(--c-border); border-radius: 6px; font-size: 1rem;
  background: #fff; color: var(--c-text); margin-top: .25rem;
}
form .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem 1.2rem; }
@media (max-width: 640px) { form .grid2 { grid-template-columns: 1fr; } }
form .check { display: flex; align-items: center; gap: .5rem; color: var(--c-text); }
form .check input { margin: 0; }
button, .btn {
  background: var(--c-accent); color: #fff; border: 0; padding: .6rem 1.2rem;
  border-radius: 6px; font-size: 1rem; cursor: pointer; margin-top: .8rem;
  text-decoration: none; display: inline-block;
}
button:hover, .btn:hover { background: var(--c-accent-dark); }
.link-btn { background: transparent; color: var(--c-accent); padding: 0; margin: 0; }
.link-btn:hover { background: transparent; text-decoration: underline; }
.hint { color: var(--c-muted); font-size: .85rem; }

.ok  { background: #e6f4ec; color: var(--c-ok);  padding: .6rem .9rem; border-radius: 6px; border: 1px solid #c4e3d1; }
.err { background: #fde9e7; color: var(--c-err); padding: .6rem .9rem; border-radius: 6px; border: 1px solid #f3c2bf; }

table.data {
  width: 100%; border-collapse: collapse; background: #fff;
  border: 1px solid var(--c-border); border-radius: var(--radius); overflow: hidden;
  margin: .6rem 0 1.4rem 0; font-size: .93rem;
}
table.data th, table.data td { padding: .55rem .7rem; border-bottom: 1px solid var(--c-border); text-align: left; }
table.data th { background: #eef2f8; font-weight: 600; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tr:last-child td { border-bottom: 0; }

.foot { color: var(--c-muted); margin-top: 2rem; }
.centered { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--c-bg); }
.login { width: 100%; max-width: 380px; }

/* Druckansicht */
@media print {
  .topbar, .foot, form.filter { display: none !important; }
  body { background: #fff; }
  .wrap { max-width: none; padding: 0; }
  table.data { font-size: .8rem; }
  h2 { page-break-after: avoid; }
}
body.print { background: #fff; padding: 1.5rem 2rem; }
body.print .topbar, body.print .foot { display: none; }

/* Balkendiagramm */
.chart-bar {
  display: flex; align-items: flex-end; gap: .6rem;
  padding: 1rem 0; margin: .5rem 0 1.5rem; min-height: 120px;
  border-bottom: 2px solid var(--c-border);
  overflow-x: auto;
}
.bar-col { display: flex; flex-direction: column; align-items: center; min-width: 48px; flex: 1; }
.bar-val { font-size: .78rem; color: var(--c-muted); margin-bottom: .2rem; font-variant-numeric: tabular-nums; }
.bar { width: 32px; background: var(--c-accent); border-radius: 4px 4px 0 0; min-height: 2px; transition: height .3s; }
.bar-label { font-size: .72rem; color: var(--c-muted); margin-top: .35rem; text-align: center; word-break: break-word; }

/* Responsive */
@media (max-width: 800px) {
  .topbar .wrap { flex-direction: column; align-items: flex-start; }
  table.data { display: block; overflow-x: auto; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* Stats-Grid (Dashboard) */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .8rem;
  margin: 1rem 0 1.5rem;
}
.stat-card {
  background: var(--c-card); border: 1px solid var(--c-border); border-radius: var(--radius);
  padding: 1rem 1.2rem; text-align: center;
}
.stat-num { font-size: 1.6rem; font-weight: 700; color: var(--c-accent-dark); font-variant-numeric: tabular-nums; }
.stat-label { font-size: .82rem; color: var(--c-muted); margin-top: .2rem; }

/* Stopwatch */
.stopwatch { display: flex; align-items: center; gap: .8rem; margin: .8rem 0; }
.sw-display { font-size: 1.4rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--c-accent-dark); min-width: 100px; }
.sw-btn { padding: .4rem .9rem; font-size: .9rem; border-radius: 6px; border: 0; cursor: pointer; color: #fff; }
.sw-start { background: var(--c-ok); }
.sw-stop  { background: var(--c-err); }
.sw-reset { background: var(--c-muted); }
.sw-apply { background: var(--c-accent); }

/* Batch-Tabelle – Inputs in Zellen */
#batchTable input[type=text], #batchTable input[type=number] {
  width: 100%; border: 1px solid var(--c-border); border-radius: 4px;
  padding: .35rem .5rem; font-size: .9rem;
}

/* Filter Card */
.filter { display: flex; flex-direction: column; gap: .5rem; }
