:root {
  --bg: #0b0d12;
  --bg-elevated: #12151c;
  --bg-card: #161a23;
  --bg-hover: #1c2130;
  --border: #252b3a;
  --border-soft: #1e2433;
  --text: #e8eaef;
  --text-secondary: #9aa3b5;
  --text-muted: #6b7385;
  --accent: #8b5cf6;
  --accent-soft: rgba(139, 92, 246, 0.15);
  --accent-hover: #a78bfa;
  --success: #34d399;
  --success-bg: rgba(52, 211, 153, 0.12);
  --danger: #f87171;
  --danger-bg: rgba(248, 113, 113, 0.12);
  --warning: #fbbf24;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 4px 24px rgba(0,0,0,.35);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

html { font-size: 15px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ── Top bar ── */
.top {
  height: 56px;
  background: rgba(18, 21, 28, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.5);
}

.top-right {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 16px;
}

.top-right a {
  color: var(--text-muted);
  transition: color 0.15s;
}
.top-right a:hover { color: var(--text); }

/* ── Layout ── */
.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - 56px);
}

aside {
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.side-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 8px 12px 6px;
}

aside a, .side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.92rem;
  font-weight: 500;
  transition: background 0.12s, color 0.12s;
}

aside a:hover, .side-link:hover {
  background: var(--bg-hover);
  color: var(--text);
}

aside a.active {
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.org-switch {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-soft);
}

.org-item {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 2px;
  transition: background 0.12s, color 0.12s;
}

.org-item:hover { background: var(--bg-hover); color: var(--text); }
.org-item.active {
  background: var(--accent-soft);
  color: var(--accent-hover);
}

/* ── Page ── */
.page {
  padding: 32px 36px;
  max-width: 1100px;
  width: 100%;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}

h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 14px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, opacity 0.15s;
  font-family: inherit;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, #7c3aed, #6366f1);
  color: #fff;
  box-shadow: 0 2px 12px rgba(124, 58, 237, 0.35);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #8b5cf6, #818cf8);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: #3a4155;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover { color: var(--text); background: var(--bg-hover); }

/* ── Cards / Stats ── */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: border-color 0.15s;
}
.card:hover { border-color: #3a4155; }

.card-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 6px;
}

.card-value {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.card-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Panels ── */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 18px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

/* ── Quick links ── */
.quick {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.quick a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  transition: border-color 0.15s, background 0.15s;
}
.quick a:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* ── Link box ── */
.linkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: "SF Mono", "Fira Code", ui-monospace, monospace;
  font-size: 0.85rem;
  color: var(--text-secondary);
  overflow-x: auto;
  word-break: break-all;
}

/* ── Tables / lists ── */
.table {
  display: flex;
  flex-direction: column;
}

.table-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-soft);
}
.table-row:last-child { border-bottom: 0; }

.table-row .title { font-weight: 600; }
.table-row .meta { font-size: 0.85rem; color: var(--text-muted); margin-top: 2px; }

/* ── Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 99px;
  white-space: nowrap;
}
.badge-on { background: var(--success-bg); color: var(--success); }
.badge-off { background: rgba(107, 115, 133, 0.15); color: var(--text-muted); }
.badge-active { background: var(--success-bg); color: var(--success); }
.badge-cancelled { background: var(--danger-bg); color: var(--danger); }
.badge-done { background: rgba(251, 191, 36, 0.12); color: var(--warning); }

/* ── Filters ── */
.filters {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-chip {
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 0.82rem;
  font-weight: 500;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: all 0.12s;
}
.filter-chip:hover { border-color: #3a4155; color: var(--text); }
.filter-chip.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-hover);
}

/* ── Empty / notice ── */
.empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty h2 { color: var(--text); margin-bottom: 8px; }

.notice {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-top: 16px;
}

.muted { color: var(--text-muted); font-size: 0.85rem; }

/* ── Landing ── */
.landing {
  min-height: calc(100vh - 56px);
  display: grid;
  place-items: center;
  padding: 40px 20px;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(139, 92, 246, 0.18), transparent),
    var(--bg);
}

.hero {
  max-width: 640px;
  text-align: center;
}

.hero h1 {
  font-size: 2.8rem;
  letter-spacing: -0.04em;
  margin: 12px 0 16px;
  background: linear-gradient(135deg, #e8eaef 30%, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 28px;
}

.hero .muted { margin-top: 18px; font-size: 0.8rem; }

/* ── Public page ── */
.public {
  max-width: 560px;
  margin: 0 auto;
  padding: 48px 20px;
}

.public-head {
  text-align: center;
  margin-bottom: 32px;
}

.public-head h1 {
  font-size: 1.9rem;
  margin: 8px 0 4px;
}

.public section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 14px;
}

.public-service {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-soft);
}
.public-service:last-child { border-bottom: 0; }

.public-service .price {
  font-weight: 700;
  white-space: nowrap;
}

/* ── Dev login ── */
.login-list {
  max-width: 420px;
  margin: 40px auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.login-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.12s, background 0.12s;
}
.login-item:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* ── Recent bookings ── */
.recent-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-soft);
}
.recent-item:last-child { border-bottom: 0; }

/* ── Responsive ── */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  aside { display: none; }
  .page { padding: 20px 16px; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 2rem; }
  .top { padding: 0 16px; }
}

/* ── Forms / editable cabinet ── */
.form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.form-grid label { display:flex; flex-direction:column; gap:6px; color:var(--text-secondary); font-size:.84rem; font-weight:500; }
.form-grid input, .form-grid select, .editable-row input, .editable-row select { width:100%; background:var(--bg-elevated); color:var(--text); border:1px solid var(--border); border-radius:10px; padding:10px 12px; font:inherit; outline:none; }
.form-grid input:focus, .form-grid select:focus, .editable-row input:focus { border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft); }
.form-actions { display:flex; align-items:end; }
.editable-row { gap:10px; align-items:center; }
.editable-row .edit-fields { min-width:220px; flex:1; }
.small-input { max-width:130px; }
.check { display:flex; align-items:center; gap:6px; white-space:nowrap; color:var(--text-secondary); font-size:.82rem; }
.check input { width:auto; }
@media (max-width:800px) { .form-grid { grid-template-columns:1fr; } .editable-row { flex-wrap:wrap; } .editable-row .edit-fields { min-width:100%; } .small-input { max-width:none; } }

/* ── Month calendar ── */
.cal-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
}
.cal-view-switch, .cal-nav {
  display: flex;
  gap: 8px;
  align-items: center;
}
.cal-title {
  min-width: 140px;
  text-align: center;
  font-size: 1rem;
}
.cal-month-panel { padding: 12px; overflow-x: auto; }
.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 6px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}
.cal-cell {
  display: flex;
  flex-direction: column;
  min-height: 96px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}
.cal-cell:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.cal-out {
  opacity: 0.4;
}
.cal-today {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.cal-has {
  background: color-mix(in srgb, var(--accent-soft) 70%, var(--bg-elevated));
}
.cal-daynum {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 4px;
}
.cal-badge {
  align-self: flex-start;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  margin-bottom: 4px;
}
.cal-preview {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.68rem;
  color: var(--text-secondary);
  line-height: 1.35;
  overflow: hidden;
}
.cal-preview li {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-muted { opacity: 0.55; }

@media (max-width: 900px) {
  .cal-cell { min-height: 72px; padding: 6px; }
  .cal-preview { display: none; }
  .cal-title { min-width: 100px; font-size: 0.9rem; }
}
@media (max-width: 600px) {
  .cal-cell { min-height: 56px; }
  .cal-badge { font-size: 0.65rem; padding: 1px 5px; }
}
