/* Hausschriften von rocdesign.de: Rubik (Text) und Teko (Überschriften), SIL Open Font License – lokal eingebunden */
@font-face { font-family: 'Rubik'; src: url('/fonts/rubik-latin-300-normal.woff2') format('woff2'); font-weight: 300; font-display: swap; }
@font-face { font-family: 'Rubik'; src: url('/fonts/rubik-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Rubik'; src: url('/fonts/rubik-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Rubik'; src: url('/fonts/rubik-latin-600-normal.woff2') format('woff2'); font-weight: 600 700; font-display: swap; }
@font-face { font-family: 'Teko'; src: url('/fonts/teko-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Teko'; src: url('/fonts/teko-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }

/* rocDesk – Standardfarben. Branding (Akzent, Seitenleiste, Logo) lässt sich in der
   Oberfläche unter Verwaltung → Branding ändern; die Werte hier sind nur die Vorgaben. */
:root {
  --accent: #beee44;          /* roc-grün */
  --on-accent: #000000;
  --accent-hover: color-mix(in srgb, var(--accent) 86%, #000);
  --accent-soft: color-mix(in srgb, var(--accent) 11%, #fff);
  --accent-text: #55700f;
  --sidebar: #000000;
  --sidebar-text: rgba(255,255,255,.74);
  --sidebar-strong: #ffffff;
  --sidebar-muted: rgba(255,255,255,.5);
  --sidebar-active: color-mix(in srgb, var(--sidebar), #fff 9%);
  --sidebar-border: color-mix(in srgb, var(--sidebar), #fff 10%);
  --bg: #f2f2f3;
  --panel: #ffffff;
  --border: #e4e4e7;
  --border-strong: #cfd0d5;
  --text: #121418;
  --muted: #686c76;
  --faint: #9a9da5;
  --soft: #f6f6f7;
  --softer: #eeeef0;
  --heading: 'Teko', 'Rubik', sans-serif;
  --ok: #138a55;
  --warn: #b7791f;
  --danger: #c8321f;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(10, 12, 16, .06), 0 1px 1px rgba(10, 12, 16, .04);
  --shadow-lg: 0 12px 40px rgba(10, 12, 16, .2);
  font-family: 'Rubik', ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; text-decoration: none; }
a.link, .link { color: var(--accent-text); cursor: pointer; }
a.link:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; }
h1 { font-family: var(--heading); font-size: 40px; line-height: .95; font-weight: 600; letter-spacing: .005em; padding-top: 4px; }
h2 { font-family: var(--heading); font-size: 23px; line-height: 1; font-weight: 500; letter-spacing: .01em; padding-top: 3px; }
h3 { font-size: 14px; }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.spacer { flex: 1; }
.pre { white-space: pre-wrap; word-break: break-word; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.danger-text { color: var(--danger); }
.ok-text { color: var(--ok); }
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- Layout ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar { background: var(--sidebar); color: var(--sidebar-text); display: flex; flex-direction: column; padding: 16px 12px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; color: var(--sidebar-strong); font-family: var(--heading); font-weight: 600; font-size: 26px; line-height: 1; }
.brand-logo { height: 58px; width: auto; max-width: 190px; object-fit: contain; object-position: left center; display: block; }
.brand-logo-wrap { display: flex; flex-direction: column; gap: 4px; }
.brand-mark { width: 28px; height: 28px; }
.brand-rail { display: none; width: 40px; height: 40px; }
.brand small { display: block; font-family: 'Rubik', sans-serif; font-weight: 400; font-size: 11px; color: var(--sidebar-muted); letter-spacing: .12em; text-transform: uppercase; margin-top: 4px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 4px; color: var(--sidebar-text); font-weight: 400; }
.nav a:hover { background: var(--sidebar-active); color: var(--sidebar-strong); }
.nav a.active { background: var(--sidebar-active); color: var(--sidebar-strong); box-shadow: inset 3px 0 0 var(--accent); }
.nav svg { width: 18px; height: 18px; opacity: .85; }
.nav-section { margin: 18px 10px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--sidebar-muted); }
.online { display: flex; flex-direction: column; gap: 6px; padding: 0 10px; }
.online-item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.online-dot { width: 7px; height: 7px; border-radius: 50%; background: #3ecf8e; margin-left: auto; }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--sidebar-border); padding-top: 12px; }
.usermenu { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; cursor: pointer; color: var(--sidebar-strong); }
.usermenu .small { color: var(--sidebar-muted); }
.usermenu:hover { background: var(--sidebar-active); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px 28px; background: rgba(242, 242, 243, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.content { padding: 24px 28px 48px; max-width: 1480px; width: 100%; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 2px; }

/* ---------- Search ---------- */
.search { position: relative; width: min(420px, 100%); }
.search input { width: 100%; padding: 8px 12px 8px 34px; border: 1px solid var(--border); border-radius: 4px; background: var(--panel); }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--faint); }
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; max-height: 70vh; overflow: auto; }
.search-group { padding: 6px 8px 2px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.search-item { display: flex; gap: 8px; align-items: baseline; padding: 7px 8px; border-radius: 6px; cursor: pointer; }
.search-item:hover, .search-item.sel { background: var(--bg); }

/* ---------- Buttons & Inputs ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 3px; border: 1px solid var(--border-strong); background: var(--panel); cursor: pointer; font-weight: 500; white-space: nowrap; line-height: 1.2; }
.btn:hover { background: var(--soft); border-color: #b9bbc2; }
.btn:disabled { opacity: .55; cursor: default; }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); text-transform: uppercase; letter-spacing: .05em; font-size: 12.5px; padding-top: 8px; padding-bottom: 8px; }
.btn.primary.sm { font-size: 11.5px; padding-top: 5px; padding-bottom: 5px; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { color: var(--danger); }
.btn.danger.solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: rgba(0, 0, 0, .05); }
.btn.sm { padding: 4px 8px; font-size: 12.5px; }
.btn.icon { padding: 6px; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 3px; overflow: hidden; background: var(--panel); }
.seg button { border: 0; background: transparent; padding: 6px 12px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; font-weight: 550; color: var(--muted); }
.seg button.on { background: #000; color: #fff; }
.seg svg { width: 15px; height: 15px; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.input, .field input, .field select, .field textarea, select.input {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: 3px; background: #fff; outline: none;
}
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: #000; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent); }
.field textarea { resize: vertical; min-height: 80px; }
.check { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.field input, .field select, .field textarea { min-width: 0; }
.span2 { grid-column: span 2; }
.span3 { grid-column: 1 / -1; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters .input { width: auto; min-width: 150px; padding: 6px 10px; }

/* ---------- Cards ---------- */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.card-body { padding: 16px; }
.card-body.tight { padding: 6px 0; }
.cols { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.cols-even { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.kpi { padding: 16px 18px; }
.kpi .label { color: var(--muted); font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; }
.kpi .value { font-family: var(--heading); font-size: 46px; line-height: .9; font-weight: 500; margin-top: 10px; }
.kpi { border-top: 3px solid #000; }
.kpi.kpi-accent { border-top-color: var(--accent); }
.kpi .hint { font-size: 12px; color: var(--faint); }
.kpi.kpi-alert { background: #fdf3f1; border-color: #f4cfc7; border-top-color: var(--danger); }
.kpi.kpi-alert .value { color: var(--danger); }

/* ---------- Tabellen ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; font-weight: 500; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--soft); text-transform: uppercase; letter-spacing: .05em; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.click { cursor: pointer; }
.table tr.click:hover td { background: var(--soft); }
.table tfoot td { font-weight: 600; background: var(--soft); border-top: 1px solid var(--border); }
.table-wrap { overflow-x: auto; }

/* ---------- Badges, Avatare ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--softer); color: var(--muted); }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; }
.badge.prio-hoch { background: #fde8e4; color: var(--danger); }
.badge.prio-niedrig { background: #eef3f7; color: #50606e; }
.avatar { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 700; flex: none; letter-spacing: .02em; }
.avatar.lg { width: 36px; height: 36px; font-size: 13px; }
.avatar.sm { width: 20px; height: 20px; font-size: 9px; }
.avatars { display: inline-flex; }
.avatars .avatar { box-shadow: 0 0 0 2px var(--panel); margin-left: -6px; }
.avatars .avatar:first-child { margin-left: 0; }
.status-select { width: auto; min-width: 140px; border: 0; border-radius: 999px; padding: 5px 30px 5px 12px; font-weight: 650; color: #fff; cursor: pointer; appearance: none; background-image: linear-gradient(45deg, transparent 50%, #fff 50%), linear-gradient(135deg, #fff 50%, transparent 50%); background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.status-select option { color: var(--text); background: #fff; }
.progress { height: 6px; border-radius: 99px; background: var(--softer); overflow: hidden; }
.progress > div { height: 100%; background: #8ea63a; border-radius: 99px; }
.progress.over > div { background: var(--danger); }
.progress.warn > div { background: var(--warn); }
.overdue { color: var(--danger); font-weight: 600; }
.soon { color: var(--warn); font-weight: 600; }

/* ---------- Board (Kanban) ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.col { background: #e7e7ea; border-radius: var(--radius); padding: 10px; min-height: 120px; transition: background .15s; }
.col.over { background: var(--accent-soft); outline: 2px dashed #8ea63a; outline-offset: -2px; }
.col-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 10px; font-weight: 650; }
.col-head .count { color: var(--muted); font-weight: 600; font-size: 12px; background: rgba(0,0,0,.06); border-radius: 99px; padding: 0 7px; }
.col-cards { display: flex; flex-direction: column; gap: 8px; }
.kcard { background: var(--panel); border: 1px solid var(--border); border-radius: 4px; padding: 10px 12px; box-shadow: var(--shadow); cursor: pointer; }
.kcard:hover { border-color: var(--border-strong); }
.kcard.dragging { opacity: .45; }
.kcard .title { font-weight: 600; margin: 2px 0 6px; word-break: break-word; }
.kcard .meta { display: flex; align-items: center; gap: 4px 10px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.kcard .meta > span { white-space: nowrap; display: inline-flex; align-items: center; gap: 3px; }
.kcard.done .title { text-decoration: line-through; color: var(--muted); }
.quickadd { width: 100%; border: 1px dashed var(--border-strong); background: rgba(255,255,255,.6); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; }
.quickadd:focus { outline: none; border-style: solid; border-color: #000; background: #fff; }

/* ---------- Projektkopf ---------- */
.phead { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 16px; }
.phead .num { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; margin-bottom: 18px; }
.fact { padding: 12px 16px; border-right: 1px solid var(--border); }
.fact:last-child { border-right: 0; }
.fact .label { font-size: 11px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 9px 14px; font-weight: 500; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a.on { color: var(--text); border-bottom-color: var(--accent); }
.tabs a.on:not(:hover) { border-bottom-color: color-mix(in srgb, var(--accent) 85%, #000); }
.tabs .n { font-size: 11.5px; color: var(--faint); margin-left: 4px; }
.here { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }

/* ---------- Aktivität ---------- */
.feed { display: flex; flex-direction: column; }
.feed-day { font-family: var(--heading); font-size: 19px; font-weight: 500; color: var(--text); letter-spacing: .02em; padding: 14px 0 4px; }
.feed-item { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--softer); }
.feed-item:last-child { border-bottom: 0; }
.feed-item .when { font-size: 12px; color: var(--faint); white-space: nowrap; }
.feed-item .ctx { font-size: 12px; color: var(--muted); }
.changes { margin-top: 4px; display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; color: var(--muted); }
.changes .from { text-decoration: line-through; color: var(--faint); }
.changes .arrow { color: var(--faint); margin: 0 4px; }
.changes .to { color: var(--text); font-weight: 550; }
.card-body .feed-item { padding-left: 0; }

/* ---------- Listen ---------- */
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 10px; padding: 9px 16px; border-bottom: 1px solid var(--softer); }
.li:last-child { border-bottom: 0; }
.li.click { cursor: pointer; }
.li.click:hover { background: var(--soft); }
.cb { width: 18px; height: 18px; border-radius: 3px; border: 1.5px solid var(--border-strong); display: grid; place-items: center; cursor: pointer; flex: none; background: #fff; }
.cb:hover { border-color: var(--ok); }
.cb.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.cb svg { width: 12px; height: 12px; }
.empty { padding: 28px 16px; text-align: center; color: var(--faint); }
.bar-row { display: grid; grid-template-columns: 120px 1fr 60px; gap: 10px; align-items: center; padding: 5px 0; font-size: 13px; }
.bar-track { height: 8px; background: var(--softer); border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; }
.stackbar { display: flex; height: 12px; border-radius: 2px; overflow: hidden; background: var(--softer); margin: 4px 0 14px; }
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; font-size: 13px; }
.legend a { display: flex; align-items: center; gap: 8px; }
.legend .dot { width: 9px; height: 9px; border-radius: 3px; }

/* ---------- Notizen, Dateien ---------- */
.note { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--softer); }
.note:last-child { border-bottom: 0; }
.dropzone { border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 26px; text-align: center; color: var(--muted); background: var(--soft); cursor: pointer; transition: all .15s; }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.fileicon { width: 40px; height: 40px; border-radius: 4px; background: var(--softer); display: grid; place-items: center; font-size: 10px; font-weight: 700; color: var(--muted); flex: none; overflow: hidden; text-transform: uppercase; }
.fileicon img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Timer ---------- */
.timer { display: inline-flex; align-items: center; gap: 8px; padding: 5px 6px 5px 12px; border-radius: 999px; background: #000; color: #fff; font-weight: 500; }
.timer .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 1.4s infinite; }
.timer .btn { padding: 3px 9px; border-radius: 99px; font-size: 12px; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

/* ---------- Modal, Toast ---------- */
.overlay { position: fixed; inset: 0; background: rgba(20, 18, 15, .45); display: grid; place-items: start center; padding: 6vh 16px; z-index: 100; overflow-y: auto; animation: fade .12s; }
.modal { background: var(--panel); border-radius: 8px; border-top: 4px solid var(--accent); box-shadow: var(--shadow-lg); width: min(640px, 100%); animation: pop .14s; }
.modal.wide { width: min(820px, 100%); }
.modal.narrow { width: min(440px, 100%); }
.modal.xwide { width: min(1240px, 100%); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px 6px; }
.modal-body { padding: 14px 20px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 20px 18px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.alert { padding: 10px 12px; border-radius: 8px; background: #fdecea; color: #8a2414; font-size: 13px; }
.alert.info { background: #eef4fb; color: #24496f; }
.alert.warn { background: #fff5e0; color: #7a5200; }
.toasts { position: fixed; left: 252px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 200; max-width: 380px; }
.toast { background: #000; color: #fff; padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow-lg); font-size: 13px; display: flex; gap: 10px; align-items: flex-start; animation: pop .15s; }
.toast.error { background: var(--danger); }
.toast .avatar { width: 22px; height: 22px; font-size: 9px; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--sidebar); background-image: radial-gradient(900px 420px at 15% -10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent); }
.login-wrap > div { width: min(400px, 100%); }
.login-wrap .login { border: 0; border-top: 4px solid var(--accent); width: 100%; }
.login-brand { display: flex; justify-content: center; margin-bottom: 26px; }
.login-brand img { height: 110px; width: auto; max-width: 320px; }
.login-brand-text { font-family: var(--heading); font-size: 44px; color: var(--sidebar-strong); line-height: 1; text-align: center; }
.login { width: min(400px, 100%); padding: 32px; }
.login .brand { color: var(--text); padding: 0 0 20px; font-size: 20px; }
.login .brand small { color: var(--muted); }
.login .brand-logo { height: 44px; max-width: 240px; }

.menu { position: absolute; background: var(--panel); border: 1px solid var(--border); border-radius: 4px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 200px; z-index: 50; }
.menu button, .menu a { display: flex; width: 100%; align-items: center; gap: 8px; padding: 8px 10px; border: 0; background: transparent; border-radius: 6px; cursor: pointer; text-align: left; color: var(--text); }
.menu button:hover, .menu a:hover { background: var(--bg); }
.menu svg { width: 16px; height: 16px; color: var(--muted); }
.rel { position: relative; }
.loading { padding: 40px; text-align: center; color: var(--faint); }
.color-input, .field input.color-input, .li input.color-input { width: 44px; height: 34px; padding: 2px; border: 1px solid var(--border-strong); border-radius: 3px; background: #fff; cursor: pointer; flex: none; }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .inv-editor { grid-template-columns: 1fr; }
  .cols, .cols-even { grid-template-columns: 1fr; }
}
/* Tablet (z. B. iPad quer/hoch): schmale Icon-Leiste statt Seitenleiste */
@media (min-width: 761px) and (max-width: 1200px) {
  .shell { grid-template-columns: 68px 1fr; }
  .sidebar { padding: 14px 8px; align-items: stretch; }
  .sidebar .brand { padding: 0 0 16px; justify-content: center; }
  .sidebar .brand > div, .sidebar .brand-logo-wrap, .sidebar .brand-mark { display: none; }
  .sidebar .brand-rail { display: block; }
  .nav a { justify-content: center; padding: 11px 0; }
  .nav a.active { box-shadow: inset 3px 0 0 var(--accent); }
  .nav span.lbl, .nav-section { display: none; }
  .online { align-items: center; margin-top: 14px; }
  .online-item { justify-content: center; }
  .online-item .ellipsis, .online-dot { display: none; }
  .usermenu { justify-content: center; padding: 6px 0; }
  .usermenu .grow { display: none; }
  .content, .topbar { padding-left: 20px; padding-right: 20px; }
}
/* Touch-Geräte: größere Bedienflächen, 16px-Eingaben (kein Auto-Zoom auf iPad/iPhone) */
@media (pointer: coarse) {
  .btn { min-height: 40px; }
  .btn.sm { min-height: 34px; }
  .btn.icon { min-width: 40px; justify-content: center; }
  input, select, textarea, .input { font-size: 16px; }
  .nav a { padding-top: 11px; padding-bottom: 11px; }
  .mp-edit { padding: 8px; }
  .tabs a { padding: 11px 14px; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 8px; }
  .sidebar .brand { padding: 4px 8px; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav span.lbl, .nav-section, .online, .sidebar-foot { display: none; }
  .content, .topbar { padding-left: 14px; padding-right: 14px; }
  .toasts { left: 12px; right: 12px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
}

/* ---------- Branding-Einstellungen ---------- */
.brand-preview { border-radius: var(--radius); padding: 14px; background: var(--sidebar); display: flex; flex-direction: column; gap: 8px; }
.brand-preview .nav a { pointer-events: none; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatch { width: 22px; height: 22px; border-radius: 6px; cursor: pointer; border: 1px solid rgba(0,0,0,.12); }
.logo-box { display: grid; place-items: center; min-height: 96px; border-radius: 4px; padding: 10px; border: 1px dashed var(--border-strong); }

/* ---------- Rechnungen ---------- */
.inv-total { background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 15px; padding: 8px 10px; margin: 6px -10px 0; border-radius: 2px; }
.inv-editor { grid-template-columns: minmax(0, 2.7fr) minmax(280px, 1fr); }
.inv-items { table-layout: fixed; }
.inv-items td { vertical-align: top; padding: 8px 5px; }
.inv-items td:last-child .btn.icon { padding: 4px; }
.inv-items th { padding: 8px 6px; }
.inv-items .input { padding: 6px 7px; }
.inv-items textarea.input { min-height: 30px; }
.inv-items td:first-child { padding-top: 14px; }
.inv-items td.right.tnum { padding-top: 14px; }
.settings-section { margin-bottom: 20px; }
.settings-section h3 { font-family: var(--heading); font-size: 21px; font-weight: 500; margin-bottom: 10px; }

/* ---------- Finanzen ---------- */
.liq-equation { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1.15fr; align-items: stretch; gap: 10px; margin-bottom: 20px; }
.liq-op { display: grid; place-items: center; font-family: var(--heading); font-size: 40px; color: var(--muted); }
.liq-result { background: #000; color: #fff; border-color: #000; border-top-color: var(--accent); }
.liq-result .label, .liq-result .hint { color: rgba(255,255,255,.7); }
.liq-result .value { color: var(--accent); }
.chart-wrap { position: relative; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: #ececef; stroke-width: 1; }
.chart .axis-zero { stroke: #b9bbc2; stroke-width: 1; }
.chart .tick { font-size: 11px; fill: var(--muted); font-family: 'Rubik', sans-serif; }
.chart .lbl { font-size: 12px; fill: var(--text); font-weight: 500; font-family: 'Rubik', sans-serif; paint-order: stroke; stroke: #fff; stroke-width: 3px; }
.chart .crosshair { stroke: var(--text); stroke-width: 1; opacity: .35; }
.chart rect:focus { outline: none; }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 6px; color: var(--muted); }
.chart-legend span, .chart-tip .row { display: inline-flex; align-items: center; gap: 6px; }
.key-line { display: inline-block; width: 14px; height: 2px; border-radius: 1px; }
.key-box { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.chart-tip { position: absolute; top: 24px; transform: translateX(-50%); background: #fff; border: 1px solid var(--border); border-radius: 6px; box-shadow: var(--shadow-lg); padding: 8px 10px; pointer-events: none; min-width: 190px; display: flex; flex-direction: column; gap: 3px; z-index: 5; }
.dropzone.big { padding: 34px 20px; background: #fff; border-width: 2px; }
.dropzone.big.over { background: var(--accent-soft); border-color: #8ea63a; color: var(--text); }
.incoming-split { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(360px, 1fr); gap: 18px; align-items: start; }
.incoming-preview { border: 1px solid var(--border); border-radius: 6px; overflow: auto; background: #f6f6f7; height: 72vh; }
.incoming-preview iframe { width: 100%; height: 100%; border: 0; display: block; }
.fixed-strip { display: flex; align-items: center; gap: 28px; padding: 12px 18px; margin: -6px 0 20px; color: var(--text); }
.fixed-strip .label { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; }
.fixed-strip b { font-size: 17px; }
.fixed-strip:hover { border-color: var(--border-strong); }
.fixed-strip > .grow { min-width: 240px; }
.kpis.kpis-3 { grid-template-columns: repeat(3, 1fr); }
.cols.fix-cols { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
@media (max-width: 1100px) { .cols.fix-cols { grid-template-columns: 1fr; } }
.badge-soft { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--softer); color: var(--muted); font-weight: 500; vertical-align: 1px; }
.table tr.dim td { color: var(--faint); }
.hbar { height: 8px; background: var(--softer); border-radius: 4px; margin-top: 4px; overflow: hidden; }
.hbar i { display: block; height: 100%; background: #f2a600; border-radius: 4px; }
@media (max-width: 1100px) {
  .fixed-strip { flex-wrap: wrap; gap: 14px 24px; }
  .liq-equation { grid-template-columns: 1fr 1fr; }
  .liq-op { display: none; }
  .incoming-split { grid-template-columns: 1fr; }
  .incoming-preview { height: 50vh; }
}

/* ---------- Messeplan ---------- */
.phase-dot { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; vertical-align: 0; }
.ph-setup { background: #f2a600; } .ph-handover { background: #1ea3e0; } .ph-event { background: #7ac943; } .ph-teardown { background: #b8323a; }
.form-section { display: flex; align-items: center; gap: 8px; font-family: var(--heading); font-size: 22px; line-height: 1; margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--border); }
.form-section .small { font-family: 'Rubik', sans-serif; font-size: 12px; }
.messe-band { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin: -6px 0 18px; border-left: 3px solid #7ac943; }
.phase-chips { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; font-size: 13px; }
.phase-chip { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.phase-chip i { width: 10px; height: 10px; border-radius: 2px; }
.phase-chip b { color: var(--text); font-weight: 500; }
.mp-head { flex-wrap: wrap; }
.mp-year button { padding: 6px 10px; }
.mp-year button.on { min-width: 64px; justify-content: center; font-variant-numeric: tabular-nums; }
.kpi { position: relative; }
.kpi-edit { position: absolute; top: 10px; right: 10px; }
.target-bar { height: 6px; border-radius: 3px; background: var(--softer); margin-top: 10px; overflow: hidden; }
.target-bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.chart .mp-now { fill: var(--accent); opacity: .16; }
.chart .tick-strong { fill: var(--text); font-weight: 600; }
.offer-key { background: repeating-linear-gradient(135deg, #b9bbc2 0 2px, #fff 2px 4px); border: 1px dashed #8b8d96; }
.mp-legend-head { flex-wrap: wrap; gap: 10px; }
.mp-months { display: flex; gap: 2px; padding: 8px 14px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.mp-months a { padding: 4px 10px; border-radius: 999px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.mp-months a:hover { background: var(--soft); color: var(--text); }
.mp-months a.on { background: #000; color: #fff; }
.mp-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.mp-month { min-width: 900px; scroll-margin-top: 70px; }
.mp-row { display: grid; grid-template-columns: minmax(170px, 250px) repeat(31, minmax(20px, 1fr)) 124px; align-items: stretch; min-width: 900px; border-bottom: 1px solid #eeeef0; }
.mp-label { grid-column: 1; grid-row: 1; padding: 6px 30px 6px 12px; min-width: 0; position: relative; border-right: 1px solid var(--border); background: var(--panel); position: sticky; left: 0; z-index: 3; }
.mp-rev { grid-column: 33; grid-row: 1; padding: 6px 12px; text-align: right; border-left: 1px solid var(--border); display: flex; flex-direction: column; justify-content: center; align-items: flex-end; background: var(--panel); }
.mp-day { border-right: 1px solid #f1f1f3; min-height: 44px; }
.mp-day.we { background: #f1f1f3; }
.mp-day.void, .mp-dh.void { background: repeating-linear-gradient(135deg, #f6f6f7 0 4px, #fff 4px 8px); }
.mp-day.today { background: color-mix(in srgb, var(--accent) 26%, #fff); }
.mp-head-row { background: var(--soft); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); position: sticky; top: 0; }
.mp-head-row .mp-label { background: var(--soft); display: flex; align-items: baseline; gap: 8px; }
.mp-head-row .mp-rev { background: var(--soft); text-transform: uppercase; letter-spacing: .05em; font-size: 10.5px; }
.mp-mname { font-family: var(--heading); font-size: 26px; line-height: 1; font-weight: 500; }
.mp-dh { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3px 0; line-height: 1.05; border-right: 1px solid #e6e6e9; }
.mp-dh b { font-size: 12px; font-weight: 500; }
.mp-dh small { font-size: 9.5px; color: var(--faint); }
.mp-dh.we { background: #e7e7ea; }
.mp-dh.today { background: var(--accent); }
.mp-dh.today small { color: #000; }
.mp-pname { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--text); }
.mp-pname:hover { text-decoration: underline; }
.mp-pname .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.mp-label .small { line-height: 1.3; }
.mp-edit { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--faint); padding: 4px; border-radius: 4px; cursor: pointer; display: grid; }
.mp-edit:hover { background: var(--soft); color: var(--text); }
.mp-seg { align-self: center; height: 24px; margin: 0 1px; border: 0; border-radius: 4px; padding: 0 6px; font: 500 11.5px/24px 'Rubik', sans-serif; text-align: left; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; z-index: 1; min-width: 0; }
.mp-seg span { display: block; overflow: hidden; text-overflow: ellipsis; }
.mp-seg.cut-l { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: 0; }
.mp-seg.cut-r { border-top-right-radius: 0; border-bottom-right-radius: 0; margin-right: 0; }
.mp-seg:hover { filter: brightness(1.06); box-shadow: 0 0 0 2px rgba(0,0,0,.18); }
.mp-seg:focus-visible { outline: 2px solid #000; outline-offset: 1px; }
.is-offer .mp-seg { opacity: .5; outline: 1px dashed rgba(0,0,0,.55); outline-offset: -1px; }
.is-offer .mp-pname { font-weight: 500; font-style: italic; }
.mp-nodates { align-self: center; justify-self: start; margin-left: 8px; border: 1px dashed var(--border-strong); background: #fff; color: var(--muted); font-size: 12px; padding: 3px 10px; border-radius: 999px; cursor: pointer; z-index: 1; }
.mp-nodates:hover { color: var(--text); border-color: var(--text); }
.mp-empty .mp-day { min-height: 30px; }
.mp-sum { background: #fbfbfc; border-bottom: 2px solid var(--border); }
.mp-sum .mp-label { background: #fbfbfc; font-weight: 600; }
.mp-sum .mp-rev { background: #fbfbfc; }
.mp-sum-days, .mp-total-days { grid-column: 2 / 33; grid-row: 1; display: flex; align-items: center; padding: 0 12px; }
.mp-total { background: #000; color: #fff; border: 0; }
.mp-total .mp-label, .mp-total .mp-rev { background: #000; color: #fff; padding-top: 12px; padding-bottom: 12px; }
.mp-total .mp-rev b { color: var(--accent); font-family: var(--heading); font-size: 26px; font-weight: 500; line-height: 1; }
.mp-total .muted { color: rgba(255,255,255,.65); }
.tiny { font-size: 11px; }
.narrow-only { display: none; }
.mp-pname { min-width: 0; }
@media (max-width: 1000px) {
  .wide-only { display: none; }
  .narrow-only { display: inline; }
  .mp-count { display: none; }
  .mp-total .mp-rev b { font-size: 20px; }
  .mp-sum .mp-label { font-size: 12px; }
  .mp-head > .grow { flex-basis: 100%; }
  .mp-row { grid-template-columns: 128px repeat(31, minmax(15px, 1fr)) 92px; min-width: 690px; }
  .mp-month { min-width: 690px; }
  .mp-label { padding: 6px 26px 6px 8px; }
  .mp-mname { font-size: 22px; }
  .mp-dh b { font-size: 11px; }
  .mp-dh small { font-size: 8.5px; }
  .mp-seg { padding: 0 3px; font-size: 10.5px; }
  .mp-rev { padding: 6px 8px; }
}
.warn-text { color: #b7791f; font-weight: 600; font-size: 12px; }
@media print {
  .sidebar, .topbar, .no-print, details, .mp-edit, .toasts, .overlay { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; max-width: none; }
  .card { box-shadow: none; }
  .mp-scroll { overflow: visible; }
  .mp-row, .mp-month { min-width: 0; }
  .mp-month { break-inside: avoid; }
  .mp-head-row { position: static; }
  .mp-label { position: static; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  @page { size: A4 landscape; margin: 10mm; }
}

/* ---------- Excel-Import ---------- */
.imp-summary { display: flex; flex-wrap: wrap; gap: 8px 28px; align-items: center; padding: 10px 14px; background: var(--soft); border: 1px solid var(--border); border-radius: 4px; margin-bottom: 12px; }
.imp-ok { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; color: #20642b; font-size: 12.5px; font-weight: 500; }
.imp-wrap { max-height: 62vh; overflow: auto; border: 1px solid var(--border); border-radius: 4px; }
.imp-table th { position: sticky; top: 0; z-index: 2; }
.imp-table td { padding: 6px 8px; vertical-align: top; }
.imp-table input:not([type=checkbox]), .imp-table select { width: 100%; min-width: 0; padding: 5px 7px; font-size: 13px; border: 1px solid var(--border); border-radius: 3px; background: #fff; }
.imp-table td:nth-child(3) { min-width: 150px; } .imp-table td:nth-child(4) { min-width: 190px; } .imp-table td:nth-child(5), .imp-table td:nth-child(6) { min-width: 110px; }
.imp-table td:nth-child(7) { min-width: 96px; } .imp-table td:nth-child(8) { min-width: 120px; }
.imp-dates { min-width: 210px; max-width: 260px; }
.imp-dates .phase-chip { display: inline-flex; margin: 0 8px 2px 0; font-size: 12px; }
.imp-note { font-size: 11.5px; color: #8a5a00; margin-top: 4px; line-height: 1.35; }
.imp-note svg { vertical-align: -2px; }
.imp-new { color: var(--accent-text); font-weight: 500; }
