/* ART INOX ERP – Oberfläche. Farben aus dem Firmenlogo (Briefpapier). */
:root {
  --brand: #263891; --brand-dark: #1b2766; --brand-soft: #e9ebf7;
  --accent: #8cc640; --accent-soft: #eef6e4;
  --ink: #1b1e2b; --muted: #636a80; --line: #dfe2ea; --bg: #f4f5f8; --card: #fff;
  --ok: #2f7d32; --warn: #a15c00; --warn-soft: #fff4e0; --err: #b3261e; --err-soft: #fdecea;
  --radius: 10px; --shadow: 0 1px 2px rgba(20, 24, 50, .06), 0 2px 8px rgba(20, 24, 50, .04);
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px; color: var(--ink); line-height: 1.45;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 16px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
code, .mono { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }

/* Layout */
.shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.side { background: var(--brand-dark); color: #d9ddf2; display: flex; flex-direction: column; position: sticky; top: 0;
        height: 100vh; overflow-y: auto; }
.side .logo { background: #fff; margin: 14px; border-radius: 8px; padding: 10px 12px; display: block; }
.side .logo img { width: 100%; display: block; }
.side nav a { display: flex; align-items: center; gap: 10px; color: #d9ddf2; padding: 7px 18px; font-size: 13.5px;
              border-left: 3px solid transparent; }
.side nav a:hover { background: rgba(255, 255, 255, .06); text-decoration: none; }
.side nav a.active { background: rgba(255, 255, 255, .1); border-left-color: var(--accent); color: #fff; font-weight: 600; }
.side nav a .ic { width: 18px; text-align: center; opacity: .85; }
.side nav a.planned { color: #9198bf; }
.side nav a .badge { margin-left: auto; font-size: 10px; border: 1px solid #4c5590; border-radius: 9px; padding: 0 6px;
                     color: #9aa1c9; font-weight: 400; }
.side .foot { margin-top: auto; padding: 14px 18px; font-size: 12px; color: #9aa1c9; border-top: 1px solid rgba(255,255,255,.08); }
.side .foot form { display: inline; }
.side .foot button { background: none; border: 0; color: #d9ddf2; padding: 0; cursor: pointer; font: inherit; text-decoration: underline; }
.main { min-width: 0; }
.topbar { display: flex; align-items: center; gap: 16px; padding: 12px 28px; background: var(--card);
          border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar form { flex: 1; max-width: 560px; }
.topbar input[type=search] { width: 100%; }
.topbar .who { margin-left: auto; color: var(--muted); font-size: 13px; }
.content { padding: 22px 28px 60px; max-width: 1500px; }
.pagehead { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.pagehead .sub { color: var(--muted); margin-top: 4px; }
.pagehead .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Karten, Raster */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
        padding: 18px; margin-bottom: 16px; }
.card.tight { padding: 0; overflow: hidden; }
.card > h2:first-child { display: flex; align-items: center; gap: 8px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
@media (max-width: 1100px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 800px) {
  .shell { grid-template-columns: 1fr; } .side { position: static; height: auto; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; } .span2 { grid-column: auto; }
}
.kpi { padding: 16px 18px; }
.kpi .v { font-size: 24px; font-weight: 700; color: var(--brand); }
.kpi .l { color: var(--muted); font-size: 12.5px; }

/* Register (Tabs) */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 0 0 16px; flex-wrap: wrap; }
.tabs a { padding: 9px 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: 13.5px; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.tabs a .soon { font-size: 10px; color: var(--muted); margin-left: 4px; }

/* Tabellen */
table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 9px 12px;
                background: #fafbfc; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.list td { padding: 9px 12px; border-bottom: 1px solid #eef0f4; vertical-align: top; }
table.list tr:last-child td { border-bottom: 0; }
table.list tr.click:hover td { background: #f8f9fd; }
table.list .num, .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.list tfoot td { font-weight: 600; background: #fafbfc; }
table.kv { border-collapse: collapse; width: 100%; }
table.kv th { text-align: left; color: var(--muted); font-weight: 400; padding: 4px 12px 4px 0; width: 42%; vertical-align: top; }
table.kv td { padding: 4px 0; }
.empty { color: var(--muted); padding: 18px; text-align: center; }

/* Formulare */
label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], input[type=date],
input[type=tel], input[type=url], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #cfd4df; border-radius: 7px; font: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
textarea { min-height: 80px; resize: vertical; }
.field { margin-bottom: 12px; }
.row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.check { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 13.5px; }
.check input { width: auto; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.inline-form { display: inline; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin: 0 0 12px; }
legend { font-size: 12px; color: var(--muted); padding: 0 6px; }

/* Schaltflächen */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 7px; border: 1px solid #cfd4df;
       background: #fff; color: var(--ink); font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; }
.btn:hover { background: #f5f6fa; text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #17320a; }
.btn.danger { color: var(--err); border-color: #e6b8b4; }
.btn.small { padding: 4px 9px; font-size: 12.5px; }
.btn.link { border: 0; background: none; color: var(--brand); padding: 0; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Status, Hinweise */
.pill { display: inline-block; padding: 1px 9px; border-radius: 10px; font-size: 12px; background: #eceef4; color: #3b4157; white-space: nowrap; }
.pill.st-kunde, .pill.st-angenommen, .pill.st-abgeschlossen, .pill.st-auftrag, .pill.st-zugeordnet { background: var(--accent-soft); color: #2d5a10; }
.pill.st-interessent, .pill.st-anfrage, .pill.st-neu { background: #e7f0fb; color: #1f4f8a; }
.pill.st-entwurf { background: var(--warn-soft); color: var(--warn); }
.pill.st-festgeschrieben, .pill.st-versendet { background: var(--brand-soft); color: var(--brand); }
.pill.st-verloren, .pill.st-abgelehnt, .pill.st-storniert { background: var(--err-soft); color: var(--err); }
.pill.planned { background: transparent; border: 1px dashed #aab; color: var(--muted); }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; background: var(--accent-soft); color: #2d5a10;
         border: 1px solid #cfe5b8; }
.flash.error { background: var(--err-soft); color: var(--err); border-color: #f2c4bf; }
.notice { padding: 10px 14px; border-radius: 8px; background: var(--warn-soft); color: #6b4300; border: 1px solid #f3d9a8; margin-bottom: 14px; }
.notice.info { background: var(--brand-soft); color: var(--brand-dark); border-color: #cdd2ee; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-wrap; }
.mailbody { white-space: pre-wrap; background: #fafbfc; border: 1px solid var(--line); border-radius: 8px; padding: 14px;
            max-height: 520px; overflow: auto; font-size: 13.5px; }
.bar { height: 6px; background: #e8eaf1; border-radius: 4px; overflow: hidden; min-width: 80px; }
.bar > span { display: block; height: 100%; background: var(--accent); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 8px 0 8px 18px; border-left: 2px solid var(--line); position: relative; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 13px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.timeline .when { font-size: 12px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: #f0f2f7; border-radius: 12px; padding: 2px 10px; font-size: 12.5px; }
.preview img { max-width: 100%; max-height: 640px; border: 1px solid var(--line); border-radius: 8px; }
.preview iframe { width: 100%; height: 720px; border: 1px solid var(--line); border-radius: 8px; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.thumbs a { display: block; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.thumbs img { width: 100%; height: 120px; object-fit: cover; display: block; }
.thumbs span { display: block; padding: 6px 8px; font-size: 12px; }
.calc-sum td, .calc-sum th { padding: 5px 0; }
.calc-sum tr.total td, .calc-sum tr.total th { border-top: 2px solid var(--brand); font-weight: 700; color: var(--brand); padding-top: 8px; }
details summary { cursor: pointer; color: var(--brand); font-weight: 500; margin-bottom: 8px; }
.login { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(160deg, var(--brand-dark), var(--brand)); }
.login .card { width: 380px; padding: 28px; }
.login img { width: 220px; display: block; margin: 0 auto 18px; }
.sep { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.danger-zone { border-color: #f2c4bf; }

/* ---------------------------------------------------------------- Belegerfassung als Blatt (Aufbau wie klassische ERP-Belegmaske) */
.beleg-toolbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; background: var(--card); border: 1px solid var(--line);
                 border-radius: var(--radius); padding: 8px 10px; margin-bottom: 12px; }
.beleg-toolbar .spacer { flex: 1; }
.beleg-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
@media (max-width: 1700px) { .beleg-layout { grid-template-columns: 1fr; } .beleg-layout aside { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; } .beleg-layout aside .card { margin: 0; } }
.sheet-canvas { background: #dcdfe6; border-radius: var(--radius); padding: 22px; }
.sheet { background: #fff; max-width: 980px; margin: 0 auto; padding: 46px 36px 40px; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.sheet-head { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 40px; margin-top: 40px; }
.sheet .sender { font-size: 11px; color: var(--muted); border-bottom: 1px solid #333; padding-bottom: 2px; margin-bottom: 6px; }
.sheet .addr textarea { border: 0; border-radius: 0; background: repeating-linear-gradient(#f1f2f5 0 24px, #fff 24px 27px);
                        line-height: 27px; padding: 0 6px; min-height: 162px; resize: none; font-size: 14px; }
.sheet .addr .pre { line-height: 22px; }
.infobox { border: 1px solid #444; font-size: 13px; }
.infobox .ib-title { background: #c9ccd3; text-align: center; font-weight: 700; font-size: 16px; padding: 3px; border-bottom: 1px solid #444; }
.infobox table { width: 100%; border-collapse: collapse; }
.infobox th { text-align: left; font-weight: 400; padding: 2px 6px; width: 44%; white-space: nowrap; }
.infobox td { padding: 2px 6px; }
.infobox input { padding: 3px 6px; border-radius: 3px; background: #f1f2f5; border: 1px solid transparent; font-size: 13px; }
.infobox input:focus { background: #fff; }
.infobox .ib-foot { text-align: center; font-weight: 700; font-size: 11.5px; padding: 3px; }
.sheet .introtext textarea, .sheet .bodytext textarea { background: #f1f2f5; border: 1px solid transparent; border-radius: 3px; }
.sheet .introtext { margin: 46px 0 14px; }
.postable { width: 100%; border-collapse: collapse; font-size: 13.5px; table-layout: fixed; }
.postable input, .postable select, .postable textarea { width: 100%; }
.postable td { overflow-wrap: anywhere; }
.postable thead th { background: #c9ccd3; font-weight: 400; text-align: left; padding: 3px 6px; white-space: nowrap; }
.postable thead th.num, .postable td.num { text-align: right; }
.postable td { padding: 4px 6px; vertical-align: top; border-bottom: 1px solid #eceef2; }
.postable input, .postable select, .postable textarea { padding: 3px 6px; font-size: 13px; background: #f1f2f5; border: 1px solid transparent; border-radius: 3px; }
.postable input:focus, .postable textarea:focus { background: #fff; }
.postable tr.newline td { background: #fbfbfd; border-bottom: 0; }
.postable tr.titel td { font-weight: 700; border-bottom: 1px solid var(--accent); }
.postable .lt { color: var(--muted); font-size: 12.5px; white-space: pre-wrap; }
.postable .rowtools { white-space: nowrap; text-align: right; }
.postable .rowtools .btn { padding: 0 5px; font-size: 12px; }
.postable .rowtools form { display: inline; }
.sumbar { display: flex; justify-content: flex-end; gap: 14px; background: #c9ccd3; padding: 3px 6px; margin-top: 4px; font-size: 13.5px; }
.sumbar span:last-child { min-width: 110px; text-align: right; border-bottom: 1px solid #333; background: #fff; padding: 0 4px; }
.sumbar.total { font-weight: 700; }
.sumbar.vat { background: #e4e6eb; }
.sheet .bodytext { margin-top: 18px; }
.sheet .ro-text { white-space: pre-wrap; font-size: 13.5px; }
