/* Muse staff dashboard — brand palette copied 1:1 from the Android app's
   ui/theme/Color.kt (sage & sand, OKLCH-derived, WCAG AA verified there) so both
   surfaces read as the same brand. Do not eyeball new colors here — pull them from
   that file if a new one is ever needed. */

@font-face {
  font-family: "Manrope";
  src: url("/assets/fonts/manrope.ttf") format("truetype");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --color-sage: #607d65;
  --color-sage-dark: #33503a;
  --color-sage-light: #e2e8e3;
  --color-sage-bright: #8caf90;
  --color-sage-bright-dark: #618568;
  --color-sand: #f2f7f2;
  --color-sand-deep: #e5eae5;
  --color-ink: #152318;
  --color-headline-ink: #2b1e1c;
  --color-body-warm-gray: #60514f;
  --color-divider: #dbdfdb;
  --color-error: #b3261e;
  --color-on-primary: #ffffff;
  --color-surface: #ffffff;

  --font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --shadow-sm: 0 1px 2px rgba(21, 35, 24, 0.06), 0 1px 3px rgba(21, 35, 24, 0.08);
  --shadow-md: 0 4px 12px rgba(21, 35, 24, 0.10);

  --focus-ring: 0 0 0 3px rgba(96, 125, 101, 0.45);

  --sidebar-width: 248px;
  --topbar-height: 64px;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-family);
  background: var(--color-sand);
  color: var(--color-ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-family);
  color: var(--color-headline-ink);
  line-height: 1.25;
  margin: 0 0 0.5em;
}

h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.375rem; font-weight: 700; }
h3 { font-size: 1.125rem; font-weight: 600; }

p { margin: 0 0 1em; }

a {
  color: var(--color-sage-dark);
}

/* Every interactive element gets a visible, high-contrast focus ring — never rely on
   color alone, and never remove the outline without replacing it. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1000;
  background: var(--color-ink);
  color: #fff;
  padding: 12px 20px;
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 600;
}

.skip-link:focus {
  left: 0;
}

/* ---------- Brand lockup (icon + wordmark) ---------- */

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--color-headline-ink);
}

.brand__mark {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.brand__wordmark {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-headline-ink);
}

/* ---------- App shell: sidebar + topbar + main ---------- */

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: var(--topbar-height) 1fr;
  grid-template-areas:
    "sidebar topbar"
    "sidebar main";
  min-height: 100vh;
}

.topbar {
  grid-area: topbar;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-divider);
}

.topbar__salon {
  font-weight: 600;
  color: var(--color-body-warm-gray);
}

.sidebar {
  grid-area: sidebar;
  background: linear-gradient(180deg, var(--color-sage) 0%, var(--color-sage-dark) 100%);
  color: #fff;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.sidebar .brand,
.sidebar .brand__wordmark {
  color: #fff;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.92rem;
}

.nav-list a:hover {
  background: rgba(255, 255, 255, 0.12);
}

.nav-list a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.94);
  color: var(--color-sage-dark);
}

.sidebar-footer {
  margin-top: auto;
}

.sidebar-footer form button {
  width: 100%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.sidebar-footer form button:hover {
  background: rgba(255, 255, 255, 0.2);
}

main {
  grid-area: main;
  padding: 32px;
  max-width: 980px;
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-areas:
      "topbar"
      "main";
  }
  .sidebar {
    display: none;
  }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-family);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 11px 20px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
}

.btn-primary {
  background: var(--color-sage);
  color: var(--color-on-primary);
}

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

.btn-secondary {
  background: transparent;
  color: var(--color-ink);
  border-color: var(--color-divider);
}

.btn-secondary:hover {
  background: var(--color-sand-deep);
}

.btn-danger {
  background: transparent;
  color: var(--color-error);
  border-color: var(--color-error);
}

.btn-danger:hover {
  background: rgba(179, 38, 30, 0.08);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* A native <input type="date"> styled to match the .btn-secondary Previous/Next Day
   buttons it sits between — browsers apply their own chrome to date inputs by default
   (extra vertical padding, a different font), which .btn's own rules don't fully
   override on their own. */
.date-input {
  appearance: none;
  -webkit-appearance: none;
  min-height: 0;
}

.date-input::-webkit-date-and-time-value {
  text-align: left;
}

/* ---------- Cards & surfaces ---------- */

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.card + .card {
  margin-top: 20px;
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.section-card {
  display: block;
  padding: 20px;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  text-decoration: none;
  color: var(--color-ink);
}

.section-card:hover {
  border-color: var(--color-sage);
  box-shadow: var(--shadow-md);
}

.section-card__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--color-sage-light);
  color: var(--color-sage-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  font-size: 1.2rem;
}

.section-card__title {
  font-weight: 700;
  margin-bottom: 4px;
}

.section-card__desc {
  color: var(--color-body-warm-gray);
  font-size: 0.88rem;
}

/* ---------- Forms ---------- */

.field {
  margin-bottom: 20px;
}

.field label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 6px;
  color: var(--color-headline-ink);
}

.field .hint {
  display: block;
  font-size: 0.82rem;
  color: var(--color-body-warm-gray);
  margin-top: 4px;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="number"],
.field input[type="time"],
.field input[type="url"],
.field textarea,
.field select {
  width: 100%;
  font-family: var(--font-family);
  font-size: 0.95rem;
  padding: 11px 14px;
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-ink);
}

.field input:disabled {
  background: var(--color-sand-deep);
}

.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.field.has-error input,
.field.has-error textarea {
  border-color: var(--color-error);
}

.field-error {
  color: var(--color-error);
  font-size: 0.82rem;
  margin-top: 4px;
}

fieldset {
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  padding: 16px;
  margin: 0 0 20px;
}

legend {
  font-weight: 700;
  padding: 0 8px;
}

.color-swatch-input {
  display: flex;
  align-items: center;
  gap: 10px;
}

.image-preview {
  border-radius: var(--radius-sm);
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}

.image-preview--current-logo {
  width: 64px;
  height: 64px;
}

.image-preview--current-cover {
  width: 160px;
  height: 64px;
}

/* Shown the instant a file is chosen (before Save is clicked) — a thumbnail plus explicit
   confirmation text, so it's unambiguous the system saw the file and that Save is the
   next required step, not that the upload already happened. */
.file-selection-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--color-sage-light);
  border-radius: var(--radius-sm);
  color: var(--color-sage-dark);
  font-size: 0.86rem;
  font-weight: 600;
}

.file-selection-status .image-preview {
  width: 40px;
  height: 40px;
}

.color-swatch-input input[type="color"] {
  width: 44px;
  height: 40px;
  padding: 2px;
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
}

/* ---------- Modal (native <dialog>) ---------- */

.modal {
  border: none;
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 520px;
  width: 90vw;
  box-shadow: var(--shadow-md);
  color: var(--color-ink);
  font-family: var(--font-family);
}

.modal::backdrop {
  background: rgba(21, 35, 24, 0.5);
}

.modal__body {
  max-height: 50vh;
  overflow-y: auto;
  margin: 16px 0;
}

.service-option {
  padding: 6px 0;
  align-items: flex-start;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--color-sage-light);
  color: var(--color-sage-dark);
  font-size: 0.85rem;
  font-weight: 600;
}

/* ---------- Booking details ---------- */

.detail-list {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 12px 16px;
  margin: 0;
}

.detail-list dt {
  font-weight: 700;
  color: var(--color-body-warm-gray);
}

.detail-list dd {
  margin: 0;
}

/* ---------- Alerts / flash messages ---------- */

.alert {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  font-weight: 600;
  font-size: 0.92rem;
}

.alert-success {
  background: var(--color-sage-light);
  color: var(--color-sage-dark);
}

.alert-error {
  background: #fbeceb;
  color: var(--color-error);
}

/* ---------- Login page ---------- */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--color-sage) 0%, var(--color-sage-dark) 100%);
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 36px 32px;
}

.auth-card .brand {
  justify-content: center;
  margin-bottom: 22px;
}

.auth-card .brand__wordmark {
  font-size: 1.2rem;
}

.auth-card h1 {
  text-align: center;
  font-size: 1.2rem;
}

.auth-subtitle {
  text-align: center;
  color: var(--color-body-warm-gray);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.auth-card .btn {
  width: 100%;
  margin-top: 6px;
}

/* ---------- Utility ---------- */

.text-muted {
  color: var(--color-body-warm-gray);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cluster {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Space between the last form section and the save/cancel row — without this the
   buttons read as if they belong to the card right above them. */
.form-actions {
  margin-top: 28px;
}

/* ---------- Schedule: slot rows ---------- */

.slot-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-sm);
}

.slot-row--booked {
  background: var(--color-sand);
}

.slot-row__time {
  flex-shrink: 0;
  width: 84px;
  font-weight: 700;
}

.slot-row__details {
  flex: 1;
}

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