/* ============================================================
   iSkillsPK Reseller Portal — Pulse theme (light + emerald)
   Single source of truth for the app's look.
   ============================================================ */

:root{
  --bg:#eef2f0; --surface:#ffffff; --surface-2:#f3f7f5; --surface-hover:#edf3f0;
  --border:#dde6e1; --border-strong:#cad8d1;
  --text:#0c1a15; --text-2:#33483f; --muted:#5d6e66;
  --accent:#0c9f6e; --accent-2:#10b981; --accent-soft:#dcf4ea; --on-accent:#ffffff;
  --success:#0c9f6e; --success-soft:#dcf4ea;
  --warn:#d98b06; --warn-soft:#fbf0d6;
  --danger:#e0524a; --danger-soft:#fdebea;
  --sidebar-bg:#063b2c; --sidebar-text:#bfe0d2; --sidebar-muted:#6fa392; --sidebar-border:rgba(255,255,255,.08);
  --radius:11px; --radius-sm:8px; --row-h:48px;
  --shadow:0 1px 2px rgba(12,26,21,.05); --shadow-lg:0 10px 30px rgba(12,26,21,.10);
  --font-display:'Sora',system-ui,sans-serif;
  --font-body:'Inter',system-ui,sans-serif;
  --font-mono:'JetBrains Mono',ui-monospace,monospace;
}

*{margin:0;padding:0;box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{font-family:var(--font-body);font-size:14px;line-height:1.5;color:var(--text);background:var(--bg)}
button{font-family:inherit;cursor:pointer;border:none;background:none;color:inherit}
a{color:inherit;text-decoration:none}
ul{list-style:none}
img,svg{display:block}
input,select{font-family:inherit}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:4px}
.num{font-family:var(--font-mono);font-variant-numeric:tabular-nums;letter-spacing:-.01em}
.muted{color:var(--muted)}

/* ---------------- App shell ---------------- */
.app{display:flex;min-height:100vh}
.sidebar{width:236px;flex-shrink:0;background:var(--sidebar-bg);color:var(--sidebar-text);
  display:flex;flex-direction:column;border-right:1px solid var(--sidebar-border);
  position:sticky;top:0;height:100vh}
.brand{display:flex;align-items:center;gap:11px;padding:20px 20px 16px}
.brand .logo{width:32px;height:32px;border-radius:9px;background:linear-gradient(135deg,var(--accent),var(--accent-2));
  display:grid;place-items:center;color:#fff;font-weight:700;font-family:var(--font-display);flex-shrink:0;font-size:14px}
.brand .b-name{font-family:var(--font-display);font-weight:700;font-size:15px;letter-spacing:-.02em;color:#fff}
.brand .b-sub{font-size:10px;color:var(--sidebar-muted);letter-spacing:.07em;text-transform:uppercase;font-weight:700;margin-top:1px}
.nav{padding:6px 12px;flex:1;overflow-y:auto}
.nav-label{font-size:10px;text-transform:uppercase;letter-spacing:.09em;color:var(--sidebar-muted);font-weight:700;padding:14px 12px 7px}
.nav a{display:flex;align-items:center;gap:11px;padding:9px 12px;border-radius:var(--radius-sm);
  color:var(--sidebar-text);font-size:13.5px;font-weight:500;position:relative;margin-bottom:2px;transition:.14s}
.nav a svg{width:18px;height:18px;flex-shrink:0;opacity:.78}
.nav a:hover{background:rgba(255,255,255,.06);color:#fff}
.nav a.active{background:rgba(255,255,255,.10);color:#fff;font-weight:600}
.nav a.active svg{opacity:1}
.nav a.active::before{content:"";position:absolute;left:-12px;top:8px;bottom:8px;width:3px;border-radius:0 3px 3px 0;background:var(--accent-2)}
.side-foot{padding:14px;border-top:1px solid var(--sidebar-border)}
.side-user{display:flex;align-items:center;gap:10px;padding:6px}
.side-user .av{width:34px;height:34px;border-radius:50%;background:var(--accent);color:#fff;display:grid;place-items:center;font-weight:700;font-size:12.5px;flex-shrink:0}
.side-user .su-name{font-size:13px;font-weight:600;color:#fff}
.side-user .su-role{font-size:11px;color:var(--sidebar-muted)}
.side-foot a.logout{display:flex;align-items:center;gap:9px;margin-top:10px;padding:8px 6px;font-size:12.5px;color:var(--sidebar-muted)}
.side-foot a.logout:hover{color:#fff}
.side-foot a.logout svg{width:16px;height:16px}

.main{flex:1;min-width:0;display:flex;flex-direction:column}
.topbar{position:sticky;top:0;z-index:20;display:flex;align-items:center;gap:14px;padding:14px 26px;
  background:rgba(238,242,240,.86);backdrop-filter:blur(10px);border-bottom:1px solid var(--border)}
.topbar h1{font-family:var(--font-display);font-size:18px;font-weight:600;letter-spacing:-.02em}
.topbar .crumb{font-size:12px;color:var(--muted);margin-top:1px}
.hamburger{display:none;width:38px;height:38px;border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--surface);place-items:center}
.hamburger svg{width:18px;height:18px}
.top-right{margin-left:auto;display:flex;align-items:center;gap:12px}
.status-chip{display:flex;align-items:center;gap:7px;font-size:12px;font-weight:500;color:var(--text-2);
  background:var(--surface);border:1px solid var(--border);border-radius:20px;padding:6px 12px}
.status-chip .live{width:7px;height:7px;border-radius:50%;background:var(--success);box-shadow:0 0 0 3px var(--success-soft)}

.content{padding:24px 26px 56px;max-width:1180px;width:100%}
.content{animation:rise .35s ease both}
@keyframes rise{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}

/* ---------------- Section heads ---------------- */
.sec-head{display:flex;align-items:baseline;gap:12px;margin:28px 0 13px;flex-wrap:wrap}
.sec-head:first-child{margin-top:2px}
.sec-head h2{font-family:var(--font-display);font-size:15px;font-weight:600;letter-spacing:-.01em}
.sec-head .h-sub{font-size:12.5px;color:var(--muted)}
.sec-head .h-link{margin-left:auto;font-size:12.5px;color:var(--accent);font-weight:600}

/* ---------------- Stat cards ---------------- */
.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:13px}
.stat{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:18px;box-shadow:var(--shadow);transition:.18s}
.stat:hover{transform:translateY(-2px);border-color:var(--border-strong)}
.stat .s-top{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}
.stat .s-ico{width:34px;height:34px;border-radius:9px;background:var(--accent-soft);color:var(--accent);display:grid;place-items:center}
.stat .s-ico svg{width:17px;height:17px}
.stat .s-ico.warn{background:var(--warn-soft);color:var(--warn)}
.stat .s-label{font-size:12px;color:var(--muted);font-weight:500}
.stat .s-val{font-size:24px;font-weight:700;letter-spacing:-.02em;font-family:var(--font-display)}
.stat .s-val .cur{font-size:13px;color:var(--muted);font-weight:500;margin-right:3px;font-family:var(--font-body)}
.stat .s-val .sub{font-size:13px;color:var(--muted);font-weight:500;font-family:var(--font-body)}
.stat .s-meta{font-size:12px;margin-top:7px;display:flex;align-items:center;gap:5px;color:var(--muted)}
.stat .s-meta .up{color:var(--success);font-weight:600}
.stat .s-meta .dn{color:var(--danger);font-weight:600}

/* meters */
.meter{height:6px;border-radius:6px;background:var(--surface-2);margin-top:11px;overflow:hidden;border:1px solid var(--border)}
.meter i{display:block;height:100%;border-radius:6px;background:linear-gradient(90deg,var(--accent),var(--accent-2))}
.meter.warn i{background:var(--warn)}
.meter.danger i{background:var(--danger)}

/* ---------------- Layout grids ---------------- */
.grid-2{display:grid;grid-template-columns:1.15fr .85fr;gap:18px;align-items:start}

/* ---------------- Cards ---------------- */
.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);overflow:hidden}
.card-head{padding:15px 18px;border-bottom:1px solid var(--border);display:flex;align-items:center;gap:10px}
.card-head h3{font-family:var(--font-display);font-size:14px;font-weight:600}
.card-head .ch-sub{font-size:12px;color:var(--muted)}
.card-head svg{flex-shrink:0}
.card-body{padding:18px}

/* ---------------- Forms ---------------- */
.field{margin-bottom:14px}
.field label{display:block;font-size:12px;font-weight:600;color:var(--text-2);margin-bottom:6px}
.field input,.field select{width:100%;background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius-sm);
  padding:10px 12px;color:var(--text);font-size:13.5px;outline:none;transition:.15s}
.field input:focus,.field select:focus{border-color:var(--accent);background:var(--surface);box-shadow:0 0 0 3px var(--accent-soft)}
.field input::placeholder{color:var(--muted)}
.field .hint{font-size:11.5px;color:var(--muted);margin-top:5px}
.frow{display:grid;grid-template-columns:1fr 1fr;gap:12px}

.cost-box{background:var(--accent-soft);border:1px solid var(--border);border-radius:var(--radius-sm);padding:13px 15px;margin:4px 0 16px}
.cost-row{display:flex;justify-content:space-between;align-items:center;font-size:13px;padding:3px 0}
.cost-row .cl{color:var(--text-2)}
.cost-row .cv{font-weight:600}
.cost-row.total{border-top:1px dashed var(--border-strong);margin-top:7px;padding-top:9px}
.cost-row.total .cl{font-weight:700;color:var(--text)}
.cost-row.total .cv{color:var(--success);font-size:15px;font-weight:700}

.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;background:var(--accent);color:var(--on-accent);
  font-weight:600;font-size:14px;padding:12px 16px;border-radius:var(--radius-sm);transition:.15s}
.btn:hover{filter:brightness(1.06);transform:translateY(-1px)}
.btn:disabled{opacity:.5;cursor:not-allowed;transform:none;filter:none}
.btn svg{width:17px;height:17px}
.btn.block{width:100%}
.btn.ghost{background:var(--surface-2);color:var(--text);border:1px solid var(--border)}
.btn.ghost:hover{background:var(--surface-hover)}
.btn.sm{padding:8px 14px;font-size:13px}

/* ---------------- Tables ---------------- */
.tbl-wrap{overflow-x:auto}
table{width:100%;border-collapse:collapse;font-size:13px}
thead th{text-align:left;font-size:11px;text-transform:uppercase;letter-spacing:.05em;color:var(--muted);font-weight:700;padding:0 18px 11px;white-space:nowrap}
tbody td{padding:0 18px;height:var(--row-h);border-top:1px solid var(--border);white-space:nowrap}
tbody tr{transition:background .12s}
tbody tr:hover{background:var(--surface-hover)}
.cust{display:inline-flex;flex-direction:column;gap:1px;vertical-align:middle}
.cust .cn{font-weight:600;color:var(--text)}
.cust .ce{font-size:11.5px;color:var(--muted)}
.av-sm{width:30px;height:30px;border-radius:50%;background:var(--accent-soft);color:var(--accent);display:inline-grid;place-items:center;font-weight:700;font-size:11.5px;margin-right:10px;vertical-align:middle}
.prod-tag{display:inline-flex;align-items:center;gap:6px;font-size:12.5px;font-weight:500}
.prod-tag .pdot{width:8px;height:8px;border-radius:3px;background:var(--accent)}
.right{text-align:right}

.badge{display:inline-flex;align-items:center;gap:5px;font-size:11.5px;font-weight:600;padding:4px 10px;border-radius:20px}
.badge::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor}
.badge.ok{color:var(--success);background:var(--success-soft)}
.badge.warn{color:var(--warn);background:var(--warn-soft)}
.badge.bad{color:var(--danger);background:var(--danger-soft)}

.mini-meter{display:flex;align-items:center;gap:9px;min-width:130px}
.mini-meter .mm-bar{flex:1;height:6px;border-radius:6px;background:var(--surface-2);border:1px solid var(--border);overflow:hidden}
.mini-meter .mm-bar i{display:block;height:100%;background:var(--accent)}
.mini-meter .mm-bar i.warn{background:var(--warn)}
.mini-meter .mm-bar i.bad{background:var(--danger)}
.mini-meter .mm-t{font-size:11.5px;color:var(--muted)}
.tlink{color:var(--accent);font-weight:600;font-size:12.5px}

/* ---------------- Activity feed ---------------- */
.feed{padding:6px 18px}
.feed li{display:flex;gap:13px;padding:12px 0;border-top:1px solid var(--border)}
.feed li:first-child{border-top:none}
.feed .f-ico{width:32px;height:32px;border-radius:9px;display:grid;place-items:center;flex-shrink:0}
.feed .f-ico svg{width:16px;height:16px}
.fi-add{background:var(--success-soft);color:var(--success)}
.fi-pay{background:var(--accent-soft);color:var(--accent)}
.fi-warn{background:var(--warn-soft);color:var(--warn)}
.feed .f-body{flex:1;min-width:0}
.feed .f-txt{font-size:13px;color:var(--text-2)}
.feed .f-txt b{color:var(--text);font-weight:600}
.feed .f-time{font-size:11.5px;color:var(--muted);margin-top:2px}
.feed .f-amt{font-size:13px;font-weight:600;white-space:nowrap}
.feed .f-amt.pos{color:var(--success)}

/* ---------------- Alerts ---------------- */
.alert{display:flex;gap:11px;align-items:flex-start;padding:13px 15px;border-radius:var(--radius-sm);font-size:13px;margin-bottom:18px;border:1px solid transparent}
.alert svg{width:18px;height:18px;flex-shrink:0;margin-top:1px}
.alert.ok{background:var(--success-soft);color:#0a5d44;border-color:#bfe7d6}
.alert.warn{background:var(--warn-soft);color:#7a4e06;border-color:#f0dcae}
.alert.err{background:var(--danger-soft);color:#8f2820;border-color:#f3c8c4}
.alert b{font-weight:700}

/* empty state */
.empty{padding:40px 20px;text-align:center;color:var(--muted)}
.empty svg{width:34px;height:34px;margin:0 auto 12px;opacity:.5}
.empty .e-title{font-weight:600;color:var(--text-2);margin-bottom:4px}

/* credential reveal box */
.creds{background:var(--surface-2);border:1px dashed var(--border-strong);border-radius:var(--radius-sm);padding:14px 16px;margin:14px 0}
.creds .cr{display:flex;justify-content:space-between;gap:12px;padding:5px 0;font-size:13px}
.creds .cr .k{color:var(--muted)}
.creds .cr .v{font-weight:600}

/* ---------------- Login ---------------- */
.auth-wrap{min-height:100vh;display:grid;place-items:center;padding:24px;
  background:radial-gradient(1200px 500px at 50% -10%, #d9efe6 0%, var(--bg) 60%)}
.auth-card{width:100%;max-width:380px;background:var(--surface);border:1px solid var(--border);border-radius:16px;box-shadow:var(--shadow-lg);padding:30px 28px}
.auth-logo{display:flex;align-items:center;gap:11px;margin-bottom:22px}
.auth-logo .logo{width:40px;height:40px;border-radius:11px;background:linear-gradient(135deg,var(--accent),var(--accent-2));display:grid;place-items:center;color:#fff;font-weight:700;font-family:var(--font-display)}
.auth-logo .t .n{font-family:var(--font-display);font-weight:700;font-size:16px;letter-spacing:-.02em}
.auth-logo .t .s{font-size:11.5px;color:var(--muted)}
.auth-card h1{font-family:var(--font-display);font-size:20px;font-weight:600;margin-bottom:4px;letter-spacing:-.02em}
.auth-card .lead{font-size:13px;color:var(--muted);margin-bottom:20px}

/* ---------------- Responsive ---------------- */
@media(max-width:1080px){.grid-2{grid-template-columns:1fr}}
@media(max-width:960px){
  .hamburger{display:grid}
  .sidebar{position:fixed;left:0;top:0;z-index:60;transform:translateX(-100%);transition:transform .25s;box-shadow:var(--shadow-lg)}
  body.nav-open .sidebar{transform:translateX(0)}
  .sidebar-scrim{display:none;position:fixed;inset:0;background:rgba(6,20,15,.45);z-index:55}
  body.nav-open .sidebar-scrim{display:block}
  .stats{grid-template-columns:repeat(2,1fr)}
  .content{padding:20px 16px 50px}
  .topbar{padding:12px 16px}
  .top-right .status-chip span.lbl{display:none}
}
@media(max-width:520px){
  .stats{grid-template-columns:1fr}
  .frow{grid-template-columns:1fr}
  .topbar h1{font-size:16px}
}
@media(prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
