/* RE Network — PSP Dashboard (Freeio-ish static mock). Client-side only. */
:root {
  --navy: #0b1f3a;
  --ink: #1a1d1f;
  --muted: #6b7280;
  --border: #e5e7eb;
  --card-border: #e8e6e1;
  --bg: #f3f4f6;
  --sidebar-bg: #f7f7f8;
  --white: #fff;
  --primary: #377DFF;
  --pill-active: #1a1d1f;
  --blue-soft: #e8f0fe;
  --blue-text: #1d4ed8;
  --tan: #f5e6c8;
  --tan-text: #92400e;
  --green-soft: #dcfce7;
  --green-text: #166534;
  --gray-pill: #f3f4f6;
  --serif: Georgia, "Times New Roman", Times, serif;
  --sans: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; min-height: 100%; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

/* ===== TOP HEADER ===== */
.topbar {
  position: sticky; top: 0; z-index: 60;
  height: 72px; background: var(--white);
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: minmax(200px, 260px) 1fr auto;
  align-items: center;
  padding: 0 20px; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand .mark {
  width: 40px; height: 40px; border-radius: 10px; background: var(--navy);
  display: grid; place-items: center; flex-shrink: 0;
}
.brand .mark svg { width: 20px; height: 20px; fill: #fff; }
.brand .name { font-family: var(--serif); font-size: 18px; font-weight: 700; line-height: 1.1; }
.brand .sub { font-size: 10px; color: var(--muted); margin-top: 2px; white-space: nowrap; }
.top-nav { display: flex; align-items: center; justify-content: center; gap: 4px; flex-wrap: wrap; }
.top-nav a, .top-nav span.linkish {
  font-size: 13px; font-weight: 600; color: #374151;
  padding: 8px 10px; border-radius: 8px; white-space: nowrap;
}
.top-nav a:hover { background: #f3f4f6; }
.top-nav a.active { color: var(--primary); }
.top-utils { display: flex; align-items: center; gap: 6px; }
.top-utils a, .top-utils button {
  width: 34px; height: 34px; border-radius: 8px; border: none; background: transparent;
  display: grid; place-items: center; color: #4b5563; cursor: pointer;
}
.top-utils a:hover, .top-utils button:hover { background: #f3f4f6; }
.top-utils svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.6; }
.top-utils .avatar {
  width: 32px; height: 32px; border-radius: 999px; object-fit: cover; margin-left: 4px;
  border: 1px solid var(--border);
}
.badge-dot {
  position: absolute; top: 4px; right: 4px; width: 8px; height: 8px;
  background: #ef4444; border-radius: 999px; border: 2px solid #fff;
}
.icon-wrap { position: relative; }

/* ===== SHELL ===== */
.shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(100vh - 72px);
  max-width: none;
  margin: 0;
  width: 100%;
}
.sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  padding: 12px 8px 24px;
  position: sticky; top: 72px; height: calc(100vh - 72px);
  overflow-y: auto;
}
.psp-card {
  display: grid; grid-template-columns: 48px 1fr auto; gap: 10px; align-items: center;
  padding: 10px 8px 16px; margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.psp-card img {
  width: 48px; height: 48px; border-radius: 999px; object-fit: cover;
}
.psp-card .lbl { font-size: 13px; font-weight: 700; }
.psp-card .bal { font-size: 12px; color: var(--muted); margin-top: 2px; }
.psp-card .view { font-size: 12px; color: var(--primary); font-weight: 600; margin-top: 2px; display: inline-block; }
.psp-card .collapse {
  width: 28px; height: 28px; border: 1px solid var(--border); border-radius: 8px;
  background: #fff; display: grid; place-items: center; color: #6b7280; cursor: pointer;
}
.psp-card .collapse svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.8; }

.side-nav { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.side-nav a {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 550; color: #374151;
}
.side-nav a svg {
  width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.7; flex-shrink: 0;
}
.side-nav a:hover { background: #eeeef0; }
.side-nav a.active {
  background: var(--pill-active); color: #fff;
}
.side-section {
  margin: 16px 8px 6px;
  font-size: 11px; font-weight: 700; letter-spacing: .06em;
  color: #9ca3af; text-transform: uppercase;
}

.main { padding: 24px 24px 48px; min-width: 0; }
.page-head { margin-bottom: 22px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 {
  font-family: var(--serif); font-size: 34px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15;
}
.page-head .sub { color: var(--muted); font-size: 14px; margin-top: 6px; max-width: 560px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 10px; border: 1px solid transparent;
  font-size: 13px; font-weight: 650; cursor: pointer; background: var(--pill-active); color: #fff;
}
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--border); }
.btn.primary { background: var(--primary); }

.card {
  background: var(--white);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 1px 2px rgba(16,24,40,.03);
}
.card + .card { margin-top: 16px; }
.card h2 { font-size: 16px; font-weight: 700; }
.card .card-sub { font-size: 13px; color: var(--muted); margin-top: 4px; margin-bottom: 14px; }

.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px;
}
.stat {
  background: #fff; border: 1px solid var(--card-border); border-radius: 14px;
  padding: 18px 16px; display: flex; align-items: center; gap: 14px;
}
.stat .ico {
  width: 44px; height: 44px; border-radius: 12px; background: #f3f4f6;
  display: grid; place-items: center; color: #374151; flex-shrink: 0;
}
.stat .ico svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.stat .num { font-size: 26px; font-weight: 750; line-height: 1; }
.stat .lbl { font-size: 13px; color: var(--muted); margin-top: 4px; }

.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.notif-list { list-style: none; display: flex; flex-direction: column; gap: 0; }
.notif-list li {
  display: grid; grid-template-columns: 36px 1fr; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid #f0f0f0;
}
.notif-list li:last-child { border-bottom: none; padding-bottom: 0; }
.notif-list .av {
  width: 36px; height: 36px; border-radius: 999px; background: #e5e7eb;
  display: grid; place-items: center; font-size: 10px; font-weight: 700; color: #4b5563;
}
.notif-list .t { font-size: 13.5px; }
.notif-list .t strong { font-weight: 700; }
.notif-list .when { font-size: 12px; color: var(--muted); margin-top: 3px; }

.chart-box {
  height: 220px; margin-top: 8px; position: relative;
  background:
    linear-gradient(to top, transparent 0, transparent calc(100% - 1px), #eef0f3 calc(100% - 1px)),
    linear-gradient(to right, transparent 0, transparent calc(100% - 1px), #eef0f3 calc(100% - 1px));
  background-size: 100% 36px, 48px 100%;
  border-radius: 8px;
}
.chart-box svg { width: 100%; height: 100%; display: block; }

/* Fee rows / list rows */
.fee-row, .list-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 0; border-bottom: 1px solid #f0f0f0;
}
.fee-row:last-child, .list-row:last-child { border-bottom: none; padding-bottom: 0; }
.fee-row:first-child, .list-row:first-child { padding-top: 0; }
.fee-row .title, .list-row .title { font-size: 14px; font-weight: 700; }
.fee-row .meta, .list-row .meta { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.fee-row .right, .list-row .right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.fee-row .val { font-size: 20px; font-weight: 750; }

.pill {
  display: inline-flex; align-items: center;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 650; background: var(--gray-pill); color: #374151;
  white-space: nowrap;
}
.pill.blue { background: var(--blue-soft); color: var(--blue-text); }
.pill.dark { background: #374151; color: #fff; }
.pill.tan { background: var(--tan); color: var(--tan-text); }
.pill.green { background: var(--green-soft); color: var(--green-text); }
.pill.gray { background: #f3f4f6; color: #4b5563; }

.table-wrap { overflow-x: auto; }
table.data {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
table.data th {
  text-align: left; font-size: 11px; letter-spacing: .04em; text-transform: uppercase;
  color: #9ca3af; font-weight: 700; padding: 0 12px 12px 0; border-bottom: 1px solid var(--border);
}
table.data td {
  padding: 14px 12px 14px 0; border-bottom: 1px solid #f0f0f0; vertical-align: middle;
}
table.data tr:last-child td { border-bottom: none; }
table.data .ad-name { font-weight: 650; }

.mini-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 16px;
}
.mini-stat {
  background: #fff; border: 1px solid var(--card-border); border-radius: 14px;
  padding: 18px; text-align: center;
}
.mini-stat .n { font-size: 28px; font-weight: 750; }
.mini-stat .l { font-size: 13px; color: var(--muted); margin-top: 4px; }

.module-pills { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.module-pills .mp {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 999px; background: #f3f4f6; font-size: 13px; font-weight: 600;
}
.module-pills .mp b {
  background: #fff; border: 1px solid var(--border); border-radius: 999px;
  padding: 2px 8px; font-size: 12px;
}

.msg-list { list-style: none; }
.msg-list li {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center;
  padding: 14px 0; border-bottom: 1px solid #f0f0f0;
}
.msg-list li:last-child { border-bottom: none; }
.msg-list img { width: 44px; height: 44px; border-radius: 999px; object-fit: cover; }
.msg-list .who { font-weight: 700; font-size: 14px; }
.msg-list .preview { font-size: 13px; color: var(--muted); margin-top: 2px; }
.msg-list .when { font-size: 12px; color: var(--muted); }

.empty-hint { font-size: 13px; color: var(--muted); padding: 8px 0; }

.footer-note {
  margin-top: 24px; font-size: 12px; color: #9ca3af; text-align: center;
}

@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .mini-stats { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; top: 0; height: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .top-nav { display: none; }
  .main { padding: 20px 16px 40px; }
  .page-head h1 { font-size: 28px; }
}


/* Refined list rows with price + stats */
.svc-row { display:grid; grid-template-columns:1fr auto; gap:16px; align-items:start; padding:16px 0; border-bottom:1px solid #f0f0f0; }
.svc-row:first-child { padding-top:0; }
.svc-row:last-child { border-bottom:none; padding-bottom:0; }
.svc-row .title { font-size:14px; font-weight:700; }
.svc-row .meta { font-size:12.5px; color:var(--muted); margin-top:3px; }
.svc-row .stats { font-size:12px; color:#9ca3af; margin-top:4px; }
.svc-row .price { font-size:16px; font-weight:750; text-align:right; }
.svc-row .right { display:flex; flex-direction:column; align-items:flex-end; gap:6px; }
.card-foot { margin-top:14px; font-size:13px; font-weight:700; }
.card-foot a { color:var(--ink); }
.about-hero .name { font-size:20px; font-weight:750; }
.about-hero .role { color:var(--muted); font-size:13px; margin-top:2px; }
.about-hero .loc { font-size:13px; margin-top:10px; color:#374151; }
.about-hero .bio { font-size:14px; margin-top:14px; line-height:1.55; max-width:640px; }
.about-hero .spec-lbl { font-size:11px; font-weight:700; letter-spacing:.06em; color:#9ca3af; margin-top:18px; }
.about-hero .specs { display:flex; flex-wrap:wrap; gap:8px; margin-top:8px; }
.about-hero .reply { font-size:13px; color:var(--muted); margin-top:14px; }
.about-hero .joined { font-size:12px; color:#9ca3af; margin-top:18px; padding-top:14px; border-top:1px solid #f0f0f0; }
.msg-layout { display:grid; grid-template-columns:340px 1fr; gap:16px; min-height:520px; }
.msg-pane, .chat-pane { background:#fff; border:1px solid var(--card-border); border-radius:14px; display:flex; flex-direction:column; min-height:520px; }
.msg-pane-head { padding:18px 18px 10px; }
.msg-pane-head h2 { font-size:22px; font-weight:750; }
.msg-pane-head .sub { font-size:12px; color:var(--muted); margin-top:2px; }
.msg-tabs { display:flex; flex-wrap:wrap; gap:8px; padding:0 16px 12px; }
.msg-tabs button { border:none; background:#f3f4f6; color:#374151; padding:7px 12px; border-radius:999px; font-size:12px; font-weight:650; cursor:pointer; }
.msg-tabs button.on { background:var(--pill-active); color:#fff; }
.msg-search { margin:0 16px 12px; display:flex; align-items:center; gap:8px; background:#f3f4f6; border-radius:999px; padding:8px 12px; }
.msg-search input { border:none; background:transparent; outline:none; width:100%; font-size:13px; }
.conv { list-style:none; overflow-y:auto; flex:1; }
.conv li { display:grid; grid-template-columns:44px 1fr auto; gap:10px; padding:12px 16px; cursor:default; border-bottom:1px solid #f5f5f5; }
.conv li.on { background:#eef4ff; }
.conv img { width:44px; height:44px; border-radius:999px; object-fit:cover; }
.conv .who { font-weight:700; font-size:13.5px; }
.conv .prev { font-size:12.5px; color:var(--muted); margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:180px; }
.conv .when { font-size:11px; color:var(--muted); }
.conv .badge { display:inline-grid; place-items:center; min-width:20px; height:20px; padding:0 6px; border-radius:999px; background:var(--pill-active); color:#fff; font-size:11px; font-weight:700; margin-top:4px; }
.chat-head { display:flex; align-items:center; justify-content:space-between; padding:14px 18px; border-bottom:1px solid var(--border); }
.chat-head .left { display:flex; align-items:center; gap:10px; }
.chat-head img { width:40px; height:40px; border-radius:999px; object-fit:cover; }
.chat-head .nm { font-weight:700; }
.chat-head .st { font-size:12px; color:#16a34a; }
.chat-body { flex:1; padding:18px; display:flex; flex-direction:column; gap:14px; background:#fafafa; }
.bubble { max-width:75%; padding:12px 14px; border-radius:16px; font-size:14px; line-height:1.45; }
.bubble.out { align-self:flex-end; background:var(--pill-active); color:#fff; border-bottom-right-radius:6px; }
.bubble.in { align-self:flex-start; background:#fff; border:1px solid var(--border); border-bottom-left-radius:6px; }
.bubble .meta { font-size:11px; opacity:.75; margin-top:6px; }
.chat-input { display:flex; align-items:center; gap:10px; padding:12px 14px; border-top:1px solid var(--border); background:#fff; border-radius:0 0 14px 14px; }
.chat-input input { flex:1; border:none; background:#f3f4f6; border-radius:999px; padding:10px 14px; outline:none; font-size:13px; }
.chat-input .send { width:40px; height:40px; border-radius:999px; border:none; background:var(--pill-active); color:#fff; font-size:16px; cursor:pointer; }
.bal-line { font-size:13px; color:var(--muted); margin-bottom:8px; }
@media (max-width: 900px) { .msg-layout { grid-template-columns:1fr; } }

/* ===== Sidebar folds + collapse (v3) — packed left, whole row toggles ===== */
.sidebar-reopen {
  display: none;
  position: fixed;
  left: 10px;
  top: 82px;
  z-index: 80;
  width: 36px; height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: #374151;
  cursor: pointer;
  place-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.sidebar-reopen svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; }
body.sidebar-collapsed .sidebar-reopen { display: grid; }
body.sidebar-collapsed .shell { grid-template-columns: 0 1fr; }
body.sidebar-collapsed .sidebar {
  position: fixed; left: 0; top: 72px;
  width: 0; min-width: 0; padding: 0; border: none;
  overflow: hidden; pointer-events: none; opacity: 0;
}
body.sidebar-collapsed .main { padding-left: 56px; }

.side-nav { gap: 1px; }
.side-nav > li.foldable { width: 100%; }

/* Whole category is a left-packed toggle button */
.side-nav > li.foldable > .fold-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #374151;
  font: inherit;
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  text-align: left;
}
.side-nav > li.foldable > .fold-toggle:hover { background: #eeeef0; }
.side-nav > li.foldable.is-open > .fold-toggle { background: #ececef; }
.side-nav > li.foldable > .fold-toggle svg:first-of-type {
  width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.7; flex-shrink: 0;
}
.side-nav > li.foldable > .fold-toggle .fold-chev-ico {
  width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2.2;
  flex-shrink: 0;
  margin-left: 2px;
  transition: transform .15s ease;
}
.side-nav > li.foldable.is-open > .fold-toggle .fold-chev-ico { transform: rotate(180deg); }

.side-nav > li.foldable > .fold-panel {
  display: none;
  padding: 0 0 4px 34px;
}
.side-nav > li.foldable.is-open > .fold-panel {
  display: block;
}
.side-nav > li.foldable > .fold-panel a {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 550;
  color: #4b5563;
}
.side-nav > li.foldable > .fold-panel a:hover { background: #eeeef0; }
.side-nav > li.foldable > .fold-panel a.active {
  background: var(--blue-soft); color: var(--blue-text);
}

.side-section.side-fold-head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  margin: 12px 0 4px;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  color: #9ca3af;
  text-transform: uppercase;
  cursor: pointer;
  text-align: left;
}
.side-section.side-fold-head:hover { background: #eeeef0; color: #6b7280; }
.side-section.side-fold-head .sec-chev,
.side-section.side-fold-head .fold-chev-ico {
  width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2.2;
  transition: transform .15s ease; flex-shrink: 0;
}
.side-section.side-fold-head[aria-expanded="true"] .sec-chev,
.side-section.side-fold-head[aria-expanded="true"] .fold-chev-ico { transform: rotate(180deg); }
.side-nav.is-section-collapsed { display: none; }

.psp-card { padding: 8px 4px 12px; margin-bottom: 4px; gap: 8px; }
