/* Swarna — clean ICMS-style desktop shell (UI rebuild) */
:root {
  --bg: #1a2744;
  --bg-2: #243556;
  --panel: #2a3d63;
  --panel-2: #33486f;
  --line: rgba(255, 214, 140, .22);
  --text: #f4f7ff;
  --muted: #b7c5e0;
  --accent: #ffb020;
  --accent-2: #ff7a18;
  --accent-ink: #1c1003;
  --accent-glow: rgba(255, 176, 32, 0.28);
  --accent-soft: #ffe0a0;
  --shadow: 0 16px 36px rgba(8, 16, 36, .28);
  --radius: 18px;
  --sidebar: 272px;
  --font: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --ok: #4ade80; --warn: #fbbf24; --bad: #fb7185; --info: #60a5fa;
}
html[data-theme="light"] {
  --bg: #f4f1ea; --bg-2: #fffdf8; --panel: #ffffff; --panel-2: #fff7eb;
  --line: rgba(180, 100, 30, .16); --text: #1c1917; --muted: #6b7280;
  --shadow: 0 12px 28px rgba(28, 25, 23, .08);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body.app-body {
  margin: 0; font-family: var(--font); color: var(--text);
  background:
    radial-gradient(1100px 520px at 8% -8%, var(--accent-glow), transparent 52%),
    radial-gradient(900px 420px at 95% 0%, rgba(45,212,191,.18), transparent 48%),
    linear-gradient(180deg, #203054 0%, #1a2744 40%, #16223c 100%);
}
html[data-theme="light"] body.app-body {
  background: radial-gradient(900px 400px at 10% -10%, var(--accent-glow), transparent 50%), #f4f1ea;
}
a { color: var(--accent); text-decoration: none; }

/* —— Shell —— */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar); flex-shrink: 0;
  background: linear-gradient(185deg, #2f4674 0%, #24365c 45%, #1e2f52 100%);
  border-right: 1px solid var(--line);
  position: sticky; top: 0; height: 100vh; overflow: auto;
  padding: 18px 14px 28px; z-index: 30;
  box-shadow: 8px 0 30px rgba(0,0,0,.12);
}
html[data-theme="light"] .sidebar { background: linear-gradient(185deg, #fff8ec, #fff); }
.brand {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 8px 16px; border-bottom: 1px solid var(--line); margin-bottom: 12px;
  color: inherit; text-decoration: none;
}
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  font-weight: 800; color: var(--accent-ink);
  background: conic-gradient(from 200deg, #ffb020, #ff7a18, #2dd4bf, #c4b5fd, #ffb020);
  box-shadow: 0 8px 20px rgba(255,122,24,.35);
}
.brand h1 { font-size: 16px; margin: 0; letter-spacing: .06em; }
.brand small { color: var(--muted); font-size: 11px; display: block; }
.nav-group {
  margin: 14px 0 6px; font-size: 11px; text-transform: uppercase;
  letter-spacing: .14em; color: var(--muted); padding: 0 10px; font-weight: 700;
}
.nav-link {
  display: flex; align-items: center; gap: 10px;
  color: #e4ecff; padding: 9px 11px; border-radius: 12px;
  font-size: 13.5px; font-weight: 600; margin-bottom: 2px;
}
html[data-theme="light"] .nav-link { color: #334155; }
.nav-link i { width: 18px; color: var(--accent); text-align: center; }
.nav-link:hover, .nav-link.active {
  background: linear-gradient(90deg, rgba(255,176,32,.22), rgba(45,212,191,.12));
  color: #fff;
}
html[data-theme="light"] .nav-link:hover,
html[data-theme="light"] .nav-link.active { color: #1c1917; }
.sidebar-foot {
  margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line);
  font-size: .8rem; color: var(--muted);
}
.plan-badge {
  display: inline-flex; border-radius: 999px; padding: 4px 10px;
  font-size: 11px; font-weight: 800; letter-spacing: .06em;
}
.plan-start { background: rgba(96,165,250,.15); color: #93c5fd; }
.plan-pro { background: rgba(255,176,32,.18); color: #ffc44d; }
.plan-enterprise { background: rgba(196,181,253,.18); color: #c4b5fd; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: nowrap;
  padding: 12px 20px; position: sticky; top: 0; z-index: 25;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.menu-toggle { display: none; }
.mobile-shortcuts { display: none; }
.search-box { position: relative; flex: 1; max-width: 480px; min-width: 160px; }
.search-box-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--muted); pointer-events: none;
}
.search-box input {
  width: 100%; background: rgba(255,255,255,.08); border: 1px solid var(--line);
  color: var(--text); border-radius: 999px; padding: 10px 72px 10px 40px;
  font: inherit; outline: none;
}
html[data-theme="light"] .search-box input { background: #fff; }
.search-kbd {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font-size: 10px; padding: 2px 6px; border-radius: 6px;
  border: 1px solid var(--line); color: var(--muted);
}
.search-panel {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  z-index: 40; box-shadow: var(--shadow); max-height: 420px; overflow: auto;
}
.search-panel[hidden] { display: none !important; }
.search-type-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.search-chip {
  border: 1px solid var(--line); background: rgba(255,255,255,.06); color: var(--text);
  border-radius: 999px; padding: 4px 10px; font-size: 11px; font-weight: 700; cursor: pointer;
}
.search-chip.active { background: linear-gradient(90deg, var(--accent), var(--accent-2)); color: var(--accent-ink); border-color: transparent; }
.search-hit { display: block; padding: 10px 14px; border-top: 1px solid var(--line); color: var(--text); }
.search-hit:hover { background: rgba(255,176,32,.1); }
.search-hit small { display: block; color: var(--muted); }
.search-panel-foot {
  display: flex; justify-content: space-between; padding: 8px 12px;
  border-top: 1px solid var(--line); font-size: 12px; color: var(--muted);
}
.top-shortcuts { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.top-shortcut {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
  border: 1px solid var(--line); background: rgba(255,255,255,.06); font-size: 1.05rem;
}
.top-shortcut:hover { transform: translateY(-1px); }
.topbar-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-shrink: 0; }
.user-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 4px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255,255,255,.05);
  font-size: 12px; font-weight: 600;
}
.user-avatar, .avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink); font-weight: 800; font-size: .85rem;
}
.layout-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.layout-btn {
  border: 0; background: transparent; color: var(--muted); padding: 6px 9px; cursor: pointer;
}
.layout-btn.on { background: rgba(255,176,32,.2); color: var(--accent-soft); }

.tone-amber { color: #ffb020 !important; border-color: rgba(255,176,32,.45) !important; background: rgba(255,176,32,.12) !important; }
.tone-orange { color: #fb923c !important; border-color: rgba(251,146,60,.45) !important; background: rgba(251,146,60,.12) !important; }
.tone-rose { color: #fb7185 !important; border-color: rgba(251,113,133,.45) !important; background: rgba(251,113,133,.12) !important; }
.tone-violet { color: #c4b5fd !important; border-color: rgba(196,181,253,.45) !important; background: rgba(196,181,253,.14) !important; }
.tone-blue { color: #60a5fa !important; border-color: rgba(96,165,250,.45) !important; background: rgba(96,165,250,.14) !important; }
.tone-sky { color: #38bdf8 !important; border-color: rgba(56,189,248,.45) !important; background: rgba(56,189,248,.14) !important; }
.tone-teal { color: #2dd4bf !important; border-color: rgba(45,212,191,.45) !important; background: rgba(45,212,191,.14) !important; }
.tone-green { color: #4ade80 !important; border-color: rgba(74,222,128,.45) !important; background: rgba(74,222,128,.12) !important; }

/* —— Page —— */
.page, .content { padding: 22px 24px 40px; }
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 18px; flex-wrap: wrap;
}
.page-head h1, .page-head h2, .page-title {
  margin: 0 0 4px; font-size: 1.65rem; font-weight: 800; letter-spacing: -.02em;
}
.page-head p, .page-sub { margin: 0; color: var(--muted); max-width: 60ch; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-row span {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  background: rgba(255,255,255,.05); border: 1px solid var(--line); color: var(--muted);
}
.chip-row i { color: var(--accent); }
.dash-chips .chip-amber {
  background: linear-gradient(135deg, rgba(255,176,32,.22), rgba(255,176,32,.08));
  border-color: rgba(255,176,32,.45); color: #ffd36a;
}
.dash-chips .chip-amber i { color: #ffb020; }
.dash-chips .chip-teal {
  background: linear-gradient(135deg, rgba(45,212,191,.22), rgba(45,212,191,.08));
  border-color: rgba(45,212,191,.45); color: #5eead4;
}
.dash-chips .chip-teal i { color: #2dd4bf; }
.dash-chips .chip-rose {
  background: linear-gradient(135deg, rgba(251,113,133,.22), rgba(251,113,133,.08));
  border-color: rgba(251,113,133,.45); color: #fda4af;
}
.dash-chips .chip-rose i { color: #fb7185; }
.dash-chips .chip-green {
  background: linear-gradient(135deg, rgba(74,222,128,.22), rgba(74,222,128,.08));
  border-color: rgba(74,222,128,.45); color: #86efac;
}
.dash-chips .chip-green i { color: #4ade80; }
.disclaimer { font-size: 12px; color: var(--muted); margin: 0 0 14px; }
.data-toolbar { margin: 0 0 12px; }
.data-toolbar-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.data-toolbar-search {
  flex: 1; min-width: 220px; display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel);
}
.data-toolbar-search input { border: 0; background: transparent; color: var(--text); width: 100%; outline: none; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.btn-act {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
  border: 1px solid var(--line); color: var(--text); background: rgba(255,255,255,.04);
}
.btn-act:hover { border-color: var(--accent); color: var(--accent-soft); }
.btn-act.pay { border-color: rgba(74,222,128,.35); color: #86efac; }
.btn-act.auction { border-color: rgba(251,113,133,.35); color: #fda4af; }
.page-tabs {
  display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px;
  padding: 6px; background: rgba(255,255,255,.04); border: 1px solid var(--line);
  border-radius: 14px; width: fit-content; max-width: 100%;
}
.page-tabs a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 10px; font-size: 13px; font-weight: 700;
  color: var(--muted); border: 1px solid transparent;
}
.page-tabs a:hover { color: var(--text); background: rgba(255,255,255,.05); }
.page-tabs a.active {
  color: var(--accent-ink);
  background: linear-gradient(180deg, #ffc44d, var(--accent));
  border-color: transparent;
}
.cards, .kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px;
}
.kpi, .panel, .card-soft {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
}
.kpi .lbl {
  color: var(--muted); font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; font-weight: 700;
}
.kpi .val { font-size: 1.35rem; font-weight: 800; margin-top: 6px; }

/* Colourful owner dashboard KPIs */
.dash-kpi-grid { gap: 14px; }
.dash-kpi {
  position: relative;
  overflow: hidden;
  min-height: 108px;
  border-width: 1.5px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.dash-kpi:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(0,0,0,.28);
}
.dash-kpi-ico {
  position: absolute;
  right: 12px;
  top: 12px;
  font-size: 1.45rem;
  opacity: .42;
}
.dash-kpi .val { font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.kpi-amber {
  background: linear-gradient(145deg, rgba(255,176,32,.28), rgba(42,61,99,.55));
  border-color: rgba(255,176,32,.5);
}
.kpi-amber .val, .kpi-amber .dash-kpi-ico { color: #ffd36a; }
.kpi-sky {
  background: linear-gradient(145deg, rgba(56,189,248,.26), rgba(42,61,99,.55));
  border-color: rgba(56,189,248,.5);
}
.kpi-sky .val, .kpi-sky .dash-kpi-ico { color: #7dd3fc; }
.kpi-green {
  background: linear-gradient(145deg, rgba(74,222,128,.26), rgba(42,61,99,.55));
  border-color: rgba(74,222,128,.5);
}
.kpi-green .val, .kpi-green .dash-kpi-ico { color: #86efac; }
.kpi-violet {
  background: linear-gradient(145deg, rgba(167,139,250,.28), rgba(42,61,99,.55));
  border-color: rgba(167,139,250,.5);
}
.kpi-violet .val, .kpi-violet .dash-kpi-ico { color: #c4b5fd; }
.kpi-teal {
  background: linear-gradient(145deg, rgba(45,212,191,.26), rgba(42,61,99,.55));
  border-color: rgba(45,212,191,.5);
}
.kpi-teal .val, .kpi-teal .dash-kpi-ico { color: #5eead4; }
.kpi-orange {
  background: linear-gradient(145deg, rgba(251,146,60,.28), rgba(42,61,99,.55));
  border-color: rgba(251,146,60,.5);
}
.kpi-orange .val, .kpi-orange .dash-kpi-ico { color: #fdba74; }
.kpi-gold {
  background: linear-gradient(145deg, rgba(250,204,21,.3), rgba(120,53,15,.35), rgba(42,61,99,.5));
  border-color: rgba(250,204,21,.55);
}
.kpi-gold .val, .kpi-gold .dash-kpi-ico { color: #fde047; }
.kpi-blue {
  background: linear-gradient(145deg, rgba(96,165,250,.28), rgba(42,61,99,.55));
  border-color: rgba(96,165,250,.5);
}
.kpi-blue .val, .kpi-blue .dash-kpi-ico { color: #93c5fd; }
.kpi-rose {
  background: linear-gradient(145deg, rgba(251,113,133,.28), rgba(42,61,99,.55));
  border-color: rgba(251,113,133,.5);
}
.kpi-rose .val, .kpi-rose .dash-kpi-ico { color: #fda4af; }
.kpi-pink {
  background: linear-gradient(145deg, rgba(244,114,182,.28), rgba(42,61,99,.55));
  border-color: rgba(244,114,182,.5);
}
.kpi-pink .val, .kpi-pink .dash-kpi-ico { color: #f9a8d4; }
.kpi-indigo {
  background: linear-gradient(145deg, rgba(129,140,248,.28), rgba(42,61,99,.55));
  border-color: rgba(129,140,248,.5);
}
.kpi-indigo .val, .kpi-indigo .dash-kpi-ico { color: #a5b4fc; }
.kpi-lime {
  background: linear-gradient(145deg, rgba(163,230,53,.26), rgba(42,61,99,.55));
  border-color: rgba(163,230,53,.5);
}
.kpi-lime .val, .kpi-lime .dash-kpi-ico { color: #bef264; }
.dash-chart-panel {
  background: linear-gradient(160deg, rgba(56,189,248,.1), rgba(74,222,128,.08), var(--panel));
  border-color: rgba(56,189,248,.28);
}
.dash-chart-panel .panel-head i { color: #38bdf8; }
.dash-overview .table-wrap {
  border: 1px solid rgba(255,176,32,.2);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(0,0,0,.18);
}
.dash-module-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 16px 0;
}
.dash-mod-tile {
  display: flex; flex-direction: column; border: 1px solid var(--line);
  border-radius: 16px; overflow: hidden; background: var(--panel); color: inherit;
  transition: .15s;
}
.dash-mod-tile:hover {
  transform: translateY(-3px); border-color: rgba(255,176,32,.5); box-shadow: var(--shadow);
}
.dash-mod-ico {
  height: 72px; display: grid; place-items: center; font-size: 1.75rem;
  background: linear-gradient(135deg, rgba(255,176,32,.18), rgba(45,212,191,.12));
}
.dash-mod-tile.tone-amber .dash-mod-ico { background: linear-gradient(135deg, #ffb020, #f59e0b); color: #1c1408; }
.dash-mod-tile.tone-green .dash-mod-ico { background: linear-gradient(135deg, #86efac, #22c55e); color: #052e16; }
.dash-mod-tile.tone-blue .dash-mod-ico { background: linear-gradient(135deg, #93c5fd, #3b82f6); color: #0b1b33; }
.dash-mod-tile.tone-teal .dash-mod-ico { background: linear-gradient(135deg, #5eead4, #14b8a6); color: #042f2e; }
.dash-mod-tile.tone-orange .dash-mod-ico { background: linear-gradient(135deg, #fdba74, #f97316); color: #431407; }
.dash-mod-tile.tone-rose .dash-mod-ico { background: linear-gradient(135deg, #fda4af, #f43f5e); color: #4c0519; }
.dash-mod-tile.tone-violet .dash-mod-ico { background: linear-gradient(135deg, #ddd6fe, #8b5cf6); color: #1e0b3d; }
.dash-mod-tile.tone-sky .dash-mod-ico { background: linear-gradient(135deg, #7dd3fc, #0ea5e9); color: #082f49; }
.dash-mod-tile span { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 2px; }
.dash-mod-tile strong { font-size: .92rem; }
.dash-mod-tile small { color: var(--muted); font-size: .72rem; }

.btn-amber, .btn-gold, .btn.btn-gold {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: linear-gradient(180deg, #ffc44d, var(--accent)); color: var(--accent-ink);
  border: 0; border-radius: 999px; padding: 10px 16px; font-weight: 700;
  font-family: inherit; cursor: pointer; box-shadow: 0 8px 18px rgba(255,176,32,.28);
}
.btn-ghost, .btn.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px; background: transparent;
  border: 1px solid var(--line); color: var(--text); border-radius: 999px;
  padding: 8px 14px; font-weight: 600; font-family: inherit; cursor: pointer;
}
.btn-icon { padding: 8px 10px; }
.btn-wa { color: #4ade80; border-color: rgba(74,222,128,.4); }

.table-wrap {
  overflow: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--panel);
}
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th, table.data td {
  padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap;
}
table.data thead th {
  position: sticky; top: 0; background: var(--panel-2); color: var(--muted);
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700;
}
.form-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px;
}
label.fld {
  display: flex; flex-direction: column; gap: 5px; font-size: 12px;
  color: var(--muted); font-weight: 600;
}
label.fld input, label.fld select, label.fld textarea,
.form-control, .form-select {
  background: var(--bg) !important; border: 1px solid var(--line) !important;
  color: var(--text) !important; border-radius: 12px !important;
  padding: 9px 12px; font-family: inherit; font-size: 14px;
}
.section-head { display: flex; align-items: center; gap: 10px; }
.sec-ico {
  width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center;
  border: 1px solid var(--line); font-size: 1.1rem;
}
.disclaimer, .how {
  font-size: 13px; color: var(--muted); border-left: 3px solid var(--accent);
  padding: 10px 12px; background: rgba(255,255,255,.03); border-radius: 0 12px 12px 0;
}
.alert { padding: 10px 12px; border-radius: 12px; margin-bottom: 12px; }
.alert-success { background: #14532d; color: #bbf7d0; }
.alert-danger { background: #7f1d1d; color: #fecaca; }
.insight {
  border-left: 3px solid var(--accent); padding: 10px 12px; margin: 8px 0;
  background: rgba(255,176,32,.06); border-radius: 0 12px 12px 0;
}
.insight.warning { border-color: var(--warn); }
.ltv-pill { font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 999px; }
.ltv-safe { background: #14532d; color: #bbf7d0; }
.ltv-caution { background: #78350f; color: #fde68a; }
.ltv-high, .ltv-high_ltv { background: #7c2d12; color: #fed7aa; }
.ltv-violation, .ltv-policy_violation { background: #7f1d1d; color: #fecaca; }

/* —— Easy Pledge desk —— */
.pledge-desk {
  display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start;
}
.pledge-main { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.pledge-side {
  position: sticky; top: 78px;
  display: flex; flex-direction: column; gap: 12px;
}
.live-rate-bar {
  display: flex; flex-direction: column; gap: 8px;
  padding: 14px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius);
}
.live-rate-chip {
  display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline;
  padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.04);
  border: 1px solid var(--line); font-size: 13px;
}
.live-rate-chip small { color: var(--muted); }
.jewel-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px; padding: 12px 0; border-bottom: 1px dashed var(--line); align-items: end;
}
.photo-preview img {
  max-width: 220px; border-radius: 12px; border: 1px solid var(--line); margin-top: 8px;
}
.cust-hits { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.cmp-active { background: rgba(255,176,32,.12); }
.override-ltv {
  display: flex; gap: 8px; align-items: center; margin-top: 10px;
  color: var(--warn); font-size: 13px; font-weight: 600;
}
.sticky-actions {
  position: sticky; bottom: 0; z-index: 15;
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 18px; padding: 14px 16px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  border: 1px solid var(--line); border-radius: 16px;
  backdrop-filter: blur(12px);
}

/* —— Easy Pledge PRO (colourful advanced) —— */
.pledge-pro { position: relative; }
.pledge-hero {
  position: relative; overflow: hidden;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px;
  padding: 22px 24px; margin-bottom: 16px; border-radius: 24px;
  border: 1px solid rgba(255,176,32,.35);
  background:
    linear-gradient(120deg, rgba(255,176,32,.22), rgba(45,212,191,.14) 40%, rgba(96,165,250,.16) 70%, rgba(196,181,253,.18));
  box-shadow: 0 18px 40px rgba(8,16,36,.25);
}
.pledge-hero-glow {
  position: absolute; inset: -40% auto auto -10%; width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(255,176,32,.45), transparent 70%);
  pointer-events: none;
}
.pledge-hero-copy { position: relative; z-index: 1; max-width: 640px; }
.pledge-hero h2 {
  margin: 8px 0 6px; font-size: clamp(1.7rem, 2.6vw, 2.35rem); font-weight: 800;
  background: linear-gradient(90deg, #ffe7a8, #ffb020 40%, #2dd4bf);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.pledge-hero p { margin: 0; color: var(--muted); max-width: 56ch; }
.pledge-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .08em;
  background: rgba(255,176,32,.2); color: #ffd36a; border: 1px solid rgba(255,176,32,.4);
}
.pledge-hero-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pledge-hero-chips span {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: rgba(0,0,0,.22); border: 1px solid rgba(255,255,255,.12); color: #e8efff;
}
.pledge-hero-chips i { color: #ffc44d; }
.pledge-hero-actions { position: relative; z-index: 1; display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }
.ph-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 14px; border-radius: 999px; font-weight: 700; font-size: 13px;
  border: 1px solid rgba(255,255,255,.14); color: var(--text); background: rgba(0,0,0,.18); cursor: pointer;
}
.ph-btn.ph-solid {
  background: linear-gradient(180deg, #ffd36a, #ff7a18); color: #1c1003; border: 0;
  box-shadow: 0 10px 22px rgba(255,122,24,.35);
}
.ph-btn.ph-ghost:hover { border-color: rgba(255,176,32,.5); color: #ffe0a0; }
.ph-btn.ph-wa { background: #128c7e; border-color: #25d366; color: #fff; }

.pledge-steps {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px;
}
.pstep {
  display: flex; flex-direction: column; gap: 2px;
  padding: 12px 14px; border-radius: 16px; color: var(--text);
  border: 1px solid var(--line); background: rgba(255,255,255,.04);
  transition: transform .15s ease, border-color .15s, background .15s;
}
.pstep span {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; font-weight: 800; background: rgba(255,255,255,.08); margin-bottom: 4px;
}
.pstep b { font-size: 13.5px; }
.pstep small { color: var(--muted); font-size: 11px; }
.pstep:nth-child(1) { border-color: rgba(96,165,250,.35); }
.pstep:nth-child(2) { border-color: rgba(251,146,60,.35); }
.pstep:nth-child(3) { border-color: rgba(74,222,128,.35); }
.pstep:nth-child(4) { border-color: rgba(196,181,253,.35); }
.pstep.on, .pstep.done { transform: translateY(-1px); }
.pstep.on:nth-child(1), .pstep.done:nth-child(1) { background: linear-gradient(135deg, rgba(96,165,250,.25), rgba(42,61,99,.4)); }
.pstep.on:nth-child(2), .pstep.done:nth-child(2) { background: linear-gradient(135deg, rgba(251,146,60,.25), rgba(42,61,99,.4)); }
.pstep.on:nth-child(3), .pstep.done:nth-child(3) { background: linear-gradient(135deg, rgba(74,222,128,.22), rgba(42,61,99,.4)); }
.pstep.on:nth-child(4), .pstep.done:nth-child(4) { background: linear-gradient(135deg, rgba(196,181,253,.25), rgba(42,61,99,.4)); }
.pstep.on span, .pstep.done span {
  background: linear-gradient(180deg, #ffd36a, #ff7a18); color: #1c1003;
}

.ppanel {
  border-radius: 22px; padding: 18px 18px 20px;
  border: 1px solid var(--line);
  background: linear-gradient(165deg, rgba(255,255,255,.06), rgba(42,61,99,.55));
  box-shadow: 0 14px 32px rgba(8,16,36,.18);
}
.ppanel-blue { border-color: rgba(96,165,250,.4); box-shadow: 0 14px 32px rgba(37,99,235,.12); }
.ppanel-orange { border-color: rgba(251,146,60,.4); box-shadow: 0 14px 32px rgba(234,88,12,.12); }
.ppanel-green { border-color: rgba(74,222,128,.35); box-shadow: 0 14px 32px rgba(22,163,74,.12); }
.ppanel-violet { border-color: rgba(196,181,253,.4); box-shadow: 0 14px 32px rgba(124,58,237,.12); }
.ppanel-head {
  display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
}
.ppanel-head h3 { margin: 0; font-size: 1.15rem; }
.ppanel-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.ppanel-head .ph-btn { margin-left: auto; }
.ppanel-ico {
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
  font-size: 1.25rem; color: #1c1003;
  background: linear-gradient(135deg, #ffd36a, #ff7a18);
  box-shadow: 0 8px 18px rgba(255,122,24,.3);
}
.ppanel-blue .ppanel-ico { background: linear-gradient(135deg, #93c5fd, #3b82f6); color: #0b1b33; }
.ppanel-orange .ppanel-ico { background: linear-gradient(135deg, #fdba74, #f97316); }
.ppanel-green .ppanel-ico { background: linear-gradient(135deg, #86efac, #22c55e); color: #052e16; }
.ppanel-violet .ppanel-ico { background: linear-gradient(135deg, #ddd6fe, #8b5cf6); color: #1e0b3d; }

.pledge-search { position: relative; display: block; }
.pledge-search i {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--accent); pointer-events: none;
}
.pledge-search input {
  width: 100%; padding: 14px 16px 14px 42px !important;
  border-radius: 16px !important; border: 1px solid rgba(96,165,250,.35) !important;
  background: rgba(0,0,0,.2) !important; font-size: 15px !important;
}
.pledge-fields .fld input, .pledge-fields .fld select {
  border-radius: 12px !important;
}
.fld-money {
  grid-column: span 2;
  min-width: 280px;
}
.fld-money input {
  font-size: 1.45rem !important; font-weight: 800 !important;
  letter-spacing: .02em;
  min-height: 52px;
  width: 100%;
  min-width: 260px;
  color: #ffd36a !important; border-color: rgba(255,176,32,.45) !important;
  font-variant-numeric: tabular-nums;
}
.fld-hint {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted, #94a3b8);
  font-weight: 500;
  line-height: 1.35;
}
@media (max-width: 720px) {
  .fld-money { grid-column: span 1; min-width: 0; }
}
.pledge-photo-card {
  margin: 14px 0;
  background: linear-gradient(120deg, rgba(96,165,250,.12), rgba(255,176,32,.08));
  border-style: solid;
}
.pledge-photo-card h4 { margin: 0 0 4px; }
.photo-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.ph-upload {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 8px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  background: linear-gradient(180deg, #ffd36a, #ff7a18); color: #1c1003;
}
.ph-upload.alt {
  background: rgba(255,255,255,.08); color: var(--text); border: 1px solid var(--line);
}

.cust-pick {
  display: inline-flex; align-items: center; gap: 10px; text-align: left;
  padding: 8px 12px 8px 8px; border-radius: 14px; cursor: pointer;
  border: 1px solid rgba(96,165,250,.3); background: rgba(96,165,250,.1); color: var(--text);
}
.cust-pick:hover { border-color: #60a5fa; background: rgba(96,165,250,.2); }
.cust-pick-meta { display: flex; flex-direction: column; line-height: 1.2; }
.cust-pick-meta small { color: var(--muted); font-size: 11.5px; }

.jewel-stack { display: flex; flex-direction: column; gap: 12px; }
.jewel-card {
  border: 1px solid rgba(251,146,60,.3) !important;
  border-radius: 16px !important; padding: 12px !important;
  background: linear-gradient(135deg, rgba(251,146,60,.1), rgba(255,255,255,.03));
  border-bottom: 1px solid rgba(251,146,60,.3) !important;
}
.jewel-card-top {
  grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center;
}
.jewel-no {
  font-size: 12px; font-weight: 800; letter-spacing: .06em;
  padding: 3px 10px; border-radius: 999px;
  background: rgba(251,146,60,.2); color: #fdba74;
}
.packet-zone {
  margin-top: 14px; display: grid; grid-template-columns: minmax(0,1fr) 180px; gap: 14px;
  padding: 14px; border-radius: 16px;
  background: linear-gradient(120deg, rgba(45,212,191,.12), rgba(255,176,32,.08));
  border: 1px dashed rgba(45,212,191,.4);
}
.packet-zone h4 { margin: 0 0 4px; }
.packet-preview {
  border-radius: 14px; overflow: hidden; border: 1px solid var(--line);
  background: rgba(0,0,0,.2); display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 120px; text-align: center; font-size: 12px; color: var(--muted);
}
.packet-preview img { width: 100%; height: 120px; object-fit: cover; }
.packet-preview span { padding: 6px; color: #86efac; font-weight: 700; }

.pledge-kpis {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px; margin-top: 14px;
}
.pkpi {
  position: relative; padding: 12px 12px 12px 14px; border-radius: 16px;
  border: 1px solid var(--line); overflow: hidden;
}
.pkpi i { position: absolute; right: 10px; top: 10px; opacity: .35; font-size: 1.2rem; }
.pkpi .lbl { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.pkpi .val { font-size: 1.15rem; font-weight: 800; margin-top: 4px; }
.pkpi-gold { background: linear-gradient(145deg, rgba(255,176,32,.2), transparent); border-color: rgba(255,176,32,.35); }
.pkpi-teal { background: linear-gradient(145deg, rgba(45,212,191,.18), transparent); border-color: rgba(45,212,191,.35); }
.pkpi-blue { background: linear-gradient(145deg, rgba(96,165,250,.18), transparent); border-color: rgba(96,165,250,.35); }
.pkpi-amber { background: linear-gradient(145deg, rgba(251,146,60,.2), transparent); border-color: rgba(251,146,60,.4); }
.pkpi-rose { background: linear-gradient(145deg, rgba(251,113,133,.18), transparent); border-color: rgba(251,113,133,.35); }
.pkpi-violet { background: linear-gradient(145deg, rgba(196,181,253,.18), transparent); border-color: rgba(196,181,253,.35); }
.pledge-how {
  margin-top: 12px; padding: 12px; border-radius: 12px;
  background: rgba(0,0,0,.18); border: 1px solid var(--line);
}
.pledge-forecast { margin-top: 10px; }

.pledge-rail .rail-card {
  border-radius: 20px; padding: 14px; border: 1px solid var(--line);
  background: linear-gradient(165deg, rgba(255,255,255,.07), rgba(26,39,68,.7));
  box-shadow: 0 12px 28px rgba(0,0,0,.18);
}
.rail-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 800; letter-spacing: .08em; margin-bottom: 10px; color: var(--muted);
}
.rail-title i { color: var(--accent); }
.rail-rates { border-color: rgba(255,176,32,.35) !important; }
.rate-neon {
  display: grid; gap: 2px; padding: 10px; margin-bottom: 8px; border-radius: 14px;
  background: rgba(255,176,32,.08); border: 1px solid rgba(255,176,32,.22);
}
.rate-neon b { font-size: 13px; }
.rate-neon em { font-style: normal; font-size: 1.25rem; font-weight: 800; color: #ffd36a; }
.rate-neon em small { font-size: 12px; color: var(--muted); font-weight: 600; margin-left: 4px; }
.rate-neon span { font-size: 12px; color: var(--muted); }
.india-rate-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.india-rate {
  border-radius: 14px; padding: 10px; border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 4px;
}
.india-rate.is-gold {
  background: linear-gradient(145deg, rgba(255,176,32,.22), rgba(255,122,24,.08));
  border-color: rgba(255,176,32,.4);
}
.india-rate.is-silver {
  background: linear-gradient(145deg, rgba(203,213,225,.18), rgba(148,163,184,.08));
  border-color: rgba(203,213,225,.35);
}
.india-rate-top b { display: block; font-size: 12.5px; font-weight: 800; }
.india-rate-top small { color: var(--muted); font-size: 10.5px; }
.india-rate-loan span { font-size: 10px; color: var(--muted); font-weight: 700; text-transform: uppercase; }
.india-rate-loan em {
  display: block; font-style: normal; font-size: 1.05rem; font-weight: 800; color: #ffe0a0; line-height: 1.15;
}
.india-rate.is-silver .india-rate-loan em { color: #e2e8f0; }
.india-rate-loan small { font-size: 11px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.india-rate-mkt { font-size: 11px; color: var(--muted); font-weight: 600; }
.rate-chip-gold { border-color: rgba(255,176,32,.45) !important; color: #ffe0a0 !important; }
.rate-chip-silver { border-color: rgba(203,213,225,.4) !important; color: #e2e8f0 !important; }
.rate-chip-gold i, .rate-chip-silver i { font-size: 8px; }
.rail-givable { border-color: rgba(45,212,191,.4) !important; }
.givable-amt {
  font-size: clamp(1.8rem, 3vw, 2.3rem); font-weight: 800; line-height: 1.1;
  background: linear-gradient(90deg, #ffe7a8, #2dd4bf);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: 12px;
}
.ltv-meter { margin-bottom: 12px; }
.ltv-meter-track {
  height: 10px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden;
}
.ltv-meter-fill {
  height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, #4ade80, #fbbf24, #fb7185);
  transition: width .35s ease;
}
.ltv-fill-safe { background: linear-gradient(90deg, #4ade80, #22c55e) !important; }
.ltv-fill-caution { background: linear-gradient(90deg, #fbbf24, #f59e0b) !important; }
.ltv-fill-high, .ltv-fill-high_ltv { background: linear-gradient(90deg, #fb923c, #ef4444) !important; }
.ltv-meter-label {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 6px; font-size: 12px; font-weight: 700; color: var(--muted);
}
.rail-mini-kpis {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.rail-mini-kpis div {
  padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.04); border: 1px solid var(--line);
}
.rail-mini-kpis span { display: block; font-size: 11px; color: var(--muted); }
.rail-mini-kpis b { font-size: 13.5px; }
.rail-tips { border-color: rgba(196,181,253,.35) !important; }
.rail-tips ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 12.5px; }
.rail-tips li { margin-bottom: 6px; }

.pledge-sticky {
  border-radius: 20px !important;
  border-color: rgba(255,176,32,.35) !important;
  background: linear-gradient(90deg, rgba(255,176,32,.12), rgba(45,212,191,.1), rgba(96,165,250,.1)) !important;
}
.btn-save-glow {
  box-shadow: 0 12px 28px rgba(255,122,24,.45) !important;
  font-size: 15px !important; padding: 12px 20px !important;
}
.pledge-sticky-note {
  flex: 1 1 100%; font-size: 12.5px; color: var(--muted); font-weight: 600;
}
.pledge-sticky-note i { color: var(--accent); }
.pledge-done-bar {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: center;
  margin-bottom: 16px; padding: 14px 16px; border-radius: 18px;
  border: 1px solid rgba(74,222,128,.4);
  background: linear-gradient(90deg, rgba(74,222,128,.18), rgba(255,176,32,.1));
}
.pledge-done-bar b { display: block; font-size: 1.05rem; margin-bottom: 2px; }
.pledge-done-bar span { color: var(--muted); font-size: 13px; }
.pledge-done-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.pledge-modal[hidden] { display: none !important; }
.pledge-modal {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center; padding: 20px;
  background: rgba(8, 14, 28, .62); backdrop-filter: blur(6px);
}
.pledge-modal-card {
  width: min(440px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px 22px 18px;
  box-shadow: 0 24px 50px rgba(0,0,0,.4);
  text-align: center;
}
.pledge-modal-card h3 { margin: 10px 0 8px; font-size: 1.25rem; }
.pledge-modal-card p { margin: 0 0 16px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.pledge-modal-ico {
  width: 56px; height: 56px; margin: 0 auto; border-radius: 50%;
  display: grid; place-items: center; font-size: 1.5rem;
}
.pledge-modal-ico.warn { background: rgba(251,191,36,.18); color: #fbbf24; }
.pledge-modal-ico.bad { background: rgba(251,113,133,.18); color: #fb7185; }
.pledge-modal-ico.ok { background: rgba(74,222,128,.18); color: #4ade80; }
.pledge-modal-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

@media (max-width: 1100px) {
  .pledge-steps { grid-template-columns: repeat(2, 1fr); }
  .packet-zone { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .pledge-steps { grid-template-columns: 1fr; }
}

/* AI dock */
.ai-dock {
  position: fixed; right: 18px; bottom: 18px; z-index: 60;
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
}
.ai-fab {
  width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer;
  background: linear-gradient(180deg, #ffc44d, var(--accent)); color: var(--accent-ink);
  box-shadow: 0 12px 28px rgba(255,176,32,.4); font-size: 1.35rem;
}
.ai-panel {
  display: none; width: min(380px, calc(100vw - 24px));
  background: var(--panel); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow); overflow: hidden;
}
.ai-panel.open { display: block; }
.ai-panel-head {
  padding: 12px 14px; display: flex; justify-content: space-between; align-items: center;
  font-weight: 700; background: linear-gradient(90deg, rgba(255,176,32,.2), transparent);
}
.ai-panel-body { max-height: 280px; overflow: auto; padding: 12px; font-size: .9rem; }
.ai-msg { margin-bottom: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.04); }
.ai-msg.bot { border-left: 3px solid var(--accent); }
.ai-msg.user { border-left: 3px solid var(--info); }
.ai-panel-foot { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.ai-panel-foot input { flex: 1; }
.ai-quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 10px; }
.ai-quick button {
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  border-radius: 999px; padding: 4px 10px; font-size: 11px; cursor: pointer;
}

.sidebar-backdrop { display: none; }
body.sidebar-open { overflow: hidden; }

/* Mobile only when forced or Auto+narrow */
@media (max-width: 991px) {
  html[data-layout="auto"] .app-shell,
  html[data-layout="mobile"] .app-shell { flex-direction: column; }
  html[data-layout="auto"] .menu-toggle,
  html[data-layout="mobile"] .menu-toggle { display: inline-flex; }
  html[data-layout="auto"] .sidebar,
  html[data-layout="mobile"] .sidebar {
    position: fixed; left: 0; top: 0; z-index: 50;
    transform: translate3d(-105%, 0, 0); transition: transform .22s ease;
    width: min(300px, 88vw); height: 100dvh;
  }
  html[data-layout="auto"] .sidebar.open,
  html[data-layout="mobile"] .sidebar.open { transform: translate3d(0, 0, 0); }
  html[data-layout="auto"] .sidebar-backdrop.open,
  html[data-layout="mobile"] .sidebar-backdrop.open {
    display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 45;
  }
  html[data-layout="auto"] .top-shortcuts,
  html[data-layout="mobile"] .top-shortcuts { display: none; }
  html[data-layout="auto"] .mobile-shortcuts,
  html[data-layout="mobile"] .mobile-shortcuts {
    display: flex; gap: 8px; padding: 8px 12px; overflow-x: auto;
    border-bottom: 1px solid var(--line);
  }
  html[data-layout="auto"] .pledge-desk,
  html[data-layout="mobile"] .pledge-desk { grid-template-columns: 1fr; }
  html[data-layout="auto"] .pledge-side,
  html[data-layout="mobile"] .pledge-side { position: static; }
  html[data-layout="auto"] .user-meta,
  html[data-layout="mobile"] .user-meta { display: none; }
  html[data-layout="auto"] .page,
  html[data-layout="mobile"] .page { padding: 14px 12px 100px; }
}

/* Force Desktop always wins */
html[data-layout="desktop"] .app-shell { flex-direction: row !important; }
html[data-layout="desktop"] .sidebar {
  position: sticky !important; transform: none !important;
  width: var(--sidebar) !important; height: 100vh !important;
}
html[data-layout="desktop"] .menu-toggle,
html[data-layout="desktop"] .mobile-shortcuts,
html[data-layout="desktop"] .sidebar-backdrop { display: none !important; }
html[data-layout="desktop"] .top-shortcuts { display: flex !important; }
html[data-layout="desktop"] .pledge-desk { grid-template-columns: minmax(0, 1fr) 320px !important; }
html[data-layout="desktop"] .pledge-side { position: sticky !important; top: 78px !important; }
html[data-layout="desktop"] .page { padding: 20px 24px 110px !important; min-width: 0; }
html[data-layout="desktop"] .main { overflow-x: auto; }
/* Keep desktop chrome usable even in a narrow Cursor side panel */
html[data-layout="desktop"] .topbar { flex-wrap: wrap; min-width: 960px; }
html[data-layout="desktop"] .page { min-width: 960px; }

/* Auth (login) */
body.auth-page {
  margin: 0; min-height: 100vh; font-family: var(--font); color: var(--text);
  background:
    radial-gradient(900px 420px at 10% 0%, rgba(255,176,32,.25), transparent 50%),
    linear-gradient(160deg, #12203a, #1a2744 50%, #0f172a);
}
.auth-stage { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-shell {
  width: min(1080px, 100%); display: grid; grid-template-columns: 1.05fr .95fr;
  background: rgba(42,61,99,.55); border: 1px solid var(--line); border-radius: 28px;
  overflow: hidden; box-shadow: var(--shadow);
}
.auth-copy { padding: 40px 36px; }
.auth-copy h1 { font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 800; margin: 12px 0; }
.auth-card { background: var(--panel); padding: 32px 28px; }
.role-pills { display: flex; flex-wrap: wrap; gap: .5rem; }
.role-pill {
  border: 1px solid var(--line); background: rgba(255,255,255,.04); color: var(--text);
  border-radius: 999px; padding: .45rem .9rem; font-size: .85rem; font-weight: 600; cursor: pointer;
}
.role-pill.active, .role-pill:hover {
  background: rgba(255,176,32,.18); border-color: rgba(255,176,32,.5); color: var(--accent-soft);
}
@media (max-width: 800px) {
  .auth-shell { grid-template-columns: 1fr; }
}

/* —— Loan grid cards —— */
.loan-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.loan-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column;
}
.loan-card-media {
  position: relative; display: block; aspect-ratio: 16/10; background: rgba(0,0,0,.2);
  overflow: hidden;
}
.loan-card-media img { width: 100%; height: 100%; object-fit: cover; }
.loan-card-fallback {
  width: 100%; height: 100%; min-height: 120px; display: grid; place-items: center;
  font-size: 2.4rem; font-weight: 800; color: var(--accent);
  background: linear-gradient(135deg, rgba(255,176,32,.2), rgba(45,212,191,.12));
}
.loan-card-status { position: absolute; top: 10px; left: 10px; }
.loan-card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.loan-card-cust { display: flex; gap: 10px; align-items: center; }
.loan-card-kpis {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px;
  font-size: 12px; color: var(--muted);
}
.loan-card-kpis i { color: var(--accent); }
.hit-thumb {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
  border: 1px solid var(--line); flex-shrink: 0;
}
.hit-thumb-empty {
  display: grid; place-items: center; background: rgba(255,255,255,.06); color: var(--muted);
}
.btn-ghost.on { background: rgba(255,176,32,.2); color: var(--accent-soft); border-color: rgba(255,176,32,.45); }

.loan-show-head { display: flex; gap: 14px; align-items: center; }
.loan-show-avatar {
  width: 64px; height: 64px; border-radius: 18px; overflow: hidden;
  border: 1px solid var(--line); background: rgba(255,255,255,.06);
  display: grid; place-items: center; font-weight: 800; font-size: 1.4rem; color: var(--accent);
}
.loan-show-avatar img { width: 100%; height: 100%; object-fit: cover; }
.loan-show-grid {
  display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; align-items: start;
}
.loan-show-photo img { width: 100%; border-radius: 14px; display: block; border: 1px solid var(--line); }
.loan-show-icons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.jewel-photo-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px;
}
.jewel-tile { display: flex; gap: 12px; align-items: center; padding: 12px; }
.jewel-tile img {
  width: 72px; height: 72px; border-radius: 12px; object-fit: cover; border: 1px solid var(--line);
}

.cust-photo-box {
  display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; align-items: center;
  padding: 12px; border: 1px dashed var(--line); border-radius: 16px; background: rgba(255,255,255,.03);
}
.cust-photo-preview {
  width: 120px; height: 120px; border-radius: 16px; overflow: hidden;
  border: 1px solid var(--line); background: rgba(0,0,0,.15);
}
.cust-photo-preview img { width: 100%; height: 100%; object-fit: cover; }

.risk-box {
  margin-top: 10px; padding: 12px 14px; border-radius: 14px;
  border: 1px solid var(--line); background: rgba(255,255,255,.04);
}
.risk-box ul { margin: 8px 0 0; padding-left: 18px; }
.risk-head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.risk-low { border-color: rgba(74,222,128,.4); background: rgba(74,222,128,.08); }
.risk-medium { border-color: rgba(251,191,36,.45); background: rgba(251,191,36,.1); }
.risk-high { border-color: rgba(251,113,133,.5); background: rgba(251,113,133,.12); }
.risk-pill {
  font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; margin-left: 6px;
}
.risk-pill.risk-low { background: #14532d; color: #bbf7d0; }
.risk-pill.risk-medium { background: #78350f; color: #fde68a; }
.risk-pill.risk-high { background: #7f1d1d; color: #fecaca; }

/* —— Reports colourful category boxes —— */
.rpt-index-bar {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 18px;
}
.rpt-count { color: var(--muted); font-weight: 700; font-size: 13px; }
.rpt-cat-grid { display: flex; flex-direction: column; gap: 20px; }
.rpt-cat {
  border-radius: 22px; padding: 18px; border: 1.5px solid transparent;
  box-shadow: 0 12px 28px rgba(0,0,0,.22);
}
.rpt-cat-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.rpt-cat-head h3 { margin: 0; font-size: 1.2rem; }
.rpt-cat-head small { color: rgba(255,255,255,.78); }
.rpt-cat-ico {
  width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center;
  font-size: 1.45rem; color: #1c1408; box-shadow: 0 8px 16px rgba(0,0,0,.25);
}
.rpt-tone-amber .rpt-cat-ico { background: linear-gradient(135deg, #ffd36a, #ffb020); }
.rpt-tone-orange .rpt-cat-ico { background: linear-gradient(135deg, #fdba74, #f97316); }
.rpt-tone-violet .rpt-cat-ico { background: linear-gradient(135deg, #ddd6fe, #8b5cf6); color: #1e0b3d; }
.rpt-tone-rose .rpt-cat-ico { background: linear-gradient(135deg, #fda4af, #f43f5e); color: #4c0519; }
.rpt-tone-blue .rpt-cat-ico { background: linear-gradient(135deg, #93c5fd, #3b82f6); color: #0b1b33; }
.rpt-tone-green .rpt-cat-ico { background: linear-gradient(135deg, #86efac, #22c55e); color: #052e16; }
.rpt-tone-teal .rpt-cat-ico { background: linear-gradient(135deg, #5eead4, #14b8a6); color: #042f2e; }
.rpt-tone-pink .rpt-cat-ico { background: linear-gradient(135deg, #f9a8d4, #ec4899); color: #500724; }
.rpt-tone-sky .rpt-cat-ico { background: linear-gradient(135deg, #7dd3fc, #0ea5e9); color: #082f49; }
.rpt-cat-boxes {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px;
}
.rpt-box {
  position: relative;
  display: flex; flex-direction: column; gap: 6px;
  padding: 14px 14px 16px; border-radius: 16px;
  background: rgba(0,0,0,.22); border: 1.5px solid rgba(255,255,255,.12);
  color: var(--text); min-height: 118px;
  transition: transform .15s ease, border-color .15s, box-shadow .15s;
}
.rpt-box:hover {
  transform: translateY(-3px);
  border-color: rgba(255,255,255,.4);
  color: #fff;
  box-shadow: 0 12px 22px rgba(0,0,0,.28);
}
.rpt-box-ico {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; font-size: 1.2rem;
  margin-bottom: 2px; color: #1c1408;
  box-shadow: 0 4px 10px rgba(0,0,0,.2);
}
.rpt-box strong { font-size: 13.5px; line-height: 1.25; padding-right: 18px; }
.rpt-box small { color: rgba(255,255,255,.78); font-size: 11.5px; line-height: 1.35; }
.rpt-box-go {
  position: absolute; right: 12px; top: 14px;
  font-size: 1.05rem; opacity: .55;
}
.rpt-box:hover .rpt-box-go { opacity: 1; }
.rpt-box-amber .rpt-box-ico { background: linear-gradient(135deg, #ffd36a, #ffb020); }
.rpt-box-amber { border-color: rgba(255,176,32,.4); background: linear-gradient(160deg, rgba(255,176,32,.22), rgba(0,0,0,.2)); }
.rpt-box-sky .rpt-box-ico { background: linear-gradient(135deg, #7dd3fc, #0ea5e9); color: #082f49; }
.rpt-box-sky { border-color: rgba(56,189,248,.4); background: linear-gradient(160deg, rgba(56,189,248,.22), rgba(0,0,0,.2)); }
.rpt-box-green .rpt-box-ico { background: linear-gradient(135deg, #86efac, #22c55e); color: #052e16; }
.rpt-box-green { border-color: rgba(74,222,128,.4); background: linear-gradient(160deg, rgba(74,222,128,.2), rgba(0,0,0,.2)); }
.rpt-box-violet .rpt-box-ico { background: linear-gradient(135deg, #ddd6fe, #8b5cf6); color: #1e0b3d; }
.rpt-box-violet { border-color: rgba(167,139,250,.45); background: linear-gradient(160deg, rgba(167,139,250,.22), rgba(0,0,0,.2)); }
.rpt-box-orange .rpt-box-ico { background: linear-gradient(135deg, #fdba74, #f97316); }
.rpt-box-orange { border-color: rgba(251,146,60,.45); background: linear-gradient(160deg, rgba(251,146,60,.22), rgba(0,0,0,.2)); }
.rpt-box-rose .rpt-box-ico { background: linear-gradient(135deg, #fda4af, #f43f5e); color: #4c0519; }
.rpt-box-rose { border-color: rgba(251,113,133,.45); background: linear-gradient(160deg, rgba(251,113,133,.22), rgba(0,0,0,.2)); }
.rpt-box-teal .rpt-box-ico { background: linear-gradient(135deg, #5eead4, #14b8a6); color: #042f2e; }
.rpt-box-teal { border-color: rgba(45,212,191,.45); background: linear-gradient(160deg, rgba(45,212,191,.22), rgba(0,0,0,.2)); }
.rpt-box-pink .rpt-box-ico { background: linear-gradient(135deg, #f9a8d4, #ec4899); color: #500724; }
.rpt-box-pink { border-color: rgba(244,114,182,.45); background: linear-gradient(160deg, rgba(244,114,182,.22), rgba(0,0,0,.2)); }
.rpt-box-blue .rpt-box-ico { background: linear-gradient(135deg, #93c5fd, #3b82f6); color: #0b1b33; }
.rpt-box-blue { border-color: rgba(96,165,250,.45); background: linear-gradient(160deg, rgba(96,165,250,.22), rgba(0,0,0,.2)); }
.rpt-box-lime .rpt-box-ico { background: linear-gradient(135deg, #bef264, #84cc16); color: #1a2e05; }
.rpt-box-lime { border-color: rgba(163,230,53,.45); background: linear-gradient(160deg, rgba(163,230,53,.2), rgba(0,0,0,.2)); }

html[data-theme="light"] .rpt-box { color: #1c1917; }
html[data-theme="light"] .rpt-box small { color: #57534e; }
html[data-theme="light"] .rpt-box:hover { color: #1c1917; }
html[data-theme="light"] .rpt-cat-head small { color: #57534e; }

.rpt-tone-amber { background: linear-gradient(145deg, #5a4010, #2a3d63 55%, #1e293b); border-color: rgba(255,176,32,.5); }
.rpt-tone-orange { background: linear-gradient(145deg, #5a2a0e, #2a3d63 55%, #1e293b); border-color: rgba(251,146,60,.55); }
.rpt-tone-violet { background: linear-gradient(145deg, #3b2566, #2a3d63 55%, #1e293b); border-color: rgba(196,181,253,.55); }
.rpt-tone-rose { background: linear-gradient(145deg, #5a1730, #2a3d63 55%, #1e293b); border-color: rgba(251,113,133,.55); }
.rpt-tone-blue { background: linear-gradient(145deg, #163a6e, #2a3d63 55%, #1e293b); border-color: rgba(96,165,250,.55); }
.rpt-tone-green { background: linear-gradient(145deg, #14532d, #2a3d63 55%, #1e293b); border-color: rgba(74,222,128,.5); }
.rpt-tone-teal { background: linear-gradient(145deg, #115e59, #2a3d63 55%, #1e293b); border-color: rgba(45,212,191,.55); }
.rpt-tone-pink { background: linear-gradient(145deg, #5b1a42, #2a3d63 55%, #1e293b); border-color: rgba(244,114,182,.55); }
.rpt-tone-sky { background: linear-gradient(145deg, #0c4a6e, #2a3d63 55%, #1e293b); border-color: rgba(56,189,248,.55); }

/* —— Bank re-pledge desk —— */
.rp-desk { display: flex; flex-direction: column; gap: 16px; }
.rp-loan-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; align-items: center; }
.rp-filter {
  min-width: 200px; padding: 8px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: rgba(0,0,0,.2); color: var(--text);
}
.rp-loan-list { display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow: auto; }
.rp-loan-card {
  border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px;
  background: rgba(0,0,0,.15);
}
.rp-loan-head {
  display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-weight: 600;
}
.rp-loan-head small { display: block; color: var(--muted); font-weight: 500; margin-top: 2px; }
.rp-loan-count {
  margin-left: auto; font-size: 12px; font-weight: 800; color: #7dd3fc;
  white-space: nowrap;
}
.rp-jewel-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; padding-left: 22px; }
.rp-jewel {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: rgba(96,165,250,.12); border: 1px solid rgba(96,165,250,.3); cursor: pointer;
}
.rp-jewel input { accent-color: #38bdf8; }
.rp-new-scheme {
  background: linear-gradient(135deg, rgba(167,139,250,.12), transparent);
  border: 1px dashed rgba(167,139,250,.4);
}
.rp-save-bar {
  position: sticky; bottom: 12px; z-index: 5;
  display: flex; gap: 10px; flex-wrap: wrap;
  padding: 12px 16px; border-radius: 16px;
  background: rgba(15,23,42,.92); border: 1px solid rgba(255,176,32,.35);
  box-shadow: 0 12px 28px rgba(0,0,0,.35);
}

/* Custom columns (masters) */
.custom-fields-banner {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 13px; color: #c4b5fd;
  padding: 8px 12px; border-radius: 12px;
  background: linear-gradient(135deg, rgba(167,139,250,.18), rgba(96,165,250,.1));
  border: 1px solid rgba(167,139,250,.35);
}
.custom-bool {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 8px; font-weight: 600;
}
.cf-edit-row { margin: 0; }
.cf-edit-grid {
  display: grid;
  grid-template-columns: 70px 1.4fr 110px 120px repeat(3, auto) 110px auto;
  gap: 8px; align-items: center;
  padding: 10px 12px;
}
.cf-edit-grid input, .cf-edit-grid select {
  width: 100%; min-width: 0;
}
.cf-mini { max-width: 70px; }
.cf-code {
  font-size: 12px; color: var(--muted);
  background: rgba(0,0,0,.2); padding: 6px 8px; border-radius: 8px;
}
@media (max-width: 1100px) {
  .cf-edit-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .loan-show-grid { grid-template-columns: 1fr; }
  .cust-photo-box { grid-template-columns: 1fr; }
}

/* —— Loan Dossier & Full View (Luxury Bank-Grade) —— */
.pledge-done-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 14px 20px; border-radius: 16px; margin-bottom: 20px;
  background: linear-gradient(135deg, rgba(74,222,128,.18), rgba(34,197,94,.08));
  border: 1px solid rgba(74,222,128,.35); box-shadow: 0 10px 24px rgba(34,197,94,.1);
}
.pledge-done-bar b { color: #86efac; font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
.pledge-done-bar span { color: var(--muted); font-size: 13px; margin-left: 6px; }
.pledge-done-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.loan-hero {
  position: relative; overflow: hidden;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap;
  padding: 24px 28px; margin-bottom: 20px; border-radius: 24px;
  border: 1px solid rgba(255,176,32,.35);
  background: linear-gradient(135deg, rgba(255,176,32,.15), rgba(45,212,191,.1) 35%, rgba(96,165,250,.12) 70%, rgba(42,61,99,.65));
  box-shadow: 0 16px 36px rgba(8,16,36,.25);
  backdrop-filter: blur(12px);
}
.loan-hero-left {
  display: flex; align-items: flex-start; gap: 18px; flex: 1; min-width: 280px;
}
.loan-hero-avatar {
  width: 72px; height: 72px; border-radius: 20px; flex-shrink: 0;
  display: grid; place-items: center; overflow: hidden;
  border: 2px solid rgba(255,176,32,.5);
  background: linear-gradient(135deg, #ffd36a, #ff7a18);
  box-shadow: 0 10px 24px rgba(255,122,24,.35);
  font-size: 2rem; font-weight: 800; color: #1c1003;
}
.loan-hero-avatar a { display: block; width: 100%; height: 100%; }
.loan-hero-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.loan-hero-title {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px;
}
.loan-hero-title h1 {
  margin: 0; font-size: clamp(1.65rem, 2.5vw, 2.25rem); font-weight: 800; letter-spacing: -0.01em;
  background: linear-gradient(90deg, #ffe7a8, #ffb020 40%, #2dd4bf);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.loan-hero-sub {
  color: var(--muted); font-size: 13.5px; margin: 0 0 10px; line-height: 1.5;
}
.loan-hero-sub a { font-weight: 700; color: #ffd36a; }
.loan-hero-sub a:hover { text-decoration: underline; }
.loan-hero-chips {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px;
}
.loan-hero-chips span {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.12); color: #e8efff;
}
.loan-hero-chips i { color: #ffc44d; }
.loan-hero-actions {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
}

.loan-kpi-strip {
  margin-bottom: 20px;
}
.ltv-pill {
  display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px;
  font-size: 10.5px; font-weight: 800; letter-spacing: .05em; vertical-align: middle; margin-left: 6px;
}
.ltv-safe { background: rgba(74,222,128,.18); color: #86efac; border: 1px solid rgba(74,222,128,.4); }
.ltv-caution { background: rgba(251,191,36,.18); color: #fde047; border: 1px solid rgba(251,191,36,.4); }
.ltv-high { background: rgba(251,146,60,.2); color: #fdba74; border: 1px solid rgba(251,146,60,.45); }
.ltv-violation { background: rgba(251,113,133,.2); color: #fda4af; border: 1px solid rgba(251,113,133,.45); }

.loan-quick-bar {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px;
  padding: 10px 14px; border-radius: 16px;
  background: rgba(0,0,0,.22); border: 1px solid var(--line);
  align-items: center;
}
.loan-quick-bar .btn-act {
  padding: 8px 16px; font-size: 13px; border-radius: 10px; font-weight: 700;
}
.btn-act.pay { border-color: rgba(74,222,128,.4); color: #86efac; background: rgba(74,222,128,.1); }
.btn-act.settle { border-color: rgba(56,189,248,.4); color: #7dd3fc; background: rgba(56,189,248,.1); }
.btn-act.delete { border-color: rgba(251,113,133,.4); color: #fda4af; background: rgba(251,113,133,.1); }

/* Dossier Panels */
.dossier-panel {
  margin-bottom: 22px; border-radius: 22px; padding: 22px 24px;
  background: linear-gradient(165deg, rgba(255,255,255,.05), rgba(42,61,99,.55));
  border: 1px solid var(--line); box-shadow: 0 12px 28px rgba(8,16,36,.18);
}
.dossier-head {
  display: flex; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line); padding-bottom: 14px;
}
.dossier-head h3 { font-size: 1.2rem; font-weight: 700; color: #f4f7ff; }
.dossier-head .how { font-size: 13px; color: var(--muted); }
.sec-ico {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  font-size: 1.25rem; flex-shrink: 0;
}
.sec-ico.tone-blue { background: linear-gradient(135deg, #93c5fd, #3b82f6); color: #0b1b33; box-shadow: 0 8px 18px rgba(59,130,246,.25); }
.sec-ico.tone-orange { background: linear-gradient(135deg, #fdba74, #f97316); color: #431407; box-shadow: 0 8px 18px rgba(249,115,22,.25); }
.sec-ico.tone-amber { background: linear-gradient(135deg, #ffd36a, #f59e0b); color: #1c1408; box-shadow: 0 8px 18px rgba(245,158,11,.25); }
.sec-ico.tone-rose { background: linear-gradient(135deg, #fda4af, #f43f5e); color: #4c0519; box-shadow: 0 8px 18px rgba(244,63,94,.25); }
.sec-ico.tone-green { background: linear-gradient(135deg, #86efac, #22c55e); color: #052e16; box-shadow: 0 8px 18px rgba(34,197,94,.25); }
.sec-ico.tone-violet { background: linear-gradient(135deg, #ddd6fe, #8b5cf6); color: #1e0b3d; box-shadow: 0 8px 18px rgba(139,92,246,.25); }

/* Customer Hero in Dossier */
.dossier-cust-hero {
  display: grid; grid-template-columns: 240px 1fr; gap: 24px; align-items: start;
}
.dossier-photo-xl {
  margin: 0; width: 100%; max-width: 240px; border-radius: 18px; overflow: hidden;
  border: 2px solid rgba(255,176,32,.35); background: rgba(0,0,0,.3);
  box-shadow: 0 12px 28px rgba(0,0,0,.25); text-align: center;
}
.dossier-photo-xl a { display: block; overflow: hidden; }
.dossier-photo-xl img {
  width: 100%; height: 230px; max-height: 240px; object-fit: cover; display: block;
  transition: transform .25s ease;
}
.dossier-photo-xl img:hover { transform: scale(1.04); }
.dossier-photo-fallback {
  width: 100%; height: 210px; display: grid; place-items: center;
  font-size: 4.5rem; color: rgba(255,255,255,.15); background: rgba(255,255,255,.03);
}
.dossier-photo-xl figcaption {
  padding: 8px 12px; font-size: 11.5px; color: var(--muted);
  background: rgba(0,0,0,.45); border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; gap: 6px;
}

/* Detail Grid (Customer and Loan specs) */
.detail-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; width: 100%;
}
.detail-grid > div {
  background: rgba(0,0,0,.22); border: 1px solid var(--line);
  border-radius: 14px; padding: 10px 14px; display: flex; flex-direction: column; gap: 4px;
}
.detail-grid > div.span-2 { grid-column: span 2; }
.detail-grid .lbl {
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); font-weight: 700;
}
.detail-grid b { font-size: 13.5px; color: var(--text); word-break: break-word; }
.detail-name { font-size: 1.15rem !important; color: #ffd36a !important; font-weight: 800; }
.detail-phone { color: #86efac !important; font-family: monospace; font-size: 1rem !important; font-weight: 700; }

/* Packet Hero */
.packet-hero {
  display: flex; align-items: center; gap: 18px; padding: 14px 18px; border-radius: 16px;
  background: rgba(255,176,32,.08); border: 1px solid rgba(255,176,32,.3); margin-bottom: 20px;
}
.packet-hero a { display: block; flex-shrink: 0; overflow: hidden; border-radius: 12px; }
.packet-hero img {
  width: 110px; height: 85px; object-fit: cover; display: block;
  border-radius: 12px; border: 2px solid rgba(255,176,32,.4);
  box-shadow: 0 6px 16px rgba(0,0,0,.25); transition: transform .2s ease;
}
.packet-hero img:hover { transform: scale(1.05); }
.packet-hero p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.chip-gold {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  border-radius: 999px; font-size: 11.5px; font-weight: 800;
  background: rgba(255,176,32,.22); color: #ffd36a; border: 1px solid rgba(255,176,32,.4);
}

/* Jewel Cards Gallery */
.jewel-gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 16px; margin-bottom: 20px;
}
.jewel-card-xl {
  background: rgba(0,0,0,.24); border: 1px solid var(--line);
  border-radius: 20px; overflow: hidden; display: flex; flex-direction: column;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.jewel-card-xl:hover {
  transform: translateY(-3px); border-color: rgba(255,176,32,.5);
  box-shadow: 0 14px 30px rgba(0,0,0,.28);
}
.jewel-card-media {
  position: relative; height: 180px; width: 100%;
  background: rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center;
  overflow: hidden; border-bottom: 1px solid var(--line);
}
.jewel-card-media a { display: block; width: 100%; height: 100%; }
.jewel-card-media img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .25s ease;
}
.jewel-card-media img:hover { transform: scale(1.04); }
.jewel-card-fallback { font-size: 3.5rem; color: rgba(255,255,255,.14); }
.jewel-badge {
  position: absolute; top: 12px; left: 12px;
  background: rgba(0,0,0,.65); backdrop-filter: blur(8px);
  padding: 3px 10px; border-radius: 8px; font-size: 11.5px; font-weight: 800;
  border: 1px solid rgba(255,255,255,.18); color: #ffd36a;
}
.jewel-card-body {
  padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; flex: 1;
}
.jewel-card-body h4 { margin: 0; font-size: 1.15rem; font-weight: 800; color: #f4f7ff; }
.jewel-meta-row { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; color: var(--muted); }
.jewel-meta-row span {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,.06); padding: 4px 9px; border-radius: 7px;
}
.jewel-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  background: rgba(0,0,0,.25); border-radius: 14px; padding: 12px 14px;
  font-size: 12.5px; border: 1px solid rgba(255,255,255,.06);
}
.jewel-stats > div { display: flex; flex-direction: column; gap: 2px; }
.jewel-stats em { font-style: normal; color: var(--muted); font-size: 11px; text-transform: uppercase; font-weight: 600; }
.jewel-stats b { color: #f4f7ff; font-size: 13.5px; }
.jewel-foot {
  display: flex; justify-content: space-between; align-items: center; margin-top: auto;
  padding-top: 10px; border-top: 1px solid rgba(255,255,255,.06);
}
.custody-pill {
  display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  background: rgba(45,212,191,.15); color: #5eead4; border: 1px solid rgba(45,212,191,.35);
}
.jewel-thumbs { display: flex; gap: 6px; }
.jewel-thumbs img {
  width: 36px; height: 36px; object-fit: cover; border-radius: 7px;
  border: 1px solid var(--line); display: block;
}
.jewel-table-fold {
  margin-top: 16px; background: rgba(0,0,0,.18); border-radius: 16px;
  border: 1px solid var(--line); padding: 14px 18px;
}
.jewel-table-fold summary {
  cursor: pointer; font-weight: 700; font-size: 14px; color: var(--accent);
  user-select: none; display: flex; align-items: center; gap: 6px;
}

.dossier-explain {
  color: var(--muted); font-size: 12.5px; margin-top: 14px;
  padding: 12px 16px; background: rgba(0,0,0,.22); border-radius: 12px;
  border-left: 3px solid var(--accent); line-height: 1.5;
}

/* —— Phone overlay only (<768px). Desktop / core layout unchanged at ≥768px. —— */
@media (max-width: 767px) {
  /* Shell: override Force Desktop chrome on real phones only */
  html[data-layout="desktop"] .app-shell {
    flex-direction: column !important;
  }
  html[data-layout="desktop"] .sidebar {
    position: fixed !important;
    left: 0; top: 0; z-index: 50;
    transform: translate3d(-105%, 0, 0) !important;
    width: min(300px, 88vw) !important;
    height: 100dvh !important;
    padding-top: max(14px, env(safe-area-inset-top, 0px));
    padding-bottom: max(20px, env(safe-area-inset-bottom, 0px));
    border-right: 0;
    border-radius: 0 22px 22px 0;
    box-shadow: 16px 0 40px rgba(0, 0, 0, .4);
    transition: transform .22s ease;
    overscroll-behavior: contain;
  }
  html[data-layout="desktop"] .sidebar.open {
    transform: translate3d(0, 0, 0) !important;
  }
  html[data-layout="desktop"] .menu-toggle {
    display: inline-flex !important;
    align-items: center; justify-content: center;
    min-width: 44px; min-height: 44px;
    padding: 8px 10px;
    flex-shrink: 0;
  }
  html[data-layout="desktop"] .menu-toggle .icon-tip { display: none; }
  html[data-layout="desktop"] .mobile-shortcuts {
    display: flex !important;
    gap: 10px; padding: 8px 12px 10px;
    overflow-x: auto; overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-bottom: 1px solid var(--line);
  }
  html[data-layout="desktop"] .mobile-shortcuts::-webkit-scrollbar { display: none; }
  html[data-layout="desktop"] .mobile-shortcuts .top-shortcut {
    width: 44px; height: 44px; flex-shrink: 0; font-size: 1.15rem;
  }
  html[data-layout="desktop"] .sidebar-backdrop.open {
    display: block !important;
    position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 45;
  }
  html[data-layout="desktop"] .top-shortcuts { display: none !important; }
  html[data-layout="desktop"] .topbar {
    min-width: 0 !important;
    flex-wrap: wrap;
    gap: 8px;
    padding: max(8px, env(safe-area-inset-top, 0px)) 12px 10px;
  }
  html[data-layout="desktop"] .page {
    min-width: 0 !important;
    padding: 12px 12px calc(108px + env(safe-area-inset-bottom, 0px)) !important;
  }
  html[data-layout="desktop"] .main { overflow-x: hidden; max-width: 100vw; }
  html[data-layout="desktop"] .pledge-desk { grid-template-columns: 1fr !important; gap: 12px; }
  html[data-layout="desktop"] .pledge-side { position: static !important; }
  html[data-layout="desktop"] .user-meta { display: none; }
  html[data-layout="desktop"] .nav-link {
    min-height: 44px; padding: 11px 12px; font-size: 14.5px;
  }

  /* Topbar: hamburger + search share a row; tools wrap below */
  .search-box { max-width: none; min-width: 0; flex: 1 1 140px; }
  .search-kbd { display: none; }
  .search-box input {
    padding-right: 14px; min-height: 44px; font-size: 16px !important;
  }
  .search-panel {
    position: fixed; left: 10px; right: 10px;
    top: max(58px, calc(env(safe-area-inset-top, 0px) + 52px));
    z-index: 70;
    max-height: min(70dvh, 480px);
    border-radius: 18px;
  }
  .search-type-chips { gap: 8px; padding: 10px; }
  .search-chip { min-height: 36px; padding: 6px 12px; font-size: 12px; }
  .search-hit { padding: 12px 14px; min-height: 48px; }
  .search-panel-foot kbd { display: none; }
  .topbar-tools {
    flex-wrap: wrap; margin-left: 0; width: 100%;
    justify-content: flex-start; align-items: center; gap: 8px;
  }
  .topbar-tools > a.btn-amber {
    flex: 1 1 100%; order: -1; min-height: 44px; justify-content: center;
  }
  .topbar-tools .btn-icon { min-width: 44px; min-height: 44px; justify-content: center; }
  .topbar-tools .user-pill { padding: 4px; }
  .branch-switch { flex: 1 1 140px; min-width: 0; }
  .branch-switch .form-select {
    min-width: 0 !important; max-width: none; width: 100%; min-height: 44px;
  }
  #localeForm .form-select { min-height: 44px; max-width: 42vw; }

  /* Login / auth — form first, marketing below */
  body.auth-page { min-height: 100dvh; }
  .auth-stage { padding: 12px; padding-bottom: max(12px, env(safe-area-inset-bottom, 0px)); }
  .auth-shell {
    grid-template-columns: 1fr;
    border-radius: 20px;
    width: 100%;
  }
  .auth-copy { order: 2; padding: 18px 16px 22px; }
  .auth-copy h1 { font-size: 1.45rem; line-height: 1.2; }
  .auth-copy .d-flex.flex-wrap.gap-2 { flex-direction: column; }
  .auth-copy .btn-amber, .auth-copy .btn-ghost {
    width: 100%; justify-content: center; min-height: 44px;
  }
  .auth-card { order: 1; padding: 20px 16px 22px; }
  .auth-card .form-control { font-size: 16px; min-height: 46px; }
  .auth-card .btn-amber { min-height: 48px; }
  .role-pill { min-height: 40px; padding: .55rem 1rem; }
  .auth-card form.d-flex { gap: 8px; }
  .auth-card form.d-flex .btn-ghost {
    flex: 1 1 calc(50% - 8px); justify-content: center; min-height: 44px;
  }

  /* Pledge desk */
  .pledge-hero { padding: 16px; border-radius: 18px; gap: 12px; }
  .pledge-hero h2 { font-size: 1.4rem; }
  .pledge-hero-actions { width: 100%; }
  .pledge-hero-actions .ph-btn { flex: 1 1 auto; justify-content: center; min-height: 44px; }
  .pledge-steps {
    display: flex; grid-template-columns: none;
    gap: 8px; overflow-x: auto; padding-bottom: 4px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .pledge-steps::-webkit-scrollbar { display: none; }
  .pledge-steps .pstep {
    flex: 0 0 min(78vw, 240px); scroll-snap-align: start;
  }
  .ppanel { padding: 14px; border-radius: 16px; }
  .ppanel-head { gap: 10px; }
  .ppanel-head .ph-btn { margin-left: 0; width: 100%; justify-content: center; }
  .pledge-search input { font-size: 16px !important; min-height: 48px; }
  .fld-money { grid-column: 1 / -1; min-width: 0; }
  .fld-money input { min-width: 0; font-size: 1.25rem !important; }
  .jewel-row { grid-template-columns: 1fr 1fr; }
  .jewel-card-top { grid-column: 1 / -1; }
  .cust-hits { flex-direction: column; }
  .cust-pick { width: 100%; }
  .photo-btns .ph-upload { min-height: 40px; }
  .pledge-kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
  .india-rate-grid { grid-template-columns: 1fr 1fr; }
  .pledge-done-actions .btn-amber, .pledge-done-actions .btn-ghost {
    flex: 1 1 calc(50% - 8px); justify-content: center;
  }
  .pledge-modal { padding: 12px; align-items: end; }
  .pledge-modal-card { width: 100%; border-radius: 20px 20px 12px 12px; }

  /* Collect + forms */
  .form-grid { grid-template-columns: 1fr; }
  .section-head { flex-wrap: wrap; gap: 10px; }
  .page-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .page-head h1, .page-head h2, .page-title { font-size: 1.35rem; }
  .row-actions { flex-wrap: wrap; }
  .loan-show-head { flex-wrap: wrap; }
  .btn-amber, .btn-gold, .btn.btn-gold, .btn-ghost, .btn.btn-ghost {
    min-height: 44px;
  }
  label.fld input, label.fld select, label.fld textarea,
  .form-control, .form-select {
    font-size: 16px !important; min-height: 44px;
  }

  /* Sticky save bars — thumb reach, above home indicator */
  .sticky-actions, .pledge-sticky {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 10px 12px max(12px, env(safe-area-inset-bottom, 0px));
    border-radius: 16px 16px 0 0;
    margin-left: -12px; margin-right: -12px; margin-bottom: 0;
  }
  .sticky-actions .pledge-sticky-note { grid-column: 1 / -1; }
  .sticky-actions .btn-save-glow,
  .sticky-actions > .btn-amber { grid-column: 1 / -1; }
  .sticky-actions .btn-amber,
  .sticky-actions .btn-gold,
  .sticky-actions .ph-btn,
  .sticky-actions .btn-ghost {
    width: 100%; justify-content: center; min-height: 46px;
  }
  .ai-dock { right: 12px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .ai-fab { width: 48px; height: 48px; font-size: 1.2rem; }

  /* Tables — swipe, sticky first col, no page overflow */
  .table-wrap {
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
    margin-inline: -12px;
    max-width: calc(100% + 24px);
    border-radius: 0;
    border-left: 0; border-right: 0;
  }
  table.data { font-size: 13px; }
  table.data th, table.data td { padding: 10px; }
  table.data thead th:first-child {
    position: sticky; left: 0; top: 0; z-index: 3;
  }
  table.data tbody td:first-child {
    position: sticky; left: 0; z-index: 1; background: var(--panel);
  }
  .btn-act { min-height: 36px; padding: 6px 10px; }

  /* Filters / tabs / toolbars */
  .multi-filter-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
  .mf-actions { display: flex; gap: 8px; }
  .mf-actions .btn-amber, .mf-actions .btn-ghost {
    flex: 1; justify-content: center;
  }
  .data-toolbar-form { flex-direction: column; align-items: stretch; }
  .data-toolbar-search { min-width: 0; width: 100%; }
  .data-toolbar-actions {
    display: flex; flex-wrap: wrap; gap: 6px; width: 100%;
  }
  .data-toolbar-actions .btn-ghost,
  .data-toolbar-actions .btn-sm {
    flex: 1 1 calc(50% - 6px); justify-content: center; min-height: 40px;
  }
  .page-tabs {
    width: 100%; max-width: 100%;
    flex-wrap: nowrap; overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .page-tabs::-webkit-scrollbar { display: none; }
  .page-tabs a, .page-tabs .page-tab {
    flex-shrink: 0; min-height: 40px; white-space: nowrap;
  }
  .rpt-filters, .rpt-toolbar {
    display: grid; grid-template-columns: 1fr; gap: 10px;
  }
  .rpt-toolbar-actions { display: flex; gap: 8px; }
  .rpt-toolbar-actions .btn, .rpt-filter-actions .btn {
    flex: 1; justify-content: center; min-height: 44px;
  }
  .rpt-filter-actions { display: flex; gap: 8px; }

  /* Cards */
  .cards, .kpi-grid, .dash-kpi-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi, .dash-kpi { padding: 12px; min-height: 0; }
  .kpi .val, .dash-kpi .val { font-size: 1.05rem; }
  .dash-module-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .loan-grid { grid-template-columns: 1fr; }
  .loan-show-grid, .cust-photo-box, .packet-zone { grid-template-columns: 1fr; }
  .rpt-cat { padding: 14px; border-radius: 16px; }
  .rpt-cat-boxes { grid-template-columns: 1fr; }
  .cf-edit-grid { grid-template-columns: 1fr; }
  .rp-save-bar {
    flex-direction: column;
    padding: 12px 12px max(12px, env(safe-area-inset-bottom, 0px));
  }
  .rp-save-bar .btn-amber, .rp-save-bar .btn-ghost { width: 100%; justify-content: center; }

  /* Loan Dossier Mobile */
  .loan-hero { padding: 16px; border-radius: 18px; }
  .loan-hero-left { flex-direction: column; align-items: center; text-align: center; }
  .loan-hero-title { justify-content: center; }
  .loan-hero-chips { justify-content: center; }
  .loan-hero-actions { width: 100%; justify-content: center; }
  .dossier-cust-hero { grid-template-columns: 1fr; justify-items: center; }
  .dossier-photo-xl { max-width: 100%; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-grid > div.span-2 { grid-column: span 1; }
  .jewel-gallery { grid-template-columns: 1fr; }
  .jewel-stats { grid-template-columns: 1fr; }
}
