/* ==========================================================================
   Khushboo Jewellers admin. Same type and silver palette as the public site,
   tuned for long working sessions: quiet surfaces, hairlines, no ornament.
   Light/dark follows the site's saved choice (localStorage "kj-theme").
   ========================================================================== */

:root {
  color-scheme: light;
  --bg: #f3f3f1;
  --surface: #ffffff;
  --surface-2: #f7f7f5;
  --text: #16181b;
  --muted: #5d636b;
  --faint: #8a9099;
  --line: #e4e5e2;
  --line-strong: #cfd1d4;
  --accent: #4f5761;
  --accent-soft: rgba(79, 87, 97, .08);
  --invert-bg: #16181b;
  --invert-fg: #f6f6f4;
  --ok: #2f7d5b;
  --ok-bg: #e8f3ed;
  --danger: #b4382c;
  --danger-bg: #f8e9e7;
  --warn: #8f6512;
  --warn-bg: #f6efe0;
  --focus: rgba(79, 87, 97, .22);

  --serif: "Bodoni Moda", "Didot", Georgia, serif;
  --sans: "Manrope", "Helvetica Neue", Arial, sans-serif;
  --r: 6px;
  --r-lg: 10px;
  --sidebar-width: 248px;
  --ease: cubic-bezier(.16, 1, .3, 1);

  /* Legacy names used by the page templates, mapped onto the palette above */
  --lux-gold: var(--accent);
  --lux-gold-dark: var(--text);
  --lux-navy: var(--text);
  --lux-bg: var(--bg);
  --lux-border: var(--line);
  --lux-text-primary: var(--text);
  --lux-text-secondary: var(--muted);
  --lux-success: var(--ok);
  --lux-danger: var(--danger);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0b0c;
  --surface: #121315;
  --surface-2: #17191c;
  --text: #f2f2f0;
  --muted: #a9adb3;
  --faint: #7c8188;
  --line: #24272b;
  --line-strong: #363a3f;
  --accent: #c8ccd2;
  --accent-soft: rgba(200, 204, 210, .08);
  --invert-bg: #f2f2f0;
  --invert-fg: #0a0b0c;
  --ok: #7fd3a8;
  --ok-bg: rgba(127, 211, 168, .1);
  --danger: #f0a89e;
  --danger-bg: rgba(240, 168, 158, .1);
  --warn: #e6c27a;
  --warn-bg: rgba(230, 194, 122, .1);
  --focus: rgba(200, 204, 210, .25);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans); font-size: 14px; line-height: 1.55; font-weight: 400;
  background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--invert-fg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[data-lucide], svg.lucide { stroke-width: 1.6; }

/* ---------- Layout ---------- */
.admin-container { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width); z-index: 1000;
  display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--line);
  transition: transform .4s var(--ease);
}
.sidebar.hidden { transform: translateX(-100%); }

.sidebar-header { display: flex; align-items: center; gap: 12px; padding: 22px 22px 18px; text-decoration: none; }
.sidebar-header img { width: 30px; height: 30px; object-fit: contain; filter: invert(1); }
:root[data-theme="dark"] .sidebar-header img { filter: none; }
.brand-name { display: block; font-weight: 600; font-size: 13px; letter-spacing: .34em; }
.brand-sub { display: block; font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 13px; color: var(--muted); margin-top: 2px; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 6px 12px 16px; scrollbar-width: none; }
.sidebar-nav::-webkit-scrollbar { display: none; }
.nav-section-title {
  padding: 18px 12px 6px; font-size: 10.5px; font-weight: 600; letter-spacing: .16em;
  text-transform: uppercase; color: var(--faint);
}
.nav-item {
  position: relative; display: flex; align-items: center; gap: 11px; padding: 8px 12px; margin-bottom: 1px;
  border-radius: var(--r); color: var(--muted); text-decoration: none; font-size: 13.5px; font-weight: 500;
  transition: color .2s, background-color .2s;
}
.nav-item svg, .nav-item i { width: 17px; height: 17px; flex-shrink: 0; }
.nav-item:hover { color: var(--text); background: var(--surface-2); }
.nav-item.active { color: var(--text); background: var(--accent-soft); font-weight: 600; }
.nav-item.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: var(--text); }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center; font-size: 10.5px; font-weight: 600; background: var(--invert-bg); color: var(--invert-fg); }

.sidebar-footer { padding: 14px 12px 18px; border-top: 1px solid var(--line); display: grid; gap: 2px; }

.main-content { flex: 1; min-width: 0; margin-left: var(--sidebar-width); min-height: 100vh; transition: margin .4s var(--ease); }
.main-content.expanded { margin-left: 0; }

.top-bar {
  position: sticky; top: 0; z-index: 500; height: 60px; padding: 0 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: color-mix(in srgb, var(--bg) 86%, transparent); border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.top-bar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.top-bar-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: var(--r);
  background: none; border: 0; cursor: pointer; color: var(--muted); transition: color .2s, background-color .2s;
}
.icon-btn:hover { color: var(--text); background: var(--surface-2); }
.icon-btn svg { width: 18px; height: 18px; }
.user-controls { display: flex; align-items: center; gap: 6px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding-left: 10px; margin-left: 4px; border-left: 1px solid var(--line); }
.user-avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--invert-bg); color: var(--invert-fg); font-size: 12px; font-weight: 600; }
.user-email { font-size: 12.5px; color: var(--muted); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; text-decoration: none; font-size: 12.5px; font-weight: 500; color: var(--muted); border: 1px solid var(--line); transition: color .2s, border-color .2s; }
.logout-btn:hover { color: var(--danger); border-color: currentColor; }
.logout-btn svg { width: 14px; height: 14px; }

.content-area { padding: 28px 32px 56px; max-width: 1360px; animation: page-in .5s var(--ease) both; }
@keyframes page-in { from { opacity: 0; transform: translateY(8px); } }

.sidebar-scrim { display: none; }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.page-head h1, .page-title {
  font-family: var(--serif); font-style: italic; font-weight: 500; font-size: clamp(28px, 3vw, 36px);
  letter-spacing: -.01em; line-height: 1.05;
}
.page-head p { color: var(--muted); margin-top: 6px; }
.eyebrow { font-size: 10.5px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--faint); }

/* ---------- Shared components (used by every page template) ---------- */
.lux-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); margin-bottom: 24px; box-shadow: none; }

.lux-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text); margin-bottom: 7px; }
.lux-input, .lux-select, .lux-textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--r);
  font-size: 14px; background: var(--surface); color: var(--text); outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.lux-input::placeholder, .lux-textarea::placeholder { color: var(--faint); }
.lux-input:focus, .lux-select:focus, .lux-textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); }

.btn-lux {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 20px; border: 1px solid var(--invert-bg); border-radius: 999px;
  background: var(--invert-bg); color: var(--invert-fg); font-size: 13px; font-weight: 600; letter-spacing: .01em;
  cursor: pointer; text-decoration: none; transition: opacity .2s, transform .2s;
}
.btn-lux:hover { opacity: .88; }
.btn-lux:active { transform: translateY(1px); }
.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: none; color: var(--text);
  font-size: 13px; font-weight: 500; text-decoration: none; cursor: pointer; transition: border-color .2s, background-color .2s;
}
.btn-ghost:hover { border-color: var(--text); background: var(--surface-2); }
.btn-lux svg, .btn-ghost svg { width: 16px; height: 16px; }

.breadcrumb { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; font-size: 12.5px; color: var(--faint); }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb svg { width: 13px; height: 13px; }

/* Tables used by the list views */
table { border-collapse: collapse; width: 100%; }
.lux-table th { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); text-align: left; }
.lux-table td, .lux-table th { border-bottom: 1px solid var(--line); }
.lux-table tbody tr { transition: background-color .15s; }
.lux-table tbody tr:hover { background: var(--surface-2); }

/* Flash messages */
.flash { display: flex; align-items: center; gap: 10px; padding: 12px 16px; margin-bottom: 20px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); font-size: 13.5px; }
.flash svg { width: 16px; height: 16px; flex-shrink: 0; }
.flash--success { color: var(--ok); background: var(--ok-bg); border-color: transparent; }
.flash--error, .flash--danger { color: var(--danger); background: var(--danger-bg); border-color: transparent; }
.flash--warning { color: var(--warn); background: var(--warn-bg); border-color: transparent; }

/* ---------- Dashboard ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); margin-bottom: 28px; }
.stat { padding: 22px 24px; border-right: 1px solid var(--line); text-decoration: none; transition: background-color .2s; }
.stat:last-child { border-right: 0; }
.stat:hover { background: var(--surface-2); }
.stat__value { font-family: var(--serif); font-weight: 500; font-size: 40px; line-height: 1; letter-spacing: -.02em; }
.stat__label { margin-top: 10px; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; justify-content: space-between; }
.stat__label svg { width: 15px; height: 15px; color: var(--faint); }

.dash-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.panel__head h2 { font-size: 14px; font-weight: 600; }
.panel__head a { font-size: 12.5px; color: var(--muted); text-decoration: none; }
.panel__head a:hover { color: var(--text); }
.panel__empty { padding: 40px 22px; text-align: center; color: var(--faint); }

.inbox-row { display: grid; grid-template-columns: 36px 1fr auto; gap: 14px; align-items: center; padding: 14px 22px; border-bottom: 1px solid var(--line); text-decoration: none; transition: background-color .15s; }
.inbox-row:last-child { border-bottom: 0; }
.inbox-row:hover { background: var(--surface-2); }
.inbox-row__avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); font-weight: 600; font-size: 13px; color: var(--muted); }
.inbox-row__name { font-weight: 600; font-size: 13.5px; }
.inbox-row__msg { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-row__date { font-size: 12px; color: var(--faint); white-space: nowrap; }

.quick { display: grid; }
.quick a { display: flex; align-items: center; gap: 12px; padding: 13px 22px; border-bottom: 1px solid var(--line); text-decoration: none; font-size: 13.5px; font-weight: 500; transition: background-color .15s; }
.quick a:last-child { border-bottom: 0; }
.quick a:hover { background: var(--surface-2); }
.quick a svg { width: 17px; height: 17px; color: var(--muted); }
.quick a .arrow { margin-left: auto; color: var(--faint); transition: transform .3s var(--ease); }
.quick a:hover .arrow { transform: translateX(3px); color: var(--text); }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; background: var(--bg); }
.login__art { position: relative; overflow: hidden; background: #000; }
.login__art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; animation: art-in 2.4s var(--ease) both; }
.login__art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.65), rgba(0,0,0,0) 45%); }
.login__quote { position: absolute; z-index: 1; left: 44px; right: 44px; bottom: 40px; color: #f6f6f4; font-family: var(--serif); font-style: italic; font-weight: 500; font-size: clamp(24px, 2.4vw, 34px); line-height: 1.15; }
.login__quote small { display: block; margin-top: 12px; font-family: var(--sans); font-style: normal; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: rgba(246,246,244,.75); }
@keyframes art-in { from { transform: scale(1.08); opacity: .4; } }

.login__panel { display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(28px, 7vw, 96px); }
.login__brand { display: flex; align-items: center; gap: 12px; margin-bottom: 56px; text-decoration: none; }
.login__brand img { width: 34px; height: 34px; filter: invert(1); }
:root[data-theme="dark"] .login__brand img { filter: none; }
.login h1 { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: clamp(34px, 3.4vw, 46px); line-height: 1; letter-spacing: -.01em; }
.login__lede { color: var(--muted); margin: 12px 0 36px; max-width: 34ch; }
.login form { display: grid; gap: 18px; max-width: 380px; }
.login .lux-input { height: 46px; }
.login .btn-lux { height: 48px; margin-top: 6px; width: 100%; }
.login__foot { margin-top: 36px; display: flex; align-items: center; justify-content: space-between; max-width: 380px; font-size: 12.5px; color: var(--faint); }
.login__foot a { color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.login__foot a:hover { color: var(--text); }
.login__foot svg { width: 14px; height: 14px; }
.login__panel > * { animation: page-in .7s var(--ease) both; }
.login__panel > :nth-child(2) { animation-delay: .06s; }
.login__panel > :nth-child(3) { animation-delay: .12s; }
.login__panel > :nth-child(4) { animation-delay: .18s; }
.login__panel > :nth-child(5) { animation-delay: .24s; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); box-shadow: 0 0 60px rgba(0,0,0,.25); }
  .sidebar.open { transform: none; }
  .main-content { margin-left: 0; }
  .sidebar-scrim { display: block; position: fixed; inset: 0; z-index: 999; background: rgba(0,0,0,.35); opacity: 0; pointer-events: none; transition: opacity .3s; }
  .sidebar.open + .sidebar-scrim { opacity: 1; pointer-events: auto; }
  .top-bar { padding: 0 16px; }
  .content-area { padding: 20px 16px 48px; }
  .user-email { display: none; }
  .login { grid-template-columns: 1fr; }
  .login__art { display: none; }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stat { padding: 16px; }
  .stat__value { font-size: 32px; }
  .inbox-row { grid-template-columns: 32px 1fr; }
  .inbox-row__date { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Theme switch ---------- */
.theme-switch {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px 0 10px;
  border: 1px solid var(--line); border-radius: 999px; background: none; cursor: pointer;
  color: var(--muted); font-size: 12.5px; font-weight: 500; transition: color .2s, border-color .2s;
}
.theme-switch:hover { color: var(--text); border-color: var(--line-strong); }
.theme-switch svg { width: 16px; height: 16px; }
.theme-switch .i-sun { display: none; }
:root[data-theme="dark"] .theme-switch .i-sun { display: block; }
:root[data-theme="dark"] .theme-switch .i-moon { display: none; }
.login__theme { position: absolute; top: 24px; right: 24px; }
.login__panel { position: relative; }

/* ---------- Password field with show/hide eye ---------- */
.password-field { position: relative; }
.password-field .lux-input { padding-right: 46px; }
.password-eye {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; display: grid; place-items: center; border: 0; background: none;
  border-radius: var(--r); color: var(--faint); cursor: pointer; transition: color .2s, background-color .2s;
}
.password-eye:hover { color: var(--text); background: var(--surface-2); }
.password-eye svg { width: 18px; height: 18px; }
.password-eye .i-eye-off { display: none; }
.password-eye[aria-pressed="true"] .i-eye { display: none; }
.password-eye[aria-pressed="true"] .i-eye-off { display: block; }
@media (max-width: 560px) { .theme-switch [data-theme-label] { display: none; } .theme-switch { padding: 0 9px; } }
