/* Itolia Hub — Stylesheet */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: #1f2937;
  background: #f1f5f9;
}
#app { height: 100%; display: flex; flex-direction: column; }
button { font: inherit; cursor: pointer; }
input, textarea, select { font: inherit; }
a { color: var(--brand-primary, #e6500f); }

/* ---- Topbar ---- */
.topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px; background: #1e1f1f; color: #fff;
  flex-shrink: 0; min-height: 48px;
}
.topbar .brand {
  font-weight: 700; font-size: 16px; color: #fff; text-decoration: none;
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
}
.topbar .spacer { flex: 1; }
.topbar-btn {
  background: rgba(255,255,255,.12); color: #fff; border: none; border-radius: 6px;
  padding: 7px 12px; white-space: nowrap;
}
.topbar-btn:hover { background: rgba(255,255,255,.22); }
.search-wrap { position: relative; }
.search-wrap input {
  background: rgba(255,255,255,.14); border: 1px solid transparent; color: #fff;
  border-radius: 6px; padding: 7px 10px; width: 230px; outline: none;
}
.search-wrap input::placeholder { color: #cbd5e1; }
.search-wrap input:focus { background: #fff; color: #1f2937; }
.search-results {
  position: absolute; top: 40px; right: 0; width: 380px; max-height: 420px; overflow: auto;
  background: #fff; color: #1f2937; border-radius: 8px; box-shadow: 0 8px 30px rgba(0,0,0,.25);
  z-index: 60; padding: 6px;
}
.search-hit { padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.search-hit:hover { background: #f1f5f9; }
.search-hit .hit-title { font-weight: 600; }
.search-hit .hit-meta { font-size: 12px; color: #64748b; }
.search-empty { padding: 12px; color: #64748b; }

/* ---- Login ---- */
.login-wrap {
  flex: 1; display: flex; align-items: center; justify-content: center;
  background: var(--login-bg, linear-gradient(135deg, #1e1f1f 0%, var(--brand-primary, #e6500f) 70%, var(--brand-accent, #f07d00) 100%));
}
.login-box {
  background: #fff; padding: 34px; border-radius: 12px; width: 360px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.login-logo { display: block; width: 250px; max-width: 100%; margin: 0 auto 6px; }
.login-box h1 { margin: 0 0 4px; font-size: 22px; }
.login-box .sub { color: #64748b; margin: 0 0 20px; }
.login-box label { display: block; margin: 12px 0 4px; font-weight: 600; font-size: 13px; }
.login-box input {
  width: 100%; padding: 10px; border: 1px solid #cbd5e1; border-radius: 8px;
}
.login-box button {
  width: 100%; margin-top: 20px; padding: 11px; border: none; border-radius: 8px;
  background: var(--brand-primary, #e6500f); color: #fff; font-weight: 600;
}
.login-box button:hover { background: var(--brand-primary-dark, #c44a0c); }
.login-error { color: #dc2626; margin-top: 12px; min-height: 18px; }
.remember-row {
  display: flex !important; align-items: center; gap: 8px;
  font-weight: 400 !important; color: #475569; cursor: pointer; margin-top: 14px !important;
}
.remember-row input { width: auto; }

/* ---- Home (Board-Übersicht) ---- */
.home { flex: 1; overflow: auto; padding: 26px; }
.home h2 { margin: 6px 0 14px; font-size: 17px; color: #334155; }
.board-grid { display: flex; flex-wrap: wrap; gap: 14px; }
.board-tile {
  width: 210px; height: 96px; border-radius: 10px; color: #fff; padding: 12px;
  display: flex; flex-direction: column; justify-content: space-between;
  cursor: pointer; border: none; text-align: left;
  box-shadow: 0 2px 6px rgba(0,0,0,.15); transition: transform .08s;
}
.board-tile:hover { transform: translateY(-2px); }
.board-tile .tile-name { font-weight: 700; font-size: 15px; overflow: hidden; }
.board-tile .tile-icon { font-size: 20px; }
.board-tile.archived { opacity: .55; }
.board-tile.new-tile {
  background: #e2e8f0; color: #475569; align-items: center; justify-content: center;
  display: flex; font-weight: 600; border: 2px dashed #94a3b8;
}
.board-tile.new-tile:hover { background: #cbd5e1; }

/* ---- Board-Ansicht ---- */
.board-view { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.board-head {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; color: #fff;
  flex-shrink: 0;
}
.board-head h1 { margin: 0; font-size: 17px; display: flex; gap: 8px; align-items: center; }
.board-head .archived-badge {
  background: rgba(0,0,0,.35); padding: 3px 8px; border-radius: 6px; font-size: 12px;
}
.board-head-btn {
  background: rgba(255,255,255,.2); color: #fff; border: none; border-radius: 6px;
  padding: 6px 11px;
}
.board-head-btn:hover { background: rgba(255,255,255,.32); }
/* Zurück-Knopf auf hellen Seiten — gleiche Größe wie .board-head-btn im Board-Kopf */
.back-btn {
  background: #eef2f7; color: #1e1f1f; border: 1px solid #cbd5e1; border-radius: 6px;
  padding: 6px 11px; font-size: 14px; cursor: pointer; white-space: nowrap;
  flex-shrink: 0;
}
.back-btn:hover { background: #e2e8f0; }
.lanes {
  flex: 1; display: flex; align-items: flex-start; gap: 12px;
  overflow-x: auto; overflow-y: hidden; padding: 4px 14px 14px;
}
.lane {
  background: #e8edf3; border-radius: 10px; width: 276px; flex-shrink: 0;
  display: flex; flex-direction: column; max-height: 100%;
}
.lane-header {
  display: flex; align-items: center; gap: 6px; padding: 10px 10px 6px; cursor: grab;
}
.lane-header .lane-name { font-weight: 700; flex: 1; padding: 2px 6px; border-radius: 4px; }
.lane-header .lane-name:hover { background: #d7dee7; }
.lane-header input {
  flex: 1; font-weight: 700; border: 2px solid var(--brand-primary, #e6500f); border-radius: 4px; padding: 1px 4px;
}
.lane-count { color: #64748b; font-size: 12px; }
.lane-menu-btn { border: none; background: none; color: #64748b; border-radius: 4px; padding: 2px 7px; font-size: 16px; }
.lane-menu-btn:hover { background: #d7dee7; }
.cards { padding: 4px 8px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; min-height: 8px; }
.card {
  background: #fff; border-radius: 8px; padding: 9px 10px; box-shadow: 0 1px 2px rgba(0,0,0,.15);
  cursor: pointer; border: none; text-align: left; display: block; width: 100%;
}
.card:hover { background: #f8fafc; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
/* Karten in einer Erledigt-Lane: leichtes Grün (weiß, sobald sie zurückwandern) */
.card.card-done { background: #e9f8ef; }
.card.card-done:hover { background: #dcf2e6; }
.sortable-ghost { opacity: .4; }
.card .card-labels { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 5px; }
.card .card-label-chip { height: 8px; width: 36px; border-radius: 4px; }
.card .card-title { font-size: 14px; }
.card .card-badges {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; color: #64748b; font-size: 12px;
  align-items: center;
}
.badge { display: inline-flex; align-items: center; gap: 3px; }
.badge.ticket-no { color: #94a3b8; font-family: ui-monospace, Consolas, monospace; }
.badge.prio { color: #fff; padding: 2px 7px; border-radius: 5px; font-size: 11px; font-weight: 700; }
.view-controls { display: inline-flex; gap: 6px; }
.head-select {
  border: none; border-radius: 6px; padding: 6px 8px; max-width: 190px;
  background: rgba(255,255,255,.2); color: #fff; cursor: pointer;
}
.head-select option { color: #1f2937; background: #fff; }
.badge.due { padding: 2px 6px; border-radius: 5px; }
.badge.due.overdue { background: #dc2626; color: #fff; }
.badge.due.due-today { background: #f59e0b; color: #fff; }
.badge.checklist-done { color: #16a34a; }
.avatars { display: flex; margin-left: auto; }
.avatar {
  width: 24px; height: 24px; border-radius: 50%; background: var(--brand-primary, #e6500f); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 11px;
  font-weight: 700; margin-left: -5px; border: 2px solid #fff;
}
.add-card-btn, .add-lane-btn {
  margin: 4px 8px 10px; padding: 7px 9px; border: none; background: none; border-radius: 6px;
  color: #64748b; text-align: left;
}
.add-card-btn:hover, .add-lane-btn:hover { background: #d7dee7; color: #1f2937; }
.add-lane {
  background: rgba(255,255,255,.35); border-radius: 10px; width: 276px; flex-shrink: 0;
}
.add-lane .add-lane-btn { margin: 6px; width: calc(100% - 12px); }
.inline-add { padding: 8px; }
.inline-add textarea, .inline-add input {
  width: 100%; border: 2px solid var(--brand-primary, #e6500f); border-radius: 6px; padding: 7px; resize: none;
}
.inline-add .row { display: flex; gap: 8px; margin-top: 6px; }

/* ---- Buttons ---- */
.btn {
  border: none; border-radius: 6px; padding: 7px 13px; background: #e2e8f0; color: #1f2937;
}
.btn:hover { background: #cbd5e1; }
.btn.primary { background: var(--brand-primary, #e6500f); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--brand-primary-dark, #c44a0c); }
.btn.danger { background: #fee2e2; color: #b91c1c; }
.btn.danger:hover { background: #fecaca; }
.btn.ghost { background: none; color: #64748b; }
.btn.ghost:hover { background: #e2e8f0; color: #1f2937; }
.btn.small { padding: 4px 9px; font-size: 13px; }

/* ---- Modals ---- */
.overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.6); z-index: 40;
  display: flex; justify-content: center; align-items: flex-start; padding: 44px 16px;
  overflow-y: auto;
}
.modal {
  background: #f1f5f9; border-radius: 12px; width: 100%; max-width: 760px;
  box-shadow: 0 24px 70px rgba(0,0,0,.4); padding: 20px 24px 24px; position: relative;
}
.modal.narrow { max-width: 520px; }
.modal h2 { margin: 0 0 4px; font-size: 19px; padding-right: 30px; }
.modal .close-x {
  position: absolute; top: 12px; right: 12px; border: none; background: none; font-size: 21px;
  color: #64748b; border-radius: 6px; width: 32px; height: 32px;
}
.modal .close-x:hover { background: #e2e8f0; }
.modal h3 { font-size: 14px; color: #334155; margin: 20px 0 8px; display: flex; align-items: center; gap: 8px; }
.modal h3 .h-action { margin-left: auto; }
.card-title-input {
  width: 100%; font-size: 19px; font-weight: 700; border: 2px solid transparent;
  background: none; border-radius: 6px; padding: 4px 6px; margin-left: -6px;
}
.card-title-input:hover { background: #e8edf3; }
.card-title-input:focus { border-color: var(--brand-primary, #e6500f); background: #fff; outline: none; }
.card-meta-line { color: #64748b; font-size: 12px; margin: 2px 0 0 0; }
.meta-grid { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 14px; }
.meta-block .meta-label { font-size: 11px; font-weight: 700; color: #64748b; text-transform: uppercase; margin-bottom: 5px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.label-chip {
  color: #fff; border-radius: 5px; padding: 4px 10px; font-size: 12px; font-weight: 600;
  border: none;
}
.chip-add {
  border: none; background: #e2e8f0; border-radius: 5px; padding: 4px 10px; color: #475569;
}
.chip-add:hover { background: #cbd5e1; }
.due-input { border: 1px solid #cbd5e1; border-radius: 6px; padding: 5px 8px; }
.markdown-body { background: #fff; border-radius: 8px; padding: 12px 14px; }
.markdown-body.clickable { cursor: pointer; }
.markdown-body.clickable:hover { background: #f8fafc; }
.markdown-body .placeholder { color: #94a3b8; }
.markdown-body p:first-child, .markdown-body h1:first-child, .markdown-body h2:first-child,
.markdown-body h3:first-child, .markdown-body ul:first-child { margin-top: 0; }
.markdown-body p:last-child, .markdown-body ul:last-child { margin-bottom: 0; }
.markdown-body pre { background: #f1f5f9; padding: 8px; border-radius: 6px; overflow-x: auto; }
.markdown-body code { background: #f1f5f9; padding: 1px 4px; border-radius: 4px; }
.desc-edit textarea {
  width: 100%; min-height: 130px; border: 2px solid var(--brand-primary, #e6500f); border-radius: 8px; padding: 10px;
}
.edit-row { display: flex; gap: 8px; margin-top: 8px; }

/* Checklisten */
.checklist { background: #fff; border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.checklist-head { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.checklist-head .cl-title { flex: 1; }
.progress-wrap { display: flex; align-items: center; gap: 8px; margin: 7px 0; }
.progress-pct { font-size: 11px; color: #64748b; width: 32px; }
.progress-bar { flex: 1; height: 8px; background: #e2e8f0; border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--brand-primary, #e6500f); transition: width .2s; }
.progress-fill.complete { background: #16a34a; }
.cl-item { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.cl-item input[type=checkbox] { width: 16px; height: 16px; }
.cl-item .cl-text { flex: 1; }
.cl-item .cl-text.done { text-decoration: line-through; color: #94a3b8; }
.cl-item .btn { visibility: hidden; }
.cl-item:hover .btn { visibility: visible; }
.cl-add-row { display: flex; gap: 8px; margin-top: 6px; }
.cl-add-row input { flex: 1; border: 1px solid #cbd5e1; border-radius: 6px; padding: 6px 8px; }

/* Kommentare */
.comment { background: #fff; border-radius: 8px; padding: 9px 12px; margin-bottom: 8px; }
.comment .c-head { display: flex; gap: 8px; align-items: baseline; margin-bottom: 3px; }
.comment .c-author { font-weight: 700; }
.comment .c-time { color: #94a3b8; font-size: 12px; }
.comment .c-del { margin-left: auto; }
.comment-add textarea {
  width: 100%; min-height: 60px; border: 1px solid #cbd5e1; border-radius: 8px; padding: 9px;
}
.comment-add textarea:focus { border-color: var(--brand-primary, #e6500f); outline: none; }

/* Anhänge */
.attachment { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 8px; padding: 8px 12px; margin-bottom: 6px; }
.attachment .a-name { font-weight: 600; }
.attachment .a-meta { color: #94a3b8; font-size: 12px; }
.attachment .a-del { margin-left: auto; }

/* Popover (Label-/Mitglieder-Auswahl) */
.popover {
  position: absolute; background: #fff; border-radius: 10px; box-shadow: 0 8px 30px rgba(0,0,0,.3);
  padding: 12px; z-index: 55; width: 280px;
}
.popover h4 { margin: 0 0 10px; font-size: 13px; text-align: center; color: #334155; }
.pop-row { display: flex; align-items: center; gap: 8px; padding: 4px 2px; border-radius: 6px; }
.pop-row:hover { background: #f1f5f9; }
.pop-row label { flex: 1; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.pop-row .label-chip { flex: 1; text-align: left; cursor: pointer; }
.pop-add-row { display: flex; gap: 6px; margin-top: 10px; }
.pop-add-row input[type=text] { flex: 1; border: 1px solid #cbd5e1; border-radius: 6px; padding: 5px 8px; min-width: 0; }
.pop-add-row input[type=color] { width: 34px; height: 30px; border: 1px solid #cbd5e1; border-radius: 6px; padding: 1px; }

/* Tabellen (Benutzerverwaltung) */
table.data { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; }
table.data th, table.data td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #e8edf3; }
table.data th { background: #f8fafc; font-size: 12px; color: #64748b; text-transform: uppercase; }
table.data tr:last-child td { border-bottom: none; }
.role-pill { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: #e0e7ff; color: #3730a3; font-weight: 700; }
.role-pill.member { background: #e2e8f0; color: #475569; }
.inactive-pill { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: #fee2e2; color: #b91c1c; font-weight: 700; }
.policy-box {
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px;
  padding: 9px 12px; margin-top: 8px; font-size: 12px; color: #475569;
}
.policy-list { margin: 5px 0 0; padding-left: 18px; }
.policy-list li { margin: 2px 0; }
.pw-note {
  background: #fef9c3; border: 1px solid #fde047; padding: 10px 12px; border-radius: 8px;
  margin: 10px 0; font-family: ui-monospace, Consolas, monospace;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.form-grid label { font-size: 12px; font-weight: 700; color: #475569; display: block; margin-bottom: 3px; }
.form-grid input, .form-grid select { width: 100%; border: 1px solid #cbd5e1; border-radius: 6px; padding: 7px 9px; }
.form-row { margin-top: 12px; }
.form-row label { font-size: 12px; font-weight: 700; color: #475569; display: block; margin-bottom: 3px; }
.form-row input { width: 100%; border: 1px solid #cbd5e1; border-radius: 6px; padding: 7px 9px; }

/* Farb-Auswahl */
.swatches { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }
.swatch { width: 34px; height: 26px; border-radius: 6px; border: 2px solid transparent; padding: 0; }
.swatch.selected { border-color: #1e1f1f; }

/* Aktivität */
.activity-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: 360px; background: #fff; z-index: 45;
  box-shadow: -8px 0 30px rgba(0,0,0,.2); display: flex; flex-direction: column;
}
.activity-panel .panel-head {
  display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid #e2e8f0;
  font-weight: 700;
}
.activity-panel .panel-head button { margin-left: auto; }
.activity-list { flex: 1; overflow-y: auto; padding: 10px 16px; }
.activity-entry { padding: 8px 0; border-bottom: 1px solid #f1f5f9; font-size: 13px; }
.activity-entry .a-time { color: #94a3b8; font-size: 12px; }

/* Toasts */
#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 100; }
.toast {
  background: #1e1f1f; color: #fff; padding: 10px 18px; border-radius: 8px; margin-top: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,.3); animation: toast-in .18s ease-out;
}
.toast.error { background: #b91c1c; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px);} to { opacity: 1; } }

/* Kleinkram */
.muted { color: #64748b; }
.hidden { display: none !important; }
.menu {
  position: absolute; background: #fff; border-radius: 8px; box-shadow: 0 8px 30px rgba(0,0,0,.3);
  z-index: 55; min-width: 180px; padding: 5px;
}
.menu button { display: block; width: 100%; text-align: left; border: none; background: none; padding: 8px 10px; border-radius: 6px; }
.menu button:hover { background: #f1f5f9; }
.menu button.danger { color: #b91c1c; }

/* ---- Marke ---- */
.brand-logo {
  background: #fff; border-radius: 6px; width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
}
.brand-logo img { width: 20px; height: 25px; }
.login-footer { margin-top: 18px; text-align: center; font-size: 13px; color: #94a3b8; }
.login-footer a { color: #64748b; text-decoration: none; }
.login-footer a:hover { color: var(--brand-primary, #e6500f); }

/* ---- Projekt-Board-Navigation ---- */
.board-body { flex: 1; display: flex; min-height: 0; }
.board-body .lanes { flex: 1; }
.board-sidebar {
  width: 216px; flex-shrink: 0; padding: 8px 10px 14px 14px;
  display: flex; flex-direction: column; gap: 4px; overflow-y: auto;
}
.sidebar-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  color: rgba(255,255,255,.75); padding: 4px 8px 6px;
}
.sidebar-item {
  border: none; text-align: left; border-radius: 7px; padding: 8px 10px;
  background: rgba(255,255,255,.14); color: #fff; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-item:hover { background: rgba(255,255,255,.28); }
.sidebar-item.active { background: #fff; color: #1f2937; }
.sidebar-item.add { background: none; color: rgba(255,255,255,.8); font-weight: 400; }
.sidebar-item.add:hover { background: rgba(255,255,255,.18); color: #fff; }
.sidebar-spacer { flex: 1; min-height: 12px; }
.projects-tile { background: linear-gradient(135deg, #475569, #1e293b) !important; }

/* ---- Kunden-Struktur (Startseite) ---- */
.home-actions { margin-bottom: 20px; }
.customer-section { margin-bottom: 30px; }
.customer-head {
  display: flex; align-items: center; gap: 10px;
  margin: 22px 0 12px; font-size: 17px; color: #334155;
}
.archive-head { margin-top: 34px; }
.tile-foot { display: flex; align-items: center; gap: 8px; }
.tile-badge {
  background: rgba(255,255,255,.25); border-radius: 5px; padding: 2px 8px;
  font-size: 11px; font-weight: 700;
}
.tickets-tile { outline: 2px solid rgba(255,255,255,.5); outline-offset: -4px; }

/* ---- Ticket-Listen (Übersicht) ---- */
.ticket-list {
  background: #fff; border-radius: 10px; padding: 6px 10px; margin-top: 10px;
  max-width: 700px; box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.ticket-list-head { font-size: 12px; font-weight: 700; color: #64748b; padding: 6px 4px 2px; text-transform: uppercase; }
.ticket-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 6px;
  border-bottom: 1px solid #f1f5f9; cursor: pointer; border-radius: 6px;
}
.ticket-row:last-child { border-bottom: none; }
.ticket-row:hover { background: #f8fafc; }
.ticket-no-cell { color: #94a3b8; font-family: ui-monospace, Consolas, monospace; font-size: 12px; min-width: 34px; }
.ticket-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-pill { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 10px; white-space: nowrap; }
.status-pill.open { background: color-mix(in srgb, var(--brand-primary, #e6500f) 15%, white); color: var(--brand-primary-dark, #c2410c); }
.status-pill.work { background: #dbeafe; color: #1d4ed8; }
.status-pill.done { background: #dcfce7; color: #15803d; }

/* ---- Sonstiges ---- */
.private-toggle { display: flex; align-items: center; gap: 6px; margin-top: 7px; font-size: 13px; color: #475569; cursor: pointer; }
.pop-group { font-size: 11px; font-weight: 700; color: #94a3b8; text-transform: uppercase; margin: 10px 0 3px; }
.popover.wide { width: 320px; max-height: 60vh; overflow-y: auto; }
.swatch.emoji { background: #f1f5f9; font-size: 16px; line-height: 1; }
.emoji-row { margin-top: 6px; }

/* ---- Zeiterfassung (Admin) ---- */
.timer-chip {
  display: inline-flex; align-items: center; gap: 7px; margin-left: 10px;
  background: var(--brand-primary, #e6500f); border-radius: 6px; padding: 4px 10px; font-size: 13px;
  max-width: 340px;
}
.timer-time { font-family: ui-monospace, Consolas, monospace; font-weight: 700; }
.timer-subject {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer;
  max-width: 200px;
}
.timer-chip.timer-warn { background: #dc2626; animation: timer-pulse 1.6s ease-in-out infinite; }
@keyframes timer-pulse { 50% { opacity: .7; } }
.timer-stop { border: none; background: rgba(0,0,0,.25); color: #fff; border-radius: 4px; padding: 1px 6px; }
.timer-stop:hover { background: rgba(0,0,0,.45); }
.admin-hint { font-weight: 400; font-size: 11px; }
.time-list { display: flex; flex-direction: column; gap: 4px; }
.time-row {
  display: flex; align-items: center; gap: 10px; background: #fff;
  border-radius: 8px; padding: 7px 11px; font-size: 13px;
}
.time-row .t-date { color: #64748b; min-width: 74px; }
.time-row .t-range { font-family: ui-monospace, Consolas, monospace; min-width: 92px; }
.time-row .t-dur { font-weight: 700; min-width: 44px; }
.time-row .t-subject { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.billed-pill {
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px;
  background: #dcfce7; color: #15803d; white-space: nowrap;
}
.manual-time { background: #fff; border-radius: 8px; padding: 12px; margin-bottom: 8px; }
.manual-time input { width: 100%; border: 1px solid #cbd5e1; border-radius: 6px; padding: 6px 8px; }
.time-filter { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.time-filter label { font-size: 12px; font-weight: 700; color: #475569; display: block; margin-bottom: 3px; }
.time-filter select, .time-filter input { border: 1px solid #cbd5e1; border-radius: 6px; padding: 6px 9px; }

/* ---- Topbar-Menü (mobil) ---- */
.mobile-only { display: none; }
.menu-user {
  padding: 8px 10px 6px; font-weight: 700; color: #64748b; font-size: 12px;
  border-bottom: 1px solid #f1f5f9; margin-bottom: 4px;
}

/* ---- Schnelleintrag (FAB) ---- */
.fab {
  position: fixed; right: 20px; bottom: 20px; width: 56px; height: 56px;
  border-radius: 50%; border: none; background: var(--brand-primary, #e6500f); color: #fff;
  font-size: 30px; line-height: 1; box-shadow: 0 6px 20px rgba(0,0,0,.35); z-index: 30;
}
.fab:hover { background: var(--brand-primary-dark, #c44a0c); transform: scale(1.05); }

/* ---- Breite Dashboards ---- */
.modal.wide { max-width: 1000px; }
.form-row textarea, .form-row select {
  width: 100%; border: 1px solid #cbd5e1; border-radius: 6px; padding: 8px 9px;
}
.quick-select { width: 100%; }

/* ---- Kundendokumente ---- */
.docs-tile { background: linear-gradient(135deg, #0f766e, #134e4a) !important; }
.folder-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 14px; }
.folder-chip {
  border: none; border-radius: 18px; padding: 8px 15px; background: #e2e8f0;
  color: #334155; font-weight: 600;
}
.folder-chip:hover { background: #cbd5e1; }
.folder-chip.active { background: var(--brand-primary, #e6500f); color: #fff; }
.docs-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 4px 0 12px; }
.docs-bar input[type=search] {
  flex: 1; min-width: 180px; border: 1px solid #cbd5e1; border-radius: 6px; padding: 7px 9px;
}
.docs-list { padding: 4px 10px; }
.doc-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 6px;
  border-bottom: 1px solid #f1f5f9;
}
.doc-row:last-child { border-bottom: none; }
.doc-icon { font-size: 18px; }
.doc-main { flex: 1; min-width: 0; }
.doc-name { font-weight: 600; color: #1f2937; text-decoration: none; word-break: break-all; }
.doc-name:hover { color: var(--brand-primary, #e6500f); }
.doc-meta { font-size: 12px; color: #94a3b8; }
.doc-comment { font-size: 13px; color: #475569; margin: 1px 0; }
.doc-comment-in {
  flex: 1; min-width: 180px; border: 1px solid #cbd5e1; border-radius: 6px; padding: 7px 9px;
}

/* ---- Angebote ---- */
.offer-new {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  background: #fff; border-radius: 8px; padding: 10px 12px; margin: 4px 0 12px;
}
.offer-new label { font-size: 12px; font-weight: 700; color: #475569; }
.offer-new select { border: 1px solid #cbd5e1; border-radius: 6px; padding: 7px 9px; }
.ai-box {
  background: color-mix(in srgb, var(--brand-primary, #e6500f) 7%, white); border: 1px solid color-mix(in srgb, var(--brand-primary, #e6500f) 30%, white); border-radius: 8px;
  padding: 10px 12px; margin-top: 12px;
}
.voice-btn.recording {
  background: #dc2626; color: #fff;
  animation: timer-pulse 1.6s ease-in-out infinite;
}
.voice-wrap { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.voice-status { font-size: 13px; font-weight: 600; color: var(--brand-primary-dark, #c2410c); }
/* Während der Aufnahme den KI-Hinweistext ausblenden — nur der Status zählt */
.voice-wrap.recording ~ .muted { display: none; }
.offer-positions { display: flex; flex-direction: column; gap: 8px; }
.offer-pos { background: #fff; border-radius: 8px; padding: 9px 11px; }
.offer-pos input { border: 1px solid #cbd5e1; border-radius: 6px; padding: 6px 8px; }
/* Beschreibung: mehrzeilig, am Griff größer ziehbar (Aufzählungen mit "- ") */
.offer-pos textarea.pos-desc {
  border: 1px solid #cbd5e1; border-radius: 6px; padding: 6px 8px;
  width: 100%; resize: vertical; min-height: 48px; font: inherit;
}
/* Angebotskopf: Nummer/Bearbeiter/Datum/Gültig bis/Steuersatz nebeneinander */
.offer-head-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0 14px;
}
.pos-row1 { display: flex; gap: 8px; align-items: center; }
.pos-no { color: #94a3b8; font-size: 12px; min-width: 18px; }
.pos-row1 input { flex: 1; font-weight: 600; min-width: 0; }
.pos-row2 { margin-top: 6px; }
.pos-row2 input { width: 100%; }
.pos-row3 { display: flex; gap: 6px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.pos-row3 label { font-size: 11px; color: #64748b; font-weight: 700; }
.pos-row3 input { width: 92px; }
.pos-sum { margin-left: auto; font-weight: 700; }
.offer-totals {
  background: #fff; border-radius: 8px; padding: 10px 14px; margin-top: 10px;
  display: flex; flex-direction: column; gap: 2px; align-items: flex-end;
}
.article-results { max-height: 45vh; overflow-y: auto; margin-top: 8px; }
.popover.wide input[type=search], .popover.wide textarea {
  width: 100%; border: 1px solid #cbd5e1; border-radius: 6px; padding: 7px 9px;
}
.article-hit {
  display: block; width: 100%; text-align: left; border: none; background: none;
  padding: 7px 8px; border-radius: 6px;
}
.article-hit:hover { background: #f1f5f9; }

/* ---- Artikelverwaltung ---- */
.article-list {
  display: flex; flex-direction: column; gap: 4px; max-height: 50vh; overflow-y: auto;
  background: #fff; border-radius: 8px; padding: 8px 12px;
}
.article-row { display: flex; gap: 6px; align-items: center; }
.article-row.inactive { opacity: .5; }
.art-no {
  font-family: ui-monospace, Consolas, monospace; font-size: 11px; color: #64748b;
  width: 135px; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.article-row input { border: 1px solid #e2e8f0; border-radius: 6px; padding: 5px 7px; }
.art-name { flex: 1; min-width: 130px; }
.art-price { width: 92px; text-align: right; }
.art-unit { width: 72px; }

/* ---- Zeiten: Auswertung je Kunde ---- */
.cust-summary {
  background: #fff; border-radius: 10px; padding: 6px 12px; margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.cust-summary-row {
  display: flex; gap: 12px; align-items: center; padding: 8px 2px;
  border-bottom: 1px solid #f1f5f9; font-size: 13px;
}
.cust-summary-row:last-child { border-bottom: none; }
.cs-name { flex: 1; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-open { color: var(--brand-primary-dark, #c2410c); font-weight: 600; }
.cs-total { font-weight: 700; min-width: 70px; text-align: right; }

/* ---- Chat ---- */
.chat-badge {
  background: #dc2626; color: #fff; border-radius: 10px; font-size: 11px;
  font-weight: 700; padding: 1px 6px; margin-left: 4px; display: inline-block;
}
.chat-panel { display: flex; flex-direction: column; }
.chat-panel .panel-head { gap: 8px; }
.chat-search-wrap { padding: 8px 10px 0; }
.chat-search {
  width: 100%; border: 1px solid #cbd5e1; border-radius: 8px; padding: 8px 10px;
}
.chat-search:focus { border-color: var(--brand-primary, #e6500f); outline: none; }
.chat-contacts { flex: 1; overflow-y: auto; padding: 8px; }
.chat-contact {
  display: flex; gap: 10px; align-items: center; width: 100%; border: none;
  background: none; text-align: left; padding: 10px 8px; border-radius: 8px;
}
.chat-contact:hover { background: #f1f5f9; }
.cc-main { flex: 1; min-width: 0; }
.cc-name { font-weight: 600; }
.cc-last {
  font-size: 12px; color: #94a3b8; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-msgs {
  flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column;
  gap: 8px; background: #f8fafc;
}
.chat-msg {
  max-width: 80%; align-self: flex-start; background: #fff;
  border-radius: 12px 12px 12px 4px; padding: 8px 11px;
  box-shadow: 0 1px 2px rgba(0,0,0,.12);
}
.chat-msg.mine {
  align-self: flex-end; background: #ffe3d5; border-radius: 12px 12px 4px 12px;
}
.chat-text { white-space: pre-wrap; word-break: break-word; font-size: 14px; }
.chat-img { max-width: 100%; max-height: 260px; border-radius: 8px; display: block; }
.chat-msgs.drop-target { outline: 3px dashed var(--brand-primary, #e6500f); outline-offset: -8px; }
.chat-file {
  display: inline-block; font-weight: 600; font-size: 13px; color: #1f2937;
  text-decoration: none; word-break: break-all;
}
.chat-file:hover { color: var(--brand-primary, #e6500f); }
.chat-msg { position: relative; }
.chat-del {
  position: absolute; top: -8px; right: -8px; display: none;
  width: 22px; height: 22px; border: none; border-radius: 50%;
  background: #64748b; color: #fff; font-size: 11px; line-height: 1;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.chat-msg:hover .chat-del { display: inline-flex; align-items: center; justify-content: center; }
.chat-del:hover { background: #dc2626; }
.chat-pending {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border-top: 1px solid #e2e8f0; background: color-mix(in srgb, var(--brand-primary, #e6500f) 7%, white);
}
.chat-pending-thumb {
  width: 44px; height: 44px; object-fit: cover; border-radius: 6px; flex-shrink: 0;
}
.chat-pending-thumb.pdf {
  display: inline-flex; align-items: center; justify-content: center;
  background: #f1f5f9; font-size: 20px;
}
.chat-pending-name {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; font-size: 13px; font-weight: 600;
}
.chat-time { font-size: 10px; color: #94a3b8; margin-top: 2px; text-align: right; }
.chat-input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #e2e8f0; }
.chat-input textarea {
  flex: 1; border: 1px solid #cbd5e1; border-radius: 8px; padding: 8px; resize: none;
}

/* ---- News ---- */
.news-tile { background: linear-gradient(135deg, #7c3aed, #4c1d95) !important; }
.news-card {
  background: #fff; border-radius: 10px; padding: 14px 18px; margin-bottom: 14px;
  max-width: 820px; box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.news-head { display: flex; align-items: flex-start; gap: 10px; }
.news-title { margin: 0; font-size: 16px; flex: 1; }
.news-meta { color: #94a3b8; font-size: 12px; margin: 3px 0 8px; }
.news-body { padding: 0; }
.news-files { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; align-items: center; }
.news-img { max-width: 260px; max-height: 180px; border-radius: 8px; display: block; }
.news-file { background: #f1f5f9; border-radius: 8px; padding: 8px 12px; }
.news-recipients {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 4px 12px; background: #fff; border-radius: 8px; padding: 10px 12px;
  max-height: 200px; overflow-y: auto;
}
.news-recipient { display: flex; align-items: center; gap: 7px; cursor: pointer; padding: 3px 0; }
.news-att-list { display: flex; flex-direction: column; gap: 4px; }

/* ---- Mobil ---- */
@media (max-width: 700px) {
  .desktop-only { display: none !important; }
  .mobile-only { display: inline-block; }
  /* Suche bekommt die volle freie Breite der Topbar */
  .topbar .spacer { display: none; }
  .search-wrap { flex: 1; min-width: 0; }
  .search-wrap input, .search-wrap input:focus { width: 100%; }
  /* Zeiten-/Angebots-Zeilen: Betreff auf eigene Zeile, nichts läuft über den Rand */
  .time-row { row-gap: 2px; }
  .time-row .t-subject {
    flex: 1 1 100%; order: 10; white-space: normal;
    overflow: visible; text-overflow: unset;
  }
  .time-row .t-range { min-width: 0; }
  .billed-pill { order: 11; }
  /* Touch: Löschknopf an Chat-Nachrichten immer anzeigen (kein Hover) */
  .chat-del { display: inline-flex; align-items: center; justify-content: center; }
  .news-img { max-width: 100%; }
  /* 16px verhindert den automatischen Zoom von iOS beim Fokussieren */
  input, select, textarea { font-size: 16px; }
  .btn { min-height: 40px; }
  .btn.small { min-height: 34px; }
  .edit-row { flex-wrap: wrap; }
  .pop-add-row { flex-wrap: wrap; }
  .meta-block { flex: 1 1 45%; }
  .time-filter > div { flex: 1 1 45%; }
  .time-filter select, .time-filter input { width: 100%; }
  .fab { right: 14px; bottom: 14px; }
  .article-row { flex-wrap: wrap; }
  .art-no { width: 100%; }
  .cust-summary-row { flex-wrap: wrap; gap: 4px 10px; }
  .pos-row3 input { width: 76px; }
  .board-head .view-controls { display: flex; width: 100%; gap: 6px; }
  .board-head .view-controls .head-select { flex: 1; max-width: none; }
  .topbar { padding: 8px 10px; gap: 7px; }
  .topbar .brand { font-size: 15px; }
  .search-wrap input { width: 110px; }
  .search-wrap input:focus { width: 160px; }
  .search-results { width: calc(100vw - 20px); right: -60px; }
  .home { padding: 14px; }
  .board-tile { width: calc(50% - 7px); min-width: 150px; height: 88px; }
  .board-head { flex-wrap: wrap; padding: 8px 10px; }
  .board-head h1 { font-size: 15px; }
  .lanes {
    padding: 4px 10px 12px; gap: 10px;
    scroll-snap-type: x proximity;
  }
  .lane, .add-lane { width: 82vw; scroll-snap-align: start; }
  .board-body { flex-direction: column; }
  .board-sidebar {
    width: 100%; flex-direction: row; overflow-x: auto; overflow-y: hidden;
    padding: 4px 10px 8px; gap: 6px; align-items: center;
  }
  .sidebar-title { display: none; }
  .sidebar-item { flex-shrink: 0; }
  .sidebar-spacer { display: none; }
  .overlay { padding: 0; align-items: stretch; }
  .modal { border-radius: 0; max-width: 100%; padding: 16px 14px 24px; min-height: 100%; }
  .meta-grid { gap: 14px; }
  .card-title-input { font-size: 17px; }
  .activity-panel { width: 100%; }
  .popover { max-width: calc(100vw - 16px); }
  .modal table.data { display: block; overflow-x: auto; white-space: nowrap; }
  .form-grid { grid-template-columns: 1fr; }
  .ticket-list { max-width: none; }
  .btn, .topbar-btn, .board-head-btn { padding: 8px 12px; }
  .head-select { max-width: 46vw; }
  .timer-subject { max-width: 70px; }
  .time-row { flex-wrap: wrap; }
}

/* ---------- Admin-Arbeitsplatz: linke Navigation (Kundenportal bleibt ohne) ---------- */
#app.admin-shell { flex-direction: row; }
.shell-main { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100%; }
.view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.sidenav {
  width: 232px; flex-shrink: 0; background: #1e1f1f; color: #e5e7eb; overflow-y: auto;
  display: flex; flex-direction: column; padding: 10px 0 16px; font-size: 13.5px;
}
.nav-group {
  padding: 14px 16px 4px; font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .08em; color: #9ca3af;
}
/* Ein-/ausklappbare Gruppe (Ticketportale) — sieht aus wie eine Gruppenüberschrift */
.nav-group-toggle {
  display: flex; align-items: center; gap: 6px; width: 100%; background: none; border: 0;
  text-align: left; font: inherit; font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .08em; color: #9ca3af; cursor: pointer;
}
.nav-group-toggle:hover { color: #e5e7eb; }
.nav-group-toggle .nav-caret { width: auto; }
.nav-item {
  display: block; width: 100%; padding: 7px 16px; color: #e5e7eb; text-decoration: none;
  border: 0; border-left: 3px solid transparent; background: none; text-align: left;
  font: inherit; cursor: pointer; box-sizing: border-box;
}
.nav-item:hover, .nav-item:focus-visible { background: rgba(255,255,255,.07); outline: none; }
.nav-item.active { border-left-color: var(--brand-accent, #f07d00); background: rgba(240,125,0,.14); color: #fff; }
.nav-item.sub { padding-left: 34px; font-size: 13px; }
.nav-item.ghost { color: #9ca3af; }
.nav-cust {
  display: flex; align-items: center; gap: 6px; width: 100%; padding: 6px 16px;
  background: none; border: 0; color: #e5e7eb; text-align: left; font: inherit;
  font-weight: 600; cursor: pointer;
}
.nav-cust:hover { background: rgba(255,255,255,.07); }
.nav-cust.active { color: #f9a05c; }
.nav-caret { width: 12px; color: #9ca3af; font-size: 11px; flex-shrink: 0; }
.nav-filter {
  margin: 4px 12px 6px; width: calc(100% - 24px); border: 1px solid #3f3f46;
  background: #2a2b2e; color: #fff; border-radius: 6px; padding: 5px 8px; font-size: 13px;
}
.nav-empty { padding: 4px 16px; color: #9ca3af; font-size: 12.5px; }
.nav-user { margin-top: auto; padding-top: 14px; border-top: 1px solid #3f3f46; }
.nav-user-name { padding: 4px 16px 6px; font-weight: 600; color: #fff; }
.nav-backdrop { display: none; }
.nav-toggle { display: none; }

/* Seiten statt Modale (Angebote, Artikel, Zeiten, Kunden, Einstellungen) */
.page-card { background: #f1f5f9; border-radius: 12px; padding: 18px 22px 22px; max-width: 1100px; }
.page-card > h2 { margin: 0 0 12px; font-size: 20px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid #cbd5e1; margin-bottom: 14px; }
.tab {
  padding: 8px 12px; color: #475569; text-decoration: none; border-bottom: 2px solid transparent;
  margin-bottom: -1px; font-weight: 600; font-size: 13px;
}
.tab.active { color: var(--brand-primary, #e6500f); border-bottom-color: var(--brand-primary, #e6500f); }
.settings-body { max-width: 760px; }
.settings-body h3 { margin: 18px 0 6px; font-size: 15px; }
.settings-body .form-row textarea { width: 100%; }
.settings-body .form-grid .form-row { margin-top: 0; }
.check-row { display: flex; align-items: center; gap: 8px; margin: 10px 0 4px; font-weight: 600; font-size: 13px; }
details.help { margin: 10px 0 4px; background: #fff; border: 1px solid #cbd5e1; border-radius: 8px; padding: 8px 12px; font-size: 13px; }
details.help summary { cursor: pointer; font-weight: 600; color: #334155; }
details.help ol { margin: 8px 0 2px; padding-left: 20px; }
details.help li { margin: 4px 0; }
.small { font-size: 12px; }
.logo-preview {
  background: #fff; border: 1px dashed #cbd5e1; border-radius: 8px; padding: 12px;
  display: inline-block; margin-top: 8px;
}
.logo-preview img { max-width: 240px; max-height: 90px; display: block; }
.range-row {
  display: grid; grid-template-columns: 1.2fr 60px 80px 64px 100px 1fr 96px; gap: 8px;
  align-items: center; background: #fff; border-radius: 8px; padding: 8px 10px; margin-bottom: 6px;
}
.range-row input { border: 1px solid #cbd5e1; border-radius: 6px; padding: 6px 8px; width: 100%; }
.range-head {
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: #64748b;
  font-weight: 700; background: none;
}
.mono { font-family: ui-monospace, Consolas, monospace; }

/* Kundenliste */
.cust-table { display: flex; flex-direction: column; gap: 4px; }
/* Feste Breite der Aktionsspalte: jede Zeile ist ein eigenes Raster — mit "auto" wäre die
   Spalte im Kopf (leer) schmaler als in den Zeilen (Knöpfe) und alles verrutscht */
.cust-row {
  display: grid; grid-template-columns: 84px 1.6fr 1fr 110px 70px 1.2fr 168px; gap: 10px;
  align-items: center; background: #fff; border-radius: 8px; padding: 8px 12px; font-size: 13px;
}
.cust-row.head {
  background: none; font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: #64748b; font-weight: 700;
}
.cust-row.archived { opacity: .55; }
.cust-row .c-name { font-weight: 600; }
.cust-row .actions { display: flex; gap: 6px; justify-content: flex-end; }

/* Belege: Status-Pills, Bezug, festgeschriebene (schreibgeschützte) Ansicht */
.doc-status {
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; white-space: nowrap;
}
.doc-status.draft { background: #e2e8f0; color: #334155; }
.doc-status.final { background: #dbeafe; color: #1e40af; }
.doc-status.sent { background: #e0f2fe; color: #075985; }
.doc-status.accepted { background: #dcfce7; color: #166534; }
.doc-status.rejected { background: #fee2e2; color: #991b1b; }
.doc-status.cancelled { background: #fee2e2; color: #991b1b; text-decoration: line-through; }
.modal h2 .doc-status { vertical-align: middle; margin-left: 6px; }
.doc-ref { font-size: 13px; color: #475569; margin: 8px 0 2px; display: flex; align-items: center; gap: 6px; }
/* Dashboard und Berichte */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 6px 0 16px; }
.kpi-tile {
  background: #fff; border-radius: 10px; padding: 12px 14px; border-left: 4px solid #cbd5e1;
  text-align: left; border-top: 0; border-right: 0; border-bottom: 0; font: inherit; color: inherit;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
button.kpi-tile { cursor: pointer; }
button.kpi-tile:hover { box-shadow: 0 3px 10px rgba(0,0,0,.14); }
.kpi-tile.warn { border-left-color: #f59e0b; }
.kpi-tile.crit { border-left-color: #dc2626; }
.kpi-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: #64748b; font-weight: 700; }
.kpi-value { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; margin: 2px 0; }
.kpi-sub { font-size: 12px; color: #64748b; }
.dash-cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin-bottom: 14px; }
.dash-col { min-width: 0; }
.chart { width: 100%; height: auto; background: #fff; border-radius: 10px; padding: 6px; box-sizing: border-box; }
.chart .grid { stroke: #e2e8f0; stroke-width: 1; }
.chart .axis { font-size: 11px; fill: #64748b; }
.chart .bar.cur { fill: var(--brand-primary, #e6500f); }
.chart .bar.prev { fill: #cbd5e1; }
.dashboard .time-list { margin-bottom: 14px; }
@media (max-width: 900px) { .dash-cols { grid-template-columns: 1fr; } }

/* Projekte: Karten mit Budgetampel */
.project-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.project-card { background: #fff; border-radius: 10px; padding: 12px 14px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.project-card.inactive { opacity: .7; }
.project-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; margin-bottom: 8px; }
.budget { margin: 6px 0; }
.budget-head { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 3px; }
.budget-track { height: 8px; background: #e2e8f0; border-radius: 4px; overflow: hidden; }
.budget-fill { height: 100%; background: #16a34a; }
.budget-fill.warn { background: #f59e0b; }
.budget-fill.crit { background: #dc2626; }
.budget-fill.none { background: #94a3b8; }
.budget-box { background: #fff; border-radius: 8px; padding: 8px 12px; margin: 10px 0; }

/* Geld: Zahlungen, Offene Posten, Mahnlauf */
.pay-box { background: #fff; border-radius: 8px; padding: 8px 12px; margin: 6px 0 10px; }
.pay-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin-top: 8px; }
.pay-form label { font-size: 11px; color: #64748b; font-weight: 700; display: block; margin-bottom: 3px; }
.pay-form input, .pay-form select { border: 1px solid #cbd5e1; border-radius: 6px; padding: 6px 8px; width: 130px; }
.pay-form .grow { flex: 1; min-width: 160px; }
.pay-form .grow input { width: 100%; }
.op-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 6px 0 14px; }
.op-tile { background: #fff; border-radius: 8px; padding: 10px 12px; border-left: 4px solid #cbd5e1; }
.op-tile.total { border-left-color: var(--brand-primary, #e6500f); }
.op-tile.warn { border-left-color: #f59e0b; }
.op-tile.crit { border-left-color: #dc2626; }
.op-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: #64748b; font-weight: 700; }
.op-value { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.overdue { color: #b91c1c; font-weight: 600; font-size: 12px; white-space: nowrap; }
.time-row input[type=checkbox] { width: 16px; height: 16px; }
.mail-log { background: #fff; border-radius: 8px; padding: 8px 12px; margin: 6px 0 10px; font-size: 13px; }
.mail-log-row { padding: 3px 0; border-top: 1px solid #f1f5f9; }
.mail-log-row:first-of-type { border-top: 0; }
.mail-log-row.error { color: #991b1b; }
.modal.readonly input:disabled, .modal.readonly textarea:disabled, .modal.readonly select:disabled {
  background: #f8fafc; color: #334155; opacity: 1;
}

/* Ansprechpartner im Kunden-Dialog */
.contacts { margin-top: 16px; }
.contacts h3 { margin: 0 0 4px; font-size: 15px; }
.contact-list { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
.contact-row {
  display: grid; grid-template-columns: 18px 76px 1.3fr 1.3fr 1fr 1fr auto auto; gap: 6px;
  align-items: center; background: #fff; border-radius: 8px; padding: 6px 8px;
}
.contact-row input, .contact-row select {
  width: 100%; border: 1px solid #cbd5e1; border-radius: 6px; padding: 5px 7px; font-size: 13px;
}
.contact-row input[type=radio] { width: auto; margin: 0; }
.contact-row.new { background: #eef2f7; }

@media (max-width: 900px) {
  .sidenav {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 60; transform: translateX(-100%);
    transition: transform .2s ease; box-shadow: 0 0 40px rgba(0,0,0,.4);
  }
  body.nav-open .sidenav { transform: none; }
  body.nav-open .nav-backdrop {
    display: block; position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 59;
  }
  .nav-toggle { display: inline-block; }
  .range-row, .cust-row { grid-template-columns: 1fr 1fr; }
  .cust-row.head, .range-head { display: none; }
  .cust-row .actions { grid-column: 1 / -1; justify-content: flex-start; }
  .contact-row { grid-template-columns: 18px 1fr 1fr; }
  .contact-row .btn { grid-column: span 1; }
}
@media (prefers-reduced-motion: reduce) { .sidenav { transition: none; } }

/* DATEV-Export auf der Berichte-Seite */
.datev-box { margin-top: 24px; border-top: 1px solid var(--line, #e5e7eb); padding-top: 8px; }
.datev-box .time-filter { margin-bottom: 8px; }

/* Bezahlte Rechnungen: grüner Status, Bereich unter den Offenen Posten */
.doc-status.paid { background: #dcfce7; color: #166534; font-weight: 700; }
.time-row.paid-row { border-left: 3px solid #22c55e; }

/* Artikeldatenbank: Karten + Artikelakte */
.article-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 10px; margin-top: 8px; }
.article-cards .art-group { grid-column: 1 / -1; margin: 8px 0 -2px; }
.article-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 12px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; transition: box-shadow .15s; }
.article-card:hover { box-shadow: 0 4px 14px rgba(15, 23, 42, .08); border-color: #cbd5e1; }
.article-card.inactive { opacity: .55; }
.article-card .art-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.article-card .art-no { width: auto; font-size: 11px; }
.article-card .art-title { font-weight: 700; flex: 1; min-width: 120px; }
.article-card .art-price-line { font-size: 14px; }
.article-card .art-desc { font-size: 12.5px; color: #475569; white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.article-card .art-actions { display: flex; justify-content: flex-end; }
.article-akte .art-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 12px; margin-bottom: 10px; }
.article-akte .art-grid .span2 { grid-column: span 2; }
.article-akte textarea { resize: vertical; min-height: 60px; font: inherit; }
.article-akte .art-cols { display: grid; grid-template-columns: 1.2fr 1fr; gap: 14px; margin-top: 12px; }
.article-akte .art-box { background: #f8fafc; border-radius: 10px; padding: 10px 12px; }
@media (max-width: 900px) { .article-akte .art-grid { grid-template-columns: 1fr 1fr; } .article-akte .art-cols { grid-template-columns: 1fr; } }
.article-akte .art-grid > div { display: flex; flex-direction: column; gap: 4px; }
.article-akte .art-grid input, .article-akte .art-grid select { width: 100%; box-sizing: border-box; }
.article-akte .art-grid label { font-size: 11px; font-weight: 700; color: #64748b; }

/* Bankimport */
.bank-row { display: grid; grid-template-columns: 1.1fr 1fr; gap: 12px; align-items: start; }
.bank-row .bank-amount { font-weight: 700; color: #166534; margin-left: 6px; }
.bank-row .bank-purpose { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.bank-row .bank-right .pay-form { margin-top: 0; }
.bank-row .bank-right select { max-width: 100%; }
@media (max-width: 900px) { .bank-row { grid-template-columns: 1fr; } }

/* Lizenzen */
.lic-modules { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.time-row.lic-dead { opacity: .6; }
