/* Capita Holiday Manager
 * Ruhiges, technisches Interface fuer ein internes Betriebs-Tool.
 * Eine Akzentfarbe (Rot) ausschliesslich fuer "Jetzt aktiv" und Primaeraktionen;
 * Unix-Timestamps in Mono als Engineering-Detail unter den lokalen Zeiten.
 */

:root {
  --bg: #f2f4f6;
  --surface: #ffffff;
  --ink: #17202d;
  --muted: #5d6a7a;
  --border: #dfe4ea;
  --accent: #d2232a;       /* Schweizer Rot, sparsam */
  --accent-dark: #a81b21;
  --planned: #1f5fa8;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Code', Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}

.hidden { display: none !important; }

/* ---------- Login ---------- */

.centered {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: 6px;
  padding: 40px 48px;
  text-align: center;
  max-width: 420px;
}

.login-card p { color: var(--muted); margin: 12px 0 24px; }

/* ---------- Brand / Header ---------- */

.brand {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand span { font-weight: 400; color: var(--muted); }

header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-right { display: flex; align-items: center; gap: 10px; }
.user-name { color: var(--muted); margin-right: 8px; }

/* ---------- Layout ---------- */

main {
  max-width: 1240px;
  margin: 24px auto;
  padding: 0 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 20px 24px;
}

.panel h2 { font-size: 15px; margin-bottom: 14px; }

.hint { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.hint code { font-family: var(--mono); background: var(--bg); padding: 1px 5px; border-radius: 3px; }
.label-hint { font-weight: 400; color: var(--muted); }

/* ---------- Formular ---------- */

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 20px;
}

.form-field { display: flex; flex-direction: column; gap: 5px; }
.form-field.span-2 { grid-column: span 2; }

label { font-weight: 600; font-size: 13px; }

input[type="text"],
input[type="datetime-local"],
select,
textarea {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  background: var(--surface);
  color: var(--ink);
}

input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible {
  outline: 2px solid var(--planned);
  outline-offset: 1px;
}

textarea { font-family: var(--mono); font-size: 13px; resize: vertical; width: 100%; }

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 4px 16px;
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px 12px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
  font-family: var(--mono);
  font-size: 13px;
  cursor: pointer;
}

.checkbox-tools { display: flex; gap: 8px; margin-top: 6px; }

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.status-text { color: var(--muted); font-size: 13px; }
.status-text.error { color: var(--accent-dark); font-weight: 600; }

/* ---------- Buttons ---------- */

.btn {
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  padding: 8px 16px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
}

.btn:hover { background: var(--bg); }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

.btn-primary:hover { background: var(--accent-dark); }

.btn-ghost { border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--ink); }

.btn-mini { padding: 3px 10px; font-size: 12.5px; }

.btn-danger { color: var(--accent-dark); }
.btn-danger:hover { background: #fbeaea; }

/* ---------- Tabelle ---------- */

.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.table-header h2 { margin: 0; }

table { width: 100%; border-collapse: collapse; }

th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  border-bottom: 2px solid var(--border);
  padding: 8px 10px;
}

td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

tr:last-child td { border-bottom: none; }

.row-past { color: var(--muted); }

.cell-project { font-family: var(--mono); font-size: 13px; white-space: nowrap; }
.cell-note { max-width: 320px; }
.cell-actions { white-space: nowrap; text-align: right; }

.unix {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

.empty { text-align: center; color: var(--muted); padding: 24px; }

/* ---------- Status Badges ---------- */

.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  border-radius: 3px;
  padding: 2px 8px;
  white-space: nowrap;
}

.badge-aktiv { color: var(--accent-dark); background: #fbeaea; }
.badge-geplant { color: var(--planned); background: #e8f0fa; }
.badge-vorbei { color: var(--muted); background: var(--bg); }

/* ---------- Responsive ---------- */

@media (max-width: 760px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-field.span-2 { grid-column: span 1; }
  main { padding: 0 14px; }
  header { padding: 12px 14px; }
  .cell-note { max-width: 160px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
