/* ============================================================
   216media Tool — monochrom, dunkel, Montserrat
   ============================================================ */

:root {
  --ground:    #14181A;
  --surface:   #1B2124;
  --surface-2: #232C30;
  --line:      #2A3438;
  --line-soft: #232B2F;
  --field:     #101416;
  --ink:       #F2F4F5;
  --ink-dim:   #9AA8AE;
  --ink-faint: #6F7D84;

  --ok:    #4FB47D;
  --warn:  #D9A253;
  --bad:   #E2685E;
  --info:  #59B6C2;

  --r-sm: 6px;
  --r:    8px;
  --r-lg: 12px;

  --ease: cubic-bezier(.2, .7, .3, 1);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: Montserrat, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); text-decoration: none; }
a:hover { color: #fff; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

.tnum { font-variant-numeric: tabular-nums; }

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

.auth {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 32px 20px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  animation: rise .5s var(--ease) both;
}

.auth-logo {
  height: 38px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
  display: block;
  margin: 0 auto 40px;
}

.auth-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 30px 28px;
}

.auth-box h1 {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -.01em;
  margin: 0 0 8px;
}

.auth-box p.lead {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-dim);
  margin: 0 0 24px;
}

.auth-foot {
  text-align: center;
  font-size: 12px;
  color: var(--ink-faint);
  margin-top: 24px;
}

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

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-dim);
  margin-bottom: 7px;
}

.field input {
  width: 100%;
  background: var(--field);
  border: 1px solid #37434A;
  border-radius: var(--r);
  padding: 12px 13px;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}

.field input::placeholder { color: #4E5A61; }

.field input:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(242, 244, 245, .1);
}

.field input.code {
  text-align: center;
  font-size: 16px;           /* nicht kleiner — sonst zoomt iOS beim Fokus */
  font-weight: 700;
  letter-spacing: .55em;
  padding: 12px 8px 12px 22px;   /* rechts weniger, gleicht das Letter-Spacing aus */
  font-variant-numeric: tabular-nums;
}

/* Sechs Striche als Platzhalter, damit die Länge sichtbar ist */
.field input.code::placeholder {
  color: var(--ink);
  opacity: .3;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: var(--r);
  padding: 13px 22px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .18s var(--ease), border-color .18s var(--ease), opacity .18s var(--ease);
}

/* Farbe explizit auch im Hover setzen — sonst greift die globale
   a:hover-Regel und färbt den Text auf weißem Grund weiß. */
.btn-primary,
.btn-primary:hover,
.btn-primary:focus-visible { background: var(--ink); color: var(--ground); }
.btn-primary:hover { background: #fff; }

.btn-quiet,
.btn-quiet:hover,
.btn-quiet:focus-visible {
  background: var(--surface-2);
  border-color: #37434A;
  color: var(--ink);
}
.btn-quiet:hover { background: #2B353A; }

.btn-block { width: 100%; }
.btn:disabled { opacity: .45; cursor: default; }

/* ---------- Meldungen ----------------------------------------- */

.msg {
  border-radius: var(--r);
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 18px;
  border: 1px solid;
  animation: rise .35s var(--ease) both;
}

.msg-info { background: rgba(89, 182, 194, .1);  border-color: rgba(89, 182, 194, .35);  color: #7FC9D3; }
.msg-bad  { background: rgba(226, 104, 94, .1);  border-color: rgba(226, 104, 94, .35);  color: var(--bad); }
.msg-ok   { background: rgba(79, 180, 125, .1);  border-color: rgba(79, 180, 125, .35);  color: var(--ok); }

/* ---------- Grundgerüst --------------------------------------- */

.shell { display: flex; min-height: 100%; }

.side {
  width: 232px;
  flex-shrink: 0;
  background: #101416;
  border-right: 1px solid var(--line-soft);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
}

.side-logo {
  height: 30px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  margin: 0 8px 30px;
  display: block;
}

.nav { display: flex; flex-direction: column; gap: 3px; }

.nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: 7px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-dim);
  transition: background .16s var(--ease), color .16s var(--ease);
}
.nav a:hover { background: rgba(242, 244, 245, .05); color: var(--ink); }
.nav a[aria-current="page"] { background: rgba(242, 244, 245, .09); color: var(--ink); font-weight: 600; }

.side-user {
  margin-top: auto;
  border-top: 1px solid var(--line-soft);
  padding-top: 16px;
  display: flex;
  align-items: center;
  gap: 11px;
}

.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #313C42;
  display: grid; place-items: center;
  font-size: 12.5px; font-weight: 700;
  flex-shrink: 0;
}

.main { flex-grow: 1; padding: 30px 34px; min-width: 0; }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.page-head h1 { font-size: 27px; font-weight: 800; letter-spacing: -.022em; margin: 0; }
.page-head .when { font-size: 13px; color: var(--ink-faint); margin-top: 5px; }

.label {
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 600;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 24px 26px;
}

.row { display: flex; gap: 20px; align-items: stretch; }
.row > .grow { flex-grow: 1; min-width: 0; }

/* ---------- Stempeluhr ---------------------------------------- */

.clock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.clock-time {
  font-size: 58px;
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: 1.05;
  margin-top: 10px;
  font-variant-numeric: tabular-nums;
}

.clock-state {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--ink-dim);
}

.dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dot-on    { background: var(--ok); }
.dot-break { background: var(--warn); }
.dot-off   { background: #4A565C; }

.clock-actions { display: flex; flex-direction: column; gap: 10px; min-width: 190px; }

/* ---------- Ampel --------------------------------------------- */

.meter {
  height: 7px;
  border-radius: 4px;
  background: var(--surface-2);
  margin-top: 15px;
  overflow: hidden;
}
.meter > span {
  display: block;
  height: 100%;
  border-radius: 4px;
  transition: width .6s var(--ease);
}
.meter.gruen > span { background: var(--ok); }
.meter.gelb  > span { background: var(--warn); }
.meter.rot   > span { background: var(--bad); }

/* ---------- Tabelle ------------------------------------------- */

.list { display: flex; flex-direction: column; }

.list-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 13px 4px;
  border-top: 1px solid var(--line-soft);
}
.list-row:last-child { border-bottom: 1px solid var(--line-soft); }
.list-row .day  { width: 130px; font-weight: 600; flex-shrink: 0; }
.list-row .span { width: 190px; color: var(--ink-dim); flex-shrink: 0; }
.list-row .pause { width: 130px; color: var(--ink-faint); font-size: 13px; flex-shrink: 0; }
.list-row .sum  { margin-left: auto; font-weight: 700; }

.badge {
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid;
  white-space: nowrap;
}
.badge-warn { background: rgba(217, 162, 83, .16); color: var(--warn); border-color: rgba(217, 162, 83, .42); }
.badge-ok   { background: rgba(79, 180, 125, .17); color: var(--ok);   border-color: rgba(79, 180, 125, .44); }

/* ---------- Bewegung ------------------------------------------ */

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.stagger > * { animation: rise .45s var(--ease) both; }
.stagger > *:nth-child(2) { animation-delay: .05s; }
.stagger > *:nth-child(3) { animation-delay: .1s; }
.stagger > *:nth-child(4) { animation-delay: .15s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ---------- Schmale Fenster ----------------------------------- */

@media (max-width: 820px) {
  .shell { flex-direction: column; }
  .side {
    width: 100%;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    border-right: none;
    border-bottom: 1px solid var(--line-soft);
    overflow-x: auto;
  }
  .side-logo { margin: 0; height: 22px; }
  .nav { flex-direction: row; gap: 4px; }
  .nav a span { display: none; }
  .side-user { margin: 0 0 0 auto; border: none; padding: 0; }
  .main { padding: 22px 18px; }
  .clock-time { font-size: 44px; }
  .clock-actions { width: 100%; }
  .list-row { flex-wrap: wrap; gap: 8px 14px; }
  .list-row .span, .list-row .pause { width: auto; }
}

/* ---------- Dashboard-Bausteine -------------------------------
   Eigene Klassen statt style-Attributen: die CSP erlaubt kein
   inline-CSS (style-src 'self'), sonst lädt die Seite halb nackt.
   -------------------------------------------------------------- */

.panel-side { width: 330px; flex-shrink: 0; }

.amount-row { display: flex; align-items: baseline; gap: 8px; margin-top: 12px; }
.amount     { font-size: 30px; font-weight: 800; letter-spacing: -.025em; }
.amount-of  { font-size: 14px; font-weight: 600; color: var(--ink-faint); }

.meter-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 11px;
  font-size: 12.5px;
}
.meter-foot .left  { color: var(--ink-dim); }
.meter-foot .right { font-weight: 600; }

.rv-note { margin-top: 10px; font-size: 12px; color: var(--ink-faint); }

.split {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 16px;
  display: flex;
  justify-content: space-between;
}
.split .end { text-align: right; }
.split dt { font-size: 11.5px; color: var(--ink-faint); margin: 0; }
.split dd { font-size: 16px; font-weight: 700; margin: 4px 0 0; }

.stack-gap { margin-top: 22px; }
.label-gap { margin-bottom: 18px; }

.list-total { border-bottom: none !important; }
.list-total .day { color: var(--ink-faint); }
.list-total .sum { font-size: 17px; font-weight: 800; }

.empty { color: var(--ink-faint); margin: 0; }

.user-name { font-weight: 700; }
.user-link  { font-size: 12px; color: var(--ink-faint); }
.user-link:hover { color: var(--ink); }

/* ---------- Formularseiten ------------------------------------ */

.form-card { max-width: 720px; }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 20px;
}

.hint {
  font-size: 12px;
  color: var(--ink-faint);
  margin: 7px 0 0;
  line-height: 1.45;
}

.check {
  display: flex !important;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--ink) !important;
  cursor: pointer;
}
.check input { width: auto; accent-color: var(--ink); }

.badge-bad { background: rgba(226,104,94,.16); color: var(--bad); border-color: rgba(226,104,94,.42); }

.list-row .avatar { width: 28px; height: 28px; font-size: 11px; }

@media (max-width: 820px) { .grid-2 { grid-template-columns: 1fr; } }
