:root {
    --surface: #fff;
    --paper: #f6f5f3;
    --graphite: #222326;
    --panel: #292a2e;
    --ink: #25252a;
    --muted: #555760;
    --light: #dfddda;
    --gold: #dec48e;
    --gold-hover: #ebd5a5;
    --gold-ink: #725526;
    --border: #dbd8d6;
    --control: #8d8a85;
    --gutter: clamp(20px, 4vw, 52px);
    --width: 1320px;
    --serif: Georgia, "Times New Roman", serif;
    color-scheme: light;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--surface); color: var(--ink); font: 15px/1.6 "Segoe UI", Arial, sans-serif; }
a { color: var(--gold-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold-ink); outline-offset: 4px; }
h1, h2, p { margin-top: 0; }
h1, h2 { line-height: 1.13; letter-spacing: -.035em; font-family: var(--serif); font-weight: 400; overflow-wrap: anywhere; }
h1 { font-size: clamp(36px, 4.5vw, 54px); margin-bottom: 12px; }
h2 { font-size: 32px; margin-bottom: 12px; }
small { display: block; color: var(--muted); font-size: 12px; margin-top: 5px; }
.muted, .lead { color: var(--muted); }
.skip, .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { z-index: 2; top: 10px; left: 10px; width: auto; height: auto; clip-path: none; padding: 8px 16px; background: var(--surface); }

.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { background: var(--graphite); color: var(--light); }
.topbar-inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 24px;
    min-height: 84px;
    max-width: var(--width);
    margin: 0 auto;
    padding-inline: var(--gutter);
}
.topbar-inner > form { justify-self: end; }
.brand {
    justify-self: start;
    align-self: center;
    padding-bottom: 4px;
    border-bottom: 2px solid var(--gold);
    color: var(--surface);
    font: 33px/1.12 var(--serif);
    letter-spacing: -.035em;
}
.brand:hover { text-decoration: none; }
.navigation { display: flex; align-self: stretch; align-items: stretch; gap: clamp(16px, 3vw, 37px); }
.nav-link {
    display: flex;
    align-items: center;
    min-height: 44px;
    margin-top: 2px;
    border-bottom: 2px solid transparent;
    color: var(--light);
}
.nav-link:hover { color: var(--surface); text-decoration: none; }
.nav-link[aria-current="page"] { border-color: var(--gold); color: var(--surface); font-weight: 600; }
.text-button { min-height: 44px; padding: 7px 0 7px 8px; border: 0; background: transparent; color: var(--light); }
.text-button:hover { color: var(--surface); text-decoration: underline; }
.topbar :focus-visible, .welcome-copy :focus-visible { outline-color: var(--gold-hover); }
.main { width: 100%; max-width: var(--width); margin: 0 auto; padding: clamp(30px, 4vw, 52px) var(--gutter); flex: 1; }
.footer {
    width: calc(100% - var(--gutter) * 2);
    max-width: calc(var(--width) - var(--gutter) * 2);
    margin: 0 auto;
    padding: 19px 0 24px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 12px;
    letter-spacing: .015em;
}

.guest { background: var(--paper); }
.guest .main { display: grid; align-content: center; }
.auth-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(28px, 6vw, 86px); align-items: center; }
.auth-story h1 { max-width: 540px; margin-bottom: 18px; font-size: clamp(42px, 5.5vw, 71px); }
.lead { font-size: 17px; max-width: 365px; }
.plot-art, .welcome-art { background: #2d2e32 url("plotavo-percelen.png") center / cover no-repeat; }
.plot-art { width: 100%; max-width: 525px; height: clamp(130px, 18vw, 240px); margin-top: 27px; }
.card { background: var(--surface); border: 1px solid var(--border); }
.auth-card { min-width: 0; padding: clamp(24px, 4vw, 46px); border-top: 2px solid var(--gold); box-shadow: 0 16px 48px #22232609; }
.stack { display: grid; gap: 18px; margin-top: 24px; }
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
input, select { width: 100%; min-width: 0; padding: 10px 12px; border: 1px solid var(--control); border-radius: 2px; background: var(--surface); color: var(--ink); }
.name-fields, .account-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.account-kind, .business-fields { min-width: 0; margin: 0; padding: 0; border: 0; }
.account-kind legend, .business-fields legend { margin-bottom: 7px; padding: 0; font-size: 13px; font-weight: 650; }
.account-options label { display: flex; align-items: center; gap: 7px; min-height: 44px; margin: 0; padding: 8px; border: 1px solid var(--control); }
.account-options label:has(:checked) { border-color: var(--gold-ink); background: var(--paper); }
.account-options input { width: auto; margin: 0; accent-color: var(--gold-ink); }
.business-fields { display: grid; gap: 12px; padding: 10px 12px 12px; border: 1px solid var(--border); }
.account-kind:not(:has(#account-business:checked)) + .business-fields { display: none; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 19px; min-height: 44px; padding: 9px 16px; border: 1px solid transparent; border-radius: 2px; text-align: center; font-size: 14px; font-weight: 650; }
.button:hover { text-decoration: none; }
.primary { background: var(--gold); color: var(--graphite); }
.primary:hover { background: var(--gold-hover); }
.secondary { background: var(--surface); border-color: var(--control); color: var(--ink); }
.secondary:hover { background: var(--paper); }
.full { width: 100%; justify-content: space-between; }
.auth-switch { border-top: 1px solid var(--border); padding-top: 20px; margin: 24px 0 0; font-size: 13px; color: var(--muted); }
.auth-switch a { font-weight: 650; }
.notice { padding: 13px 17px; margin-bottom: 22px; border-inline-start: 3px solid; }
.success { background: #f7f0e1; color: #604619; }
.danger { background: #f8eeed; color: #842c35; }

.page-heading { margin-bottom: 28px; overflow-wrap: anywhere; }
.page-heading p { color: var(--muted); }
.welcome-panel { display: grid; grid-template-columns: minmax(0, 43fr) minmax(0, 57fr); margin-bottom: 27px; background: var(--panel); color: var(--surface); }
.welcome-copy { padding: clamp(24px, 4vw, 44px); }
.welcome-copy::before { content: ""; display: block; width: 42px; height: 2px; margin-bottom: 24px; background: var(--gold); }
.welcome-panel h2 { font-size: clamp(33px, 4vw, 53px); }
.welcome-panel p { color: var(--light); max-width: 32ch; margin-bottom: 28px; }
.welcome-art { min-height: 330px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.stat { padding: clamp(13px, 2.5vw, 28px); border-top: 1px solid var(--border); background: var(--paper); overflow-wrap: anywhere; }
.stat span { color: var(--muted); font-size: 13px; }
.stat strong { display: block; margin-bottom: 8px; font: 400 clamp(31px, 4vw, 47px)/1.12 var(--serif); }
.stat-pending strong { color: var(--gold-ink); }
.profile-card { max-width: 680px; padding: clamp(20px, 4vw, 36px); }
.profile-card button { justify-self: start; }
.table-toolbar, .pagination { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 20px; }
.search, .user-form, .pagination div { display: flex; align-items: center; gap: 8px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 13px 20px; border-top: 1px solid var(--border); }
th { background: var(--paper); color: var(--muted); font-size: 13px; }
td:first-child { min-width: 155px; overflow-wrap: anywhere; }
.user-form { flex-wrap: wrap; }
.user-form select { width: auto; max-width: 100%; }
.badge { display: inline-block; padding: 3px 7px; background: var(--paper); color: var(--gold-ink); font-size: 12px; }

@media (max-width: 690px) {
    .topbar-inner { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; min-height: 66px; padding-top: 12px; }
    .guest .topbar-inner { padding-top: 0; }
    .brand { font-size: 29px; }
    .topbar-inner > form { grid-column: 2; grid-row: 1; }
    .navigation { grid-column: 1 / -1; grid-row: 2; flex-wrap: wrap; gap: 0 20px; }
    .nav-link { font-size: 13px; }
    .auth-grid, .welcome-panel { grid-template-columns: minmax(0, 1fr); }
    .auth-story h1, .auth-story .lead { margin-bottom: 10px; }
    .plot-art { display: none; }
    .welcome-art { min-height: 0; aspect-ratio: 2 / 1; }
    .stats { gap: 8px; }
    .table-toolbar { flex-direction: column; align-items: stretch; }
    th, td { padding-inline: 13px; }
}

@media (max-width: 360px) {
    .name-fields { grid-template-columns: 1fr; }
}
