/*
 * style.css – Design-System der SGWL-Tool-Familie, übernommen vom
 * Dienstplan (dienstplan.choli41.ch/static/app.css), dort an sgwl.ch
 * angeglichen: pure schwarz/weiss, keine Rundungen, "1px solid black" +
 * Hover-Invert als Button-Muster, Lato überall.
 * Schriften lokal gebundelt (kein Google-Fonts-CDN zur Laufzeit, siehe CLAUDE.md).
 */

@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/lato-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/lato-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url('../fonts/lato-900.woff2') format('woff2');
}

:root {
  --fg: #000;
  --fg-muted: #595959;   /* dunkler als sgwl-#888: WCAG-AA-Kontrast für 13-px-Hinweise */
  --fg-subtle: #929292;
  --border: #eee;
  --border-strong: #000;
  --bg: #fff;
  --bg-soft: #fafafa;
  --danger: #b22222;
  --success: #2f8f3e;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Lato', sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Typografie ---------- */
a {
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 200ms ease;
}
a:hover { color: var(--fg); }

p { margin: 0.6em 0; }

h1, h2, h3 {
  color: var(--fg);
  font-weight: 900;
  margin: 0 0 0.5em 0;
  line-height: 1.15;
}
h1 { font-size: 36px; text-transform: uppercase; letter-spacing: 0.01em; }
h2 { font-size: 28px; text-transform: uppercase; margin-top: 1.4em; margin-bottom: 0.7em; }
h3 { font-size: 18px; text-transform: uppercase; letter-spacing: 0.04em; margin-top: 1.4em; font-weight: 700; }

small, .hint { color: var(--fg-muted); font-size: 13px; }
.hint { display: block; margin: 6px 0; }

code {
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 13px;
  background: #fff;
  border: 1px solid var(--fg);
  padding: 1px 6px;
}

/* ---------- Header ---------- */
.site-header {
  background: #fff;
  border-bottom: 1px solid #000;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  color: var(--fg);
}
.brand:hover { color: var(--fg); }
.brand-logo { height: 72px; width: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong {
  font-size: 22px;
  letter-spacing: 0.02em;
  font-weight: 900;
  text-transform: uppercase;
  color: #000;
}
.brand-text small {
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-top: 4px;
}
.top-nav { display: flex; gap: 36px; align-items: center; }
.top-nav a {
  font-size: 18px;
  font-weight: 400;
  text-transform: uppercase;
  color: #000;
  padding-top: 10px;
  border-top: 2px solid transparent;
  transition: border-top-color 200ms ease;
}
.top-nav a:hover { border-top-color: #000; }

/* ---------- Main ---------- */
.site-main {
  max-width: 1140px;
  margin: 0 auto;
  padding: 40px 24px 80px 24px;
}
.page-head { margin-bottom: 30px; }
.page-head h1 { margin-bottom: 6px; }
.page-head .subtitle { color: var(--fg-muted); font-size: 15px; margin: 0; }

section { margin: 36px 0; }

/* ---------- Dateifelder ---------- */
.drop-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.drop {
  border: 1px dashed #888;
  padding: 18px 20px;
  background: #fff;
  transition: all 200ms ease;
}
.drop:hover, .drop.dragging { border-color: #000; border-style: solid; }
.drop.dragging { background: var(--bg-soft); }
.drop.loaded { border-color: #000; border-style: solid; }
.drop.loaded .drop-status::after {
  content: ' ✓ geladen';
  color: var(--success);
  text-transform: none;
  letter-spacing: 0;
}
.drop label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: #000;
}
.drop input[type="file"] {
  margin-top: 10px;
  width: 100%;
  font-family: 'Lato', sans-serif;
  font-size: 13px;
  border: none;
  padding: 0;
}

/* ---------- Formulare ---------- */
label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: #000;
  margin-top: 12px;
  margin-bottom: 6px;
}
input[type="text"], input[type="number"], input[type="time"], select, textarea {
  font-family: 'Lato', sans-serif;
  font-size: 15px;
  padding: 10px 12px;
  border: 1px solid #000;
  background: #fff;
  color: #000;
  border-radius: 0;
  width: 100%;
  max-width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid #000;
  outline-offset: -1px;
}
input:disabled { background: var(--bg-soft); color: var(--fg-subtle); }
textarea {
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 13px;
  min-height: 80px;
}
input[type="number"], input[type="time"] { width: auto; }

fieldset { border: 1px solid var(--border); margin: 18px 0; padding: 6px 20px 20px; }
legend {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0 8px;
}

.weekdays { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.weekdays label {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  font-size: 11px;
}
.weekdays-ort input { width: 7.5rem; }

/* ---------- Einstellungen (details) ---------- */
details {
  border: 1px solid var(--border);
  padding: 14px 18px;
  margin: 12px 0;
  background: #fff;
}
details[open] { border-color: #000; }
details summary {
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 14px;
  color: #000;
}

/* ---------- Buttons & Downloads ---------- */
button, .button-link {
  font-family: 'Lato', sans-serif;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 10px 22px;
  border: 1px solid #000;
  background: #fff;
  color: #000;
  cursor: pointer;
  border-radius: 0;
  text-decoration: none;
  display: inline-block;
  transition: all 200ms ease;
  line-height: 1.4;
}
button:hover:enabled, .button-link:hover { background: #000; color: #fff; }
button:focus-visible, .button-link:focus-visible { outline: 2px solid #000; outline-offset: 2px; }
button:disabled { color: var(--fg-subtle); border-color: var(--fg-subtle); cursor: not-allowed; }

/* ---------- Nicht zuordenbare Namen (Phase 3) ---------- */
#unmatched-wrap {
  border: 1px solid var(--border);
  border-left: 3px solid var(--danger);
  padding: 16px 18px;
  margin-top: 24px;
}
#unmatched-wrap h3 { margin-top: 0; color: var(--danger); }
.assign-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin: 10px 0;
}
.assign-row .assign-name { font-weight: 700; min-width: 180px; }
.assign-row select { width: auto; max-width: 100%; }

#downloads-wrap { margin-top: 24px; }
#downloads-wrap h3 { margin-top: 0; }
#downloads { display: flex; gap: 12px; flex-wrap: wrap; }
.button-link.done::after { content: ' ✓'; color: var(--success); }

/* ---------- Protokoll ---------- */
#log {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 14px 16px;
  margin-top: 24px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  color: #000;
}
.log-block { margin: 0 0 14px; }
.log-block:last-child { margin-bottom: 0; }
.log-title { font-weight: 700; }
.log-warn { border-left: 3px solid var(--danger); padding-left: 10px; }
.log-warn .log-title { color: var(--danger); }
.log-ok { color: var(--success); font-weight: 700; }
#log details {
  border: none;
  padding: 0;
  margin: 0;
  background: transparent;
}
#log details summary {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid #000;
  padding: 22px 24px;
  margin-top: 50px;
  background: #fff;
}
.footer-inner {
  max-width: 1140px;
  margin: 0 auto;
  font-size: 14px;
  color: #000;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.footer-inner a { color: #000; }
.footer-inner a:hover { color: var(--fg-muted); }

/* ---------- Mobile ---------- */
@media screen and (max-width: 1000px) {
  .header-inner { padding: 14px 18px; }
  .brand-logo { height: 54px; }
  .brand-text strong { font-size: 17px; }
  .brand-text small { font-size: 11px; letter-spacing: 0.08em; }
  .top-nav { gap: 22px; }
  .top-nav a { font-size: 15px; }
}
@media screen and (max-width: 720px) {
  .site-header { position: relative; }
  .header-inner {
    padding: 10px 14px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .brand { gap: 12px; }
  .brand-logo { height: 38px; }
  .brand-text strong { font-size: 14px; }
  .brand-text small { font-size: 10px; }
  .top-nav {
    gap: 14px;
    width: 100%;
    border-top: 1px solid var(--border);
    padding-top: 8px;
    flex-wrap: wrap;
  }
  .top-nav a { font-size: 13px; padding-top: 4px; }

  .site-main { padding: 22px 14px 60px 14px; }
  .page-head { margin-bottom: 22px; }
  h1 { font-size: 24px; }
  h2 { font-size: 20px; margin-top: 1em; }
  section { margin: 26px 0; }

  /* Grössere Tap-Targets (Apple HIG: min 44 px) */
  button, .button-link {
    padding: 11px 18px;
    font-size: 14px;
    min-height: 44px;
  }

  /* 16 px verhindert iOS Safari Auto-Zoom beim Focus */
  input[type="text"], input[type="number"], input[type="time"], select, textarea {
    font-size: 16px;
    padding: 11px 12px;
  }

  #log { font-size: 13px; }
  .drop-hint { display: none; }   /* Drag & Drop auf Touch irrelevant */
}
@media screen and (max-width: 380px) {
  h1 { font-size: 22px; }
  h2 { font-size: 18px; }
  .brand-text small { display: none; }
  .weekdays { display: grid; grid-template-columns: repeat(4, 1fr); }
  .weekdays-ort input { width: 100%; }
}
