:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --line: #dde3ea;
  --text: #17202a;
  --muted: #64748b;
  --brand: #0f766e;
  --brand-dark: #115e59;
  --accent: #2563eb;
  --danger: #dc2626;
  --warning: #b45309;
}

* { box-sizing: border-box; }
body.planning-app {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px;
  background: #102027;
  color: #fff;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  color: #fff;
  text-decoration: none;
  padding: 8px 8px 18px;
  border-bottom: 1px solid rgba(255,255,255,.12);
  margin-bottom: 14px;
}
.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--brand);
}
.brand small { display: block; color: #b8c7ce; font-size: 12px; }

.app-nav {
  display: grid;
  gap: 4px;
}
.app-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #d6e0e5;
  text-decoration: none;
  padding: 11px 12px;
  border-radius: 8px;
  font-size: 14px;
}
.app-nav a:hover,
.app-nav a.active {
  background: rgba(255,255,255,.12);
  color: #fff;
}
.app-nav svg,
.brand svg {
  width: 18px;
  height: 18px;
}

.app-main {
  min-width: 0;
  padding: 26px;
}
.page-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.page-header h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: 0;
}
.page-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

.metric-grid,
.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.metric-card,
.action-card,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .05);
}
.metric-card,
.action-card {
  padding: 18px;
}
.action-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  color: inherit;
  text-decoration: none;
}
.action-card:hover {
  border-color: var(--brand);
}
.action-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #e7f5f2;
  color: var(--brand-dark);
  flex: 0 0 auto;
}
.action-card h2,
.metric-card h2 {
  font-size: 17px;
  margin: 0 0 4px;
}
.action-card p,
.metric-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.filterbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.filterbar .form-select,
.filterbar .form-control {
  min-width: 190px;
}

.planning-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 16px;
  align-items: start;
}
.timeline {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(245px, 1fr);
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 12px;
}
.day-column {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 260px;
  padding: 12px;
}
.day-column h2 {
  font-size: 15px;
  margin: 0 0 6px;
}
.day-meta {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}
.shift-card {
  position: relative;
  display: block;
  border: 1px solid #cfe0f6;
  background: #f8fbff;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
  color: inherit;
  text-decoration: none;
}
.shift-card:hover { border-color: var(--accent); }
.shift-time {
  font-weight: 700;
  color: var(--brand-dark);
}
.shift-empty {
  color: var(--danger);
  font-weight: 600;
}
.side-panel {
  position: sticky;
  top: 18px;
  padding: 14px;
}
.side-panel h2 {
  font-size: 16px;
  margin: 0 0 10px;
}
.hours-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.hours-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.hours-list li:last-child { border-bottom: 0; }

.table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.table { margin-bottom: 0; }
.btn svg { width: 16px; height: 16px; margin-right: 6px; }

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .app-sidebar {
    position: relative;
    height: auto;
  }
  .app-nav {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
  .planning-board { grid-template-columns: 1fr; }
  .side-panel { position: relative; top: auto; }
}

@media (max-width: 620px) {
  .app-main { padding: 18px 12px; }
  .page-header h1 { font-size: 23px; }
  .toolbar { align-items: stretch; }
  .filterbar,
  .filterbar .form-select,
  .filterbar .form-control {
    width: 100%;
  }
}

.bureau-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-panel {
  width: min(420px, 100%);
  padding: 24px;
}
.login-panel h1 {
  margin: 0;
  font-size: 24px;
}
.login-panel .brand-mark {
  color: #fff;
}
.bureau-shell {
  min-height: 100vh;
}
.bureau-main {
  max-width: 1500px;
  margin: 0 auto;
}
.bureau-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}
.bureau-title {
  display: flex;
  align-items: center;
  gap: 12px;
}
.bureau-logo {
  max-height: 46px;
  max-width: 160px;
  object-fit: contain;
}
.bureau-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .05);
}
.bureau-card-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
}
.bureau-card-body {
  padding: 16px;
}
.bureau-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.bureau-details p {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}
.val-label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.medewerker-list {
  max-height: calc(100vh - 260px);
  overflow-y: auto;
}
.medewerker-card {
  cursor: grab;
}
.medewerker-card:active {
  cursor: grabbing;
}
.medewerker-photo {
  width: 74px;
  height: 74px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  flex: 0 0 auto;
}
.medewerker-photo-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
}
.rooster-wrapper {
  overflow-x: auto;
  padding-bottom: 12px;
  white-space: nowrap;
}
.dag-kolom {
  display: inline-block;
  vertical-align: top;
  min-width: 260px;
  max-width: 260px;
  margin-right: 10px;
}
.dag-header {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  text-align: center;
  font-weight: 700;
}
.dienst-drop {
  min-height: 40px;
}
.dienst-card.drop-highlight {
  border-style: dashed;
  border-color: var(--brand);
  background-color: #e7f5f2;
}
.dienst-medewerker {
  color: var(--brand-dark);
  font-weight: 700;
  word-wrap: break-word;
  white-space: normal;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.2;
}
.dienst-alert {
  border: 2px solid var(--danger) !important;
  background-color: #fff1f2 !important;
}
.icon-button svg,
.btn svg {
  width: 16px;
  height: 16px;
  margin-right: 6px;
  vertical-align: -2px;
}
.btn-primary,
.btn-custom {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.btn-primary:hover,
.btn-custom:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: #fff;
}

@media (max-width: 980px) {
  .bureau-topbar {
    align-items: flex-start;
    flex-direction: column;
  }
}
