/* Kalkulator ECM-Blue — CI-Tokens (PR 3)
 * Werte exakt wie deploy/app/lib/theme.py / deploy/pricing/app/theme.py
 * (Corporate Identity OZAS/ECM Blue). Keine externen Schriften/CDNs — Azo Sans
 * liegt lokal unter static/fonts/ (isolierter Container, kein Internetzugriff
 * zur Laufzeit noetig).
 */

:root {
  --ozas-brand: #2E6BBF;   /* Markenblau (Primaerfarbe, aktiv, Hover) */
  --ozas-royal: #1D3FA0;   /* tiefes Koenigsblau (Kopfzeile, Gruppentitel) */
  --ozas-navy:  #16255C;   /* dunkle Blau-Akzente */
  --ozas-green: #8CC63E;   /* CI-Gruen, sparsam (Erfolg) */
  --ozas-surface: #F4F6F9; /* neutrales Hellgrau */
  --ozas-ink: #1A2233;     /* Fliesstext/Ueberschriften */

  /* Excel-Farbsprache der Kalkulator-Zellen bleibt unveraendert (Wiedererkennung
     gegenueber der Vorlage ECM_Blue_HK1_Kalkulator_v0.6.xlsx). */
  --gelb: #FFF2CC;
  --hellblau: #DDEBF7;
  --rot: #C00000;
  --rand: #B7B7B7;
  --rand-hell: #E3E3E3;
  --kopf-bg: var(--ozas-navy);
  --kopf-fg: #FFFFFF;
  --grau-bg: var(--ozas-surface);
  --text: var(--ozas-ink);
  --bg: #FFFFFF;
  --panel-bg: #FFFFFF;
  color-scheme: light;
  /* Runde 2 (5.1): Flaechen, Radien, gedaempfter Text, Status, Kostenbalken */
  --seite-bg: var(--ozas-surface);
  --karte-bg: #FFFFFF;
  --radius: 10px;
  --radius-klein: 6px;
  --text-2: #5A6578;
  --akzent-text: var(--ozas-brand);
  --gefahr-bg: #A3261A;
  --status-ok: #1F6B2A;
  --status-ok-bg: #E3F2E1;
  --status-warn: #7A4F00;
  --status-warn-bg: #FFF2CC;
  --status-fehler: #A3261A;
  --status-fehler-bg: #FBE3DF;
  --status-info: #1D4F91;
  --status-info-bg: #DDEBF7;
  --kost-rohstoff: #16255C;
  --kost-gebinde: #2E6BBF;
  --kost-poe: #5B8FD6;
  --kost-lizenz: #5A962B;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --kopf-bg: #0E1733;
    --grau-bg: #1B2440;
    --text: #E7ECF7;
    --bg: #10182C;
    --panel-bg: #17213C;
    --rand: #37426B;
    --rand-hell: #2A3358;
    color-scheme: dark;
    --seite-bg: var(--bg);
    --karte-bg: var(--panel-bg);
    --text-2: #AEB8CF;
    --akzent-text: #8DB7F4;
    --gefahr-bg: #B3261E;
    --status-ok: #A5E8A8;
    --status-ok-bg: #1C3A20;
    --status-warn: #FFD56B;
    --status-warn-bg: #4A3A00;
    --status-fehler: #FFB4AB;
    --status-fehler-bg: #4D1A14;
    --status-info: #B9D2FF;
    --status-info-bg: #1B2F55;
    --kost-rohstoff: #C7D4F7;
    --kost-gebinde: #6FA3F0;
    --kost-poe: #3E7BD9;
    --kost-lizenz: #8CC63E;
  }
}
:root[data-theme="dark"] {
  --kopf-bg: #0E1733;
  --grau-bg: #1B2440;
  --text: #E7ECF7;
  --bg: #10182C;
  --panel-bg: #17213C;
  --rand: #37426B;
  --rand-hell: #2A3358;
  color-scheme: dark;
  --seite-bg: var(--bg);
  --karte-bg: var(--panel-bg);
  --text-2: #AEB8CF;
  --akzent-text: #8DB7F4;
  --gefahr-bg: #B3261E;
  --status-ok: #A5E8A8;
  --status-ok-bg: #1C3A20;
  --status-warn: #FFD56B;
  --status-warn-bg: #4A3A00;
  --status-fehler: #FFB4AB;
  --status-fehler-bg: #4D1A14;
  --status-info: #B9D2FF;
  --status-info-bg: #1B2F55;
  --kost-rohstoff: #C7D4F7;
  --kost-gebinde: #6FA3F0;
  --kost-poe: #3E7BD9;
  --kost-lizenz: #8CC63E;
}

/* ---- Hausschrift Azo Sans (lokal, kein CDN) ---- */
@font-face {
  font-family: "Azo Sans";
  src: url("fonts/AzoSans-Light.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Azo Sans";
  src: url("fonts/AzoSans-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Azo Sans";
  src: url("fonts/AzoSans-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Azo Sans";
  src: url("fonts/AzoSans-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

body {
  font-family: "Azo Sans", Arial, "Helvetica Neue", Helvetica, sans-serif;
}

/* ---- Kopfzeile der App-Seiten (Logo/Titel/Nutzer/Abmelden) ---- */
.app-kopfzeile {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  background: var(--ozas-royal);
  color: #fff;
  padding: 10px 16px;
}
.app-kopfzeile a { color: #fff; text-decoration: none; }
.app-kopfzeile a:hover, .app-kopfzeile a:focus-visible { text-decoration: underline; }
.app-kopfzeile .marke { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.app-kopfzeile .marke img { height: 28px; width: auto; display: block; }
.app-kopfzeile nav { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 13px; }
.app-kopfzeile .nutzer { color: var(--kopf-fg); }
.app-kopfzeile form { display: inline; }
.app-kopfzeile button.link {
  background: none; border: none; color: #fff; text-decoration: underline;
  cursor: pointer; font: inherit; padding: 0;
}

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--ozas-brand);
  outline-offset: 1px;
}

.knopf, a.knopf-link, button.knopf {
  display: inline-block;
  background: var(--ozas-brand);
  color: #fff;
  border: 1px solid var(--ozas-brand);
  border-radius: 4px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.knopf:hover, a.knopf-link:hover, button.knopf:hover { background: var(--ozas-royal); border-color: var(--ozas-royal); }
.knopf.sekundaer, a.knopf-link.sekundaer, button.knopf.sekundaer {
  background: transparent; color: var(--ozas-brand); border-color: var(--ozas-brand);
}
.knopf.gefahr, button.knopf.gefahr { background: var(--rot); border-color: var(--rot); }

.hinweis-banner {
  background: var(--grau-bg);
  border: 1px solid var(--rand);
  border-left: 4px solid var(--ozas-brand);
  padding: 10px 14px;
  border-radius: 4px;
  margin: 12px 0;
}
.hinweis-banner.gesperrt { border-left-color: var(--rot); }

.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}
.status-badge.entwurf { background: var(--gelb); color: #6B5300; }
.status-badge.freigegeben { background: var(--ozas-green); color: #1A2233; }
.status-badge.archiviert { background: var(--rand-hell); color: #444; }

table.uebersicht { border-collapse: collapse; width: 100%; }
table.uebersicht th, table.uebersicht td {
  border: 1px solid var(--rand); padding: 6px 10px; text-align: left; font-size: 13px;
}
table.uebersicht thead th { background: var(--grau-bg); font-weight: 700; }

.schloss { margin-left: 4px; cursor: help; }
.eingabe.gesperrt, input.eingabe:disabled, select.eingabe:disabled {
  background: var(--rand-hell);
  color: #666;
  cursor: not-allowed;
}

@media (max-width: 400px) {
  .app-kopfzeile { flex-direction: column; align-items: flex-start; }
  table.uebersicht { display: block; overflow-x: auto; }
}

/* ---- Generische Seiten ohne eigenes Layout (Login/Passwort/Formularseiten) ---- */
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
}
body > h1, body > form, body > p, body > .seite {
  max-width: 32rem;
  margin-left: auto;
  margin-right: auto;
  padding-inline: 16px;
}
body > h1 { margin-top: 2rem; }
form label { display: block; margin-top: 1rem; font-weight: 600; }
form input[type="text"], form input[type="password"], form input[type="number"],
form select, form textarea {
  width: 100%;
  padding: 0.5rem;
  margin-top: 0.25rem;
  box-sizing: border-box;
  border: 1px solid var(--rand);
  border-radius: 3px;
  font: inherit;
  color: var(--text);
  background: var(--bg);
}
form button[type="submit"] {
  margin-top: 1.5rem;
  background: var(--ozas-brand);
  color: #fff;
  border: 1px solid var(--ozas-brand);
  border-radius: 4px;
  padding: 8px 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
form button[type="submit"]:hover { background: var(--ozas-royal); }
.fehler { color: var(--rot); margin-top: 1rem; font-weight: 600; }
.erfolg { color: #1A7A1A; margin-top: 1rem; font-weight: 600; }
.hinweis { color: #667; font-size: 0.9rem; }

/* A: workflow navigation and cockpit */
.app-kopfzeile{position:relative;gap:16px}.hauptmenu{margin-left:auto}.hauptmenu>summary{display:none}.app-kopfzeile nav a{padding:9px 12px;border-radius:6px}.app-kopfzeile [aria-current=page]{background:#fff;color:var(--ozas-navy);font-weight:700}.verwaltung{position:relative}.verwaltung>summary{cursor:pointer;padding:9px 12px}.verwaltung-inhalt{position:absolute;right:0;top:100%;z-index:100;background:var(--ozas-navy);padding:16px;min-width:220px;box-shadow:0 8px 24px #0003;border-radius:8px;display:grid;gap:12px}.verwaltung-inhalt a{padding:7px}.cockpit{max-width:1440px!important;margin:32px auto!important;padding:0 24px!important}.page-heading h1{margin:8px 0}.eyebrow{font-size:12px;font-weight:700;letter-spacing:.1em;color:#5d7088}.cockpit-stand{display:flex;align-items:center;justify-content:space-between;gap:20px;margin:28px 0}.cockpit-kpis{display:grid;grid-template-columns:repeat(3,1fr);gap:18px}.cockpit-card{padding:22px;border:1px solid #dce4ed;border-radius:12px;background:#f7faff}.cockpit-card h2{font-size:15px;margin:0 0 16px}.cockpit-card strong{font-size:30px;color:#205ea0}.cockpit-card small{font-size:15px}.cockpit-card p{font-size:13px;color:#566b82;margin:12px 0 0}.cockpit-products{margin-top:30px}.cockpit-actions{display:flex;gap:12px;flex-wrap:wrap;margin:24px 0}.table-scroll{overflow-x:auto}.cockpit-products td{font-variant-numeric:tabular-nums}.cockpit-products td:not(:first-child){text-align:right}@media(max-width:700px){.cockpit-kpis{grid-template-columns:1fr}.cockpit-stand{display:block}.cockpit{padding:0 16px!important}.app-kopfzeile{flex-direction:row;flex-wrap:nowrap;align-items:center}.app-kopfzeile .marke span{display:none}.hauptmenu>summary{display:block;cursor:pointer}.hauptmenu:not([open]) nav{display:none}.hauptmenu nav{position:absolute;left:0;right:0;top:100%;z-index:90;background:var(--ozas-royal);padding:14px;display:grid}.hauptmenu>summary{font-size:14px}.verwaltung>summary{font-size:12px;padding:8px}.app-kopfzeile .marke img{width:70px;height:auto}}

/* B: shared visual system; page CSS controls structure, this sheet the appearance. */
*{box-sizing:border-box}
body{font-size:14px;line-height:1.5;background:var(--bg)}
main,main.vk-page,main.mo-page,main.cockpit{width:100%;max-width:1440px!important;margin:0 auto!important;padding:30px 24px 56px!important}
main h1,main.vk-page h1,main.mo-page h1{font-size:28px;line-height:1.2;letter-spacing:-.02em;margin:0 0 12px}
main h2,main.vk-page h2,main.mo-page h2{font-size:19px;line-height:1.3;margin:0 0 12px}
main h3,main.vk-page h3,main.mo-page h3{font-size:15px;line-height:1.4;margin:0 0 8px}
main p{line-height:1.5}
.cockpit-card,.vk-panel,.mo-panel{border:1px solid var(--rand-hell);border-radius:12px;background:var(--panel-bg);box-shadow:0 3px 15px rgb(22 37 92 / 3%)}
.cockpit-card h2{font-size:15px;margin-bottom:14px}
main table{border-collapse:separate;border-spacing:0;width:100%;font-variant-numeric:tabular-nums;font-size:13px}
main table th,main table td{border:0;border-bottom:1px solid var(--rand-hell);padding:10px 12px;vertical-align:middle}
main table thead th{background:var(--grau-bg);font-weight:600;color:var(--text);white-space:nowrap}
main table tbody tr:hover{background:var(--grau-bg)}
main table th:first-child,main table td:first-child{text-align:left}
main .knopf,main .knopf-link,.vk-dialog .knopf{border-radius:7px;padding:9px 14px;font-family:inherit;font-size:13px;line-height:1.4;min-height:38px;margin-top:0}
.status-badge,.vk-badge{border-radius:20px;font-size:11px;line-height:1.4;padding:4px 9px;text-transform:none;letter-spacing:0}
main input,main select,main textarea{font:inherit;border-radius:6px}
main input.eingabe,main select.eingabe,.vk-input-unit input{background:var(--panel-bg);border:1px solid var(--rand);color:var(--text);padding:7px 9px}
main td.zelle-eingabe{background:transparent}
main input.eingabe.gesperrt,main select.eingabe.gesperrt,main input.eingabe:disabled,main select.eingabe:disabled{background:var(--grau-bg);border-color:transparent;color:var(--text);cursor:default}
main table.ergebnistabelle tr.hk1-einheit td{background:#eaf2fc;color:var(--ozas-navy)}
.ergebnis-kopf{padding:12px 14px;background:var(--grau-bg);color:var(--text)}
.ergebnis-kopf h2{color:var(--text);font-size:16px;margin:0}
nav.tabs{gap:5px;border-bottom:1px solid var(--rand);margin:22px 0 18px;padding-bottom:8px}
nav.tabs button{border:1px solid transparent;border-radius:7px;padding:10px 13px;background:var(--grau-bg)}
nav.tabs button.aktiv{background:var(--ozas-royal);color:#fff}
.hinweis-banner,.vk-message{border-radius:8px;line-height:1.5}
.verwaltung-inhalt form button.link{margin:0;min-height:0;padding:7px;background:transparent;border:0;color:#fff;text-align:left}
@media(max-width:700px){main,main.vk-page,main.mo-page,main.cockpit{padding:22px 16px 40px!important}main h1,main.vk-page h1,main.mo-page h1{font-size:24px}.app-kopfzeile{padding:9px 12px;gap:8px}.cockpit-stand{margin:20px 0}.cockpit-kpis{gap:12px}.cockpit-card{padding:18px}main table th,main table td{padding:9px 10px}.vk-panel{padding:18px}.hauptmenu>summary{padding:7px}}

/* C: align the condensed price-state header with every page. */
header.hk-kopf{max-width:1440px;margin:0 auto;padding:30px 24px 0}header.hk-kopf h1{font-size:28px;line-height:1.2;margin-bottom:14px}header.hk-kopf p{margin:8px 0}header.hk-kopf .knopfleiste{margin:12px 0}.hk-kopf .sperr-hinweis{font-size:12px}.hk-kopf .hk-dezimal{font-size:12px}@media(max-width:700px){header.hk-kopf{padding:22px 16px 0}header.hk-kopf h1{font-size:24px}}

/* C: one lock hint replaces the old per-cell pseudo-icons. */
td.zelle-eingabe.zelle-gesperrt{position:static}

/* F: one-line mobile header and scrollable tables with a stable row label. */
.preisstand-weitere{margin-left:6px}.preisstand-weitere>summary{list-style:none;cursor:pointer}.preisstand-weitere>summary::-webkit-details-marker{display:none}.preisstand-weitere .hinweis-banner{display:flex;align-items:start;gap:10px;flex-wrap:wrap;min-width:230px;margin-bottom:0}.preisstand-weitere form{margin:0}.preisstand-weitere form button{margin:0}.preisstand-weitere summary:focus-visible{outline:3px solid var(--ozas-brand)}
@media(max-width:700px){
 .app-kopfzeile{min-height:54px;flex-direction:row;flex-wrap:nowrap;align-items:center}
 .app-kopfzeile .marke span{display:none}.app-kopfzeile .marke img{width:65px;height:auto}.hauptmenu{margin-left:auto}.verwaltung{flex-shrink:0}
 main{min-width:0}main .table-scroll,main .hk-tab-scroll,main .ue-table-wrap,main .mo-table-scroll{overflow-x:auto;max-width:100%;isolation:isolate}
 main table.uebersicht{display:table;min-width:540px}
 main table th:first-child,main table td:first-child{position:sticky;left:0;z-index:1;background:var(--panel-bg)}
 main table thead th:first-child{z-index:2;background:var(--grau-bg)}
 main table.ergebnistabelle th:first-child,main table.ergebnistabelle td:first-child{min-width:145px;max-width:165px;white-space:normal}
 main .hk-tab-scroll table th:first-child,main .hk-tab-scroll table td:first-child{min-width:135px;max-width:180px}
 main table td[colspan]{position:static}.cockpit-products table.uebersicht{min-width:520px}
 .preisstand-weitere{margin-top:8px;margin-left:0}.mo-offers-scroll{overflow-x:auto}
}

/* Shared table header colors also apply to the fixed market column. */
main .mo-table > thead th,main .mo-offer-table thead th{background:var(--grau-bg);color:var(--text)}
