/* ============================================================================
   RevNet for Business — portal shell + components (shared by all portal pages)
   Load AFTER styles.css (which provides the Inter font, reset and .btn).
   UI only: this is a front-end prototype, not wired to a backend yet.
   ========================================================================== */

:root{
  --d-bg:#f7f7f6; --d-card:#ffffff; --d-border:#e8e8e7; --d-hair:#f0f0ef;
  --d-ink:#14151a; --d-sub:#6b6f76; --d-muted:#6b6f76;
  --d-brand:#cc2b2b; --d-brand-tint:rgba(204,43,43,.08);
  /* data-viz palette (validated) */
  --series:#2a78d6; --series-fill:rgba(42,120,214,.14);
  --ord1:#86b6ef; --ord2:#5598e7; --ord3:#2a78d6; --ord4:#1c5cab;
  --good:#0ca30c; --good-ink:#0a7c0a; --bad:#d03b3b;
  --grid:#eeeeed; --axis:#d7d7d3; --tick:#969aa1;
  --d-radius:16px;
}
body{ background:var(--d-bg); color:var(--d-ink); }
.d-app{ display:grid; grid-template-columns:248px 1fr; min-height:100vh; }
/* sidebar */
.d-side{ background:#fff; border-right:1px solid var(--d-border); padding:20px 16px; position:sticky; top:0; height:100vh; display:flex; flex-direction:column; gap:6px; }
.d-side .d-logo{ display:flex; align-items:center; gap:10px; padding:6px 10px 16px; }
.d-side .d-logo img{ height:22px; }
.d-side .d-logo span{ font-weight:700; font-size:13px; color:var(--d-sub); border-left:1px solid var(--d-border); padding-left:10px; }
.d-nav-label{ font-size:11px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--d-muted); padding:14px 10px 6px; }
.d-nav a{ display:flex; align-items:center; gap:11px; padding:9px 11px; border-radius:10px; color:var(--d-sub); font-size:14px; font-weight:550; transition:background .15s,color .15s; }
.d-nav a svg{ width:18px; height:18px; flex:0 0 auto; }
.d-nav a:hover{ background:#f4f4f3; color:var(--d-ink); }
.d-nav a.active{ background:var(--d-brand-tint); color:var(--d-brand); font-weight:650; }
.d-nav a .d-count{ margin-left:auto; font-size:11px; font-weight:700; background:var(--d-brand); color:#fff; border-radius:999px; padding:1px 7px; }
.d-side .d-upgrade{ margin-top:auto; border:1px solid var(--d-border); border-radius:14px; padding:14px; background:#fbfbfa; }
.d-side .d-upgrade b{ font-size:13.5px; } .d-side .d-upgrade p{ margin:4px 0 10px; font-size:12px; color:var(--d-sub); }
.d-switch-label{ font-size:10.5px; font-weight:700; letter-spacing:.07em; text-transform:uppercase; color:var(--d-muted); margin-bottom:6px; }
.d-switcher{ width:100%; margin-bottom:10px; padding:8px 10px; border:1px solid var(--d-border); border-radius:9px; background:#fff; font:inherit; font-size:13px; font-weight:600; color:var(--d-ink); cursor:pointer; }
.d-switcher:focus{ outline:none; border-color:var(--d-brand); box-shadow:0 0 0 3px var(--d-brand-tint); }
.d-signout{ display:flex; align-items:center; gap:9px; padding:9px 11px; border-radius:10px; color:var(--d-sub); font-size:13.5px; font-weight:550; margin-top:4px; }
.d-signout:hover{ background:#f4f4f3; color:var(--d-ink); }
.d-signout svg{ width:17px; height:17px; }
/* main */
.d-main{ min-width:0; }
.d-top{ position:sticky; top:0; z-index:20; background:rgba(255,255,255,.85); backdrop-filter:blur(10px); border-bottom:1px solid var(--d-border); display:flex; align-items:center; gap:16px; padding:14px 26px; }
.d-top h1{ font-family:'Inter Tight'; font-size:20px; font-weight:700; letter-spacing:-0.02em; }
.d-top .d-crumb{ font-size:12.5px; color:var(--d-muted); }
.d-top .d-right{ margin-left:auto; display:flex; align-items:center; gap:12px; }
.d-range{ display:inline-flex; border:1px solid var(--d-border); border-radius:10px; overflow:hidden; background:#fff; }
.d-range button{ border:0; background:#fff; padding:8px 13px; font:inherit; font-size:13px; color:var(--d-sub); cursor:pointer; border-left:1px solid var(--d-border); }
.d-range button:first-child{ border-left:0; }
.d-range button.on{ background:var(--d-ink); color:#fff; }
.d-avatar{ width:34px; height:34px; border-radius:999px; background:linear-gradient(135deg,#cc2b2b,#8f1f1f); color:#fff; display:grid; place-items:center; font-size:13px; font-weight:700; text-decoration:none; cursor:pointer; }
a.d-avatar:hover{ box-shadow:0 0 0 3px rgba(204,43,43,.18); }
/* mobile nav chrome (hidden on desktop) */
.d-menu-btn{ display:none; width:40px; height:40px; border:1px solid var(--d-border); border-radius:11px; background:#fff; align-items:center; justify-content:center; cursor:pointer; color:var(--d-ink); flex:0 0 auto; }
.d-menu-btn svg{ width:21px; height:21px; }
.d-nav-backdrop{ display:none; position:fixed; inset:0; background:rgba(0,0,0,.45); z-index:45; }
/* "no data yet" hint */
.d-nodata{ display:flex; align-items:flex-start; gap:11px; background:#f5f8ff; border:1px solid #d8e3fb; color:#2b4a86; border-radius:13px; padding:13px 15px; font-size:13.5px; line-height:1.5; margin-bottom:18px; }
.d-nodata svg{ width:18px; height:18px; flex:0 0 auto; margin-top:1px; }
.d-content{ padding:26px; max-width:1200px; }
.d-hello{ margin-bottom:20px; }
.d-hello h2{ font-family:'Inter Tight'; font-size:23px; font-weight:700; letter-spacing:-0.025em; }
.d-hello p{ color:var(--d-sub); font-size:14px; margin-top:4px; }
/* KPI tiles */
.d-kpis{ display:grid; grid-template-columns:repeat(5,1fr); gap:14px; }
.d-kpis.four{ grid-template-columns:repeat(4,1fr); }
.d-kpis.three{ grid-template-columns:repeat(3,1fr); }
.d-tile{ background:var(--d-card); border:1px solid var(--d-border); border-radius:var(--d-radius); padding:18px; }
.d-tile .k-label{ font-size:12.5px; color:var(--d-sub); display:flex; align-items:center; gap:7px; }
.d-tile .k-label .k-ico{ width:26px; height:26px; border-radius:8px; background:var(--d-brand-tint); color:var(--d-brand); display:grid; place-items:center; }
.d-tile .k-label .k-ico svg{ width:15px; height:15px; }
.d-tile .k-val{ font-family:'Inter Tight'; font-size:28px; font-weight:800; letter-spacing:-0.03em; margin-top:12px; }
.d-delta{ display:inline-flex; align-items:center; gap:4px; font-size:12px; font-weight:650; margin-top:8px; padding:2px 8px; border-radius:999px; }
.d-delta svg{ width:12px; height:12px; }
.d-delta.up, .d-delta.down-good{ background:rgba(12,163,12,.10); color:var(--good-ink); }
.d-delta.flat{ background:#f1f1f0; color:var(--d-sub); }
/* panels + grids */
.d-grid{ display:grid; gap:16px; margin-top:16px; }
.d-cols-2{ grid-template-columns:1.6fr 1fr; }
.d-cols-3{ grid-template-columns:1fr 1fr 1fr; }
.d-cols-even{ grid-template-columns:1fr 1fr; }
.d-panel{ background:var(--d-card); border:1px solid var(--d-border); border-radius:var(--d-radius); padding:20px; }
.d-panel .p-head{ display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:6px; }
.d-panel h3{ font-size:15px; font-weight:700; letter-spacing:-0.01em; }
.d-panel .p-sub{ font-size:12.5px; color:var(--d-sub); margin-top:2px; }
.d-legend{ display:flex; gap:14px; font-size:12px; color:var(--d-sub); }
.d-legend i{ width:9px; height:9px; border-radius:3px; display:inline-block; margin-right:6px; vertical-align:middle; }
svg .grid-line{ stroke:var(--grid); stroke-width:1; }
svg .axis-txt{ fill:var(--tick); font-size:11px; font-family:Inter,sans-serif; }
svg .val-txt{ fill:var(--d-sub); font-size:11px; font-weight:600; font-family:Inter,sans-serif; }
/* horizontal bars */
.d-hbars{ display:grid; gap:14px; margin-top:6px; }
.d-hbar .hb-top{ display:flex; justify-content:space-between; font-size:13px; margin-bottom:6px; }
.d-hbar .hb-top .hb-name{ color:var(--d-ink); font-weight:550; }
.d-hbar .hb-top .hb-val{ color:var(--d-sub); font-variant-numeric:tabular-nums; }
.d-hbar .hb-track{ height:9px; border-radius:999px; background:#f0f0ef; overflow:hidden; }
.d-hbar .hb-fill{ height:100%; border-radius:999px; }
/* funnel */
.d-funnel{ display:grid; gap:10px; margin-top:4px; }
.d-frow{ display:flex; align-items:center; gap:12px; }
.d-frow .f-name{ width:96px; font-size:13px; color:var(--d-sub); flex:0 0 auto; }
.d-frow .f-track{ flex:1; height:30px; background:#f5f5f4; border-radius:8px; overflow:hidden; }
.d-frow .f-fill{ height:100%; border-radius:8px; display:flex; align-items:center; padding-left:12px; color:#fff; font-size:12.5px; font-weight:650; }
.d-frow .f-num{ width:44px; text-align:right; font-size:13px; font-weight:700; font-variant-numeric:tabular-nums; }
/* reply tile */
.d-reply .r-big{ font-family:'Inter Tight'; font-size:40px; font-weight:800; letter-spacing:-0.03em; }
.d-reply .r-note{ font-size:12.5px; color:var(--d-sub); margin-top:4px; }
.d-spark{ margin-top:14px; }
.d-fastpill{ display:inline-flex; align-items:center; gap:6px; font-size:12px; font-weight:650; color:var(--good-ink); background:rgba(12,163,12,.10); padding:4px 10px; border-radius:999px; margin-top:12px; }
.d-fastpill svg{ width:12px; height:12px; }
/* rating */
.d-rate-top{ display:flex; align-items:center; gap:16px; }
.d-rate-big{ font-family:'Inter Tight'; font-size:44px; font-weight:800; letter-spacing:-0.03em; line-height:1; }
.d-stars{ color:#f5a623; font-size:15px; letter-spacing:1px; }
.d-rate-rows{ display:grid; gap:7px; margin-top:14px; }
.d-rrow{ display:flex; align-items:center; gap:10px; font-size:12.5px; }
.d-rrow .rr-k{ width:30px; color:var(--d-sub); }
.d-rrow .rr-track{ flex:1; height:7px; background:#f0f0ef; border-radius:999px; overflow:hidden; }
.d-rrow .rr-fill{ height:100%; background:#f5a623; border-radius:999px; }
.d-rrow .rr-n{ width:22px; text-align:right; color:var(--d-sub); font-variant-numeric:tabular-nums; }
/* table */
.d-tablewrap{ overflow-x:auto; }
table.d-table{ width:100%; border-collapse:collapse; font-size:13.5px; min-width:640px; }
.d-table th{ text-align:left; font-size:11.5px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; color:var(--d-muted); padding:0 14px 12px; border-bottom:1px solid var(--d-border); }
.d-table td{ padding:13px 14px; border-bottom:1px solid var(--d-hair); vertical-align:middle; }
.d-table tr:last-child td{ border-bottom:0; }
.d-table tbody tr{ cursor:pointer; }
.d-table tbody tr:hover{ background:#fafafa; }
.d-cust{ display:flex; align-items:center; gap:10px; }
.d-cust .c-av{ width:30px; height:30px; border-radius:999px; background:#ececeb; display:grid; place-items:center; font-size:11px; font-weight:700; color:var(--d-sub); flex:0 0 auto; }
.d-cust .c-veh{ font-size:12px; color:var(--d-muted); }
.d-pill{ display:inline-flex; align-items:center; gap:6px; font-size:11.5px; font-weight:650; padding:4px 10px; border-radius:999px; }
.d-pill .p-dot{ width:6px; height:6px; border-radius:999px; background:currentColor; }
.d-pill.new{ background:rgba(42,120,214,.10); color:#1c5cab; }
.d-pill.read{ background:#f1f1f0; color:var(--d-sub); }
.d-pill.resp{ background:rgba(12,163,12,.10); color:var(--good-ink); }
.d-pill.closed{ background:#efeeed; color:#8a8f96; }
.d-reply-in{ color:var(--d-sub); font-variant-numeric:tabular-nums; }
.d-when{ color:var(--d-muted); font-size:12.5px; }
/* reviews */
.d-review{ border:1px solid var(--d-border); border-radius:14px; padding:16px; }
.d-review .rv-head{ display:flex; align-items:center; gap:10px; }
.d-review .rv-head .c-av{ width:34px; height:34px; border-radius:999px; background:#ececeb; display:grid; place-items:center; font-size:12px; font-weight:700; color:var(--d-sub); }
.d-review .rv-name{ font-weight:650; font-size:13.5px; } .d-review .rv-meta{ font-size:12px; color:var(--d-muted); }
.d-review p.rv-body{ font-size:13.5px; color:#33363c; margin:12px 0 0; line-height:1.55; }
.d-review .rv-reply{ margin-top:12px; background:#f7f7f6; border-radius:10px; padding:11px 13px; font-size:12.5px; color:var(--d-sub); }
.d-review .rv-reply b{ color:var(--d-ink); }
.d-backbar{ display:flex; align-items:center; gap:8px; font-size:13px; color:var(--d-sub); padding:10px 26px; background:#fff; border-bottom:1px solid var(--d-border); }
.d-backbar a{ color:var(--d-brand); font-weight:600; }

/* ---- enquiries inbox (two-pane) ---- */
.d-enq{ display:grid; grid-template-columns:360px 1fr; gap:16px; margin-top:16px; align-items:start; }
.d-enq-list{ background:var(--d-card); border:1px solid var(--d-border); border-radius:var(--d-radius); overflow:hidden; }
.d-enq-row{ display:flex; gap:11px; padding:14px 16px; border-bottom:1px solid var(--d-hair); cursor:pointer; }
.d-enq-row:last-child{ border-bottom:0; }
.d-enq-row:hover{ background:#fafafa; }
.d-enq-row.on{ background:var(--d-brand-tint); }
.d-enq-row .c-av{ width:36px; height:36px; border-radius:999px; background:#ececeb; display:grid; place-items:center; font-size:12px; font-weight:700; color:var(--d-sub); flex:0 0 auto; }
.d-enq-row .er-main{ min-width:0; flex:1; }
.d-enq-row .er-top{ display:flex; align-items:center; gap:8px; }
.d-enq-row .er-name{ font-weight:650; font-size:13.5px; }
.d-enq-row .er-time{ margin-left:auto; font-size:11.5px; color:var(--d-muted); flex:0 0 auto; }
.d-enq-row .er-msg{ font-size:12.5px; color:var(--d-sub); margin-top:3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.d-enq-row .er-veh{ font-size:11.5px; color:var(--d-muted); margin-top:3px; }
.d-enq-row .unread{ width:8px; height:8px; border-radius:999px; background:var(--series); flex:0 0 auto; align-self:center; }
.d-enq-detail{ background:var(--d-card); border:1px solid var(--d-border); border-radius:var(--d-radius); padding:22px; }
.d-vehcard{ display:flex; gap:12px; align-items:center; border:1px solid var(--d-border); border-radius:12px; padding:12px 14px; background:#fbfbfb; margin:14px 0; }
.d-vehcard .vc-ico{ width:40px; height:40px; border-radius:10px; background:var(--d-brand-tint); color:var(--d-brand); display:grid; place-items:center; flex:0 0 auto; }
.d-vehcard .vc-ico svg{ width:22px; height:22px; }
.d-vehcard .vc-name{ font-weight:650; font-size:14px; }
.d-vehcard .vc-spec{ font-size:12px; color:var(--d-sub); margin-top:2px; }
.d-msgbubble{ background:#f5f5f4; border-radius:12px; padding:14px 15px; font-size:14px; color:#2c2f35; line-height:1.55; }
.d-replybox{ margin-top:16px; }
.d-replybox textarea{ width:100%; min-height:96px; border:1px solid var(--d-border); border-radius:12px; padding:12px 14px; font:inherit; font-size:14px; resize:vertical; background:#fff; color:var(--d-ink); }
.d-replybox textarea:focus{ outline:none; border-color:#cfcfcf; box-shadow:0 0 0 3px rgba(0,0,0,.04); }
.d-replybar{ display:flex; align-items:center; gap:10px; margin-top:10px; }
.d-replybar .hint{ font-size:12px; color:var(--d-muted); }

/* ---- forms (settings / listing) ---- */
.d-form{ display:grid; gap:18px; max-width:640px; }
.d-field label{ display:block; font-size:13px; font-weight:650; margin-bottom:7px; }
.d-field .hint{ font-size:12px; color:var(--d-muted); margin-top:6px; }
.d-input, .d-textarea, .d-select{ width:100%; border:1px solid var(--d-border); border-radius:11px; padding:11px 13px; font:inherit; font-size:14px; background:#fff; color:var(--d-ink); }
.d-textarea{ min-height:88px; resize:vertical; }
.d-input:focus, .d-textarea:focus, .d-select:focus{ outline:none; border-color:#cfcfcf; box-shadow:0 0 0 3px rgba(0,0,0,.04); }
.d-two{ display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.d-chipset{ display:flex; flex-wrap:wrap; gap:8px; }
.d-chip{ font-size:12.5px; font-weight:600; padding:7px 12px; border-radius:999px; border:1px solid var(--d-border); background:#fff; color:var(--d-sub); cursor:pointer; }
.d-chip.on{ background:var(--d-brand-tint); border-color:transparent; color:var(--d-brand); }
.d-photos{ display:grid; grid-template-columns:repeat(4,1fr); gap:10px; }
.d-photo{ aspect-ratio:4/3; border-radius:12px; background:#eceff2; border:1px solid var(--d-border); display:grid; place-items:center; color:var(--d-muted); }
.d-photo.add{ border-style:dashed; cursor:pointer; }

@media (max-width:1080px){ .d-kpis, .d-kpis.four, .d-kpis.three{ grid-template-columns:repeat(2,1fr); } .d-cols-2,.d-cols-3,.d-cols-even{ grid-template-columns:1fr; } .d-enq{ grid-template-columns:1fr; } }
@media (max-width:820px){
  .d-app{ grid-template-columns:1fr; }
  /* sidebar becomes an off-canvas drawer instead of vanishing */
  .d-side{ position:fixed; top:0; left:0; height:100dvh; width:min(286px,85vw); z-index:50; transform:translateX(-100%); transition:transform .25s ease; box-shadow:0 24px 60px rgba(0,0,0,.28); overflow-y:auto; }
  .d-app.nav-open .d-side{ transform:none; }
  .d-app.nav-open .d-nav-backdrop{ display:block; }
  .d-menu-btn{ display:inline-flex; }
  .d-photos{ grid-template-columns:repeat(3,1fr); }
  .d-top{ padding:12px 15px; gap:10px 12px; flex-wrap:wrap; }
  .d-top .d-range{ margin-left:0; }
  .d-content{ padding:18px 15px; }
  .d-top h1{ font-size:18px; }
}
@media (max-width:520px){
  .d-kpis, .d-kpis.four, .d-kpis.three{ grid-template-columns:1fr; }
  .d-two{ grid-template-columns:1fr; }
  .d-top .d-crumb{ display:none; }
  .d-content{ padding:16px 13px; }
  .d-hello h2{ font-size:20px; }
  .d-range button{ padding:8px 11px; }
}

/* standalone bar-label rows (used outside .d-hbar, e.g. listing status) */
.hb-top{ display:flex; justify-content:space-between; align-items:center; gap:8px; font-size:13px; margin-bottom:6px; }
.hb-name{ color:var(--d-ink); font-weight:550; }
.hb-val{ color:var(--d-sub); font-variant-numeric:tabular-nums; }
