@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --navy: #16233F;
  --navy-light: #223357;
  --red: #C82D2D;
  --red-dark: #971F1F;
  --bg: #F1F1EE;
  --card: #ffffff;
  --text: #1B1F27;
  --muted: #666f7d;
  --border: #E1E1DC;
  --green: #1F7A4D;
  --green-light: #E3F3EA;
  --amber: #B45309;
  --amber-light: #FCEFDD;
  --red-light: #FBE7E7;
  --font-display: 'Oswald', 'Arial Narrow', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 0 0 32px 0;
  -webkit-font-smoothing: antialiased;
}

h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 24px;
  letter-spacing: 0.02em;
  margin: 0;
  color: var(--text);
}
h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.02em;
  margin: 0 0 14px 0;
  color: var(--navy);
}
.subtitle { color: var(--muted); font-size: 14px; margin: 4px 0 20px 0; }

/* ---------- Kopfleiste: Marken-Header mit Ziel-Karo-Streifen ---------- */
.site-header {
  background: var(--navy);
  color: white;
  padding: 16px 24px;
  margin-bottom: 0;
}
.site-header .topbar { max-width: 1100px; margin: 0 auto; padding: 0; }
.site-header h1 { color: white; }
.site-header a, .site-header .small-muted { color: #c7d0e0 !important; }
.site-header a:hover { color: white !important; }

.brand { display: flex; align-items: center; gap: 14px; }
.brand .logo-chip {
  background: white;
  padding: 6px 10px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  line-height: 0;
}
.brand img { height: 36px; width: auto; display: block; }
.brand h1 { margin: 0; }
.brand .brand-sub { font-size: 11px; color: #9fb0cc; text-transform: uppercase; letter-spacing: 0.12em; margin-top: 2px; }

.finish-stripe {
  height: 8px;
  background-image:
    linear-gradient(45deg, #111 25%, transparent 25%),
    linear-gradient(-45deg, #111 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #111 75%),
    linear-gradient(-45deg, transparent 75%, #111 75%);
  background-size: 14px 14px;
  background-position: 0 0, 0 7px, 7px -7px, -7px 0px;
  background-color: white;
}

.page-body { padding: 24px; }

.topbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }

.print-header { display: flex; align-items: center; gap: 16px; margin-bottom: 4px; }
.print-header img { height: 46px; width: auto; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 6px; margin: 20px 0; max-width: 900px; margin-left: auto; margin-right: auto; }
.tab-btn {
  background: transparent; border: none; border-bottom: 3px solid transparent;
  padding: 10px 4px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--muted);
  font-family: var(--font-display); letter-spacing: 0.02em; margin-right: 22px;
}
.tab-btn.active { color: var(--navy); border-bottom-color: var(--red); }

.container { max-width: 900px; margin: 0 auto; }
.wide { max-width: 1100px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
}

label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 5px; margin-top: 12px; }
input[type="time"], input[type="text"], input[type="password"], input[type="number"], input[type="date"], select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px;
  font-family: var(--font-body); background: #fafaf9;
}
input:focus, select:focus { outline: none; border-color: var(--navy); background: white; }

button.primary {
  background: var(--red); color: white; border: none; padding: 11px 18px;
  border-radius: 6px; font-weight: 600; cursor: pointer; font-size: 14px; font-family: var(--font-body);
}
button.primary:hover { background: var(--red-dark); }
button.primary:disabled { background: #b8bcc3; cursor: not-allowed; }
button.secondary {
  background: #ECECE8; color: var(--text); border: none; padding: 11px 18px;
  border-radius: 6px; font-weight: 600; cursor: pointer; font-size: 14px; font-family: var(--font-body);
}
button.secondary:hover { background: #dedcd6; }
button.danger {
  background: var(--red-light); color: var(--red-dark); border: none; padding: 11px 18px;
  border-radius: 6px; font-weight: 600; cursor: pointer; font-size: 14px; font-family: var(--font-body);
}
button.danger:hover { background: #f6cccc; }
button.small { padding: 7px 12px; font-size: 12px; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-row { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

/* ---------- Statuskarte ---------- */
.status-card { text-align: center; padding: 28px 20px; }
.status-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 22px; border-radius: 6px; font-weight: 600; font-size: 15px; margin: 10px 0;
  font-family: var(--font-display); letter-spacing: 0.02em;
}
.status-badge::before { content: ''; width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.status-out { background: #EDEDE9; color: var(--muted); }
.status-out::before { background: #9aa0aa; }
.status-in { background: var(--green-light); color: var(--green); }
.status-in::before { background: var(--green); }
.status-break { background: var(--amber-light); color: var(--amber); }
.status-break::before { background: var(--amber); }

.action-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 18px; }
.action-grid button { padding: 18px; font-size: 15px; }

.who-list { font-size: 14px; }
.who-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.who-row:last-child { border-bottom: none; }
.who-row .badge { font-size: 12px; padding: 4px 12px; border-radius: 6px; font-weight: 600; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 2px solid var(--navy); }
tr.corrected { background: #FCF8ED; }
.tag {
  display: inline-block; font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 4px; margin-left: 6px;
  text-transform: uppercase; letter-spacing: 0.03em;
}
.tag-corrected { background: var(--amber-light); color: var(--amber); }
.tag-open { background: var(--red-light); color: var(--red-dark); }

.totals-row td { font-weight: 700; border-top: 2px solid var(--navy); border-bottom: none; font-family: var(--font-display); font-size: 14px; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(22,35,63,0.55);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal-box {
  background: white; border-radius: 8px; padding: 26px; width: 320px; max-width: 90vw;
  border-top: 4px solid var(--red);
}
.modal-box.wide { width: 480px; }
.modal-box h3 { margin: 0 0 12px 0; font-size: 16px; font-family: var(--font-display); color: var(--navy); }
.error-text { color: var(--red-dark); font-size: 13px; margin-top: 8px; min-height: 16px; }

.login-screen { display: flex; align-items: center; justify-content: center; min-height: 80vh; background: var(--bg); }
.login-box {
  background: var(--card); padding: 36px; border-radius: 8px; width: 300px; text-align: center;
  border-top: 4px solid var(--red); box-shadow: 0 4px 24px rgba(22,35,63,0.08);
}

.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border); }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; inset: 0; background: #ccc; border-radius: 24px; transition: 0.2s; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: 0.2s; }
.switch input:checked + .slider { background: var(--red); }
.switch input:checked + .slider:before { transform: translateX(20px); }

.emp-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border); gap: 10px; flex-wrap: wrap; }
.emp-row:last-child { border-bottom: none; }
.emp-row .name { font-weight: 600; }
.emp-row .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.pin-badge { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; padding: 3px 8px; border-radius: 4px; background: var(--green-light); color: var(--green); }
.pin-badge.none { background: #EDEDE9; color: var(--muted); }

.small-muted { font-size: 12px; color: var(--muted); }

.site-footer {
  max-width: 1100px; margin: 32px auto 0 auto; padding: 16px 24px;
  border-top: 1px solid var(--border); text-align: center;
}
.site-footer a { color: var(--muted); font-size: 12px; text-decoration: none; margin: 0 10px; }
.site-footer a:hover { color: var(--navy); text-decoration: underline; }
.login-footer { text-align: center; margin-top: 16px; }
.login-footer a { color: var(--muted); font-size: 12px; text-decoration: none; margin: 0 8px; }
.login-footer a:hover { color: var(--navy); text-decoration: underline; }

/* Druckansicht */
.print-only { display: none; }
@media print {
  body { padding: 0; background: white; }
  .no-print { display: none !important; }
  .print-only { display: block; }
  .card { box-shadow: none; padding: 0; border: none; }
}
