/* =========================================================
   admin.css — ຫ້ອງແອດມິນ DEK MASH SHOP
   ໃຊ້ 2 ໂຕນສີຮ່ວມກັນ:
     - ໜ້າລ໋ອກອິນ (login/denied screen) ຍັງໃຊ້ໂຕນສີແດງເຫมือนເວັບຫลัก (style.css)
     - ຫ້ອງແອດມິນຈິງ (ຫລັງລ໋ອກອິນຜ່ານ) ໃຊ້ໂຕນສີຄຳ/ໂທນເຄື່ອງມືທີ່ພອດຈາກເວັບເກົ່າ
       (ນິຍາມຢູ່ໃນ <style> ຂອງ admin.html ເອງ ເພື່ອບໍ່ໃຫ້ກະທົບໜ້າອື່ນຂອງເວັບ)
   ========================================================= */

.admin-shell{
  max-width:480px; margin:0 auto; min-height:100vh;
  background:var(--bg); position:relative; padding-bottom:60px;
}

/* ---------- Login screen (ໂຕນສີແດງເຫมือนໜ້າອື່ນຂອງເວັບ) ---------- */
.login-screen{
  min-height:100vh; display:flex; flex-direction:column;
  align-items:center; justify-content:center; padding:24px;
  gap:22px; position:relative; z-index:2;
}
.login-logo{
  width:56px; height:56px; border-radius:16px;
  background:var(--red);
  display:flex; align-items:center; justify-content:center;
  box-shadow:none;
}
.login-logo svg{ width:28px; height:28px; }
.login-title{ font-size:19px; font-weight:800; text-align:center; }
.login-sub{ font-size:12.5px; color:var(--text-faint); text-align:center; max-width:32ch; line-height:1.6; }

.login-card{
  width:100%; max-width:340px;
  background:var(--card);
  border:1px solid var(--card-border);
  border-radius:var(--radius);
  padding:22px; display:flex; flex-direction:column; gap:14px;
  box-shadow:none;
}

.btn-block{
  width:100%; padding:13px; border-radius:12px; border:none;
  font-size:14.5px; font-weight:700; font-family:inherit; cursor:pointer;
  background:var(--red);
  color:#fff;
  box-shadow:none;
  transition:transform .15s ease;
}
.btn-block:active{ transform:scale(.97); }
.btn-block.secondary{
  background:#0f0f0f;
  border:1px solid #2f2f2f; box-shadow:none;
}

.login-error{
  font-size:12.5px; color:var(--red-glow); text-align:center; min-height:16px;
}

/* ---------- Discord login button ---------- */
.btn-discord{
  display:flex; align-items:center; justify-content:center; gap:9px;
  background:#5865f2;
  box-shadow:none;
}
.btn-discord svg{ width:19px; height:19px; }

.hint{ font-size:11.5px; color:var(--text-faint); line-height:1.6; }

/* ===== Utility classes (migrated from inline style= attributes for CSP compliance) ===== */
.u-mt-6 { margin-top: 6px; }
.u-mt-8 { margin-top: 8px; }
.u-mt-10 { margin-top: 10px; }
.u-mt-14 { margin-top: 14px; }
.u-mt-16 { margin-top: 16px; }
.u-mb-14 { margin-bottom: 14px; }
.u-hidden { display: none; }
.u-pos-static { position: static; }
.u-hint-center { text-align: center; max-width: 300px; }
.u-bg-black { background: #2a2a2a; }
.u-icon-40 { width: 40px; height: 40px; }
.u-max-w-340 { max-width: 340px; }
.u-textarea-resize { resize: vertical; min-height: 90px; }
.u-panel-sub-margin { margin: -2px 2px 16px; }
.u-small-hint { font-size: 12px; color: var(--ink-500); margin: 0 0 10px; }
.u-small-hint-mb { margin-bottom: 10px; color: var(--ink-500); font-size: 12px; }
.u-gate {
  display: none;
  text-align: center;
  padding: 70px 10px;
  color: var(--ink-300);
  font-size: 13.5px;
}
.u-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  margin: 0 auto 16px;
  border: 3px solid rgba(255, 0, 1, 0.15);
  border-top-color: var(--gx-signal);
  animation: gxSpin .8s linear infinite;
}
.rail-red { --rail-color: var(--black-400, #ff0001); }
.rail-orange { --rail-color: #ffb020; }
.rail-purple { --rail-color: #7c5cff; }
.rail-black { --rail-color: #2a2a2a; }
.swatch-red { background: var(--black-400, #ff0001); }
.swatch-orange { background: #ffb020; }
.swatch-purple { background: #7c5cff; }
.swatch-black { background: #2a2a2a; }


/* ===== Migrated from inline <style> block in admin.html (CSP compliance) ===== */

  /* ===== ຄ່າສີ/ຟອນພື້ນຖານ ທີ່ຫ້ອງແອດມິນເອົາມາຈາກເວັບເກົ່າ (scope ສະເພາະໜ້ານີ້ ບໍ່ກະທົບໜ້າອື່ນ) ===== */
  :root{
    --navy-950:#000000;
    --navy-900:#0a0a0a;
    --navy-800:#141414;
    --navy-700:#222222;
    --black-500:#990001;
    --black-400:#ff0001;
    --black-300:#ff4141;
    --shine:#ffffff;
    --shine-dim:#ff4d4d;
    --ink-100:#eef2fb;
    --ink-300:#aab4c8;
    --ink-500:#78839b;
    --green-500:#22c55e;
  }
  .ambient-glow{ position:fixed; inset:0; z-index:0; overflow:hidden; pointer-events:none; }
  .ambient-glow .orb{ position:absolute; border-radius:50%; filter:blur(60px); opacity:0.55; will-change:transform; }
  .ambient-glow .orb-gold{ width:340px;height:340px; top:-60px;left:-80px; background:radial-gradient(circle, rgba(255,120,150,0.55), transparent 70%); animation:driftA 22s ease-in-out infinite; }
  .ambient-glow .orb-navy{ width:400px;height:400px; top:20%;right:-140px; background:radial-gradient(circle, rgba(255,0,1,0.30), transparent 70%); animation:driftB 26s ease-in-out infinite; }
  .ambient-glow .orb-gold-soft{ width:260px;height:260px; bottom:5%;left:10%; background:radial-gradient(circle, rgba(255,150,180,0.5), transparent 70%); animation:driftC 30s ease-in-out infinite; }
  @keyframes driftA{ 0%,100%{transform:translate(0,0) scale(1);} 33%{transform:translate(40px,60px) scale(1.08);} 66%{transform:translate(-20px,30px) scale(0.95);} }
  @keyframes driftB{ 0%,100%{transform:translate(0,0) scale(1);} 50%{transform:translate(-50px,80px) scale(1.12);} }
  @keyframes driftC{ 0%,100%{transform:translate(0,0) scale(1);} 40%{transform:translate(30px,-40px) scale(1.1);} 70%{transform:translate(-30px,-10px) scale(0.9);} }
  @media (prefers-reduced-motion: reduce){ .ambient-glow .orb{animation:none;} }

  .toast{
    position:fixed;left:50%;bottom:24px;transform:translate(-50%, 20px);
    background:rgba(20,10,16,0.75);border:1px solid rgba(255,0,1,0.35);
     
    color:var(--ink-100);padding:12px 20px;border-radius:14px;
    font-size:13.5px;opacity:0;transition:opacity .25s ease, transform .25s ease;
    pointer-events:none;z-index:200;
  }
  .toast.show{opacity:1;transform:translate(-50%, 0);}

  .back-row{ display:flex;align-items:center;gap:10px; margin-bottom:22px; }
  .back-btn{
    width:40px;height:40px;border-radius:13px;
    border:1px solid rgba(255,0,1,0.3);
    background:rgba(255,0,1,0.09);
     
    color:var(--shine-dim);font-size:18px;
    display:flex;align-items:center;justify-content:center;
    cursor:pointer; transition:transform .15s ease, border-color .2s ease;
  }
  .back-btn:hover{border-color:rgba(255,0,1,0.6);}
  .back-btn:active{transform:scale(0.92);}
  .back-btn svg{width:18px;height:18px;stroke:currentColor;}
  .page-title{font-size:19px;font-weight:800;margin:0;}

  :root{
    --gx-signal:#ff0001;
    --gx-signal-soft:rgba(255,0,1,0.35);
    --gx-signal-dim:rgba(255,0,1,0.16);
    --gx-danger:#e83131;
    --gx-success:#2ecc71;
    --gx-warn:#e8b34a;
    --gx-violet:#7c5cff;
    --gx-violet-dim:rgba(124,92,255,0.18);
    --gx-cyan:#28e0d6;
    --gx-font:'Chakra Petch', 'Noto Sans Lao', sans-serif;
  }

  .gx-grid{
    position:fixed;inset:0;z-index:0;pointer-events:none;
    background-image:
      linear-gradient(rgba(255,0,1,0.05) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255,0,1,0.05) 1px, transparent 1px);
    background-size:34px 34px;
    -webkit-mask-image:radial-gradient(ellipse 70% 55% at 50% 20%, #000 0%, transparent 75%);
            mask-image:radial-gradient(ellipse 70% 55% at 50% 20%, #000 0%, transparent 75%);
    opacity:0.8;
  }
  .gx-scanline{
    position:fixed;left:0;right:0;height:140px;z-index:1;pointer-events:none;
    background:linear-gradient(180deg, transparent, rgba(255,0,1,0.04) 45%, rgba(255,0,1,0.07) 50%, rgba(255,0,1,0.04) 55%, transparent);
    animation:gxScan 7s linear infinite;
  }
  @keyframes gxScan{ 0%{top:-140px;} 100%{top:100vh;} }
  @media (prefers-reduced-motion: reduce){ .gx-scanline{animation:none;display:none;} }

  .wrap{position:relative;z-index:2;}
  .back-btn{transition:border-color .2s ease, box-shadow .2s ease, transform .15s ease;}
  .back-btn:hover{border-color:var(--gx-signal-soft);box-shadow:0 0 0 3px var(--gx-signal-dim);}
  .back-btn:active{transform:scale(0.94);}
  .page-title{font-family:var(--gx-font);letter-spacing:0.4px;}

  /* ===== gate: shown while checking admin access ===== */
  #gate{ text-align:center; padding:70px 10px; color:var(--ink-300); font-size:13.5px; }
  #gate .gx-spinner-lg{
    width:34px;height:34px;border-radius:50%;margin:0 auto 16px;
    border:3px solid rgba(255,0,1,0.15); border-top-color:var(--gx-signal);
    animation:gxSpin .8s linear infinite;
  }
  @keyframes gxSpin{ to{transform:rotate(360deg);} }

  #adminApp{ display:none; }

  /* ===== status strip — signature element: a live "operations" readout ===== */
  .ops-strip{
    display:flex; gap:10px; margin:6px 0 18px; overflow-x:auto; padding-bottom:2px;
  }
  .ops-chip{
    flex-shrink:0; display:flex; flex-direction:column; gap:2px;
    padding:12px 16px; border-radius:17px;
    background:#0d0d0d;
    border:1px solid rgba(255,0,1,0.2);
    box-shadow:none;
    min-width:100px;
    animation:chipIn .3s ease both;
  }
  .ops-chip.topup-chip{ border-color:rgba(255,176,32,0.35); }
  .ops-chip.topup-chip .ops-num{ color:var(--gx-warn); }
  @keyframes chipIn{ from{opacity:0;transform:translateY(4px);} to{opacity:1;transform:translateY(0);} }
  .ops-chip .ops-num{ font-family:var(--gx-font); font-weight:700; font-size:19px; color:var(--ink-100); }
  .ops-chip .ops-label{ font-size:10.5px; color:var(--ink-500); letter-spacing:0.4px; }

  /* ===== dashboard nav — "control deck" accordion switches (flat, ເປີດເທື່ອລະອັນ) ===== */
  .deck{
    position:relative; z-index:1;
    display:flex; flex-direction:column; gap:14px;
    margin-bottom:22px;
  }
  .switch{
    position:relative;
    border-radius:24px;
    background:#0d0d0d;
    border:1px solid rgba(255,0,1,0.22);
    box-shadow:none;
    transition:transform .3s cubic-bezier(.2,.9,.25,1), box-shadow .3s ease, border-color .3s ease;
  }
  @media (hover:hover){
    .switch:hover{ transform:translateY(-2px); }
  }
  .switch.open{
    border-color:rgba(255,0,1,0.65);
    box-shadow:none;
  }
  .switch-head{
    position:relative; z-index:1;
    display:flex; align-items:center; gap:14px;
    padding:16px 16px;
    cursor:pointer; -webkit-tap-highlight-color:transparent;
    border-radius:24px;
  }
  .switch-icon{
    width:48px;height:48px;border-radius:15px;flex-shrink:0;
    display:flex;align-items:center;justify-content:center;
    background:#141414;
    border:1px solid rgba(255,0,1,0.2);
    box-shadow:none;
    transition:background .3s ease, box-shadow .3s ease;
  }
  .switch-icon svg{ width:22px;height:22px;stroke:var(--ink-300); transition:stroke .3s ease; }
  .switch.open .switch-icon{
    background:var(--black-500);
    box-shadow:0 0 0 4px rgba(255,0,1,0.14);
  }
  .switch.open .switch-icon svg{ stroke:#fff; }
  .switch-text{ flex:1; min-width:0; }
  .dash-title{ font-weight:700; font-size:14px; letter-spacing:0.2px; color:var(--ink-100); font-family:var(--gx-font); }
  .dash-desc{ font-size:11px; line-height:1.45; color:var(--ink-500); font-family:'Noto Sans Lao', sans-serif; letter-spacing:0; margin-top:3px; }
  .switch-right{ display:flex; align-items:center; gap:8px; flex-shrink:0; }
  .tab-badge{
    background:var(--gx-danger);color:#fff;font-size:9.5px;font-weight:700;
    padding:3px 9px;border-radius:20px;line-height:1.4;
    box-shadow:0 0 0 2px rgba(10,8,20,0.45);
  }
  .switch-chevron{
    width:32px;height:32px;border-radius:10px;flex-shrink:0;
    display:flex;align-items:center;justify-content:center;
    background:rgba(255,255,255,0.03); border:1px solid rgba(255,0,1,0.18);
    color:var(--ink-500);
    transition:transform .35s cubic-bezier(.2,.9,.25,1), color .3s ease, border-color .3s ease;
  }
  .switch-chevron svg{ width:15px;height:15px;stroke:currentColor; }
  .switch.open .switch-chevron{ transform:rotate(180deg); color:var(--gx-signal); border-color:rgba(255,0,1,0.5); }

  .switch-body{ max-height:0; overflow:hidden; transition:max-height .45s cubic-bezier(.2,.85,.25,1); }
  /* ຄ່ານີ້ເປັນແຄ່ fallback (ໃນກໍລະນີ JS ຍັງບໍ່ທັນຮັນ/browser ບໍ່ຮອງຮັບ ResizeObserver) —
     ໂຕຫຼັກ JS (syncSwitchHeight ໃນ admin.js) ຈະຕັ້ງ max-height ຕາມຄວາມສູງເນື້ອຫາຈິງ
     ໃຫ້ເອງ, ຄ່ານີ້ຈຶ່ງຕ້ອງໃຫຍ່ພໍທີ່ຈະບໍ່ຕັດເນື້ອຫາໜ້າ "ຕັ້ງຄ່າຮ້ານ" (4 ໝວດໝູ່) ຖ້າ JS ບໍ່ທັນຮັນ */
  .switch.open .switch-body{ max-height:20000px; }
  .switch-body-inner{ padding:2px 4px 16px; border-top:1px dashed rgba(255,0,1,0.18); margin:0 6px; padding-top:12px; }
  .switch-body-inner:empty{ border-top:none; padding-top:0; }

  .switch-placeholder{
    display:flex; align-items:center; gap:10px;
    font-size:12px; color:var(--ink-500); line-height:1.6;
    background:rgba(255,255,255,0.03); border:1px solid rgba(255,0,1,0.16);
    border-radius:14px; padding:12px 14px;
  }
  .switch-placeholder svg{ width:18px;height:18px;stroke:var(--gx-violet); flex-shrink:0; }

  /* ===== accordion content boxes (ຢູ່ນອກ .switch, ຄຸມແຍກຕາມ id ດ້ວຍ JS) ===== */
  .panel-content{ display:none; }
  .panel-content.open{ display:block; }

  /* ===== static card (no rotating border, for content-heavy panels) ===== */
  .stat-panel{
    border-radius:22px;
    background:#0d0d0d;
    border:1px solid rgba(255,0,1,0.18);
    box-shadow:none;
    padding:14px 10px; margin-bottom:14px;
  }
  .stat-panel h3{
    font-family:var(--gx-font); font-size:14.5px; margin:0 0 6px;
    display:flex;align-items:center;gap:8px;color:var(--ink-100);
  }
  .stat-panel h3 svg{width:16px;height:16px;stroke:var(--gx-signal);flex-shrink:0;}
  .stat-panel .panel-sub{
    font-size:11.8px; color:var(--ink-500); line-height:1.55; margin:0 0 14px;
    font-family:'Noto Sans Lao', sans-serif; letter-spacing:0;
  }

  .mini-refresh{
    margin-left:auto;width:28px;height:28px;border-radius:8px;flex-shrink:0;
    border:1px solid rgba(255,0,1,0.25); background:rgba(255,0,1,0.05);
    color:var(--ink-300); display:flex;align-items:center;justify-content:center;
    cursor:pointer; transition:color .2s ease, border-color .2s ease;
  }
  .mini-refresh:hover{ color:var(--shine-dim); border-color:var(--gx-signal-soft); }
  .mini-refresh svg{ width:14px;height:14px;stroke:currentColor; }
  .mini-refresh.spinning svg{ animation:gxSpin .6s linear; }

  /* fields reused from login.html */
  .gx-field{margin-bottom:14px;}
  .gx-field label{
    display:flex;align-items:center;gap:6px;
    margin-bottom:6px;font-size:11.5px;color:var(--ink-300);
    font-family:var(--gx-font);letter-spacing:0.5px;text-transform:uppercase;
  }
  .gx-input-wrap input, .gx-input-wrap textarea, .gx-input-wrap select{
    width:100%;padding:12px 14px;border-radius:12px;
    border:1px solid rgba(255,0,1,0.25);
    background:rgba(255,255,255,0.96);color:#161a2c;font-size:0.95rem;
    font-family:'Noto Sans Lao', sans-serif;
    transition:border-color .2s ease, box-shadow .2s ease;
  }
  .gx-input-wrap textarea{resize:vertical;min-height:96px;line-height:1.5;}
  .gx-input-wrap input::placeholder, .gx-input-wrap textarea::placeholder{color:var(--ink-500);}
  .gx-input-wrap input:focus, .gx-input-wrap textarea:focus, .gx-input-wrap select:focus{
    outline:none;border-color:var(--gx-signal);
    box-shadow:0 0 0 3px var(--gx-signal-dim);
  }
  .gx-row2{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }

  .gx-submit{
    position:relative;overflow:hidden;
    width:100%;margin-top:6px;border:none;border-radius:14px;padding:13px;
    background:var(--black-500);
    color:var(--shine);font-weight:700;font-size:14.5px;
    font-family:var(--gx-font);letter-spacing:0.5px;
    border:1px solid rgba(255,0,1,0.35);
    box-shadow:none;
    cursor:pointer;transition:transform .15s ease, box-shadow .2s ease;
    display:flex;align-items:center;justify-content:center;gap:8px;
  }
  .gx-submit:hover{box-shadow:none;}
  .gx-submit:active{transform:scale(0.98);}
  .gx-submit:disabled{opacity:.6;cursor:default;}
  .gx-submit.danger{ border-color:rgba(232,57,90,0.4); }
  .gx-spinner{
    width:15px;height:15px;border-radius:50%;
    border:2px solid rgba(232,232,238,0.25); border-top-color:var(--shine);
    animation:gxSpin .7s linear infinite; display:none;
  }
  .gx-submit.loading .gx-spinner{display:inline-block;}
  .gx-submit.loading .gx-submit-label{opacity:.6;}

  .gx-msg{
    display:flex;align-items:center;gap:7px;justify-content:center;
    margin-top:12px;font-size:13px;min-height:1.4em;
    opacity:0;transform:translateY(-4px);
    transition:opacity .25s ease, transform .25s ease;
  }
  .gx-msg.show{opacity:1;transform:translateY(0);}
  .gx-msg.error{color:var(--gx-danger);}
  .gx-msg.success{color:var(--gx-success);}
  .gx-msg.pending{color:var(--ink-300);}

  /* ===== image dropzone ===== */
  .drop-zone{
    border:1.5px dashed rgba(255,0,1,0.35); border-radius:14px;
    padding:18px; text-align:center; cursor:pointer;
    color:var(--ink-500); font-size:12.5px;
    transition:border-color .2s ease, background .2s ease;
    position:relative; overflow:hidden;
  }
  .drop-zone:hover{ border-color:var(--gx-signal-soft); background:rgba(255,0,1,0.04); }
  .drop-zone.has-image{ padding:0; border-style:solid; }
  .drop-zone img{ width:100%; max-height:200px; object-fit:cover; display:block; border-radius:12px; }
  .drop-zone input[type=file]{ position:absolute; inset:0; opacity:0; cursor:pointer; }

  /* ===== ຮູບປະຈຳໝວດໝູ່ (1-10) ===== */
  .cat-field-group{
    position:relative;
    padding:14px 12px 12px; margin-bottom:12px;
    border:1px solid rgba(255,0,1,0.16); border-radius:16px;
    background:#0d0d0d;
  }
  .cat-field-group.cat-numbered{ padding-left:44px; }
  .cat-field-group .cat-num-badge{
    position:absolute; top:14px; left:12px; width:22px;height:22px;border-radius:8px;
    background:var(--black-500);
    color:#fff; font-family:var(--gx-font); font-weight:700; font-size:11.5px;
    display:flex;align-items:center;justify-content:center;
    box-shadow:0 3px 10px -3px rgba(255,20,90,0.55);
  }
  .cat-enable-row{
    display:flex; align-items:center; justify-content:flex-end; gap:7px;
    margin:0 0 10px;
  }
  .cat-enable-row .pause-toggle-label{ margin:0; font-size:0.78rem; }
  .cat-enable-row .cat-enable-state{
    font-size:10.5px; font-weight:700; padding:2px 8px; border-radius:20px;
    border:1px solid rgba(120,255,150,0.35); background:rgba(120,255,150,0.1); color:#3ecb63;
  }
  .cat-enable-row .cat-enable-state.is-off{
    border-color:rgba(255,0,1,0.35); background:rgba(255,0,1,0.08); color:var(--gx-danger);
  }
  .cat-img-row{ display:flex; align-items:stretch; gap:8px; margin-top:8px; }
  .drop-zone.cat-img-drop{ flex:1; padding:10px; font-size:11.5px; }
  .drop-zone.cat-img-drop img{ max-height:90px; border-radius:10px; }
  .cat-img-remove-btn{
    flex-shrink:0; border:1px solid rgba(255,0,1,0.35); background:transparent;
    color:var(--gx-danger); border-radius:10px; padding:0 12px; font-size:12px;
    cursor:pointer; white-space:nowrap;
  }
  .cat-img-remove-btn:hover{ background:rgba(255,0,1,0.08); }

  /* ===== ຢືນຢັນຊື່ໝວດໝູ່ ແຍກແຕ່ລະອັນ (ບໍ່ຕ້ອງເລື່ອນລົງໄປກົດປຸ່ມລວມ) ===== */
  .cat-name-row{ display:flex; align-items:stretch; gap:8px; }
  .cat-name-row input{ flex:1; min-width:0; }
  .cat-name-confirm-btn{
    flex-shrink:0; border:1px solid rgba(255,0,1,0.4);
    background:var(--black-500);
    color:var(--shine); border-radius:10px; padding:0 16px; font-size:12.5px;
    font-weight:700; font-family:var(--gx-font); letter-spacing:0.3px;
    cursor:pointer; white-space:nowrap; transition:box-shadow .2s ease, transform .15s ease;
  }
  .cat-name-confirm-btn:hover{ box-shadow:0 0 14px -4px var(--gx-signal-soft); }
  .cat-name-confirm-btn:active{ transform:scale(0.96); }
  .cat-name-confirm-btn.loading{ opacity:.6; cursor:default; pointer-events:none; }
  .cat-name-msg{ margin-top:6px; justify-content:flex-start; font-size:12px; }

  /* ===== product management list ===== */
  .prod-row{
    display:flex; gap:12px; align-items:flex-start;
    padding:14px 0; border-bottom:1px solid rgba(255,0,1,0.12);
  }
  .prod-row:last-child{ border-bottom:none; }
  .prod-thumb{
    width:56px;height:56px;border-radius:10px;flex-shrink:0;
    background:rgba(255,0,1,0.04); border:1px solid rgba(255,0,1,0.18);
    object-fit:cover;
  }
  .prod-thumb-wrap{
    position:relative; width:56px; height:56px; flex-shrink:0;
    cursor:pointer; -webkit-tap-highlight-color:transparent;
  }
  .prod-thumb-wrap .prod-thumb{ width:100%; height:100%; display:block; transition:opacity .2s ease, filter .2s ease; }
  .prod-thumb-wrap:hover .prod-thumb{ border-color:var(--gx-signal-soft); }
  .thumb-edit-badge{
    position:absolute; right:-6px; bottom:-6px;
    width:22px; height:22px; border-radius:50%;
    display:flex; align-items:center; justify-content:center;
    background:#e11d2e; color:#fff; border:2px solid #0b0b0d;
    box-shadow:0 0 10px -2px rgba(255,0,1,.6); pointer-events:none;
  }
  .thumb-edit-badge svg{ width:11px; height:11px; }
  .prod-thumb-wrap.uploading{ cursor:progress; }
  .prod-thumb-wrap.uploading .prod-thumb{ opacity:.35; filter:blur(1px); }
  .prod-thumb-wrap.uploading::after{
    content:''; position:absolute; top:50%; left:50%; width:20px; height:20px; margin:-10px 0 0 -10px;
    border-radius:50%; border:2px solid rgba(255,255,255,.25); border-top-color:#fff;
    animation:thumbSpin .7s linear infinite;
  }
  @keyframes thumbSpin{ to{ transform:rotate(360deg); } }
  .prod-fields{ flex:1; min-width:0; display:flex; flex-direction:column; gap:8px; }
  .prod-fields .gx-row2 input{ width:100%; min-width:0; padding:9px 10px; font-size:0.88rem; }
  .prod-meta-row{ display:flex; justify-content:space-between; align-items:center; gap:8px; }
  .prod-stock{ font-size:11px; color:var(--ink-500); white-space:nowrap; }
  .prod-actions{ display:flex; gap:8px; }
  .icon-btn{
    width:34px;height:34px;border-radius:9px;flex-shrink:0;
    display:flex;align-items:center;justify-content:center;
    background:rgba(255,0,1,0.05); border:1px solid rgba(255,0,1,0.22);
    color:var(--ink-300); cursor:pointer; transition:all .15s ease;
  }
  .icon-btn:hover{ border-color:var(--gx-signal-soft); color:var(--shine-dim); }
  .icon-btn.save-btn:hover{ border-color:rgba(32,181,106,0.5); color:var(--gx-success); }
  .icon-btn.del-btn:hover{ border-color:rgba(232,57,90,0.5); color:var(--gx-danger); }
  .icon-btn.hard-del-btn{ border-color:rgba(232,57,90,0.35); color:var(--gx-danger); }
  .icon-btn.hard-del-btn:hover{ border-color:var(--gx-danger); background:rgba(232,57,90,0.12); color:var(--gx-danger); }
  .icon-btn svg{ width:15px;height:15px;stroke:currentColor; }
  .empty-note{ text-align:center; color:var(--ink-500); font-size:13px; padding:24px 0; }

  select#codeProductSelect{ appearance:none; -webkit-appearance:none; }

  /* ===== top-up requests panel ===== */
  .topup-card{
    border-radius:16px;
    background:linear-gradient(165deg, rgba(255,0,1,0.07), rgba(255,0,1,0.015));
    border:1px solid rgba(255,0,1,0.18);
    padding:16px;margin-bottom:14px;
    position:relative;overflow:hidden;
    animation:topupIn .35s ease both;
  }
  @keyframes topupIn{ from{opacity:0;transform:translateY(8px);} to{opacity:1;transform:translateY(0);} }
  .topup-card::before{
    content:'';position:absolute;top:0;left:0;right:0;height:2px;
    background:linear-gradient(90deg, transparent, var(--gx-signal-soft), transparent);
  }
  .topup-head{ display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:12px; gap:10px; }
  .topup-amount{ font-family:var(--gx-font); font-weight:700; font-size:21px; color:var(--shine); }
  .topup-meta{ font-size:11.5px; color:var(--ink-500); line-height:1.6; margin-top:2px; }
  .topup-meta .ref{ color:var(--ink-300); }
  .topup-status-tag{
    flex-shrink:0; font-size:10.5px; padding:4px 11px; border-radius:20px;
    font-family:var(--gx-font); font-weight:600; letter-spacing:.4px; white-space:nowrap;
  }
  .topup-status-tag.pending{
    background:rgba(255,176,32,0.14); color:var(--gx-warn); border:1px solid rgba(255,176,32,0.35);
    animation:tagPulse 1.8s ease-in-out infinite;
  }
  @keyframes tagPulse{
    0%,100%{ box-shadow:0 0 0 0 rgba(255,176,32,0.35); }
    50%{ box-shadow:0 0 0 5px rgba(255,176,32,0); }
  }
  .topup-slip-wrap{
    border-radius:12px; overflow:hidden; border:1px solid rgba(255,0,1,0.2);
    margin-bottom:14px; cursor:zoom-in; position:relative; background:rgba(0,0,0,0.03);
  }
  .topup-slip-wrap img{ width:100%; max-height:260px; object-fit:contain; display:block; }
  .topup-slip-wrap .zoom-hint{
    position:absolute; bottom:8px; right:8px; background:rgba(10,8,20,0.55);
    color:#fff; font-size:10px; padding:3px 9px; border-radius:20px;
    display:flex; align-items:center; gap:4px; 
  }
  .topup-slip-wrap .zoom-hint svg{ width:11px;height:11px;stroke:currentColor; }
  .topup-actions-row{ display:flex; gap:10px; }
  .topup-btn{
    flex:1; border:none; border-radius:11px; padding:12px;
    font-family:var(--gx-font); font-weight:700; font-size:13.5px; letter-spacing:.3px;
    cursor:pointer; display:flex; align-items:center; justify-content:center; gap:7px;
    transition:transform .15s ease, box-shadow .2s ease, opacity .2s ease;
  }
  .topup-btn:active{ transform:scale(0.96); }
  .topup-btn:disabled{ opacity:.5; cursor:default; }
  .topup-btn svg{ width:16px;height:16px;stroke:currentColor; }
  .topup-btn.approve{
    background:linear-gradient(135deg, #22c579, #159657);
    color:#fff; box-shadow:0 4px 14px -4px rgba(32,181,106,0.55);
  }
  .topup-btn.approve:hover{ box-shadow:0 4px 20px -3px rgba(32,181,106,0.7); }
  .topup-btn.reject{
    background:linear-gradient(135deg, #ec4a6b, #c22246);
    color:#fff; box-shadow:0 4px 14px -4px rgba(232,57,90,0.55);
  }
  .topup-btn.reject:hover{ box-shadow:0 4px 20px -3px rgba(232,57,90,0.7); }
  /* ===== slip lightbox (fullscreen viewer) ===== */
  .slip-lightbox{
    position:fixed; inset:0; z-index:80; background:rgba(8,6,16,0.92);
    display:none; align-items:center; justify-content:center; padding:24px;
     
    animation:lbIn .2s ease;
  }
  .slip-lightbox.show{ display:flex; }
  @keyframes lbIn{ from{opacity:0;} to{opacity:1;} }
  .slip-lightbox img{
    max-width:100%; max-height:88vh; border-radius:14px;
    box-shadow:0 25px 70px -12px rgba(0,0,0,0.7);
    border:1px solid rgba(255,0,1,0.3);
  }
  .slip-lightbox .lb-close{
    position:absolute; top:18px; right:18px; width:38px;height:38px;border-radius:50%;
    background:rgba(255,255,255,0.08); border:1px solid rgba(255,255,255,0.18);
    color:#fff; display:flex; align-items:center; justify-content:center; cursor:pointer;
  }
  .slip-lightbox .lb-close svg{ width:18px;height:18px;stroke:currentColor; }

  /* ===== duration options (12ຊມ / 1ວັນ ... 30ວັນ) ===== */
  .duration-toggle-label{
    display:flex; align-items:center; gap:8px; cursor:pointer;
    font-size:0.95rem; color:var(--ink-100); text-transform:none;
    font-family:'Noto Sans Lao', sans-serif; letter-spacing:0;
  }
  .duration-toggle-label input[type="checkbox"]{
    width:18px;height:18px;accent-color:var(--gx-signal);cursor:pointer;flex-shrink:0;
  }
  .duration-options-list{
    display:flex; flex-direction:column; gap:8px;
    border:1px solid rgba(255,0,1,0.18); border-radius:12px;
    padding:12px; background:rgba(255,0,1,0.03);
  }
  .duration-opt-row{
    display:flex; align-items:center; gap:10px;
  }
  .duration-opt-row label{
    display:flex; align-items:center; gap:8px; flex:1; min-width:64px;
    font-size:0.9rem; color:var(--ink-100); cursor:pointer;
  }
  .duration-opt-row input[type="checkbox"]{
    width:16px;height:16px;accent-color:var(--gx-signal);cursor:pointer;flex-shrink:0;
  }
  .duration-opt-row .dur-price{
    width:150px; padding:8px 10px; border-radius:8px;
    border:1px solid rgba(255,0,1,0.25); background:#fff;
    color:#161a2c; font-size:0.9rem;
  }
  .duration-opt-row .cdr-label{
    flex:1; min-width:0; padding:8px 10px; border-radius:8px;
    border:1px solid rgba(255,0,1,0.25); background:#fff;
    color:#161a2c; font-size:0.85rem; font-family:inherit;
  }
  .duration-opt-row .cdr-remove{
    flex-shrink:0; width:28px;height:28px;border-radius:8px;
    border:1px solid rgba(232,57,90,0.3); background:rgba(232,57,90,0.06);
    color:var(--gx-danger); font-size:15px; line-height:1; cursor:pointer;
  }
  .duration-add-row{
    width:100%; background:none; border:none; padding:2px 0;
    display:flex; align-items:center; gap:8px;
    color:var(--gx-signal); font-weight:600; font-size:0.9rem; cursor:pointer;
    font-family:'Noto Sans Lao', sans-serif; text-align:left;
  }
  .duration-add-row:hover{ opacity:0.75; }
  .duration-pill-badge{
    display:inline-flex; align-items:center; gap:4px;
    font-size:10.5px; padding:2px 8px; border-radius:20px;
    background:rgba(255,0,1,0.12); color:var(--gx-signal);
    border:1px solid rgba(255,0,1,0.25); margin-left:6px;
  }
  .prod-duration-list{
    display:flex; flex-wrap:wrap; gap:6px; margin-top:8px;
  }
  .prod-duration-chip{
    font-size:10.5px; padding:3px 9px; border-radius:20px;
    background:rgba(255,0,1,0.08); border:1px solid rgba(255,0,1,0.2);
    color:var(--ink-300);
    display:inline-flex; align-items:center; gap:5px;
    cursor:pointer; transition:background .15s ease, border-color .15s ease;
  }
  .prod-duration-chip:hover{
    background:rgba(255,0,1,0.16); border-color:rgba(255,0,1,0.4);
  }
  .prod-duration-chip .pdc-edit-icon{
    width:11px; height:11px; flex-shrink:0; opacity:.6;
  }
  .prod-duration-chip.is-editing{
    background:#fff; border-color:var(--gx-signal); padding:3px 4px 3px 9px; cursor:default;
  }
  .prod-duration-chip .pdc-price-input{
    width:78px; font-size:11px; padding:2px 6px; border-radius:12px;
    border:1px solid rgba(255,0,1,0.3); color:#161a2c; background:#fff;
  }
  .prod-duration-chip .pdc-save-btn,
  .prod-duration-chip .pdc-cancel-btn{
    width:20px; height:20px; border-radius:50%; border:none; flex-shrink:0;
    display:flex; align-items:center; justify-content:center; cursor:pointer;
  }
  .prod-duration-chip .pdc-save-btn{ background:rgba(34,197,94,0.15); color:#16a34a; }
  .prod-duration-chip .pdc-save-btn:hover{ background:rgba(34,197,94,0.3); }
  .prod-duration-chip .pdc-save-btn svg{ width:12px; height:12px; }
  .prod-duration-chip .pdc-cancel-btn{ background:rgba(239,68,68,0.1); color:#dc2626; }
  .prod-duration-chip .pdc-cancel-btn:hover{ background:rgba(239,68,68,0.22); }
  .prod-duration-chip .pdc-cancel-btn svg{ width:11px; height:11px; }
  .prod-row.is-archived{
    opacity: 0.55;
  }
  .archived-tag{
    display:inline-block;
    font-size:10.5px; font-weight:600;
    padding:2px 8px; border-radius:20px;
    background:rgba(239,68,68,0.1); color:#dc2626;
    border:1px solid rgba(239,68,68,0.25);
    margin-bottom:8px;
  }

  /* ===== ລິ້ງໂບນັດ — ຕອນເພີ່ມສິນຄ້າໃໝ່ ===== */
  .link-rows-list{
    display:flex; flex-direction:column; gap:8px;
    border:1px solid rgba(255,0,1,0.18); border-radius:12px;
    padding:12px; background:rgba(255,0,1,0.03);
    margin-bottom:8px;
  }
  .link-row{ display:flex; gap:8px; align-items:center; }
  .link-row input{
    flex:1; min-width:0; padding:8px 10px; border-radius:8px;
    border:1px solid rgba(255,0,1,0.25); background:#fff;
    color:#161a2c; font-size:0.85rem; font-family:inherit;
  }
  .link-row-remove{
    flex-shrink:0; width:30px;height:30px;border-radius:8px;
    border:1px solid rgba(232,57,90,0.3); background:rgba(232,57,90,0.06);
    color:var(--gx-danger); font-size:16px; line-height:1; cursor:pointer;
  }
  .gx-add-link-btn{
    width:100%; padding:10px; border-radius:10px;
    border:1.5px dashed rgba(255,0,1,0.35); background:transparent;
    color:var(--gx-signal); font-weight:700; font-size:0.85rem; cursor:pointer;
    font-family:var(--gx-font);
  }
  .gx-add-link-btn:hover{ background:rgba(255,0,1,0.05); }

  /* ===== ຢຸດຂາຍຊົ່ວຄາວ ===== */
  .pause-toggle-label{
    display:flex; align-items:center; gap:8px; cursor:pointer;
    font-size:0.85rem; color:var(--ink-100);
    font-family:'Noto Sans Lao', sans-serif;
    margin:2px 0;
  }
  .pause-toggle-label input[type="checkbox"]{
    width:16px;height:16px;accent-color:var(--gx-warn);cursor:pointer;flex-shrink:0;
  }
  .pause-note-wrap input{
    width:100%; padding:8px 10px; border-radius:8px;
    border:1px solid rgba(255,176,32,0.35); background:rgba(255,176,32,0.04);
    color:var(--ink-100); font-size:0.82rem; font-family:inherit;
  }
  .paused-tag{
    display:inline-block;
    font-size:10.5px; font-weight:600;
    padding:2px 8px; border-radius:20px;
    background:rgba(255,176,32,0.14); color:#a06600;
    border:1px solid rgba(255,176,32,0.35);
    margin-bottom:8px;
  }
  .prod-row.is-paused{ opacity:0.85; }

  /* ===== ລິ້ງໂບນັດ — ຕອນຈັດການສິນຄ້າ ===== */
  .prod-links-section{ margin-top:4px; }
  .prod-links-list{
    display:flex; flex-wrap:wrap; gap:6px; margin-bottom:8px;
  }
  .prod-link-chip{
    display:inline-flex; align-items:center; gap:6px;
    font-size:10.5px; padding:3px 6px 3px 9px; border-radius:20px;
    background:rgba(255,0,1,0.08); border:1px solid rgba(255,0,1,0.2);
    color:var(--ink-300);
  }
  .link-chip-remove{
    width:16px;height:16px;border-radius:50%;flex-shrink:0;
    border:none; background:rgba(232,57,90,0.14); color:var(--gx-danger);
    font-size:11px; line-height:1; cursor:pointer;
  }
  .link-add-inline{ display:flex; gap:6px; }
  .link-add-inline input{
    flex:1; min-width:0; padding:7px 9px; border-radius:8px;
    border:1px solid rgba(255,0,1,0.22); background:#fff;
    color:#161a2c; font-size:0.8rem; font-family:inherit;
  }
  .link-add-btn{
    flex-shrink:0; width:30px;height:30px;border-radius:8px;
    border:1px solid rgba(255,0,1,0.3); background:rgba(255,0,1,0.06);
    color:var(--gx-signal); font-size:16px; line-height:1; cursor:pointer;
  }

  /* ===== reseller / agent panel ===== */
  .tier-card{
    display:flex; flex-direction:column; gap:10px;
    padding:14px 0; border-bottom:1px solid rgba(255,0,1,0.12);
  }
  .tier-card:last-child{ border-bottom:none; }
  .tier-card-head{ display:flex; align-items:center; justify-content:space-between; gap:8px; }
  .tier-card-title{ font-family:var(--gx-font); font-weight:700; font-size:15px; color:var(--shine); }
  .tier-card-sub{ font-size:11px; color:var(--ink-500); }
  .tier-card-fields{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
  .tier-card-fields.single{ grid-template-columns:1fr; }
  .tier-card-fields label{ font-size:11px; color:var(--ink-500); display:block; margin-bottom:4px; }
  .tier-card-fields input{ width:100%; padding:9px 10px; font-size:0.88rem; }
  .tier-card-lifetime-note{ font-size:11.5px; color:var(--ink-500); }

  .agent-key-row{
    display:flex; align-items:center; justify-content:space-between; gap:10px;
    padding:12px 0; border-bottom:1px solid rgba(255,0,1,0.12); flex-wrap:wrap;
  }
  .agent-key-row:last-child{ border-bottom:none; }
  .agent-key-main{ display:flex; flex-direction:column; gap:3px; min-width:0; }
  .agent-key-code{ font-family:var(--gx-font); font-weight:700; font-size:14px; color:var(--shine); letter-spacing:.4px; }
  .agent-key-meta{ font-size:11px; color:var(--ink-500); }
  .agent-key-right{ display:flex; align-items:center; gap:8px; flex-shrink:0; }

  .key-status-tag{
    flex-shrink:0; font-size:10.5px; padding:4px 11px; border-radius:20px;
    font-family:var(--gx-font); font-weight:600; letter-spacing:.4px; white-space:nowrap;
  }
  .key-status-tag.unused{ background:rgba(32,181,106,0.14); color:var(--gx-success); border:1px solid rgba(32,181,106,0.35); }
  .key-status-tag.used{ background:rgba(120,120,130,0.14); color:var(--ink-500); border:1px solid rgba(120,120,130,0.3); }

  .key-copy-btn{
    width:32px;height:32px;border-radius:8px;flex-shrink:0;
    display:flex;align-items:center;justify-content:center;
    background:rgba(255,0,1,0.05); border:1px solid rgba(255,0,1,0.22);
    color:var(--ink-300); cursor:pointer; transition:all .15s ease;
  }
  .key-copy-btn:hover{ border-color:var(--gx-signal-soft); color:var(--shine-dim); }
  .key-copy-btn svg{ width:14px;height:14px;stroke:currentColor; }

  .new-key-banner{
    margin-top:14px; border-radius:14px; padding:16px;
    background:linear-gradient(165deg, rgba(32,181,106,0.1), rgba(32,181,106,0.02));
    border:1px solid rgba(32,181,106,0.3);
    display:flex; align-items:center; justify-content:space-between; gap:10px;
    animation:topupIn .35s ease both;
  }
  .new-key-banner-code{ font-family:var(--gx-font); font-weight:800; font-size:18px; letter-spacing:1px; color:var(--gx-success); word-break:break-all; }
  .new-key-banner-label{ font-size:11px; color:var(--ink-500); margin-bottom:4px; }

  .price-prod-card{
    padding:14px 0; border-bottom:1px solid rgba(255,0,1,0.12);
  }
  .price-prod-card:last-child{ border-bottom:none; }
  .price-prod-name{ font-family:var(--gx-font); font-weight:700; font-size:14px; color:var(--shine); margin-bottom:8px; }
  .price-dur-base{ font-family:var(--gx-font); font-weight:500; font-size:11.5px; color:var(--ink-500); }
  .price-dur-list{ display:flex; flex-direction:column; gap:8px; }
  .price-dur-row{ display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; }
  .price-dur-label{ font-size:12.5px; color:var(--ink-300); flex-shrink:0; }
  .price-dur-row input{ flex:1; min-width:120px; padding:9px 10px; font-size:0.88rem; }
  .price-prod-card .gx-submit{ padding:10px 16px; font-size:0.85rem; min-height:0; }

  .agent-cat-row{ display:flex; gap:8px; overflow-x:auto; margin:2px 0 14px; padding-bottom:2px; }
  .agent-cat-tab{
    flex-shrink:0; display:flex; flex-direction:column; align-items:center; gap:3px;
    padding:9px 14px; border-radius:12px; border:1px solid var(--navy-700); background:var(--navy-800);
    cursor:pointer; user-select:none; min-width:76px; transition:.15s;
  }
  .agent-cat-tab .agent-cat-name{ font-family:var(--gx-font); font-size:11.5px; font-weight:700; color:var(--ink-300); white-space:nowrap; }
  .agent-cat-tab .agent-cat-count{ font-size:9.5px; color:var(--ink-500); }
  .agent-cat-tab.active{ border-color:var(--gx-signal-soft); background:var(--gx-signal-dim); }
  .agent-cat-tab.active .agent-cat-name{ color:#ffdada; }
  .agent-cat-tab.active .agent-cat-count{ color:#ffb3b3; }

  .search-row-agent{ position:relative; margin-bottom:10px; }
  .search-row-agent input{
    width:100%; background:var(--navy-900); border:1px solid var(--navy-700); color:var(--ink-100);
    border-radius:11px; padding:10px 12px; font-family:var(--gx-font); font-size:12.5px;
  }
  .search-row-agent input::placeholder{ color:var(--ink-500); }
  .search-row-agent input:focus{ outline:none; border-color:var(--gx-signal-soft); }

  .agent-acc-row{
    display:flex; align-items:flex-start; justify-content:space-between; gap:10px;
    padding:13px 0; border-bottom:1px solid rgba(255,0,1,0.12); flex-wrap:wrap;
  }
  .agent-acc-row:last-child{ border-bottom:none; }
  .agent-acc-main{ flex:1; min-width:180px; }
  .agent-acc-email{ font-family:var(--gx-font); font-weight:700; font-size:13.5px; color:var(--shine); word-break:break-all; }
  .agent-acc-meta{ font-size:11px; color:var(--ink-500); margin-top:2px; line-height:1.7; }
  .agent-acc-progress{ margin-top:8px; max-width:280px; }
  .agent-acc-bar{ height:6px; border-radius:99px; background:var(--navy-700); overflow:hidden; }
  .agent-acc-bar-fill{ height:100%; background:var(--gx-signal); border-radius:99px; transition:width .3s; }
  .agent-acc-bar-fill.full{ background:var(--gx-success); }
  .agent-acc-progress-text{ font-size:10.5px; color:var(--ink-500); margin-top:4px; display:block; }
  .agent-acc-note{ font-size:10.5px; color:var(--gx-warn); margin-top:4px; }
  .agent-acc-countdown{
    display:inline-block; white-space:nowrap; vertical-align:baseline;
    font-family:var(--gx-font, 'Space Grotesk', monospace);
    font-variant-numeric:tabular-nums; font-feature-settings:'tnum' 1;
    min-width:12ch; /* ກວ້າງຄົງທີ່ ບໍ່ໃຫ້ຂະໜາດແຖວປ່ຽນທຸກວິນາທີ */
    font-weight:700; color:var(--shine);
  }
  .agent-acc-hold{ font-size:10.5px; color:var(--gx-warn); margin-top:4px; display:flex; align-items:center; gap:5px; }
  .agent-acc-live-dot{ display:inline-block; width:5px; height:5px; border-radius:50%; background:var(--gx-success); box-shadow:0 0 6px var(--gx-success); animation:agent-acc-pulse 1.2s infinite; }
  @keyframes agent-acc-pulse{ 0%,100%{ opacity:1; } 50%{ opacity:.35; } }
  .agent-acc-right{ display:flex; flex-direction:column; align-items:flex-end; gap:8px; flex-shrink:0; }
  .agent-acc-toggle-btn{
    font-family:var(--gx-font); font-size:11px; font-weight:600; padding:7px 12px; border-radius:9px;
    cursor:pointer; white-space:nowrap;
    background:rgba(232,49,49,0.12); border:1px solid rgba(232,49,49,0.4); color:var(--gx-danger);
  }
  .agent-acc-toggle-btn:hover{ background:rgba(232,49,49,0.2); }
  .agent-acc-toggle-btn.is-revoked{
    background:rgba(32,181,106,0.14); border-color:rgba(32,181,106,0.35); color:var(--gx-success);
  }
  .agent-acc-toggle-btn:disabled{ opacity:.6; cursor:default; }
  .key-status-tag.revoked{ background:rgba(232,49,49,0.14); color:var(--gx-danger); border:1px solid rgba(232,49,49,0.35); }

  /* ================= D2 DASHBOARD (ໜ້າສະຫຼຸບຫຼັກ — ຕໍ່ຂໍ້ມູນຈິງ) ================= */
  .d2-board{ margin-bottom:18px; }
  .d2-kpi-row{ display:grid; grid-template-columns:repeat(4,1fr); gap:8px; margin-bottom:12px; }
  .d2-kpi{ background:var(--gx-panel,#111); border:1px solid rgba(255,0,1,0.16); border-radius:16px; padding:12px 8px; text-align:center; }
  .d2-kpi-num{ font-weight:700; font-size:21px; line-height:1; }
  .d2-kpi-label{ font-size:9.5px; color:var(--gx-ink-dim,#9a9694); margin-top:5px; line-height:1.35; }

  .d2-sum-row{ display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-bottom:12px; }
  .d2-sum-card{ background:var(--gx-panel,#111); border:1px solid rgba(255,0,1,0.16); border-radius:18px; padding:14px; }
  .d2-sum-card.d2-acc-green{ border-color:rgba(35,197,94,.28); }
  .d2-sum-card.d2-acc-violet{ border-color:rgba(124,92,255,.28); }
  .d2-sum-label{ font-size:10px; color:var(--gx-ink-dim,#9a9694); line-height:1.4; }
  .d2-sum-value{ font-weight:700; font-size:20px; line-height:1.1; margin-top:4px; }
  .d2-sum-unit{ font-size:9.5px; color:var(--gx-ink-dim,#9a9694); margin-top:1px; }

  .d2-challenge-card{
    position:relative;
    background:linear-gradient(180deg, rgba(124,92,255,0.09), rgba(124,92,255,0.02));
    border:1px solid rgba(124,92,255,0.35); border-radius:20px; padding:14px 14px 12px; margin-bottom:14px;
    overflow:hidden;
  }
  .d2-ch-track{ display:flex; transition:transform .38s cubic-bezier(.22,.9,.3,1); }
  .d2-ch-slide{ flex:0 0 100%; min-width:100%; }
  .d2-ch-head{ display:flex; align-items:flex-start; justify-content:space-between; gap:10px; margin-bottom:10px; }
  .d2-ch-title{ font-weight:700; font-size:13px; }
  .d2-ch-sub{ font-size:10.5px; color:var(--gx-ink-dim,#9a9694); margin-top:3px; }
  .d2-ch-badge{ flex-shrink:0; font-size:10px; font-weight:700; padding:3px 10px; border-radius:20px; white-space:nowrap; }
  .d2-ch-badge.d2-up{ background:rgba(35,197,94,0.14); color:#23c55e; }
  .d2-ch-badge.d2-down{ background:rgba(255,0,1,0.14); color:#ff6767; }
  .d2-ch-badge.d2-flat{ background:rgba(255,255,255,0.06); color:#a9a6a3; }
  .d2-ch-badge.d2-reset{ background:rgba(124,92,255,0.16); color:#c9bfff; }
  .d2-ch-value{ font-weight:700; font-size:28px; line-height:1; margin-bottom:4px; }
  .d2-ch-value span{ font-size:12px; color:var(--gx-ink-dim,#9a9694); font-weight:600; margin-left:5px; }
  .d2-ch-prev{ font-size:10.5px; color:var(--gx-ink-dim,#9a9694); margin-bottom:10px; }
  .d2-ch-nav{ display:flex; align-items:center; gap:8px; }
  .d2-ch-arrow{
    flex-shrink:0; width:38px; height:38px; border-radius:12px;
    background:rgba(124,92,255,0.1); border:1px solid rgba(124,92,255,.35); color:#c9bfff;
    display:flex; align-items:center; justify-content:center; cursor:pointer;
    transition:opacity .15s ease, transform .12s ease;
  }
  .d2-ch-arrow:active{ transform:scale(0.92); }
  .d2-ch-arrow:disabled{ opacity:.25; cursor:default; pointer-events:none; }
  .d2-ch-arrow svg{ width:16px; height:16px; stroke:currentColor; }
  .d2-ch-recheck-btn{
    flex:1; display:flex; align-items:center; justify-content:center; gap:8px;
    background:rgba(124,92,255,0.14); border:1px solid rgba(124,92,255,.4); color:#c9bfff;
    font-weight:600; font-size:12.5px; padding:10px; border-radius:14px; cursor:pointer;
  }
  .d2-ch-recheck-btn:disabled{ opacity:.55; cursor:not-allowed; }
  .d2-ch-recheck-btn svg{ width:14px; height:14px; stroke:currentColor; }
  .d2-ch-recheck-btn.d2-spinning svg{ animation:d2spin .6s linear; }
  @keyframes d2spin{ from{transform:rotate(0deg);} to{transform:rotate(360deg);} }
  .d2-ch-lastcheck{ text-align:center; font-size:10px; color:var(--gx-ink-dim,#9a9694); margin-top:8px; }
  .d2-ch-dots{ display:flex; justify-content:center; gap:5px; margin-top:10px; }
  .d2-ch-dot{ width:5px; height:5px; border-radius:50%; background:rgba(255,255,255,0.15); transition:background .2s ease, width .2s ease; }
  .d2-ch-dot.active{ background:#c9bfff; width:14px; border-radius:3px; }

  .d2-attn{
    background:linear-gradient(180deg, rgba(255,0,1,0.07), rgba(255,0,1,0.02));
    border:1px solid rgba(255,0,1,0.4); border-radius:20px; padding:14px 12px 6px; margin-bottom:16px;
  }
  .d2-attn-head{ display:flex; align-items:center; gap:9px; margin-bottom:10px; }
  .d2-attn-head svg{ width:16px; height:16px; stroke:var(--gx-signal,#ff0001); flex-shrink:0; }
  .d2-attn-title{ font-weight:700; font-size:13px; }
  .d2-attn-count{ margin-left:auto; background:var(--gx-signal,#ff0001); color:#fff; font-size:10.5px; font-weight:700; padding:2px 9px; border-radius:20px; }
  .d2-attn-row{ display:flex; align-items:center; gap:11px; padding:10px 6px; border-radius:12px; cursor:pointer; border-bottom:1px solid rgba(255,255,255,0.04); }
  .d2-attn-row:last-child{ border-bottom:none; }
  .d2-attn-dot{ width:9px; height:9px; border-radius:50%; flex-shrink:0; box-shadow:0 0 0 4px currentColor; }
  .d2-attn-dot.d2-sev-high{ background:#ff0001; color:rgba(255,0,1,0.18); }
  .d2-attn-dot.d2-sev-mid{ background:#ffb020; color:rgba(255,176,32,0.18); }
  .d2-attn-body{ flex:1; min-width:0; }
  .d2-attn-text{ font-size:12.5px; font-weight:600; line-height:1.4; }
  .d2-attn-sub{ font-size:10.8px; color:var(--gx-ink-dim,#9a9694); margin-top:2px; }
  .d2-attn-arrow{ width:24px; height:24px; border-radius:8px; flex-shrink:0; background:rgba(255,255,255,0.04); display:flex; align-items:center; justify-content:center; color:var(--gx-ink-dim,#9a9694); }
  .d2-attn-arrow svg{ width:11px; height:11px; stroke:currentColor; }
  .d2-attn-empty{ display:flex; align-items:center; gap:9px; padding:12px 6px; color:#23c55e; font-size:12.5px; font-weight:600; }
  .d2-attn-empty svg{ width:16px; height:16px; stroke:#23c55e; }

  .d2-cat-group{ margin-bottom:16px; }
  .d2-cat-head{ display:flex; align-items:center; gap:9px; padding:0 4px; margin-bottom:8px; }
  .d2-cat-swatch{ width:24px; height:24px; border-radius:8px; flex-shrink:0; display:flex; align-items:center; justify-content:center; }
  .d2-cat-swatch svg{ width:13px; height:13px; stroke:#fff; }
  .d2-cat-name{ font-weight:700; font-size:11.5px; letter-spacing:.5px; text-transform:uppercase; }
  .d2-cat-cards{ display:flex; flex-direction:column; gap:7px; }
  .d2-fn-card{
    background:var(--gx-panel,#111); border:1px solid rgba(255,0,1,0.16); border-radius:14px;
    display:flex; align-items:center; gap:11px; padding:12px 11px; cursor:pointer;
    transition:border-color .25s ease, transform .15s ease;
  }
  .d2-fn-card:active{ transform:scale(.99); }
  /* ອະນິເມຊັນ "ເປີດ" ຂອງກາດ — ໃຫ້ຮູ້ສຶກຄືກັບ .fn-card.expanded ໃນ demo:
     ຂອບກາດຕິດສີ + ລູກສອນໝຸນ 180° + ປ່ຽນສີ ຕອນ switch ຂອງມັນຖືກເປີດ */
  .d2-fn-card.d2-open{ border-color:var(--rail-color, rgba(255,0,1,0.5)); }
  .d2-fn-icon{ width:36px; height:36px; border-radius:11px; flex-shrink:0; background:var(--rail-color,#ff0001); display:flex; align-items:center; justify-content:center; }
  .d2-fn-icon svg{ width:16px; height:16px; stroke:#fff; }
  .d2-fn-text{ flex:1; min-width:0; }
  .d2-fn-title-row{ display:flex; align-items:center; gap:7px; flex-wrap:wrap; }
  .d2-fn-title{ font-weight:700; font-size:13px; }
  .d2-fn-badge{ font-size:9.5px; font-weight:700; padding:2px 8px; border-radius:20px; flex-shrink:0; letter-spacing:.2px; }
  .d2-fn-badge.d2-ok{ background:rgba(255,255,255,0.06); color:#a9a6a3; }
  .d2-fn-badge.d2-warn{ background:rgba(255,176,32,0.14); color:#ffb020; }
  .d2-fn-badge.d2-urgent{ background:rgba(255,0,1,0.14); color:#ff6767; }
  .d2-fn-desc{ font-size:10.5px; color:var(--gx-ink-dim,#9a9694); margin-top:2px; line-height:1.4; }
  .d2-fn-arrow{
    width:24px; height:24px; border-radius:8px; flex-shrink:0; background:rgba(255,255,255,0.04);
    display:flex; align-items:center; justify-content:center; color:var(--gx-ink-dim,#9a9694);
    transition:transform .3s cubic-bezier(.2,.85,.25,1), color .25s ease, background .25s ease;
  }
  .d2-fn-arrow svg{ width:11px; height:11px; stroke:currentColor; }
  .d2-fn-card.d2-open .d2-fn-arrow{ transform:rotate(180deg); color:var(--rail-color, #ff0001); background:rgba(255,0,1,0.1); }

  /* ---- ເອົາ list ເມນູເກົ່າ (switch-head) ແລະ ops-strip ເກົ່າອອກ — ຊ້ຳກັບ D2 dashboard ດ້ານເທິງແລ້ວ ---- */
  .switch-head{ display:none !important; }
  #opsStrip{ display:none !important; }


  /* ---------- ລາຄາສະເພາະຕົວແທນລາຍຄົນ ---------- */
  .agent-acc-custom-btn{
    font-family:var(--gx-font); font-size:11px; font-weight:600; padding:7px 12px; border-radius:9px;
    cursor:pointer; white-space:nowrap;
    background:rgba(255,255,255,0.05); border:1px solid var(--navy-700); color:var(--ink-100);
  }
  .agent-acc-custom-btn:hover, .agent-acc-custom-btn.is-open{ border-color:var(--gx-signal-soft); }
  .agent-custom-panel{
    flex-basis:100%; width:100%; margin-top:6px; padding:12px; border-radius:12px;
    background:var(--navy-900); border:1px solid var(--navy-700);
  }
  .agent-custom-panel[hidden]{ display:none; }
  .agent-custom-note{ font-size:11px; color:var(--ink-500); margin-bottom:8px; line-height:1.5; }
  .agent-custom-search{
    width:100%; background:var(--navy-800, #0d0d12); border:1px solid var(--navy-700); color:var(--ink-100);
    border-radius:10px; padding:9px 11px; font-family:var(--gx-font); font-size:12.5px; margin-bottom:8px;
  }
  .agent-custom-search:focus{ outline:none; border-color:var(--gx-signal-soft); }
  .agent-custom-body{ max-height:420px; overflow-y:auto; padding-right:2px; }
  .agent-custom-cat-title{ font-family:var(--gx-font); font-weight:700; font-size:11.5px; color:var(--shine); margin:10px 0 4px; }
  .agent-custom-prod{ padding:8px 0; border-bottom:1px solid rgba(255,0,1,0.1); }
  .agent-custom-prod-name{ font-size:12.5px; font-weight:700; color:var(--ink-100); margin-bottom:5px; }
  .agent-custom-row{ display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; margin-top:4px; }
  .agent-custom-label{ flex:1 1 180px; font-size:12.5px; color:var(--ink-300); }
  .agent-custom-input{
    flex:0 1 190px; min-width:120px; padding:8px 10px; font-size:0.85rem; border-radius:9px;
    background:var(--navy-800, #0d0d12); border:1px solid var(--navy-700); color:var(--ink-100);
  }
  .agent-custom-input:focus{ outline:none; border-color:var(--gx-signal-soft); }
  .agent-custom-panel .gx-submit{ margin-top:12px; padding:10px 16px; font-size:0.85rem; min-height:0; }

/* ---------- ปุ่มลบคีย์ตัวแทน ---------- */
.key-del-btn{width:32px;height:32px;border-radius:8px;flex-shrink:0;display:flex;align-items:center;justify-content:center;background:rgba(232,49,49,0.1);border:1px solid rgba(232,49,49,0.38);color:var(--gx-danger);cursor:pointer;transition:all .15s ease}
.key-del-btn:hover{background:rgba(232,49,49,0.2)}
.key-del-btn:disabled{opacity:.5;cursor:default}
.key-del-btn svg{width:15px;height:15px;stroke:currentColor}
.key-bulk-bar{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;padding:10px 0 12px;font-size:12px;color:var(--ink-500)}
.key-bulk-del-btn{font-family:var(--gx-font);font-size:11.5px;font-weight:600;padding:8px 14px;border-radius:99px;cursor:pointer;white-space:nowrap;background:rgba(232,49,49,0.12);border:1px solid rgba(232,49,49,0.4);color:var(--gx-danger)}
.key-bulk-del-btn:active{transform:scale(.96)}


/* ປຸ່ມຫົວໃຈປັກໝຸດສິນຄ້າ (ຟອມເພີ່ມ/ແກ້ໄຂສິນຄ້າ) */
.pin-heart-toggle{ display:flex; align-items:center; gap:12px; cursor:pointer; -webkit-tap-highlight-color:transparent; }
.pin-heart-toggle input{ position:absolute; opacity:0; width:0; height:0; }
.pin-heart-ui{
  width:44px; height:44px; flex:0 0 44px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  color:#8a8f98; background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.18);
  transition:color .2s ease, background .2s ease, border-color .2s ease, transform .15s ease;
}
.pin-heart-ui svg{ width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; transition:fill .2s ease; }
.pin-heart-toggle:active .pin-heart-ui{ transform:scale(.92); }
.pin-heart-toggle input:checked + .pin-heart-ui{ color:#ff2a3c; background:rgba(255,0,1,.16); border-color:rgba(255,60,70,.8); }
.pin-heart-toggle input:checked + .pin-heart-ui svg{ fill:currentColor; }
.pin-heart-toggle input:focus-visible + .pin-heart-ui{ outline:2px solid #ff2a3c; outline-offset:2px; }
.pin-heart-text{ display:flex; flex-direction:column; gap:2px; min-width:0; }
.pin-heart-text b{ font-size:14px; font-weight:700; }
.pin-heart-text small{ font-size:12px; opacity:.7; }

.link-chip-edit{
  width:16px;height:16px;border-radius:50%;flex-shrink:0;
  border:none; background:rgba(255,255,255,0.1); color:var(--ink-300);
  font-size:10px; line-height:1; cursor:pointer;
}
.link-edit-inline{ flex-direction:column; }
