/* PB-Afspraaktool Admin — CSS */
/* Gebaseerd op mockup variabelen */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

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

:root {
  --pb-orange: #EF7D05;
  --pb-orange-light: #fff3e6;
  --pb-orange-hover: #d96e00;
  --pb-black: #010202;
  --pb-grey: #B3B3B2;
  --pb-grey-light: #f5f5f5;
  --pb-bg: #fafafa;
  --pb-white: #ffffff;
  --pb-green: #95C121;
  --pb-blue: #14B4EA;
  --pb-yellow: #F9B004;
  --pb-red: #e74c3c;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
}

body {
  font-family: 'Inter', Arial, sans-serif;
  color: var(--pb-black);
  line-height: 1.6;
  background: var(--pb-bg);
}

/* === LOGIN PAGE === */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eee;
}

.login-card {
  background: white;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
}

.login-header h1 {
  font-size: 22px;
  font-weight: 800;
  color: var(--pb-orange);
}

.login-header p {
  font-size: 13px;
  color: var(--pb-grey);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 600;
}

/* === FORMS === */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #333;
  margin-bottom: 6px;
}

.form-group .hint {
  font-size: 12px;
  color: #888;
  margin-top: 4px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: white;
  transition: border-color 0.2s;
  min-height: 44px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--pb-orange);
}

.form-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid #f3f3f3;
  align-items: center;
}

.form-row:last-child { border-bottom: none; }

.form-row label {
  font-size: 13px;
  font-weight: 600;
  color: #444;
}

.form-row .help {
  font-size: 11px;
  color: #999;
  font-weight: 500;
  margin-top: 2px;
}

.form-row input,
.form-row select,
.form-row textarea {
  padding: 10px 12px;
  border: 1.5px solid #e0e0e0;
  border-radius: 7px;
  font-size: 13px;
  font-family: inherit;
  min-height: 40px;
  background: white;
}

.form-row input:focus,
.form-row select:focus {
  outline: none;
  border-color: var(--pb-orange);
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  text-decoration: none;
  line-height: 1.4;
}

.btn-primary { background: var(--pb-orange); color: white; }
.btn-primary:hover { background: var(--pb-orange-hover); }
.btn-outline { background: transparent; border: 1.5px solid #ddd; color: #555; }
.btn-outline:hover { border-color: var(--pb-orange); color: var(--pb-orange); }
.btn-ghost { background: transparent; color: #777; padding: 6px 10px; }
.btn-ghost:hover { background: var(--pb-grey-light); }
.btn-green { background: var(--pb-green); color: white; }
.btn-red { background: var(--pb-red); color: white; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; min-height: 48px; font-size: 15px; }
.btn-danger { background: white; color: var(--pb-red); border: 1.5px solid var(--pb-red); }
.btn-danger:hover { background: var(--pb-red); color: white; }

/* === ALERTS === */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
  font-weight: 500;
}

.alert-error {
  background: #fbe4e1;
  color: #8c2c1f;
  border: 1px solid #e74c3c30;
}

.alert-success {
  background: #ecf8d4;
  color: #5d8203;
}

.alert-info {
  background: #def0f9;
  color: #0a4b6b;
}

.banner {
  background: #fbe4e1;
  border: 1.5px solid #e74c3c30;
  color: #8c2c1f;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.banner .btn { margin-left: auto; }

/* === ADMIN LAYOUT === */
.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

/* === SIDEBAR === */
.sidebar {
  background: var(--pb-black);
  color: white;
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-header {
  padding: 0 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 16px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo-mark {
  width: 36px;
  height: 36px;
  background: var(--pb-orange);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
}

.sidebar-logo-text {
  font-size: 14px;
  font-weight: 700;
}

.sidebar-logo-text small {
  display: block;
  font-size: 10px;
  font-weight: 500;
  color: rgba(255,255,255,0.5);
  margin-top: -2px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.sidebar-section {
  padding: 16px 12px 8px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  margin: 0 8px 2px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.sidebar-item:hover { background: rgba(255,255,255,0.06); color: white; }
.sidebar-item.active { background: var(--pb-orange); color: white; font-weight: 600; }

.sidebar-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 20px;
  margin-top: auto;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  background: var(--pb-orange);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
}

.sidebar-user-info { font-size: 12px; }
.sidebar-user-info strong { display: block; color: white; }
.sidebar-user-info span { color: rgba(255,255,255,0.5); text-transform: capitalize; }

.sidebar-logout {
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}

.sidebar-logout:hover { color: white; }

/* === CONTENT AREA === */
.admin-content {
  padding: 28px 36px;
  overflow-y: auto;
}

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

.topbar h2 {
  font-size: 24px;
  font-weight: 800;
}

.topbar .crumb {
  font-size: 12px;
  color: #999;
  margin-bottom: 4px;
}

.topbar .crumb a {
  color: var(--pb-orange);
  text-decoration: none;
}

.topbar-actions {
  display: flex;
  gap: 8px;
}

/* === STATS === */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat {
  background: white;
  padding: 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.stat-label {
  font-size: 11px;
  color: #999;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--pb-black);
  line-height: 1;
}

.stat-sub {
  font-size: 12px;
  color: #666;
  margin-top: 4px;
}

.stat-sub.green { color: var(--pb-green); }
.stat-sub.red { color: var(--pb-red); }
.stat.alert { border-left: 4px solid var(--pb-red); }
.stat.success { border-left: 4px solid var(--pb-green); }

/* === PANELS === */
.panel {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
  flex-wrap: wrap;
  gap: 8px;
}

.panel-header h3 {
  font-size: 15px;
  font-weight: 700;
}

.panel-body { padding: 16px 20px; }
.panel-body.tight { padding: 0; }

/* === TABLES === */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  text-align: left;
  padding: 12px 16px;
  background: #fafafa;
  font-size: 11px;
  font-weight: 700;
  color: #777;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid #eee;
}

tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid #f3f3f3;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafafa; }

td .name { font-weight: 600; color: var(--pb-black); }
td .sub { font-size: 11px; color: #999; }

/* === BADGES === */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}

.badge-green { background: #ecf8d4; color: #5d8203; }
.badge-orange { background: var(--pb-orange-light); color: var(--pb-orange); }
.badge-red { background: #fbe4e1; color: #b91d12; }
.badge-grey { background: #eee; color: #777; }
.badge-blue { background: #def0f9; color: #0a6b94; }
.badge-yellow { background: #fdefcc; color: #8c5e00; }

/* === SCHEDULE GRID === */
.schedule {
  display: grid;
  gap: 1px;
  background: #e5e5e5;
}

.schedule .cell {
  background: white;
  padding: 12px;
  font-size: 13px;
}

.schedule .head {
  background: var(--pb-grey-light);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #666;
}

.schedule .time-cell {
  font-family: monospace;
  font-size: 12px;
  font-weight: 600;
}

.schedule .cell-free {
  background: var(--pb-orange-light);
  color: #999;
  font-size: 12px;
}

.schedule .cell-pause {
  background: #fbe4e1;
  color: #8c2c1f;
  font-weight: 600;
  text-align: center;
}

.schedule .cell-unavailable {
  background: #eee;
  color: #999;
  font-style: italic;
  font-size: 11px;
}

/* === DAY TABS === */
.day-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.day-tab {
  padding: 10px 16px;
  border-radius: 8px;
  border: 2px solid #e0e0e0;
  background: white;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s;
  text-decoration: none;
  color: var(--pb-black);
}

.day-tab.active {
  border-color: var(--pb-orange);
  background: var(--pb-orange-light);
  color: var(--pb-orange);
}

.day-tab .pct {
  font-size: 11px;
  color: #999;
  font-weight: 500;
  margin-left: 6px;
}

/* === LEGEND === */
.legend {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: #666;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

/* === CONFIRM DIALOG === */
.dialog-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.dialog-overlay.active { display: flex; }

.dialog {
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 28px;
  max-width: 440px;
  width: 90%;
}

.dialog h3 { font-size: 18px; margin-bottom: 8px; }
.dialog p { font-size: 14px; color: #555; margin-bottom: 20px; }

.dialog-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* === EMPTY STATE === */
.empty {
  text-align: center;
  padding: 40px 20px;
  color: #999;
  font-size: 13px;
}

/* === PROGRESS BAR === */
.progress-bar {
  height: 6px;
  background: #eee;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 6px;
}

.progress-bar-fill {
  height: 100%;
  background: var(--pb-orange);
  border-radius: 3px;
  transition: width 0.3s;
}

/* === META GRID === */
.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
}

.meta-label {
  font-size: 11px;
  color: #999;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.meta-value {
  font-size: 16px;
  font-weight: 700;
}

.meta-value.mono {
  font-family: monospace;
  font-size: 12px;
  color: var(--pb-orange);
  word-break: break-all;
}

/* === LOGO UPLOAD === */
.logo-area {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 32px;
  align-items: start;
}

.logo-preview {
  background: #f5f5f5;
  border: 2px dashed #ccc;
  border-radius: 12px;
  height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.logo-placeholder {
  font-size: 14px;
  color: #999;
  text-align: center;
}

/* Geannuleerde boekingen in de afspraken-tabel (zichtbaar via 'Inclusief geannuleerd'-filter) */
tr.row-cancelled td { color: #999; }
tr.row-cancelled td .name { text-decoration: line-through; }
tr.row-cancelled td:not(:last-child) { background: rgba(0,0,0,0.02); }

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .admin-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .admin-content { padding: 16px; }
  .form-row { grid-template-columns: 1fr; }
  .logo-area { grid-template-columns: 1fr; }
}
