/* Book My Cleaning — admin.css (loads after site.css) */
body.admin { background: var(--lilac); font-size: 15px; padding-bottom: 0; }
.adm { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.adm-side { background: var(--ink); color: #C9BDD1; padding: 1.2rem 1rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: .25rem; }
.adm-brand { display: block; color: #fff; margin-bottom: 1.2rem; padding: .25rem .5rem; }
.adm-brand img { height: 34px; width: auto; display: block; }
.adm-brand:hover { text-decoration: none; }
.adm-brand small { display: block; color: #A99BB3; font-weight: 500; font-size: .75rem; margin-top: .35rem; letter-spacing: .02em; }
.adm-nav a { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .6rem .75rem; border-radius: var(--r-sm); color: #D9CFE0; font-weight: 500; }
.adm-nav a:hover { background: rgba(255,255,255,.08); text-decoration: none; }
.adm-nav a.active { background: var(--pink); color: #fff; }
.adm-nav .count { background: rgba(255,255,255,.18); color: #fff; font-size: .75rem; font-weight: 700; padding: .1rem .5rem; border-radius: var(--r-pill); }
.adm-nav a.active .count { background: rgba(0,0,0,.2); }
.adm-side .foot { margin-top: auto; font-size: .82rem; color: #A99BB3; padding: .75rem .5rem 0; }
.adm-side .foot a { color: #fff; }
.adm-main { padding: 1.25rem 1.75rem 3rem; min-width: 0; }
.adm-top { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.adm-top h1 { font-size: 1.5rem; margin: 0; }
.gsearch { position: relative; margin-left: auto; width: min(420px, 100%); }
.gsearch input { padding-left: 2.4rem; min-height: 44px; }
.gsearch svg { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ink-3); }
.gsearch .results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-card); z-index: 30; max-height: 420px; overflow-y: auto; display: none; }
.gsearch .results.show { display: block; }
.gsearch .results h5 { margin: 0; padding: .6rem .9rem .3rem; font-size: .75rem; color: var(--ink-3); font-weight: 600; }
.gsearch .results button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: .55rem .9rem; cursor: pointer; font-size: .92rem; color: var(--ink); }
.gsearch .results button:hover { background: var(--blush); }
.gsearch .results button span { color: var(--ink-3); font-size: .82rem; display: block; }
.view { display: none; }
.view.active { display: block; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .9rem; margin-bottom: 1.5rem; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); padding: 1rem 1.1rem; cursor: pointer; }
.stat:hover { border-color: var(--ink-3); }
.stat b { display: block; font-family: var(--font-display); font-size: 1.7rem; font-weight: 800; color: var(--ink); letter-spacing: -.02em; line-height: 1.1; }
.stat span { font-size: .85rem; color: var(--ink-3); }
.stat.warn b { color: var(--amber); }
.stat.bad b { color: var(--red); }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); padding: 1.1rem 1.25rem; margin-bottom: 1.25rem; }
.panel h2 { font-size: 1.15rem; margin: 0 0 .8rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 1rem; }
.toolbar .input, .toolbar .select { width: auto; min-height: 42px; padding-block: .5rem; }
.toolbar .spacer { flex: 1; }
.tbl-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); }
table.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th, .tbl td { padding: .65rem .8rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.tbl th { background: var(--lilac); font-weight: 600; color: var(--ink); font-size: .8rem; position: sticky; top: 0; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr.click:hover { background: var(--blush); }
.tbl td.wrap { white-space: normal; min-width: 220px; }
.tbl .r { text-align: right; }
.tbl .muted { font-size: .82rem; }
.drawer-bg { position: fixed; inset: 0; background: rgba(42,20,51,.45); z-index: 60; display: none; }
.drawer-bg.show { display: block; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 100vw); background: #fff; z-index: 61; transform: translateX(100%); transition: transform .25s var(--ease); display: flex; flex-direction: column; box-shadow: var(--shadow-card); }
.drawer.show { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-size: 1.2rem; }
.drawer-head button { background: none; border: 0; font-size: 1.6rem; cursor: pointer; color: var(--ink-3); line-height: 1; }
.drawer-body { padding: 1.25rem; overflow-y: auto; flex: 1; }
.drawer-body .field { margin-bottom: .8rem; }
.drawer-body .input, .drawer-body .select, .drawer-body .textarea { min-height: 42px; padding: .55rem .75rem; }
.drawer-foot { padding: .9rem 1.25rem; border-top: 1px solid var(--line); display: flex; gap: .5rem; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: .35rem .8rem; font-size: .92rem; margin-bottom: 1rem; }
.kv dt { color: var(--ink-3); } .kv dd { margin: 0; color: var(--ink); }
.bars { display: flex; align-items: flex-end; gap: .5rem; height: 180px; padding: 0 .25rem; border-bottom: 1px solid var(--line); }
.bars div { flex: 1; background: var(--pink); border-radius: 6px 6px 0 0; position: relative; min-height: 2px; }
.bars div span { position: absolute; top: -1.4rem; left: 50%; transform: translateX(-50%); font-size: .7rem; color: var(--ink-3); white-space: nowrap; }
.bars div i { position: absolute; bottom: -1.4rem; left: 50%; transform: translateX(-50%); font-size: .7rem; color: var(--ink-3); font-style: normal; }
.pill-row { display: flex; gap: .4rem; flex-wrap: wrap; }
.toast { position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: .7rem 1.1rem; border-radius: var(--r-pill); font-size: .92rem; z-index: 99; display: none; box-shadow: var(--shadow-card); }
.toast.show { display: block; }
.toast.err { background: var(--red); }
.notice { background: var(--amber-2); color: var(--amber); border-radius: var(--r-md); padding: .8rem 1rem; font-size: .92rem; margin-bottom: 1rem; }
.notice.ok { background: var(--mint-2); color: var(--mint); }
.rating { color: #F2A900; letter-spacing: .05em; }
@media (max-width: 900px) {
  .adm { grid-template-columns: 1fr; }
  .adm-side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; gap: .3rem; }
  .adm-brand { width: 100%; margin-bottom: .5rem; }
  .adm-nav { display: flex; flex-wrap: wrap; gap: .3rem; }
  .adm-nav a { padding: .45rem .6rem; font-size: .88rem; }
  .adm-side .foot { display: none; }
  .adm-main { padding: 1rem; }
  .adm-top { flex-wrap: wrap; }
  .gsearch { width: 100%; }
}

/* ---------- shared panel extras (CEO / HR) ---------- */
.panel-switch { margin: .9rem 0 0; padding-top: .9rem; border-top: 1px solid rgba(255,255,255,.12); }
.panel-switch span { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: #A99BB3; margin-bottom: .35rem; }
.panel-switch a { display: block; padding: .4rem .75rem; border-radius: var(--r-sm); color: #D9CFE0; font-size: .9rem; }
.panel-switch a:hover { background: rgba(255,255,255,.08); text-decoration: none; }
.stat small { display: block; margin-top: .35rem; font-size: .78rem; color: var(--ink-3); }
.stat b em { font-family: var(--font-body); font-size: .8rem; font-style: normal; font-weight: 600; margin-left: .35rem; }
.stat b em.up { color: var(--mint); } .stat b em.down { color: var(--red); }
.admin .grid-2, .admin .grid-3 { gap: 1.25rem; }
.admin .grid-2 > *, .admin .grid-3 > * { min-width: 0; }
.row-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; }
.prog { margin-bottom: .5rem; }
.prog-bar { height: 10px; border-radius: 999px; background: var(--lilac); overflow: hidden; border: 1px solid var(--line); }
.prog-bar span { display: block; height: 100%; background: var(--grad-brand); border-radius: 999px; }
.prog-label { margin-top: .35rem; font-size: .85rem; color: var(--ink-3); }
.prog-label b { color: var(--ink); }
.tbl td.neg, .tbl .neg { color: var(--red); }
.tbl tr.hl { background: var(--blush); }
.avatar-sm { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--grad-brand); color: #fff; font-size: .7rem; font-weight: 700; margin-right: .4rem; vertical-align: middle; }
.note-item { border: 1px solid var(--line); border-radius: var(--r-md); padding: .8rem 1rem; margin-bottom: .6rem; }
.note-item p { margin: 0; white-space: pre-wrap; }
.status.ceo { background: #EDE4F5; color: #5C1C76; }
.status.hr { background: #E2F0FB; color: #14568B; }
.status.admin { background: var(--blush); color: var(--pink-2); }
.status.cleaner { background: var(--mint-2); color: var(--mint); }
.status.customer { background: var(--lilac); color: var(--ink-3); }
.status.draft { background: var(--lilac); color: var(--ink-3); }
.admin .status.paid, .admin .status.declined { background: var(--red-2); color: var(--red); }
@media (max-width: 1024px) { .row-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .row-4 { grid-template-columns: 1fr; } }

.admin .status { text-transform: none; }
.bars { padding: 0 1.5rem; }
.bars div span, .bars div i { max-width: 90px; overflow: hidden; text-overflow: ellipsis; }

/* Panels must never push the page sideways on a phone — tables scroll inside instead */
@media (max-width: 900px) {
  .adm-main .panel { overflow-x: auto; }
  .adm-main .panel > table.tbl { min-width: 520px; }
  .stats { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .drawer-body .row-2, .drawer-body .row-3, .drawer-body .row-4 { grid-template-columns: 1fr; }
  .adm-top h1 { font-size: 1.25rem; }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stat b { font-size: 1.4rem; }
  .toolbar .input, .toolbar .select { width: 100%; }
  .toolbar .spacer { display: none; }
}

/* Settings has code samples and long URLs — keep them inside the panel */
.adm-main code { word-break: break-all; overflow-wrap: anywhere; white-space: pre-wrap; max-width: 100%; display: inline-block; }
.adm-main .kv dd { min-width: 0; overflow-wrap: anywhere; }
.adm-main .panel table.tbl { max-width: 100%; table-layout: fixed; }
.adm-main .panel table.tbl td, .adm-main .panel table.tbl th { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 900px) { .adm-main .panel > table.tbl { min-width: 0; } .adm-main .panel { overflow-x: hidden; } .adm-main .tbl-wrap { overflow-x: auto; } }

@media (max-width: 900px) {
  .adm-main .panel > table.tbl { display: block; overflow-x: auto; white-space: nowrap; }
}

/* The panels sit outside the site's page grid, so collapse their own columns too */
@media (max-width: 900px) {
  .adm-main .grid-2, .adm-main .grid-3, .adm-main .row-2, .adm-main .row-3, .adm-main .row-4 { grid-template-columns: 1fr; }
}

/* ---------- Sales panel ---------- */
.status.sales { background: #E7F0FE; color: #1D4ED8; }
.enquiry.is-due { border-color: var(--amber); box-shadow: inset 4px 0 0 var(--amber); }
.find-list { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; margin-bottom: .8rem; }
.find-row { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: #fff; padding: .55rem .8rem; cursor: pointer; font-size: .92rem; color: var(--ink); }
.find-row:last-child { border-bottom: 0; }
.find-row:hover { background: var(--blush); }
.find-row span { display: block; color: var(--ink-3); font-size: .82rem; }
.quote-box { background: var(--lilac); border-radius: var(--r-md); padding: .9rem 1rem; margin: 1rem 0; }
.quote-line { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.05rem; }
.quote-line b { font-family: var(--font-display); font-size: 1.4rem; color: var(--pink-2); }

/* ---------- Sales pipeline ---------- */
.pipe-board { display: grid; grid-template-columns: repeat(5, 1fr); gap: .75rem; margin-bottom: 1.25rem; }
.pipe-col {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); padding: .9rem .75rem;
  text-align: center; cursor: pointer; font: inherit; color: inherit; transition: border-color .18s, transform .18s;
}
.pipe-col:hover { border-color: var(--pink); transform: translateY(-2px); }
.pipe-col.is-on { border-color: var(--pink); box-shadow: inset 0 -3px 0 var(--pink); }
.pipe-col b { display: block; font-family: var(--font-display); font-size: 1.6rem; font-weight: 800; color: var(--ink); line-height: 1.1; }
.pipe-col span { display: block; font-size: .85rem; color: var(--ink-3); margin-top: .15rem; }
.pipe-col small { display: block; font-size: .74rem; color: var(--pink-2); margin-top: .2rem; }
.lead-row { cursor: pointer; }
.lead-row:hover { background: var(--blush); }
.status.new { background: var(--amber-2); color: var(--amber); }
.status.contacted { background: #E7F0FE; color: #1D4ED8; }
.status.quoted { background: var(--blush); color: var(--pink-2); }
.status.won { background: var(--mint-2); color: var(--mint); }
.status.lost { background: var(--lilac); color: var(--ink-3); }
.trail { border-left: 2px solid var(--line); margin-left: .4rem; padding-left: .9rem; }
.trail-item { display: flex; gap: .7rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.trail-item:last-child { border-bottom: 0; }
.trail-kind { flex: none; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--pink-2); background: var(--blush); border-radius: var(--r-pill); padding: .15rem .5rem; height: fit-content; }
.trail-item p { margin: 0 0 .15rem; white-space: pre-wrap; }
@media (max-width: 900px) { .pipe-board { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 520px) { .pipe-board { grid-template-columns: repeat(2, 1fr); } .pipe-col b { font-size: 1.3rem; } }

/* ---------- CEO dashboard ---------- */
.ceo-hero {
  display: grid; grid-template-columns: 1.25fr .95fr; gap: 1.5rem; align-items: stretch;
  background: linear-gradient(135deg, #2A1433 0%, #4A1B52 55%, #8E1F63 100%);
  color: #fff; border-radius: var(--r-lg); padding: 1.6rem 1.8rem; margin-bottom: 1.25rem;
  box-shadow: 0 24px 50px -30px rgba(42,20,51,.7);
}
.ceo-eyebrow { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: #E8B8D4; }
.ceo-hero-main h2 { font-family: var(--font-display); font-size: clamp(2.2rem, 5vw, 3.4rem); margin: .1rem 0 .2rem; color: #fff; line-height: 1; }
.ceo-sub { color: #E3D3E9; font-size: .95rem; margin: 0 0 1.1rem; }
.ceo-sub em { font-style: normal; font-weight: 700; margin-left: .4rem; }
.ceo-sub em.up { color: #7BE0C0; } .ceo-sub em.down { color: #FFB4A8; }
.ceo-mini { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; }
.ceo-mini div { background: rgba(255,255,255,.1); border-radius: var(--r-md); padding: .6rem .7rem; }
.ceo-mini b { display: block; font-family: var(--font-display); font-size: 1.15rem; }
.ceo-mini b.neg { color: #FFB4A8; }
.ceo-mini span { font-size: .74rem; color: #DCC9E4; }
.ceo-hero-chart { background: rgba(255,255,255,.08); border-radius: var(--r-md); padding: .9rem 1rem; display: flex; flex-direction: column; }
.ceo-hero-chart > span { font-size: .78rem; color: #DCC9E4; }
.spark-wrap { flex: 1; min-height: 90px; color: #FF8FC4; display: flex; align-items: flex-end; }
.spark { width: 100%; height: 100%; }
.spark-foot { display: flex; justify-content: space-between; font-size: .72rem; color: #C6AFD1; }

.rings { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.ring { position: relative; text-align: center; }
.ring svg { display: block; margin: 0 auto .35rem; width: 108px; height: 108px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--lilac); stroke-width: 4; }
.ring-fg { fill: none; stroke: var(--pink); stroke-width: 4; stroke-linecap: round; transition: stroke-dasharray .6s ease; }
.ring b { position: absolute; top: 38px; left: 0; right: 0; font-family: var(--font-display); font-size: 1.45rem; line-height: 1; }
.ring span { margin-top: .1rem; }
.ring span { display: block; font-size: .88rem; color: var(--ink-3); }
.ring small { display: block; font-size: .78rem; color: var(--ink-3); margin-top: .15rem; }

.mixbar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; margin-bottom: .9rem; }
.mixbar span { display: block; }
.mix-0 { background: var(--pink); } .mix-1 { background: #7C3AED; } .mix-2 { background: var(--mint); }
.mix-3 { background: #F2A900; } .mix-4 { background: #2A1433; }
i.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: .45rem; }

.panel-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: .9rem; }
.panel-links a { display: block; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: var(--r-md); text-decoration: none; transition: border-color .18s, transform .18s; }
.panel-links a:hover { border-color: var(--pink); transform: translateY(-2px); }
.panel-links b { display: block; color: var(--ink); }
.panel-links span { font-size: .85rem; color: var(--ink-3); }

@media (max-width: 900px) {
  .ceo-hero { grid-template-columns: 1fr; }
  .ceo-mini { grid-template-columns: repeat(2, 1fr); }
  .rings, .panel-links { grid-template-columns: 1fr; }
  .ring svg { width: 92px; height: 92px; }
  .ring b { top: 30px; }
}

/* The head fail-safe caps every SVG at 48px so a stale cache can never blow up
   an icon. The dashboard's charts and rings are meant to be bigger. */
.ring svg, .spark, .adm-main svg.spark { max-width: none !important; max-height: none !important; }
.ring svg { width: 108px !important; height: 108px !important; }
.spark { width: 100% !important; height: 100% !important; }

/* ---------- Quick actions on the admin dashboard ---------- */
.quick-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; margin-bottom: 1.25rem; }
.quick { display: block; padding: .85rem 1rem; border-radius: var(--r-md); text-decoration: none;
  background: var(--grad-brand); color: #fff; box-shadow: 0 14px 28px -18px rgba(216,38,127,.8); transition: transform .18s; }
.quick:nth-child(n+3) { background: #fff; color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.quick:hover { transform: translateY(-2px); text-decoration: none; }
.quick b { display: block; font-size: .98rem; }
.quick span { font-size: .8rem; opacity: .85; }
.quick:nth-child(n+3) span { color: var(--ink-3); }
@media (max-width: 900px) { .quick-row { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .quick-row { grid-template-columns: 1fr; } }

/* ---------- Job cards (cleaner and customer panels) ---------- */
.jobcard {
  display: grid; grid-template-columns: 84px 1fr auto; gap: 1rem; align-items: center;
  border: 1px solid var(--line); border-radius: var(--r-md); padding: .9rem 1rem; margin-bottom: .7rem; background: #fff;
}
.jobcard:last-child { margin-bottom: 0; }
.jobcard.in_progress { border-color: var(--pink); box-shadow: inset 3px 0 0 var(--pink); }
.jobcard.completed { opacity: .82; }
.jobcard.cancelled { opacity: .6; }
.jobcard-when { text-align: center; background: var(--lilac); border-radius: var(--r-sm); padding: .5rem .3rem; }
.jobcard-when span { display: block; font-size: .74rem; color: var(--ink-3); }
.jobcard-when b { display: block; font-family: var(--font-display); font-size: 1.05rem; color: var(--ink); }
.jobcard-main { min-width: 0; }
.jobcard-main h3 { margin: 0 0 .2rem; font-size: 1.05rem; }
.jobcard-main p { margin: 0 0 .15rem; font-size: .92rem; }
.jobcard-side { text-align: right; display: grid; gap: .35rem; justify-items: end; }
.jobcard-side b { font-family: var(--font-display); font-size: 1.25rem; color: var(--ink); }
.jobnote { background: var(--amber-2); color: var(--amber); border-radius: var(--r-sm); padding: .4rem .6rem; font-size: .88rem; }
@media (max-width: 700px) {
  .jobcard { grid-template-columns: 68px 1fr; }
  .jobcard-side { grid-column: 1 / -1; justify-items: stretch; text-align: left; }
  .jobcard-side .btn { width: 100%; }
}

/* ---------- Period filter bar (CEO panel) ---------- */
.filterbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-md);
  padding: .7rem .9rem; margin-bottom: 1.25rem;
}
.filterbar-label { font-size: .82rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
.filterbar .chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.chip {
  border: 1px solid var(--line); background: #fff; color: var(--ink-3); font: inherit; font-size: .85rem;
  padding: .35rem .75rem; border-radius: var(--r-pill); cursor: pointer; transition: all .15s;
}
.chip:hover { border-color: var(--pink); color: var(--pink-2); }
.chip.on { background: var(--grad-brand); border-color: transparent; color: #fff; font-weight: 600; }
.custom-range { display: flex; align-items: center; gap: .4rem; }
.custom-range .input { width: auto; padding: .35rem .6rem; font-size: .85rem; }
@media (max-width: 700px) {
  .filterbar { gap: .45rem; }
  .filterbar .spacer, .filterbar-label { display: none; }
  .custom-range { width: 100%; }
  .custom-range .input { flex: 1; min-width: 0; }
}

/* Charts need room for their labels, and say so when there is no data */
.adm-main .bars { margin-bottom: 1.9rem; }
.chart-empty { padding: 1.6rem 0; text-align: center; }

/* ---------- Before & after photo grid ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .6rem; }
.photo-grid figure { margin: 0; }
.photo-grid img { width: 100%; height: 100px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--line); }
.photo-grid figcaption { display: flex; align-items: center; justify-content: space-between; font-size: .78rem; color: var(--ink-3); }

/* A boxed block inside a drawer (invoice, receipt, signing) */
.drawer-block { background: var(--lilac); border-radius: var(--r-md); padding: .9rem 1.1rem; margin-top: 1.2rem; }
.drawer-block h3 { margin: 0 0 .5rem; font-size: 1rem; }
.drawer-block .kv-list { margin-bottom: .7rem; }

/* ---------- Admin dashboard hero and mini bars ---------- */
.dash-hero { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.25rem; }
.dash-hero > div {
  background: linear-gradient(135deg, #2A1433 0%, #4A1B52 60%, #8E1F63 100%);
  color: #fff; border-radius: var(--r-lg); padding: 1.1rem 1.2rem;
  box-shadow: 0 18px 40px -28px rgba(42,20,51,.75);
}
.dash-hero span { display: block; font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: #E3B9D6; }
.dash-hero b { display: block; font-family: var(--font-display); font-size: 1.75rem; line-height: 1.15; margin: .15rem 0 .1rem; }
.dash-hero b.warn { color: #FFC98F; }
.dash-hero small { color: #DCC9E4; font-size: .78rem; }
.minibar { background: var(--lilac); border-radius: 99px; height: 8px; overflow: hidden; min-width: 90px; }
.minibar span { display: block; height: 100%; background: var(--grad-brand); }
.sig-name { font-family: var(--font-display); font-size: 1.05rem; }
@media (max-width: 1100px) { .dash-hero { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .dash-hero { grid-template-columns: 1fr; } }

/* ---------- Invoice branding preview ---------- */
.inv-preview { background: var(--lilac); border-radius: var(--r-md); padding: 1.5rem; }
.inv-sheet { background: #fff; border-radius: 8px; padding: 1.6rem; max-width: 640px; margin: 0 auto; color: var(--i, #2A1433); box-shadow: 0 10px 30px -20px rgba(42,20,51,.6); }
.inv-head { display: flex; justify-content: space-between; gap: 1.5rem; border-bottom: 3px solid var(--a, #D8267F); padding-bottom: .9rem; margin-bottom: 1rem; }
.inv-head img { height: 34px; }
.inv-head p { font-size: .74rem; color: var(--ink-3); margin: .4rem 0 0; line-height: 1.5; }
.inv-doc { text-align: right; }
.inv-doc h3 { font-family: var(--font-display); margin: 0; font-size: 1.3rem; color: var(--a, #D8267F); }
.inv-doc span { font-size: .74rem; color: var(--ink-3); }
.inv-tot { display: flex; justify-content: space-between; font-size: .88rem; padding: .25rem 0; max-width: 260px; margin-left: auto; }
.inv-tot.grand { border-top: 2px solid var(--i, #2A1433); margin-top: .3rem; padding-top: .5rem; font-family: var(--font-display); font-size: 1.1rem; }
.inv-pay { background: var(--blush); border-radius: 8px; padding: .7rem .9rem; font-size: .8rem; margin-top: 1rem; }
.inv-foot { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: .6rem; font-size: .72rem; color: var(--ink-3); }

/* ---------- Blog editor ---------- */
.blog-thumb { width: 56px; height: 40px; object-fit: cover; border-radius: var(--r-sm); display: block; }
.bp-cover-img { width: 100%; max-height: 180px; object-fit: cover; border-radius: var(--r-md); margin-bottom: .6rem; }
.bp-lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: .4rem; margin-top: .5rem; }
.bp-lib button { border: 1px solid var(--line); background: none; padding: 0; border-radius: var(--r-sm); overflow: hidden; cursor: pointer; }
.bp-lib button:hover { border-color: var(--pink); }
.bp-lib img { width: 100%; height: 64px; object-fit: cover; display: block; }


/* =====================================================================
   MOBILE RESPONSIVE v3 — hamburger slide-in menu + card-style job tables
   ===================================================================== */
.adm-hamburger { display: none; }
@media (max-width: 900px) {
  html, body.admin { max-width: 100%; overflow-x: hidden; }
  .adm { display: block; }
  .adm-side { position: fixed; top: 0; left: 0; bottom: 0; width: 82vw; max-width: 300px; height: 100vh; z-index: 70; transform: translateX(-100%); transition: transform .25s ease; overflow-y: auto; flex-direction: column; gap: .25rem; padding: 1.1rem 1rem; box-shadow: 4px 0 24px rgba(42,20,51,.28); }
  body.nav-open .adm-side { transform: none; }
  .adm-brand { width: auto; margin-bottom: 1rem; }
  .adm-brand small { display: block; }
  .adm-nav { display: flex; flex-direction: column; gap: .25rem; overflow: visible; }
  .adm-nav a { padding: .7rem .8rem; font-size: .95rem; min-height: 44px; }
  .panel-switch { display: block; }
  .panel-switch span { display: block; }
  .adm-side .foot { display: block; }
  .adm-hamburger { display: flex; align-items: center; justify-content: center; position: fixed; top: .55rem; left: .6rem; z-index: 75; width: 44px; height: 44px; border: 0; border-radius: var(--r-sm); background: var(--ink); color: #fff; font-size: 1.35rem; line-height: 1; cursor: pointer; box-shadow: var(--shadow-card); }
  .adm-navbg { position: fixed; inset: 0; background: rgba(42,20,51,.5); z-index: 65; display: none; }
  body.nav-open .adm-navbg { display: block; }
  .adm-main { padding: 3.4rem .8rem 3rem; min-width: 0; max-width: 100%; }
  .adm-top { flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; padding-left: 3rem; min-height: 44px; }
  .adm-top h1 { font-size: 1.3rem; }
  .gsearch { width: 100%; margin-left: 0; }
  .stats { grid-template-columns: 1fr 1fr; gap: .6rem; margin-bottom: 1.1rem; }
  .stat { padding: .8rem .9rem; }
  .stat b { font-size: 1.45rem; }
  .adm-main .grid-2, .adm-main .grid-3, .adm-main .row-2, .adm-main .row-3, .adm-main .row-4 { grid-template-columns: 1fr !important; }
  .adm-main .panel { overflow: visible; }
  .adm-main .tbl-wrap { overflow: visible; border: 0; background: transparent; }
  .adm-main table.tbl { display: block; width: 100%; min-width: 0; border: 0; }
  .adm-main table.tbl thead { display: none; }
  .adm-main table.tbl tbody { display: block; }
  .adm-main table.tbl tr { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); margin-bottom: .7rem; padding: .25rem .2rem; box-shadow: var(--shadow-card); }
  .adm-main table.tbl td { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .45rem .85rem; border: 0; border-bottom: 1px dashed var(--line); white-space: normal; text-align: right; font-size: .9rem; }
  .adm-main table.tbl tr td:last-child { border-bottom: 0; }
  .adm-main table.tbl td::before { content: attr(data-label); color: var(--ink-3); font-weight: 600; font-size: .78rem; text-align: left; flex: 0 0 auto; }
  .adm-main table.tbl td:not([data-label]) { justify-content: flex-start; text-align: left; }
  .adm-main table.tbl td .muted { font-size: .8rem; }
  .toolbar { gap: .45rem; }
  .toolbar .input, .toolbar .select { width: 100%; min-height: 44px; }
  .toolbar .spacer { display: none; }
  .drawer { width: 100vw; }
  .drawer-foot { position: sticky; bottom: 0; background: #fff; }
  .kv { grid-template-columns: 108px 1fr; }
  .bars { padding: 0 .5rem; }
}
@media (max-width: 480px) { .stats { grid-template-columns: 1fr; } .adm-top h1 { font-size: 1.2rem; } }
