/* Haus Astenalm intern portaal */
:root {
    --green-dark: #24523d;
    --green: #2f6b4f;
    --green-light: #e7f0eb;
    --bg: #f4f6f5;
    --card: #ffffff;
    --border: #dfe5e2;
    --text: #26302b;
    --muted: #6b7671;
    --orange: #e08a00;
    --yellow: #b99a00;
    --red: #b04a4a;
    --blue: #3b6ea5;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
}
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0; }
h2 { font-size: 15px; margin: 18px 0 10px; color: var(--green-dark); text-transform: uppercase; letter-spacing: .04em; }
h2:first-child { margin-top: 0; }
code { background: var(--green-light); padding: 1px 5px; border-radius: 4px; font-size: 12px; }

/* Layout */
.app { display: flex; min-height: 100vh; }
.sidebar {
    width: 210px; flex-shrink: 0;
    background: var(--green-dark); color: #fff;
    display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh;
}
.brand { padding: 20px 18px 14px; border-bottom: 1px solid rgba(255,255,255,.15); }
.brand strong { display: block; font-size: 16px; }
.brand span { font-size: 12px; opacity: .7; }
.sidebar nav { flex: 1; padding: 12px 0; }
.sidebar nav a {
    display: block; padding: 9px 18px; color: rgba(255,255,255,.85);
    text-decoration: none; font-size: 14px;
}
.sidebar nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar nav a.active { background: var(--green); color: #fff; font-weight: 600; }
.sidebar-footer { padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.15); font-size: 13px; }
.sidebar-footer .user-name { display: block; opacity: .8; margin-bottom: 4px; }
.sidebar-footer a { color: #fff; }
.main { flex: 1; padding: 22px 26px; min-width: 0; }

/* Page head */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Cards */
.card {
    background: var(--card); border: 1px solid var(--border); border-radius: 8px;
    padding: 18px; margin-bottom: 18px;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 1000px) { .grid-2 { grid-template-columns: 1fr; } }
.form-card { max-width: 640px; }

/* Stat cards */
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
@media (max-width: 800px) { .stat-cards { grid-template-columns: repeat(2, 1fr); } }
.stat-card {
    background: var(--card); border: 1px solid var(--border); border-radius: 8px;
    padding: 14px 16px; display: flex; flex-direction: column;
}
.stat-value { font-size: 26px; font-weight: 700; color: var(--green-dark); }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* Tables */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 7px 9px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: none; }
.table th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.detail-table th { width: 130px; text-transform: none; font-size: 13px; }
.table-scroll { overflow-x: auto; }
.room-table small { display: block; color: var(--muted); font-weight: 400; }
.room-label { cursor: pointer; }
.notes { white-space: pre-line; background: var(--green-light); padding: 10px 12px; border-radius: 6px; }

/* Badges */
.badge {
    display: inline-block; padding: 2px 9px; border-radius: 999px;
    font-size: 11.5px; font-weight: 600; color: #fff; vertical-align: middle;
}
.badge.st-offerte { background: var(--orange); }
.badge.st-optie { background: var(--yellow); }
.badge.st-bevestigd { background: var(--green); }
.badge.st-geannuleerd { background: #9aa39e; }

/* Buttons */
.btn {
    display: inline-block; padding: 7px 14px; border-radius: 6px;
    border: 1px solid var(--border); background: #fff; color: var(--text);
    font-size: 13.5px; cursor: pointer; text-decoration: none; line-height: 1.3;
}
.btn:hover { background: var(--green-light); text-decoration: none; }
.btn-primary { background: var(--green); border-color: var(--green); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--green-dark); }
.btn-sm { padding: 3px 9px; font-size: 12.5px; }
.btn-block { width: 100%; }

/* Forms */
label { display: block; margin: 12px 0 4px; font-weight: 600; font-size: 13px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], select, textarea {
    width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px;
    font: inherit; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(47,107,79,.35); border-color: var(--green); }
textarea { resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check-line { display: flex; align-items: center; gap: 8px; font-weight: 400; margin: 10px 0; }
.check-line input { width: auto; }
.check-strong { font-weight: 600; }
.form-actions { margin-top: 18px; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form select, .inline-form input { width: auto; flex: 1; }
.price-input { max-width: 110px; }
.error-list { margin: 0; padding-left: 18px; }

/* Filter bar */
.filter-bar { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.filter-bar input[type=text] { max-width: 320px; }
.filter-bar select { width: auto; }

/* Flash messages */
.flash {
    padding: 10px 14px; border-radius: 6px; margin-bottom: 12px;
    border: 1px solid transparent; transition: opacity .6s ease;
}
.flash-hide { opacity: 0; }
.flash-success { background: #e6f3ea; border-color: #bcdcc7; color: #1d5c37; }
.flash-error { background: #fbeaea; border-color: #eec4c4; color: #8c2f2f; }
.flash-warning { background: #fdf3e0; border-color: #f0dcb0; color: #7d5a10; }
.flash-info { background: #e8eff7; border-color: #c4d6ea; color: #2d517a; }

/* Action buttons */
.action-buttons { display: flex; flex-wrap: wrap; gap: 8px; }

/* Calendar */
.cal-wrap { overflow-x: auto; padding: 10px; }
.cal { border-collapse: collapse; width: 100%; table-layout: fixed; min-width: 900px; }
.cal .col-room { width: 170px; }
.cal .col-day { width: 30px; }
.cal th, .cal td { border: 1px solid var(--border); padding: 0; }
.cal thead th { font-size: 11px; color: var(--muted); padding: 3px 0; text-align: center; background: #fafbfa; }
.cal thead th span { display: block; font-weight: 400; opacity: .8; }
.cal .cal-room { text-align: left; padding: 6px 9px; background: #fafbfa; font-size: 13px; }
.cal .cal-room small { display: block; color: var(--muted); font-weight: 400; font-size: 11px; }
.cal .cal-room a { color: var(--text); }
.cal td.weekend, .cal th.weekend { background: #f1f4f2; }
.cal th.today, .cal td.cal-free.today { box-shadow: inset 0 0 0 2px var(--green); }
.cal .cal-free { height: 34px; }
.cal .cal-free a { display: block; width: 100%; height: 34px; }
.cal .cal-free a:hover { background: var(--green-light); }
.cal .cal-bk a {
    display: block; padding: 8px 6px; height: 34px; overflow: hidden;
    white-space: nowrap; text-overflow: ellipsis;
    color: #fff; font-size: 12px; font-weight: 600;
}
.cal .cal-bk a:hover { text-decoration: none; filter: brightness(1.08); }
.cal .cal-bk.st-offerte { background: var(--orange); }
.cal .cal-bk.st-optie { background: var(--yellow); }
.cal .cal-bk.st-bevestigd { background: var(--green); }

/* Energie & klimaat */
.stat-cards-6 { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 1100px) { .stat-cards-6 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .stat-cards-6 { grid-template-columns: repeat(2, 1fr); } }
.stat-on { color: var(--green) !important; }
.stat-off { color: var(--muted) !important; }
.chart { width: 100%; height: auto; display: block; }
.chart-grid { stroke: var(--border); stroke-width: 1; }
.chart-label { fill: var(--muted); font-size: 11px; font-family: inherit; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 8px; }
.legend-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.tank-bar {
    height: 22px; background: #edf1ef; border: 1px solid var(--border);
    border-radius: 999px; overflow: hidden; margin: 4px 0 14px;
}
.tank-fill { height: 100%; border-radius: 999px; }
.tank-fill.tank-ok { background: var(--green); }
.tank-fill.tank-laag { background: var(--orange); }
.tank-fill.tank-urgent { background: var(--red); }

/* Kamercombinaties / snelkeuze */
.quick-combos { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 14px; }
.combo-btn { background: var(--green-light); border-color: var(--green); color: var(--green-dark); font-weight: 600; }
.combo-btn:hover { background: var(--green); color: #fff; }
.row-actions { white-space: nowrap; }
.row-actions form.inline-delete { display: inline-block; margin-left: 6px; }

/* Utility */
.muted { color: var(--muted); }

/* Login */
.login-page {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; background: var(--green-dark);
}
.login-card {
    background: #fff; border-radius: 10px; padding: 30px 34px;
    width: 100%; max-width: 380px; box-shadow: 0 10px 40px rgba(0,0,0,.25);
}
.login-brand { text-align: center; margin-bottom: 18px; }
.login-brand strong { display: block; font-size: 20px; color: var(--green-dark); }
.login-brand span { font-size: 13px; color: var(--muted); }
.login-card button { margin-top: 18px; }

/* Print: alleen hoofdinhoud */
@media print {
    .sidebar, .page-actions, .filter-bar { display: none; }
    .main { padding: 0; }
}
