[hidden] { display: none !important; }
:root {
    --ink: #1f2a37; --muted: #6b7684; --line: #e3e7ec; --bg: #f5f7f9; --card: #fff;
    --brand: #1d4e5f; --brand-2: #2f7d79; --accent: #2f9e6e; --danger: #c2413b; --warn: #d9a21b;
    --closed: #eef1f4; --radius: 8px;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--ink); background: var(--bg); font-size: 14px;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--brand-2); }
h1 { font-size: 22px; margin: 0; }
h2 { font-size: 16px; margin: 0 0 10px; }
.muted { color: var(--muted); font-weight: normal; }
.small { font-size: 12px; }
.mt { margin-top: 20px; }

.shell { display: flex; min-height: 100vh; }
.sidebar { width: 76px; background: var(--brand); display: flex; flex-direction: column; align-items: center; padding: 12px 0; gap: 4px; position: sticky; top: 0; height: 100vh; }
.sidebar a, .sidebar button { width: 64px; padding: 8px 0; color: #cfe3e6; text-decoration: none; display: flex; flex-direction: column; align-items: center; gap: 3px; border-radius: 8px; font-size: 10.5px; background: none; border: 0; cursor: pointer; font-family: inherit; }
.sidebar a:hover, .sidebar button:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar a.active { background: rgba(255,255,255,.15); color: #fff; }
.sidebar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sidebar .logout { margin-top: auto; }
.brand { font-weight: 800; letter-spacing: .5px; color: #fff !important; background: var(--brand-2) !important; width: 44px !important; height: 44px; border-radius: 12px !important; justify-content: center !important; font-size: 15px !important; margin-bottom: 10px; display: flex; align-items: center; }
.brand.big { margin: 0 auto 12px; width: 56px !important; height: 56px; font-size: 18px !important; }
.main { flex: 1; padding: 18px 22px; min-width: 0; }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: var(--radius); cursor: pointer; text-decoration: none; font: inherit; line-height: 1.2; white-space: nowrap; }
.btn:hover { border-color: #c7ced6; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(.95); }
.btn.small { padding: 4px 8px; font-size: 12px; }
.btn.wide { width: 100%; justify-content: center; padding: 10px; }
.btn.disabled { opacity: .45; pointer-events: none; }
.link { background: none; border: 0; color: var(--brand-2); cursor: pointer; padding: 0; font: inherit; text-decoration: underline; }

input, select, textarea { font: inherit; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid #9fd3c7; border-color: var(--brand-2); }
input[type=checkbox] { width: auto; }
input[type=color] { padding: 2px; height: 36px; }
label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 13px; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: normal; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin: 0; }
legend { font-weight: 600; padding: 0 4px; }
.row2, .row3, .row4 { display: grid; gap: 10px; }
.row2 { grid-template-columns: 1fr 1fr; }
.row3 { grid-template-columns: repeat(3, 1fr); }
.row4 { grid-template-columns: repeat(4, 1fr); }
.checks { display: flex; flex-wrap: wrap; gap: 6px 18px; }
form.inline { display: inline; }
form.inline input, form.inline select { width: auto; }

.flash { background: #e6f6ee; border: 1px solid #b6e3cc; color: #145c3a; padding: 9px 12px; border-radius: var(--radius); margin-bottom: 12px; }
.flash.error { background: #fdecea; border-color: #f5c2bd; color: #8a201a; }

.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 10px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.form { display: flex; flex-direction: column; gap: 12px; max-width: 860px; }
.form footer, .modal footer { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.grid2 { display: grid; grid-template-columns: minmax(280px, 1fr) 2fr; gap: 14px; }
.dl { display: grid; grid-template-columns: 140px 1fr; gap: 6px 10px; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; }
.pinned { background: #fff8e1; border: 1px solid #f3dc95; padding: 8px 12px; border-radius: var(--radius); margin-bottom: 12px; }

.searchbar { display: flex; gap: 8px; margin-bottom: 12px; }
.table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.table th, .table td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { background: #fafbfc; font-size: 12px; color: var(--muted); font-weight: 600; }
.table.compact td { padding: 6px 8px; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: #f7fafb; }
.table .num { text-align: right; white-space: nowrap; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin: 14px 0; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; }
.hours th { text-align: left; padding-right: 14px; font-weight: 600; }
.hours td { padding: 3px 14px 3px 0; white-space: nowrap; }
.hours input { width: 110px; }
.empty { text-align: center; padding: 60px 20px; background: #fff; border: 1px dashed var(--line); border-radius: 12px; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; background: #e8eef3; }
.badge.s-booked { background: #dbeafe; color: #1e40af; }
.badge.s-arrived { background: #fef3c7; color: #92400e; }
.badge.s-completed { background: #dcfce7; color: #166534; }
.badge.s-no_show { background: #fee2e2; color: #991b1b; }
.badge.s-cancelled { background: #e5e7eb; color: #4b5563; text-decoration: line-through; }

/* Kalender */
.cal-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.cal-toolbar .group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cal-title { font-size: 17px; margin-left: 8px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.seg a { padding: 7px 12px; text-decoration: none; color: var(--ink); background: #fff; }
.seg a.on { background: var(--brand); color: #fff; }

.cal { background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: auto; max-height: calc(100vh - 110px); }
.cal-head, .cal-body { display: grid; grid-template-columns: 56px repeat(var(--cols), minmax(130px, 1fr)); min-width: calc(56px + var(--cols) * 130px); }
.cal-head { position: sticky; top: 0; z-index: 5; background: #fff; border-bottom: 1px solid var(--line); }
.col-head { padding: 9px 6px; text-align: center; font-weight: 600; border-left: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col-head a { color: var(--ink); text-decoration: none; }
.col-head a:hover { text-decoration: underline; }
.col-head.today { background: #eef8f4; }
.gutter { position: relative; }
.cal-head .gutter { border: 0; }
.hour-label { position: absolute; right: 6px; transform: translateY(-50%); font-size: 11px; color: var(--muted); }
.hour-label:first-child { transform: none; }
.col { position: relative; border-left: 1px solid var(--line); background: var(--closed);
    background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(60px * var(--px-per-min) - 1px), #dfe4ea calc(60px * var(--px-per-min) - 1px), #dfe4ea calc(60px * var(--px-per-min))); cursor: copy; }
.col .open { position: absolute; left: 0; right: 0; background: #fff;
    background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(15px * var(--px-per-min) - 1px), #f1f3f5 calc(15px * var(--px-per-min) - 1px), #f1f3f5 calc(15px * var(--px-per-min))); }
.col .blocked { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(135deg, #e5e7eb, #e5e7eb 6px, #f3f4f6 6px, #f3f4f6 12px); border-top: 2px solid #9ca3af; font-size: 11px; color: #4b5563; padding: 2px 4px; display: flex; justify-content: space-between; z-index: 1; cursor: default; overflow: hidden; }
.col .blocked button { background: none; border: 0; cursor: pointer; color: #6b7280; font-size: 14px; line-height: 1; }
.appt { position: absolute; left: 2px; width: calc(100% - 4px); z-index: 2; text-align: left; border: 0; border-left: 4px solid var(--c); background: color-mix(in srgb, var(--c) 18%, #fff); border-radius: 5px; padding: 3px 6px; font: inherit; font-size: 11.5px; line-height: 1.25; overflow: hidden; cursor: pointer; color: var(--ink); display: flex; flex-direction: column; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.appt:hover { box-shadow: 0 2px 8px rgba(0,0,0,.15); z-index: 3; }
.appt .t { font-size: 10.5px; color: var(--muted); }
.appt .n { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt .s { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #4b5563; }
.appt.online::after { content: "online"; position: absolute; top: 3px; right: 4px; font-size: 9px; background: #1e40af; color: #fff; padding: 0 4px; border-radius: 3px; }
.appt.status-arrived { background: #fff3c4; }
.appt.status-completed { background: #d9f2e3; }
.appt.status-no_show { background: #fde1df; text-decoration: line-through; }
.appt.highlight { outline: 2px solid var(--accent); animation: pulse 1.2s ease 2; }
@keyframes pulse { 50% { outline-offset: 3px; } }
.now { position: absolute; left: 0; right: 0; height: 2px; background: #e4572e; z-index: 4; pointer-events: none; }
.now::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: #e4572e; }

.modal { border: 0; border-radius: 12px; padding: 0; width: min(720px, 96vw); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.small { width: min(480px, 96vw); }
.modal::backdrop { background: rgba(15, 30, 40, .45); }
.modal form { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.modal header { display: flex; justify-content: space-between; align-items: center; }
.modal header h2 { margin: 0; font-size: 18px; }
.modal .x { background: none; border: 0; font-size: 22px; cursor: pointer; color: var(--muted); }
.spacer { flex: 1; }
.client-pick { position: relative; }
.chosen { display: flex; align-items: center; gap: 12px; }
.chosen > div { flex: 1; }
.results { list-style: none; margin: 4px 0 0; padding: 0; border: 1px solid var(--line); border-radius: 6px; max-height: 220px; overflow: auto; background: #fff; position: absolute; left: 12px; right: 12px; z-index: 10; box-shadow: 0 6px 20px rgba(0,0,0,.12); }
.results li { padding: 7px 10px; cursor: pointer; border-bottom: 1px solid var(--line); }
.results li:hover, .results li:focus { background: #eef8f4; outline: none; }
#new-client { margin-top: 8px; }
#new-client summary { cursor: pointer; color: var(--brand-2); }
#new-client .row3 { margin-top: 8px; }
.slots { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.chip { border: 1px solid #b6e3cc; background: #effaf4; border-radius: 99px; padding: 2px 8px; font: inherit; font-size: 12px; cursor: pointer; }
.chip:hover { background: #d7f2e3; }
.status-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.status-btn.s-cancelled, .status-btn.s-no_show { color: var(--danger); }

.login-page { display: grid; place-items: center; min-height: 100vh; background: linear-gradient(135deg, var(--brand), #0e2a35); }
.login-card { background: #fff; padding: 28px; border-radius: 14px; width: min(380px, 92vw); display: flex; flex-direction: column; gap: 12px; text-align: center; }
.login-card label { text-align: left; }
.login-card h1 { font-size: 19px; }
.login-card p { margin: 0 0 4px; }

@media (max-width: 800px) {
    .sidebar { width: 58px; }
    .sidebar a, .sidebar button { width: 50px; font-size: 0; }
    .main { padding: 12px; }
    .row3, .row4, .grid2 { grid-template-columns: 1fr 1fr; }
}
