/* CleanManager - strakke, moderne UI */
:root {
    --primary: #0f766e;
    --primary-dark: #115e59;
    --primary-light: #ccfbf1;
    --bg: #f1f5f9;
    --surface: #ffffff;
    --border: #e2e8f0;
    --text: #0f172a;
    --text-muted: #64748b;
    --red: #dc2626; --red-bg: #fee2e2;
    --green: #16a34a; --green-bg: #dcfce7;
    --blue: #2563eb; --blue-bg: #dbeafe;
    --orange: #ea580c; --orange-bg: #ffedd5;
    --gray: #64748b; --gray-bg: #f1f5f9;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 1px 2px rgba(15, 23, 42, .04);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
}

/* ---- Layout ---- */
.app { display: flex; min-height: 100vh; }

.sidebar {
    width: 240px; min-width: 240px;
    background: #0f172a;
    color: #cbd5e1;
    display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh;
}
.sidebar-brand {
    display: flex; align-items: center; gap: 10px;
    padding: 20px 18px; font-size: 17px; font-weight: 700; color: #fff;
    border-bottom: 1px solid #1e293b;
}
.brand-icon { font-size: 22px; }
.sidebar-nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; margin-bottom: 2px;
    color: #94a3b8; text-decoration: none;
    border-radius: 8px; font-size: 14px;
    transition: background .15s, color .15s;
}
.nav-item:hover { background: #1e293b; color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; }
.nav-icon { width: 20px; text-align: center; }
.sidebar-footer { padding: 14px; border-top: 1px solid #1e293b; }
.user-chip { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.user-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--primary); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
}
.user-name { font-size: 13px; font-weight: 600; color: #e2e8f0; }
.user-role { font-size: 12px; color: #64748b; }

.main { flex: 1; min-width: 0; }
.topbar {
    background: var(--surface);
    padding: 16px 28px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 14px;
    position: sticky; top: 0; z-index: 10;
}
.topbar h1 { font-size: 20px; font-weight: 700; }
.hamburger { display: none; background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text); }
.content { padding: 24px 28px; max-width: 1400px; }

/* ---- Cards & grids ---- */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
}
.card h2 { font-size: 16px; margin-bottom: 14px; font-weight: 700; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }
.card-header h2 { margin: 0; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

.stat {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
    display: flex; align-items: center; gap: 14px;
}
.stat-icon {
    width: 46px; height: 46px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; background: var(--primary-light);
}
.stat-value { font-size: 24px; font-weight: 800; line-height: 1.1; }
.stat-label { font-size: 13px; color: var(--text-muted); }

/* ---- Tabellen ---- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
    text-align: left; padding: 10px 12px;
    font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
    color: var(--text-muted); border-bottom: 2px solid var(--border);
    white-space: nowrap;
}
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: #f8fafc; }
.table .acties { text-align: right; white-space: nowrap; }

/* ---- Formulieren ---- */
form label { display: block; margin-bottom: 12px; font-size: 13px; font-weight: 600; color: var(--text); }
input[type=text], input[type=password], input[type=email], input[type=tel],
input[type=number], input[type=date], input[type=time], select, textarea {
    width: 100%; margin-top: 4px;
    padding: 9px 12px;
    border: 1px solid var(--border); border-radius: 8px;
    font: inherit; font-weight: 400;
    background: var(--surface); color: var(--text);
    transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, .12);
}
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
.checkbox-label { display: flex !important; align-items: center; gap: 8px; font-weight: 500; }
.checkbox-label input { width: auto; margin: 0; }

/* ---- Knoppen ---- */
.btn {
    display: inline-block; padding: 9px 16px;
    border: none; border-radius: 8px;
    font: inherit; font-size: 14px; font-weight: 600;
    cursor: pointer; text-decoration: none; text-align: center;
    transition: background .15s, transform .05s;
    line-height: 1.4;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--gray-bg); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: var(--red-bg); color: var(--red); }
.btn-danger:hover { background: #fecaca; }
.btn-ghost { background: transparent; color: #94a3b8; border: 1px solid #334155; }
.btn-ghost:hover { background: #1e293b; color: #fff; }
.btn-small { padding: 5px 10px; font-size: 13px; }
.btn-full { width: 100%; display: block; }

/* ---- Badges & alerts ---- */
.badge {
    display: inline-block; padding: 3px 10px;
    border-radius: 999px; font-size: 12px; font-weight: 600;
    white-space: nowrap;
}
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-blue { background: var(--blue-bg); color: var(--blue); }
.badge-orange { background: var(--orange-bg); color: var(--orange); }
.badge-gray, .badge-default { background: var(--gray-bg); color: var(--gray); }

.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; font-weight: 500; }
.alert-green { background: var(--green-bg); color: #15803d; }
.alert-red { background: var(--red-bg); color: #b91c1c; }
.alert-orange { background: var(--orange-bg); color: #c2410c; }

.muted { color: var(--text-muted); font-size: 13px; }
.mt { margin-top: 16px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.filters label { margin-bottom: 0; min-width: 160px; }
.filters .btn { margin-bottom: 1px; }

/* ---- Agenda / kalender ---- */
.week-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(150px, 1fr));
    gap: 8px;
}
.week-dag {
    background: var(--surface); border-radius: var(--radius);
    box-shadow: var(--shadow); min-height: 160px;
    display: flex; flex-direction: column;
}
.week-dag-kop {
    padding: 8px 10px; font-size: 13px; font-weight: 700;
    border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between;
}
.week-dag-kop.vandaag { background: var(--primary); color: #fff; border-radius: var(--radius) var(--radius) 0 0; }
.week-dag-items { padding: 8px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.planning-item {
    padding: 7px 9px; border-radius: 7px; font-size: 12px;
    border-left: 3px solid var(--blue);
    background: var(--blue-bg);
    color: var(--text); text-decoration: none;
    display: block;
}
.planning-item strong { display: block; font-size: 12.5px; }
.planning-item.status-klaar { border-color: var(--gray); background: var(--gray-bg); opacity: .7; }
.planning-item.status-bezig { border-color: var(--orange); background: var(--orange-bg); }
.planning-item.status-bevestigd { border-color: var(--green); background: var(--green-bg); }
.planning-item.status-geannuleerd { border-color: var(--red); background: var(--red-bg); text-decoration: line-through; }
.planning-item.type-onderhoud { border-style: dashed; }

.maand-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.maand-kop { text-align: center; font-size: 12px; font-weight: 700; color: var(--text-muted); padding: 4px; }
.maand-dag {
    aspect-ratio: 1.2; min-height: 52px;
    background: var(--surface); border-radius: 8px;
    border: 1px solid var(--border);
    padding: 6px; font-size: 13px;
    position: relative;
}
.maand-dag.leeg { background: transparent; border: none; }
.maand-dag.beschikbaar { background: var(--green-bg); border-color: var(--green); cursor: pointer; }
.maand-dag.beschikbaar:hover { background: #bbf7d0; }
.maand-dag.geselecteerd { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }
.maand-dag.verleden { opacity: .4; }
.maand-dag .dag-marker { position: absolute; bottom: 5px; left: 6px; right: 6px; font-size: 10px; overflow: hidden; white-space: nowrap; }

/* ---- Beschikbaarheidsrooster ---- */
.dagen-rooster { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.dag-blok {
    border: 1px solid var(--border); border-radius: 8px; padding: 10px;
    background: var(--surface);
}
.dag-blok.aan { border-color: var(--primary); background: var(--primary-light); }
.dag-blok .dag-naam { font-weight: 700; font-size: 13px; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.dag-blok input[type=time] { padding: 5px 6px; font-size: 12px; }

/* ---- Voorraad ---- */
.voorraad-laag { color: var(--red); font-weight: 700; }
.barcode-scan { display: flex; gap: 8px; }
.barcode-scan input { flex: 1; }

/* ---- Foto's onderhoud ---- */
.foto-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.foto-item { display: flex; flex-direction: column; gap: 6px; }
.foto-item img {
    width: 100%; aspect-ratio: 4/3; object-fit: cover;
    border-radius: 8px; border: 1px solid var(--border);
}
input[type=file] {
    width: 100%; margin-top: 4px; padding: 8px;
    border: 1px dashed var(--border); border-radius: 8px;
    font: inherit; background: var(--surface);
}

/* ---- Login ---- */
.login-body {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #115e59 100%);
    padding: 20px;
}
.login-box {
    background: var(--surface); border-radius: 16px;
    padding: 36px; width: 100%; max-width: 380px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .3);
}
.login-logo { font-size: 40px; text-align: center; }
.login-box h1 { text-align: center; font-size: 22px; margin: 6px 0 2px; }
.login-box .muted { text-align: center; margin-bottom: 20px; }
.login-box form { margin-top: 16px; }

/* ---- Responsief ---- */
@media (max-width: 900px) {
    .sidebar {
        position: fixed; left: -260px; z-index: 100;
        transition: left .2s; height: 100vh;
    }
    .sidebar.open { left: 0; box-shadow: 4px 0 24px rgba(0,0,0,.3); }
    .hamburger { display: block; }
    .content { padding: 16px; }
    .topbar { padding: 12px 16px; }
    .week-grid { grid-template-columns: 1fr; }
    .week-dag { min-height: auto; }
}

@media print {
    .sidebar, .topbar, .btn, .filters { display: none !important; }
    .content { padding: 0; }
}
