/* ALL-CERT E-Rechnung — Oberfläche */

:root {
  --navy:        #16284d;
  --navy-700:    #1f3666;
  --navy-300:    #5a7099;
  --accent:      #0d6efd;
  --bg:          #eef1f6;
  --surface:     #ffffff;
  --line:        #dde3ec;
  --text:        #1a2233;
  --muted:       #6b7689;
  --ok:          #0f7a52;
  --ok-bg:       #e6f5ee;
  --warn:        #9a6400;
  --warn-bg:     #fdf4e1;
  --err:         #b3261e;
  --err-bg:      #fdecea;
  --radius:      10px;
  --shadow:      0 1px 2px rgba(22,40,77,.06), 0 8px 24px rgba(22,40,77,.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

/* ---------- Kopfzeile ---------- */
.topbar {
  background: var(--navy);
  color: #fff;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  box-shadow: var(--shadow);
}
.topbar .brand { display: flex; align-items: baseline; gap: 10px; font-weight: 600; letter-spacing: .3px; }
.topbar .brand span { font-weight: 400; opacity: .75; font-size: 13px; letter-spacing: 0; }
.topbar .right { display: flex; align-items: center; gap: 16px; font-size: 14px; }
.topbar .right .who { opacity: .8; }
.topbar a { color: #fff; text-decoration: none; opacity: .85; }
.topbar a:hover { opacity: 1; text-decoration: underline; }

/* ---------- Layout ---------- */
.wrap { max-width: 1060px; margin: 28px auto 60px; padding: 0 24px; }
.wrap.narrow { max-width: 440px; margin-top: 8vh; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
}
.card h2 { margin: 0 0 4px; font-size: 17px; }
.card h2 + .sub { margin: 0 0 18px; color: var(--muted); font-size: 13.5px; }
.card > :last-child { margin-bottom: 0; }

h1 { font-size: 22px; margin: 0 0 6px; }
.lead { color: var(--muted); margin: 0 0 24px; }

/* ---------- Formular ---------- */
label { display: block; font-size: 13px; font-weight: 600; color: var(--navy-700); margin-bottom: 5px; }
input[type=text], input[type=password], input[type=date], input[type=number], select, textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font: inherit;
  font-size: 14px;
  background: #fff;
  color: var(--text);
  transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13,110,253,.14);
}
input[readonly] { background: #f4f6fa; color: var(--muted); }
textarea { resize: vertical; min-height: 60px; }

.grid { display: grid; gap: 14px 18px; }
.grid.c2 { grid-template-columns: 1fr 1fr; }
.grid.c3 { grid-template-columns: 1fr 1fr 1fr; }
.grid.c4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 760px) { .grid.c2, .grid.c3, .grid.c4 { grid-template-columns: 1fr; } }

fieldset { border: 0; padding: 0; margin: 0 0 26px; }
fieldset legend {
  font-size: 12px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
  color: var(--navy-300); padding: 0 0 10px; width: 100%; border-bottom: 1px solid var(--line); margin-bottom: 16px;
}

/* ---------- Schaltflächen ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 7px; border: 1px solid transparent;
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  text-decoration: none; transition: background .12s, box-shadow .12s, transform .06s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-700); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--text); }
.btn-ghost:hover { background: #f4f6fa; }
.btn-danger { background: #fff; border-color: #f0c9c6; color: var(--err); }
.btn-danger:hover { background: var(--err-bg); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.btn-row.end { justify-content: flex-end; }

/* ---------- Hinweise ---------- */
.note { padding: 12px 15px; border-radius: 8px; font-size: 14px; margin-bottom: 18px; border: 1px solid; }
.note-ok   { background: var(--ok-bg);   border-color: #bfe3d2; color: var(--ok); }
.note-warn { background: var(--warn-bg); border-color: #f0dcae; color: var(--warn); }
.note-err  { background: var(--err-bg);  border-color: #f3c7c3; color: var(--err); }
.note-info { background: #eaf2fe;        border-color: #c7dcfb; color: #0a4fa8; }
.note ul { margin: 8px 0 0; padding-left: 20px; }
.note strong { display: block; margin-bottom: 2px; }

/* ---------- Hochladen ---------- */
.drop {
  border: 2px dashed #c3cedf; border-radius: var(--radius);
  padding: 38px 24px; text-align: center; background: #f8fafd;
  transition: background .15s, border-color .15s; cursor: pointer;
}
.drop:hover, .drop.over { border-color: var(--accent); background: #eef4ff; }
.drop .big { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.drop .small { color: var(--muted); font-size: 13px; }
.drop input[type=file] { display: none; }
#filelist { margin-top: 14px; font-size: 13.5px; color: var(--muted); }
#filelist div { padding: 3px 0; }

/* ---------- Tabellen ---------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left; font-size: 11.5px; letter-spacing: .6px; text-transform: uppercase;
  color: var(--navy-300); font-weight: 700; padding: 0 10px 8px; border-bottom: 1px solid var(--line);
}
td { padding: 10px; border-bottom: 1px solid #eef1f6; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.items td { padding: 6px 6px; }
.items input { font-size: 13.5px; }

/* ---------- Statusmarken ---------- */
.tag {
  display: inline-block; padding: 3px 9px; border-radius: 99px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.tag-ok   { background: var(--ok-bg);   color: var(--ok); }
.tag-warn { background: var(--warn-bg); color: var(--warn); }
.tag-err  { background: var(--err-bg);  color: var(--err); }
.tag-neutral { background: #eceff5; color: var(--muted); }

/* ---------- Summenblock ---------- */
.totals { margin-left: auto; width: 320px; font-size: 14px; }
.totals div { display: flex; justify-content: space-between; padding: 7px 0; }
.totals .line { border-top: 1px solid var(--line); }
.totals .grand { border-top: 2px solid var(--navy); font-weight: 700; font-size: 15.5px; color: var(--navy); }
.totals .num { font-variant-numeric: tabular-nums; }

/* ---------- Fußzeile ---------- */
.foot { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 36px; }
.foot a { color: var(--muted); }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }

/* ---------- Abmelden als Formular (statt Link) ---------- */
.inline-form { display: inline; margin: 0; }
.linkbutton {
  background: none; border: 0; padding: 0; margin: 0;
  font: inherit; font-size: 14px; color: #fff; opacity: .85;
  cursor: pointer; text-decoration: none;
}
.linkbutton:hover { opacity: 1; text-decoration: underline; }
