:root {
  --bg: #f7f7f8;
  --surface: #ffffff;
  --surface-soft: #fafafa;
  --surface-hover: #f4f4f5;
  --text: #18181b;
  --text-soft: #52525b;
  --muted: #71717a;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;
  --primary: #3f51cc;
  --primary-hover: #3444b5;
  --primary-soft: #eef0ff;
  --success: #16815d;
  --success-soft: #ecf8f3;
  --warning: #a15c12;
  --warning-soft: #fff6e8;
  --danger: #c13d3d;
  --danger-soft: #fff0f0;
  --sidebar: 196px;
  --content: 1180px;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.035);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI Variable", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

svg {
  display: block;
}

/* ---------- Layout ---------- */

.app-layout {
  min-height: 100vh;
  display: flex;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  padding: 14px 10px;
  overflow-y: auto;
  overflow-x: hidden;
  background: #fbfbfc;
  color: var(--text-soft);
  border-right: 1px solid var(--border);
  scrollbar-width: none;
}

.sidebar::-webkit-scrollbar {
  display: none;
}

.workspace {
  width: calc(100% - var(--sidebar));
  min-width: 0;
  min-height: 100vh;
  margin-left: var(--sidebar);
}

body.signed-out .workspace,
.signed-out .workspace {
  width: 100%;
  margin-left: 0;
}

body.signed-out .topbar,
.signed-out .topbar {
  display: none;
}

body.signed-out .content-area,
.signed-out .auth-page {
  min-height: 100vh;
}

/* ---------- Brand ---------- */

.brand-block {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 7px 15px;
}

.brand-mark {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--text);
  color: #fff;
  font-size: 15px;
  font-weight: 750;
  letter-spacing: -0.3px;
}

.brand-name {
  color: var(--text);
  font-size: 15px;
  font-weight: 720;
  letter-spacing: -0.25px;
}

.brand-sub {
  margin-top: 1px;
  color: var(--muted);
  font-size: 10px;
}

.sidebar-label {
  padding: 13px 10px 6px;
  color: #a1a1aa;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------- Navigation ---------- */

.sidebar-nav {
  display: grid;
  gap: 2px;
}

.sidebar-nav button {
  width: 100%;
  min-height: 35px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #5f6168;
  box-shadow: none;
  font-size: 12px;
  font-weight: 550;
  text-align: left;
  transition: background 0.12s ease, color 0.12s ease;
}

.sidebar-nav button svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-nav button:hover {
  background: #f0f0f2;
  color: var(--text);
}

.sidebar-nav button.active {
  background: #eceef8;
  color: #303f9f;
  font-weight: 650;
}

.sidebar-spacer {
  flex: 1;
}

.sidebar-bottom {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--border);
}

/* ---------- Topbar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 35;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 22px;
  background: rgba(247, 247, 248, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.page-eyebrow {
  margin-bottom: 1px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.topbar h1 {
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 16px;
  font-weight: 680;
  letter-spacing: -0.25px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.mobile-brand {
  display: none;
  font-weight: 750;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.top-action,
.account-pill {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  box-shadow: none;
}

.top-action {
  border-radius: 8px;
}

.top-action svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.account-pill {
  border-radius: 50%;
  color: var(--primary);
  background: var(--primary-soft);
  font-weight: 700;
}

.content-area {
  min-height: calc(100vh - 56px);
}

.container {
  width: min(100%, var(--content));
  margin: 0 auto;
  padding: 18px 22px 38px;
}

/* ---------- Typography ---------- */

h1,
h2,
h3,
p {
  word-break: break-word;
}

h2 {
  margin: 0;
  color: var(--text);
  font-size: 21px;
  font-weight: 680;
  letter-spacing: -0.45px;
}

h3 {
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.15px;
}

p {
  margin: 8px 0;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 11px;
}

.money {
  font-variant-numeric: tabular-nums;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.page-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.section-title {
  margin: 20px 0 8px;
  font-size: 14px;
  font-weight: 650;
}

/* ---------- Grid ---------- */

.grid {
  display: grid;
  gap: 10px;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* ---------- Cards ---------- */

.card {
  margin: 8px 0;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.card h3 {
  margin: 0 0 6px;
}

.card-click {
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.card-click:hover {
  border-color: var(--border-strong);
  background: #fdfdfd;
}

.metric-card {
  min-height: 96px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 13px;
}

.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.metric-icon,
.more-tile-icon,
.empty-icon {
  display: grid;
  place-items: center;
  background: var(--surface-hover);
  color: var(--text-soft);
  border: 1px solid var(--border);
}

.metric-icon {
  width: 29px;
  height: 29px;
  border-radius: 7px;
}

.metric-icon svg,
.more-tile-icon svg,
.empty-icon svg,
.inline-icon svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.metric {
  margin-top: 7px;
  color: var(--text);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.55px;
}

.metric-label {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.metric-trend {
  padding: 3px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 650;
}

.kpi-up {
  color: var(--success);
  background: var(--success-soft);
}

.kpi-down {
  color: var(--danger);
  background: var(--danger-soft);
}

/* ---------- Dashboard hero ---------- */

.hero-card {
  padding: 16px 17px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.hero-card::after {
  display: none;
}

.hero-card h2 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 680;
}

.hero-card p {
  max-width: 720px;
  margin: 4px 0;
  color: var(--muted);
  font-size: 12px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.hero-actions button,
.hero-actions .btn-ghost-dark {
  background: var(--surface-hover);
  color: var(--text);
  border: 1px solid var(--border);
}

.hero-actions button:first-child {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}

/* ---------- Buttons ---------- */

button,
.btn {
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: var(--primary);
  color: #fff;
  box-shadow: none;
  font-size: 12px;
  font-weight: 620;
  line-height: 1.25;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

button:hover,
.btn:hover {
  background: var(--primary-hover);
}

button:active,
.btn:active {
  transform: none;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  border-color: var(--border);
  background: var(--surface-hover);
  color: var(--text-soft);
}

.btn-secondary:hover,
.btn-ghost:hover {
  border-color: var(--border-strong);
  background: #ededf0;
  color: var(--text);
}

.btn-ghost {
  border-color: var(--border);
  background: transparent;
  color: var(--text-soft);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-warning {
  background: var(--warning);
  color: #fff;
}

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 5px 8px;
  font-size: 11px;
}

/* ---------- Forms ---------- */

input,
select,
textarea,
.input,
.select {
  width: 100%;
  padding: 8px 9px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  outline: none;
  background: var(--surface);
  color: var(--text);
  box-shadow: none;
  font-size: 13px;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

input::placeholder,
textarea::placeholder {
  color: #a1a1aa;
}

input:focus,
select:focus,
textarea:focus,
.input:focus,
.select:focus {
  border-color: #8792da;
  box-shadow: 0 0 0 3px rgba(63, 81, 204, 0.09);
}

input[type="file"] {
  padding: 7px;
}

textarea {
  min-height: 82px;
  resize: vertical;
}

.form-group {
  margin-bottom: 10px;
}

.form-group label {
  display: block;
  margin-bottom: 4px;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 620;
}

.form-help {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

/* ---------- Toolbar / list ---------- */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin: 8px 0;
}

.toolbar > * {
  flex: 0 0 auto;
}

.toolbar input,
.toolbar select {
  width: auto;
  min-width: 150px;
  flex: 1 1 170px;
}

.split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.list-row-main {
  min-width: 0;
  flex: 1;
}

.list-row-main strong,
.file-info strong {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.list-row-main .muted {
  display: block;
  margin-top: 2px;
}

/* ---------- Status ---------- */

.badge,
.chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 10px;
  font-weight: 620;
}

.badge {
  padding: 3px 7px;
}

.chip {
  margin: 2px 2px 2px 0;
  padding: 3px 7px;
  background: var(--surface-hover);
  color: var(--text-soft);
  border: 1px solid var(--border);
}

.badge-open {
  background: #fff7ed;
  color: #9a4c10;
}

.badge-progress {
  background: #eef4ff;
  color: #3158a6;
}

.badge-done {
  background: var(--success-soft);
  color: var(--success);
}

.badge-cancel {
  background: var(--danger-soft);
  color: var(--danger);
}

.badge-neutral {
  background: #f4f4f5;
  color: #60606a;
}

/* ---------- Inline icons ---------- */

.inline-icon {
  width: 17px;
  height: 17px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--muted);
  vertical-align: -3px;
}

.info-line {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 6px 0;
  color: var(--text-soft);
}

.info-line .inline-icon {
  margin-top: 1px;
}

/* ---------- Empty ---------- */

.empty {
  padding: 24px 14px;
  text-align: center;
  color: var(--muted);
}

.empty-icon {
  width: 32px;
  height: 32px;
  margin: 0 auto 8px;
  border-radius: 8px;
}

.customer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.stat-mini {
  text-align: left;
}

.stat-mini strong {
  font-size: 17px;
  font-weight: 680;
}

/* ---------- Tabs ---------- */

.tabs {
  width: max-content;
  max-width: 100%;
  display: flex;
  gap: 2px;
  margin: 8px 0 13px;
  padding: 3px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.tabs button {
  padding: 6px 9px;
  border: 0;
  background: transparent;
  color: var(--muted);
  white-space: nowrap;
}

.tabs button:hover {
  background: var(--surface-hover);
}

.tabs button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

/* ---------- Calendar ---------- */

.calendar-shell {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border-bottom: 1px solid var(--border);
}

.calendar-toolbar strong {
  font-size: 13px;
  font-weight: 650;
}

.calendar-nav {
  display: flex;
  gap: 4px;
}

.calendar-nav button {
  padding: 5px 7px;
  border-color: var(--border);
  background: var(--surface-hover);
  color: var(--text-soft);
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.month-weekday {
  padding: 7px 4px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
}

.month-day {
  min-height: 82px;
  padding: 6px;
  overflow: hidden;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
}

.month-day:nth-child(7n) {
  border-right: 0;
}

.month-day:hover {
  background: var(--surface-soft);
}

.month-day.is-outside {
  background: #fafafa;
  color: #b3b3ba;
  cursor: default;
}

.month-day.today {
  background: #f5f6ff;
  box-shadow: inset 0 0 0 1px #aab1eb;
}

.day-number {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 3px;
  font-size: 11px;
  font-weight: 650;
}

.day-count {
  padding: 1px 4px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 8px;
}

.cal-item {
  margin-top: 3px;
  padding: 3px 5px;
  overflow: hidden;
  border-left: 2px solid var(--primary);
  border-radius: 4px;
  background: #f4f4f6;
  color: var(--text-soft);
  font-size: 9px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.cal-item.done {
  border-left-color: var(--success);
  opacity: 0.75;
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(145px, 1fr));
  overflow-x: auto;
}

.week-day {
  min-height: 210px;
  padding: 8px;
  border-right: 1px solid var(--border);
  background: var(--surface);
}

.week-day:last-child {
  border-right: 0;
}

.week-day.today {
  background: #f7f8ff;
}

.week-day-head {
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 650;
}

.week-event {
  margin-bottom: 5px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-soft);
  cursor: pointer;
}

.week-event strong {
  display: block;
  font-size: 11px;
}

.week-event span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.agenda-date {
  margin: 16px 0 6px;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 650;
}

/* ---------- Tables ---------- */

.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}

.data-table th,
.data-table td {
  padding: 8px 9px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  text-align: left;
  white-space: nowrap;
}

.data-table th {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

/* ---------- Files ---------- */

.file-drop {
  padding: 13px;
  border: 1px dashed #c9cad0;
  border-radius: var(--radius);
  background: #fcfcfd;
  text-align: center;
}

.file-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.file-icon {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-hover);
  color: var(--text-soft);
  font-size: 8px;
  font-weight: 700;
}

.file-info {
  min-width: 0;
  flex: 1;
}

.service-price {
  font-size: 16px;
  font-weight: 680;
}

/* ---------- More ---------- */

.more-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.more-tile {
  min-height: 108px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 13px;
}

.more-tile-icon {
  width: 30px;
  height: 30px;
  border-radius: 7px;
}

.more-tile h3 {
  margin: 10px 0 2px;
}

/* ---------- Auth ---------- */

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #f7f7f8;
}

.auth-shell {
  width: min(100%, 820px);
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.05);
}

.auth-brand {
  min-height: 430px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 30px;
  border-right: 1px solid var(--border);
  background: #f3f3f5;
  color: var(--text);
}

.auth-brand .brand-mark {
  width: 36px;
  height: 36px;
  font-size: 17px;
}

.auth-brand h2 {
  margin: 20px 0 8px;
  font-size: 28px;
  font-weight: 680;
  letter-spacing: -0.8px;
}

.auth-brand p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.auth-points {
  display: grid;
  gap: 8px;
  color: var(--text-soft);
  font-size: 11px;
}

.auth-point {
  display: flex;
  align-items: center;
  gap: 7px;
}

.auth-point .inline-icon {
  color: var(--success);
}

.auth-form {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 34px;
}

.auth-form h2 {
  margin: 0 0 5px;
}

.auth-form > p {
  margin: 0 0 18px;
  color: var(--muted);
}

/* ---------- Toast ---------- */

.toast-host {
  position: fixed;
  right: 16px;
  bottom: 18px;
  z-index: 120;
  width: min(340px, calc(100vw - 28px));
  display: grid;
  gap: 7px;
}

.toast {
  padding: 10px 12px;
  border: 1px solid #303038;
  border-radius: 8px;
  background: #202024;
  color: #fff;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.12);
  font-size: 12px;
  animation: toastIn 0.15s ease;
}

.toast.error {
  border-color: #9f2d2d;
  background: #7e2828;
}

.toast.success {
  border-color: #1d6a50;
  background: #155b45;
}

@keyframes toastIn {
  from { transform: translateY(5px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.skeleton-card {
  height: 110px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, #efeff1 25%, #f8f8f9 40%, #efeff1 55%);
  background-size: 300% 100%;
  animation: shimmer 1.15s infinite;
}

@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

.print-area,
.mobile-nav {
  display: none;
}

/* ---------- Dark mode ---------- */

.dark {
  --bg: #151516;
  --surface: #1c1c1f;
  --surface-soft: #202024;
  --surface-hover: #25252a;
  --text: #f4f4f5;
  --text-soft: #c2c2c7;
  --muted: #92929a;
  --border: #303035;
  --border-strong: #3b3b42;
  --primary: #7c88e7;
  --primary-hover: #8994ed;
  --primary-soft: #292d4d;
  --success-soft: #17362c;
  --warning-soft: #3a2a17;
  --danger-soft: #3e2222;
  --shadow: none;
}

.dark .sidebar,
.dark .topbar,
.dark .mobile-nav {
  background: rgba(24, 24, 27, 0.96);
}

.dark .sidebar-nav button:hover,
.dark .btn-secondary:hover,
.dark .btn-ghost:hover {
  background: #29292e;
}

.dark .sidebar-nav button.active {
  background: #292d4d;
  color: #b8c0ff;
}

.dark .brand-mark,
.dark .hero-actions button:first-child {
  background: #f4f4f5;
  color: #18181b;
  border-color: #f4f4f5;
}

.dark .card-click:hover,
.dark .file-drop,
.dark .month-day.is-outside {
  background: #202024;
}

.dark .month-day.today,
.dark .week-day.today {
  background: #252941;
}

.dark .cal-item {
  background: #28282d;
}

.dark .badge-open {
  background: #3c2d1d;
  color: #f2bd7c;
}

.dark .badge-progress {
  background: #222f4a;
  color: #9bb8ef;
}

.dark .badge-done {
  color: #83d1b1;
}

.dark .badge-cancel {
  color: #efa1a1;
}

.dark .badge-neutral {
  background: #2a2a2f;
  color: #c7c7cd;
}

.dark .auth-page {
  background: #151516;
}

.dark .auth-brand {
  background: #18181b;
}

/* ---------- Laptop ---------- */

@media (min-width: 821px) and (max-width: 1400px) {
  :root {
    --sidebar: 184px;
    --content: 1060px;
  }

  .container {
    padding-left: 18px;
    padding-right: 18px;
  }

  .sidebar-nav button {
    font-size: 11.5px;
  }

  .more-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 821px) and (max-height: 850px) {
  .sidebar {
    padding-top: 9px;
    padding-bottom: 9px;
  }

  .brand-block {
    padding-bottom: 10px;
  }

  .sidebar-label {
    padding-top: 9px;
  }

  .sidebar-nav button {
    min-height: 31px;
    padding-top: 5px;
    padding-bottom: 5px;
  }

  .topbar {
    height: 52px;
  }

  .content-area {
    min-height: calc(100vh - 52px);
  }

  .container {
    padding-top: 14px;
  }

  .metric-card {
    min-height: 88px;
  }
}

/* ---------- Mobile ---------- */

@media (max-width: 820px) {
  :root {
    --radius: 9px;
  }

  body {
    font-size: 13px;
  }

  .sidebar {
    display: none !important;
  }

  .workspace {
    width: 100%;
    margin-left: 0;
  }

  .topbar {
    height: 56px;
    padding: 0 13px;
    background: rgba(247, 247, 248, 0.96);
  }

  .dark .topbar {
    background: rgba(21, 21, 22, 0.96);
  }

  .mobile-brand {
    display: block;
    margin-right: 5px;
    font-size: 16px;
  }

  .page-eyebrow {
    display: none;
  }

  .topbar h1 {
    font-size: 15px;
  }

  .top-action {
    width: 32px;
    height: 32px;
  }

  .account-pill {
    display: none;
  }

  .content-area {
    min-height: calc(100vh - 56px);
    padding-bottom: 74px;
  }

  .container {
    padding: 14px 12px 24px;
  }

  .mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 70;
    grid-template-columns: repeat(5, 1fr);
    padding: 5px 5px calc(5px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(12px);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.04);
  }

  .mobile-nav button {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 5px 2px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    font-size: 9px;
    font-weight: 600;
  }

  .mobile-nav button:hover {
    background: transparent;
  }

  .mobile-nav button svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .mobile-nav button.active {
    background: var(--primary-soft);
    color: var(--primary);
  }

  .toast-host {
    right: 10px;
    bottom: 78px;
  }

  .page-head {
    align-items: center;
    margin-bottom: 11px;
  }

  .page-head h2,
  h2 {
    font-size: 19px;
  }

  .page-head p {
    font-size: 11px;
  }

  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-card {
    padding: 14px;
  }

  .hero-card h2 {
    font-size: 18px;
  }

  .more-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .month-day {
    min-height: 62px;
    padding: 4px;
  }

  .day-number {
    font-size: 10px;
  }

  .cal-item {
    height: 6px;
    margin-top: 3px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: var(--primary);
    font-size: 0;
  }

  .cal-item:nth-of-type(n + 3) {
    display: none;
  }

  .week-grid {
    grid-template-columns: repeat(7, minmax(170px, 1fr));
  }

  .auth-page {
    padding: 14px;
  }

  .auth-shell {
    max-width: 500px;
    grid-template-columns: 1fr;
  }

  .auth-brand {
    display: none;
  }

  .auth-form {
    padding: 26px 20px;
  }
}

@media (max-width: 520px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: 82px;
  }

  .metric {
    font-size: 21px;
  }

  .page-head {
    flex-wrap: wrap;
  }

  .page-head > button {
    margin-left: auto;
  }

  .toolbar {
    gap: 6px;
  }

  .toolbar > * {
    flex: 1 1 140px;
  }

  .toolbar button {
    flex: 0 1 auto;
  }

  .list-row,
  .file-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .list-row > button {
    margin-left: auto;
  }

  .split {
    align-items: flex-start;
  }

  .more-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .more-tile {
    min-height: 100px;
    padding: 11px;
  }

  .customer-head {
    display: block;
  }

  .month-weekday {
    padding: 6px 2px;
    font-size: 8px;
  }

  .month-day {
    min-height: 54px;
    padding: 3px;
  }

  .day-count {
    display: none;
  }
}

/* ---------- Print ---------- */

@media print {
  @page {
    size: A4;
    margin: 14mm;
  }

  body {
    background: #fff;
    color: #000;
  }

  .app-layout,
  .mobile-nav,
  .toast-host {
    display: none !important;
  }

  .print-area {
    display: block !important;
    color: #111;
    font-family: Arial, sans-serif;
  }

  .print-doc {
    max-width: 185mm;
    margin: 0 auto;
    font-size: 10.5pt;
    line-height: 1.45;
  }

  .print-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 38px;
  }

  .print-logo {
    max-width: 160px;
    max-height: 70px;
    object-fit: contain;
  }

  .print-company {
    margin: 0 0 7px;
    font-size: 20pt;
    font-weight: 800;
  }

  .print-meta {
    min-width: 220px;
  }

  .print-meta-row,
  .print-total-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
  }

  .print-meta-row {
    margin: 3px 0;
  }

  .print-addressline {
    margin-bottom: 12px;
    padding-bottom: 3px;
    border-bottom: 1px solid #ddd;
    color: #555;
    font-size: 8pt;
  }

  .print-recipient {
    min-height: 85px;
    margin-bottom: 32px;
  }

  .print-title {
    margin: 0 0 18px;
    font-size: 18pt;
  }

  .print-doc table {
    width: 100%;
    margin: 18px 0 22px;
    border-collapse: collapse;
  }

  .print-doc th {
    background: #f3f4f6;
    font-size: 9pt;
    letter-spacing: 0.03em;
    text-transform: uppercase;
  }

  .print-doc th,
  .print-doc td {
    padding: 8px 7px;
    border-bottom: 1px solid #ddd;
    text-align: left;
    vertical-align: top;
  }

  .print-doc th:nth-child(n + 2),
  .print-doc td:nth-child(n + 2) {
    text-align: right;
  }

  .print-totals {
    width: 290px;
    margin-left: auto;
  }

  .print-total-row {
    padding: 4px 0;
  }

  .print-total-row.grand {
    margin-top: 5px;
    padding-top: 8px;
    border-top: 2px solid #111;
    font-size: 13pt;
    font-weight: 800;
  }

  .print-note {
    margin-top: 28px;
    white-space: pre-wrap;
  }

  .print-footer {
    position: fixed;
    right: 14mm;
    bottom: 8mm;
    left: 14mm;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding-top: 5px;
    border-top: 1px solid #ddd;
    color: #555;
    font-size: 8pt;
  }
}

/* =========================================================
   KUNDLY V3.3 - COMPACT EMOJI UI
   Minimalistisch, übersichtlich, wenig Scrollen
========================================================= */

:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-soft: #f9fafc;
  --surface-hover: #f2f4f8;
  --text: #1f2430;
  --text-soft: #505766;
  --muted: #818898;
  --border: #e7e9ef;
  --border-strong: #d8dce5;
  --primary: #5965df;
  --primary-hover: #4854ca;
  --primary-soft: #eef0ff;
  --success: #16815d;
  --success-soft: #eaf8f2;
  --warning: #9b6118;
  --warning-soft: #fff6e7;
  --danger: #c04444;
  --danger-soft: #fff0f0;
  --sidebar: 182px;
  --content: 1320px;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(25, 30, 50, .03);
}

body {
  font-family: Inter, "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  font-size: 13px;
  line-height: 1.35;
  background: var(--bg);
}

.nav-emoji,
.emoji-icon,
.emoji-action {
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-variant-emoji: emoji;
}

.nav-emoji {
  width: 22px;
  flex: 0 0 22px;
  display: inline-grid;
  place-items: center;
  font-size: 15px;
  line-height: 1;
}

.emoji-icon {
  display: inline-grid;
  place-items: center;
  min-width: 1em;
  line-height: 1;
}

/* Desktop Grundlayout */
@media (min-width: 821px) {
  .sidebar {
    width: var(--sidebar);
    padding: 10px 8px;
    background: #fbfbfd;
  }

  .workspace {
    width: calc(100% - var(--sidebar));
    margin-left: var(--sidebar);
  }

  .brand-block {
    gap: 8px;
    padding: 3px 7px 11px;
  }

  .brand-mark {
    width: 29px;
    height: 29px;
    border-radius: 8px;
    background: var(--primary);
    font-size: 14px;
  }

  .brand-name { font-size: 14px; }
  .brand-sub { font-size: 9px; }

  .sidebar-label {
    padding: 10px 9px 4px;
    font-size: 8px;
  }

  .sidebar-nav { gap: 1px; }

  .sidebar-nav button {
    min-height: 32px;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 7px;
    font-size: 11.5px;
    font-weight: 560;
  }

  .sidebar-nav button:hover { background: #f0f2f7; }
  .sidebar-nav button.active {
    background: var(--primary-soft);
    color: #3f49b8;
  }

  .sidebar-bottom {
    margin-top: 6px;
    padding-top: 6px;
  }

  .topbar {
    height: 48px;
    padding: 0 16px;
    background: rgba(246, 247, 251, .94);
  }

  .content-area { min-height: calc(100vh - 48px); }

  .topbar h1 { font-size: 14px; }
  .page-eyebrow { font-size: 8px; }

  .top-action,
  .account-pill {
    width: 30px;
    height: 30px;
    border-radius: 8px;
  }

  .emoji-action {
    font-size: 14px;
    line-height: 1;
  }

  .container {
    width: min(100%, var(--content));
    padding: 12px 16px 26px;
  }
}

/* Typografie */
h1, h2, h3, p { margin-top: 0; }
h2 {
  margin-bottom: 3px;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: -.35px;
}
h3 {
  margin-bottom: 4px;
  font-size: 13px;
  letter-spacing: -.1px;
}
.page-head {
  gap: 8px;
  margin-bottom: 9px;
}
.page-head p {
  margin: 1px 0 0;
  font-size: 11px;
  color: var(--muted);
}
.section-title {
  margin: 11px 0 6px;
  font-size: 12.5px;
}
.small { font-size: 10.5px; }

/* Karten */
.card {
  margin: 5px 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.card:hover { border-color: var(--border-strong); }
.card-click:hover {
  transform: none;
  background: var(--surface-soft);
}

.grid { gap: 7px; }
.grid-2 { gap: 8px; }
.grid-3 { gap: 8px; }
.grid-4 { gap: 8px; }

/* Dashboard */
.dashboard-quickbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.dashboard-quickbar strong { font-size: 13px; }
.dashboard-quickbar .muted { font-size: 10.5px; }
.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.dashboard-actions button { white-space: nowrap; }

.metric-card {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  padding: 9px 10px;
}
.metric-top {
  margin: 0;
  align-self: center;
}
.metric-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  font-size: 18px;
}
.metric-icon svg { display: none; }
.metric {
  margin: 0;
  font-size: 20px;
  line-height: 1.05;
  letter-spacing: -.45px;
}
.metric-label {
  margin-top: 2px;
  font-size: 10px;
}
.metric-trend {
  position: absolute;
  margin: -26px 0 0 18px;
  padding: 2px 5px;
  font-size: 8px;
}
.dashboard-main {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(250px, .8fr);
  gap: 8px;
  margin-top: 7px;
}
.dashboard-panel {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.dashboard-panel .section-title { margin-top: 0; }
.dashboard-panel .card {
  margin: 4px 0;
  padding: 7px 8px;
}
.dashboard-finance {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}
.dashboard-finance > div {
  padding: 8px;
  border-radius: 8px;
  background: var(--surface-soft);
}
.dashboard-finance .muted {
  display: block;
  margin-bottom: 2px;
  font-size: 9px;
}
.dashboard-finance strong { font-size: 13px; }
.dashboard-recent {
  margin-top: 8px;
}
.dashboard-recent-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}
.dashboard-recent-grid .card {
  margin: 0;
  padding: 8px;
}
.dashboard-recent-grid h3 {
  margin: 2px 0 6px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Buttons */
button,
.btn {
  min-height: 30px;
  padding: 6px 9px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 650;
}
.btn-sm {
  min-height: 25px;
  padding: 4px 7px;
  font-size: 10px;
}
.toolbar {
  gap: 5px;
  margin: 5px 0 7px;
}
.toolbar input,
.toolbar select {
  min-width: 130px;
  flex-basis: 150px;
}

/* Formulare */
input,
select,
textarea,
.input,
.select {
  min-height: 32px;
  padding: 6px 8px;
  border-radius: 7px;
  font-size: 12px;
}
textarea { min-height: 66px; }
.form-group { margin-bottom: 7px; }
.form-group label {
  margin-bottom: 3px;
  font-size: 10px;
}
.form-help { font-size: 9.5px; }

/* Listen */
.list-row,
.file-row {
  min-height: 44px;
  gap: 7px;
  padding: 7px 8px;
}
.list-row-main { gap: 1px; }
.list-row-main strong { font-size: 11.5px; }
.list-row-main .muted { font-size: 10px; }
.badge {
  padding: 3px 6px;
  font-size: 9px;
}
.chip {
  margin: 2px 3px 0 0;
  padding: 2px 6px;
  font-size: 9px;
}

/* Kunden- und Listen-Karten auf Desktop kompakter */
@media (min-width: 1000px) {
  #kundenListe,
  #auftragListe,
  #taskList,
  #dateiListe {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }
  #kundenListe > .card,
  #auftragListe > .card,
  #taskList > .card,
  #dateiListe > .card {
    margin: 0;
  }
}

/* Mehr Bereich */
.more-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}
.more-tile {
  min-height: 72px;
  padding: 9px;
  gap: 8px;
}
.more-tile-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 17px;
}
.more-tile-icon svg { display: none; }
.more-tile h3 { margin: 0 0 2px; }

/* Kalender kompakter */
.calendar-shell { border-radius: 10px; }
.calendar-toolbar { padding: 7px 9px; }
.calendar-toolbar strong { font-size: 11.5px; }
.calendar-nav { gap: 3px; }
.month-weekday {
  padding: 5px 3px;
  font-size: 8px;
}
.month-day {
  min-height: 67px;
  padding: 4px;
}
.day-number { font-size: 10px; }
.day-count { font-size: 7px; }
.cal-item {
  margin-top: 2px;
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 8px;
}
.week-day {
  min-height: 150px;
  padding: 6px;
}
.week-event {
  margin-bottom: 3px;
  padding: 4px;
}

/* Tabellen */
.data-table th,
.data-table td {
  padding: 6px 7px;
  font-size: 10px;
}
.data-table th { font-size: 8px; }

/* Auth */
.auth-page { padding: 14px; }
.auth-shell {
  width: min(100%, 760px);
  border-radius: 14px;
}
.auth-brand {
  min-height: 380px;
  padding: 28px;
}
.auth-brand h2 { font-size: 25px; }
.auth-form { padding: 28px; }

/* Dark */
html.dark {
  --bg: #15171c;
  --surface: #1d2027;
  --surface-soft: #232731;
  --surface-hover: #282d37;
  --text: #f2f4f8;
  --text-soft: #c5cad3;
  --muted: #9299a8;
  --border: #2e333e;
  --border-strong: #3a404d;
  --primary-soft: #272b4d;
}
html.dark .sidebar { background: #191c22; }
html.dark .topbar { background: rgba(21, 23, 28, .94); }

/* Mobile */
@media (max-width: 820px) {
  .workspace {
    width: 100%;
    margin-left: 0;
  }
  .topbar {
    height: 48px;
    padding: 0 11px;
  }
  .content-area { padding-bottom: 61px; }
  .container { padding: 9px 9px 18px; }
  .mobile-nav {
    min-height: 56px;
    padding: 4px 5px max(4px, env(safe-area-inset-bottom));
    background: rgba(255,255,255,.97);
  }
  html.dark .mobile-nav { background: rgba(29,32,39,.98); }
  .mobile-nav button {
    gap: 1px;
    min-height: 46px;
    font-size: 9px;
  }
  .mobile-nav .nav-emoji {
    width: auto;
    flex: none;
    font-size: 17px;
  }
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .metric-card {
    min-height: 66px;
    padding: 8px;
  }
  .metric-icon {
    width: 28px;
    height: 28px;
    font-size: 16px;
  }
  .metric { font-size: 18px; }
  .dashboard-main { grid-template-columns: 1fr; }
  .dashboard-finance { grid-template-columns: repeat(3, 1fr); }
  .dashboard-recent-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .more-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .more-tile { min-height: 66px; }
  .page-head { margin-bottom: 7px; }
  .page-head h2 { font-size: 17px; }
  .card { padding: 8px; }
  .toolbar { margin: 4px 0 6px; }
}

@media (max-width: 520px) {
  .grid-2,
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dashboard-quickbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .dashboard-actions { width: 100%; }
  .dashboard-actions button { flex: 1; }
  .dashboard-finance > div { padding: 6px; }
  .dashboard-finance strong { font-size: 11px; }
  .dashboard-recent-grid { grid-template-columns: 1fr; }
  .month-day { min-height: 51px; }
}
.btn-email {
    background: #2563eb;
    color: #ffffff;
    border: 1px solid #2563eb;
}

.btn-email:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}


.btn-whatsapp {
    background: #25d366;
    color: #ffffff;
    border: 1px solid #25d366;
}

.btn-whatsapp:hover {
    background: #1ebe5d;
    border-color: #1ebe5d;
}/* =========================================
   DASHBOARD – NÄCHSTE TERMINE
========================================= */

.compact-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.compact-list-item {
    width: 100%;
    display: grid;
    grid-template-columns: 64px 1fr auto;
    align-items: center;
    gap: 14px;

    padding: 12px 14px;

    background: #ffffff;
    color: #111827;

    border: 1px solid #e5e7eb;
    border-radius: 14px;

    text-align: left;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);

    transition:
        transform 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease;

    cursor: pointer;
}

.compact-list-item:hover {
    transform: translateY(-1px);
    border-color: #c7d2fe;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.07);
}


/* DATUM LINKS */

.compact-date {
    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 52px;

    padding: 7px;

    border-radius: 11px;

    background: #f4f6f8;
    color: #111827;

    font-size: 12px;
    font-weight: 800;

    text-align: center;
}


/* INHALT */

.compact-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.compact-main strong {
    font-size: 14px;
    font-weight: 750;
    color: #111827;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.compact-main small {
    font-size: 12px;
    color: #6b7280;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* PFEIL RECHTS */

.compact-list-item > span:last-child {
    color: #9ca3af;
    font-size: 20px;
    font-weight: 400;
}


/* DARK MODE */

.dark .compact-list-item {
    background: #181b22;
    color: #f8fafc;
    border-color: #2b303a;
    box-shadow: none;
}

.dark .compact-list-item:hover {
    background: #1d2129;
    border-color: #3b4250;
}

.dark .compact-date {
    background: #232832;
    color: #ffffff;
}

.dark .compact-main strong {
    color: #ffffff;
}

.dark .compact-main small {
    color: #9ca3af;
}

.dark .compact-list-item > span:last-child {
    color: #6b7280;
}


/* HANDY */

@media (max-width: 700px) {

    .compact-list-item {
        grid-template-columns: 58px 1fr auto;
        gap: 11px;
        padding: 11px 12px;
        border-radius: 12px;
    }

    .compact-date {
        min-height: 48px;
        font-size: 11px;
    }

    .compact-main strong {
        font-size: 14px;
    }

    .compact-main small {
        font-size: 11px;
    }
}/* =========================================
   DASHBOARD TERMINE – CLEAN
========================================= */

.dashboard-schedule {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 12px;
}

.schedule-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.schedule-group-title {
    padding: 0 3px;

    font-size: 11px;
    font-weight: 800;

    color: #64748b;

    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.schedule-items {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.schedule-item {
    width: 100%;

    display: grid;
    grid-template-columns: 70px 1fr auto;

    align-items: center;

    gap: 13px;

    padding: 12px;

    background: #ffffff;
    color: #111827;

    border: 1px solid #e5e7eb;
    border-radius: 12px;

    text-align: left;

    box-shadow:
        0 2px 8px
        rgba(15, 23, 42, 0.04);

    cursor: pointer;

    transition:
        border-color 0.15s ease,
        background 0.15s ease,
        transform 0.15s ease;
}

.schedule-item:hover {
    border-color: #cbd5e1;
    transform: translateY(-1px);
}


/* UHRZEIT */

.schedule-time {
    display: flex;
    flex-direction: column;
    gap: 3px;

    padding-right: 12px;

    border-right: 1px solid #e5e7eb;
}

.schedule-time strong {
    font-size: 17px;
    font-weight: 800;

    color: #111827;
}

.schedule-time small {
    font-size: 10px;
    color: #94a3b8;
}


/* TERMIN */

.schedule-info {
    min-width: 0;

    display: flex;
    flex-direction: column;

    gap: 4px;
}

.schedule-info strong {
    font-size: 14px;
    font-weight: 750;

    color: #111827;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.schedule-info small {
    font-size: 12px;
    color: #64748b;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* PFEIL */

.schedule-arrow {
    padding-left: 5px;

    font-size: 22px;
    font-weight: 400;

    color: #94a3b8;
}


/* DARK MODE */

.dark .schedule-group-title {
    color: #717b8c;
}

.dark .schedule-item {
    background: #181b22;
    border-color: #2a2f39;
    color: #ffffff;
    box-shadow: none;
}

.dark .schedule-item:hover {
    background: #1d2129;
    border-color: #3a414e;
}

.dark .schedule-time {
    border-right-color: #303641;
}

.dark .schedule-time strong,
.dark .schedule-info strong {
    color: #f8fafc;
}

.dark .schedule-time small,
.dark .schedule-info small {
    color: #8b95a7;
}

.dark .schedule-arrow {
    color: #5f6978;
}


/* HANDY */

@media (max-width: 700px) {

    .dashboard-schedule {
        gap: 15px;
    }

    .schedule-item {
        grid-template-columns: 62px 1fr auto;

        padding: 11px;
        gap: 10px;
    }

    .schedule-time {
        padding-right: 9px;
    }

    .schedule-time strong {
        font-size: 16px;
    }

    .schedule-time small {
        font-size: 9px;
    }

    .schedule-info strong {
        font-size: 13px;
    }

    .schedule-info small {
        font-size: 11px;
    }
}
.kundly-powered {
    margin-top: 24px;
    text-align: center;
    font-size: 10px;
    color: #94a3b8;
}

.kundly-powered-inner {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.kundly-powered-logo {
    width: 18px;
    height: 18px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 5px;

    background: #111827;
    color: #ffffff;

    font-size: 10px;
    font-weight: 800;
}

.kundly-powered strong {
    color: #475569;
    font-weight: 700;
}


/* Existing view classes: shared layout contract for app.js. */
.entity-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.entity-card { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.entity-card h3 { overflow-wrap: anywhere; }
.entity-contact { display: flex; flex-wrap: wrap; gap: 6px 14px; overflow-wrap: anywhere; }
.entity-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; }
.dashboard-main-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 12px; margin: 12px 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.panel-head > div { display: grid; gap: 4px; }
.compact-list { display: grid; gap: 6px; }
.compact-list-item, .order-mini { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-width: 0; text-align: left; background: var(--surface-soft); color: var(--text); border: 1px solid var(--border); padding: 12px; }
.compact-list-item:hover, .order-mini:hover { background: var(--surface-hover); border-color: var(--border-strong); }
.compact-date { color: var(--text-soft); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.compact-main { flex: 1; min-width: 0; }
.compact-main strong, .compact-main small, .order-mini small { display: block; overflow: hidden; text-overflow: ellipsis; }
.compact-main small, .order-mini small { margin-top: 4px; color: var(--text-soft); }
.quick-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.quick-stats button { display: grid; justify-items: start; gap: 6px; padding: 12px 8px; color: var(--text); background: var(--surface-soft); border: 1px solid var(--border); min-width: 0; }
.quick-stats button:hover { background: var(--surface-hover); }
.quick-stats strong { font-size: 15px; overflow-wrap: anywhere; }
.quick-stats small { color: var(--text-soft); }
.orders-compact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.order-mini > div { min-width: 0; }
.order-mini-right { display: grid; justify-items: end; gap: 6px; flex-shrink: 0; }
.mini-empty { padding: 20px 8px; color: var(--text-soft); }
.dashboard-kpis .metric-card { position: relative; align-items: stretch; justify-content: space-between; min-height: 105px; gap: 10px; }
.dashboard-kpis .metric-top { width: 100%; }
.dashboard-kpis .metric-trend { position: static; align-self: flex-start; margin: 0; font-size: 11px; }
.metric-money { overflow-wrap: anywhere; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
.form-group { min-width: 0; }
.split { flex-wrap: wrap; }
#docKatalog { min-width: 0 !important; max-width: 100%; }
.form-group label { font-size: 12px; }
.small { font-size: 12px; }
button, .btn { font-size: 12px; min-height: 34px; }
.btn-sm { min-height: 30px; font-size: 11px; }
input, select, textarea { font-size: 14px; min-height: 38px; }
:root { --content: 1180px; }
@media (max-width: 1000px) {
  .dashboard-main-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  input, select, textarea { font-size: 16px; min-height: 44px; }
  button, .btn, .btn-sm { min-height: 44px; }
  .content-area { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .toast-host { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .cal-item { height: 6px; padding: 0; font-size: 0; line-height: 0; border: 0; }
  .compact-list-item { gap: 8px; }
  .compact-date { font-size: 11px; }
}
@media (max-width: 600px) {
  .entity-grid, .orders-compact-grid { grid-template-columns: 1fr; }
  .compact-list-item { flex-wrap: wrap; }
  .compact-main { flex-basis: 55%; }
  .panel-head { flex-wrap: wrap; }
  .quick-stats strong { font-size: 13px; }
  .dashboard-actions button { white-space: normal; }
}
@media print {
  .print-doc tr { break-inside: avoid; }
  .print-doc thead { display: table-header-group; }
  .print-footer { position: static; margin-top: 24px; break-inside: avoid; }
  .print-totals { break-inside: avoid; }
  .print-doc h1, .print-doc h2, .print-doc h3 { color: #111; }
}

/* Current customer and reminder forms. */
.narrow { max-width: 940px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-group.full { grid-column: 1 / -1; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.entity-card-head { display: flex; align-items: center; gap: 12px; }
.avatar { width: 40px; height: 40px; flex-shrink: 0; display: grid; place-items: center; border-radius: 12px; background: var(--primary-soft); color: var(--primary); font-weight: 750; }
.entity-card-title { min-width: 0; flex: 1; display: grid; gap: 4px; }
.entity-card-title strong { font-size: 15px; overflow-wrap: anywhere; }
.entity-card-title span, .entity-meta { color: var(--text-soft); font-size: 12px; }
.entity-meta { display: grid; gap: 6px; overflow-wrap: anywhere; }
.entity-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--border); padding-top: 12px; margin-top: auto; }
.entity-card-foot > div { display: grid; gap: 4px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { background: var(--surface-hover); color: var(--text-soft); border: 1px solid var(--border); border-radius: 6px; padding: 3px 7px; font-size: 11px; }
.auth-shell-reset { max-width: 440px; grid-template-columns: 1fr; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } .entity-card-head { flex-wrap: wrap; } }
