/* BKNL-JA — Kommunaler Layer
   CI: Marine + Sky als Basis (Amt), Sunshine sparsam als Akzent.
   Distinkt zu bknl-orga: klarer, formeller Ton. Nunito lokal. */

@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
  src: url('/static/fonts/nunito-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
                  U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
                  U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
  src: url('/static/fonts/nunito-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
                  U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF,
                  U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
                  U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --marine-50:  #e8f1f8;
  --marine-100: #c2dbeb;
  --marine-500: #2a5a87;
  --marine-600: #1a4570;
  --marine-700: #003459;
  --sky-50:  #eef5fb;
  --sky-100: #d4e8f4;
  --sky-500: #4aa0d5;
  --sky-600: #3690cc;
  --sky-700: #2a7eb8;
  --sunshine-500: #fcd34d;
  --leaf-500: #86c77b;
  --leaf-600: #71b365;
  --ember-500: #e4572e;
  --ember-700: #b8421f;
  --bk-50:  #f7faff;
  --bk-100: #e8f1f8;
  --bk-200: #cbd5e1;
  --bk-500: #5a6470;
  --bk-700: #334155;
  --bk-900: #1a1a1a;
  --white:  #ffffff;
}

* { box-sizing: border-box; }
html, body { overflow-x: hidden; }
body {
  margin: 0; font-family: 'Nunito', system-ui, sans-serif;
  color: var(--bk-900); background: var(--bk-50);
  font-size: 15px; line-height: 1.5;
}
a { color: var(--sky-700); text-decoration: none; }
a:hover { color: var(--marine-700); text-decoration: underline; }
h1, h2, h3 { color: var(--marine-700); font-weight: 700; margin: 0 0 8px 0; }
h1 { font-size: 1.75rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.1rem; }
p { margin: 0 0 10px 0; }
.muted { color: var(--bk-500); font-size: 0.92rem; }
.lead { font-size: 1.05rem; color: var(--bk-700); }

/* Header */
.site-header {
  background: var(--marine-700); color: var(--white);
  padding: 10px 0; border-bottom: 3px solid var(--sky-500);
}
.site-header .inner {
  max-width: 1200px; margin: 0 auto; padding: 0 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.site-header .brand {
  display: flex; align-items: center; gap: 10px; color: var(--white);
  text-decoration: none;
}
.site-header .logo {
  width: 42px; height: 42px; border-radius: 8px;
  background: var(--sky-700); color: var(--sunshine-500);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.15rem;
}
.brand-name { font-weight: 700; font-size: 1rem; line-height: 1.15; }
.brand-sub  { font-size: 0.72rem; opacity: 0.75; letter-spacing: 0.05em;
              text-transform: uppercase; margin-top: 1px; }
.site-header nav { display: flex; align-items: center; gap: 18px; }
.site-header nav a { color: var(--white); font-size: 0.9rem; }
.site-header nav a:hover { color: var(--sunshine-500); text-decoration: none; }
.user { font-size: 0.85rem; opacity: 0.85; }
.role { opacity: 0.65; text-transform: uppercase; letter-spacing: 0.04em;
        font-size: 0.72rem; }

main { max-width: 1200px; margin: 0 auto; padding: 24px 16px 60px; }
.section { margin-bottom: 32px; }

/* Cards */
.cards {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-top: 16px;
}
.card {
  background: var(--white); border: 1px solid var(--bk-200);
  border-radius: 10px; padding: 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.card h3 { margin-bottom: 6px; }

/* Buttons */
.btn-primary, .btn-ghost {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 16px; border-radius: 8px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  font-size: 0.9rem; font-family: inherit;
}
.btn-primary { background: var(--sky-700); color: var(--white); }
.btn-primary:hover { background: var(--marine-700); text-decoration: none; }
.btn-ghost {
  background: transparent; color: var(--sunshine-500);
  border-color: rgba(255,255,255,0.4);
}
.btn-ghost:hover { background: rgba(255,255,255,0.1); color: var(--white);
                    text-decoration: none; }

/* Login */
.login-wrap {
  min-height: 70vh; display: flex; align-items: center; justify-content: center;
}
.login-card {
  background: var(--white); border-radius: 12px;
  padding: 28px; width: 100%; max-width: 380px;
  border: 1px solid var(--bk-200);
  box-shadow: 0 6px 16px rgba(0, 52, 89, 0.08);
}
.login-brand {
  display: flex; align-items: center; gap: 10px; margin-bottom: 20px;
}
.login-brand .logo {
  width: 42px; height: 42px; border-radius: 8px;
  background: var(--marine-700); color: var(--sunshine-500);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.15rem;
}
.login-brand .brand-name { color: var(--marine-700); }
.login-brand .brand-sub  { color: var(--bk-500); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack label { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; }
.stack input {
  padding: 9px 10px; border: 1px solid var(--bk-200); border-radius: 6px;
  font-family: inherit; font-size: 0.95rem;
}
.stack input:focus { outline: 2px solid var(--sky-500); border-color: var(--sky-500); }

.alert-error {
  background: #fdebe1; color: var(--ember-700);
  padding: 9px 12px; border-radius: 6px; margin-bottom: 12px;
  font-size: 0.9rem;
}

/* Layout */
.row-between { display: flex; align-items: center; justify-content: space-between;
                gap: 12px; flex-wrap: wrap; }
.row { display: flex; gap: 10px; align-items: center; margin-top: 6px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.narrow { max-width: 720px; }
.form-narrow { max-width: 460px; }
.form-wide { max-width: 720px; }
.small { font-size: 0.82rem; }
.mono { font-family: SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85rem; }
.center { text-align: center; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.span-2 { grid-column: span 2; }

.card-link { text-decoration: none; color: inherit; display: block; transition: transform 100ms, box-shadow 100ms; }
.card-link:hover { transform: translateY(-1px); box-shadow: 0 4px 8px rgba(0,52,89,0.08); text-decoration: none; }

.kv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 20px; margin: 12px 0; }
.kv-grid > div { display: flex; flex-direction: column; gap: 2px; }
.kv-grid .k { font-size: 0.72rem; color: var(--bk-500); text-transform: uppercase; letter-spacing: 0.05em; }

.info-box { background: var(--sky-50); border-left: 4px solid var(--sky-500); padding: 10px 14px; border-radius: 6px; margin: 12px 0; }
.info-box.art9 { background: #fdebe1; border-left-color: var(--ember-500); }

.data-table { width: 100%; border-collapse: collapse; margin-top: 12px; background: var(--white); border: 1px solid var(--bk-200); border-radius: 6px; overflow: hidden; }
.data-table th, .data-table td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--bk-200); font-size: 0.88rem; }
.data-table th { background: var(--marine-50); color: var(--marine-700); font-weight: 700; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
.data-table tr:last-child td { border-bottom: none; }
.data-table a { color: var(--marine-700); font-weight: 600; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 0.72rem; font-weight: 700; background: var(--bk-100); color: var(--bk-700); text-transform: uppercase; letter-spacing: 0.03em; }
.badge.big { padding: 5px 12px; font-size: 0.85rem; }
.badge-ok { background: #dff0dd; color: var(--leaf-600); }
.badge-off { background: #fdebe1; color: var(--ember-700); }
.badge-offen { background: #d4e8f4; color: var(--sky-700); }
.badge-angeboten { background: #fef3d6; color: #6b4f00; }
.badge-angenommen { background: #dff0dd; color: var(--leaf-600); }
.badge-abgelehnt { background: #fdebe1; color: var(--ember-700); }
.badge-zurueckgezogen, .badge-verfallen { background: var(--bk-100); color: var(--bk-500); }
.badge-pausiert { background: #e8f1f8; color: var(--marine-500); }
.badge-art9 { background: #fdebe1; color: var(--ember-700); }

.filter-bar { display: flex; gap: 6px; margin: 12px 0; flex-wrap: wrap; }
.pill { padding: 4px 10px; border-radius: 999px; font-size: 0.82rem; background: var(--bk-100); color: var(--bk-700); text-decoration: none; }
.pill.active { background: var(--marine-700); color: var(--white); }
.pill:hover { text-decoration: none; }

.site-header.familie { background: var(--sky-700); border-bottom-color: var(--sunshine-500); }
.site-header.familie .logo { background: var(--marine-700); color: var(--sunshine-500); }

fieldset { border: 1px solid var(--bk-200); border-radius: 6px; padding: 14px 16px; margin: 0; }
legend { font-weight: 700; color: var(--marine-700); font-size: 0.92rem; padding: 0 6px; }
.checkbox-list { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.checkbox { display: flex; align-items: flex-start; gap: 8px; font-size: 0.9rem; }
.checkbox input { margin-top: 4px; }

/* Footer */
.site-footer {
  text-align: center; padding: 16px; color: var(--bk-500);
  font-size: 0.8rem; border-top: 1px solid var(--bk-200);
  background: var(--white);
}
