/* Green Crew Zeiterfassung — bewusst schlicht.
   Ein Werkzeug, das täglich zwei Minuten benutzt wird, muss vor allem
   schnell lesbar und schnell bedienbar sein. */

:root {
  --gruen:      #97d700;
  --gruen-tief: #002413;
  --tinte:      #1f1f1f;
  --grau:       #666;
  --linie:      #e3e5e2;
  --flaeche:    #f6f7f5;
  --weiss:      #fff;
  --warn:       #d67a00;
  --fehler:     #c0392b;
  --ok:         #2f7d32;
  --radius:     7px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--tinte);
  background: var(--flaeche);
}

.wrap { max-width: 1140px; margin: 0 auto; padding: 0 1.25rem; }

/* ---------------------------------------------------------------- Kopfzeile */

.top { background: var(--gruen-tief); color: #fff; }
.top .wrap { display: flex; align-items: center; gap: 1.75rem; min-height: 58px; flex-wrap: wrap; }

.brand { display: flex; align-items: center; gap: .55rem; color: #fff; text-decoration: none; font-weight: 650; }
.brand .mark { width: 13px; height: 13px; border-radius: 3px; background: var(--gruen); display: inline-block; }

.top nav { display: flex; gap: .25rem; margin-right: auto; flex-wrap: wrap; }
.top nav a {
  color: rgba(255,255,255,.82); text-decoration: none;
  padding: .35rem .7rem; border-radius: var(--radius); font-size: .93rem;
}
.top nav a:hover { background: rgba(255,255,255,.1); color: #fff; }
.top nav a.on { background: var(--gruen); color: var(--gruen-tief); font-weight: 600; }

.top .me { display: flex; align-items: center; gap: .9rem; font-size: .88rem; color: rgba(255,255,255,.75); }
.top .me a { color: rgba(255,255,255,.9); text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.3); }
.top .me a:hover { color: #fff; border-color: #fff; }

main.wrap { padding-top: 1.6rem; padding-bottom: 3rem; }

.foot {
  display: flex; gap: 1.25rem; align-items: center;
  padding-top: 1rem; padding-bottom: 2rem;
  font-size: .82rem; color: var(--grau); border-top: 1px solid var(--linie);
}
.foot a { color: var(--grau); }

/* ------------------------------------------------------------------ Typografie */

h1 { font-size: 1.4rem; margin: 0 0 .2rem; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; margin: 2rem 0 .7rem; }
h3 { font-size: .95rem; margin: 1.4rem 0 .5rem; }
.lead { color: var(--grau); margin: 0 0 1.4rem; font-size: .93rem; }
.muted { color: var(--grau); }
.small { font-size: .84rem; }
a { color: #1c6b2e; }

/* ---------------------------------------------------------------------- Karten */

.card {
  background: var(--weiss); border: 1px solid var(--linie);
  border-radius: var(--radius); padding: 1.1rem 1.25rem; margin-bottom: 1.1rem;
}
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
/* Breite Tabellen auf schmalen Fenstern seitlich scrollen lassen,
   statt das Layout zu sprengen. */
.card { overflow-x: auto; }
.card > table { min-width: max-content; }
@media (min-width: 900px) { .card > table { min-width: 100%; } }

.grid { display: grid; gap: 1rem; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.four { grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); }

.kpi { background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--radius); padding: .85rem 1rem; }
.kpi .label { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--grau); }
.kpi .value { font-size: 1.5rem; font-weight: 650; font-variant-numeric: tabular-nums; margin-top: .15rem; }
.kpi .note { font-size: .8rem; color: var(--grau); }
.kpi.plus .value { color: var(--ok); }
.kpi.minus .value { color: var(--fehler); }

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

.flash { padding: .7rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: .92rem; border: 1px solid; }
.flash.ok    { background: #eef7ee; border-color: #cbe3cb; color: #245c27; }
.flash.error { background: #fdefed; border-color: #f2cdc7; color: #96261a; }
.flash.warn  { background: #fdf5e8; border-color: #f0ddb8; color: #8a5000; }
.flash.info  { background: #eef3f8; border-color: #cfdcea; color: #274b6d; }

.hint { font-size: .85rem; padding: .45rem .7rem; border-radius: 5px; margin: .3rem 0; }
.hint.error { background: #fdefed; color: #96261a; }
.hint.info  { background: #f1f4f7; color: #3a5169; }

/* ---------------------------------------------------------------------- Tabellen */

table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--linie); vertical-align: middle; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--grau); font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tbody tr:hover { background: #fafbfa; }
tr.weekend td { background: #fafaf8; }
tr.weekend:hover td { background: #f5f6f3; }
tr.today td { box-shadow: inset 3px 0 0 var(--gruen); }
tr.cancelled td { color: #999; text-decoration: line-through; }
tfoot td { font-weight: 650; border-top: 2px solid var(--tinte); border-bottom: none; }

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

label { display: block; font-size: .82rem; color: var(--grau); margin-bottom: .2rem; }

input[type=text], input[type=email], input[type=password], input[type=date],
input[type=number], select, textarea {
  font: inherit; color: inherit;
  padding: .42rem .55rem; border: 1px solid #cfd3ce; border-radius: 5px;
  background: #fff; width: 100%; max-width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--gruen); outline-offset: -1px; border-color: var(--gruen);
}
input[readonly] { background: var(--flaeche); color: var(--grau); }

.field { margin-bottom: .9rem; }
.row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1 1 auto; }

.btn {
  display: inline-block; font: inherit; font-weight: 600; font-size: .89rem;
  padding: .45rem .95rem; border-radius: 5px; border: 1px solid transparent;
  background: var(--gruen-tief); color: #fff; cursor: pointer; text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: #003a1e; }
.btn.primary { background: var(--gruen); color: var(--gruen-tief); }
.btn.primary:hover { background: #a8e60d; }
.btn.ghost { background: #fff; color: var(--tinte); border-color: #cfd3ce; }
.btn.ghost:hover { background: var(--flaeche); }
.btn.danger { background: #fff; color: var(--fehler); border-color: #e3bdb8; }
.btn.danger:hover { background: #fdefed; }
.btn.small { padding: .25rem .55rem; font-size: .8rem; }

.linkbtn { background: none; border: 0; padding: 0; font: inherit; font-size: .82rem;
           color: var(--grau); cursor: pointer; text-decoration: underline; }
.linkbtn:hover { color: var(--fehler); }

/* ------------------------------------------------------------- Wochenerfassung */

.weeknav { display: flex; align-items: center; gap: .8rem; margin-bottom: 1.1rem; flex-wrap: wrap; }
.weeknav .title { font-weight: 650; font-size: 1.05rem; }

.day { background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--radius); margin-bottom: .7rem; overflow: hidden; }
.day.is-today { border-color: var(--gruen); box-shadow: 0 0 0 1px var(--gruen); }
.day.is-off { background: #fbfbf9; }

.day > .head {
  display: flex; align-items: baseline; gap: .7rem; flex-wrap: wrap;
  padding: .55rem .9rem; border-bottom: 1px solid var(--linie); background: #fcfdfc;
}
.day > .head .d { font-weight: 650; min-width: 5.5rem; }
.day > .head .tag { font-size: .78rem; padding: .1rem .45rem; border-radius: 3px; background: var(--flaeche); color: var(--grau); }
.day > .head .tag.feier { background: #eaf3fb; color: #2a5f8f; }
.day > .head .sum { margin-left: auto; font-variant-numeric: tabular-nums; font-size: .88rem; }
.day > .head .sum b { font-size: .98rem; }

.entryform { display: grid; grid-template-columns: 8.5rem 5.5rem 5.5rem 5.5rem 1fr auto; gap: .5rem;
             align-items: end; padding: .65rem .9rem; border-bottom: 1px solid var(--linie); }
.entryform:last-child { border-bottom: 0; }
.entryform.neu { background: #fcfdfa; }
.entryform .reason { grid-column: 1 / -1; margin-top: -.15rem; }
.entryform .reasoninput { max-width: 34rem; font-size: .84rem; padding: .28rem .5rem;
                          background: #fcfcfa; border-style: dashed; }
.entryform .reasoninput::placeholder { color: #9a9e97; }
.entryform .acts { display: flex; gap: .4rem; align-items: center; }
@media (max-width: 780px) {
  .entryform { grid-template-columns: 1fr 1fr; }
  .entryform .note-cell, .entryform .acts { grid-column: 1 / -1; }
}

.badge { display: inline-block; font-size: .75rem; padding: .1rem .45rem; border-radius: 3px; font-weight: 600; }
.badge.arbeit      { background: #eef7e6; color: #3d6b13; }
.badge.urlaub      { background: #e9f2fb; color: #23577f; }
.badge.krank       { background: #fdeeec; color: #9c342a; }
.badge.seminar     { background: #f4eefb; color: #5c357f; }
.badge.dienstreise { background: #fdf6e5; color: #8a5f00; }
.badge.zu   { background: #eceeeb; color: #555; }
.badge.offen{ background: #eef7e6; color: #3d6b13; }

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

.loginpage { display: grid; place-items: center; min-height: 100vh; background: var(--gruen-tief); }
.loginbox { background: #fff; border-radius: 10px; padding: 2rem; width: min(380px, calc(100vw - 2.5rem)); }
.loginbox h1 { font-size: 1.15rem; margin-bottom: 1.2rem; display: flex; align-items: center; gap: .5rem; }
.loginbox h1 .mark { width: 12px; height: 12px; border-radius: 3px; background: var(--gruen); }

/* ----------------------------------------------------------------------- Druck */

.printbar { padding: 1rem 1.25rem; display: flex; gap: .6rem; }
.sheet { max-width: 900px; margin: 0 auto 3rem; background: #fff; padding: 2.2rem 2.4rem; border: 1px solid var(--linie); }
.sheet h1 { font-size: 1.25rem; }
.sheet .meta { font-size: .85rem; color: var(--grau); margin-bottom: 1.5rem; }
.sheet table { font-size: .82rem; }
.sheet th, .sheet td { padding: .32rem .45rem; }
/* Datum und Uhrzeiten nie umbrechen — sonst wird der Ausdruck unruhig. */
.sheet td:nth-child(-n+2), .sheet td:nth-child(4), .sheet td:nth-child(5),
.sheet td:nth-child(6), .sheet td:nth-child(7) { white-space: nowrap; }
.sig { margin-top: 3rem; display: flex; gap: 4rem; font-size: .82rem; color: var(--grau); }
.sig div { flex: 1; border-top: 1px solid var(--tinte); padding-top: .35rem; }

@media print {
  body { background: #fff; }
  .noprint, .top, .foot { display: none !important; }
  .sheet { border: 0; padding: 0; max-width: none; margin: 0; }
  table { font-size: 9.5pt; }
  th, td { padding: .18rem .3rem; }
  tr, .day { page-break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
  @page { margin: 16mm 14mm; }
}
