:root {
    --bg: #f4f6f8;
    --surface: #ffffff;
    --ink: #17212b;
    --muted: #647181;
    --line: #d9e1e8;
    --brand: #00592c;
    --brand-dark: #003d1e;
    --accent: #6fb72b;
    --accent-yellow: #ffd600;
    --ok: #197248;
    --error: #b42318;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: var(--brand);
    text-decoration: none;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 0;
    font-size: 2rem;
    line-height: 1.15;
}

h2 {
    font-size: 1.1rem;
}

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: 8px;
    background: var(--brand);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

button:hover,
.button:hover {
    background: var(--brand-dark);
    color: #fff;
}

input {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font: inherit;
}

label {
    display: grid;
    gap: 7px;
    color: #2c3a47;
    font-weight: 700;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 28px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-weight: 800;
    text-decoration: none;
}

.brand__logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: block;
}

.topbar nav {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.page {
    width: min(1180px, calc(100% - 32px));
    margin: 32px auto;
}

.narrow {
    width: min(680px, calc(100% - 32px));
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.row-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.secondary-button {
    background: #eef2f6;
    color: var(--ink);
}

.secondary-button:hover {
    background: #dfe7ee;
    color: var(--ink);
}

.panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 24px;
    box-shadow: 0 10px 24px rgb(23 33 43 / 7%);
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

.settings-tile {
    display: grid;
    gap: 10px;
    min-height: 150px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 10px 24px rgb(23 33 43 / 7%);
}

.settings-tile:hover {
    border-color: var(--brand);
    color: var(--ink);
}

.settings-tile p {
    margin-bottom: 0;
    color: var(--muted);
}

.auth-page,
.check-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
}

.auth-panel,
.check-panel {
    width: min(460px, 100%);
}

.auth-panel,
.check-panel form,
.form-grid {
    display: grid;
    gap: 18px;
}

.status-form {
    margin-top: 22px;
}

.eyebrow {
    margin-bottom: 6px;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.muted,
.location-status {
    color: var(--muted);
}

.summary-list {
    display: grid;
    gap: 12px;
    margin: 20px 0 0;
}

.summary-list div {
    display: flex;
    justify-content: space-between;
    gap: 18px;
}

.summary-list dt {
    color: var(--muted);
    font-weight: 700;
}

.summary-list dd {
    margin: 0;
    text-align: right;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    white-space: nowrap;
}

th {
    color: var(--muted);
    font-size: .82rem;
}

tr:last-child td {
    border-bottom: 0;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: #e8f4ee;
    color: var(--ok);
    font-weight: 800;
}

.status {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: #eef2f6;
    color: var(--muted);
    font-weight: 800;
}

.status-sent {
    background: #e8f4ee;
    color: var(--ok);
}

.status-failed {
    background: #fde8e7;
    color: var(--error);
}

.status-skipped {
    background: #fff4d6;
    color: #8a5a00;
}

.split {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 18px;
    margin-bottom: 22px;
}

.qr {
    width: min(260px, 100%);
    height: auto;
    border: 1px solid var(--line);
}

.map {
    min-height: 290px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #e9eef2;
}

.map iframe {
    width: 100%;
    height: 100%;
    min-height: inherit;
    border: 0;
}

.link-button {
    min-height: 0;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: var(--brand);
    font-weight: 800;
}

.link-button:hover {
    background: transparent;
    color: var(--brand-dark);
}

.location-dialog {
    width: min(760px, calc(100% - 32px));
    border: 0;
    border-radius: 8px;
    padding: 0;
}

.location-dialog::backdrop {
    background: rgb(23 33 43 / 50%);
}

.dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
}

.dialog-head h2 {
    margin: 0;
}

.icon-button {
    width: 36px;
    min-height: 36px;
    padding: 0;
}

.location-dialog .map {
    border: 0;
    border-radius: 0;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox input {
    width: auto;
    min-height: auto;
}

.flash,
.form-error {
    width: min(680px, calc(100% - 32px));
    margin: 16px auto 0;
    padding: 12px 14px;
    border-radius: 8px;
    background: #e8f4ee;
    color: var(--ok);
    font-weight: 700;
}

.form-error,
.flash-error {
    background: #fde8e7;
    color: var(--error);
}

@media (max-width: 760px) {
    .topbar,
    .page-header,
    .split {
        display: grid;
    }

    .split {
        grid-template-columns: 1fr;
    }

    .topbar {
        padding: 14px 16px;
    }
}

.connection-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: #fff4d6;
    color: #8a5a00;
    font-weight: 700;
    font-size: .92rem;
    border-bottom: 1px solid #f0d97a;
}

[hidden] {
    display: none !important;
}

.connection-banner__dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #c9911f;
    box-shadow: 0 0 0 3px #fbe7ac;
}

.connection-banner__queue {
    margin-left: auto;
    padding: 2px 10px;
    border-radius: 999px;
    background: rgb(0 0 0 / 7%);
    font-size: .82rem;
}

.install-button {
    margin-left: 4px;
}

.install-floating {
    position: fixed;
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
    z-index: 50;
    padding: 0 18px;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    box-shadow: 0 12px 24px rgb(23 33 43 / 22%);
}

.install-floating:hover {
    background: var(--brand-dark);
    color: #fff;
}

.install-ios-dialog {
    width: min(420px, calc(100% - 32px));
    border: 0;
    border-radius: 12px;
    padding: 0;
}

.install-ios-dialog::backdrop {
    background: rgb(23 33 43 / 50%);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.panel-header h2 {
    margin: 0;
}

.filter-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    padding: 0.5rem;
    background: #f8fafc;
    border-radius: 8px;
}

.filter-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.filter-button:hover {
    background: var(--surface);
    color: var(--ink);
}

.filter-button.active {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
}

.button-secondary {
    background: var(--surface);
    color: var(--ink);
    border: 1px solid var(--line);
}

.button-secondary:hover {
    background: #f8fafc;
    border-color: var(--brand);
}

.table-responsive {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.workers-table {
    width: 100%;
    border-collapse: collapse;
}

.workers-table thead {
    background: #f8fafc;
}

.workers-table th {
    padding: 14px 16px;
    text-align: left;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--muted);
    border-bottom: 2px solid var(--line);
    white-space: nowrap;
}

.workers-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
}

.workers-table tbody tr:last-child td {
    border-bottom: 0;
}

@media (max-width: 768px) {
    .workers-table thead {
        display: none;
    }

    .workers-table,
    .workers-table tbody,
    .workers-table tr,
    .workers-table td {
        display: block;
    }

    .workers-table tr {
        margin-bottom: 1rem;
        border: 1px solid var(--line);
        border-radius: 8px;
        overflow: hidden;
    }

    .workers-table td {
        padding: 12px 16px;
        text-align: right;
        position: relative;
        border-bottom: 1px solid #f8fafc;
    }

    .workers-table td:last-child {
        border-bottom: 0;
    }

    .workers-table td::before {
        content: attr(data-label);
        float: left;
        font-weight: 700;
        color: var(--muted);
    }

    .workers-table td[data-label="Locatie"] {
        text-align: left;
    }
}

dialog {
    border: 0;
    border-radius: 12px;
    padding: 0;
    max-width: min(500px, calc(100% - 32px));
}

dialog::backdrop {
    background: rgb(23 33 43 / 50%);
}

.dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid var(--line);
}

.dialog-head h2 {
    margin: 0;
    font-size: 1.25rem;
}

