/* MAS Keuringen — design system
   Tokens → base → layout → components → pages → utilities → print */

:root {
  --navy-950: #0a1530;
  --navy-900: #0f1e3d;
  --navy-800: #16295a;
  --brand-700: #1a428a;
  --brand-600: #1f4fa3;
  --brand-500: #2f63c4;
  --brand-100: #dce7fa;
  --brand-50:  #eef3fc;
  --accent:    #e8622c;
  --accent-50: #fdf0ea;

  --bg:       #f3f5fa;
  --surface:  #ffffff;
  --surface-2:#f8fafd;
  --border:   #e2e7f0;
  --border-strong: #cdd5e3;
  --text:     #15223d;
  --text-2:   #3b4a65;
  --muted:    #64738c;

  --success: #0d7a52; --success-bg: #e3f5ec;
  --warning: #9a5b00; --warning-bg: #fff3d6;
  --danger:  #c0322f; --danger-bg:  #fdeaea;
  --info:    #1d63c4; --info-bg:    #e7f0fd;
  --neutral: #55637a; --neutral-bg: #edf0f5;

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 30, 61, .06);
  --shadow:    0 1px 3px rgba(15, 30, 61, .06), 0 6px 16px rgba(15, 30, 61, .06);
  --shadow-lg: 0 12px 40px rgba(15, 30, 61, .16);
  --ring:      0 0 0 3px rgba(47, 99, 196, .28);

  --sidebar-w: 268px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* ── Base ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.55; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.25; color: var(--navy-900); letter-spacing: -.01em; }
p { margin: 0 0 1em; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { color: var(--brand-700); text-decoration: underline; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.icon { width: 18px; height: 18px; flex: none; vertical-align: middle; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--radius-sm); }
.skip-link { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; z-index: 100; border-radius: var(--radius-sm); }
.skip-link:focus { left: 8px; }

/* ── App shell ────────────────────────────────────────────────────────────── */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 40;
  display: flex; flex-direction: column; background: var(--navy-900); color: #c9d4ea;
  overflow-y: auto; transition: transform .25s ease;
}
.is-admin .sidebar { background: linear-gradient(180deg, var(--navy-950), #101f44); }
.sidebar__head { display: flex; align-items: center; justify-content: space-between; padding: 20px 18px 16px; }
.sidebar__env { margin: 0 18px 8px; padding: 6px 10px; border-radius: var(--radius-sm); background: rgba(232, 98, 44, .14); color: #ffb08f; font-size: 12px; font-weight: 600; display: flex; gap: 6px; align-items: center; }
.sidebar__env .icon { width: 14px; height: 14px; }
.sidebar__foot { margin-top: auto; padding: 14px 12px 18px; border-top: 1px solid rgba(255,255,255,.07); }
.sidebar__contact { display: grid; gap: 4px; padding: 4px 8px 10px; font-size: 13px; }
.sidebar__contact span { color: #8193b5; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 2px; }
.sidebar__contact a { color: #c9d4ea; display: flex; gap: 8px; align-items: center; }
.sidebar__contact a:hover { color: #fff; text-decoration: none; }
.sidebar__contact .icon { width: 14px; height: 14px; opacity: .7; }

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none !important; }
.brand__mark { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand-500), var(--brand-700)); color: #fff; box-shadow: inset 0 -3px 0 var(--accent); }
.brand__mark .icon { width: 20px; height: 20px; }
.brand__text { display: flex; flex-direction: column; line-height: 1.2; }
.brand__name { font-weight: 700; font-size: 15px; color: var(--navy-900); }
.brand__sub { font-size: 11px; color: var(--muted); }
.brand--light .brand__name { color: #fff; }
.brand--light .brand__sub { color: #8fa1c4; }
/* The logo has dark-blue lettering, so on the navy sidebar and login panel it sits on a white plate */
.brand__logo { display: block; width: 196px; max-width: 100%; height: auto; padding: 8px 12px; border-radius: 10px; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.auth__brand .brand__logo { width: 220px; }

.nav { padding: 6px 12px; display: grid; gap: 2px; }
.nav__section { padding: 16px 10px 6px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: #7184a9; }
.nav__link { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 8px; color: #c9d4ea; font-weight: 500; font-size: 14px; text-decoration: none !important; transition: background .15s, color .15s; }
.nav__link:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav__link.is-active { background: rgba(47, 99, 196, .32); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.nav__link .icon { opacity: .85; }
.nav__link.is-disabled { opacity: .5; cursor: default; }
.nav__link.is-disabled:hover { background: none; color: #c9d4ea; }
.nav__text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.nav__soon { font-size: 11px; font-weight: 500; color: #7f91b4; }
.nav__badge { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 600; text-align: center; }

.main-col { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; height: 64px; display: flex; align-items: center; gap: 12px; padding: 0 28px; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.topbar__title { font-weight: 600; color: var(--text-2); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.content { flex: 1; width: 100%; max-width: 1240px; padding: 28px; margin: 0 auto; }
.footer { padding: 18px 28px; color: var(--muted); font-size: 12px; text-align: center; }

.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 8px; background: transparent; color: inherit; cursor: pointer; }
.icon-btn:hover { background: rgba(15,30,61,.06); }
.sidebar .icon-btn:hover { background: rgba(255,255,255,.08); }
.sidebar__close, .topbar__menu { display: none; }

.user-menu { position: relative; margin-left: auto; }
.user-menu__btn { display: flex; align-items: center; gap: 10px; padding: 5px 8px 5px 5px; border: 1px solid transparent; border-radius: 999px; background: none; cursor: pointer; font: inherit; color: var(--text); }
.user-menu__btn:hover { background: var(--surface-2); border-color: var(--border); }
.user-menu__who { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.user-menu__name { font-weight: 600; font-size: 14px; }
.user-menu__role { font-size: 12px; color: var(--muted); }
.user-menu__panel { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.user-menu__email { padding: 8px 10px 10px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--border); margin-bottom: 4px; overflow-wrap: anywhere; }
.user-menu__panel a, .user-menu__panel button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 10px; border: 0; border-radius: 6px; background: none; font: inherit; font-size: 14px; color: var(--text); text-align: left; cursor: pointer; text-decoration: none !important; }
.user-menu__panel a:hover, .user-menu__panel button:hover { background: var(--surface-2); }
.user-menu__panel form { margin: 0; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand-500), var(--brand-700)); color: #fff; font-size: 13px; font-weight: 600; flex: none; }
.avatar--lg { width: 56px; height: 56px; font-size: 18px; }

.sidebar-backdrop { display: none; }

/* ── Page head ────────────────────────────────────────────────────────────── */
.page-head { margin-bottom: 24px; }
.page-head__row { display: flex; gap: 16px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
.page-head__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.page-title { font-size: 26px; font-weight: 700; margin: 0; }
.page-sub { margin: 6px 0 0; color: var(--muted); max-width: 70ch; }
.back-link { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px; font-size: 14px; font-weight: 500; color: var(--muted); }
.back-link .icon { width: 16px; height: 16px; }

/* ── Cards ────────────────────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card + .card, .stack > * + * { margin-top: 20px; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card__title { margin: 0; font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card__title .icon { color: var(--brand-600); }
.card__body { padding: 20px; }
.card__foot { padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.card--flush .card__body { padding: 0; }

.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px 20px; }
.col-3 { grid-column: span 3; } .col-4 { grid-column: span 4; } .col-5 { grid-column: span 5; } .col-6 { grid-column: span 6; }
.col-7 { grid-column: span 7; } .col-8 { grid-column: span 8; } .col-12 { grid-column: span 12; }
.layout-2 { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.layout-2 > * { margin-top: 0 !important; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { padding: 18px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); display: flex; gap: 14px; align-items: center; }
.stat__icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-600); flex: none; }
.stat__icon--accent { background: var(--accent-50); color: var(--accent); }
.stat__icon--success { background: var(--success-bg); color: var(--success); }
.stat__icon--warning { background: var(--warning-bg); color: var(--warning); }
.stat__value { font-size: 24px; font-weight: 700; line-height: 1.1; color: var(--navy-900); }
.stat__label { font-size: 13px; color: var(--muted); }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px; border: 1px solid transparent; border-radius: 8px; font: inherit; font-size: 14px; font-weight: 600; line-height: 1.2; cursor: pointer; text-decoration: none !important; white-space: nowrap; transition: background .15s, border-color .15s, color .15s, box-shadow .15s; }
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: var(--brand-600); color: #fff; box-shadow: 0 1px 2px rgba(31,79,163,.3); }
.btn-primary:hover { background: var(--brand-700); color: #fff; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #d4531f; color: #fff; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); color: var(--text); border-color: #b7c2d6; }
.btn-ghost { background: transparent; color: var(--brand-600); }
.btn-ghost:hover { background: var(--brand-50); color: var(--brand-700); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: #f1c1c0; }
.btn-danger:hover { background: var(--danger-bg); color: var(--danger); }
.btn-danger-solid { background: var(--danger); color: #fff; }
.btn-danger-solid:hover { background: #a42926; color: #fff; }
.btn-sm { min-height: 32px; padding: 5px 11px; font-size: 13px; }
.btn-lg { min-height: 48px; padding: 12px 22px; font-size: 15px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-loading { opacity: .6; pointer-events: none; }
.btn.is-loading::before { content: ''; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ── Forms ────────────────────────────────────────────────────────────────── */
.field { min-width: 0; }
.field fieldset { border: 0; padding: 0; margin: 0; }
.label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; color: var(--text); }
.req { color: var(--danger); }
.input { display: block; width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); font: inherit; font-size: 15px; color: var(--text); transition: border-color .15s, box-shadow .15s; }
.input:hover { border-color: #b2bed3; }
.input:focus { outline: none; border-color: var(--brand-500); box-shadow: var(--ring); }
.input:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
.input::placeholder { color: #98a3b6; }
.input[aria-invalid="true"], .was-validated .input:invalid { border-color: var(--danger); }
select.input { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364738c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 18px; }
textarea.input { resize: vertical; min-height: 96px; }
.input-group { position: relative; }
.input-group .input { padding-right: 44px; }
.input-group__btn { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.input-group__btn:hover { color: var(--text); background: var(--surface-2); }
.hint { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.field-error { margin: 6px 0 0; font-size: 13px; font-weight: 500; color: var(--danger); }
.form-stack { display: grid; gap: 16px; }
.checkbox { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.checkbox input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--brand-600); flex: none; }

.choice-row { display: flex; gap: 10px; flex-wrap: wrap; }
.choice { position: relative; display: inline-flex; align-items: center; gap: 10px; min-width: 120px; padding: 10px 16px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); cursor: pointer; font-weight: 500; transition: border-color .15s, background .15s; }
.choice input { width: 18px; height: 18px; margin: 0; accent-color: var(--brand-600); }
.choice:hover { border-color: var(--brand-500); }
.choice:has(input:checked) { border-color: var(--brand-600); background: var(--brand-50); box-shadow: inset 0 0 0 1px var(--brand-600); }

/* Upload row: the transparent file input covers the whole row (click or drop anywhere) */
.upload { position: relative; display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface); transition: border-color .15s, background .15s, box-shadow .15s; }
.upload:hover, .upload.is-drag { border-color: var(--brand-500); background: var(--brand-50); }
.upload.is-invalid { border-color: var(--danger); background: var(--danger-bg); }
.upload.has-file { border-style: solid; border-color: #b8e4cf; background: #f5fbf8; }
.upload input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.upload:focus-within { box-shadow: var(--ring); }
.upload__icon { position: relative; width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; overflow: hidden; background: var(--brand-50); color: var(--brand-600); flex: none; }
.upload__icon .icon { width: 20px; height: 20px; }
.upload__icon img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.upload__done { display: none; }
.upload.has-file .upload__icon { background: var(--success-bg); color: var(--success); }
.upload.has-file .upload__type { display: none; }
.upload.has-file .upload__done { display: block; }
.upload__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.upload__label { font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.35; }
.upload__meta { font-size: 12.5px; color: var(--muted); }
.upload__file { display: flex; gap: 8px; align-items: baseline; min-width: 0; font-size: 13px; }
.upload__name { min-width: 0; color: var(--success); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload__size { flex: none; color: var(--muted); font-size: 12px; }
.upload__action { display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 34px; padding: 6px 12px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--brand-700); font-size: 13px; font-weight: 600; transition: border-color .15s; }
.upload__action .icon { width: 15px; height: 15px; }
.upload:hover .upload__action { border-color: var(--brand-500); }
.upload__clear { position: relative; z-index: 2; flex: none; border: 0; background: none; color: var(--muted); width: 32px; height: 32px; border-radius: 6px; cursor: pointer; display: grid; place-items: center; }
.upload__clear:hover { background: var(--danger-bg); color: var(--danger); }
.upload:not(.has-file) .upload__clear { visibility: hidden; }
.grid > .field--upload + .field--upload { margin-top: -8px; }

/* Section within a form step */
.form-section__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.form-section__title { margin: 0; font-size: 15px; font-weight: 600; color: var(--navy-900); }
.form-section__desc { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.form-section { margin-bottom: -4px; }
.form-section:not(:first-child) { margin-top: 10px; padding-top: 22px; border-top: 1px solid var(--border); }

/* ── Notices & badges ─────────────────────────────────────────────────────── */
.flashes { display: grid; gap: 10px; margin-bottom: 20px; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); border: 1px solid; font-size: 14px; }
.notice > .icon { margin-top: 1px; }
.notice > span { flex: 1; }
.notice ul { margin: 6px 0 0; padding-left: 18px; }
.notice--success { background: var(--success-bg); border-color: #b8e4cf; color: #0b5e40; }
.notice--danger  { background: var(--danger-bg);  border-color: #f4c3c2; color: #93241f; }
.notice--warning { background: var(--warning-bg); border-color: #f5dc9e; color: #774600; }
.notice--info    { background: var(--info-bg);    border-color: #c5d9f7; color: #164c96; }
.notice__close { border: 0; background: none; color: inherit; opacity: .6; cursor: pointer; padding: 0; display: grid; place-items: center; }
.notice__close:hover { opacity: 1; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.4; white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--plain::before { display: none; }
.badge--success { background: var(--success-bg); color: var(--success); }
.badge--warning { background: var(--warning-bg); color: var(--warning); }
.badge--danger  { background: var(--danger-bg);  color: var(--danger); }
.badge--info    { background: var(--info-bg);    color: var(--info); }
.badge--neutral { background: var(--neutral-bg); color: var(--neutral); }
.badge--brand   { background: var(--brand-50);   color: var(--brand-700); }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--neutral-bg); color: var(--text-2); font-size: 12px; font-weight: 600; font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; }

.meter { display: flex; align-items: center; gap: 10px; min-width: 140px; }
.meter__bar { flex: 1; height: 6px; border-radius: 999px; background: var(--neutral-bg); overflow: hidden; }
.meter__fill { height: 100%; border-radius: inherit; }
.meter__fill--success { background: #18a06c; } .meter__fill--warning { background: #e5a019; } .meter__fill--danger { background: var(--danger); }
.meter__label { font-size: 13px; font-weight: 600; color: var(--text-2); min-width: 44px; text-align: right; }

/* ── Tables ───────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { padding: 11px 16px; text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fafbfe; }
.table--compact th, .table--compact td { padding: 9px 14px; }
.table .row-link { color: var(--text); font-weight: 600; }
.table tr.is-full td { color: var(--muted); }
.table tr.group-row td { background: var(--brand-50); font-weight: 600; color: var(--navy-900); }
.cell-sub { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: nowrap; }
.actions form { margin: 0; }
.table td.actions { display: table-cell; text-align: right; white-space: nowrap; }
.table td.actions > * { display: inline-flex; vertical-align: middle; }
.table td.actions > * + * { margin-left: 6px; }
.checkbox span { white-space: normal; }
.filters .checkbox span { white-space: nowrap; }

.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; padding: 16px 20px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.filters .field { min-width: 170px; flex: 1; max-width: 260px; }
.filters .label { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.filters .input { min-height: 38px; padding-top: 7px; padding-bottom: 7px; font-size: 14px; }

.dl { display: grid; grid-template-columns: minmax(130px, 38%) 1fr; margin: 0; }
.dl dt, .dl dd { padding: 10px 0; border-bottom: 1px solid var(--border); margin: 0; font-size: 14px; }
.dl dt { color: var(--muted); padding-right: 12px; }
.dl dd { font-weight: 500; overflow-wrap: anywhere; }
.dl > :nth-last-child(-n+2) { border-bottom: 0; }

.empty { text-align: center; padding: 44px 20px; }
.empty__icon { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-600); }
.empty__icon .icon { width: 26px; height: 26px; }
.empty h3 { font-size: 17px; margin-bottom: 4px; }
.empty p { color: var(--muted); max-width: 46ch; margin: 0 auto 16px; }

/* ── Auth pages ───────────────────────────────────────────────────────────── */
.auth { display: grid; grid-template-columns: minmax(380px, 44%) 1fr; min-height: 100vh; }
.auth__brand { position: relative; overflow: hidden; background: radial-gradient(120% 90% at 0% 0%, #23498f 0%, var(--navy-900) 55%, var(--navy-950) 100%); color: #dbe4f5; }
.auth__brand-inner { position: relative; z-index: 2; display: flex; flex-direction: column; height: 100%; padding: 40px 48px; }
.auth__pitch { margin: auto 0; max-width: 440px; }
.auth__pitch h2 { color: #fff; font-size: 32px; font-weight: 700; line-height: 1.2; margin-bottom: 28px; letter-spacing: -.02em; }
.auth__points { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.auth__points li { display: flex; gap: 14px; align-items: center; font-size: 15px; }
.auth__points .icon { width: 38px; height: 38px; padding: 9px; border-radius: 10px; background: rgba(255,255,255,.08); color: #ffb08f; }
.auth__contact { font-size: 13px; color: #8fa1c4; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.auth__contact .icon { width: 14px; height: 14px; }
.auth__waves { position: absolute; left: -10%; right: -10%; bottom: -40px; height: 260px; z-index: 1; opacity: .5;
  background:
    radial-gradient(60% 50% at 20% 100%, rgba(47,99,196,.55), transparent 70%),
    radial-gradient(50% 40% at 80% 100%, rgba(232,98,44,.25), transparent 70%); }
.auth__main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px; background: var(--bg); }
.auth-card { width: 100%; max-width: 440px; }
.auth-card__body { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 32px; }
.auth-title { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.auth-sub { color: var(--muted); margin-bottom: 24px; }
.auth-alt { margin: 20px 0 0; text-align: center; font-size: 14px; color: var(--muted); }
.auth__footer { margin-top: 24px; font-size: 12px; color: var(--muted); }
.auth-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 18px; background: var(--brand-50); color: var(--brand-600); }
.auth-icon .icon { width: 26px; height: 26px; }
.auth-icon--success { background: var(--success-bg); color: var(--success); }
.label-row { display: flex; justify-content: space-between; align-items: baseline; }
.label-row a { font-size: 13px; font-weight: 500; }
.error-code { font-size: 56px; font-weight: 800; color: var(--brand-100); line-height: 1; margin-bottom: 8px; }
.pw-meter { display: flex; gap: 4px; margin-top: 8px; }
.pw-meter span { flex: 1; height: 4px; border-radius: 2px; background: var(--neutral-bg); transition: background .2s; }
.pw-meter[data-score="1"] span:nth-child(-n+1) { background: var(--danger); }
.pw-meter[data-score="2"] span:nth-child(-n+2) { background: #e5a019; }
.pw-meter[data-score="3"] span:nth-child(-n+3) { background: #18a06c; }
.pw-meter[data-score="4"] span { background: #0d7a52; }

/* ── Multi-step form ──────────────────────────────────────────────────────── */
.wizard { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 24px; align-items: start; }
.steps { position: sticky; top: 88px; list-style: none; margin: 0; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); counter-reset: step; }
.steps li { position: relative; display: flex; gap: 12px; align-items: center; padding: 10px 6px; color: var(--muted); font-weight: 500; font-size: 14px; }
.steps li:not(:last-child)::after { content: ''; position: absolute; left: 21px; top: 42px; width: 2px; height: 18px; background: var(--border); }
.steps__dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--border-strong); background: var(--surface); font-size: 13px; font-weight: 700; flex: none; }
.steps__dot .icon { width: 15px; height: 15px; display: none; }
.steps li.is-current { color: var(--navy-900); font-weight: 600; }
.steps li.is-current .steps__dot { border-color: var(--brand-600); background: var(--brand-600); color: #fff; box-shadow: 0 0 0 4px var(--brand-50); }
.steps li.is-done { color: var(--text-2); cursor: pointer; }
.steps li.is-done .steps__dot { border-color: var(--success); background: var(--success); color: #fff; }
.steps li.is-done .steps__dot .icon { display: block; }
.steps li.is-done .steps__num { display: none; }
.steps li.is-done:not(:last-child)::after { background: var(--success); }
.wizard__progress { display: none; }
.step-panel__head { padding: 26px 28px 0; }
.step-panel__eyebrow { font-size: 12px; font-weight: 600; color: var(--brand-600); text-transform: uppercase; letter-spacing: .07em; }
.step-panel__title { font-size: 21px; margin: 4px 0 4px; }
.step-panel__desc { color: var(--muted); margin: 0; }
.step-panel__body { padding: 24px 28px 28px; }
.wizard__nav { display: flex; justify-content: space-between; gap: 10px; padding: 16px 28px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.wizard__nav .spacer { flex: 1; }
.doc-sets { margin-bottom: 4px; }
.review-section { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 14px; overflow: hidden; }
.review-section__head { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-weight: 600; font-size: 14px; }
.review-section .dl { padding: 0 16px; }
.confirm-box { margin-top: 18px; padding: 14px 16px; border-radius: var(--radius); background: var(--brand-50); border: 1px solid var(--brand-100); }

.schedule-peek { margin-bottom: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.schedule-peek summary { display: flex; align-items: center; gap: 10px; padding: 12px 16px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--brand-700); list-style: none; }
.schedule-peek summary::-webkit-details-marker { display: none; }
.schedule-peek__chev { margin-left: auto; transition: transform .2s; }
.schedule-peek[open] .schedule-peek__chev { transform: rotate(180deg); }
.schedule-peek .table-wrap { max-height: 320px; overflow-y: auto; border-top: 1px solid var(--border); }

.date-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 10px; }
.date-opt { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.date-opt input { position: absolute; opacity: 0; pointer-events: none; }
.date-opt__day { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.date-opt__date { font-size: 16px; font-weight: 700; color: var(--navy-900); }
.date-opt__group { font-size: 12px; color: var(--text-2); }
.date-opt__seats { margin-top: 6px; }
.date-opt:hover { border-color: var(--brand-500); }
.date-opt:has(input:checked) { border-color: var(--brand-600); background: var(--brand-50); box-shadow: inset 0 0 0 1px var(--brand-600); }
.date-opt:has(input:focus-visible) { box-shadow: var(--ring); }
.date-opt.is-full { cursor: not-allowed; opacity: .55; background: var(--surface-2); }
.date-opt__first { position: absolute; top: -9px; right: 10px; padding: 1px 8px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 600; }

/* ── Dashboard bits ───────────────────────────────────────────────────────── */
.hero { position: relative; overflow: hidden; padding: 26px 28px; border-radius: var(--radius-lg); background: linear-gradient(120deg, var(--navy-900), var(--brand-700)); color: #dbe4f5; margin-bottom: 20px; }
.hero h1 { color: #fff; font-size: 24px; margin-bottom: 6px; }
.hero p { margin: 0 0 16px; max-width: 60ch; }
.hero::after { content: ''; position: absolute; right: -60px; top: -80px; width: 280px; height: 280px; border-radius: 50%; background: radial-gradient(circle, rgba(232,98,44,.35), transparent 70%); }
.hero > * { position: relative; z-index: 1; }
.hero .btn-secondary { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.25); }
.hero .btn-secondary:hover { background: rgba(255,255,255,.18); }
.next-inspection { display: flex; gap: 16px; align-items: center; }
.cal-tile { width: 64px; flex: none; border-radius: 12px; overflow: hidden; text-align: center; border: 1px solid var(--border); background: var(--surface); }
.cal-tile__m { background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; text-transform: uppercase; padding: 3px 0; letter-spacing: .06em; }
.cal-tile__d { font-size: 24px; font-weight: 800; color: var(--navy-900); padding: 4px 0 6px; line-height: 1.1; }
.form-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.form-tile { display: flex; flex-direction: column; gap: 8px; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); color: var(--text); text-decoration: none !important; transition: border-color .15s, box-shadow .15s, transform .15s; }
.form-tile:hover { border-color: var(--brand-500); box-shadow: var(--shadow); transform: translateY(-1px); color: var(--text); }
.form-tile__icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-600); }
.form-tile__title { font-weight: 600; }
.form-tile__meta { font-size: 13px; color: var(--muted); }
.form-tile.is-soon { opacity: .6; pointer-events: none; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 18px 26px; }
.timeline li::before { content: ''; position: absolute; left: 6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand-500); box-shadow: 0 0 0 3px var(--brand-50); }
.timeline li:not(:last-child)::after { content: ''; position: absolute; left: 10px; top: 20px; bottom: 0; width: 2px; background: var(--border); }
.timeline__meta { font-size: 12px; color: var(--muted); }
.timeline__note { margin-top: 6px; padding: 8px 12px; background: var(--surface-2); border-left: 3px solid var(--brand-500); border-radius: 0 6px 6px 0; font-size: 14px; white-space: pre-line; }
.file-list { list-style: none; margin: 0; padding: 0; }
.file-list li { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.file-list li:last-child { border-bottom: 0; }
.file-list__icon { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-600); flex: none; }
.file-list__main { flex: 1; min-width: 0; }
.file-list__label { font-weight: 600; font-size: 14px; }
.file-list__name { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.checklist .icon { color: var(--success); margin-top: 2px; }
.type-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.type-chip { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); font-weight: 600; font-size: 14px; color: var(--text-2); }
.type-chip:hover { border-color: var(--brand-500); color: var(--brand-700); text-decoration: none; }
.type-chip.is-active { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.type-chip.is-soon { color: var(--muted); }

dialog.modal { width: min(520px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); color: var(--text); }
dialog.modal::backdrop { background: rgba(10, 21, 48, .45); }
.modal__head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal__head h2 { font-size: 17px; margin: 0; }
.modal__body { padding: 22px; }
.modal__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2); }
.check-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; max-height: 260px; overflow-y: auto; padding: 4px; }

/* ── Utilities ────────────────────────────────────────────────────────────── */
.text-muted { color: var(--muted); } .text-right { text-align: right; } .text-center { text-align: center; }
.text-sm { font-size: 13px; } .fw-600 { font-weight: 600; } .nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0 !important; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 16px; } .mt-4 { margin-top: 24px; }
.mb-0 { margin-bottom: 0 !important; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 16px; } .mb-4 { margin-bottom: 24px; }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .wrap { flex-wrap: wrap; }
.inline-form { display: inline; margin: 0; }
.mono { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; }
.divider { height: 1px; background: var(--border); margin: 20px 0; border: 0; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .layout-2 { grid-template-columns: 1fr; }
  .wizard { grid-template-columns: 1fr; }
  .steps { display: none; }
  .wizard__progress { display: block; margin-bottom: 14px; }
  .wizard__progress-label { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-2); }
  .wizard__progress-bar { height: 6px; border-radius: 999px; background: var(--neutral-bg); overflow: hidden; }
  .wizard__progress-bar span { display: block; height: 100%; background: var(--brand-600); border-radius: inherit; transition: width .25s; }
}
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.is-open { transform: none; }
  .sidebar__close, .topbar__menu { display: inline-grid; }
  .sidebar-backdrop.is-open { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(10,21,48,.45); }
  .main-col { margin-left: 0; }
  .auth { grid-template-columns: 1fr; }
  .auth__brand-inner { padding: 24px; }
  .auth__pitch, .auth__contact { display: none; }
  .auth__waves { display: none; }
}
@media (max-width: 720px) {
  body { font-size: 14px; }
  .content { padding: 18px 16px; }
  .topbar { padding: 0 12px; }
  .user-menu__who { display: none; }
  .grid { gap: 14px; }
  .grid > [class*="col-"] { grid-column: span 12; }
  .page-title { font-size: 22px; }
  .card__body, .step-panel__body { padding: 16px; }
  .step-panel__head { padding: 18px 16px 0; }
  .wizard__nav { padding: 14px 16px; }
  .auth-card__body { padding: 24px 20px; }
  .dl { grid-template-columns: 1fr; }
  .dl dt { border-bottom: 0; padding-bottom: 0; }
  .filters .field { max-width: none; min-width: 100%; }
  .check-grid { grid-template-columns: 1fr; }
  .table-stack thead { display: none; }
  .table-stack tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--border); }
  .table-stack td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 5px 16px; text-align: right; }
  .table-stack td::before { content: attr(data-label); font-weight: 600; color: var(--muted); text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
  .table-stack td.actions { justify-content: flex-end; }
  .table-stack td.actions::before { content: none; }
}

@media (max-width: 480px) {
  .upload { gap: 12px; padding: 12px; }
  .upload__icon { width: 38px; height: 38px; }
  .upload__action { padding: 6px 9px; }
  .upload__action-text { display: none; }
}

@media print {
  .sidebar, .topbar, .footer, .no-print, .flashes { display: none !important; }
  .main-col { margin: 0; }
  .content { padding: 0; max-width: none; }
  body { background: #fff; font-size: 12px; }
  .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
}
