/* Glamora admin — elevated luxury LIGHT-DEFAULT theme (override layer + polish).
   Loaded in <head> of every admin page so there is no dark flash. Dark mode = html.dark. */

:root {
  --ivory: #f5f1ea;
  --surface: #ffffff;
  --surface-2: #faf7f2;
  --ink: #1a1620;
  --ink-2: #4c4557;
  --muted: #7a7385;
  --muted-2: #9a93a6;
  --gold: #c9a24b;
  --gold-dark: #a8862f;
  --gold-light: #e3c778;
  --border: rgba(26, 22, 32, .08);
  --border-2: rgba(26, 22, 32, .13);
  --shadow-sm: 0 1px 2px rgba(26, 22, 32, .05), 0 1px 3px rgba(26, 22, 32, .06);
  --shadow-md: 0 10px 30px -18px rgba(26, 22, 32, .30);
  --shadow-gold: 0 16px 40px -14px rgba(201, 162, 75, .40);
}

::selection { background: rgba(201, 162, 75, .28); }

/* Refined scrollbar */
* { scrollbar-width: thin; scrollbar-color: rgba(26,22,32,.2) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: rgba(26,22,32,.18); border-radius: 9px; }
.dark *::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); }

/* ============ LIGHT-DEFAULT (ungated !important) — always on unless .dark restores ============ */
body { background: var(--ivory) !important; color: var(--ink) !important; }
.bg-ink { background: var(--ivory) !important; }
.bg-ink-soft { background: var(--surface) !important; box-shadow: var(--shadow-sm); }
.bg-ink-softer { background: var(--surface-2) !important; }
.text-stone-100 { color: var(--ink) !important; }
.text-stone-200, .text-stone-300 { color: var(--ink-2) !important; }
.text-stone-400 { color: var(--muted) !important; }
.text-stone-500, .text-stone-600 { color: var(--muted-2) !important; }
.border-white\/5, .border-white\/10 { border-color: var(--border) !important; }
.border-white\/15 { border-color: var(--border-2) !important; }
.bg-white\/5 { background: rgba(26, 22, 32, .035) !important; }
.bg-white\/10 { background: rgba(26, 22, 32, .05) !important; }
.bg-white\/20 { background: rgba(26, 22, 32, .08) !important; }
.hover\:bg-white\/5:hover { background: rgba(26, 22, 32, .04) !important; }
.hover\:bg-white\/10:hover { background: rgba(26, 22, 32, .06) !important; }
.hover\:bg-white\/20:hover { background: rgba(201, 162, 75, .14) !important; }
.fld, input:not([type=checkbox]):not([type=radio]), select, textarea {
  background: var(--surface-2) !important; border-color: var(--border-2) !important; color: var(--ink) !important;
}
input::placeholder, textarea::placeholder { color: var(--muted-2) !important; }

/* ============ DARK RESTORE (higher specificity via .dark ancestor wins) ============ */
.dark body { background: #16121b !important; color: #e7e5ea !important; }
.dark .bg-ink { background: #16121b !important; }
.dark .bg-ink-soft { background: #1e1a24 !important; box-shadow: none; }
.dark .bg-ink-softer { background: #2a2433 !important; }
.dark .text-stone-100 { color: #ece9f0 !important; }
.dark .text-stone-200, .dark .text-stone-300 { color: #d2ccda !important; }
.dark .text-stone-400 { color: #a29bad !important; }
.dark .text-stone-500, .dark .text-stone-600 { color: #837c8e !important; }
.dark .border-white\/5, .dark .border-white\/10 { border-color: rgba(255, 255, 255, .08) !important; }
.dark .border-white\/15 { border-color: rgba(255, 255, 255, .14) !important; }
.dark .bg-white\/5 { background: rgba(255, 255, 255, .05) !important; }
.dark .bg-white\/10 { background: rgba(255, 255, 255, .08) !important; }
.dark .bg-white\/20 { background: rgba(255, 255, 255, .12) !important; }
.dark .hover\:bg-white\/5:hover { background: rgba(255, 255, 255, .06) !important; }
.dark .hover\:bg-white\/10:hover { background: rgba(255, 255, 255, .09) !important; }
.dark .hover\:bg-white\/20:hover { background: rgba(255, 255, 255, .14) !important; }
.dark .fld, .dark input:not([type=checkbox]):not([type=radio]), .dark select, .dark textarea {
  background: rgba(255, 255, 255, .05) !important; border-color: rgba(255, 255, 255, .14) !important; color: #ece9f0 !important;
}
.dark input::placeholder, .dark textarea::placeholder { color: #837c8e !important; }

/* ============ POLISH (both modes) ============ */
/* Cards get real depth + a hairline */
.bg-ink-soft { border-radius: 1rem; border: 1px solid var(--border); }
.dark .bg-ink-soft { border-color: rgba(255, 255, 255, .08); }

/* Primary gold buttons: gradient + glow + subtle lift */
.bg-gold:not(.bg-gold\/15):not(.bg-gold\/20):not(.bg-gold\/30) {
  background-image: linear-gradient(120deg, var(--gold-dark), var(--gold)) !important;
  box-shadow: 0 10px 22px -12px rgba(201, 162, 75, .6);
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}
.bg-gold:not(.bg-gold\/15):not(.bg-gold\/20):not(.bg-gold\/30):hover { transform: translateY(-1px); filter: brightness(1.03); }

/* Inputs: gold focus ring */
.fld:focus, input:focus, select:focus, textarea:focus {
  border-color: var(--gold) !important; box-shadow: 0 0 0 3px rgba(201, 162, 75, .18) !important;
}

/* Table rows: smooth hover */
tbody tr { transition: background-color .15s ease; }

/* KPI cards (dashboard) */
.kpi { transition: transform .25s ease, box-shadow .25s ease; }
.kpi:hover { transform: translateY(-4px); box-shadow: var(--shadow-gold); }
.kpi-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; border-radius: 4px 0 0 4px; opacity: .9; }

/* Status pills: a touch more polish */
span[class*="rounded-full"][class*="/20"], span[class*="rounded-full"][class*="/40"] { font-weight: 600; letter-spacing: .01em; }

/* ============ SIDEBAR (new glass rail) ============ */
.g-sidebar {
  width: 15.5rem; height: 100vh; position: sticky; top: 0; flex-shrink: 0;
  align-self: flex-start;   /* don't stretch to the tall content — required for sticky to work */
  overflow-y: auto;         /* long nav scrolls inside the rail, not the page */
  display: flex; flex-direction: column; padding: 1.1rem .85rem;
  background: linear-gradient(180deg, #ffffff, #faf7f2);
  border-right: 1px solid var(--border); box-shadow: var(--shadow-md);
}
.dark .g-sidebar { background: linear-gradient(180deg, #1e1a24, #16121b); border-right-color: rgba(255,255,255,.08); }
.g-brand { display: flex; align-items: center; gap: .6rem; padding: .3rem .5rem .9rem; }
.g-brand-mark {
  width: 2.4rem; height: 2.4rem; border-radius: .8rem; display: grid; place-items: center; color: #fff; font-weight: 700;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark)); box-shadow: 0 8px 18px -8px rgba(201,162,75,.7);
  font-family: 'Playfair Display', serif; font-size: 1.15rem;
}
.g-user {
  display: flex; align-items: center; gap: .6rem; padding: .6rem; margin-bottom: .6rem;
  border-radius: .8rem; background: rgba(201,162,75,.08); border: 1px solid rgba(201,162,75,.18);
}
.g-user-avatar {
  width: 2.1rem; height: 2.1rem; border-radius: 999px; display: grid; place-items: center; flex-shrink: 0;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark)); color: #fff; font-weight: 600; font-size: .8rem;
}
.g-nav { display: flex; flex-direction: column; gap: .12rem; overflow-y: auto; flex: 1; margin: .2rem -.15rem; padding: 0 .15rem; }
.g-nav-link {
  display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem; border-radius: .7rem;
  font-size: .875rem; color: var(--ink-2); position: relative; transition: background .18s, color .18s;
}
.dark .g-nav-link { color: #cfc9d6; }
.g-nav-link .ic { width: 1.4rem; text-align: center; font-size: 1rem; opacity: .9; }
.g-nav-link:hover { background: rgba(26,22,32,.05); color: var(--ink); }
.dark .g-nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.g-nav-link.active {
  background: linear-gradient(100deg, rgba(201,162,75,.18), rgba(201,162,75,.06));
  color: var(--gold-dark); font-weight: 600;
}
.dark .g-nav-link.active { color: var(--gold-light); }
.g-nav-link.active::before {
  content: ""; position: absolute; left: -0.15rem; top: 18%; bottom: 18%; width: 3px; border-radius: 3px;
  background: linear-gradient(var(--gold), var(--gold-dark));
}
.g-side-foot { padding-top: .6rem; border-top: 1px solid var(--border); display: flex; gap: .4rem; }
.dark .g-side-foot { border-top-color: rgba(255,255,255,.08); }
.g-side-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: .4rem; padding: .5rem;
  border-radius: .6rem; font-size: .8rem; color: var(--muted); transition: all .18s; cursor: pointer;
}
.g-side-btn:hover { background: rgba(26,22,32,.05); color: var(--ink); }
.dark .g-side-btn:hover { background: rgba(255,255,255,.06); color: #fff; }

/* ============ Notification bell + panel ============ */
.notif-bell { position: relative; width: 2rem; height: 2rem; border-radius: .55rem; display: grid; place-items: center; font-size: 1rem; cursor: pointer; transition: background .18s, transform .18s; flex-shrink: 0; }
.notif-bell:hover { background: rgba(201, 162, 75, .18); }
.notif-bell.ring { animation: bell-ring .5s ease; }
@keyframes bell-ring { 0%,100% { transform: rotate(0); } 20% { transform: rotate(16deg); } 40% { transform: rotate(-14deg); } 60% { transform: rotate(9deg); } 80% { transform: rotate(-5deg); } }
.notif-badge { position: absolute; top: -3px; right: -3px; min-width: 1.05rem; height: 1.05rem; padding: 0 .25rem; border-radius: 999px; background: #d9534f; color: #fff; font-size: .62rem; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff; }
.dark .notif-badge { border-color: #1e1a24; }
#notif-panel { position: fixed; left: 15.5rem; bottom: 1.5rem; z-index: 60; width: 22rem; max-width: 92vw; max-height: 30rem; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border-2); border-radius: 1rem; box-shadow: var(--shadow-md); overflow: hidden; }
/* The ID rule above outranks Tailwind's .hidden utility — restore hide-on-.hidden. */
#notif-panel.hidden { display: none !important; }
.dark #notif-panel { background: #1e1a24; border-color: rgba(255,255,255,.1); }
@media (max-width: 900px) { #notif-panel { left: 1rem; } }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: .9rem 1rem; border-bottom: 1px solid var(--border); }
.notif-list { overflow-y: auto; }
.notif-item { display: flex; gap: .7rem; padding: .8rem 1rem; border-bottom: 1px solid var(--border); transition: background .15s; }
.notif-item:hover { background: rgba(201, 162, 75, .07); }
.notif-item.unread { background: rgba(201, 162, 75, .09); }
.notif-item.unread::before { content: ""; position: absolute; }
.notif-ic { width: 2.2rem; height: 2.2rem; border-radius: .6rem; display: grid; place-items: center; background: rgba(201, 162, 75, .14); flex-shrink: 0; }

/* ============ Floating theme toggle ============ */
#theme-fab {
  position: fixed; bottom: 1.5rem; left: 1.5rem; z-index: 50; width: 3rem; height: 3rem; border-radius: 999px;
  display: grid; place-items: center; font-size: 1.1rem; cursor: pointer; border: 1px solid var(--border-2);
  background: var(--surface); box-shadow: var(--shadow-md); transition: transform .2s;
}
#theme-fab:hover { transform: scale(1.08); }
.dark #theme-fab { background: #1e1a24; border-color: rgba(255,255,255,.12); }

/* ============ Branch switcher (multi-branch salons) ============ */
.g-branch {
  display: flex; align-items: center; gap: .5rem; margin: -.1rem .1rem .4rem;
  padding: .35rem .55rem; border-radius: .6rem; border: 1px solid var(--border-2); background: var(--surface-2);
}
.dark .g-branch { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.12); }
.g-branch-ic { font-size: .9rem; opacity: .8; }
.g-branch-select {
  flex: 1; min-width: 0; border: none; outline: none; background: transparent; color: var(--ink);
  font-size: .82rem; font-weight: 500; cursor: pointer;
}
.g-branch-select option { color: #141118; }

/* ============ Support-mode banner (SuperAdmin "view as") ============ */
#support-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 80; text-align: center;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold)); color: #fff;
  font-size: .82rem; font-weight: 500; padding: .5rem 1rem; box-shadow: 0 4px 14px -6px rgba(26,22,32,.5);
}
#support-exit {
  margin-left: .6rem; border: 1px solid rgba(255,255,255,.6); border-radius: 999px;
  padding: .12rem .8rem; font-weight: 600; cursor: pointer; background: rgba(255,255,255,.14); color: #fff;
}
#support-exit:hover { background: rgba(255,255,255,.28); }
body.has-support-bar { padding-top: 2.1rem; }

/* ============ Styled confirm / prompt dialogs ============ */
.gd-overlay {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  padding: 1rem; background: rgba(20, 16, 25, .5); backdrop-filter: blur(3px);
}
.gd-box {
  width: 26rem; max-width: 92vw; background: var(--surface); color: var(--ink);
  border: 1px solid var(--border-2); border-radius: 1rem; box-shadow: 0 30px 70px -30px rgba(26,22,32,.55);
  padding: 1.5rem;
}
.dark .gd-box { background: #1e1a24; border-color: rgba(255,255,255,.1); }
.gd-title { font-family: "Playfair Display", serif; font-size: 1.35rem; margin: 0 0 .4rem; }
.gd-msg { font-size: .9rem; color: var(--muted); margin: 0 0 1.1rem; line-height: 1.5; }
.gd-input {
  width: 100%; margin-bottom: 1.1rem; border-radius: .6rem; padding: .65rem .9rem; font-size: .95rem;
  background: var(--surface-2) !important; border: 1px solid var(--border-2); color: var(--ink); outline: none;
}
.gd-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,162,75,.18); }
.gd-input.gd-err { border-color: #dc2626; box-shadow: 0 0 0 3px rgba(220,38,38,.15); }
.gd-actions { display: flex; gap: .75rem; }
.gd-btn { flex: 1; border-radius: .6rem; padding: .65rem 1rem; font-size: .9rem; font-weight: 600; cursor: pointer; border: 1px solid transparent; transition: filter .15s, background .15s; }
.gd-cancel { background: transparent; border-color: var(--border-2); color: var(--ink); }
.gd-cancel:hover { background: rgba(26,22,32,.05); }
.dark .gd-cancel:hover { background: rgba(255,255,255,.06); }
.gd-ok { background: linear-gradient(120deg, var(--gold-dark), var(--gold)); color: #fff; }
.gd-ok:hover { filter: brightness(1.06); }
.gd-danger { background: #dc2626; color: #fff; }
.gd-danger:hover { filter: brightness(1.08); }

/* ============ Command palette (⌘K) ============ */
#cmdk-fab {
  position: fixed; bottom: 5.25rem; left: 1.5rem; z-index: 50; width: 3rem; height: 3rem; border-radius: 999px;
  display: grid; place-items: center; font-size: 1.05rem; cursor: pointer; border: 1px solid var(--border-2);
  background: var(--surface); box-shadow: var(--shadow-md); transition: transform .2s;
}
#cmdk-fab:hover { transform: scale(1.08); }
.dark #cmdk-fab { background: #1e1a24; border-color: rgba(255,255,255,.12); }

#cmdk-overlay {
  position: fixed; inset: 0; z-index: 90; display: flex; justify-content: center; align-items: flex-start;
  padding-top: 12vh; background: rgba(20, 16, 25, .45); backdrop-filter: blur(3px);
}
/* The ID rule above outranks Tailwind's .hidden utility — restore hide-on-.hidden. */
#cmdk-overlay.hidden { display: none !important; }
#cmdk-box {
  width: 40rem; max-width: 92vw; max-height: 66vh; display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border-2); border-radius: 1rem; box-shadow: 0 30px 70px -30px rgba(26,22,32,.55);
}
.dark #cmdk-box { background: #1e1a24; border-color: rgba(255,255,255,.1); }
#cmdk-input {
  width: 100%; padding: 1.1rem 1.3rem; font-size: 1.05rem; border: none; outline: none;
  background: transparent !important; color: var(--ink) !important; border-bottom: 1px solid var(--border);
}
#cmdk-results { overflow-y: auto; padding: .4rem; }
.cmdk-group { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted-2); padding: .7rem .8rem .3rem; }
.cmdk-item {
  display: flex; align-items: center; gap: .8rem; padding: .6rem .8rem; border-radius: .6rem; cursor: pointer;
  color: var(--ink); text-decoration: none;
}
.cmdk-item .ic { width: 2rem; height: 2rem; border-radius: .5rem; display: grid; place-items: center; background: rgba(201,162,75,.14); flex-shrink: 0; font-size: 1rem; }
.cmdk-item .sub { font-size: .75rem; color: var(--muted); }
.cmdk-item.sel, .cmdk-item:hover { background: rgba(201,162,75,.14); }
.cmdk-empty { padding: 1.4rem; text-align: center; color: var(--muted); font-size: .9rem; }
.cmdk-kbd { margin-left: auto; font-size: .68rem; color: var(--muted-2); border: 1px solid var(--border-2); border-radius: .35rem; padding: .05rem .35rem; }

/* AI panel + toast pick up surfaces automatically via overrides above */
