/* ==========================================================================
   SOWMI MAKEOVER — STUDIO DASHBOARD
   Same logo colours as the website (see style.css for how they were sampled),
   used more quietly here so the numbers stay easy to read.
   Chart colours were checked with a colour-blind safety validator:
     --chart   #9c2a5a  (wine, from the saree + rani tones)  — main data colour
     --chart-2 #d47e5d  (rose-gold ring)                     — highlight / comparison
   ========================================================================== */

@font-face { font-family: "Gloock"; src: url("../fonts/gloock.woff") format("woff"); font-display: swap; }
@font-face { font-family: "Outfit"; src: url("../fonts/outfit-400.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Outfit"; src: url("../fonts/outfit-700.woff") format("woff"); font-weight: 700; font-display: swap; }

:root {
  --wine-950: #1e0211; --wine-700: #5e0225; --rose-wine: #92293d;
  --rose-gold: #ee9d75; --rose-gold-hi: #fac1a4; --rose-gold-deep: #d47e5d;
  --cream: #fdeee6; --cream-soft: #d9b3bc;
  --bg: #fbf3ef; --surface: #ffffff; --line: #f0dcd4; --grid: #f3e6e1;
  --ink: #2a0716; --ink-soft: #6b4250; --ink-muted: #8a6470;
  --chart: #9c2a5a; --chart-2: #d47e5d; --chart-wash: rgba(156, 42, 90, .1);
  --good: #1f7a4d; --warn: #9a5b00; --bad: #b3261e;
  --foil: linear-gradient(135deg, #fac1a4 0%, #ee9d75 38%, #d47e5d 62%, #f6c2a6 100%);
  --serif: "Gloock", Georgia, serif;
  --sans: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
body { font-family: var(--sans); font-size: 16px; line-height: 1.5; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
svg { width: 1em; height: 1em; flex: none; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
:focus-visible { outline: 2px solid var(--chart); outline-offset: 2px; border-radius: 6px; }
code { font-family: inherit; background: var(--bg); padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: 999px; font-weight: 700; text-decoration: none; white-space: nowrap; transition: transform .2s ease, background-color .2s ease; }
.btn svg { width: 18px; height: 18px; }
.btn.sm { min-height: 40px; padding: 0 14px; font-size: .9rem; }
.btn-rose { background: var(--foil); color: var(--ink); box-shadow: 0 8px 22px -12px rgba(212, 126, 93, .9); }
.btn-line { border: 1.5px solid var(--line); background: var(--surface); }
.btn-line:hover { border-color: var(--rose-gold-deep); }
.icon-btn { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; }
.icon-btn svg { width: 20px; height: 20px; }

/* ---------- PIN screen ---------- */
.gate { min-height: 100svh; display: grid; place-items: center; padding: 20px; background: radial-gradient(70% 60% at 70% 20%, var(--rose-wine), transparent 70%), radial-gradient(60% 60% at 10% 90%, var(--wine-700), transparent 70%), var(--wine-950); }
.gate[hidden] { display: none; }
.gate-card { width: min(100%, 380px); padding: 34px 26px 26px; border-radius: 28px; background: var(--surface); text-align: center; box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .7); display: grid; gap: 10px; }
.gate-card img { width: 84px; height: 84px; border-radius: 50%; margin: 0 auto 6px; box-shadow: 0 10px 30px -10px rgba(212, 126, 93, .9); }
.gate-card h1 { font-family: var(--serif); font-weight: 400; font-size: 1.9rem; line-height: 1.1; }
.gate-card > p { color: var(--ink-soft); font-size: .95rem; }
.gate-card label { margin-top: 10px; font-weight: 700; font-size: .9rem; text-align: left; }
.gate-card input { height: 54px; border-radius: 14px; border: 1.5px solid var(--line); padding: 0 16px; font-size: 1.3rem; letter-spacing: .3em; text-align: center; outline: none; }
.gate-card input:focus { border-color: var(--rose-gold-deep); box-shadow: 0 0 0 4px rgba(238, 157, 117, .2); }
.gate-err { color: var(--bad); font-size: .9rem; min-height: 1.2em; }
.gate-hint { font-size: .85rem; color: var(--ink-muted); }
.gate-back { font-size: .9rem; color: var(--ink-soft); }

/* ---------- Top bar ---------- */
.app[hidden] { display: none; }
.top { position: sticky; top: 0; z-index: 20; color: var(--cream); background: var(--wine-950); }
.top-in { max-width: 1200px; margin: 0 auto; height: 60px; padding: 0 16px; display: flex; align-items: center; gap: 12px; }
.top-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; font-family: var(--serif); font-size: 1.3rem; }
.top-brand img { width: 36px; height: 36px; border-radius: 50%; }
.mode { font-size: .78rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: rgba(250, 193, 164, .14); color: var(--rose-gold-hi); }
.mode.live::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #3ddc84; margin-right: 6px; vertical-align: 1px; }
.top-actions { margin-left: auto; display: flex; gap: 4px; }

.main { max-width: 1200px; margin: 0 auto; padding: 16px 16px 60px; }
.demo-note { padding: 12px 16px; border-radius: 14px; background: #fff4e5; border: 1px solid #f3d9b0; color: #5c3a00; font-size: .92rem; margin-bottom: 14px; }

/* ---------- Filter row ---------- */
.filters { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.filters-label { font-size: .9rem; color: var(--ink-soft); }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.seg button { min-height: 36px; padding: 0 14px; border-radius: 999px; font-size: .9rem; font-weight: 700; color: var(--ink-soft); }
.seg button[aria-pressed="true"] { background: var(--wine-950); color: var(--cream); }
.seg.small { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.seg.small::-webkit-scrollbar { display: none; }
.seg.small button { min-height: 32px; padding: 0 12px; font-size: .85rem; flex: none; }

/* ---------- KPI strip ---------- */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; margin-bottom: 14px; }
.kpi { padding: 16px; background: var(--surface); }
.kpi:first-child { grid-column: span 2; }
.kpi-label { font-size: .88rem; color: var(--ink-soft); }
.kpi-value { font-size: 1.75rem; font-weight: 700; line-height: 1.15; margin-top: 2px; }
.kpi:first-child .kpi-value { font-size: 3rem; }
.kpi-delta { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 3px; font-size: .8rem; font-weight: 700; margin-top: 4px; }
.kpi-delta svg { width: 14px; height: 14px; }
.kpi-delta.up { color: var(--good); }
.kpi-delta.down { color: var(--bad); }
.kpi-delta.flat { color: var(--ink-muted); }
.kpi-delta span { color: var(--ink-muted); font-weight: 400; }
@media (min-width: 900px) {
  .kpis { grid-template-columns: 1.4fr repeat(4, 1fr); }
  .kpi { padding: 20px; }
  .kpi:first-child { grid-column: auto; }
}

/* ---------- Panels ---------- */
.grid { display: grid; gap: 14px; margin-bottom: 14px; }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(3, 1fr); } .panel.wide { grid-column: span 2; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 18px; min-width: 0; }
.panel h2 { font-size: 1.05rem; font-weight: 700; }
.panel .sub { font-size: .86rem; color: var(--ink-muted); margin-top: 2px; }
.chart { position: relative; margin-top: 12px; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .axis { font-size: 11px; fill: var(--ink-muted); font-family: var(--sans); }
.chart .val { font-size: 12px; fill: var(--ink); font-weight: 700; font-family: var(--sans); }
.nums { margin-top: 10px; font-size: .86rem; }
.nums summary { cursor: pointer; color: var(--ink-soft); }
.nums table { width: 100%; border-collapse: collapse; margin-top: 8px; font-variant-numeric: tabular-nums; }
.nums th, .nums td { text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.nums td:last-child, .nums th:last-child { text-align: right; }
.nums > div { max-height: 220px; overflow: auto; }

/* horizontal bars (HTML) */
.hbars { margin-top: 14px; display: grid; gap: 12px; }
.hbar { display: grid; grid-template-columns: minmax(84px, 38%) 1fr; align-items: center; gap: 10px; font-size: .9rem; }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { position: relative; height: 22px; display: flex; align-items: center; }
.hbar-fill { height: 18px; border-radius: 0 4px 4px 0; background: var(--chart); min-width: 2px; transition: width .6s cubic-bezier(.2, .7, .2, 1), filter .2s ease; }
.hbar:hover .hbar-fill, .hbar:focus-visible .hbar-fill { filter: brightness(1.2); }
.hbar-val { margin-left: 8px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hbar-val small { font-weight: 400; color: var(--ink-muted); margin-left: 4px; }
.empty { color: var(--ink-muted); font-size: .9rem; padding: 12px 0; }

/* insights */
.insights ul { list-style: none; display: grid; gap: 12px; margin-top: 12px; }
.insights li { display: grid; grid-template-columns: 28px 1fr; gap: 8px; font-size: .94rem; }
.insights li svg { width: 22px; height: 22px; color: var(--rose-gold-deep); margin-top: 1px; }

/* upcoming */
.upcoming { list-style: none; display: grid; gap: 10px; margin-top: 12px; }
.upcoming li { display: grid; grid-template-columns: 52px 1fr; gap: 12px; align-items: center; }
.datebox { width: 52px; height: 56px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); display: grid; place-items: center; text-align: center; line-height: 1.05; }
.datebox b { font-size: 1.25rem; display: block; }
.datebox span { font-size: .72rem; color: var(--ink-soft); text-transform: uppercase; }
.up-name { font-weight: 700; }
.up-meta { font-size: .85rem; color: var(--ink-soft); }

/* ---------- Customers ---------- */
.cust-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.cust-head h2 { font-family: var(--serif); font-weight: 400; font-size: 1.6rem; }
.cust-actions { display: flex; gap: 8px; }
.cust-tools { display: grid; gap: 10px; margin: 14px 0; }
@media (min-width: 760px) { .cust-tools { grid-template-columns: 1fr auto; align-items: center; } }
.cust-tools input { height: 44px; border-radius: 999px; border: 1.5px solid var(--line); padding: 0 16px; outline: none; background: var(--bg); }
.cust-tools input:focus { border-color: var(--rose-gold-deep); }
.cust-list { display: grid; gap: 10px; }
.cust {
  display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center;
  padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); cursor: pointer;
  transition: border-color .2s ease, background-color .2s ease;
}
.cust:hover { border-color: var(--rose-gold-deep); background: #fffaf8; }
.cust-name { font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tag { font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--bg); color: var(--ink-soft); border: 1px solid var(--line); }
.cust-meta { grid-column: 1 / -1; font-size: .87rem; color: var(--ink-soft); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.cust-btns { display: flex; gap: 6px; }
.round { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); color: var(--ink); background: var(--surface); text-decoration: none; }
.round svg { width: 18px; height: 18px; }
.round.wa { color: #128c4b; }
.round[aria-disabled="true"] { opacity: .35; pointer-events: none; }
.status { font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.st-New { background: #fde8ef; color: #8a1846; }
.st-Contacted { background: #fff1db; color: var(--warn); }
.st-Confirmed { background: #e3f4ea; color: var(--good); }
.st-Completed { background: #ece9f6; color: #4b3f8a; }
.st-Cancelled { background: #f1eeee; color: #6d6466; }
.more { justify-self: center; margin-top: 6px; }

/* ---------- Sheet dialog ---------- */
.sheet { position: fixed; inset: 0; z-index: 50; display: grid; align-items: end; background: rgba(30, 2, 17, .55); }
.sheet[hidden] { display: none; }
.sheet-card { width: 100%; max-height: 92svh; overflow: auto; background: var(--surface); border-radius: 24px 24px 0 0; padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); animation: up .3s ease both; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
@media (min-width: 640px) { .sheet { place-items: center; } .sheet-card { width: 480px; border-radius: 24px; } }
.sheet-top { display: flex; align-items: center; justify-content: space-between; }
.sheet-top h3 { font-family: var(--serif); font-weight: 400; font-size: 1.5rem; }
.sheet-body { display: grid; gap: 12px; margin: 14px 0 18px; }
.sheet-body dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: .94rem; padding: 12px 14px; border-radius: 14px; background: var(--bg); }
.sheet-body dt { color: var(--ink-soft); }
.sheet-body dd { font-weight: 700; overflow-wrap: anywhere; }
.fld { display: grid; gap: 4px; font-size: .88rem; font-weight: 700; }
.fld input, .fld select, .fld textarea { font-weight: 400; min-height: 44px; border-radius: 12px; border: 1.5px solid var(--line); padding: 8px 12px; outline: none; background: var(--surface); font-size: 1rem; }
.fld input:focus, .fld select:focus, .fld textarea:focus { border-color: var(--rose-gold-deep); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sheet-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- Tooltip + toast ---------- */
.tip { position: fixed; z-index: 60; pointer-events: none; padding: 8px 12px; border-radius: 10px; background: var(--wine-950); color: var(--cream); font-size: .85rem; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .5); transform: translate(-50%, calc(-100% - 12px)); white-space: nowrap; }
.tip b { display: block; font-size: 1.05rem; }
.tip span { color: var(--cream-soft); }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 70; background: var(--wine-950); color: var(--cream); padding: 12px 18px; border-radius: 999px; font-size: .92rem; box-shadow: 0 16px 40px -16px rgba(0, 0, 0, .6); }
.loading .grid, .loading .kpis, .loading .cust-list { opacity: .5; transition: opacity .2s ease; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
