/* Stark Gerüstbau Dashboard – Design-System
   Alle Module verwenden NUR diese Klassen + Tokens. */
:root {
  /* STARK Gerüstbau – Corporate Design (aus Website-Briefing): Grün, Anthrazit, Kalk, Stahl */
  --bg: #f6f7f5;            /* Kalk */
  --surface: #ffffff;
  --surface-2: #fafbfa;
  --border: #e3e7e5;        /* Stahl hell */
  --border-strong: #c7cdca; /* Stahl */
  --text: #18201d;          /* Anthrazit */
  --text-2: #4a5551;
  --text-3: #87918d;
  --side-bg: #18201d;
  --side-bg-2: #232d29;
  --side-text: #c9d1cd;
  --side-text-dim: #7f8a85;
  --accent: #007c4e;        /* STARK-Grün */
  --accent-600: #005c3a;
  --accent-50: #e7f3ee;
  --mint: #36ca99;          /* Akzent auf Dunkel */
  --blue: #2f5d9e;   --blue-50: #eef3fa;
  --green: #007c4e;  --green-50: #e7f3ee;
  --amber: #b7791f;  --amber-50: #fbf5e8;
  --red: #b42318;    --red-50: #fbefed;
  --violet: #6d4fb3; --violet-50: #f3f0fa;
  --gray-50: #eef1ef;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(24, 32, 29, .04), 0 2px 8px rgba(24, 32, 29, .04);
  --shadow-lg: 0 18px 48px rgba(24, 32, 29, .18);
  --font: "Barlow", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-head: "Barlow Condensed", "Barlow", -apple-system, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h1 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 16px; font-weight: 650; }
h3 { font-size: 14px; font-weight: 650; }
p { margin: 0 0 8px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }

/* ---------------------------------------------------------------- Layout */
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar { background: var(--side-bg); color: var(--side-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 16px; border-bottom: 1px solid rgba(255,255,255,.06); }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(145deg, #0a8f5c, #005c3a); display: grid; place-items: center; color: #fff; box-shadow: 0 4px 14px rgba(0, 124, 78, .35), inset 0 1px 0 rgba(255,255,255,.25); }
.brand-mark svg { width: 20px; height: 20px; }
.brand-name { font-weight: 800; color: #fff; letter-spacing: .16em; font-size: 15px; }
.brand-sub { font-size: 10px; color: var(--side-text-dim); letter-spacing: .14em; margin-top: 1px; }
.nav { padding: 10px 10px; display: flex; flex-direction: column; gap: 2px; }
.nav-section { display: flex; align-items: center; width: 100%; border: 0; background: none; cursor: pointer; font: 600 10.5px var(--font); text-transform: uppercase; letter-spacing: .1em; color: var(--side-text-dim); padding: 14px 10px 6px; text-align: left; }
.nav-section:hover { color: var(--side-text); }
.nav-section .chev { width: 13px; height: 13px; margin: 0 6px 0 -2px; transition: transform .18s; opacity: .6; }
.nav-group:first-child .nav-items { margin-top: 4px; }
.nav-group.closed .chev { transform: rotate(-90deg); }
.nav-items { display: flex; flex-direction: column; gap: 2px; }
.nav-group.closed .nav-items { display: none; }
.rail-toggle { color: var(--side-text-dim) !important; width: 100%; justify-content: flex-start !important; padding: 0 8px !important; margin-bottom: 10px; gap: 10px !important; }
.rail-toggle:hover { background: var(--side-bg-2) !important; color: #fff !important; }
.rail-toggle svg { transition: transform .2s; }
/* Eingeklappte Icon-Leiste */
.app { transition: grid-template-columns .2s ease; }
.app.rail { grid-template-columns: 68px 1fr; }
.app.rail .brand { justify-content: center; padding: 18px 0 16px; }
.app.rail .brand-text, .app.rail .nav-label, .app.rail .nav-section span, .app.rail .foot-text, .app.rail .nav-section .chev { display: none; }
.app.rail .nav-section { justify-content: center; padding: 12px 0 6px; cursor: default; }
.app.rail .nav-section::before { content: ''; display: block; width: 20px; border-top: 1px solid rgba(255,255,255,.12); }
.app.rail .nav-group.closed .nav-items { display: flex; }
.app.rail .nav a { justify-content: center; padding: 10px 0; position: relative; }
.app.rail .nav .count { position: absolute; top: 2px; right: 6px; font-size: 9.5px; padding: 0 5px; line-height: 15px; }
.app.rail .rail-toggle { justify-content: center !important; padding: 0 !important; }
.app.rail .rail-toggle svg { transform: rotate(180deg); }
.app.rail .sidebar-foot { padding: 12px 8px 16px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8px 11px; border-radius: 8px; color: var(--side-text); font-weight: 500; font-size: 13.5px; text-decoration: none; transition: background .12s, color .12s; }
.nav a:hover { background: var(--side-bg-2); color: #fff; }
.nav a.active { background: var(--side-bg-2); color: #fff; }
.nav a.active svg { color: var(--accent); opacity: 1; }
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .75; }
.nav .count { margin-left: auto; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; border-radius: 20px; padding: 0 7px; line-height: 18px; }
.nav .count:empty { display: none; }
.nav .count { background: rgba(255,255,255,.14); color: #fff; }
.nav .count.rot { background: var(--accent); }
.sidebar-foot { margin-top: auto; padding: 12px 18px 16px; font-size: 11.5px; color: var(--side-text-dim); border-top: 1px solid rgba(255,255,255,.06); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 60px; backdrop-filter: saturate(1.4) blur(8px); background: rgba(255,255,255,.85) !important; display: flex; align-items: center; gap: 12px; padding: 0 28px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.topbar .search { flex: 1; max-width: 460px; }
.topbar .today { margin-left: auto; color: var(--text-2); font-size: 13px; }
.topbar .menu-btn { display: inline-flex; }
.content { padding: 24px 28px 48px; max-width: 1480px; width: 100%; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .sub { color: var(--text-2); margin-top: 4px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- Karten & Grids */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.card-head .hint { color: var(--text-3); font-size: 12.5px; }
.card-body { padding: 16px 18px; }
.card-body.flush { padding: 0; }
.card + .card { margin-top: 16px; }
.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)); }
.span-2 { grid-column: span 2; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; }

/* KPI-Kacheln */
.kpi { padding: 16px 18px; }
.kpi .label { color: var(--text-2); font-size: 12.5px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.kpi .value { font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .delta { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.kpi.accent { box-shadow: inset 0 3px 0 var(--accent), var(--shadow); }
.kpi.red .value { color: var(--red); }
.kpi.green .value { color: var(--green); }
.kpi a.kpi-link { color: inherit; text-decoration: none; display: block; }

/* ---------------------------------------------------------------- Buttons & Formulare */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: 500 13.5px var(--font); cursor: pointer; white-space: nowrap; text-decoration: none !important; }
.btn:hover { background: var(--surface-2); border-color: #bdb9b1; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-600); border-color: var(--accent-600); }
.btn-dark { background: var(--text); border-color: var(--text); color: #fff; }
.btn-dark:hover { background: #2e2c29; }
.btn-danger { color: var(--red); }
.btn-danger:hover { background: var(--red-50); border-color: #f5b5b0; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--gray-50); border-color: transparent; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn-icon { width: 32px; padding: 0; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field .help { font-size: 12px; color: var(--text-3); }
.input, select.input, textarea.input { width: 100%; height: 36px; padding: 0 11px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: 14px var(--font); outline: none; }
select.input, select {
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  padding-right: 34px; cursor: pointer; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238f8a83' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; background-size: 15px;
}
select.input:hover { border-color: #bdb9b1; }
select.input:focus { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23007c4e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
.toolbar select.input, .row select.input { width: auto; }
textarea.input { height: auto; min-height: 90px; padding: 9px 11px; resize: vertical; line-height: 1.5; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 124, 78, .14); }
.input-sm { height: 30px; font-size: 13px; }
.checkbox { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--accent); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }

.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .input { width: auto; min-width: 180px; }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tab { padding: 9px 14px; border: 0; background: none; font: 500 13.5px var(--font); color: var(--text-2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.tab .n { margin-left: 6px; font-size: 11.5px; color: var(--text-3); }

/* Segmentierte Filter-Chips */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border: 1px solid var(--border-strong); border-radius: 20px; background: var(--surface); font: 500 12.5px var(--font); color: var(--text-2); cursor: pointer; }
.chip:hover { border-color: #bdb9b1; color: var(--text); }
.chip.active { background: var(--text); color: #fff; border-color: var(--text); }
.chip .x { opacity: .6; }

/* Badges: .badge.neutral|blue|green|amber|red|orange|violet */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 20px; font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--gray-50); color: var(--text-2); }
.badge.blue { background: var(--blue-50); color: var(--blue); }
.badge.green { background: var(--green-50); color: var(--green); }
.badge.amber { background: var(--amber-50); color: var(--amber); }
.badge.red { background: var(--red-50); color: var(--red); }
.badge.orange { background: var(--accent-50); color: var(--accent-600); }
.badge.violet { background: var(--violet-50); color: var(--violet); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--text-3); flex: none; }
.dot.red { background: var(--red); } .dot.amber { background: var(--amber); } .dot.green { background: var(--green); } .dot.blue { background: var(--blue); } .dot.orange { background: var(--accent); } .dot.violet { background: var(--violet); }

/* ---------------------------------------------------------------- Tabellen */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover td { background: var(--surface-2); }
.table .num, .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .nowrap { white-space: nowrap; }
.table .title { font-weight: 600; }
.table .sub { font-size: 12.5px; color: var(--text-3); }

/* Listen */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
.list-item.clickable { cursor: pointer; }
.list-item.clickable:hover { background: var(--surface-2); }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .meta { font-size: 12.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Leerer Zustand */
.empty { text-align: center; padding: 40px 20px; color: var(--text-3); }
.empty svg { width: 36px; height: 36px; opacity: .5; margin-bottom: 8px; }
.empty .title { color: var(--text-2); font-weight: 600; margin-bottom: 4px; }

/* Master/Detail (z.B. Mails, Kontakte) */
.split { display: grid; grid-template-columns: 380px 1fr; gap: 16px; align-items: start; }
.split > .card { min-height: 420px; }
.scroll { max-height: calc(100vh - 230px); overflow-y: auto; }

/* Kanban (Akquise, Ausschreibungen) */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.kcol { background: #ecebe7; border-radius: var(--radius); padding: 10px; min-height: 160px; }
.kcol.drop { outline: 2px dashed var(--accent); outline-offset: -2px; }
.kcol-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 10px; font-weight: 650; font-size: 13px; }
.kcol-head .sum { margin-left: auto; color: var(--text-3); font-weight: 500; font-size: 12px; }
.kcard { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; box-shadow: var(--shadow); cursor: grab; }
.kcard:hover { border-color: var(--border-strong); }
.kcard .title { font-weight: 600; font-size: 13.5px; }
.kcard .meta { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.kcard.dragging { opacity: .5; }

/* Kalender */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-left: 1px solid var(--border); border-top: 1px solid var(--border); }
.cal-h { padding: 8px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); background: var(--surface-2); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.cal-d { min-height: 108px; padding: 6px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface); cursor: pointer; }
.cal-d:hover { background: var(--surface-2); }
.cal-d.other { background: #f8f7f4; color: var(--text-3); }
.cal-d.today .n { background: var(--accent); color: #fff; }
.cal-d .n { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: 12.5px; font-weight: 600; }
.cal-ev { display: block; font-size: 11.5px; padding: 2px 6px; border-radius: 4px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: var(--blue-50); color: var(--blue); border-left: 3px solid var(--blue); }
.cal-ev.orange { background: var(--accent-50); color: var(--accent-600); border-color: var(--accent); }
.cal-ev.green { background: var(--green-50); color: var(--green); border-color: var(--green); }
.cal-ev.red { background: var(--red-50); color: var(--red); border-color: var(--red); }
.cal-ev.violet { background: var(--violet-50); color: var(--violet); border-color: var(--violet); }
.cal-ev.amber { background: var(--amber-50); color: var(--amber); border-color: var(--amber); }

/* Fortschritt */
.progress { height: 8px; background: var(--gray-50); border-radius: 8px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: 8px; }

/* Hinweise */
.notice { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--blue-50); color: #24426e; font-size: 13.5px; border: 1px solid #d3deee; }
.notice.amber { background: var(--amber-50); color: #7a4a05; border-color: #fbe0a6; }
.notice.red { background: var(--red-50); color: #8a1c14; border-color: #f7c3be; }
.notice.green { background: var(--green-50); color: #0f5a2c; border-color: #b4e8c7; }
.notice svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }

/* Text-Helfer */
.muted { color: var(--text-2); } .dim { color: var(--text-3); } .small { font-size: 12.5px; }
.strong { font-weight: 650; } .red-text { color: var(--red); } .green-text { color: var(--green); } .amber-text { color: var(--amber); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pre { white-space: pre-wrap; word-break: break-word; }

/* ---------------------------------------------------------------- Modal & Toast */
.modal-back { position: fixed; inset: 0; background: rgba(26, 25, 23, .45); backdrop-filter: blur(2px); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 100; overflow-y: auto; animation: fade .12s ease-out; }
.modal { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-lg); width: 100%; max-width: 620px; animation: pop .14s ease-out; }
.modal.wide { max-width: 980px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 18px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 12px 12px; }
.modal-foot .left { margin-right: auto; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }

.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: var(--text); color: #fff; padding: 11px 16px; border-radius: 8px; box-shadow: var(--shadow-lg); font-size: 13.5px; max-width: 380px; animation: pop .15s ease-out; }
.toast.error { background: var(--red); }
.toast.success { background: #0f7a37; }

.spinner { width: 18px; height: 18px; border: 2px solid var(--border-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 40px; color: var(--text-3); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- Responsiv */
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 250px; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; }
  .app.rail { grid-template-columns: 1fr; }
  .app.rail .nav-label, .app.rail .brand-text, .app.rail .foot-text, .app.rail .nav-section span { display: initial; }
  .rail-toggle { display: none !important; }
  .topbar, .content { padding-left: 16px; padding-right: 16px; }
  .g2, .g3, .g4, .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .topbar .today { display: none; }
}

/* ---------------------------------------------------------------- Druck (Rechnungen, Mahnungen) */
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  body { background: #fff; }
}

/* Icon-Größen (Standard 16px über width/height-Attribut; hier gezielt angepasst) */
svg { flex: none; }
.kpi .label svg { width: 15px; height: 15px; color: var(--text-3); }
.card-head svg, .small svg, a > svg { width: 14px; height: 14px; vertical-align: -2px; }

/* Karten in Rastern/Zeilen nicht versetzen */
.grid > .card + .card, .row > .card + .card, .split > .card + .card, .kanban .card + .card { margin-top: 0; }

/* Unterpunkte im Menü (z.B. Mail-Kategorien) */
.nav a.nav-sub { padding-top: 6px; padding-bottom: 6px; font-size: 13px; color: var(--side-text-dim); }
.nav a.nav-sub svg { width: 15px; height: 15px; }
.nav a.nav-sub:hover, .nav a.nav-sub.active { color: #fff; }
.nav .count.muted { background: rgba(255,255,255,.12); color: var(--side-text); }

/* Einklappen-Knopf in der Markenzeile (wie Alladin) */
.brand { position: relative; }
.collapse-btn { margin-left: auto; border: 0; background: none; color: var(--side-text-dim); padding: 5px; border-radius: 7px; cursor: pointer; display: grid; place-items: center; }
.collapse-btn:hover { background: var(--side-bg-2); color: #fff; }
.collapse-btn svg { width: 18px; height: 18px; }
.app.rail .brand { flex-direction: column; gap: 10px; }
.app.rail .collapse-btn { margin: 0; }
/* Leads hervorgehoben (wie Alladin) */
.nav a[data-navkey="leads"] { color: #fff; font-weight: 600; }
.nav a[data-navkey="leads"] svg { color: var(--accent); opacity: 1; }
.nav a[data-navkey="leads"].active { background: linear-gradient(100deg, #007c4e, #005c3a); box-shadow: 0 4px 14px rgba(0,124,78,.35); }
.nav a[data-navkey="leads"].active svg { color: #fff; }
.nav a[data-navkey="leads"].active .count { background: rgba(255,255,255,.25); }
.brand-sub { white-space: nowrap; letter-spacing: .1em !important; }
.brand-text { min-width: 0; }
.empty .btn svg { width: 16px; height: 16px; margin: 0; opacity: 1; }

/* ---------- STARK-CI: Überschriften in Barlow Condensed, Logo in der Seitenleiste */
h1, .kpi .value, .brand-name { font-family: var(--font-head); }
h1 { font-size: 30px; font-weight: 700; letter-spacing: 0; }
h2 { font-weight: 600; }
.kpi .value { font-size: 32px; font-weight: 700; letter-spacing: 0; }
body { font-size: 14.5px; }
.brand-logo { display: block; height: 30px; width: auto; max-width: 150px; }
.brand-logo-rund { display: none; width: 38px; height: 38px; }
.app.rail .brand-logo { display: none; }
.app.rail .brand-logo-rund { display: block; }
.brand-sub { color: var(--mint) !important; opacity: .85; }
.nav a.active svg { color: var(--mint); }
.nav .count.rot { background: var(--accent); }
.brand .brand-text { display: none; }
.brand { padding: 20px 16px 18px 18px; }
.nav .count.rot { background: var(--red) !important; color: #fff; }

.topbar .user-btn { margin-left: 8px; gap: 8px; }
.topbar .user-btn span { max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 760px) { .topbar .user-btn span { display: none; } }
