/* ============================================================
   Suda Cart — Admin / Vendor Panels (panel.css)
   ============================================================ */

body.panel { background: #f1f1f8; }

/* ---------- Shell layout ---------- */
.shell { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
  background: linear-gradient(180deg, #17123b 0%, #1e1750 100%);
  color: #b9b4e2; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 80;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 99px; }
.sidebar .s-head { display: flex; align-items: center; gap: 11px; padding: 20px 20px 16px; }
.sidebar .logo .mark { box-shadow: 0 6px 18px rgba(108, 76, 241, .5); }
.sidebar .logo .name b { color: #fff; }
.sidebar .logo .name span { color: #8f89c6; }
.sidebar .env { margin-inline-start: auto; font-size: 9.5px; font-weight: 800; letter-spacing: .6px; background: rgba(255, 159, 28, .16); color: #ffb020; padding: 3px 9px; border-radius: 99px; border: 1px solid rgba(255, 159, 28, .3); }

.snav { flex: 1; padding: 8px 14px 20px; }
.snav .group { margin-top: 16px; }
.snav .gtitle { font-size: 10.5px; font-weight: 800; letter-spacing: 1px; color: #6a63a8; padding: 0 12px 8px; text-transform: uppercase; }
.snav a {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; margin-bottom: 2px; border-radius: 11px;
  font-size: 13.5px; font-weight: 600; color: #c8c3ec;
  transition: all .16s ease; position: relative;
}
.snav a .ic { width: 18px; height: 18px; color: #8f89c6; flex: none; transition: color .16s ease; }
.snav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.snav a:hover .ic { color: #cfc9f5; }
.snav a.on { background: var(--grad-brand); color: #fff; box-shadow: 0 8px 20px rgba(108, 76, 241, .38); }
.snav a.on .ic { color: #fff; }
.snav a .cnt { margin-inline-start: auto; min-width: 20px; height: 20px; padding-inline: 6px; border-radius: 99px; background: #ff5f5f; color: #fff; font-size: 10.5px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; animation: pulse-dot 2.2s infinite; }
.snav a .cnt.amber { background: var(--amber-500); color: #3d2500; animation: none; }

.s-foot { padding: 14px; border-top: 1px solid rgba(255,255,255,.09); }
.s-user { display: flex; align-items: center; gap: 11px; padding: 8px; border-radius: 13px; }
.s-user:hover { background: rgba(255,255,255,.06); }
.s-user .av { width: 40px; height: 40px; border-radius: 12px; flex: none; }
.s-user b { display: block; font-size: 13px; color: #fff; }
.s-user span { font-size: 10.5px; color: #8f89c6; font-weight: 600; }
.s-user .out { margin-inline-start: auto; color: #8f89c6; width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; }
.s-user .out:hover { color: #ff7b7b; background: rgba(255, 123, 123, .12); }

/* ---------- Main column ---------- */
.main { min-width: 0; display: flex; flex-direction: column; }
.ptop {
  position: sticky; top: 0; z-index: 70;
  background: rgba(241, 241, 248, .88); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding: 12px 26px; display: flex; align-items: center; gap: 16px;
}
.ptop h1 { font-size: 18.5px; }
.ptop .crumb { font-size: 11.5px; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
.ptop-search { flex: 1; max-width: 430px; display: flex; align-items: center; gap: 9px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; padding: 9px 14px; transition: border-color .16s ease; }
.ptop-search:focus-within { border-color: var(--brand-500); }
.ptop-search .ic { color: var(--muted-2); width: 17px; height: 17px; }
.ptop-search input { border: 0; outline: 0; background: none; font-size: 13.5px; width: 100%; min-width: 0; }
.ptop-actions { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.bell { position: relative; width: 42px; height: 42px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink-800); display: inline-flex; align-items: center; justify-content: center; }
.bell:hover { border-color: var(--brand-300); color: var(--brand-600); }
.bell .nd { position: absolute; top: -5px; inset-inline-end: -5px; min-width: 18px; height: 18px; border-radius: 99px; background: #ff5f5f; color: #fff; font-size: 10px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; border: 2px solid #f1f1f8; padding-inline: 3px; }
.puser { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--line); background: var(--surface); border-radius: 12px; padding: 5px 12px 5px 5px; }
[dir="rtl"] .puser { padding: 5px 5px 5px 12px; }
.puser b { font-size: 12.5px; display: block; line-height: 1.3; }
.puser span { font-size: 10.5px; color: var(--muted); font-weight: 600; }

.content { padding: 24px 26px 40px; }
.view { display: none; }
.view.on { display: block; animation: fade-up .3s ease; }

/* ---------- KPI cards ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(225px, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px 20px; overflow: hidden; transition: all .2s ease; }
.kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.kpi .k-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.kpi .k-ic { width: 44px; height: 44px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; }
.kpi .k-ic .ic { width: 21px; height: 21px; }
.k-ic.violet { background: var(--brand-50); color: var(--brand-600); }
.k-ic.green { background: var(--green-100); color: var(--green-600); }
.k-ic.amber { background: var(--amber-100); color: var(--amber-600); }
.k-ic.blue { background: var(--blue-100); color: var(--blue-600); }
.k-ic.red { background: var(--red-100); color: var(--red-600); }
.kpi .k-lbl { font-size: 12px; font-weight: 700; color: var(--muted); }
.kpi .k-val { font-size: 25px; font-weight: 800; letter-spacing: -.2px; line-height: 1.15; }
.kpi .k-val small { font-size: 13px; color: var(--muted); font-weight: 700; }
.kpi .k-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.delta { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 800; padding: 3px 9px; border-radius: 99px; }
.delta.up { background: var(--green-100); color: var(--green-600); }
.delta.down { background: var(--red-100); color: var(--red-600); }
.delta .ic { width: 12px; height: 12px; }
.kpi .k-spark { opacity: .9; }

/* ---------- Cards / grid rows ---------- */
.grid-2 { display: grid; grid-template-columns: 1.65fr 1fr; gap: 16px; margin-bottom: 16px; align-items: start; }
.grid-2b { display: grid; grid-template-columns: 1fr 1.65fr; gap: 16px; margin-bottom: 16px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; align-items: start; }
.pcard2 { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.pc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.pc-head h3 { font-size: 15px; display: flex; align-items: center; gap: 9px; }
.pc-head h3 .ic { width: 18px; height: 18px; color: var(--brand-600); }
.pc-head .actions { display: flex; align-items: center; gap: 8px; }
.pc-body { padding: 18px 20px; }
.pc-body.flush { padding: 0; }

/* ---------- Status pills ---------- */
.pill2 { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 800; padding: 4px 11px; border-radius: 99px; white-space: nowrap; }
.pill2::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill2.ok { background: var(--green-100); color: var(--green-600); }
.pill2.proc { background: var(--blue-100); color: var(--blue-600); }
.pill2.ship { background: var(--brand-100); color: var(--brand-700); }
.pill2.pay { background: var(--amber-100); color: var(--amber-600); }
.pill2.bad { background: var(--red-100); color: var(--red-600); }

/* ---------- Table extras ---------- */
.tbl .id { font-weight: 800; color: var(--brand-700); font-size: 13px; }
.tbl .u { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.tbl .u small { display: block; color: var(--muted); font-weight: 600; font-size: 11px; }
.tbl .money { font-weight: 800; white-space: nowrap; }
.row-actions { display: flex; gap: 6px; }
.mini-btn { width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); display: inline-flex; align-items: center; justify-content: center; transition: all .15s ease; }
.mini-btn:hover { border-color: var(--brand-500); color: var(--brand-600); background: var(--brand-50); }
.mini-btn.ok:hover { border-color: var(--green-600); color: var(--green-600); background: var(--green-100); }
.mini-btn.no:hover { border-color: var(--red-600); color: var(--red-600); background: var(--red-100); }
.mini-btn .ic { width: 15px; height: 15px; }

/* ---------- Chart legend ---------- */
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; font-weight: 700; color: var(--muted); }
.legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-inline-end: 5px; }
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 11px; padding: 3px; }
.seg button { padding: 6px 13px; border-radius: 9px; font-size: 12px; font-weight: 700; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--brand-700); box-shadow: var(--shadow-xs); }

/* donut center */
.donut-wrap { display: flex; align-items: center; gap: 22px; padding: 6px; flex-wrap: wrap; }
.donut-center { position: relative; width: 158px; height: 158px; flex: none; }
.donut-center .mid { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.donut-center .mid b { font-size: 24px; }
.donut-center .mid span { font-size: 11px; color: var(--muted); font-weight: 700; }
.donut-legend { flex: 1; min-width: 150px; display: flex; flex-direction: column; gap: 10px; }
.donut-legend .row { display: flex; align-items: center; gap: 9px; font-size: 12.5px; font-weight: 700; }
.donut-legend .row i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.donut-legend .row b { margin-inline-start: auto; }

/* ---------- Top vendors / lists ---------- */
.vrow { display: flex; align-items: center; gap: 13px; padding: 13px 20px; border-bottom: 1px solid var(--line); }
.vrow:last-child { border-bottom: 0; }
.vrow:hover { background: #faf9ff; }
.vrow .rank { width: 30px; height: 30px; border-radius: 10px; background: var(--brand-50); color: var(--brand-700); font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.vrow:nth-child(1) .rank { background: linear-gradient(135deg, #ffd166, #f07d0a); color: #3d2500; }
.vrow .vinfo { flex: 1; min-width: 0; }
.vrow .vinfo b { font-size: 13px; display: flex; align-items: center; gap: 5px; }
.vrow .vinfo .bar { margin-top: 7px; height: 5px; }
.vrow .vnum { text-align: end; white-space: nowrap; }
.vrow .vnum b { font-size: 13.5px; display: block; }
.vrow .vnum span { font-size: 10.5px; color: var(--muted); font-weight: 700; }

/* ---------- Payout requests ---------- */
.payrow { display: flex; align-items: center; gap: 13px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.payrow:last-child { border-bottom: 0; }
.payrow .pm-ic { width: 40px; height: 40px; border-radius: 12px; background: var(--brand-50); color: var(--brand-600); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.payrow .pm-ic .ic { width: 19px; height: 19px; }
.payrow .pinfo { flex: 1; min-width: 0; }
.payrow .pinfo b { font-size: 13px; display: block; }
.payrow .pinfo span { font-size: 11px; color: var(--muted); font-weight: 600; }
.payrow .amount { font-weight: 800; font-size: 14.5px; white-space: nowrap; }
.payrow .amount small { color: var(--muted); font-size: 10.5px; font-weight: 700; display: block; }

/* ---------- Plan card (vendor panel) ---------- */
.plan-card { position: relative; overflow: hidden; border-radius: var(--radius-lg); background: var(--grad-ink); color: #fff; padding: 22px; }
.plan-card .tag { display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .25); border-radius: 99px; padding: 4px 13px; font-size: 11.5px; font-weight: 800; color: #ffd9a0; }
.plan-card h3 { font-size: 20px; margin-block: 10px 4px; }
.plan-card .price { font-size: 26px; font-weight: 800; }
.plan-card .price small { font-size: 12px; color: #b6afe6; font-weight: 600; }
.plan-card .meta { font-size: 11.5px; color: #c9c3ef; font-weight: 600; margin-top: 4px; }
.plan-usage { margin-top: 16px; display: flex; flex-direction: column; gap: 11px; }
.plan-usage .u { font-size: 11.5px; font-weight: 700; }
.plan-usage .u .t { display: flex; justify-content: space-between; margin-bottom: 5px; color: #d9d5f7; }
.plan-usage .bar { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .16); overflow: hidden; }
.plan-usage .bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #ffd166, #f07d0a); }

/* balance card */
.balance-card { background: var(--grad-brand); color: #fff; border-radius: var(--radius-lg); padding: 22px; position: relative; overflow: hidden; }
.balance-card .lbl { font-size: 12px; font-weight: 700; color: #e4defc; }
.balance-card .val { font-size: 30px; font-weight: 800; margin-block: 6px 2px; }
.balance-card .sub { font-size: 11.5px; color: #d5cdfa; font-weight: 600; }

/* activity feed */
.feed { display: flex; gap: 12px; }
.feed .line { display: flex; flex-direction: column; align-items: center; }
.feed .line i { width: 9px; height: 9px; border-radius: 50%; background: var(--brand-500); flex: none; margin-top: 6px; }
.feed .line::after { content: ""; width: 2px; flex: 1; background: var(--line); margin-top: 4px; }
.feed .fitem { padding-bottom: 16px; flex: 1; min-width: 0; }
.feed .fitem b { font-size: 13px; }
.feed .fitem p { font-size: 12px; color: var(--muted); margin: 3px 0 0; font-weight: 500; line-height: 1.6; }
.feed .fitem .t { font-size: 10.5px; color: var(--muted-2); font-weight: 700; margin-top: 4px; display: inline-flex; align-items: center; gap: 5px; }
.feed .fitem .t .ic { width: 12px; height: 12px; }

/* ---------- Mobile (panels) ---------- */
.panel .burger { display: none; }
@media (max-width: 1240px) {
  .grid-2, .grid-2b, .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 1024px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: 280px; transform: translateX(-105%); transition: transform .28s ease; height: 100vh; }
  [dir="rtl"] .sidebar { transform: translateX(105%); }
  body.panel.snav-open .sidebar { transform: translateX(0); box-shadow: 40px 0 80px rgba(18,14,51,.4); }
  body.panel.snav-open .scrim { opacity: 1; visibility: visible; }
  .scrim { position: fixed; inset: 0; background: rgba(18, 14, 51, .5); z-index: 75; opacity: 0; visibility: hidden; transition: all .25s ease; }
  .panel .burger { display: inline-flex; }
  .ptop { padding: 12px 16px; }
  .content { padding: 18px 16px 34px; }
  .ptop-search.hide-tab { display: none; }
}
@media (max-width: 640px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .puser span, .puser b { display: none; }
  .puser { padding: 5px; }
  .tbl .hide-sm { display: none; }
  .kpi .k-val { font-size: 19px; }
  .ptop { padding: 10px 12px; gap: 10px; }
  .ptop .crumb { display: none; }
  .ptop .ptop-left { min-width: 0; }
  .ptop h1 { font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42vw; }
  .ptop-actions { gap: 6px; }
  .ptop-actions .btn-outline { padding: 8px; }
  .ptop-actions .btn-outline span { display: none; }
  .bell { width: 38px; height: 38px; }
  .lang-btn.light { padding: 5px 10px; }
  .content { padding: 14px 12px 30px; }
}
