/*
  ============================================================
  styles.css — GEDEELDE STIJL VOOR ALLE PAGINA'S
  ============================================================
  Elke pagina (Dashboard, Planning, Uren, Team, Omzet, Kosten,
  Rapportages, Instellingen) laadt dit ene bestand, zodat alles
  overal hetzelfde uitziet en we niet steeds dezelfde CSS moeten
  kopiëren/plakken.

  Stijlrichting: professioneel en betrouwbaar (rustige navy +
  witruimte), met één heldere accentkleur voor actie/energie, en
  zachte diepte (schaduw i.p.v. drukke randen/kleurvlakken) zodat
  het geheel overzichtelijk en rustig aanvoelt in plaats van druk.
*/

:root {
  --navy: #172033;
  --navy-soft: #2A3552;
  --bg: #F7F8FB;
  --accent: #2F6FED;
  --accent-soft: #EAF1FF;
  --accent-dark: #1F55C4;
  --green: #16A36A;
  --green-soft: #E6F6EF;
  --orange: #D97706;
  --orange-soft: #FDF3E4;
  --red: #E5484D;
  --red-soft: #FDECEC;
  --card-bg: #FFFFFF;
  --border: #E7EAF0;
  --text-muted: #6B7280;
  --shadow-sm: 0 1px 2px rgba(23,32,51,0.05);
  --shadow-md: 0 1px 2px rgba(23,32,51,0.04), 0 6px 20px rgba(23,32,51,0.06);
}
* { box-sizing: border-box; }
.hidden { display: none !important; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--navy);
  -webkit-font-smoothing: antialiased;
}
main { max-width: 900px; margin-left: 220px; padding: 32px 36px 64px; }
@media (max-width: 800px) {
  main { margin-left: 0; padding: 20px 16px 60px; }
}
h1 { font-size: 25px; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 4px 0; }
h2 { font-size: 16px; font-weight: 700; margin: 0 0 14px 0; }
.subtitle { color: var(--text-muted); font-size: 13.5px; margin-bottom: 22px; }

.banner {
  background: var(--accent-soft); border: 1px solid #D6E4FF; border-radius: 10px;
  padding: 10px 14px; font-size: 12.5px; color: var(--accent-dark); margin-bottom: 22px;
}
.banner.error { background: var(--red-soft); border-color: #F5C9CA; color: #B42318; }

.card {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-sm);
  padding: 20px 22px; margin-bottom: 18px;
}
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.row.wrap { flex-wrap: wrap; }

select, input, button, textarea {
  font-family: inherit; font-size: 13px; padding: 8px 11px;
  border: 1px solid var(--border); border-radius: 8px; background: white; color: var(--navy);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--accent); }
label { font-size: 12px; font-weight: 600; color: var(--text-muted); display: block; margin: 12px 0 5px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; font-size: 13px; border-bottom: 1px solid var(--border); }
th { color: var(--text-muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
tr:hover td { background: #FAFBFD; }

.btn {
  background: var(--accent); color: white; border: none; cursor: pointer; font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--accent-dark); }
.btn-secondary { background: white; color: var(--navy); cursor: pointer; }
.btn-secondary:hover { background: #F3F5F9; border-color: #D9DEE7; }
.btn-danger { background: white; color: var(--red); border-color: #F5C9CA; cursor: pointer; }
.btn-danger:hover { background: var(--red-soft); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.actions { display: flex; gap: 8px; margin-top: 18px; }
.status { font-size: 12px; color: var(--text-muted); margin-top: 8px; min-height: 16px; }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,20,32,0.45);
  display: flex; align-items: center; justify-content: center; z-index: 10;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: white; border-radius: 16px; padding: 24px; width: 420px; max-height: 85vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(15,20,32,0.25);
}

/* ---- Statuskleuren (financiële gezondheid) ---- */
.badge { display: inline-block; padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.orange { background: var(--orange-soft); color: var(--orange); }
.badge.red { background: var(--red-soft); color: var(--red); }

/* ---- Aandachtskaart (bijv. open diensten): kleuraccent i.p.v. een
   volledig gekleurd vlak, zodat het rustig blijft ondanks de
   waarschuwing. ---- */
.card.accent-left {
  border-left: 4px solid var(--red); padding-left: 19px;
}
.card.accent-left h2 { display: flex; align-items: center; gap: 8px; }
.card.accent-left h2::before {
  content: ""; width: 7px; height: 7px; border-radius: 999px; background: var(--red); display: inline-block;
}

/* ---- Navigatie (vaste linker zijbalk) ---- */
.app-nav {
  background: var(--navy); color: white;
  position: fixed; top: 0; left: 0; bottom: 0; width: 220px;
  overflow-y: auto; z-index: 5;
  display: flex; flex-direction: column;
}
.app-nav-inner {
  display: flex; flex-direction: column; padding: 10px 0 20px;
}
.app-nav-brand {
  font-weight: 700; font-size: 15.5px; letter-spacing: -0.01em; padding: 20px 20px 22px; white-space: nowrap;
}
.app-nav a {
  color: rgba(255,255,255,0.68); text-decoration: none; font-size: 13.5px;
  padding: 11px 20px; white-space: nowrap; border-left: 3px solid transparent;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.app-nav a:hover { color: white; background: rgba(255,255,255,0.06); }
.app-nav a.active { color: white; border-left-color: var(--accent); font-weight: 600; background: rgba(255,255,255,0.07); }

/* Ondersteunende onderdelen (Klantenservice/Instellingen/GainOwner) —
   los van de eigen dagelijkse administratie hierboven, met wat lucht en
   een scheidingslijn zodat duidelijk is dat dit een ander soort menu is. */
.app-nav-divider { height: 1px; background: rgba(255,255,255,0.1); margin: 14px 20px 10px; }
.app-nav-section-label {
  padding: 0 20px 6px; font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: rgba(255,255,255,0.4); white-space: nowrap;
}

@media (max-width: 800px) {
  .app-nav { position: static; width: auto; }
  .app-nav-inner { flex-direction: row; overflow-x: auto; padding: 4px 8px; }
  .app-nav a { border-left: none; border-bottom: 2px solid transparent; padding: 12px 10px; }
  .app-nav a.active { border-left-color: transparent; border-bottom-color: var(--accent); }
  .app-nav-divider { width: 1px; height: auto; align-self: stretch; margin: 4px 6px; }
  .app-nav-section-label { display: flex; align-items: center; padding: 0 6px; }
}

/* ---- Meldingenbelletje (onderaan de zijbalk) ---- */
.app-nav-footer { margin-top: auto; padding: 10px 14px 16px; position: relative; }
.notif-bell {
  width: 100%; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.85); border-radius: 8px; padding: 9px 12px; font-size: 12.5px;
  display: flex; align-items: center; gap: 6px; cursor: pointer;
}
.notif-bell:hover { background: rgba(255,255,255,0.1); }
.notif-count {
  background: var(--red); color: white; font-size: 10.5px; font-weight: 700;
  border-radius: 999px; padding: 1px 6px; margin-left: auto;
}
.notif-count.hidden { display: none; }
.notif-panel {
  position: absolute; bottom: 56px; left: 14px; right: 14px;
  background: white; border-radius: 12px; box-shadow: 0 12px 32px rgba(15,20,32,0.3);
  max-height: 340px; display: flex; flex-direction: column; overflow: hidden; z-index: 20;
}
.notif-panel.hidden { display: none; }
.notif-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 12.5px; font-weight: 700; color: var(--navy);
}
.notif-clear { background: none; border: none; color: var(--accent); font-size: 11.5px; font-weight: 600; padding: 0; cursor: pointer; }
.notif-list { overflow-y: auto; }
.notif-item { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.notif-item:last-child { border-bottom: none; }
.notif-message { font-size: 12.5px; color: var(--navy); }
.notif-meta { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.notif-empty { padding: 16px 14px; font-size: 12.5px; color: var(--text-muted); }

/* ---- Ingelogde gebruiker + uitloggen (boven het meldingenbelletje) ---- */
.app-nav-user {
  padding: 12px 14px 10px; margin: 0 4px; border-top: 1px solid rgba(255,255,255,0.1);
}
.app-nav-user-name {
  font-size: 12.5px; font-weight: 600; color: white;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.app-nav-user-role { font-size: 11px; color: rgba(255,255,255,0.55); margin-top: 1px; }
.app-nav-logout {
  margin-top: 9px; width: 100%; background: none; border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.75); border-radius: 8px; padding: 7px 10px; font-size: 12px; cursor: pointer;
}
.app-nav-logout:hover { background: rgba(255,255,255,0.08); color: white; }

/* ---- Inlogpagina ---- */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg); padding: 20px;
}
.login-card {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow-md); padding: 38px 34px; width: 100%; max-width: 380px;
}
.login-brand { font-weight: 700; font-size: 19px; color: var(--navy); margin-bottom: 4px; }
.login-sub { color: var(--text-muted); font-size: 13px; margin-bottom: 24px; }
.login-field input { width: 100%; }
.login-submit { width: 100%; padding: 11px; font-size: 13.5px; margin-top: 8px; border-radius: 8px; }
.login-hint { margin-top: 18px; font-size: 11.5px; color: var(--text-muted); text-align: center; }

/* ---- RTL-ondersteuning (Arabisch) ----
   Spiegelt de zijbalk-navigatie en tekstuitlijning. Wordt geactiveerd doordat
   i18n.js `dir="rtl"` op <html> zet voor de taal "ar". Alle overige CSS blijft
   logisch/symmetrisch genoeg om zonder aparte regels goed te ogen. */
[dir="rtl"] main { margin-left: 0; margin-right: 220px; }
@media (max-width: 800px) {
  [dir="rtl"] main { margin-right: 0; }
}
[dir="rtl"] .app-nav { left: auto; right: 0; }
[dir="rtl"] .app-nav a { border-left: none; border-right: 3px solid transparent; }
[dir="rtl"] .app-nav a.active { border-left-color: transparent; border-right-color: var(--accent); }
@media (max-width: 800px) {
  [dir="rtl"] .app-nav a { border-right: none; border-bottom: 2px solid transparent; }
  [dir="rtl"] .app-nav a.active { border-right-color: transparent; border-bottom-color: var(--accent); }
}
[dir="rtl"] .notif-count { margin-left: 0; margin-right: auto; }
[dir="rtl"] th, [dir="rtl"] td { text-align: right; }
[dir="rtl"] .card.accent-left { border-left: none; border-right: 4px solid var(--red); padding-left: 0; padding-right: 19px; }
