/* ═══════════════════════════════════════════════════════════════════════════
   Villa Maria Klis — Admin Panel Styles
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --primary:    #D97559;
  --primary-dk: #c4633f;
  --secondary:  #1B3A5C;
  --accent:     #F0C040;
  --bg:         #f4f6f9;
  --card-bg:    #ffffff;
  --sidebar-bg: #1B3A5C;
  --sidebar-w:  240px;
  --text:       #1a1a2e;
  --text-muted: #6b7280;
  --border:     #e5e7eb;
  --radius:     10px;
  --shadow:     0 1px 4px rgba(0,0,0,.08);

  /* Status colours */
  --pending:   #f59e0b;
  --confirmed: #10b981;
  --cancelled: #ef4444;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: 'Inter', sans-serif; font-size: 14px; color: var(--text); background: var(--bg); }
input, select, textarea, button { font-family: inherit; font-size: inherit; }
button { cursor: pointer; }
a { text-decoration: none; color: inherit; }

/* ─── Login ──────────────────────────────────────────────────────────────── */
#login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1B3A5C 0%, #2d5f8a 100%);
}
.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 44px 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.login-logo { text-align: center; margin-bottom: 32px; }
.login-monogram {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 14px;
  background: var(--secondary);
  color: var(--primary);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1px;
  margin-bottom: 14px;
}
.login-logo h1 { font-size: 20px; color: var(--secondary); font-weight: 700; }
.login-logo p  { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ─── App layout ─────────────────────────────────────────────────────────── */
#app {
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar ────────────────────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  overflow-y: auto;
}
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar-monogram {
  width: 38px;
  height: 38px;
  background: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
.sidebar-title { font-size: 13.5px; font-weight: 700; color: #fff; line-height: 1.2; }
.sidebar-sub   { font-size: 11px; color: rgba(255,255,255,.5); margin-top: 2px; }

.sidebar-nav { flex: 1; padding: 16px 12px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 8px;
  color: rgba(255,255,255,.65);
  font-size: 13.5px;
  font-weight: 500;
  transition: background .15s, color .15s;
  margin-bottom: 2px;
}
.nav-item svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.nav-item:hover  { background: rgba(255,255,255,.1); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; }

/* ─── Sidebar sub-nav (settings tabs) ───────────────────────────────────── */
.nav-subnav {
  display: none;
  padding: 2px 12px 8px 41px;
  flex-direction: column;
  gap: 1px;
}
.nav-subnav {
  display: flex;
}
.nav-subitem {
  display: block;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,.5);
  cursor: pointer;
  transition: background .12s, color .12s;
  text-decoration: none;
}
.nav-subitem:hover  { color: rgba(255,255,255,.85); background: rgba(255,255,255,.07); }
.nav-subitem.active { color: #fff; background: rgba(255,255,255,.12); }

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: transparent;
  border: none;
  color: rgba(255,255,255,.5);
  font-size: 13px;
  font-weight: 500;
  border-top: 1px solid rgba(255,255,255,.1);
  width: 100%;
  transition: color .15s;
}
.sidebar-logout svg {
  width: 16px; height: 16px;
  fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.sidebar-logout:hover { color: #fff; }

/* ─── Main content ───────────────────────────────────────────────────────── */
#main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
#topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
#topbar h2 { font-size: 17px; font-weight: 700; color: var(--secondary); }
#topbar-actions { display: flex; gap: 8px; }

.section { padding: 24px 28px; display: none; }
.section.active { display: block; }

/* ─── Cards ──────────────────────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.card-header h3 { font-size: 14px; font-weight: 600; color: var(--secondary); }

/* ─── Stats grid ─────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.stat-card .stat-label { font-size: 11.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 8px; }
.stat-card .stat-value { font-size: 26px; font-weight: 700; color: var(--secondary); line-height: 1; }
.stat-card .stat-sub   { font-size: 11.5px; color: var(--text-muted); margin-top: 6px; }

/* ─── Upcoming list ──────────────────────────────────────────────────────── */
.upcoming-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 20px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.upcoming-item:last-child { border-bottom: none; }
.upcoming-guest { font-weight: 600; font-size: 13.5px; }
.upcoming-dates { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ─── Toolbar ────────────────────────────────────────────────────────────── */
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.search-input {
  flex: 1;
  min-width: 200px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 13.5px;
  outline: none;
  transition: border-color .15s;
}
.search-input:focus { border-color: var(--primary); }

/* ─── Table ──────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table thead th {
  background: #f8fafc;
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: #fafafa; }

.action-btns { display: flex; gap: 6px; flex-wrap: wrap; }

/* ─── Status badges ──────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.badge-pending   { background: #fef3c7; color: var(--pending);   }
.badge-confirmed { background: #d1fae5; color: var(--confirmed); }
.badge-cancelled { background: #fee2e2; color: var(--cancelled); }

/* ─── Empty state ────────────────────────────────────────────────────────── */
.empty-state { padding: 48px; text-align: center; color: var(--text-muted); }

/* ─── Admin calendar ─────────────────────────────────────────────────────── */
.cal-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.cal-toolbar h3 { font-size: 15px; font-weight: 700; color: var(--secondary); min-width: 180px; text-align: center; }

.cal-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
}
.legend-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  margin-right: 4px;
}
.legend-dot.available { background: #d1fae5; border: 1px solid #10b981; }
.legend-dot.booked    { background: #fee2e2; border: 1px solid #ef4444; }
.legend-dot.blocked   { background: #e5e7eb; border: 1px solid #9ca3af; }

.cal-bulk-wrap { display: flex; align-items: center; gap: 8px; }

#admin-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
}
.ac-weekday {
  padding: 8px 4px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.ac-day {
  position: relative;
  min-height: 70px;
  padding: 6px 8px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .12s;
}
.ac-day:nth-child(7n) { border-right: none; }
.ac-day.empty { background: #fafafa; cursor: default; }
.ac-day .day-num { font-size: 12px; font-weight: 600; color: var(--text); }
.ac-day.today .day-num { color: var(--primary); font-weight: 800; }
.ac-day.past  { opacity: .45; cursor: default; }

/* Availability states */
.ac-day.available  { background: #f0fdf4; }
.ac-day.available:hover { background: #dcfce7; }
.ac-day.booked     { background: #fff8f6; cursor: default; }
.ac-day.blocked    { background: #f3f4f6; }
.ac-day.blocked:hover { background: #e5e7eb; }
.ac-day.too-short  { background: #fef2f2; }
.ac-day.too-short:hover { background: #fee2e2; }
.ac-day.too-short .day-num  { color: #dc2626; }
.ac-day.too-short .day-price { color: #ef4444; }

/* ─── Booking bar ─────────────────────────────────────────────────────────── */
.ac-day.booked::before {
  content: '';
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  height: 26px;
  background: rgba(217, 117, 89, 0.15);
  border-top: 1.5px solid rgba(217, 117, 89, 0.4);
  border-bottom: 1.5px solid rgba(217, 117, 89, 0.4);
  border-left: none;
  border-right: none;
  z-index: 0;
}
/* Check-in: bar starts at 50% (guest arriving) */
.ac-day.bc-in::before {
  left: 50%;
  border-left: 1.5px solid rgba(217, 117, 89, 0.4);
  border-radius: 13px 0 0 13px;
}
/* Checkout day: left-half bar via ::after (guest departing, bar ends at centre) */
.ac-day.bc-checkout::after {
  content: '';
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 50%;
  height: 26px;
  background: rgba(217, 117, 89, 0.15);
  border: 1.5px solid rgba(217, 117, 89, 0.4);
  border-left: none;
  border-radius: 0 13px 13px 0;
  z-index: 0;
}
/* Row continuation start (Monday / first day of month mid-booking) */
.ac-day.bc-row-start::before {
  left: 6px;
  border-left: 1.5px solid rgba(217, 117, 89, 0.4);
  border-radius: 13px 0 0 13px;
}
/* Row continuation end (Sunday / last day of month mid-booking) */
.ac-day.bc-row-end::before {
  right: 6px;
  border-right: 1.5px solid rgba(217, 117, 89, 0.4);
  border-radius: 0 13px 13px 0;
}
/* Last booked night immediately before a checkout day — bar extends flush to edge */
.ac-day.bc-pre-checkout::before {
  right: 0;
  border-right: none;
  border-radius: 0;
}
.ac-day.bc-row-start.bc-row-end::before { border-radius: 13px; }
.ac-day.booked .day-status { display: none; }
.ac-day.booked .day-price  { position: relative; z-index: 1; }

.day-guest-label {
  position: absolute;
  bottom: 9px;
  height: 26px;
  display: flex;
  align-items: center;
  gap: 5px;
  z-index: 2;
  pointer-events: none;
  white-space: nowrap;
  left: 10px;
}
.day-guest-label.bc-label-right { left: calc(50% + 6px); }
.day-guest-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 8px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1.5px solid #fff;
}
.day-guest-name {
  font-size: 10px;
  font-weight: 600;
  color: #92400e;
}

.ac-day .day-guest {
  font-size: 10px;
  color: var(--cancelled);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ac-day .day-price {
  font-size: 10px;
  color: var(--confirmed);
  margin-top: 2px;
}
.ac-day .day-status {
  position: absolute;
  bottom: 5px;
  right: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.ac-day.available .day-status { background: var(--confirmed); }
.ac-day.blocked   .day-status { background: #9ca3af; }

/* ─── Bulk panel ─────────────────────────────────────────────────────────── */
.bulk-panel {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-top: 16px;
}
.bulk-panel h4 { font-size: 13px; font-weight: 600; margin-bottom: 12px; color: var(--secondary); }
.bulk-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.bulk-row label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 500; color: var(--text-muted); }
.bulk-row input, .bulk-row select { padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }

/* ─── Date popover ───────────────────────────────────────────────────────── */
.date-popover {
  position: fixed;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  min-width: 240px;
  box-shadow: 0 8px 24px rgba(0,0,0,.14);
  z-index: 200;
}
.popover-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.popover-header strong { font-size: 13.5px; color: var(--secondary); }
.popover-close {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  line-height: 1;
  padding: 0 2px;
}
.popover-close:hover { color: var(--text); }
#popover-body { font-size: 12.5px; color: var(--text-muted); margin-bottom: 12px; }
.popover-actions { display: flex; flex-direction: column; gap: 8px; }
.popover-price-row { display: flex; gap: 6px; }
.popover-price-row input {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12.5px;
}

/* ─── Settings ───────────────────────────────────────────────────────────── */
.settings-form { padding: 20px; }

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 7px;
  border: none;
  font-size: 13.5px;
  font-weight: 600;
  transition: background .15s, opacity .15s;
  white-space: nowrap;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dk); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) { background: var(--bg); }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover:not(:disabled) { background: #dc2626; }
.btn-secondary { background: #f3f4f6; color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover:not(:disabled) { background: #e5e7eb; }
.btn-sm   { padding: 6px 12px; font-size: 12px; border-radius: 6px; }
.btn-full { width: 100%; }

.select-sm {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 13px;
  background: #fff;
  cursor: pointer;
}

/* ─── Forms ──────────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12.5px; font-weight: 500; color: var(--text-muted); }
.field input, .field select, .field textarea {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 13.5px;
  outline: none;
  transition: border-color .15s;
  background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); }
.field textarea { resize: vertical; }
.field-row { display: flex; gap: 14px; }
.field-row .field { flex: 1; }
.form-error {
  padding: 10px 14px;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 7px;
  color: #dc2626;
  font-size: 13px;
}
.form-msg {
  padding: 10px 14px;
  border-radius: 7px;
  font-size: 13px;
}
.form-msg.success { background: #d1fae5; color: #065f46; }
.form-msg.error   { background: #fee2e2; color: #dc2626; }

.sync-result {
  margin-top: 14px;
  padding: 10px 14px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 7px;
  font-size: 13px;
  color: #1e40af;
}

/* ─── Modal ──────────────────────────────────────────────────────────────── */
#modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 15px; font-weight: 700; color: var(--secondary); }
.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text-muted);
  line-height: 1;
  padding: 0 4px;
}
.modal-close:hover { color: var(--text); }
#booking-form { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

/* ─── Toast ──────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
  z-index: 1000;
  transition: opacity .3s;
}
.toast.success { background: var(--confirmed); }
.toast.error   { background: var(--cancelled); }
.toast.info    { background: var(--secondary); }

/* ─── Settings tabs ──────────────────────────────────────────────────────── */
.stabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.stab {
  padding: 9px 18px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 6px 6px 0 0;
  transition: color .15s, border-color .15s;
}
.stab:hover  { color: var(--secondary); }
.stab.active { color: var(--secondary); border-bottom-color: var(--primary); font-weight: 600; }

.stab-panel         { display: none; }
.stab-panel.active  { display: block; }

.stab-hint {
  padding: 8px 20px 12px;
  font-size: 12.5px;
  color: var(--text-muted);
  font-style: italic;
}

/* ─── Period list items (seasonal prices & min nights) ───────────────────── */
.period-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.period-item:last-child { border-bottom: none; }
.pi-label  { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pi-range  { color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.pi-value  { font-weight: 600; color: var(--secondary); min-width: 90px; text-align: right; white-space: nowrap; }
/* Inline edit row */
.period-item.editing {
  background: #f8fafc;
  padding: 12px 20px;
  align-items: flex-start;
}
.period-edit-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
}
.period-edit-input {
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12.5px;
  background: #fff;
  font-family: inherit;
  flex: 1;
  min-width: 80px;
}
.period-edit-input:focus { outline: none; border-color: var(--primary); }

.period-empty {
  padding: 16px 20px;
  color: var(--text-muted);
  font-size: 13px;
  font-style: italic;
}

.period-add-form {
  padding: 14px 20px;
  border-top: 2px dashed var(--border);
  background: #fafafa;
}
.period-add-form h4 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.period-form-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.period-form-row .field { flex: 1; min-width: 120px; }

/* ─── Date picker popup ──────────────────────────────────────────────────── */
.dp-popup {
  position: absolute;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 28px rgba(0,0,0,.16);
  padding: 12px;
  width: 264px;
  z-index: 500;
  user-select: none;
}
.dp-nav-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 10px;
}
.dp-nav-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 5px;
  width: 28px;
  height: 28px;
  font-size: 14px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .12s, color .12s;
}
.dp-nav-btn:hover { background: var(--bg); color: var(--secondary); }
.dp-title {
  flex: 1;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--secondary);
}
.dp-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 4px;
}
.dp-weekdays div {
  text-align: center;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 4px 0;
}
.dp-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.dp-day {
  text-align: center;
  padding: 5px 2px;
  border-radius: 5px;
  font-size: 12.5px;
  cursor: pointer;
  transition: background .1s, color .1s;
  color: var(--text);
}
.dp-day:hover            { background: var(--bg); }
.dp-day.selected         { background: var(--primary); color: #fff; font-weight: 600; }
.dp-day.today            { font-weight: 700; color: var(--primary); }
.dp-day.today.selected   { color: #fff; }
.dp-empty                { pointer-events: none; }
.dp-day-taken {
  background: #fee2e2;
  color: #ef4444;
  cursor: not-allowed;
  opacity: .75;
}
.dp-day-taken:hover { background: #fee2e2; }

/* ─── Calendar drag selection ────────────────────────────────────────────── */
.ac-day.drag-sel {
  background: rgba(217, 117, 89, .18) !important;
  outline: 2px solid var(--primary);
  outline-offset: -2px;
  z-index: 1;
}
.cal-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-style: italic;
}

/* ─── Drag actions popup ─────────────────────────────────────────────────── */
.drag-actions-popup {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  padding: 12px 14px;
  min-width: 200px;
}
.drag-popup-info {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.drag-popup-btns { display: flex; gap: 6px; }

/* ─── Utilities ──────────────────────────────────────────────────────────── */
.mt-24 { margin-top: 24px; }
[hidden] { display: none !important; }

/* ─── Hamburger button (hidden on desktop) ───────────────────────────────── */
#menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 6px;
  background: none;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}
#menu-toggle span {
  display: block;
  height: 2px;
  background: var(--secondary);
  border-radius: 2px;
  transition: transform .2s, opacity .2s;
}

/* ─── Sidebar overlay (mobile) ───────────────────────────────────────────── */
#sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 99;
}
#sidebar-overlay.active { display: block; }

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }

  #menu-toggle { display: flex; }

  #sidebar {
    transform: translateX(-100%);
    transition: transform .25s ease;
    width: 260px;
  }
  #sidebar.open {
    transform: translateX(0);
    display: flex;
  }

  #main { margin-left: 0; }
  .section { padding: 16px; }
  .field-row { flex-direction: column; }
  .settings-grid { grid-template-columns: 1fr; }
}
