/* ============================================================
   NOREMYAH PRODUCTIONS — Admin panel
   ============================================================ */
:root {
  --brand: #F1571F; --brand-2: #FF7A3D; --brand-deep: #C93C09;
  --brand-glow: rgba(241,87,31,0.5);
  --bg: #08080A; --bg-1: #0D0D11; --bg-2: #131318; --bg-3: #1A1A21;
  --text: #F5F5F6; --muted: #9A9AA6; --faint: #6B6B78;
  --line: rgba(255,255,255,0.09); --line-2: rgba(255,255,255,0.15);
  --radius: 16px; --radius-sm: 11px;
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --shadow: 0 30px 80px -30px rgba(0,0,0,0.85);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --green: #38d16a; --amber: #f5a623; --blue: #4a9eff; --red: #e5484d;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-body); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
h1,h2,h3,h4 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.01em; margin: 0; line-height: 1.1; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
ul { margin: 0; padding: 0; list-style: none; }
input, select, textarea { font-family: inherit; }

@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: 10px; border: 1px solid transparent; font-family: var(--font-display); font-weight: 600; font-size: 0.9rem; transition: transform .25s var(--ease), background .25s, border-color .25s, box-shadow .25s, opacity .2s; white-space: nowrap; }
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: linear-gradient(180deg,var(--brand-2),var(--brand)); color: #190b03; box-shadow: 0 14px 34px -14px var(--brand-glow); }
.btn-primary:hover { transform: translateY(-2px); }
.btn-ghost { background: rgba(255,255,255,0.04); border-color: var(--line-2); color: var(--text); }
.btn-ghost:hover { border-color: var(--brand); background: rgba(241,87,31,0.08); }
.btn-sm { padding: 8px 13px; font-size: 0.82rem; border-radius: 9px; }
.btn-danger { background: rgba(229,72,77,0.12); border-color: rgba(229,72,77,0.4); color: #ff8b8b; }
.btn-danger:hover { background: rgba(229,72,77,0.2); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; }
.icon-btn { width: 36px; height: 36px; padding: 0; border-radius: 9px; border: 1px solid var(--line-2); background: rgba(255,255,255,0.03); color: var(--muted); display: inline-grid; place-items: center; transition: all .2s; }
.icon-btn:hover { color: var(--text); border-color: var(--brand); }
.icon-btn svg { width: 16px; height: 16px; }

/* ---------- Login gate ---------- */
.gate { min-height: 100dvh; display: grid; place-items: center; padding: 24px; position: relative; overflow: hidden; }
.gate::before, .gate::after { content: ''; position: absolute; border-radius: 50%; filter: blur(80px); z-index: 0; }
.gate::before { width: 40vw; height: 40vw; background: radial-gradient(circle,var(--brand),transparent 65%); top: -10vw; right: -8vw; opacity: 0.4; }
.gate::after { width: 34vw; height: 34vw; background: radial-gradient(circle,var(--brand-deep),transparent 60%); bottom: -12vw; left: -8vw; opacity: 0.35; }
.gate-card { position: relative; z-index: 1; width: 100%; max-width: 400px; background: linear-gradient(180deg,var(--bg-2),var(--bg-1)); border: 1px solid var(--line); border-radius: 22px; padding: 40px 34px; box-shadow: var(--shadow); text-align: center; }
.gate-card img { height: 44px; width: auto; margin: 0 auto 22px; }
.gate-card h1 { font-size: 1.4rem; }
.gate-card p { color: var(--muted); margin-top: 8px; font-size: 0.92rem; }
.gate-form { margin-top: 26px; display: grid; gap: 12px; }
.gate-form input { text-align: center; letter-spacing: 0.3em; font-size: 1.2rem; padding: 15px; border-radius: 12px; background: rgba(255,255,255,0.04); border: 1px solid var(--line-2); color: var(--text); }
.gate-form input#gateEmail { text-align: left; letter-spacing: normal; font-size: 1rem; }
.gate-form input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(241,87,31,0.12); }
.gate-err { color: #ff8b8b; font-size: 0.86rem; min-height: 20px; }
.sync-note { margin: 0 0 12px; padding: 9px 14px; border-radius: 10px; font-size: 0.85rem; color: var(--muted); background: rgba(241,87,31,0.08); border: 1px solid rgba(241,87,31,0.2); }
.gate-hint { color: var(--faint); font-size: 0.8rem; margin-top: 14px; }
.btn-google { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; margin-top: 24px; padding: 12px 14px; border-radius: 12px; background: #fff; color: #1f1f1f; border: 1px solid var(--line-2); font-family: var(--font-body); font-weight: 600; font-size: 0.95rem; cursor: pointer; transition: background .2s, box-shadow .2s; }
.btn-google:hover { background: #f4f4f5; box-shadow: 0 3px 12px rgba(0,0,0,0.25); }
.btn-google:disabled { opacity: 0.7; cursor: default; box-shadow: none; }
.btn-google svg { flex: none; }
.gate-or { display: flex; align-items: center; gap: 12px; margin: 18px 0 2px; color: var(--faint); font-size: 0.78rem; }
.gate-or::before, .gate-or::after { content: ''; flex: 1; height: 1px; background: var(--line-2); }

/* ---------- App shell ---------- */
.app { display: none; min-height: 100dvh; grid-template-columns: 250px 1fr; }
.app.show { display: grid; }

.sidebar { background: var(--bg-1); border-right: 1px solid var(--line); padding: 22px 16px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100dvh; }
.sidebar .logo { display: flex; align-items: center; gap: 10px; padding: 6px 10px 22px; }
.sidebar .logo img { height: 34px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 11px; color: var(--muted); font-weight: 500; font-size: 0.94rem; transition: all .2s; border: 1px solid transparent; width: 100%; text-align: left; background: none; }
.nav-item svg { width: 19px; height: 19px; flex: none; }
.nav-item:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.nav-item.active { color: var(--text); background: rgba(241,87,31,0.12); border-color: rgba(241,87,31,0.28); }
.nav-item.active svg { color: var(--brand-2); }
.nav-item .count { margin-left: auto; background: var(--brand); color: #190b03; font-size: 0.72rem; font-weight: 700; min-width: 20px; height: 20px; border-radius: 999px; display: grid; place-items: center; padding: 0 6px; }
.nav-item .count[hidden] { display: none; }
.sidebar .spacer { flex: 1; }
.sidebar .side-foot { border-top: 1px solid var(--line); padding-top: 14px; display: grid; gap: 6px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.sidebar-backdrop { display: none; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px clamp(18px,3vw,34px); background: rgba(8,8,10,0.8); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.topbar h2 { font-size: 1.35rem; }
.topbar .sub { color: var(--faint); font-size: 0.84rem; margin-top: 2px; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.content { padding: clamp(20px,3vw,34px); max-width: 1180px; width: 100%; }

.mobile-top { display: none; }

/* ---------- Panels ---------- */
.panel { display: none; animation: fade .35s var(--ease); }
.panel.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Stat cards ---------- */
.stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 26px; }
.stat-card { background: linear-gradient(180deg,var(--bg-2),var(--bg-1)); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; position: relative; overflow: hidden; transition: border-color .3s, transform .3s var(--ease); }
.stat-card:hover { border-color: rgba(241,87,31,0.35); transform: translateY(-3px); }
.stat-card .ic { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: rgba(241,87,31,0.12); border: 1px solid rgba(241,87,31,0.25); color: var(--brand-2); margin-bottom: 16px; }
.stat-card .ic svg { width: 21px; height: 21px; }
.stat-card .val { font-family: var(--font-display); font-size: 2rem; font-weight: 700; line-height: 1; }
.stat-card .lbl { color: var(--muted); font-size: 0.88rem; margin-top: 6px; }
.stat-card.ok .val { color: var(--green); }
.stat-card.due .val { color: var(--amber); }

/* Dashboard charts */
.dash-charts { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; margin-bottom: 22px; }
.chart-card { padding: 20px 22px; }
.chart-svg { width: 100%; height: auto; margin-top: 10px; }
.chart-svg .bar { fill: var(--brand); }
.chart-svg .bx { fill: var(--faint); font-size: 12px; text-anchor: middle; }
.chart-svg .bv { fill: var(--muted); font-size: 11px; font-weight: 600; text-anchor: middle; }
.chart-empty { color: var(--faint); font-size: 0.9rem; padding: 26px 4px; text-align: center; }
.donut-wrap { display: flex; align-items: center; gap: 20px; padding: 10px 0; flex-wrap: wrap; }
.donut-svg { width: 148px; height: 148px; flex: none; }
.donut-bg { fill: none; stroke: var(--line-2); stroke-width: 15; }
.donut-fg { fill: none; stroke: var(--green); stroke-width: 15; stroke-linecap: round; }
.donut-pct { fill: var(--text); font-size: 26px; font-weight: 700; text-anchor: middle; font-family: var(--font-display); }
.donut-lbl { fill: var(--faint); font-size: 11px; text-anchor: middle; }
.donut-legend { display: grid; gap: 12px; font-size: 0.92rem; color: var(--muted); }
.donut-legend > div { display: flex; align-items: center; }
.donut-legend b { color: var(--text); margin-left: 8px; font-family: var(--font-display); }
.donut-legend .dot { width: 11px; height: 11px; border-radius: 50%; margin-right: 9px; flex: none; }
.donut-legend .dot.ok { background: var(--green); }
.donut-legend .dot.due { background: var(--amber); }
@media (max-width: 900px) { .dash-charts { grid-template-columns: 1fr; } }

/* ---------- Cards / sections ---------- */
.card { background: linear-gradient(180deg,var(--bg-2),var(--bg-1)); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.card-head h3 { font-size: 1.1rem; }
.card-head .hint { color: var(--faint); font-size: 0.85rem; }

/* ---------- Toolbar / filters ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.chip { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255,255,255,0.03); color: var(--muted); font-size: 0.85rem; font-weight: 500; transition: all .2s; }
.chip.active, .chip:hover { color: var(--text); border-color: var(--brand); background: rgba(241,87,31,0.1); }
.search { flex: 1; min-width: 160px; display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 10px; background: rgba(255,255,255,0.04); border: 1px solid var(--line-2); }
.search svg { width: 16px; height: 16px; color: var(--faint); flex: none; }
.search input { flex: 1; background: none; border: none; color: var(--text); outline: none; font-size: 0.92rem; }

/* ---------- Request / quote list ---------- */
.list { display: grid; gap: 12px; }
.row-item { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; transition: border-color .25s, transform .25s var(--ease); }
.row-item:hover { border-color: var(--line-2); }
.row-main { min-width: 0; }
.row-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-top b { font-family: var(--font-display); font-size: 1.02rem; }
.row-sub { color: var(--muted); font-size: 0.88rem; margin-top: 5px; display: flex; gap: 14px; flex-wrap: wrap; }
.row-sub span { display: inline-flex; align-items: center; gap: 5px; }
.row-msg { color: var(--faint); font-size: 0.88rem; margin-top: 8px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.row-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

/* Clients */
.client-av { width: 46px; height: 46px; border-radius: 50%; flex: none; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; color: #190b03; background: linear-gradient(180deg, var(--brand-2), var(--brand)); text-transform: uppercase; }
.client-head { display: flex; align-items: center; gap: 15px; margin-bottom: 22px; }
.client-head .client-av { width: 58px; height: 58px; font-size: 1.35rem; }
.client-head h4 { font-family: var(--font-display); font-size: 1.25rem; }
.client-head .sub { color: var(--faint); font-size: 0.85rem; margin-top: 3px; }
.client-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 22px; }
.client-stat { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; text-align: center; }
.client-stat .v { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; }
.client-stat .l { color: var(--faint); font-size: 0.76rem; margin-top: 3px; }
.chip-svc { display: inline-block; font-size: 0.74rem; padding: 5px 11px; border-radius: 999px; border: 1px solid rgba(241,87,31,0.28); color: var(--brand-2); background: rgba(241,87,31,0.08); margin: 3px 5px 3px 0; }
.client-timeline { margin-top: 8px; }
.client-timeline h5 { font-family: var(--font-display); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); margin: 18px 0 12px; }
.tl-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.tl-item:last-child { border-bottom: none; }
.tl-dot { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: rgba(241,87,31,0.12); border: 1px solid rgba(241,87,31,0.25); color: var(--brand-2); }
.tl-dot svg { width: 15px; height: 15px; }
.tl-body { min-width: 0; flex: 1; }
.tl-body b { font-family: var(--font-display); font-size: 0.95rem; }
.tl-body .when { color: var(--faint); font-size: 0.8rem; }
.tl-body p { color: var(--muted); font-size: 0.88rem; margin-top: 4px; }

.badge { font-family: var(--font-display); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; border: 1px solid; }
.badge.new { color: var(--green); border-color: rgba(56,209,106,0.4); background: rgba(56,209,106,0.1); }
.badge.contacted { color: var(--blue); border-color: rgba(74,158,255,0.4); background: rgba(74,158,255,0.1); }
.badge.quoted, .badge.sent { color: var(--amber); border-color: rgba(245,166,35,0.4); background: rgba(245,166,35,0.1); }
.badge.closed, .badge.draft { color: var(--faint); border-color: var(--line-2); background: rgba(255,255,255,0.03); }
.badge.accepted { color: var(--green); border-color: rgba(56,209,106,0.4); background: rgba(56,209,106,0.1); }
.badge.declined { color: var(--red); border-color: rgba(229,72,77,0.4); background: rgba(229,72,77,0.1); }
.badge.paid { color: var(--green); border-color: rgba(56,209,106,0.55); background: rgba(56,209,106,0.16); }
.badge.unpaid { color: var(--amber); border-color: rgba(245,166,35,0.4); background: rgba(245,166,35,0.1); }
.qf-hint { font-size: 0.82rem; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.qf-hint a { color: var(--brand); font-weight: 600; }
.badge.partial { color: var(--amber); border-color: rgba(245,166,35,0.5); background: rgba(245,166,35,0.14); }
.photo-mode { padding: 12px 16px; border-radius: 12px; font-size: 0.9rem; line-height: 1.5; margin-bottom: 16px; border: 1px solid; }
.photo-mode.ok { color: var(--green); border-color: rgba(56,209,106,0.4); background: rgba(56,209,106,0.1); }
.photo-mode.warn { color: var(--amber); border-color: rgba(245,166,35,0.45); background: rgba(245,166,35,0.12); }
.badge.draft { color: var(--faint); border-color: var(--line-2); background: rgba(255,255,255,0.03); }

/* Page editor (rich text) */
.rte-toolbar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.rte-toolbar button { padding: 6px 11px; border-radius: 8px; border: 1px solid var(--line-2); background: rgba(255,255,255,0.03); color: var(--text); font-size: 0.85rem; cursor: pointer; transition: background .15s, border-color .15s; }
.rte-toolbar button:hover { background: rgba(241,87,31,0.12); border-color: var(--brand); }
.rte { min-height: 200px; max-height: 46vh; overflow-y: auto; border: 1px solid var(--line-2); border-radius: 12px; padding: 14px 16px; background: rgba(255,255,255,0.03); color: var(--text); font-size: 0.95rem; line-height: 1.6; outline: none; }
.rte:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(241,87,31,0.12); }
.rte:empty:before { content: attr(data-placeholder); color: var(--faint); }
.rte h2 { font-size: 1.3rem; margin: 14px 0 8px; }
.rte a { color: var(--brand-2); }
.rte img { max-width: 100%; border-radius: 8px; margin: 8px 0; }
.rte ul { padding-left: 22px; }
.pg-pub { display: flex; align-items: center; gap: 10px; margin-top: 16px; font-size: 0.92rem; cursor: pointer; }
.pg-pub input { width: 18px; height: 18px; accent-color: var(--brand); }
.pg-pub small { color: var(--faint); font-weight: 400; }

/* Payments modal */
.pay-sum-top { display: flex; justify-content: space-between; gap: 12px; font-size: 0.9rem; margin-bottom: 12px; }
.pay-sum-top span { color: var(--muted); }
.pay-sum-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pay-sum-grid > div { background: rgba(255,255,255,0.03); border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px; }
.pay-sum-grid > div span { display: block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); }
.pay-sum-grid > div b { display: block; font-size: 1.1rem; font-family: var(--font-display); margin-top: 4px; }
.pay-sum-grid .is-due b { color: var(--amber); }
.pay-sum-grid .is-paid b { color: var(--green); }
.pay-list { margin: 16px 0; display: grid; gap: 8px; }
.pay-empty { color: var(--faint); font-size: 0.86rem; padding: 14px; text-align: center; border: 1px dashed var(--line-2); border-radius: 12px; }
.pay-item { display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,0.03); border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 14px; }
.pay-item-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.pay-item-main b { font-size: 1rem; }
.pay-item-main span { font-size: 0.8rem; color: var(--muted); }
.pay-item-date { font-size: 0.8rem; color: var(--faint); white-space: nowrap; }
.pay-del { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: var(--faint); flex: none; }
.pay-del:hover { color: var(--red); background: rgba(229,72,77,0.12); }
.pay-del svg { width: 16px; height: 16px; }
.pay-add { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.pay-add-title { font-size: 0.95rem; margin-bottom: 12px; }
.quote-doc .qd-bal { font-weight: 700; font-size: 1.1rem; color: #C93C09; }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty .ic { width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 18px; display: grid; place-items: center; background: rgba(255,255,255,0.03); border: 1px solid var(--line); color: var(--faint); }
.empty .ic svg { width: 30px; height: 30px; }
.empty h3 { font-size: 1.15rem; color: var(--text); margin-bottom: 8px; }
.empty p { max-width: 380px; margin: 0 auto; font-size: 0.92rem; }

/* ---------- Forms ---------- */
.form-grid { display: grid; gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.f { display: flex; flex-direction: column; gap: 7px; }
.f label { font-family: var(--font-display); font-size: 0.84rem; font-weight: 500; color: var(--text); }
.f input, .f select, .f textarea { padding: 12px 14px; border-radius: var(--radius-sm); background: rgba(255,255,255,0.04); border: 1px solid var(--line-2); color: var(--text); font-size: 0.94rem; transition: border-color .2s, box-shadow .2s, background .2s; width: 100%; }
.f textarea { resize: vertical; min-height: 90px; }
.f input:focus, .f select:focus, .f textarea:focus { outline: none; border-color: var(--brand); background: rgba(241,87,31,0.05); box-shadow: 0 0 0 4px rgba(241,87,31,0.1); }
.f input:user-invalid, .f textarea:user-invalid { border-color: var(--red); }
.f select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%239A9AA6' stroke-width='2'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 38px; }
.hint-txt { color: var(--faint); font-size: 0.82rem; }

/* ---------- How-to guide (Photos panel) ---------- */
.guide { margin-top: 18px; border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; background: #fff; }
.guide > summary { list-style: none; cursor: pointer; padding: 14px 18px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.guide > summary::-webkit-details-marker { display: none; }
.guide > summary::after { content: '▾'; margin-left: auto; color: var(--faint); transition: transform .2s; }
.guide[open] > summary::after { transform: rotate(180deg); }
.guide-ic { font-size: 1.05rem; }
.guide-body { padding: 4px 18px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.92rem; line-height: 1.6; }
.guide-body h4 { color: var(--ink); font-size: 0.92rem; margin: 14px 0 6px; }
.guide-body ol, .guide-body ul { margin: 0 0 4px; padding-left: 20px; }
.guide-body li { margin-bottom: 6px; }
.guide-body b { color: var(--ink); font-weight: 600; }
.guide-tip { margin-top: 12px; padding: 10px 12px; background: rgba(241,87,31,0.07); border-radius: 10px; color: var(--muted); }

/* ---------- Quote builder ---------- */
.li-table { width: 100%; border-collapse: collapse; }
.li-table th { text-align: left; font-family: var(--font-display); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); padding: 0 10px 10px; font-weight: 600; }
.li-table th.num, .li-table td.num { text-align: right; }
.li-row td { padding: 6px 10px; vertical-align: middle; }
.li-row input { padding: 10px 12px; border-radius: 9px; background: rgba(255,255,255,0.04); border: 1px solid var(--line-2); color: var(--text); font-size: 0.9rem; width: 100%; }
.li-row input:focus { outline: none; border-color: var(--brand); }
.li-row .li-desc { min-width: 180px; }
.li-row input.qty, .li-row input.price { text-align: right; }
.li-amount { font-family: var(--font-display); font-weight: 600; text-align: right; white-space: nowrap; }
.li-del { color: var(--faint); background: none; border: none; padding: 6px; border-radius: 7px; }
.li-del:hover { color: var(--red); background: rgba(229,72,77,0.1); }
.li-del svg { width: 16px; height: 16px; display: block; }
.totals { margin-top: 18px; margin-left: auto; max-width: 320px; display: grid; gap: 8px; }
.totals .t-row { display: flex; justify-content: space-between; font-size: 0.94rem; color: var(--muted); }
.totals .t-row.grand { border-top: 1px solid var(--line-2); margin-top: 6px; padding-top: 12px; font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; color: var(--text); }
.totals .t-row.grand span:last-child { color: var(--brand-2); }

/* ---------- Photos ---------- */
.dropzone { border: 2px dashed var(--line-2); border-radius: var(--radius); padding: 40px 24px; text-align: center; transition: border-color .25s, background .25s; cursor: pointer; }
.dropzone:hover, .dropzone.drag { border-color: var(--brand); background: rgba(241,87,31,0.06); }
.dropzone .ic { width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 14px; display: grid; place-items: center; background: rgba(241,87,31,0.12); border: 1px solid rgba(241,87,31,0.3); color: var(--brand-2); }
.dropzone .ic svg { width: 26px; height: 26px; }
.dropzone h3 { font-size: 1.05rem; margin-bottom: 6px; }
.dropzone p { color: var(--muted); font-size: 0.88rem; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px,1fr)); gap: 14px; margin-top: 20px; }
.photo-card { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--bg-2); aspect-ratio: 4/5; }
.photo-card img { width: 100%; height: 100%; object-fit: cover; }
.photo-card .pc-meta { position: absolute; inset: auto 0 0 0; padding: 26px 12px 12px; background: linear-gradient(0deg,rgba(5,5,7,0.92),transparent); }
.photo-card .pc-meta b { font-family: var(--font-display); font-size: 0.9rem; display: block; }
.photo-card .pc-meta span { color: var(--brand-2); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; }
.photo-card .pc-del { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border-radius: 8px; background: rgba(8,8,10,0.7); border: 1px solid var(--line-2); color: #fff; display: grid; place-items: center; opacity: 0; transition: opacity .2s; }
.photo-card:hover .pc-del { opacity: 1; }
.photo-card .pc-del:hover { background: rgba(229,72,77,0.8); }
.photo-card .pc-del svg { width: 15px; height: 15px; }
.photo-card .pc-foot { position: absolute; top: 10px; left: 10px; width: 32px; height: 32px; border-radius: 8px; background: rgba(8,8,10,0.7); border: 1px solid var(--line-2); color: #fff; display: grid; place-items: center; opacity: 0; transition: opacity .2s, background .2s, border-color .2s; cursor: pointer; }
.photo-card:hover .pc-foot { opacity: 1; }
.photo-card .pc-foot:hover { background: var(--brand); border-color: var(--brand); }
.photo-card .pc-foot.on { opacity: 1; background: var(--brand); border-color: var(--brand); }
.photo-card .pc-foot.on svg { fill: #fff; }
.photo-card .pc-foot svg { width: 16px; height: 16px; }
.photo-card.is-foot { outline: 2px solid var(--brand); outline-offset: -2px; }

/* ---------- Modal ---------- */
dialog.modal { border: none; padding: 0; background: transparent; max-width: min(760px, 94vw); width: 100%; color: var(--text); }
dialog.modal::backdrop { background: rgba(5,5,7,0.75); backdrop-filter: blur(6px); }
.modal-card { background: linear-gradient(180deg,var(--bg-2),var(--bg-1)); border: 1px solid var(--line-2); border-radius: 20px; box-shadow: var(--shadow); max-height: 92vh; overflow: auto; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 22px 24px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg-2); z-index: 2; }
.modal-head h3 { font-size: 1.2rem; }
.modal-body { padding: 24px; }
.modal-foot { display: flex; gap: 12px; justify-content: flex-end; padding: 18px 24px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--bg-1); flex-wrap: wrap; }

/* Detail rows in request modal */
.detail-row { display: grid; grid-template-columns: 130px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.detail-row:last-child { border-bottom: none; }
.detail-row .k { color: var(--faint); font-size: 0.86rem; }
.detail-row .v { font-size: 0.95rem; word-break: break-word; }
.detail-row .v a { color: var(--brand-2); }

/* ---------- Quote preview (printable) ---------- */
.quote-doc { background: #fff; color: #17171c; border-radius: 14px; padding: 40px; }
.quote-doc .qd-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; border-bottom: 2px solid #17171c; padding-bottom: 22px; margin-bottom: 24px; }
.quote-doc .qd-head img { height: 42px; }
.quote-doc .qd-title { text-align: right; }
.quote-doc .qd-title h2 { font-size: 1.8rem; color: #17171c; }
.quote-doc .qd-title .qn { color: #F1571F; font-family: var(--font-display); font-weight: 600; }
.quote-doc .qd-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; font-size: 0.9rem; }
.quote-doc .qd-parties h5 { text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.1em; color: #888; margin-bottom: 6px; }
.quote-doc table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
.quote-doc thead th { text-align: left; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.06em; color: #888; padding: 10px; border-bottom: 1px solid #ddd; }
.quote-doc thead th.num { text-align: right; }
.quote-doc tbody td { padding: 12px 10px; border-bottom: 1px solid #eee; font-size: 0.92rem; }
.quote-doc tbody td.num { text-align: right; }
.quote-doc .qd-totals { margin-left: auto; max-width: 280px; }
.quote-doc .qd-totals .r { display: flex; justify-content: space-between; padding: 6px 0; font-size: 0.92rem; }
.quote-doc .qd-totals .r.g { border-top: 2px solid #17171c; margin-top: 6px; padding-top: 12px; font-weight: 700; font-size: 1.25rem; }
.quote-doc .qd-notes { margin-top: 24px; font-size: 0.88rem; color: #555; border-top: 1px solid #eee; padding-top: 16px; }
.quote-doc .qd-pay { margin-top: 26px; text-align: center; }
.quote-doc .qd-pay-btn { display: inline-block; background: #635BFF; color: #fff !important; text-decoration: none; font-family: var(--font-display); font-weight: 600; font-size: 1rem; padding: 14px 30px; border-radius: 10px; box-shadow: 0 10px 24px -10px rgba(99,91,255,0.6); }
.quote-doc .qd-pay-note { margin-top: 9px; font-size: 0.76rem; color: #888; }
.quote-doc .qd-pay.paid { border: 2px dashed #38D16A; border-radius: 12px; padding: 16px; display: flex; align-items: center; justify-content: center; gap: 12px; }
.quote-doc .qd-paid-badge { color: #1a9c4a; font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; letter-spacing: 0.04em; }
.quote-doc .qd-paid-date { color: #888; font-size: 0.82rem; }
.quote-doc .qd-foot { margin-top: 20px; font-size: 0.78rem; color: #999; text-align: center; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%,20px); z-index: 300; background: var(--bg-3); border: 1px solid var(--line-2); border-radius: 13px; padding: 13px 20px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s var(--ease); display: flex; gap: 10px; align-items: center; max-width: 92vw; }
.toast.show { opacity: 1; transform: translate(-50%,0); }
.toast svg { color: var(--brand-2); width: 19px; height: 19px; flex: none; }
.toast.err svg { color: var(--red); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .app.show { grid-template-columns: 1fr; }
  .sidebar { display: none; position: fixed; z-index: 60; width: 260px; left: 0; top: 0; transform: translateX(-100%); transition: transform .3s var(--ease); }
  .sidebar.open { display: flex; transform: none; }
  .sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 55; }
  .sidebar-backdrop.show { display: block; }
  .mobile-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; background: rgba(8,8,10,0.85); backdrop-filter: blur(12px); }
  .mobile-top img { height: 30px; }
  .hamb { width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(255,255,255,0.03); display: grid; place-items: center; color: var(--text); }
  .hamb svg { width: 20px; height: 20px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .row-item { grid-template-columns: 1fr; }
  .row-actions { justify-content: flex-start; }
  .topbar { padding: 16px 18px; }
}
@media (max-width: 520px) {
  .stats { grid-template-columns: 1fr; }
  .quote-doc { padding: 24px; }
  .quote-doc .qd-head { flex-direction: column; }
  .quote-doc .qd-title { text-align: left; }
  .quote-doc .qd-parties { grid-template-columns: 1fr; }
}

/* ---------- Print ---------- */
@media print {
  body * { visibility: hidden; }
  #printArea, #printArea * { visibility: visible; }
  #printArea { position: absolute; inset: 0; margin: 0; }
  .quote-doc { border-radius: 0; box-shadow: none; }
  .modal-head, .modal-foot { display: none !important; }
}
