/* Desktop-beheer */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--indigo); color: #fff; display: flex; flex-direction: column; padding: 22px 14px 16px; position: sticky; top: 0; height: 100vh; }
.sidebar .wordmark { padding: 0 8px 22px; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.sidebar nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: rgba(255,255,255,.78); text-decoration: none; font-weight: 500; border-left: 3px solid transparent; }
.sidebar nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar nav a.active { background: rgba(255,255,255,.12); color: #fff; border-left-color: var(--orange); }
.sidebar nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sidebar .count { margin-left: auto; background: var(--orange); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 7px; font-weight: 600; }
.nav-sep { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.45); padding: 16px 12px 6px; }
.sidebar-foot { border-top: 1px solid rgba(255,255,255,.14); padding: 12px 8px 0; font-size: 12px; }
.me b { display: block; font-size: 13px; }
.me span { color: rgba(255,255,255,.6); word-break: break-all; }
.me-actions { display: flex; gap: 12px; margin: 8px 0; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--teal); cursor: pointer; font-size: 12px; font-weight: 500; }
.linkbtn:hover { text-decoration: underline; }
.mobile-link { color: rgba(255,255,255,.6); font-size: 12px; text-decoration: none; }
.mobile-link:hover { color: #fff; }

.content { padding: 26px 32px 48px; min-width: 0; outline: none; }
.page-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: 24px; }
.page-head .spacer { flex: 1; }
.page-head p { margin: 2px 0 0; color: var(--muted); }

.weeknav { display: inline-flex; align-items: center; gap: 4px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 3px; }
.weeknav button { border: 0; background: none; width: 32px; height: 32px; border-radius: 7px; cursor: pointer; font-size: 16px; }
.weeknav button:hover { background: var(--cream-2); }
.weeknav .label { padding: 0 10px; font-weight: 600; color: var(--indigo); font-size: 14px; min-width: 210px; text-align: center; }
.weeknav .today { width: auto; padding: 0 10px; font-size: 13px; font-weight: 500; color: var(--teal-dark); }

.card { background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 18px 20px; }
.card h2 { font-size: 16px; margin-bottom: 12px; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.tile { background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 16px 18px; border-top: 4px solid var(--teal); text-decoration: none; color: inherit; display: block; }
.tile.orange { border-top-color: var(--orange); }
.tile.indigo { border-top-color: var(--indigo); }
.tile .k { font-size: 12px; color: var(--muted); font-weight: 500; }
.tile .v { font-size: 30px; font-weight: 700; line-height: 1.2; }
.tile .s { font-size: 12px; color: var(--muted); }
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }

table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.list td { padding: 9px 10px; border-bottom: 1px solid var(--cream-2); vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
table.list tbody tr:hover { background: #fbfaf6; }
table.list th.num, table.list td.num { text-align: right; }
table.list td.actions { text-align: right; white-space: nowrap; }
table.list tr.inactive td { color: var(--muted); }
.empty { padding: 28px 10px; text-align: center; color: var(--muted); }

/* Planning-raster */
.grid-wrap { background: #fff; border-radius: 14px; box-shadow: var(--shadow); overflow: auto; }
table.grid { width: 100%; border-collapse: collapse; table-layout: fixed; min-width: 980px; }
table.grid th, table.grid td { border-bottom: 1px solid var(--cream-2); border-right: 1px solid var(--cream-2); vertical-align: top; }
table.grid thead th { background: var(--cream); font-size: 12px; font-weight: 600; padding: 8px; text-align: left; position: sticky; top: 0; z-index: 1; }
table.grid thead th small { display: block; font-weight: 400; color: var(--muted); }
table.grid thead th.today { background: var(--info-bg); color: var(--teal-dark); }
table.grid th.who { width: 190px; text-align: left; padding: 10px 12px; font-weight: 500; background: #fff; }
table.grid th.who small { display: block; color: var(--muted); font-weight: 400; margin-bottom: 4px; }
table.grid td.cell { padding: 5px; height: 64px; cursor: pointer; position: relative; }
table.grid td.cell:hover { background: #fbfaf6; }
table.grid td.cell:hover::after { content: '+'; position: absolute; right: 6px; bottom: 2px; color: var(--muted); font-size: 16px; }
table.grid td.cell.weekend { background: #faf8f3; }
table.grid td.cell.locked { cursor: default; }
table.grid td.cell.locked:hover::after { content: ''; }
table.grid td.total, table.grid th.total { width: 92px; text-align: right; padding: 10px 12px; font-variant-numeric: tabular-nums; }
table.grid td.total small { display: block; color: var(--muted); }
table.grid tfoot td { background: var(--cream); font-weight: 600; padding: 8px; text-align: right; font-variant-numeric: tabular-nums; }
table.grid tfoot td:first-child { text-align: left; padding-left: 12px; }
.chip { display: block; width: 100%; text-align: left; border: 0; border-left: 4px solid var(--muted); background: var(--cream); border-radius: 6px; padding: 4px 7px; margin-bottom: 4px; cursor: pointer; font-size: 12px; line-height: 1.35; }
.chip:hover { filter: brightness(.97); }
.chip b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-open { border-left-color: #b9b3a3; }
.chip-akkoord { border-left-color: var(--ok); background: var(--ok-bg); }
.chip-meer, .chip-extra { border-left-color: var(--orange); background: var(--warn-bg); }
.chip-minder { border-left-color: var(--minder); background: var(--minder-bg); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* Weekstaten */
.review { background: #fff; border-radius: 14px; box-shadow: var(--shadow); margin-bottom: 12px; overflow: hidden; }
.review summary { list-style: none; display: grid; grid-template-columns: minmax(180px, 1.4fr) 110px 120px 90px 90px 90px minmax(120px, 1fr) 20px; gap: 12px; align-items: center; padding: 13px 18px; cursor: pointer; }
.review summary::-webkit-details-marker { display: none; }
.review summary::after { content: '▾'; color: var(--muted); }
.review[open] summary::after { content: '▴'; }
.review summary b { font-weight: 600; }
.review summary small { display: block; color: var(--muted); }
.review .body { border-top: 1px solid var(--cream-2); padding: 6px 18px 16px; }
.review .actions { display: flex; gap: 8px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.review-head { display: grid; grid-template-columns: minmax(180px, 1.4fr) 110px 120px 90px 90px 90px minmax(120px, 1fr) 20px; gap: 12px; padding: 0 18px 8px; font-size: 12px; color: var(--muted); font-weight: 500; }
.diff-pos { color: var(--orange-dark); font-weight: 600; }
.diff-neg { color: var(--minder); font-weight: 600; }
.seg { display: inline-flex; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 3px; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 7px; cursor: pointer; font-weight: 500; }
.seg button.on { background: var(--indigo); color: #fff; }

pre.code { background: var(--indigo); color: #e9e6f7; border-radius: var(--radius); padding: 14px; overflow: auto; font-size: 12px; line-height: 1.5; margin: 0; }
details.more > summary { cursor: pointer; font-weight: 500; color: var(--teal-dark); margin: 4px 0 10px; }

dialog { border: 0; border-radius: 16px; padding: 0; width: min(520px, calc(100vw - 32px)); box-shadow: 0 30px 80px rgba(28,17,77,.35); color: var(--text); }
dialog::backdrop { background: rgba(28, 17, 77, .45); }
dialog form { padding: 20px 22px; }
dialog header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
dialog header h2 { font-size: 18px; }
dialog footer { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
dialog footer .left { margin-right: auto; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.daypick { display: flex; gap: 6px; flex-wrap: wrap; }
.daypick label { border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; cursor: pointer; font-size: 13px; color: var(--text); user-select: none; }
.daypick input { position: absolute; opacity: 0; pointer-events: none; }
.daypick label:has(input:checked) { background: var(--indigo); color: #fff; border-color: var(--indigo); }
.daypick label:has(input:focus-visible) { outline: 2px solid var(--teal); outline-offset: 2px; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: 16px; height: 16px; accent-color: var(--teal-dark); }
.secret { font-family: ui-monospace, Consolas, monospace; font-size: 20px; letter-spacing: .04em; background: var(--cream); border-radius: var(--radius); padding: 14px; text-align: center; user-select: all; }
dl.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; }

@media (max-width: 1100px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .content { padding: 18px 14px 40px; }
}
