/* Lienhard Buchhaltung – Stylesheet */
:root {
  --bg: #f2f3f5;
  --surface: #ffffff;
  --surface-2: #f8f9fa;
  --border: #e3e5e8;
  --border-strong: #cfd3d8;
  --text: #22262b;
  --text-2: #5d6670;
  --text-3: #8b939c;
  --primary: #135270;
  --primary-hover: #0e4058;
  --primary-soft: #e6f0f5;
  --accent: #b5121b;
  --green: #5ba632;
  --green-hover: #4b8c28;
  --link: #1592c6;
  --blue: #3fa2cc;
  --orange: #e39a1b;
  --red: #d33b32;
  --gray: #8b939c;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(20, 30, 40, 0.06), 0 1px 3px rgba(20, 30, 40, 0.08);
  --shadow-lg: 0 10px 30px rgba(20, 30, 40, 0.18);
  --sidebar-w: 224px;
  --topbar-h: 60px;
  --font: 'Lato', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 14px; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
h1 { font-size: 26px; font-weight: 500; }
h2 { font-size: 19px; }
h3 { font-size: 15px; }
.boot-loading { padding: 40px; color: var(--text-2); }
.muted { color: var(--text-2); }
.small { font-size: 12px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-line; }
.hidden { display: none !important; }
.flex { display: flex; gap: 8px; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.right { margin-left: auto; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-orange { color: var(--orange); }
.text-blue { color: var(--blue); }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: var(--sidebar-w) 1fr; grid-template-rows: var(--topbar-h) 1fr; height: 100vh; }
.topbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; padding: 0 20px 0 14px; background: var(--surface); border-bottom: 1px solid var(--border); position: relative; z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; min-width: calc(var(--sidebar-w) - 30px); color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 32px; height: 32px; border-radius: 7px; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; letter-spacing: 0.5px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 14px; }
.brand-text span { font-size: 11px; color: var(--text-3); }
.company-chip { border: 1px solid var(--border); border-radius: 4px; padding: 5px 10px; font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.company-chip b { color: var(--accent); font-size: 11px; letter-spacing: 0.5px; }
.topbar-spacer { flex: 1; }
.global-search { position: relative; width: 320px; }
.global-search input { width: 100%; height: 36px; border: 1px solid var(--border); border-radius: 5px; padding: 0 60px 0 34px; background: var(--surface-2); }
.global-search input:focus { outline: none; border-color: var(--link); background: #fff; }
.global-search .icon { position: absolute; left: 10px; top: 9px; color: var(--text-3); }
.global-search kbd { position: absolute; right: 8px; top: 8px; font-size: 11px; background: #e9ecef; border-radius: 3px; padding: 1px 5px; color: var(--text-2); font-family: inherit; }
.search-results { position: absolute; top: 40px; left: 0; right: 0; background: #fff; border: 1px solid var(--border); border-radius: 6px; box-shadow: var(--shadow-lg); max-height: 420px; overflow: auto; }
.search-results a { display: block; padding: 8px 12px; color: var(--text); border-bottom: 1px solid var(--border); }
.search-results a:hover, .search-results a.active { background: var(--primary-soft); text-decoration: none; }
.search-results .sub { font-size: 12px; color: var(--text-3); }
.search-results .kind { float: right; font-size: 11px; color: var(--text-3); text-transform: uppercase; }
.icon-btn { background: none; border: 0; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: var(--text-2); position: relative; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn .dot { position: absolute; top: 6px; right: 6px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--red); color: #fff; font-size: 10px; display: grid; place-items: center; padding: 0 4px; }
.timer-chip { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 18px; background: #eaf6e3; color: #2f6d12; font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer; border: 0; }
.timer-chip.stopped { background: var(--surface-2); color: var(--text-2); font-weight: 400; }
.timer-chip .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--green); animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(91, 166, 50, 0.6); } 70% { box-shadow: 0 0 0 8px rgba(91, 166, 50, 0); } 100% { box-shadow: 0 0 0 0 rgba(91, 166, 50, 0); } }
.user-menu { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 8px; border-radius: 20px; border: 0; background: none; }
.user-menu:hover { background: var(--surface-2); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: #d8dde2; color: #52606d; display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.menu-toggle { display: none; }

.sidebar { background: var(--surface); border-right: 1px solid var(--border); overflow-y: auto; padding: 14px 10px; display: flex; flex-direction: column; }
.nav-item { position: relative; }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 5px; color: var(--text); cursor: pointer; font-size: 14.5px; user-select: none; }
.nav-link:hover { background: #e9ecef; text-decoration: none; }
.nav-link .chev { margin-left: auto; color: var(--text-3); font-size: 10px; }
.nav-link.active { background: var(--primary); color: #fff; }
.nav-link.active .chev { color: #cfe3ec; }
.nav-link svg { flex: 0 0 18px; }
.nav-sep { height: 1px; background: var(--border); margin: 10px 12px; }
.nav-flyout { display: none; position: fixed; min-width: 230px; background: #fff; border-radius: 6px; box-shadow: var(--shadow-lg); padding: 6px 0; z-index: 50; }
.nav-flyout a { display: block; padding: 9px 18px; color: var(--text); font-size: 14.5px; }
.nav-flyout a:hover, .nav-flyout a.active { background: #eef1f4; text-decoration: none; }
.nav-flyout a.active { font-weight: 600; }
.nav-item.open .nav-flyout { display: block; }
.sidebar-footer { margin-top: auto; padding: 12px; font-size: 11px; color: var(--text-3); }

.main { overflow-y: auto; overflow-x: hidden; padding: 28px 36px 60px; min-width: 0; }
.page { max-width: 1480px; margin: 0 auto; }
.page-narrow { max-width: 1100px; margin: 0 auto; }
.page-header { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.page-header .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.breadcrumb { font-size: 12px; color: var(--link); margin-bottom: 2px; }
.breadcrumb a { color: var(--link); }
.title-sub { color: var(--link); }

/* ---------- Cards ---------- */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; }
.card-header { display: flex; align-items: center; gap: 10px; padding: 16px 22px; border-bottom: 1px solid var(--border); }
.card-header h2 { font-size: 18px; }
.card-header .actions { margin-left: auto; display: flex; gap: 8px; }
.card-body { padding: 18px 22px; }
.card-body.tight { padding: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 0; }
.detail-main { padding: 20px 24px; border-right: 1px solid var(--border); min-width: 0; }
.detail-side { padding: 20px 22px; }
.side-section { margin-bottom: 18px; }
.side-section h4 { font-size: 11.5px; text-transform: uppercase; color: var(--text-2); font-weight: 500; letter-spacing: 0.3px; border-bottom: 1px solid var(--border); padding-bottom: 5px; margin-bottom: 8px; }
.side-action { display: flex; align-items: center; gap: 9px; padding: 6px 0; color: var(--link); cursor: pointer; background: none; border: 0; width: 100%; text-align: left; font-size: 14.5px; }
.side-action:hover { text-decoration: underline; }
.side-action.danger { color: var(--red); }
.side-action[disabled] { color: var(--text-3); cursor: not-allowed; text-decoration: none; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 14px; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; }
.stat { padding: 4px 0; }
.stat .label { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.3px; }
.stat .value { font-size: 22px; font-variant-numeric: tabular-nums; }
.stat.blue .label, .stat.blue .value { color: var(--blue); }
.stat.orange .label, .stat.orange .value { color: var(--orange); }
.stat.green .label, .stat.green .value { color: var(--green); }
.stat.red .label, .stat.red .value { color: var(--red); }
.summary-bar { display: grid; grid-template-columns: repeat(4, 1fr); background: #eef0f2; border-radius: 4px; padding: 10px 14px; text-align: center; margin-bottom: 16px; }
.summary-bar .label { font-weight: 700; font-size: 13.5px; }
.summary-bar .value { font-size: 13px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 4px; border: 1px solid var(--border-strong); background: #fff; cursor: pointer; font-size: 14px; white-space: nowrap; color: var(--text); }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-hover); }
.btn-blue { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-blue:hover { background: var(--primary-hover); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: #b52f27; }
.btn-link { border: 0; background: none; color: var(--link); padding: 0 6px; }
.btn-link:hover { background: none; text-decoration: underline; }
.btn-sm { height: 28px; padding: 0 9px; font-size: 13px; }
.btn-icon { width: 36px; padding: 0; justify-content: center; }
.btn-sm.btn-icon { width: 28px; }
.dropdown { position: relative; display: inline-block; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 4px); background: #fff; border-radius: 5px; box-shadow: var(--shadow-lg); min-width: 210px; padding: 5px 0; z-index: 60; display: none; }
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu button, .dropdown-menu a { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: 0; background: none; padding: 8px 14px; cursor: pointer; color: var(--text); font-size: 14px; }
.dropdown-menu button:hover, .dropdown-menu a:hover { background: #eef1f4; text-decoration: none; }
.dropdown-menu .danger { color: var(--red); }
.dropdown-menu hr { border: 0; border-top: 1px solid var(--border); margin: 4px 0; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; flex-wrap: wrap; }
.tab { padding: 9px 12px; cursor: pointer; color: var(--text-2); border: 0; background: none; border-bottom: 3px solid transparent; margin-bottom: -1px; font-size: 14.5px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--link); border-bottom-color: var(--link); }
.tab .count { background: #e9ecef; border-radius: 9px; padding: 0 6px; font-size: 11px; margin-left: 4px; color: var(--text-2); }
.pill-tabs { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.pill-tab { padding: 7px 13px; cursor: pointer; color: var(--link); border: 1px solid transparent; background: none; border-radius: 4px; font-size: 14.5px; }
.pill-tab.active { border-color: var(--border-strong); color: var(--text); background: #fff; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
table.data th { text-align: left; font-weight: 600; font-size: 13px; color: var(--text); padding: 10px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; background: #fff; position: sticky; top: 0; z-index: 1; }
table.data th.sortable { cursor: pointer; user-select: none; }
table.data th.sortable:hover { color: var(--link); }
table.data td { padding: 9px 10px; border-bottom: 1px solid #eef0f2; vertical-align: top; }
table.data tbody tr:nth-child(even) td { background: #fafbfc; }
table.data tbody tr.clickable { cursor: pointer; }
table.data tbody tr.clickable:hover td { background: #eef6fb; }
table.data tbody tr.selected td { background: #e6f2f8; }
table.data tfoot td { font-weight: 700; border-top: 1px solid var(--border-strong); border-bottom: 0; padding: 10px; }
table.data .actions-cell { text-align: right; white-space: nowrap; width: 1%; }
table.data td.check, table.data th.check { width: 34px; }
table.compact td, table.compact th { padding: 6px 8px; }
.table-footer { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); background: #fafbfc; flex-wrap: wrap; }
.pager { display: flex; gap: 2px; margin-left: auto; }
.pager button { min-width: 32px; height: 30px; border: 1px solid var(--border); background: #fff; color: var(--link); cursor: pointer; }
.pager button.active { background: #eef1f4; color: var(--text); }
.pager button:disabled { color: var(--text-3); cursor: default; }
.table-toolbar { display: flex; align-items: center; gap: 10px; padding: 14px 16px; flex-wrap: wrap; }
.table-toolbar .input, .page-header .actions .input, .card-header .input { width: auto; }
.table-toolbar input[type=date].input, .page-header .actions input[type=date].input { width: 160px; }
.search-input { position: relative; }
.search-input input { height: 34px; border: 1px solid var(--border-strong); border-radius: 4px; padding: 0 10px 0 32px; width: 240px; }
.search-input svg { position: absolute; left: 9px; top: 9px; color: var(--text-3); }
.empty { padding: 40px 20px; text-align: center; color: var(--text-2); }
.tree-row-group td { font-weight: 700; background: #f4f6f8 !important; }
.indent-1 { padding-left: 24px !important; }
.indent-2 { padding-left: 40px !important; }
.indent-3 { padding-left: 56px !important; }
.indent-4 { padding-left: 72px !important; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 2px 7px; border-radius: 3px; font-size: 12px; font-weight: 700; color: #fff; white-space: nowrap; line-height: 1.5; }
.badge-gray { background: #9aa3ab; }
.badge-blue { background: var(--blue); }
.badge-green { background: var(--green); }
.badge-red { background: var(--red); }
.badge-orange { background: var(--orange); }
.badge-dark { background: #52606d; }
.badge-outline { background: #fff; color: var(--text-2); border: 1px solid var(--border-strong); font-weight: 400; }
.dot-status { width: 16px; height: 16px; border-radius: 50%; display: inline-grid; place-items: center; background: #c9ced3; color: #fff; font-size: 10px; }
.dot-status.on { background: var(--green); }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 22px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 13px; color: var(--text-2); }
.field label .req { color: var(--red); }
.field .hint { font-size: 12px; color: var(--text-3); }
.input, select.input, textarea.input { height: 36px; border: 1px solid var(--border-strong); border-radius: 4px; padding: 0 10px; background: #fff; width: 100%; min-width: 0; }
textarea.input { height: auto; min-height: 80px; padding: 8px 10px; resize: vertical; line-height: 1.45; }
.input:focus { outline: none; border-color: var(--link); box-shadow: 0 0 0 3px rgba(21, 146, 198, 0.15); }
.input[readonly] { background: var(--surface-2); }
.input.num { text-align: right; }
.input-sm { height: 30px; font-size: 13px; padding: 0 7px; }
.check-label { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; }
.check-label input { width: 16px; height: 16px; }
.form-section { margin-bottom: 22px; }
.form-section > h3 { margin-bottom: 12px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; padding-top: 12px; }
.input-group { display: flex; }
.input-group .input { border-radius: 4px 0 0 4px; }
.input-group .btn { border-radius: 0 4px 4px 0; border-left: 0; }

/* Combobox */
.combo { position: relative; }
.combo-list { position: absolute; left: 0; right: 0; top: calc(100% + 2px); background: #fff; border: 1px solid var(--border-strong); border-radius: 4px; box-shadow: var(--shadow-lg); max-height: 280px; overflow-y: auto; z-index: 80; min-width: 260px; }
.combo-item { padding: 7px 10px; cursor: pointer; }
.combo-item:hover, .combo-item.active { background: #e8f3f9; }
.combo-item .sub { font-size: 12px; color: var(--text-3); }
.combo-empty { padding: 8px 10px; color: var(--text-3); }
.combo-clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--text-3); cursor: pointer; font-size: 16px; }

/* Positionseditor */
.items-editor { width: 100%; border-collapse: collapse; }
.items-editor th { font-size: 12.5px; text-align: left; color: var(--text-2); font-weight: 600; padding: 6px 4px; border-bottom: 1px solid var(--border); }
.items-editor td { padding: 5px 4px; border-bottom: 1px solid #eef0f2; vertical-align: top; }
.items-editor tr.kind-text td, .items-editor tr.kind-title td { background: #fbfbf4; }
.items-editor tr.kind-subtotal td { background: #f3f6f8; font-weight: 600; }
.items-editor tr.dragging { opacity: 0.4; }
.items-editor .handle { cursor: grab; color: var(--text-3); padding-top: 8px; text-align: center; }
.items-editor textarea.input { min-height: 36px; height: 36px; }
.totals-box { margin-left: auto; width: 360px; margin-top: 14px; }
.totals-box .row { display: flex; justify-content: space-between; padding: 4px 0; }
.totals-box .row.total { font-weight: 700; border-top: 1px solid var(--text); border-bottom: 3px double var(--text); margin-top: 4px; padding: 6px 0; }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(30, 40, 50, 0.45); display: flex; align-items: flex-start; justify-content: center; z-index: 200; padding: 60px 16px; overflow-y: auto; }
.modal { background: #fff; border-radius: 6px; box-shadow: var(--shadow-lg); width: 560px; max-width: 100%; }
.modal.lg { width: 860px; }
.modal.xl { width: 1120px; }
.modal-header { display: flex; align-items: center; padding: 16px 22px; border-bottom: 1px solid var(--border); }
.modal-header h2 { font-size: 19px; }
.modal-close { margin-left: auto; border: 0; background: none; font-size: 22px; cursor: pointer; color: var(--text-2); line-height: 1; }
.modal-body { padding: 18px 22px; }
.modal-footer { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 22px; border-top: 1px solid var(--border); background: #fafbfc; border-radius: 0 0 6px 6px; }

/* ---------- Toasts ---------- */
#toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 300; }
.toast { background: #243039; color: #fff; padding: 11px 16px; border-radius: 5px; box-shadow: var(--shadow-lg); max-width: 440px; animation: slidein 0.2s ease-out; }
.toast.success { background: #3d7d1f; }
.toast.error { background: #b8322a; }
@keyframes slidein { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Alerts ---------- */
.alert { padding: 10px 14px; border-radius: 4px; margin-bottom: 14px; display: flex; gap: 10px; align-items: flex-start; }
.alert-warning { background: #fdf4dd; border: 1px solid #f1d98f; color: #6f5310; }
.alert-danger { background: #fbe7e5; border: 1px solid #f0bbb6; color: #8a2019; }
.alert-info { background: #e6f2f8; border: 1px solid #b9dcec; color: #174e66; }
.alert-success { background: #eaf5e3; border: 1px solid #c3e2b0; color: #2f5f15; }
.banner-yellow { background: #d9a92a; color: #fff; padding: 9px 14px; border-radius: 3px; margin-bottom: 14px; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #0f3f57, #135270 55%, #2b7a9b); padding: 20px; }
.login-card { background: #fff; border-radius: 8px; box-shadow: var(--shadow-lg); width: 400px; max-width: 100%; padding: 34px; }
.login-card h1 { font-size: 22px; margin: 16px 0 4px; }
.login-card .field { margin-top: 14px; }
.login-card .btn { width: 100%; justify-content: center; margin-top: 20px; height: 42px; }

/* ---------- Dashboard ---------- */
.chart-box { position: relative; height: 240px; }
.legend-row { display: flex; gap: 24px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); align-items: flex-start; flex-wrap: wrap; }
.legend-item { display: flex; gap: 8px; align-items: center; font-size: 13.5px; }
.legend-swatch { width: 28px; height: 10px; }
.progress { height: 20px; background: #eef0f2; margin: 10px 0 18px; }
.progress > div { height: 100%; background: #56c1e6; }
.todo-list { list-style: none; margin: 0; padding: 0; }
.todo-list li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #eef0f2; }
.todo-list li:last-child { border-bottom: 0; }

/* ---------- Zeiterfassung ---------- */
.clock-card { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.clock-card > .grow { flex: 1 1 420px; min-width: 0; }
.clock-display { font-size: 42px; font-weight: 300; font-variant-numeric: tabular-nums; min-width: 180px; }
.clock-btn { width: 64px; height: 64px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; color: #fff; background: var(--green); box-shadow: var(--shadow); }
.clock-btn.stop { background: var(--red); }
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--border); }
.week-day { border-right: 1px solid var(--border); min-height: 220px; padding: 8px; }
.week-day:last-child { border-right: 0; }
.week-day.weekend { background: #fafbfc; }
.week-day.today { background: #f2f9fd; }
.week-day-head { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; }
.week-day-head strong { color: var(--text); }
.time-block { background: #e6f0f5; border-left: 3px solid var(--primary); border-radius: 3px; padding: 5px 7px; margin-bottom: 5px; font-size: 12px; cursor: pointer; }
.time-block:hover { background: #d6e7ef; }
.time-block.nonbillable { border-left-color: var(--gray); background: #eef0f2; }
.time-block.billed { border-left-color: var(--green); }
.time-block.running { border-left-color: var(--green); background: #eaf6e3; }
.absence-block { background: #fdf1dc; border-left: 3px solid var(--orange); border-radius: 3px; padding: 4px 7px; margin-bottom: 5px; font-size: 12px; }
.holiday-block { background: #fbe7e5; border-left: 3px solid var(--red); border-radius: 3px; padding: 4px 7px; margin-bottom: 5px; font-size: 12px; }
.day-total { font-size: 12px; color: var(--text-2); margin-top: 4px; }
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
.kpi .label { font-size: 12px; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.3px; }
.kpi .value { font-size: 24px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 12px; color: var(--text-3); }
.calendar-month { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); }
.calendar-month > div { background: #fff; min-height: 70px; padding: 4px 6px; font-size: 12px; }
.calendar-month .head { min-height: auto; font-weight: 600; text-align: center; background: #f4f6f8; }
.calendar-month .other { background: #fafbfc; color: var(--text-3); }

/* ---------- Report ---------- */
.report-table td.amount { width: 150px; }
.report-section-title td { font-weight: 700; padding-top: 14px !important; }
.report-sum td { font-weight: 700; border-top: 1px solid var(--text) !important; background: #f4f6f8 !important; }
.report-result td { font-weight: 700; border-top: 2px solid var(--text) !important; border-bottom: 3px double var(--text) !important; background: #eef6fb !important; }
.vat-form td:first-child { min-width: 260px; }
.vat-form .vat-zif { width: 90px; color: var(--primary, #1a73a8); white-space: nowrap; }
.vat-form .vat-box { display: inline-block; min-width: 110px; padding: 4px 8px; background: #f1f3f5; border-radius: 3px; }
.file-drop { border: 2px dashed var(--border-strong); border-radius: 6px; padding: 26px; text-align: center; color: var(--text-2); cursor: pointer; background: #fafbfc; }
.file-drop.over { border-color: var(--link); background: #eef6fb; }
.attachment-preview { width: 100%; height: 70vh; border: 1px solid var(--border); border-radius: 4px; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: #eef1f4; border-radius: 12px; padding: 2px 9px; font-size: 12px; }

/* ---------- Kommentare ---------- */
.comment-box { background: #f1f2f4; border-radius: 4px; padding: 10px; margin-top: 18px; }
.comment-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); color: var(--text-2); }
.comment-item .avatar { width: 36px; height: 36px; flex: 0 0 36px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .detail-layout { grid-template-columns: 1fr; }
  .detail-main { border-right: 0; border-bottom: 1px solid var(--border); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .global-search { width: 220px; }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .topbar { min-width: 0; gap: 8px; padding: 0 10px; }
  .global-search { min-width: 0; }
  .global-search input { padding-right: 8px; }
  .timer-chip { padding: 6px 10px; white-space: nowrap; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
  .topbar .icon-btn[href] { display: none; }
  .page-header .actions { margin-left: 0; width: 100%; }
  .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .week-day-head { font-size: 14px; }
  .sidebar { position: fixed; top: var(--topbar-h); bottom: 0; left: 0; width: 260px; transform: translateX(-100%); transition: transform 0.2s; z-index: 40; box-shadow: var(--shadow-lg); }
  .layout.nav-open .sidebar { transform: none; }
  .menu-toggle { display: grid; }
  .brand { min-width: 0; }
  .brand-text, .company-chip, .global-search kbd { display: none; }
  .global-search { width: auto; flex: 1; }
  .main { padding: 18px 16px 50px; }
  .grid-2, .grid-3, .grid-4, .form-grid, .form-grid.cols-3, .form-grid.cols-4 { grid-template-columns: 1fr; }
  .nav-item.open .nav-flyout { position: static; box-shadow: none; padding-left: 28px; }
  .summary-bar { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .week-grid { grid-template-columns: 1fr; }
  .week-day { border-right: 0; border-bottom: 1px solid var(--border); min-height: auto; }
  .totals-box { width: 100%; }
  .kv { grid-template-columns: 1fr; }
  .user-menu .name { display: none; }
  .page-header h1 { font-size: 22px; }
  .clock-display { font-size: 34px; min-width: 0; }
  .search-input input, .table-toolbar .input { max-width: 100%; }
  .detail-main, .detail-side { padding: 16px; }
}

@media print {
  .topbar, .sidebar, .page-header .actions, .no-print { display: none !important; }
  .layout { display: block; height: auto; }
  .main { overflow: visible; padding: 0; }
  .card { box-shadow: none; }
}
