:root {
    --ink: #1a2744;
    --muted: #5a6578;
    --line: #d5dbe6;
    --paper: #f4f1ea;
    --card: #fffdf8;
    --teal: #1e3a5f;
    --teal-dark: #152a45;
    --sage: #8a9bb0;
    --coral: #c45c4a;
    --sand: #e8dcc8;
    --ok: #2f7d5a;
    --warn: #b8860b;
    --radius: 18px;
    --shadow: 0 12px 40px rgba(26, 39, 68, 0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; height: 100%; }
body {
    font-family: "Source Serif 4", "Georgia", serif;
    color: var(--ink);
    background: var(--paper);
}

a { color: var(--teal); text-decoration: none; }
h1, h2, h3, .sans { font-family: "Sora", "Segoe UI", sans-serif; }

.wrap { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }
.site-header, .app-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 0;
}
.site-header { position: relative; }
.app-top__lead {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.app-top__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.app-nav-toggle { display: none; }
.app-nav-backdrop { display: none; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-family: Sora, sans-serif; font-weight: 700; flex-shrink: 0; }
.mark {
    width: 36px; height: 36px; border-radius: 12px;
    background: linear-gradient(135deg, var(--teal), #3d6a9a);
    color: #fff; display: grid; place-items: center; font-size: 18px;
}
.nav { display: flex; gap: 18px; align-items: center; font-family: Sora, sans-serif; font-size: 14px; }
.nav a { color: var(--muted); }
.nav a.is-active, .nav a:hover { color: var(--ink); }
.nav-toggle {
    display: none;
    width: 42px; height: 42px; padding: 0;
    border: 1px solid var(--line); border-radius: 12px;
    background: #fff; color: var(--ink); cursor: pointer;
}
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
    display: block; width: 18px; height: 2px;
    background: currentColor; border-radius: 2px;
    transition: transform .18s ease, opacity .18s ease;
}
.nav-toggle-bars { margin: 0 auto; position: relative; }
.nav-toggle-bars::before, .nav-toggle-bars::after {
    content: ""; position: absolute; left: 0;
}
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }
.site-header.is-open .nav-toggle-bars { background: transparent; }
.site-header.is-open .nav-toggle-bars::before { top: 0; transform: rotate(45deg); }
.site-header.is-open .nav-toggle-bars::after { top: 0; transform: rotate(-45deg); }

.lang-drop { position: relative; font-family: Sora, sans-serif; }
.lang-drop summary {
    display: flex; align-items: center; gap: 8px;
    list-style: none; cursor: pointer; user-select: none;
    padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line);
    background: #fff; color: var(--ink); font-size: 13px; font-weight: 600;
}
.lang-drop summary::-webkit-details-marker,
.lang-drop summary::marker { display: none; content: none; }
.lang-drop summary .chev { width: 14px; height: 14px; opacity: .6; }
.lang-drop[open] summary .chev { transform: rotate(180deg); }
.lang-menu {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 20;
    min-width: 180px; padding: 6px;
    background: #fff; border: 1px solid var(--line); border-radius: 14px;
    box-shadow: var(--shadow);
}
.lang-menu a {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; border-radius: 10px; color: var(--ink); font-size: 13px;
}
.lang-menu a:hover, .lang-menu a.is-active { background: #eef1f6; }
.flag {
    width: 18px; height: 12px; border-radius: 2px; flex: 0 0 18px;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(26, 39, 68, .12);
}
.flag-nl { background: linear-gradient(to bottom, #ae1c28 33.33%, #fff 33.33% 66.66%, #21468b 66.66%); }
.flag-de { background: linear-gradient(to bottom, #000 33.33%, #dd0000 33.33% 66.66%, #ffce00 66.66%); }
.flag-gb {
    background: #012169 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 36'%3E%3Crect width='60' height='36' fill='%23012169'/%3E%3Cpath d='M0 0 L60 36 M60 0 L0 36' stroke='%23fff' stroke-width='7.2'/%3E%3Cpath d='M0 0 L60 36 M60 0 L0 36' stroke='%23C8102E' stroke-width='2.4'/%3E%3Cpath d='M30 0 V36 M0 18 H60' stroke='%23fff' stroke-width='12'/%3E%3Cpath d='M30 0 V36 M0 18 H60' stroke='%23C8102E' stroke-width='7.2'/%3E%3C/svg%3E") center / cover no-repeat;
}

.btn, button.btn, input[type=submit] {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px;
    border: 0; border-radius: 999px; padding: 10px 18px;
    background: var(--teal); color: #fff; font-family: Sora, sans-serif;
    font-size: 14px; font-weight: 600; cursor: pointer;
}
.btn.ghost { background: transparent; color: var(--teal); border: 1px solid var(--teal); }
.btn.small { padding: 6px 12px; font-size: 12px; }
.btn.coral { background: var(--coral); color: #fff; }
.btn.start {
    padding: 12px 22px;
    font-size: 15px;
    background: var(--coral);
    color: #fff;
    box-shadow: 0 8px 20px rgba(196, 92, 74, 0.28);
}
.btn.start:hover { background: #b04e3e; }

.hero { padding: 48px 0 72px; display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.hero h1 { font-size: clamp(36px, 5vw, 62px); line-height: 1.05; margin: 0 0 16px; }
.hero p { font-size: 20px; color: var(--muted); }
.hero-card, .card, .panel {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 22px;
}
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.pill { background: var(--sand); border-radius: 999px; padding: 6px 12px; font-family: Sora, sans-serif; font-size: 12px; }
.grid-3, .grid-2, .stats { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: 1fr 1fr; }
.stats { grid-template-columns: repeat(3, 1fr); margin-bottom: 22px; }
.stats-4 { grid-template-columns: repeat(4, 1fr); }
.stat strong { display: block; font-size: 28px; }
form.filter-bar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
    gap: 12px 16px;
    align-items: end;
}
form.filter-bar label { margin: 0 0 4px; }
form.filter-bar .btn { height: 42px; white-space: nowrap; }

.app { display: grid; grid-template-columns: 268px 1fr; min-height: 100vh; align-items: stretch; }
.sidebar {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100vh;
    position: sticky;
    top: 0;
    background: var(--teal-dark);
    color: #e8eef6;
    padding: 22px 14px;
    overflow-y: auto;
}
.sidebar-top { flex: 0 1 auto; }
.sidebar .brand { color: #fff; margin-bottom: 18px; }
.sidebar .who {
    flex: 0 0 auto;
    margin-top: 16px;
    padding: 12px;
    background: rgba(255,255,255,.06);
    border-radius: 14px;
    font-size: 13px;
}
.sidebar .btn.ghost {
    width: 100%;
    color: #fff;
    border-color: rgba(255,255,255,.5);
}
.sidebar .btn.ghost:hover {
    background: rgba(255,255,255,.12);
    border-color: #fff;
}

.side-nav svg.ico, .side-nav svg {
    width: 18px; height: 18px; max-width: 18px; max-height: 18px;
    flex: 0 0 18px; display: block;
}
.side-nav { display: grid; gap: 8px; }
.side-link, .side-drop summary {
    display: flex; align-items: center; flex-wrap: nowrap; gap: 12px;
    color: #c9d4e3; padding: 10px 12px; border-radius: 12px;
    font-family: Sora, sans-serif; font-size: 13px; font-weight: 500;
    cursor: pointer; user-select: none;
}
.side-link span, .side-drop summary span { flex: 1; }
.side-link:hover, .side-drop summary:hover { background: rgba(255,255,255,.08); color: #fff; }
.side-link.is-active { background: rgba(255,255,255,.14); color: #fff; }
.side-drop { border-radius: 14px; }
.side-drop.is-current { background: rgba(255,255,255,.04); }
.side-drop summary { list-style: none; }
.side-drop summary::-webkit-details-marker,
.side-drop summary::marker { display: none; content: none; }
.side-drop .chev { width: 14px; height: 14px; flex: 0 0 14px; opacity: .7; transition: transform .18s ease; }
.side-drop[open] > summary .chev { transform: rotate(180deg); }
.side-drop[open] > summary { color: #fff; }
.side-sub { display: grid; gap: 2px; padding: 2px 4px 6px 12px; }
.side-sub .side-link { padding: 5px 10px; font-size: 12px; color: #b7c4d6; }
button.side-link {
    width: 100%;
    margin: 0;
    border: 0;
    background: transparent;
    text-align: left;
    appearance: none;
    -webkit-appearance: none;
}
.side-sub svg { width: 16px; height: 16px; flex: 0 0 16px; }
.main { padding: 24px 28px 48px; }
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 22px; }
.page-head h1 { margin: 0; font-size: 32px; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 12px 8px; border-bottom: 1px solid var(--line); font-size: 15px; }
.table th { font-family: Sora, sans-serif; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.check-inline { display: flex; align-items: center; gap: 8px; font-weight: 500; margin: 8px 0 0; min-height: 42px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.org-logo-inline { height: 22px; max-width: 80px; object-fit: contain; vertical-align: middle; margin-right: 8px; }
.badge { display: inline-block; border-radius: 999px; padding: 3px 9px; font-family: Sora, sans-serif; font-size: 11px; background: var(--sand); }
.badge.ok { background: #d9efe4; color: var(--ok); }
.badge.warn { background: #f4e6b8; color: #7a5b08; }
.badge.hot { background: #f6d7d2; color: var(--coral); }

form { display: grid; gap: 8px; }
.table form { display: block; }
label { display: block; font-family: Sora, sans-serif; font-size: 13px; font-weight: 600; margin: 12px 0 4px; color: var(--ink); }
input, select, textarea {
    width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
    font: inherit; background: #fff; margin: 0;
}
input[type="checkbox"] { width: auto; margin: 0 8px 0 0; }
textarea { min-height: 110px; }
textarea.tall { min-height: 220px; }
.mail-frame {
    width: 100%; height: 520px; border: 1px solid var(--line);
    border-radius: 14px; background: #f4f1ea; display: block;
}
.flash { background: #d9efe4; color: var(--ok); padding: 10px 14px; border-radius: 12px; margin-bottom: 16px; }
.flash.hot { background: #f6d7d2; color: var(--coral); }
.danger-zone {
    border: 1px solid #e8b4ac;
    background: #fdf4f2;
    border-radius: 16px;
    padding: 18px 20px;
}
.danger-zone h2 { color: var(--coral); margin-top: 0; }
.error { color: var(--coral); font-size: 13px; }
.muted { color: var(--muted); }
.stack { display: grid; gap: 16px; }
.progress { height: 8px; background: #eee6d8; border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--teal); }

.avatar {
    width: 72px; height: 72px; border-radius: 18px; object-fit: cover;
    background: var(--sand); display: grid; place-items: center;
    font-family: Sora, sans-serif; font-weight: 700; color: var(--teal);
}
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.tabs a {
    padding: 6px 12px; border-radius: 999px; font-family: Sora, sans-serif; font-size: 12px;
    background: #fff; border: 1px solid var(--line); color: var(--muted);
}
.tabs a.is-active { background: var(--teal); color: #fff; border-color: var(--teal); }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }
.chart { display: grid; gap: 10px; }
.chart-row { display: grid; grid-template-columns: minmax(90px, 140px) 1fr 36px; gap: 10px; align-items: center; }
.chart-label { font-family: Sora, sans-serif; font-size: 12px; color: var(--muted); }
.chart-bar { height: 12px; background: #e8eef6; border-radius: 99px; overflow: hidden; }
.chart-bar > span { display: block; height: 100%; background: var(--teal); border-radius: 99px; }
.chart-row strong { font-family: Sora, sans-serif; font-size: 13px; text-align: right; }
.team-cal { margin-top: 8px; }
.team-cal .cal-day { min-height: 72px; }
.inline-fields { display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 8px; align-items: center; }
.btn.small.ghost, .btn.ghost.small { padding: 6px 12px; font-size: 12px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-day { min-height: 92px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px; font-size: 12px; }
.cal-day strong { display: block; font-family: Sora, sans-serif; margin-bottom: 4px; }
.cal-item { display: block; margin-top: 3px; padding: 2px 6px; border-radius: 6px; background: #e8eef6; }
.cal-item.leave { background: #d9efe4; }
.cal-item.sick { background: #f6d7d2; }
.pipeline { display: grid; grid-template-columns: repeat(7, minmax(120px, 1fr)); gap: 10px; }
.perm-table th, .perm-table td { text-align: center; }
.perm-table th:first-child, .perm-table td:first-child { text-align: left; }
.table-wrap { overflow-x: auto; }
.secret-box { font-family: Sora, sans-serif; letter-spacing: .08em; background: #eef1f6; padding: 10px 12px; border-radius: 10px; }
.export-row { display: grid; gap: 14px; }
.export-row > div { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pipe { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px; min-height: 160px; }
.pipe h3 { margin: 0 0 10px; font-size: 13px; }
.pipe-card { background: var(--paper); border-radius: 10px; padding: 8px; margin-bottom: 8px; font-size: 13px; }

.page-help {
    margin: 0 0 16px;
    border: 1px solid #c9d4e3;
    background: #eef1f6;
    border-radius: 14px;
    font-family: Sora, sans-serif;
}
.page-help summary {
    display: flex; align-items: center; gap: 8px;
    list-style: none; cursor: pointer; user-select: none;
    padding: 10px 14px; color: var(--teal); font-size: 13px; font-weight: 600;
}
.page-help summary::-webkit-details-marker,
.page-help summary::marker { display: none; content: none; }
.page-help summary .chev { margin-left: auto; opacity: .6; }
.page-help[open] summary .chev { transform: rotate(180deg); }
.page-help-body {
    padding: 0 14px 14px 40px;
    color: var(--ink); font-family: "Source Serif 4", Georgia, serif;
    font-size: 15px; line-height: 1.45;
}
.help-toc { display: flex; flex-wrap: wrap; gap: 8px; }
.help-toc .pill { text-decoration: none; color: inherit; }
.help-section { scroll-margin-top: 16px; }
.help-section h3 {
    margin: 12px 0 6px;
    font-family: Sora, sans-serif; font-size: 12px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .04em; color: var(--teal);
}
.help-section ul, .help-section ol { margin: 0 0 4px; padding-left: 1.2em; }
.help-section li { margin: 0 0 6px; }
.guest-help {
    position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
    width: min(520px, calc(100% - 48px)); z-index: 5; margin: 0;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        linear-gradient(180deg, rgba(21, 42, 69, .48), rgba(21, 42, 69, .72)),
        url('../img/auth-hr.jpg') center / cover no-repeat;
}
.login-box { width: min(440px, 100%); background: var(--card); }
.login-box.register-box { width: min(520px, 100%); }

.pwa-bar {
    position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 80;
    display: flex; align-items: center; gap: 14px;
    padding: 14px 16px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    font-family: Sora, sans-serif;
}
.pwa-bar[hidden] { display: none !important; }
.pwa-bar-mark {
    width: 44px; height: 44px; border-radius: 14px; flex: 0 0 44px;
    background: linear-gradient(135deg, var(--teal), #3d6a9a);
    color: #fff; display: grid; place-items: center; font-size: 20px; font-weight: 700;
}
.pwa-bar-copy { flex: 1; min-width: 0; display: grid; gap: 4px; }
.pwa-bar-copy strong { font-size: 14px; }
.pwa-bar-copy span { font-size: 12px; color: var(--muted); font-weight: 500; }
.pwa-pin {
    display: flex; align-items: center; gap: 8px;
    margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--ink); cursor: pointer;
}
.pwa-pin input { accent-color: var(--teal); }
.pwa-bar-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.pwa-bar[data-mode="install"] .pwa-hint-only,
.pwa-bar[data-mode="hint"] .pwa-install-only { display: none !important; }
body.pwa-bar-on { padding-bottom: 110px; }

.cookie-bar {
    position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 90;
    display: flex; align-items: center; gap: 16px;
    padding: 16px 18px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 18px 50px rgba(26, 39, 68, 0.16);
    font-family: Sora, sans-serif;
}
.cookie-bar[hidden] { display: none !important; }
.cookie-bar-mark {
    width: 46px; height: 46px; border-radius: 14px; flex: 0 0 46px;
    background: linear-gradient(135deg, var(--teal), #3d6a9a);
    color: #fff; display: grid; place-items: center;
}
.cookie-bar-copy { flex: 1; min-width: 0; display: grid; gap: 4px; }
.cookie-bar-copy strong { font-size: 15px; }
.cookie-bar-copy span { font-size: 13px; color: var(--muted); font-weight: 500; line-height: 1.45; }
.cookie-bar-copy a { color: var(--teal); font-weight: 600; }
.cookie-bar-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
body.cookie-bar-on { padding-bottom: 120px; }
body.cookie-bar-on .pwa-bar { display: none !important; }
.site-footer {
    display: flex; gap: 16px; padding: 8px 0 48px;
    font-family: Sora, sans-serif; font-size: 13px;
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--ink); }
.legal-page { max-width: 760px; margin: 0 auto 64px; padding: 32px; }
.legal-page h1 { margin: 8px 0 12px; }
.legal-page h2 { margin: 28px 0 10px; font-size: 18px; }

.visually-hidden {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.about-dialog {
    border: 0; padding: 0; background: transparent;
    max-width: min(920px, calc(100vw - 32px));
    width: min(920px, calc(100vw - 32px));
}
.about-dialog::backdrop { background: rgba(21, 42, 69, .58); }
.about-dialog-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 22px 60px rgba(21, 42, 69, .22);
}
.about-dialog-card img {
    display: block; width: 100%; height: auto;
    background: #1e3a5f;
}
.about-dialog-actions {
    display: flex; justify-content: flex-end;
    padding: 14px 16px;
    background: var(--card);
}

@media (max-width: 900px) {
    .hero, .app, .grid-3, .grid-2, .stats, .stats-4, form.filter-bar, .pipeline { grid-template-columns: 1fr; }
    .stats, .stats-4 { grid-template-columns: 1fr 1fr; }
    .app-nav-toggle { display: grid; place-items: center; position: relative; z-index: 80; }
    .app-nav-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 65;
        background: rgba(15, 23, 42, .42);
    }
    .app.is-nav-open .app-nav-backdrop { display: block; }
    .sidebar {
        display: flex;
        position: fixed;
        inset: 0 auto 0 0;
        width: min(288px, 86vw);
        z-index: 70;
        transform: translateX(-110%);
        transition: transform .2s ease;
        box-shadow: none;
    }
    .app.is-nav-open .sidebar {
        transform: translateX(0);
        box-shadow: 16px 0 40px rgba(15, 23, 42, .28);
    }
    .app.is-nav-open .app-nav-toggle .nav-toggle-bars { background: transparent; }
    .app.is-nav-open .app-nav-toggle .nav-toggle-bars::before { top: 0; transform: rotate(45deg); }
    .app.is-nav-open .app-nav-toggle .nav-toggle-bars::after { top: 0; transform: rotate(-45deg); }
    body.app-nav-locked { overflow: hidden; }
    .cal { grid-template-columns: 1fr; }
    .pwa-bar { left: 10px; right: 10px; bottom: 10px; flex-wrap: wrap; }
    .pwa-bar-actions { width: 100%; }
    .cookie-bar { left: 10px; right: 10px; bottom: 10px; flex-wrap: wrap; }
    .cookie-bar-actions { width: 100%; }
    .nav-toggle { display: grid; place-items: center; }
    .nav {
        display: none;
        position: absolute; top: calc(100% - 6px); right: 0; left: 0;
        z-index: 25;
        flex-direction: column; align-items: stretch; gap: 10px;
        padding: 14px;
        background: var(--card);
        border: 1px solid var(--line);
        border-radius: 16px;
        box-shadow: var(--shadow);
    }
    .site-header.is-open .nav { display: flex; }
    .nav .lang-drop { width: 100%; }
    .nav .lang-drop summary { justify-content: space-between; }
    .nav .lang-menu { left: 0; right: 0; min-width: 0; }
    .nav > a { padding: 10px 4px; font-weight: 600; }
    .nav .btn.start { text-align: center; }
}
