/* ==========================================================
   Urenregistratie — stylesheet
   Palette: charcoal (#20242A) + steel grey (#4B5563) + safety
   orange (#E8590C) accent, on a cool light-grey canvas.
   Numeric/tabular data uses a monospace face for a workshop,
   spec-sheet feel.
   ========================================================== */

:root {
    --charcoal: #20242A;
    --charcoal-soft: #2B313A;
    --steel: #5B6472;
    --steel-light: #8A93A1;
    --canvas: #F1F2F4;
    --panel: #FFFFFF;
    --line: #DEE1E6;
    --orange: #E8590C;
    --orange-dark: #C64A08;
    --orange-tint: #FDEEE4;
    --green: #2E7D32;
    --green-tint: #E9F5EA;
    --red: #C62828;
    --red-tint: #FBEAEA;
    --radius: 6px;
    --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--canvas);
    color: var(--charcoal);
    font-size: 15px;
    line-height: 1.5;
}

a { color: var(--orange-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { font-weight: 700; letter-spacing: -0.01em; margin: 0 0 0.6em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }

/* ---------- Top navigation ---------- */
.topbar {
    background: var(--charcoal);
    color: #fff;
    border-bottom: 3px solid var(--orange);
}
.topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 28px;
    height: 58px;
}
.brand {
    color: #fff;
    font-weight: 700;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; opacity: 0.9; }
.brand-mark { color: var(--orange); }
.main-nav { display: flex; gap: 4px; flex: 1; }
.main-nav a {
    color: #C9CDD3;
    padding: 8px 14px;
    border-radius: var(--radius);
    font-size: 0.92rem;
    font-weight: 600;
}
.main-nav a:hover { background: var(--charcoal-soft); color: #fff; text-decoration: none; }
.user-menu { display: flex; align-items: center; gap: 14px; font-size: 0.88rem; color: #C9CDD3; }
.role-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: var(--steel);
    color: #fff;
}
.role-badge.role-admin { background: var(--orange); }
.logout-link { color: #C9CDD3; font-weight: 600; }
.logout-link:hover { color: #fff; }

/* ---------- Layout ---------- */
.page-wrap { max-width: 1200px; margin: 0 auto; padding: 28px 20px 60px; }
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--charcoal);
    background-image: linear-gradient(160deg, #20242A 0%, #2B313A 100%);
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
}

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

/* ---------- Login ---------- */
.login-card {
    width: 360px;
    background: var(--panel);
    border-radius: 10px;
    padding: 34px 32px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.35);
}
.login-card .brand-mark { color: var(--orange); font-size: 1.4rem; }
.login-title { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.login-sub { color: var(--steel); font-size: 0.88rem; margin-bottom: 22px; }

/* ---------- Forms ---------- */
label { display: block; font-weight: 600; font-size: 0.86rem; margin-bottom: 5px; color: var(--charcoal); }
.field { margin-bottom: 16px; }
.field-hint { font-size: 0.78rem; color: var(--steel); margin-top: 4px; }
input[type=text], input[type=date], input[type=password], input[type=number], select, textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-size: 0.92rem;
    font-family: var(--font-body);
    background: #fff;
    color: var(--charcoal);
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--orange);
    box-shadow: 0 0 0 3px var(--orange-tint);
}
input[readonly] { background: #F7F7F8; color: var(--charcoal); font-family: var(--font-mono); font-weight: 600; }
.required-mark { color: var(--orange-dark); }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    font-family: var(--font-body);
}
.btn-primary { background: var(--orange); color: #fff; }
.btn-primary:hover { background: var(--orange-dark); text-decoration: none; }
.btn-secondary { background: #fff; border-color: var(--line); color: var(--charcoal); }
.btn-secondary:hover { border-color: var(--steel); text-decoration: none; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #a11f1f; text-decoration: none; }
.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 5px 10px; font-size: 0.78rem; }

/* ---------- Stepper (uur velden) ---------- */
.stepper-title {
    font-weight: 700;
    font-size: 0.86rem;
    color: var(--charcoal);
    margin-bottom: 6px;
}

.stepper {
    display: grid;
    grid-template-columns: 46px 1fr 46px;
    align-items: stretch;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}
.stepper input {
    border: none;
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
    text-align: center;
    border-radius: 0;
}
.stepper input:focus { box-shadow: none; }
.stepper-btn {
    background: #F1F2F4;
    color: var(--steel);
    border: none;
    font-size: 0.72rem;
    font-weight: 700;
    font-family: var(--font-mono);
    letter-spacing: -0.02em;
    cursor: pointer;
    line-height: 1;
}
.stepper-btn:hover { background: #E4E6EA; color: var(--charcoal); }
.stepper-btn:active { background: #D7DADF; }
.stepper-group { margin-bottom: 14px; }

.uur-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px 16px;
}

.pro-input-group { display: flex; align-items: stretch; }
.pro-prefix {
    background: var(--charcoal);
    color: #fff;
    font-family: var(--font-mono);
    font-weight: 700;
    padding: 9px 12px;
    border-radius: var(--radius) 0 0 var(--radius);
    display: flex;
    align-items: center;
    letter-spacing: 0.03em;
}
.pro-input-group input {
    border-radius: 0 var(--radius) var(--radius) 0;
    font-family: var(--font-mono);
}

.sum-indicator {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--red-tint);
    color: var(--red);
}
.sum-indicator.ok { background: var(--green-tint); color: var(--green); }

fieldset { border: none; padding: 0; margin: 0; }
.type-toggle { display: flex; gap: 10px; margin-bottom: 18px; }
.type-toggle label {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 700;
    color: var(--steel);
    margin: 0;
}
.type-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.type-toggle label.active {
    border-color: var(--orange);
    background: var(--orange-tint);
    color: var(--orange-dark);
}

/* ---------- Alerts / flash ---------- */
.alert {
    padding: 11px 15px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 0.9rem;
    font-weight: 600;
}
.alert-success { background: var(--green-tint); color: var(--green); border: 1px solid #BEE0C0; }
.alert-error { background: var(--red-tint); color: var(--red); border: 1px solid #EBC0C0; }
.alert ul { margin: 6px 0 0; padding-left: 18px; font-weight: 500; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; }
table.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--panel);
    font-size: 0.88rem;
}
table.data-table th {
    text-align: left;
    background: var(--charcoal);
    color: #fff;
    padding: 10px 12px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
table.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}
table.data-table tbody tr:hover { background: #FAFAFA; }
.num-cell { font-family: var(--font-mono); text-align: right; white-space: nowrap; }
.pro-tag {
    display: inline-block;
    background: var(--orange-tint);
    color: var(--orange-dark);
    font-family: var(--font-mono);
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}
.type-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    background: #EEF0F2;
    color: var(--steel);
}
.total-cell { font-weight: 700; font-family: var(--font-mono); text-align: right; }
.opmerkingen-cell { max-width: 260px; color: var(--steel); font-size: 0.85rem; }
.row-actions { white-space: nowrap; }
.row-actions a { margin-right: 10px; font-size: 0.82rem; font-weight: 600; }
.row-actions .delete-link { color: var(--red); }

/* ---------- Filter bar ---------- */
.filter-bar {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding: 16px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.filter-bar .field { margin-bottom: 0; min-width: 160px; }
.filter-bar .field label { margin-bottom: 4px; }

.field-periode { min-width: 280px; }
.period-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}
.period-chip {
    padding: 4px 11px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: #fff;
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--steel);
    cursor: pointer;
    white-space: nowrap;
}
.period-chip:hover { border-color: var(--steel); color: var(--charcoal); }
.period-chip.active { background: var(--orange); border-color: var(--orange); color: #fff; }
.period-range { display: flex; align-items: center; gap: 8px; }
.period-range input[type=date] { min-width: 0; flex: 1; }
.period-sep { font-size: 0.8rem; color: var(--steel); white-space: nowrap; }

.summary-bar {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.summary-card {
    flex: 1;
    min-width: 150px;
    background: var(--charcoal);
    color: #fff;
    border-radius: var(--radius);
    padding: 14px 16px;
}
.summary-card .value { font-family: var(--font-mono); font-size: 1.5rem; font-weight: 700; color: var(--orange); }
.summary-card .label { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.04em; color: #B7BCC3; margin-top: 2px; }

.summary-card-totaal { flex: 2.5; min-width: 340px; }
.onderdeel-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 22px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.12);
}
.onderdeel-stat-value { font-family: var(--font-mono); font-size: 1.05rem; font-weight: 700; color: var(--orange); }
.onderdeel-stat-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; color: #B7BCC3; margin-top: 2px; }

.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--steel);
}

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) {
    .form-grid-2 { grid-template-columns: 1fr; }
    .topbar-inner { flex-wrap: wrap; height: auto; padding: 10px 16px; }
    .main-nav { order: 3; width: 100%; }
}

.form-actions { display: flex; gap: 10px; margin-top: 22px; }
.text-muted { color: var(--steel); }
.badge-count { background: var(--orange); color: #fff; border-radius: 20px; padding: 1px 8px; font-size: 0.72rem; font-weight: 700; margin-left: 6px; }
