:root {
    --blue: #146cbe;
    --blue-dark: #0d5598;
    --border: #cbd3dc;
    --text: #182230;
    --muted: #667085;
    --bg: #f4f6f8;
    --ok-bg: #e9f8ef;
    --ok: #176b37;
    --error-bg: #fff0f0;
    --error: #9b2525;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.wrap {
    max-width: 760px;
    margin: 40px auto;
    padding: 0 16px;
}

.card {
    max-width: 100%;
    overflow: hidden;
    background: #fff;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 6px 22px #00000012;
}

.top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.top > div {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

h1 {
    margin: 0 0 20px;
}

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.full {
    grid-column: 1 / -1;
}

label {
    display: block;
    font-weight: 650;
    margin-bottom: 6px;
}

input:not([type="checkbox"]),
select,
textarea {
    width: 100%;
    padding: 11px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
}

textarea {
    min-height: 90px;
}

.alert {
    padding: 14px;
    border-radius: 9px;
    margin-bottom: 18px;
}

.ok {
    background: var(--ok-bg);
    color: var(--ok);
}

.err {
    background: var(--error-bg);
    color: var(--error);
}

.result {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.result > div {
    background: #fff;
    border: 1px solid #cfe6d6;
    padding: 12px 8px;
    border-radius: 8px;
    text-align: center;
}

.result span {
    display: block;
    font-size: 13px;
    margin-bottom: 4px;
}

.result strong {
    display: block;
    font-size: 1.15rem;
    color: var(--text);
}

.hint {
    margin-top: 5px;
    color: var(--muted);
    font-size: 13px;
}

.button {
    border: 0;
    border-radius: 9px;
    padding: 12px 20px;
    background: var(--blue);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.button:hover {
    background: var(--blue-dark);
}

.logout {
    color: var(--blue);
    text-decoration: none;
}

.km {
    display: none;
}

.overview-filter {
    margin-top: 10px;
}

.filter-tabs,
.filter-fields {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 10px;
}

.filter-tabs {
    margin-bottom: 16px;
}

.filter-tab {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 9px 13px;
    background: #fff;
    color: var(--blue);
    font: inherit;
    font-weight: 650;
    cursor: pointer;
}

.filter-tab:hover,
.filter-tab.active {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff;
}

.filter-fields label {
    margin-bottom: 0;
}

.overview-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.daily-table {
    width: 100%;
    min-width: 900px;
    margin-top: 20px;
    border-collapse: collapse;
}

.daily-table th,
.daily-table td {
    padding: 9px 10px;
    border-bottom: 1px solid var(--border);
    text-align: right;
    white-space: nowrap;
}

.daily-table th:first-child,
.daily-table td:first-child {
    text-align: left;
}

.daily-table tfoot {
    font-weight: 700;
}

.period-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 18px 0;
}

.period-label {
    margin: 0;
    text-align: center;
}

.period-nav-button {
    display: inline-block;
    padding: 9px 13px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--blue);
    text-decoration: none;
    font-weight: 650;
    white-space: nowrap;
}

.period-nav-button:hover {
    background: var(--bg);
}

.entry-detail-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 0;
}

.entry-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.delete-form {
    display: inline;
    margin: 0;
}

.edit-link,
.delete-link {
    color: var(--blue);
    font: inherit;
    font-weight: 650;
}

.edit-link {
    text-decoration: none;
}

.delete-link {
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--error);
    cursor: pointer;
}

@media (max-width: 600px) {
    .wrap {
        margin: 15px auto;
        padding: 0 8px;
    }

    .card {
        padding: 14px;
    }

    .top {
        flex-direction: column;
        align-items: stretch;
    }

    .top h1 {
        margin-bottom: 8px;
    }

    .top > div {
        width: 100%;
        justify-content: flex-start;
    }

    .logout {
        display: inline-block;
        padding: 8px 0;
    }

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

    .full {
        grid-column: auto;
    }

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

    .filter-tabs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .filter-tab {
        width: 100%;
    }

    .filter-fields {
        display: grid;
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .filter-fields label,
    .filter-fields .button {
        width: 100%;
    }

    .period-navigation {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .period-label {
        grid-column: 1 / -1;
        grid-row: 1;
        margin-bottom: 5px;
    }

    .period-nav-button {
        text-align: center;
    }

    .daily-table {
        font-size: 14px;
    }

    .daily-table th,
    .daily-table td {
        padding: 8px;
    }

    .entry-detail-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }
}
.reset-button {
    background: var(--blue);
    margin-left: 8px;
}

.reset-button:hover {
    background: var(--blue-dark);
}
.reset-modal[hidden] {
    display: none;
}

.reset-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.reset-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .45);
}

.reset-modal-box {
    position: relative;
    width: min(420px, 100%);
    padding: 26px;
    background: #fff;
    border-radius: 14px;
    text-align: center;
    box-shadow: 0 18px 55px rgba(0,0,0,.25);
}

.reset-modal-icon {
    color: var(--blue);
    font-size: 28px;
    margin-bottom: 10px;
}

.reset-modal-box h2 {
    margin: 0 0 8px;
}

.reset-modal-box p {
    margin: 0 0 22px;
    color: #5f6670;
}

.reset-modal-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
}
.expand-column,
.expand-cell {
    width: 34px;
    text-align: center;
}

.entry-expand {
    cursor: pointer;
    color: var(--blue);
    list-style: none;
}

.entry-expand::-webkit-details-marker {
    display: none;
}

.entry-expand i {
    transition: transform .2s ease;
}

.entry-details[open] > .entry-expand i {
    transform: rotate(90deg);
}
.expand-column {
    width: 34px;
    padding-left: 6px !important;
    padding-right: 6px !important;
    text-align: center;
}

.expand-button {
    border: 0;
    background: transparent;
    color: #146cbe;
    cursor: pointer;
    padding: 6px 8px;
    font-size: 15px;
}

.expand-button i {
    transition: transform .2s ease;
}

.expand-button[aria-expanded="true"] i {
    transform: rotate(90deg);
}

.detail-row td {
    padding: 0;
    background: #f7f9fb;
}

.entry-detail-list {
    padding: 10px 16px 10px 46px;
    text-align: left;
}

.entry-detail-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 0;
    text-align: left;
}

.entry-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.delete-form {
    display: inline;
}
.day-table-toggle .logout {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.day-table-toggle .logout:hover {
    text-decoration: underline;
}
#day-table .daily-table {
    font-size: 0.88rem;
}

#day-table .daily-table th,
#day-table .daily-table td {
    padding: 5px 7px;
    white-space: nowrap;
}

#day-table .daily-table th {
    font-size: 0.82rem;
}

.day-table-toggle {
    margin: 6px 0;
}

.day-table-toggle .logout {
    font-size: 0.9rem;
}
.overview-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.daily-table {
    width: 100%;
    min-width: 1050px;
    border-collapse: collapse;
}

@media (max-width: 768px) {
    .overview-table-wrap {
        overflow-x: auto;
    }

    .daily-table {
        min-width: 1050px;
    }

    .daily-table th,
    .daily-table td {
        white-space: nowrap;
    }
}
.table-scroll-hint {
    display: none;
}

@media (max-width: 768px) {
    .table-scroll-hint {
        display: block;
        margin: 8px 0;
        color: #6b7280;
        font-size: 13px;
        text-align: center;
    }
    .table-scroll-hint i {
        margin-right: 6px;
        color: #146cbe;
    }
    .entry-actions {
    justify-content: flex-start;
    text-align: left;
    }
    .entry-detail-row {
    align-items: flex-start;
    }
}
.login-card {
    max-width: 380px;
    margin: 0 auto;
}
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-weight: 650;
    cursor: pointer;
}

.checkbox-input {
    width: 18px;
    height: 18px;
    margin: 0;
    flex: 0 0 18px;
}
.entry-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    width: 100%;
    text-align: left;
}

.daily-table td .entry-actions {
    justify-content: flex-start;
    text-align: left;
}

.entry-actions .edit-link,
.entry-actions .delete-form {
    flex: 0 0 auto;
}
.top-nav {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.current-user {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    width: 100%;
    text-align: right;
    font-weight: 650;
    color: var(--text);
}

.current-user i {
    color: var(--blue);
}

.nav-links {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}
/* =========================================================
   Gebruikersbeheer
   ========================================================= */

.users-table {
    width: 100%;
}

.users-table td {
    vertical-align: middle;
}

.user-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    font-weight: 600;
}

.user-status-active {
    color: #16803c;
}

.user-status-inactive {
    color: #b00020;
}

.user-current {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: 5px;
    white-space: nowrap;
    font-size: 0.9em;
    font-weight: 600;
    color: var(--blue);
}

.user-role {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    font-weight: 600;
}

.user-admin-form {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.user-admin-form select {
    width: auto;
    min-width: 90px;
    margin: 0;
}

.admin-action-button {
    width: auto;
    margin: 0;
    white-space: nowrap;
}

.user-created {
    white-space: nowrap;
}

@media (max-width: 768px) {
    .user-admin-form {
        align-items: center;
    }

    .users-table {
        min-width: 950px;
    }
}
/* Gebruikersbeheer breder op desktop */
@media (min-width: 1000px) {
    body:has(.users-table) .wrap {
        max-width: 1400px;
    }

    .users-table {
        width: 100%;
    }
}
.admin-link {
    appearance: none;
    border: 0;
    background: none;
    padding: 0;
    margin: 0;
    color: var(--blue);
    font: inherit;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.admin-link:hover {
    text-decoration: underline;
}

.admin-link i {
    margin-right: 4px;
}