/* BarberOS — Design System */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&family=Inter:wght@300;400;500;600&display=swap');

:root {
  --black: #0a0a0a;
  --charcoal: #161616;
  --slate: #222222;
  --border: #2e2e2e;
  --muted: #6b6b6b;
  --silver: #a8a8a8;
  --white: #f5f3ee;
  --gold: #c9a84c;
  --gold-dim: #9c7d38;
  --danger: #c0392b;
  --success: #27ae60;
  --pending: #e67e22;
  --radius: 4px;
  --radius-lg: 8px;
  --shadow: 0 2px 12px rgba(0,0,0,0.4);
}

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

html, body {
  background: var(--black);
  color: var(--white);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Typography ── */
.display { font-family: 'Playfair Display', serif; }
h1, h2, h3 { font-family: 'Playfair Display', serif; font-weight: 700; line-height: 1.2; }
h1 { font-size: 2.6rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.2rem; }

/* ── Layout ── */
#app { min-height: 100vh; display: flex; flex-direction: column; }

.page { display: none; flex: 1; }
.page.active { display: flex; flex-direction: column; }

/* ── Nav ── */
nav {
  background: var(--charcoal);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--gold);
  letter-spacing: 0.05em;
  text-decoration: none;
}

.nav-brand span { color: var(--white); }

.nav-links { display: flex; gap: 0.25rem; align-items: center; }
.nav-links button {
  background: none;
  border: none;
  color: var(--silver);
  font-size: 0.85rem;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-weight: 500;
}
.nav-links button:hover { color: var(--white); background: var(--slate); }
.nav-links button.active { color: var(--gold); }

.nav-bell {
  position: relative;
  background: none;
  border: none;
  color: var(--silver);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.4rem;
}
.nav-bell .badge {
  position: absolute; top: 0; right: 0;
  background: var(--gold); color: var(--black);
  font-size: 0.65rem; font-weight: 700;
  border-radius: 50%; width: 16px; height: 16px;
  display: flex; align-items: center; justify-content: center;
}

.nav-user {
  color: var(--muted);
  font-size: 0.8rem;
  margin-left: 1rem;
}

/* ── Container ── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  width: 100%;
}

/* ── Cards ── */
.card {
  background: var(--charcoal);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.6rem 1.2rem;
  border: none; border-radius: var(--radius);
  font-family: 'Inter', sans-serif; font-size: 0.85rem; font-weight: 600;
  cursor: pointer; text-decoration: none;
  transition: all 0.15s;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.btn-primary { background: var(--gold); color: var(--black); }
.btn-primary:hover { background: #d4af55; }
.btn-secondary { background: var(--slate); color: var(--white); border: 1px solid var(--border); }
.btn-secondary:hover { background: #2a2a2a; }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #c0392b; opacity: 0.85; }
.btn-success { background: var(--success); color: var(--white); }
.btn-ghost { background: transparent; color: var(--silver); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--white); border-color: var(--silver); }
.btn-sm { padding: 0.3rem 0.75rem; font-size: 0.78rem; }

/* ── Forms ── */
.form-group { margin-bottom: 1.2rem; }
label {
  display: block; font-size: 0.8rem; font-weight: 500;
  color: var(--silver); margin-bottom: 0.4rem;
  text-transform: uppercase; letter-spacing: 0.06em;
}
input, select, textarea {
  width: 100%; padding: 0.65rem 0.9rem;
  background: var(--slate); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--white);
  font-family: 'Inter', sans-serif; font-size: 0.9rem;
  transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--gold);
}
input::placeholder, textarea::placeholder { color: var(--muted); }
select option { background: var(--slate); }
textarea { resize: vertical; min-height: 80px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-hint { font-size: 0.78rem; color: var(--muted); margin-top: 0.3rem; }

/* ── Tables ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th {
  text-align: left; padding: 0.7rem 1rem;
  color: var(--muted); font-weight: 500; font-size: 0.75rem;
  text-transform: uppercase; letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
}
td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }

/* ── Status badges ── */
.badge {
  display: inline-block; padding: 0.2rem 0.6rem;
  border-radius: 20px; font-size: 0.72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.badge-pending { background: rgba(230,126,34,0.15); color: var(--pending); }
.badge-approved { background: rgba(39,174,96,0.15); color: var(--success); }
.badge-rejected { background: rgba(192,57,43,0.15); color: var(--danger); }
.badge-cancelled { background: rgba(107,107,107,0.15); color: var(--muted); }

/* ── Alerts ── */
.alert {
  padding: 0.75rem 1rem; border-radius: var(--radius);
  font-size: 0.88rem; margin-bottom: 1rem;
}
.alert-error { background: rgba(192,57,43,0.1); border: 1px solid rgba(192,57,43,0.3); color: #e74c3c; }
.alert-success { background: rgba(39,174,96,0.1); border: 1px solid rgba(39,174,96,0.3); color: #2ecc71; }
.alert-info { background: rgba(201,168,76,0.1); border: 1px solid rgba(201,168,76,0.3); color: var(--gold); }

/* ── Auth Page ── */
#page-auth {
  justify-content: center; align-items: center;
  background: var(--black);
  min-height: 100vh;
}
.auth-box {
  width: 100%; max-width: 420px;
  background: var(--charcoal);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
}
.auth-logo {
  text-align: center; margin-bottom: 2rem;
}
.auth-logo h1 { font-size: 2.2rem; color: var(--gold); }
.auth-logo p { color: var(--muted); font-size: 0.85rem; margin-top: 0.25rem; }
.auth-tabs { display: flex; gap: 0; margin-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.auth-tab {
  flex: 1; background: none; border: none; color: var(--muted);
  font-family: 'Inter', sans-serif; font-size: 0.85rem; font-weight: 500;
  padding: 0.75rem; cursor: pointer; transition: color 0.15s;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.auth-tab.active { color: var(--gold); border-bottom-color: var(--gold); }

/* ── Dashboard ── */
.dash-grid {
  display: grid; gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--charcoal);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
}
.stat-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.stat-value { font-family: 'Playfair Display', serif; font-size: 2rem; color: var(--gold); margin-top: 0.25rem; }

/* ── Calendar ── */
.calendar-nav {
  display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem;
}
.calendar-nav h3 { flex: 1; text-align: center; font-size: 1rem; color: var(--silver); }

.week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
}
.day-col { min-width: 0; }
.day-header {
  text-align: center; font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--muted); padding: 0.5rem 0;
  border-bottom: 1px solid var(--border); margin-bottom: 0.5rem;
}
.day-date {
  font-size: 0.9rem; font-weight: 600; color: var(--white);
  display: block; text-align: center; margin-bottom: 0.4rem;
}
.day-date.today { color: var(--gold); }

.time-slot {
  display: block; width: 100%;
  background: var(--slate); border: 1px solid var(--border);
  color: var(--silver); font-size: 0.72rem;
  padding: 0.3rem 0.2rem; margin-bottom: 0.25rem;
  border-radius: var(--radius); cursor: pointer;
  text-align: center;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.time-slot:hover { background: var(--gold); color: var(--black); border-color: var(--gold); }
.time-slot.blocked { background: var(--black); border-color: transparent; color: var(--border); cursor: not-allowed; }
.time-slot.booked { background: rgba(192,57,43,0.15); border-color: rgba(192,57,43,0.3); color: var(--danger); cursor: not-allowed; }
.time-slot.pending { background: rgba(230,126,34,0.15); border-color: rgba(230,126,34,0.3); color: var(--pending); cursor: not-allowed; }

/* ── Time blocks ── */
.block-list { display: flex; flex-direction: column; gap: 0.5rem; }
.block-item {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--slate); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.6rem 1rem;
  font-size: 0.85rem;
}
.block-item .block-info { color: var(--silver); }
.block-item .block-label { font-weight: 600; color: var(--white); font-size: 0.8rem; }

/* ── Notifications panel ── */
.notif-panel {
  position: fixed; top: 60px; right: 1rem;
  width: 320px; max-height: 400px; overflow-y: auto;
  background: var(--charcoal); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
  z-index: 200; display: none;
}
.notif-panel.open { display: block; }
.notif-item {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.84rem; cursor: pointer;
}
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: rgba(201,168,76,0.05); }
.notif-item .notif-time { font-size: 0.72rem; color: var(--muted); margin-top: 0.25rem; }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75); backdrop-filter: blur(2px);
  z-index: 300; display: none; align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--charcoal); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 2rem;
  width: 100%; max-width: 480px;
  max-height: 90vh; overflow-y: auto;
}
.modal h2 { margin-bottom: 1.5rem; font-size: 1.4rem; }
.modal-footer { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1.5rem; }

/* ── Section tabs ── */
.section-tabs { display: flex; gap: 0.25rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.section-tab {
  background: none; border: none; color: var(--muted);
  font-family: 'Inter', sans-serif; font-size: 0.85rem; font-weight: 500;
  padding: 0.6rem 1rem; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color 0.15s;
}
.section-tab.active { color: var(--gold); border-bottom-color: var(--gold); }

.section-content { display: none; }
.section-content.active { display: block; }

/* ── Loader ── */
.loader {
  display: flex; align-items: center; justify-content: center;
  padding: 3rem; color: var(--muted); font-size: 0.9rem;
}
.spinner {
  width: 24px; height: 24px;
  border: 2px solid var(--border); border-top-color: var(--gold);
  border-radius: 50%; animation: spin 0.7s linear infinite;
  margin-right: 0.75rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Empty state ── */
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.empty p { font-size: 0.9rem; }

/* ── Gold divider ── */
.gold-line {
  height: 2px; width: 40px;
  background: var(--gold); margin: 0.75rem 0 1.5rem;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  nav { padding: 0 1rem; }
  .nav-links button { padding: 0.35rem 0.5rem; font-size: 0.75rem; }
  .container { padding: 1.25rem 1rem; }
  .form-row { grid-template-columns: 1fr; }
  .week-grid { grid-template-columns: repeat(7, minmax(80px, 1fr)); overflow-x: auto; }
  h1 { font-size: 1.8rem; }
  .auth-box { padding: 1.75rem; }
  .modal { padding: 1.25rem; }
}
