:root {
  --ink: #07111f;
  --ink-soft: #0f1c2e;
  --paper: #f3efe6;
  --card: #fffcf7;
  --line: #ddd6c8;
  --muted: #6b6458;
  --accent: #0f766e;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.45 system-ui, sans-serif;
}
a { color: inherit; text-decoration: none; }
input, select, textarea, button { font: inherit; }
.btn, button.btn, a.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  border: 0; border-radius: 8px; padding: .5rem .9rem; background: var(--accent); color: #fff; cursor: pointer;
}
a.btn-outline, button.btn-outline { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.btn-danger, button.btn-danger { background: #b91c1c; color: #fff; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, monospace; }
.page { margin-bottom: 1.5rem; display: flex; justify-content: space-between; align-items: end; gap: 1rem; flex-wrap: wrap; }
.page h1 { margin: 0; font-size: 1.5rem; }
.grid { display: grid; gap: 1rem; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.grid-2 { grid-template-columns: 1fr 340px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }
.stat { padding: 1.1rem 1.25rem; }
.stat p { margin: 0; }
.stat .n { font-size: 1.6rem; font-weight: 650; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: .7rem 1.1rem; border-bottom: 1px solid var(--line); }
td { padding: .7rem 1.1rem; border-bottom: 1px solid rgba(221,214,200,.7); vertical-align: top; }
.field { display: block; margin-bottom: .75rem; }
.field span { display: block; font-size: .8rem; margin-bottom: .25rem; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: .5rem .7rem; background: var(--card);
}
.badge { display: inline-block; border-radius: 999px; padding: .1rem .5rem; font-size: .72rem; background: #e7e5e0; }
.badge.active, .badge.paid { background: #ccfbf1; color: #115e59; }
.badge.open { background: #fef3c7; color: #92400e; }
.badge.overdue, .badge.suspended { background: #fee2e2; color: #991b1b; }
.badge.prepaid { background: #fef3c7; color: #92400e; }
.badge.pending, .badge.draft { background: #e5e7eb; }
.badge.terminated, .badge.cancelled, .badge.closed { background: #f3f4f6; color: #4b5563; }

/* Kundendetail */
.client-head { margin-bottom: .5rem; }
.client-head h1 { margin: 0; font-size: 1.45rem; }
.client-breadcrumb { font-size: .82rem; color: var(--muted); margin-bottom: 1rem; }
.client-breadcrumb a { text-decoration: underline; text-underline-offset: 2px; }
.client-tabs {
  display: flex; gap: .15rem; flex-wrap: wrap;
  border-bottom: 1px solid var(--line); margin-bottom: 1.25rem;
}
.client-tabs a {
  padding: .55rem .85rem; border-radius: 10px 10px 0 0;
  color: var(--muted); font-size: .88rem;
}
.client-tabs a.on {
  background: var(--card); color: var(--ink); font-weight: 600;
  border: 1px solid var(--line); border-bottom-color: var(--card); margin-bottom: -1px;
}
.client-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) { .client-grid-3 { grid-template-columns: 1fr; } }
.client-panel { padding: 1rem 1.1rem 1.15rem; }
.client-panel h2, .client-panel h3 {
  margin: 0 0 .85rem; font-size: .95rem; font-weight: 650;
  padding-bottom: .55rem; border-bottom: 1px solid var(--line);
}
.info-list { display: grid; gap: 0; font-size: .88rem; }
.info-row {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: .42rem 0; border-bottom: 1px solid rgba(221,214,200,.55);
}
.info-row:last-child { border-bottom: 0; }
.info-row .k { color: var(--muted); flex: 0 0 42%; }
.info-row .v { text-align: right; word-break: break-word; }
.info-row .v.ok { color: #047857; font-weight: 600; }
.info-row .v.bad { color: #b91c1c; font-weight: 600; }
.action-stack { display: grid; gap: .45rem; margin-top: .85rem; }
.action-stack .btn, .action-stack button.btn { width: 100%; justify-content: center; }
.action-stack .btn-danger { background: #b91c1c; }
.service-summary { display: grid; gap: .35rem; font-size: .88rem; }
.service-summary-row { display: flex; justify-content: space-between; gap: .75rem; }
.service-summary-total {
  margin-top: .65rem; padding-top: .65rem; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; font-weight: 650; color: #047857;
}
.client-notes textarea { min-height: 110px; resize: vertical; }
.flash-msg {
  padding: .75rem 1rem; margin-bottom: 1rem; border-radius: 10px;
  background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46;
}
.admin { min-height: 100vh; }
@media (min-width: 960px) { .admin { display: grid; grid-template-columns: 260px 1fr; } }
.side { background: var(--ink); color: #e7e5e4; }
.side-brand { display: flex; align-items: center; gap: .7rem; height: 64px; padding: 0 1.1rem; border-bottom: 1px solid rgba(255,255,255,.1); }
.mark { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; background: #14b8a6; color: var(--ink); font-weight: 700; }
.side nav { padding: 1rem .7rem; }
.side .g { font-size: .65rem; letter-spacing: .16em; text-transform: uppercase; color: #78716c; padding: 0 .5rem; margin: .9rem 0 .3rem; }
.side a { display: block; padding: .5rem .65rem; border-radius: 8px; color: #d6d3d1; }
.side a.on, .side a:hover { background: rgba(255,255,255,.1); color: #fff; }
.top { height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 1.5rem; border-bottom: 1px solid var(--line); background: rgba(243,239,230,.9); }
main.wrap { padding: 1.5rem; }
.shop-head, .acc-head { background: var(--ink); color: #e7e5e4; }
.shop-head .inner, .acc-head .inner { max-width: 1100px; margin: 0 auto; padding: 0 1rem; height: 64px; display: flex; align-items: center; justify-content: space-between; }
.acc-nav { max-width: 1100px; margin: 0 auto; padding: 0 1rem .7rem; display: flex; gap: .3rem; }
.acc-nav a { padding: .35rem .7rem; border-radius: 8px; color: #d6d3d1; }
.acc-nav a.on { background: rgba(255,255,255,.1); color: #fff; }
.auth { min-height: 100vh; display: grid; place-items: center; background: var(--ink); color: #f5f5f4; }
.auth-box { width: min(420px, 92vw); background: var(--ink-soft); border: 1px solid rgba(255,255,255,.1); border-radius: 24px; padding: 2rem; }
.auth-box input { background: rgba(255,255,255,.05); color: #fff; border-color: rgba(255,255,255,.15); }
.empty { padding: 2rem 1.2rem; color: var(--muted); }
.right { text-align: right; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
@media (max-width: 640px) { .row-2 { grid-template-columns: 1fr; } }
