/* Dashboard — extends theme.css design tokens */
:root {
  --bg: #FAF8F5;
  --bg-alt: #F2EDE6;
  --fg: #1A1A1A;
  --fg-muted: #6B6560;
  --accent: #D4613A;
  --accent-dark: #B84F2E;
  --border: #E2DDD6;
  --serif: 'DM Serif Display', Georgia, serif;
  --sans: 'DM Sans', system-ui, sans-serif;
}

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

/* ── LAYOUT ── */
.db-layout {
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR ── */
.db-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--fg);
  color: var(--bg);
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: sticky;
  top: 0;
  height: 100vh;
}

.db-logo {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--bg);
  margin-bottom: 48px;
  padding-left: 4px;
}

.db-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.db-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: rgba(250, 248, 245, 0.55);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
}

.db-nav-item:hover,
.db-nav-item.active {
  background: rgba(250, 248, 245, 0.08);
  color: var(--bg);
}

.db-back {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: rgba(250, 248, 245, 0.4);
  text-decoration: none;
  padding: 8px 12px;
  transition: color 0.15s;
  margin-top: 24px;
}

.db-back:hover { color: var(--bg); }

/* ── MAIN ── */
.db-main {
  flex: 1;
  padding: 48px 56px;
  background: var(--bg);
  overflow-x: auto;
}

/* ── PANELS ── */
.db-panel { display: none; }
.db-panel.active { display: block; }

.db-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 24px;
}

.db-panel-title {
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 400;
  color: var(--fg);
  line-height: 1.1;
}

.db-panel-sub {
  font-size: 14px;
  color: var(--fg-muted);
  margin-top: 6px;
}

/* ── BUTTONS ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.btn-primary:hover { background: var(--accent-dark); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 20px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.btn-ghost:hover {
  background: var(--bg-alt);
  border-color: #ccc;
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #c0392b;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-danger:hover { background: #a93226; }

/* ── STATS ── */
.db-stats-row {
  display: flex;
  gap: 16px;
  margin-bottom: 28px;
}

.db-stat-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  text-align: center;
  min-width: 90px;
}

.db-stat-num {
  display: block;
  font-family: var(--serif);
  font-size: 32px;
  color: var(--fg);
  line-height: 1;
  margin-bottom: 6px;
}

.db-stat-num.stat-confirmed { color: #2E7D32; }
.db-stat-num.stat-cancelled { color: #c0392b; }
.db-stat-num.stat-noshow { color: #7B5EA7; }

.db-stat-label {
  font-size: 12px;
  color: var(--fg-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── FILTERS ── */
.db-header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.db-filter-group {
  display: flex;
  gap: 4px;
}

.filter-btn {
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-muted);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
}

.filter-btn:hover { background: var(--bg-alt); }

.filter-btn.active {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

/* ── TABLE ── */
.db-table-wrap {
  overflow-x: auto;
}

.db-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.db-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  padding: 0 16px 12px 0;
  border-bottom: 1px solid var(--border);
}

.db-table td {
  padding: 14px 16px 14px 0;
  color: var(--fg);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.db-table tr:last-child td { border-bottom: none; }

.db-table tbody tr:hover td { background: #fdfcfa; }

.db-table .col-actions {
  text-align: right;
  padding-right: 0;
  white-space: nowrap;
}

.db-empty-row td { padding: 40px 0; }
.db-empty { color: var(--fg-muted); text-align: center; font-size: 14px; }

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.status-badge.confirmed { background: #E8F5E8; color: #2E7D32; }
.status-badge.cancelled { background: #FDECEA; color: #c0392b; }
.status-badge.no-show    { background: #F3F0FF; color: #7B5EA7; }

.action-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--fg-muted);
  padding: 6px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
  font-size: 16px;
  line-height: 1;
}

.action-btn:hover { background: var(--bg-alt); color: var(--fg); }
.action-btn.delete:hover { background: #FDECEA; color: #c0392b; }

/* ── MODAL ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 26, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open { display: flex; }

.modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 540px;
  box-shadow: 0 24px 64px rgba(26, 26, 26, 0.15);
  overflow: hidden;
}

.modal-sm { max-width: 400px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  color: var(--fg);
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--fg-muted);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  border-radius: 6px;
  transition: background 0.15s;
}

.modal-close:hover { background: var(--bg-alt); }

.modal-body-text {
  padding: 20px 28px;
  font-size: 14px;
  color: var(--fg-muted);
  line-height: 1.6;
}

/* ── FORM ── */
form { padding: 24px 28px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-group:last-child { margin-bottom: 0; }

label {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
}

input, select {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--fg);
  background: var(--bg);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  width: 100%;
}

input:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(212, 97, 58, 0.12);
}

input::placeholder, select::placeholder { color: #bbb; }

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px 28px 24px;
  border-top: 1px solid var(--border);
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .db-sidebar {
    width: 60px;
    padding: 24px 12px;
    align-items: center;
  }
  .db-logo { font-size: 18px; margin-bottom: 32px; }
  .db-nav-item span { display: none; }
  .db-nav-item { justify-content: center; padding: 12px; }
  .db-back span { display: none; }
  .db-back { justify-content: center; }
  .db-main { padding: 32px 24px; }
  .db-panel-header { flex-direction: column; align-items: flex-start; }
  .db-header-actions { flex-wrap: wrap; }
  .form-row { grid-template-columns: 1fr; }
}