/* dlingu — Oberflaeche
   Calm UI: gedeckt, keine Signalfarben als Flaeche, Status als Punkt.
   Ein Akzent (Teal), sonst Graustufen. Dark Mode ueber data-theme. */

:root {
  --ac:      #0F6E56;
  --ac-weich:#E6F1ED;
  --ac-text: #0B5443;

  --bg:      #F2F2EE;
  --flaeche: #FFFFFF;
  --erhoben: #EAEAE4;
  --linie:   #CFCFC5;
  --linie-2: #ADACA1;

  --text:    #1A1A18;
  --text-2:  #4E4D48;
  --text-3:  #6E6D66;

  --ok:      #2F7D5C;
  --warn:    #A8761E;
  --stop:    #A63A32;

  --r:   6px;
  --r-2: 10px;
  --schatten: 0 1px 2px rgba(30,30,25,.06), 0 1px 3px rgba(30,30,25,.05);

  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

[data-theme="dark"] {
  --ac:      #2FA37D;
  --ac-weich:#14322A;
  --ac-text: #6FD3AE;

  --bg:      #15161A;
  --flaeche: #1B1D22;
  --erhoben: #22252B;
  --linie:   #2C3037;
  --linie-2: #3A3F48;

  --text:    #E8E8E5;
  --text-2:  #A2A5A9;
  --text-3:  #74787E;

  --ok:      #4FB483;
  --warn:    #D0A24C;
  --stop:    #D4726A;

  --schatten: 0 1px 2px rgba(0,0,0,.35), 0 1px 3px rgba(0,0,0,.25);
}

* { box-sizing: border-box; }

html { color-scheme: light dark; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ac-text); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--ac);
  outline-offset: 2px;
  border-radius: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------------------------------------------------- Anmeldung */

.anmeldung {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem;
}

.anmeldung-karte {
  width: 100%;
  max-width: 22.5rem;
}

.anmeldung-marke {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin-bottom: 1.75rem;
  color: var(--ac);
}
.anmeldung-marke svg { width: 34px; height: auto; display: block; }
.anmeldung-marke b {
  font-weight: 500;
  font-size: 1.35rem;
  letter-spacing: -.015em;
  color: var(--text);
}

.anmeldung h1 {
  font-size: 1.0625rem;
  font-weight: 500;
  margin: 0 0 .25rem;
}
.anmeldung p.hinweis {
  color: var(--text-2);
  font-size: .875rem;
  margin: 0 0 1.5rem;
}

/* ---------------------------------------------------- Formular */

.feld { margin-bottom: 1rem; }
.feld label {
  display: block;
  font-size: .8125rem;
  color: var(--text-2);
  margin-bottom: .35rem;
}

.feld input {
  width: 100%;
  padding: .6rem .75rem;
  font: inherit;
  color: var(--text);
  background: var(--flaeche);
  border: 1px solid var(--linie-2);
  border-radius: var(--r);
  transition: border-color .12s ease;
}
.feld input:focus {
  border-color: var(--ac);
  outline: none;
  box-shadow: 0 0 0 3px var(--ac-weich);
}

.feld input.code {
  font: 1.35rem/1 var(--mono);
  letter-spacing: .45em;
  text-align: center;
  padding: .8rem .75rem;
}

.knopf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  width: 100%;
  padding: .65rem 1rem;
  font: inherit;
  font-weight: 500;
  color: #fff;
  background: var(--ac);
  border: 1px solid var(--ac);
  border-radius: var(--r);
  cursor: pointer;
  transition: filter .12s ease;
}
.knopf:hover { filter: brightness(1.08); }
.knopf:active { filter: brightness(.94); }

.knopf.leise {
  color: var(--text-2);
  background: transparent;
  border-color: var(--linie-2);
}
.knopf.leise:hover { background: var(--erhoben); filter: none; }

.meldung {
  padding: .6rem .75rem;
  border-radius: var(--r);
  font-size: .875rem;
  margin-bottom: 1rem;
  border: 1px solid var(--linie-2);
  background: var(--erhoben);
  color: var(--text);
}
.meldung.stop  { border-color: var(--stop); color: var(--stop); background: transparent; }

/* ---------------------------------------------------- Mandantenwahl */

.wahl-liste {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--linie);
  border-radius: var(--r-2);
  overflow: hidden;
  background: var(--flaeche);
}
.wahl-liste li + li { border-top: 1px solid var(--linie); }

.wahl-liste a {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .8rem .9rem;
  color: var(--text);
  text-decoration: none;
}
.wahl-liste a:hover { background: var(--erhoben); text-decoration: none; }

.wahl-liste .firma { flex: 1; min-width: 0; }
.wahl-liste .firma b { display: block; font-weight: 500; }
.wahl-liste .firma span {
  display: block;
  font-size: .8125rem;
  color: var(--text-3);
  font-family: var(--mono);
}

.punkt {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex: none;
  background: var(--text-3);
}
.punkt.aktiv  { background: var(--ok); }
.punkt.setup  { background: var(--warn); }
.punkt.sperre { background: var(--stop); }

/* ---------------------------------------------------- Rahmen */

.kopf {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.25rem;
  height: 52px;
  background: var(--flaeche);
  border-bottom: 1px solid var(--linie);
  position: sticky; top: 0; z-index: 10;
}
.kopf .marke { display: flex; align-items: center; gap: .55rem; color: var(--ac); }
.kopf .marke svg { width: 22px; height: auto; display: block; }
.kopf .marke b { font-weight: 500; color: var(--text); letter-spacing: -.01em; }

.kopf .mandant {
  display: flex; align-items: center; gap: .5rem;
  padding: .3rem .6rem;
  font-size: .875rem;
  color: var(--text-2);
  background: var(--erhoben);
  border: 1px solid var(--linie);
  border-radius: var(--r);
}
.kopf .rechts { margin-left: auto; display: flex; align-items: center; gap: .35rem; }

.icon-knopf {
  display: grid; place-items: center;
  width: 32px; height: 32px;
  color: var(--text-2);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r);
  cursor: pointer;
}
.icon-knopf:hover { background: var(--erhoben); border-color: var(--linie); }

.rumpf { max-width: 68rem; margin: 0 auto; padding: 1.75rem 1.25rem 4rem; }

.rumpf h1 {
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -.015em;
  margin: 0 0 .25rem;
}
.rumpf .unter { color: var(--text-2); font-size: .875rem; margin: 0 0 1.75rem; }

.kacheln {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: .875rem;
}
.kachel {
  padding: 1rem;
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--r-2);
  box-shadow: var(--schatten);
}
.kachel h2 {
  font-size: .8125rem;
  font-weight: 500;
  color: var(--text-2);
  margin: 0 0 .5rem;
  text-transform: none;
}
.kachel .zahl {
  font: 500 1.75rem/1 var(--sans);
  letter-spacing: -.02em;
}
.kachel .fuss { font-size: .8125rem; color: var(--text-3); margin-top: .4rem; }

.leer {
  padding: 2.5rem 1.25rem;
  text-align: center;
  color: var(--text-2);
  background: var(--flaeche);
  border: 1px dashed var(--linie-2);
  border-radius: var(--r-2);
}
.leer b { display: block; color: var(--text); font-weight: 500; margin-bottom: .25rem; }

code, .mono { font-family: var(--mono); font-size: .875em; }

@media (max-width: 640px) {
  .kopf { gap: .6rem; padding: 0 .875rem; }
  .kopf .mandant { max-width: 9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .rumpf { padding: 1.25rem .875rem 3rem; }
}


/* ---------------------------------------------------- Navigation */

.kopf { gap: .75rem; }

.nav {
  display: flex;
  align-items: center;
  gap: .125rem;
  margin-left: .5rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }

.nav a {
  position: relative;
  flex: none;
  padding: .4rem .6rem;
  font-size: .875rem;
  color: var(--text-2);
  border-radius: var(--r);
  white-space: nowrap;
  text-decoration: none;
}
.nav a:hover { background: var(--erhoben); color: var(--text); text-decoration: none; }

.nav a[aria-current="page"] { color: var(--text); font-weight: 500; }
.nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: .6rem; right: .6rem; bottom: -12px;
  height: 2px;
  background: var(--ac);
  border-radius: 2px 2px 0 0;
}

.kopf .trenner {
  width: 1px;
  height: 20px;
  background: var(--linie);
  flex: none;
}

.sprachwahl {
  appearance: none;
  padding: .3rem 1.5rem .3rem .5rem;
  font: inherit;
  font-size: .8125rem;
  color: var(--text-2);
  background: transparent
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236E6D66' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    no-repeat right .45rem center;
  border: 1px solid transparent;
  border-radius: var(--r);
  cursor: pointer;
}
.sprachwahl:hover { background-color: var(--erhoben); border-color: var(--linie); }

@media (max-width: 900px) {
  .kopf .marke b { display: none; }
  .kopf .mandant { display: none; }
}
@media (max-width: 640px) {
  .nav { margin-left: 0; }
  .nav a { padding: .4rem .5rem; }
  .sprachwahl { display: none; }
}


/* ---------------------------------------------------- Listen */

.listenkopf {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.listenkopf > div:first-child { flex: 1; min-width: 0; }
.listenkopf h1 { margin-bottom: .15rem; }
.listenkopf .unter { margin-bottom: 0; }

.knopf.schmal { width: auto; padding: .45rem .85rem; font-size: .875rem; flex: none; }

.abschnitt {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -.01em;
  margin: 0 0 .25rem;
}

.suchleiste {
  display: flex;
  gap: .5rem;
  margin-bottom: 1.25rem;
}
.suchleiste input {
  flex: 1;
  min-width: 0;
  padding: .55rem .75rem;
  font: inherit;
  color: var(--text);
  background: var(--flaeche);
  border: 1px solid var(--linie-2);
  border-radius: var(--r);
}
.suchleiste input:focus {
  border-color: var(--ac);
  outline: none;
  box-shadow: 0 0 0 3px var(--ac-weich);
}

table.liste {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--r-2);
  overflow: hidden;
  font-size: .9375rem;
}
table.liste thead th {
  padding: .55rem .75rem;
  font-size: .75rem;
  font-weight: 500;
  color: var(--text-3);
  text-align: left;
  background: var(--erhoben);
  border-bottom: 1px solid var(--linie);
  white-space: nowrap;
}
table.liste td {
  padding: .6rem .75rem;
  border-bottom: 1px solid var(--linie);
  vertical-align: middle;
}
table.liste tbody tr:last-child td { border-bottom: none; }
table.liste tbody tr { cursor: pointer; }
table.liste tbody tr:hover td { background: var(--erhoben); }

table.liste .zahl-sp { text-align: right; }
table.liste.schmal-zeilen td { padding: .4rem .75rem; font-size: .875rem; }
table.liste tbody tr:not([onclick]) { cursor: default; }
table.liste tbody tr:not([onclick]):hover td { background: transparent; }

.neben {
  display: block;
  font-size: .8125rem;
  color: var(--text-3);
  margin-top: .1rem;
}

.marke-klein {
  display: inline-block;
  padding: .1rem .4rem;
  margin-right: .25rem;
  font-size: .75rem;
  color: var(--ac-text);
  background: var(--ac-weich);
  border-radius: 3px;
  white-space: nowrap;
}

.blaettern {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .75rem .25rem;
  font-size: .875rem;
  color: var(--text-3);
}
.blaettern a { margin-left: auto; }
.blaettern a + a { margin-left: .75rem; }

.kette {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 2px solid var(--linie-2);
}
.kette li { padding: .45rem 0 .45rem 1rem; position: relative; }
.kette li::before {
  content: "";
  position: absolute;
  left: -5px; top: .95rem;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ac);
}
.kette .neben { display: inline; margin-left: .5rem; }

/* ---------------------------------------------------- Formulare */

.formular { max-width: 44rem; }

.karte {
  padding: 1.125rem;
  margin-bottom: 1rem;
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--r-2);
}
.karte .feld:last-child { margin-bottom: 0; }

.reihe { display: flex; gap: .75rem; }
.reihe .feld { flex: 1; min-width: 0; }
.reihe .feld.schmal { flex: 0 0 8rem; }

.feld select,
.feld textarea {
  width: 100%;
  padding: .6rem .75rem;
  font: inherit;
  color: var(--text);
  background: var(--flaeche);
  border: 1px solid var(--linie-2);
  border-radius: var(--r);
}
.feld select:focus,
.feld textarea:focus {
  border-color: var(--ac);
  outline: none;
  box-shadow: 0 0 0 3px var(--ac-weich);
}
.feld textarea { resize: vertical; min-height: 4.5rem; }
.feld input[readonly] { background: var(--erhoben); color: var(--text-2); }

.hilfe {
  display: block;
  font-size: .8125rem;
  color: var(--text-3);
  margin-top: .3rem;
}

.schalter {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .3rem 0;
  font-size: .9375rem;
  color: var(--text);
  cursor: pointer;
}
.schalter input { width: 16px; height: 16px; accent-color: var(--ac); margin: 0; }

.mehr { margin-bottom: 1rem; }
.mehr > summary {
  padding: .55rem .75rem;
  font-size: .875rem;
  color: var(--text-2);
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--r-2);
  cursor: pointer;
  list-style: none;
}
.mehr > summary::-webkit-details-marker { display: none; }
.mehr > summary::before { content: "+ "; color: var(--text-3); }
.mehr[open] > summary { border-radius: var(--r-2) var(--r-2) 0 0; border-bottom: none; }
.mehr[open] > summary::before { content: "– "; }
.mehr[open] .karte:first-of-type { border-radius: 0; border-top: none; }

.formularfuss { display: flex; gap: .6rem; }
.formularfuss .knopf { width: auto; padding: .6rem 1.25rem; }

@media (max-width: 640px) {
  .reihe { flex-wrap: wrap; }
  .reihe .feld, .reihe .feld.schmal { flex: 1 1 100%; }
  table.liste { font-size: .875rem; }
  table.liste td, table.liste thead th { padding: .5rem .55rem; }
  .listenkopf { flex-wrap: wrap; }
}
