/* Anrufsteuerung – MV EDV
   Layout: dunkle Seitenleiste (Marke + Navigation), heller Arbeitsbereich mit Karten.
   Markenfarben zentral hier anpassen (--brand*, --accent*). */
:root {
  --brand: #0c2340;          /* MV EDV Dunkelblau – Seitenleiste */
  --brand-2: #133257;
  --brand-line: #1f416b;
  --brand-text: #c9d6e8;
  --accent: #1769e0;         /* Aktionsfarbe */
  --accent-hover: #0f57c2;
  --accent-soft: #e8f0fd;
  --mark: #f5b700;           /* Akzent in der Wortmarke */

  --bg: #f2f5f9;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --text: #0f1b2d;
  --muted: #5b6b82;
  --line: #e1e7ef;
  --line-strong: #cbd5e1;

  --ok: #0f7b3f;    --ok-soft: #e3f5ea;
  --warn: #9a5b00;  --warn-soft: #fff2d6;
  --stop: #b42318;  --stop-soft: #fdeceb;
  --info: #5b3ec8;  --info-soft: #efeafe;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(15, 27, 45, .05), 0 4px 16px rgba(15, 27, 45, .06);
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 15px/1.5 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; margin: 0; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Marke ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; }
.logo-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: linear-gradient(145deg, #1d4f8f, #0a1d36);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); font: 800 16px/1 var(--font-display); letter-spacing: -.02em; color: #fff; position: relative; }
.logo-mark::after { content: ""; position: absolute; right: 7px; bottom: 7px; width: 6px; height: 6px; border-radius: 2px; background: var(--mark); }
.logo-text { display: grid; line-height: 1.1; }
.logo-text b { font: 700 17px/1.1 var(--font-display); letter-spacing: .02em; }
.logo-text small { font-size: 11.5px; color: var(--brand-text); letter-spacing: .04em; }
.logo img { max-height: 42px; max-width: 170px; }

/* ---------- App-Rahmen ---------- */
.app { display: grid; grid-template-columns: 260px 1fr; min-height: 100%; }
.sidebar { background: var(--brand); color: var(--brand-text); display: flex; flex-direction: column; padding: 22px 16px; position: sticky; top: 0; height: 100vh; }
.sidebar .logo { padding: 0 6px 22px; border-bottom: 1px solid var(--brand-line); margin-bottom: 18px; }
.customer { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--brand-2); margin-bottom: 18px; }
.customer small { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #8ea3bf; }
.customer strong { color: #fff; font-weight: 600; }
.nav { display: grid; gap: 3px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: var(--radius-sm); color: var(--brand-text); text-decoration: none; font-size: 14.5px; }
.nav a:hover { background: var(--brand-2); color: #fff; }
.nav a.active { background: var(--accent); color: #fff; }
.nav a .dot { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--mark); }
.sidebar-foot { margin-top: auto; padding: 16px 8px 0; border-top: 1px solid var(--brand-line); font-size: 12px; color: #8ea3bf; display: grid; gap: 10px; }
.sidebar-foot button { width: 100%; justify-content: center; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 32px 6px; flex-wrap: wrap; }
.topbar h1 { font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.topbar p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.content { padding: 18px 32px 40px; display: grid; gap: 20px; max-width: 1180px; width: 100%; }
.footer { margin-top: auto; padding: 16px 32px 24px; color: var(--muted); font-size: 12.5px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.footer b { color: var(--text); }

/* ---------- Karten ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head h2 { font-size: 17px; font-weight: 650; }
.card-head p { margin: 3px 0 0; color: var(--muted); font-size: 14px; max-width: 70ch; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* ---------- Status ---------- */
.hero { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; padding: 26px; border-radius: var(--radius); color: #fff; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 240px; height: 240px; border-radius: 50%; background: rgba(255,255,255,.07); }
.hero.s-offen { background: linear-gradient(135deg, #0f7b3f, #0b5e30); }
.hero.s-pause, .hero.s-sonder { background: linear-gradient(135deg, #b86e00, #8a5200); }
.hero.s-geschlossen, .hero.s-feiertag, .hero.s-urlaub { background: linear-gradient(135deg, #1b3a63, #0c2340); }
.hero-icon { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: rgba(255,255,255,.14); }
.hero-icon svg.i { width: 32px; height: 32px; }
.hero small { text-transform: uppercase; letter-spacing: .1em; font-size: 11.5px; opacity: .8; }
.hero h2 { font-size: 28px; font-weight: 700; margin: 2px 0 6px; }
.hero .flow { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,.14); padding: 6px 12px; border-radius: 999px; font-size: 14px; }
.hero .why { margin-top: 8px; font-size: 13.5px; opacity: .85; }
.hero.override { box-shadow: 0 0 0 3px var(--mark) inset; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.p-offen { background: var(--ok-soft); color: var(--ok); }
.p-pause, .p-sonder { background: var(--warn-soft); color: var(--warn); }
.p-geschlossen, .p-feiertag, .p-urlaub { background: var(--stop-soft); color: var(--stop); }
.flowtag { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); }
.flowtag svg.i { width: 15px; height: 15px; }

/* ---------- Formulare ---------- */
label, .label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.field { display: grid; min-width: 0; }
input, select, button, textarea { font: inherit; }
input[type=text], input[type=tel], input[type=url], input[type=number], input[type=password], input[type=date], input[type=datetime-local], input[type=time], select {
  height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); width: 100%; min-width: 0; }
input[type=time] { width: auto; padding: 0 8px; }
select { appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235b6b82' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form-row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); align-items: end; margin-bottom: 14px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.check { display: flex; gap: 10px; align-items: center; font-size: 14.5px; color: var(--text); font-weight: 500; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

.btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border: 0; border-radius: var(--radius-sm);
  background: var(--accent); color: #fff; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s; }
.btn:hover { background: var(--accent-hover); }
.btn:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 1px; }
.btn.ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--line); }
.btn.danger { background: var(--stop); }
.btn.danger:hover { background: #8f1c13; }
.btn.warn { background: var(--mark); color: #1d1300; }
.btn.small { height: 32px; padding: 0 12px; font-size: 13.5px; }
.btn.icon { width: 34px; height: 34px; padding: 0; justify-content: center; background: transparent; color: var(--muted); }
.btn.icon:hover { background: var(--stop-soft); color: var(--stop); }
.sidebar .btn.ghost { background: transparent; color: var(--brand-text); border-color: var(--brand-line); }
.sidebar .btn.ghost:hover { background: var(--brand-2); color: #fff; }

/* Regel-Editor */
.rule { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: end; }
.rule .num[hidden] { display: none; }
.sub { border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); padding: 14px; background: var(--surface-2); margin: 4px 0 16px; }
.sub > .label { margin-bottom: 10px; }
.situations { display: grid; gap: 10px; }
.situation { display: grid; grid-template-columns: 220px 1fr; gap: 16px; align-items: center; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.situation .title { display: grid; gap: 4px; }
.situation .title strong { font-weight: 650; }
.situation .title span { font-size: 12.5px; color: var(--muted); }

/* Zeiten */
.week { display: grid; gap: 8px; }
.day { display: grid; grid-template-columns: 130px 1fr auto; gap: 14px; align-items: center; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.day strong { font-weight: 600; }
.wins { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.win { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.day .state { font-size: 12.5px; color: var(--muted); }

/* Tabellen / Listen */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
tr:last-child td { border-bottom: 0; }
tr.past td { color: #9aa7b8; }
tr.past .pill { opacity: .55; }
.list { display: grid; }
.list-item { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.date-chip { display: grid; place-items: center; width: 52px; height: 54px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); line-height: 1.05; }
.date-chip b { font-size: 19px; font-family: var(--font-display); }
.date-chip small { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.list-item .meta { font-size: 13px; color: var(--muted); }
.empty { padding: 26px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); }
.holidays { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }

/* Hinweise */
.toast { position: fixed; top: 18px; right: 18px; z-index: 50; max-width: min(420px, calc(100vw - 36px)); padding: 13px 16px; border-radius: 12px;
  box-shadow: 0 10px 30px rgba(15,27,45,.18); display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; animation: toast-in .25s ease-out; }
.toast.ok { background: #0f3d26; color: #e3f5ea; } .toast.err { background: #5c130d; color: #fdeceb; } .toast.warn { background: #4a3000; color: #fff2d6; }
@keyframes toast-in { from { transform: translateY(-8px); opacity: 0; } }
.note { padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.note.warn { background: var(--warn-soft); color: var(--warn); }
.note.info { background: var(--accent-soft); color: #0f3f8a; }
code, .mono { font-family: var(--mono); font-size: 13px; background: var(--surface-2); border: 1px solid var(--line); padding: 2px 6px; border-radius: 6px; word-break: break-all; }
details > summary { cursor: pointer; font-weight: 600; color: var(--accent); list-style: none; display: flex; align-items: center; gap: 8px; }
details > summary::-webkit-details-marker { display: none; }
details[open] > summary { margin-bottom: 12px; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--muted); font-size: 14px; }
.steps b { color: var(--text); }

/* ---------- Anmeldung ---------- */
.auth { min-height: 100%; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-brand { background: radial-gradient(circle at 20% 20%, #1d4f8f 0, transparent 55%), var(--brand); color: var(--brand-text); padding: 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 30px; }
.auth-brand h1 { color: #fff; font-size: clamp(28px, 3.4vw, 40px); line-height: 1.15; letter-spacing: -.02em; max-width: 16ch; }
.auth-brand p { max-width: 44ch; margin: 14px 0 0; }
.auth-brand ul { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 10px; }
.auth-brand li { display: flex; gap: 10px; align-items: center; }
.auth-brand li svg.i { color: var(--mark); }
.auth-form { display: grid; place-items: center; padding: 40px 16px; }
.auth-card { width: 100%; max-width: 380px; display: grid; gap: 16px; }
.auth-card h2 { font-size: 24px; }
.auth-card p { margin: 0; color: var(--muted); }
.auth-card .btn { width: 100%; justify-content: center; height: 44px; }

/* ---------- Mobil ---------- */
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar, .nav { min-width: 0; }
  .sidebar { position: sticky; height: auto; padding: 12px 16px; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; z-index: 20; }
  .sidebar .logo { border: 0; margin: 0; padding: 0; }
  .customer, .sidebar-foot .by { display: none; }
  .nav { order: 3; width: 100%; display: flex; overflow-x: auto; gap: 4px; }
  .nav a { white-space: nowrap; padding: 7px 10px; }
  .sidebar-foot { margin: 0 0 0 auto; padding: 0; border: 0; }
  .sidebar-foot button { width: auto; }
  .topbar, .content, .footer { padding-left: 16px; padding-right: 16px; }
  .situation, .day { grid-template-columns: 1fr; gap: 10px; }
  .auth { grid-template-columns: 1fr; }
  .auth-brand { padding: 28px 20px; }
  .auth-brand ul { display: none; }
  .hero { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
