/* =========================================================
   SaaS Store Admin — Ultra-Modern Animated Dashboard UI
   ========================================================= */
@font-face { font-family: 'Outfit'; font-style: normal; font-weight: 300 900; font-display: swap; src: url('../fonts/outfit.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Orbitron'; font-style: normal; font-weight: 600 900; font-display: swap; src: url('../fonts/orbitron.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #07090e;
  --bg-2: #0e1320;
  --card: rgba(17, 24, 39, 0.75);
  --card-hover: rgba(26, 36, 56, 0.85);
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: #8b5cf6;
  
  --primary: #7c3aed;
  --primary-light: #a78bfa;
  --accent-cyan: #06b6d4;
  --accent-gold: #f59e0b;
  --green: #10b981;
  --red: #ef4444;
  
  --text: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  
  --sidebar-w: 250px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 25px rgba(124, 58, 237, 0.25);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  margin: 0; background: var(--bg);
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(124, 58, 237, 0.1) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.06) 0%, transparent 40%);
  background-attachment: fixed;
  color: var(--text);
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 14.5px; line-height: 1.6;
}

a { color: var(--primary-light); text-decoration: none; transition: all .2s ease; }
a:hover { color: #c4b5fd; }
h1, h2, h3, h4 { margin: 0 0 12px; line-height: 1.3; font-weight: 700; color: #fff; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
code { background: rgba(255,255,255,0.06); padding: 2px 8px; border-radius: 6px; font-size: 12.5px; font-family: monospace; color: #c4b5fd; border: 1px solid var(--border); }

/* ---------------- SIDEBAR & TOPBAR ---------------- */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w);
  background: rgba(13, 18, 29, 0.95);
  backdrop-filter: blur(16px);
  border-right: 1px solid var(--border);
  z-index: 50; overflow-y: auto; transition: transform .3s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar-brand {
  height: 68px; display: flex; align-items: center; gap: 12px; padding: 0 20px;
  font-family: 'Orbitron', sans-serif; font-weight: 800; font-size: 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}
.brand-dot {
  width: 14px; height: 14px; border-radius: 4px;
  background: linear-gradient(135deg, var(--primary), #ec4899);
  box-shadow: 0 0 10px rgba(124, 58, 237, 0.6);
}
.sidebar-brand img { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; }
.sidebar-brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sidebar nav {
  display: flex; flex-direction: column; padding: 16px 12px; gap: 4px;
}
.sidebar nav a {
  display: flex; align-items: center; gap: 12px;
  color: var(--text-muted); padding: 11px 16px; border-radius: 12px;
  font-weight: 600; font-size: 14px; transition: all .2s ease;
}
.sidebar nav a:hover {
  background: rgba(255, 255, 255, 0.05); color: #fff;
  transform: translateX(3px);
}
.sidebar nav a.active {
  background: linear-gradient(135deg, var(--primary), #9333ea);
  color: #fff; box-shadow: 0 4px 16px rgba(124, 58, 237, 0.35);
}
.sidebar-view-store {
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border);
}
.sidebar-view-store a {
  color: var(--accent-cyan) !important;
  background: rgba(6, 182, 212, 0.08) !important;
  border: 1px solid rgba(6, 182, 212, 0.2);
}

.topbar {
  height: 68px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; background: rgba(13, 18, 29, 0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 40;
}
.topbar-brand { font-size: 18px; font-weight: 700; color: #fff; display: flex; align-items: center; gap: 10px; }
.menu-btn {
  display: none; background: none; border: 0; color: #fff; font-size: 24px; cursor: pointer;
}

.has-sidebar .topbar, .has-sidebar main { margin-left: var(--sidebar-w); }
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .7); }
  .has-sidebar .topbar, .has-sidebar main { margin-left: 0; }
  .menu-btn { display: block; }
}

.container { max-width: 1240px; padding: 28px 24px 80px; margin: 0 auto; }
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 22px; margin-bottom: 22px;
  backdrop-filter: blur(14px);
}
.card-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; margin-bottom: 18px;
}

/* ---------------- ANIMATED STATS ---------------- */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.stat {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 20px;
  transition: all .25s ease;
  position: relative; overflow: hidden;
}
.stat::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent-cyan));
  opacity: 0.6;
}
.stat:hover {
  transform: translateY(-3px);
  border-color: rgba(124, 58, 237, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.stat span { color: var(--text-muted); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.stat b {
  font-family: 'Orbitron', sans-serif;
  font-size: 24px; font-weight: 800; color: #fff; display: block; margin-top: 6px;
}

/* ---------------- PAYMENTS DASHBOARD & TABS ---------------- */
.payments-dashboard { margin-top: 10px; }

.nav-tabs-pill {
  display: flex; gap: 14px; margin-bottom: 24px;
  border-bottom: 1px solid var(--border); padding-bottom: 16px;
  overflow-x: auto;
}
.tab-pill {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 20px; border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border);
  color: var(--text); transition: all .25s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 220px;
}
.tab-pill:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}
.tab-pill.active {
  background: rgba(124, 58, 237, 0.15);
  border-color: var(--primary);
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.25);
  transform: translateY(-2px);
}
.pill-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: grid; place-items: center; flex: none;
}
.pill-icon.glow-purple { background: rgba(124, 58, 237, 0.2); color: #c4b5fd; }
.pill-icon.glow-yellow { background: rgba(245, 158, 11, 0.2); color: #facc15; }
.pill-icon.glow-cyan { background: rgba(6, 182, 212, 0.2); color: #38bdf8; }
.tab-pill.active .pill-icon {
  background: var(--primary); color: #fff;
  box-shadow: 0 0 14px rgba(124, 58, 237, 0.5);
}

.pill-text { display: flex; flex-direction: column; flex: 1; }
.pill-title { font-weight: 700; font-size: 15px; color: #fff; }
.pill-sub { font-size: 11.5px; color: var(--text-muted); }

.status-dot {
  width: 10px; height: 10px; border-radius: 50%; flex: none;
}
.dot-active { background: var(--green); box-shadow: 0 0 8px var(--green); }
.dot-inactive { background: var(--text-dim); }
.pill-badge {
  padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 700;
  background: rgba(255, 255, 255, 0.1); color: var(--text-muted);
}

/* Gateway Hero Card */
.gateway-hero-card {
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 28px; border-radius: var(--radius-md);
  margin-bottom: 22px; border: 1px solid var(--border);
  backdrop-filter: blur(16px);
}
.murubbi-hero {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.2) 0%, rgba(13, 18, 29, 0.95) 100%);
  border-color: rgba(124, 58, 237, 0.35);
}
.binance-hero {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18) 0%, rgba(13, 18, 29, 0.95) 100%);
  border-color: rgba(245, 158, 11, 0.35);
}
.hero-left { display: flex; align-items: center; gap: 18px; }
.gateway-badge-logo {
  width: 58px; height: 58px; border-radius: 14px;
  background: #fff; display: grid; place-items: center;
  overflow: hidden; padding: 6px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}
.gateway-badge-logo img { width: 100%; height: 100%; object-fit: contain; }
.binance-gold-bg { background: #facc15; }
.hero-left h2 { font-size: 22px; margin-bottom: 4px; }
.hero-left p { color: var(--text-muted); font-size: 13.5px; margin: 0; }
.hero-right { display: flex; align-items: center; gap: 14px; }

/* iOS Toggle Switch */
.toggle-switch {
  position: relative; display: inline-block; width: 56px; height: 30px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider-round {
  position: absolute; cursor: pointer; inset: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: .3s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-radius: 34px; border: 1px solid var(--border);
}
.slider-round:before {
  position: absolute; content: ""; height: 22px; width: 22px;
  left: 3px; bottom: 3px; background-color: white;
  transition: .3s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-radius: 50%; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
input:checked + .slider-round {
  background-color: var(--green);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.5);
}
input:checked + .slider-gold {
  background-color: var(--accent-gold);
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.5);
}
input:checked + .slider-round:before {
  transform: translateX(26px);
}
.toggle-status-label { font-size: 13px; font-weight: 700; }

/* Sub Panels */
.sub-panel {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 24px; margin-bottom: 22px;
}
.card-header-styled {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.card-header-styled h3 {
  display: flex; align-items: center; gap: 10px; margin: 0; font-size: 16px;
}

/* Mode Cards Grid (API vs Hosted) */
.mode-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 10px;
}
@media (max-width: 768px) { .mode-grid { grid-template-columns: 1fr; } }

.mode-card {
  position: relative; cursor: pointer;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  border: 2px solid var(--border);
  transition: all .25s cubic-bezier(0.4, 0, 0.2, 1);
}
.mode-card input { position: absolute; opacity: 0; }
.mode-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}
.mode-card.selected, .mode-card:has(input:checked) {
  background: rgba(124, 58, 237, 0.12);
  border-color: var(--primary);
  box-shadow: 0 0 24px rgba(124, 58, 237, 0.3);
  transform: translateY(-2px);
}
.mode-card-inner {
  display: flex; align-items: flex-start; gap: 16px; padding: 20px;
}
.mode-icon-circle {
  width: 44px; height: 44px; border-radius: 12px;
  background: rgba(124, 58, 237, 0.2); color: var(--primary-light);
  display: grid; place-items: center; flex: none;
}
.mode-card.selected .mode-icon-circle {
  background: var(--primary); color: #fff;
  box-shadow: 0 0 14px rgba(124, 58, 237, 0.6);
}
.mode-info h4 { font-size: 16px; margin-bottom: 6px; color: #fff; }
.mode-info p { font-size: 13px; color: var(--text-muted); line-height: 1.5; margin: 0; }
.mode-perks { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.tag-sm {
  font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 6px;
  background: rgba(255, 255, 255, 0.06); color: #cbd5e1;
  border: 1px solid var(--border);
}

.grid-2-custom {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
}
@media (max-width: 900px) { .grid-2-custom { grid-template-columns: 1fr; } }

/* Form Controls */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block; font-size: 13.5px; font-weight: 600;
  color: var(--text-muted); margin-bottom: 7px;
}
.form-group input, .form-group select, .form-group textarea {
  display: block; margin-top: 0; font-family: inherit;
  width: 100%; padding: 12px 14px; border-radius: 10px;
  background: rgba(13, 18, 29, 0.9); border: 1.5px solid var(--border);
  color: #fff; font-size: 14.5px; transition: all .2s ease;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.25);
  background: #111827;
}

.input-with-action { position: relative; display: flex; }
.input-with-action input { padding-right: 48px; }
.input-with-action button {
  position: absolute; right: 4px; top: 4px; bottom: 4px;
  width: 40px; border-radius: 8px;
}

.input-rate-wrap {
  display: flex; align-items: center; position: relative;
}
.rate-prefix {
  position: absolute; left: 14px; font-weight: 700; color: var(--accent-gold);
}
.input-rate-wrap input { padding-left: 110px; }

/* Copy Box */
.copy-box {
  display: flex; gap: 8px; margin: 12px 0 16px;
}
.copy-box input {
  font-family: monospace; font-size: 13px; color: var(--accent-cyan);
  background: rgba(0, 0, 0, 0.4);
}
.btn-copied { background: var(--green) !important; border-color: var(--green) !important; }

/* Test Connection */
.test-conn-box {
  margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border);
}
.test-conn-result { margin-top: 10px; }
.alert-box {
  padding: 10px 14px; border-radius: 8px; font-size: 13px; font-weight: 600;
}
.alert-success-sm {
  background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3);
}
.alert-error-sm {
  background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Wallet Inputs Grid */
.wallet-inputs-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 600px) { .wallet-inputs-grid { grid-template-columns: 1fr; } }

.wallet-card-input {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 16px;
}
.wallet-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.wallet-logo {
  width: 28px; height: 28px; object-fit: contain;
  background: #fff; border-radius: 6px; padding: 2px;
}
.row-2-tight { display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; }

/* QR Preview Box */
.qr-preview-box {
  margin-bottom: 12px; text-align: center;
}
.qr-preview-img {
  width: 140px; height: 140px; object-fit: contain;
  background: #fff; padding: 6px; border-radius: 12px;
  margin: 0 auto 6px;
}

/* Doc Highlights */
.doc-highlights {
  display: flex; flex-direction: column; gap: 10px; margin-top: 14px;
}
.doc-item {
  display: flex; align-items: center; gap: 10px; font-size: 13px; color: #cbd5e1;
}
.doc-badge {
  font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px;
}
.doc-badge.green { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.doc-badge.yellow { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }

/* Bottom Action Bar */
.form-bottom-bar {
  margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end;
}
.btn-lg-glow {
  padding: 14px 28px; font-size: 15px; font-weight: 700; border-radius: 12px;
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
}
.btn-gold {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000; font-weight: 800; border: 0;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.35);
}
.btn-gold:hover {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  box-shadow: 0 6px 25px rgba(245, 158, 11, 0.55);
  transform: translateY(-2px);
}

/* ---------------- TABLES ---------------- */
.table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--border); }
table.styled-table, table {
  width: 100%; border-collapse: collapse; min-width: 600px;
}
th, td {
  padding: 14px 16px; border-bottom: 1px solid var(--border); text-align: left;
}
th {
  background: rgba(0, 0, 0, 0.25); color: var(--text-muted);
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
}
tbody tr:hover { background: rgba(255, 255, 255, 0.03); }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 700;
}
.badge-purple { background: rgba(124, 58, 237, 0.15); color: #c4b5fd; border: 1px solid rgba(124, 58, 237, 0.3); }
.badge-cyan { background: rgba(6, 182, 212, 0.15); color: #38bdf8; border: 1px solid rgba(6, 182, 212, 0.3); }
.badge-pending { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.badge-processing { background: rgba(6, 182, 212, 0.15); color: #38bdf8; }
.badge-completed, .badge-active { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-cancelled, .badge-refunded { background: rgba(239, 68, 68, 0.15); color: #f87171; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: 10px; font-weight: 600; font-size: 13.5px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--border);
  color: #fff; cursor: pointer; transition: all .2s ease;
}
.btn:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.2); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), #9333ea);
  border: 0; color: #fff;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #8b5cf6, #a855f7);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.5);
  transform: translateY(-1px);
}
.btn-danger {
  background: rgba(239, 68, 68, 0.15); border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.25); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
.btn-ghost { background: transparent; border-color: transparent; }

/* Alerts */
.alert {
  padding: 14px 18px; border-radius: 12px; margin-bottom: 18px; font-size: 14px; font-weight: 500;
}
.alert-error {
  background: rgba(239, 68, 68, 0.15); border: 1px solid rgba(239, 68, 68, 0.35); color: #fca5a5;
}
.alert-success {
  background: rgba(16, 185, 129, 0.15); border: 1px solid rgba(16, 185, 129, 0.35); color: #86efac;
}

.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-gold { color: var(--accent-gold); }
.muted { color: var(--text-muted); }
.small { font-size: 12px; }
.center { text-align: center; }

/* Micro-animations */
.animated-fade-in { animation: fadeIn .3s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.spinner-sm {
  width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff; border-radius: 50%;
  animation: spin .6s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================================
   Base forms & shared layout helpers
   ========================================================= */
:where(label) { display: block; margin-bottom: 16px; font-size: 13px; font-weight: 600; color: #d1d5db; }
:where(input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea) {
  display: block; width: 100%; margin-top: 7px; padding: 11px 14px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); font: inherit; font-size: 14px;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
:where(input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea):focus {
  outline: none; border-color: var(--border-focus); background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}
input[readonly]:not(.copy-box input) { opacity: .75; cursor: text; }
input::placeholder, textarea::placeholder { color: var(--text-dim); }
select option { background: var(--bg-2); color: var(--text); }
textarea { resize: vertical; min-height: 90px; }
input[type=file] {
  display: block; width: 100%; margin-top: 7px; padding: 9px; font: inherit; font-size: 13px;
  color: var(--text-muted); background: rgba(255, 255, 255, 0.03);
  border: 1px dashed var(--border); border-radius: 10px;
}
input[type=file]::file-selector-button {
  margin-right: 12px; padding: 7px 14px; border: 0; border-radius: 8px; cursor: pointer;
  background: rgba(124, 58, 237, 0.2); color: #ddd6fe; font: inherit; font-weight: 600;
}
input[type=checkbox], input[type=radio] { accent-color: var(--primary); width: 16px; height: 16px; }
label.check, .check { display: flex; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 700px) { .row-2 { grid-template-columns: 1fr; } }
.narrow { max-width: 520px; }
.btn-block { width: 100%; }
.btn-secondary { background: rgba(6, 182, 212, 0.12); border-color: rgba(6, 182, 212, 0.3); color: #67e8f9; }
.text-muted { color: var(--text-muted); }
.font-bold { font-weight: 700; }
.inline { display: inline; }
.actions, .form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.form-actions { margin-top: 8px; }
.search-row { display: flex; gap: 10px; margin-bottom: 18px; }
.search-row input { margin-top: 0 !important; flex: 1; }
.mini-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.mini-form label { margin-bottom: 0; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; padding: 5px;
  background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border); border-radius: 12px; width: fit-content; max-width: 100%; }
.tabs a { padding: 8px 16px; border-radius: 9px; color: var(--text-muted); font-weight: 600; font-size: 13.5px; }
.tabs a:hover { color: #fff; background: rgba(255, 255, 255, 0.05); }
.tabs a.active { color: #fff; background: linear-gradient(135deg, var(--primary), #9333ea); box-shadow: 0 4px 12px rgba(124, 58, 237, 0.35); }
.thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }
.thumb-lg { width: 120px; height: 120px; }
.thumb-empty { display: inline-flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, 0.04); color: var(--text-dim); }
.thumb-row { display: flex; align-items: center; gap: 14px; margin: -6px 0 16px; }
.thumb-row .check { margin: 0; }
.topbar-nav { display: flex; align-items: center; gap: 18px; }
.topbar-nav a { color: var(--text-muted); font-weight: 600; }
.topbar-nav a:hover { color: #fff; }
.pagination { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.banner-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.banner-item { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: rgba(255, 255, 255, 0.02); }
.banner-item img { width: 100%; aspect-ratio: 16 / 7; object-fit: cover; display: block; }
.banner-meta { padding: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.variant-row { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 10px; align-items: end; margin-bottom: 10px; }
.variant-row label { margin-bottom: 0; }
@media (max-width: 700px) { .variant-row { grid-template-columns: 1fr 1fr; } }
details, .details { border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; }
details summary { cursor: pointer; font-weight: 600; }
.inline-details { display: inline-block; padding: 6px 10px; margin: 0; }
.check-mark-circle { display: inline-flex; width: 20px; height: 20px; border-radius: 50%; align-items: center; justify-content: center;
  background: var(--primary); color: #fff; font-size: 11px; }
.auth-box { max-width: 420px; margin: 60px auto; }

/* =========================================================
   Login screen (master + store admin)
   ========================================================= */
.auth-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 0%, rgba(124, 58, 237, 0.18), transparent 60%),
    var(--bg);
}
.auth-shell { min-height: 100vh; }
.auth-main { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 16px; }
.auth-card {
  width: 100%; max-width: 420px; padding: 40px 36px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  animation: authIn .5s ease both;
}
@keyframes authIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.auth-card h1 { font-size: 26px; font-weight: 800; color: #fff; letter-spacing: -0.4px; margin-bottom: 6px; text-align: center; }
.auth-sub { color: var(--text-muted); margin-bottom: 28px; word-break: break-word; text-align: center; font-size: 14px; }
.auth-field { margin-bottom: 18px; }
.auth-field > span { display: block; margin-bottom: 7px; }
.auth-input { position: relative; }
.auth-input > svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-dim); pointer-events: none; }
.auth-input input:not([type=checkbox]) { margin-top: 0; padding: 13px 44px 13px 44px; font-size: 15px; border-radius: 12px; }
.auth-input:focus-within > svg { color: var(--primary-light); }
.auth-eye {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 0; border-radius: 8px; color: var(--text-dim); cursor: pointer;
}
.auth-eye:hover, .auth-eye.on { color: #fff; background: rgba(255, 255, 255, 0.06); }
.auth-submit { width: 100%; padding: 14px 18px; font-size: 15px; border-radius: 12px; margin-top: 6px; gap: 10px; }
.auth-submit svg { transition: transform .2s ease; }
.auth-submit:hover svg { transform: translateX(3px); }

@media (max-width: 480px) {
  .auth-card { padding: 30px 22px; }
}

/* Two-column page layout (product edit) */
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
@media (max-width: 1000px) { .grid-2 { grid-template-columns: 1fr; } }

/* Image size hint under upload fields */
.img-hint {
  display: flex; gap: 10px; align-items: flex-start; margin: -8px 0 16px; padding: 10px 12px;
  border-radius: 10px; background: rgba(6, 182, 212, 0.08); border: 1px solid rgba(6, 182, 212, 0.25);
  color: #a5f3fc; font-size: 12.5px; line-height: 1.5;
}
.img-hint svg { flex-shrink: 0; margin-top: 2px; }
.img-hint b { color: #fff; }
.img-hint small { color: var(--text-muted); font-size: 12px; }

/* Variant table header */
.variant-head { display: grid; grid-template-columns: 2fr 1fr 80px 40px; gap: 10px; margin-bottom: 6px;
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-dim); }
.variant-row { grid-template-columns: 2fr 1fr 80px 40px; }
.variant-row input:not([type=hidden]), .variant-row select { margin-top: 0; }
@media (max-width: 700px) { .variant-head { display: none; } .variant-row { grid-template-columns: 1fr 1fr; } }

/* Confirm modal (replaces browser confirm popup) */
.cmodal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.cmodal[hidden] { display: none; }
.cmodal-backdrop { position: absolute; inset: 0; background: rgba(3, 5, 10, 0.72); backdrop-filter: blur(6px); opacity: 0; transition: opacity .18s ease; }
.cmodal-box {
  position: relative; width: 100%; max-width: 400px; padding: 28px 26px 22px; text-align: center;
  background: linear-gradient(180deg, #161c2b, #0f1420); border: 1px solid var(--border); border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  opacity: 0; transform: translateY(10px) scale(.96); transition: opacity .18s ease, transform .18s ease;
}
.cmodal.open .cmodal-backdrop { opacity: 1; }
.cmodal.open .cmodal-box { opacity: 1; transform: none; }
.cmodal-icon {
  width: 60px; height: 60px; margin: 0 auto 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.35); color: #f87171;
  box-shadow: 0 0 0 8px rgba(239, 68, 68, 0.06);
}
.cmodal-box h3 { font-size: 20px; color: #fff; margin-bottom: 8px; }
.cmodal-box p { color: #d1d5db; font-size: 14.5px; margin: 0; }
.cmodal-box .cmodal-warn { color: var(--text-dim); font-size: 12.5px; margin-top: 6px; }
.cmodal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
.cmodal-actions .btn { width: 100%; padding: 11px 16px; }
.btn-danger-solid { background: linear-gradient(135deg, #ef4444, #dc2626); border: 0; color: #fff; box-shadow: 0 6px 18px rgba(239, 68, 68, 0.35); }
.btn-danger-solid:hover { background: linear-gradient(135deg, #f87171, #ef4444); box-shadow: 0 8px 22px rgba(239, 68, 68, 0.5); }
button, select, input, textarea { font-family: inherit; }

/* =========================================================
   Products page: categories bar, add product, variant dropdowns
   ========================================================= */
.cat-bar { padding: 16px 20px; }
.cat-bar-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.cat-bar-head h2 { margin: 0; font-size: 17px; }
.cat-add { display: flex; gap: 8px; }
.cat-add input { margin-top: 0 !important; width: 220px; padding: 8px 12px !important; font-size: 13.5px !important; }
.cat-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 4px;
  background: rgba(124, 58, 237, 0.1); border: 1px solid rgba(124, 58, 237, 0.3); border-radius: 999px;
}
.cat-chip-form { display: inline-flex; align-items: center; }
.cat-chip-form input {
  margin: 0 !important; padding: 4px 8px !important; width: auto !important; min-width: 40px; max-width: 180px;
  background: transparent !important; border: 1px solid transparent !important; border-radius: 999px !important;
  color: #ede9fe !important; font-weight: 600; font-size: 13px !important; box-shadow: none !important;
}
.cat-chip-form input:focus { border-color: var(--primary-light) !important; background: rgba(0, 0, 0, 0.3) !important; }
.cat-chip-save, .cat-chip-del {
  width: 24px; height: 24px; border-radius: 50%; border: 0; cursor: pointer; font-size: 13px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; background: transparent; color: var(--text-muted);
}
.cat-chip-save { display: none; color: #34d399; }
.cat-chip-form:focus-within .cat-chip-save { display: inline-flex; }
.cat-chip-save:hover { background: rgba(16, 185, 129, 0.15); }
.cat-chip-del { font-size: 17px; }
.cat-chip-del:hover { background: rgba(239, 68, 68, 0.18); color: #fca5a5; }
.cat-chip-count {
  min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, 0.08); color: var(--text-muted);
}
.cat-tip { margin-top: 10px; }

.add-product > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.add-product > summary::-webkit-details-marker { display: none; }
.add-product > summary h2 { margin: 0; color: var(--primary-light); }
.add-product[open] > summary { margin-bottom: 18px; }
.row-3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 16px; }
@media (max-width: 800px) { .row-3 { grid-template-columns: 1fr; } }

.plist { display: flex; flex-direction: column; gap: 10px; }
.pitem { border: 1px solid var(--border); border-radius: 14px; background: rgba(255, 255, 255, 0.02); overflow: hidden; transition: border-color .2s ease; }
.pitem[open] { border-color: rgba(124, 58, 237, 0.45); background: rgba(124, 58, 237, 0.04); }
.pitem-row { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 14px; padding: 12px 16px; }
.pitem-row::-webkit-details-marker { display: none; }
.pitem-row:hover { background: rgba(255, 255, 255, 0.03); }
.pitem-row .thumb { width: 56px; height: 40px; flex-shrink: 0; }
.pitem-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pitem-info b { color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pitem-toggle {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 10px; flex-shrink: 0;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--border); font-size: 13px; font-weight: 600;
}
.pitem-toggle svg { transition: transform .2s ease; }
.pitem[open] .pitem-toggle { background: rgba(124, 58, 237, 0.2); border-color: rgba(124, 58, 237, 0.45); color: #ede9fe; }
.pitem[open] .pitem-toggle svg { transform: rotate(180deg); }
.pitem-body { padding: 4px 16px 16px; border-top: 1px solid var(--border); }
.pitem-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 16px; }

.vgrid { display: grid; grid-template-columns: 2fr 1fr 90px 110px; gap: 8px; align-items: center; margin-bottom: 8px; }
.vgrid > input, .vgrid > select { margin-top: 0 !important; padding: 9px 12px !important; font-size: 13.5px !important; }
.vgrid-form { display: none; }
.vgrid-head { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-dim); margin-bottom: 6px; }
.vgrid-btns { display: flex; gap: 6px; justify-content: flex-end; }
.vgrid-new { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }
@media (max-width: 760px) {
  .vgrid { grid-template-columns: 1fr 1fr; }
  .vgrid-head { display: none; }
  .vgrid > input:first-of-type { grid-column: 1 / -1; }
  .pitem-row { flex-wrap: wrap; }
  .pitem-row .badge { order: 5; }
}

/* Verified switch + quick status select */
.switch-row { display: flex !important; align-items: center; gap: 12px; margin-bottom: 16px; cursor: pointer; font-weight: 500; }
.switch-row .toggle-switch { margin: 0; }
.status-quick { display: inline-flex; align-items: center; gap: 8px; }
.status-quick select { margin-top: 0 !important; width: auto !important; padding: 6px 30px 6px 10px !important; font-size: 12.5px !important; }

/* Add Product open/close toggle */
.add-toggle .t-close { display: none; }
.add-product[open] .add-toggle .t-open { display: none; }
.add-product[open] .add-toggle .t-close { display: inline; }
.add-product[open] .add-toggle { background: rgba(124, 58, 237, 0.2); border-color: rgba(124, 58, 237, 0.45); color: #ede9fe; }
.add-product[open] .add-toggle svg { transform: rotate(180deg); }

/* Tap-to-copy chips (Google Login guide) */
.copy-chip {
  display: inline-flex; align-items: center; gap: 10px; max-width: 100%; margin: 4px 0;
  padding: 8px 8px 8px 12px; border-radius: 10px; cursor: pointer; text-align: left;
  background: rgba(124, 58, 237, 0.1); border: 1px dashed rgba(167, 139, 250, 0.5); color: var(--text);
  transition: background .2s, border-color .2s, transform .1s;
}
.copy-chip:hover { background: rgba(124, 58, 237, 0.2); border-color: var(--primary-light); }
.copy-chip:active { transform: scale(.98); }
.copy-chip code { font-size: 13px; color: #e9d5ff; overflow-wrap: anywhere; word-break: break-all; background: none; padding: 0; }
.copy-chip-tag { flex-shrink: 0; padding: 3px 9px; border-radius: 7px; font-size: 11.5px; font-weight: 700; color: #fff; background: var(--primary); }
.copy-chip.is-copied { border-style: solid; border-color: var(--green); background: rgba(16, 185, 129, 0.12); }
.copy-chip.is-copied .copy-chip-tag { background: var(--green); }
.copy-chip-block { display: flex; width: 100%; justify-content: space-between; margin-top: 6px; }
.field-like { display: block; margin-bottom: 14px; }
.g-steps { padding-left: 20px; display: grid; gap: 18px; font-size: 14px; }
.g-steps > li > b { font-size: 15px; color: #fff; }
.g-steps p { margin: 6px 0; color: var(--text-muted); line-height: 1.6; }
.g-row { display: grid; grid-template-columns: 220px minmax(0, 1fr); align-items: center; gap: 4px 12px; margin: 6px 0; }
.g-row > span { color: var(--text-muted); font-size: 13px; }
.g-row > em { font-style: normal; color: var(--text); }
.g-row .copy-chip { justify-self: start; }
.g-help { margin-top: 20px; padding: 14px 16px; border-radius: 12px; background: rgba(239, 68, 68, 0.07); border: 1px solid rgba(239, 68, 68, 0.25); font-size: 13.5px; }
.g-help ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 6px; color: var(--text-muted); }
@media (max-width: 700px) { .g-row { grid-template-columns: 1fr; } }
.g-status { padding: 10px 14px; border-radius: 10px; font-size: 13.5px; margin: 4px 0 14px; }
.g-status.on { color: #6ee7b7; background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.3); }
.g-status.off { color: #fcd34d; background: rgba(245, 158, 11, 0.08); border: 1px solid rgba(245, 158, 11, 0.3); }

/* Banner inline edit form */
.banner-edit {
  margin-top: 14px; padding-top: 14px;
  border-top: 1px dashed rgba(255, 255, 255, 0.12);
}
.banner-meta .muted.small { word-break: break-all; }

/* =========================================================
   Login: store name + logo on top of the card
   ========================================================= */
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 22px; text-align: center; }
.auth-brand img, .auth-brand-mark { width: 58px; height: 58px; border-radius: 16px; object-fit: cover; box-shadow: 0 8px 24px rgba(124, 58, 237, 0.35); }
.auth-brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary), #ec4899); color: #fff;
  font-family: 'Orbitron', sans-serif; font-size: 26px; font-weight: 800;
}
.auth-brand b { font-family: 'Orbitron', sans-serif; font-size: 18px; letter-spacing: .6px; color: #fff; word-break: break-word; }
.auth-card .auth-brand + h1 { font-size: 20px; color: var(--text-muted); font-weight: 700; }

/* Topbar: store name over page title */
.topbar-logo { width: 32px; height: 32px; border-radius: 9px; object-fit: cover; flex-shrink: 0; }
.topbar-titles { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.topbar-titles small { font-size: 11px; font-weight: 600; color: var(--text-dim); letter-spacing: .4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
.topbar-titles span { font-size: 17px; }

/* =========================================================
   Phone: admin layout + Products page
   ========================================================= */
@media (max-width: 600px) {
  .topbar { height: 60px; padding: 0 14px; gap: 10px; }
  .topbar-brand { gap: 10px; min-width: 0; flex: 1; }
  .topbar-titles span { font-size: 15.5px; }
  .topbar-store-btn { padding: 6px 10px !important; font-size: 12px !important; }
  .hide-xs { display: none; }
  .container { padding: 16px 12px 70px; }
  .card { padding: 16px 14px; border-radius: 16px; margin-bottom: 14px; }
  .card-head { margin-bottom: 12px; }
  .card-head h2, .add-product > summary h2 { font-size: 16px; }

  /* categories */
  .cat-bar { padding: 14px; }
  .cat-bar-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .cat-add { width: 100%; }
  .cat-add input { flex: 1; width: auto; min-width: 0; }
  .cat-chips { gap: 6px; }
  .cat-chip-form input { font-size: 12.5px !important; max-width: 140px; }
  .cat-tip { font-size: 11.5px; }

  /* add product */
  .add-product { padding: 14px; }
  .add-product[open] > summary { margin-bottom: 14px; }
  .add-product-form .btn-primary { width: 100%; }
  .add-product-form > .muted.small { display: block; margin: 8px 0 0 !important; text-align: center; }

  /* product list rows */
  .plist { gap: 8px; }
  .pitem { border-radius: 12px; }
  .pitem-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 4px 10px; padding: 10px; flex-wrap: nowrap; }
  .pitem-row .thumb { width: 52px; height: 52px; grid-row: 1 / span 2; border-radius: 10px; }
  .pitem-info { grid-column: 2; }
  .pitem-info b { font-size: 14px; }
  .pitem-info .small { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .pitem-toggle { grid-column: 3; grid-row: 1 / span 2; align-self: center; padding: 7px 9px; font-size: 0; gap: 0; }
  .pitem-toggle svg { width: 18px; height: 18px; }
  .add-product .pitem-toggle { font-size: 12.5px; gap: 6px; padding: 6px 10px; }
  .pitem-row .badge { order: 0; grid-column: 2; justify-self: start; font-size: 10.5px; padding: 3px 8px; }
  .pitem-row .badge + .badge { margin-top: 2px; }

  /* expanded product */
  .pitem-body { padding: 4px 10px 12px; }
  .pitem-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0 14px; }
  .pitem-actions > a.btn { grid-column: 1 / -1; justify-content: center; }
  .pitem-actions form.inline, .pitem-actions .status-quick { display: flex; width: 100%; }
  .pitem-actions .status-quick { justify-content: space-between; padding: 0 10px; border: 1px solid var(--border); border-radius: 10px; }
  .pitem-actions .status-quick select { flex: 1; max-width: 120px; }
  .pitem-actions .btn-danger { width: 100%; justify-content: center; }

  /* variants: each one is a small card */
  .vgrid { grid-template-columns: 1fr 1fr; gap: 6px; padding: 10px; margin-bottom: 8px; border: 1px solid var(--border); border-radius: 12px; background: rgba(0, 0, 0, 0.18); }
  .vgrid > input:first-of-type { grid-column: 1 / -1; }
  .vgrid > input, .vgrid > select { padding: 8px 10px !important; font-size: 13px !important; }
  .vgrid-btns { justify-content: stretch; }
  .vgrid-btns > .btn, .vgrid-btns > form { flex: 1; }
  .vgrid-btns > form .btn { width: 100%; }
  .vgrid-new { margin-top: 10px; border-style: dashed; }
  .vgrid-new > span { display: none; }
  .vgrid-new .vgrid-btns { grid-column: 1 / -1; }
  .vgrid-new .vgrid-btns .btn { width: 100%; }
}

/* =========================================================
   Phone: whole admin panel polish
   ========================================================= */
@media (max-width: 900px) {
  .sidebar { width: min(280px, 82vw); z-index: 60; }
}
@media (max-width: 600px) {
  body { font-size: 14px; background-attachment: scroll; }
  h2 { font-size: 17px; }
  /* 16px stops iPhone from zooming in when a field is tapped */
  :where(input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea),
  .form-group input, .form-group select, .form-group textarea,
  .vgrid > input, .vgrid > select, .cat-add input, .status-quick select { font-size: 16px !important; }
  .cat-chip-form input { font-size: 14px !important; }
  label { font-size: 12.5px; margin-bottom: 12px; }

  .stats { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
  .stat { padding: 14px 12px; }
  .stat span { font-size: 11px; }
  .stat b { font-size: 18px; }

  .table-wrap { margin: 0 -2px; }
  th, td { padding: 10px 12px; font-size: 13px; }
  table.styled-table, table { min-width: 520px; }

  .tabs { width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tabs a { white-space: nowrap; padding: 7px 12px; font-size: 13px; }
  .nav-tabs-pill { gap: 8px; padding-bottom: 12px; margin-bottom: 16px; }
  .tab-pill { min-width: 0; flex: 1; padding: 10px; gap: 8px; }
  .pill-icon { width: 32px; height: 32px; }
  .pill-sub, .pill-badge { display: none; }
  .pill-title { font-size: 13px; }

  .gateway-hero-card { flex-direction: column; align-items: flex-start; gap: 14px; padding: 16px; }
  .hero-left { gap: 12px; }
  .hero-left h2 { font-size: 17px; }
  .gateway-badge-logo { width: 46px; height: 46px; }
  .sub-panel { padding: 16px 14px; }
  .card-header-styled { flex-wrap: wrap; gap: 8px; }
  .input-rate-wrap input { padding-left: 96px; }
  .form-bottom-bar { justify-content: stretch; }
  .form-bottom-bar .btn, .form-actions .btn-primary { flex: 1; }
  .search-row { flex-direction: column; }
  .mini-form > * { flex: 1 1 100%; }
  .banner-list { grid-template-columns: 1fr; }
  .alert { padding: 12px 14px; font-size: 13.5px; }
  .thumb-lg { width: 96px; height: 96px; }
  .variant-row { padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: rgba(0, 0, 0, 0.18); gap: 6px; }
  .variant-row input[name="v_name[]"] { grid-column: 1 / -1; }
  .variant-row .btn-danger { width: 100%; grid-column: 1 / -1; }
}

/* Category show / hide */
.cat-chip-vis {
  display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 999px;
  border: 1px solid transparent; cursor: pointer; font: inherit; font-size: 11.5px; font-weight: 700;
}
.cat-chip-vis.on { background: rgba(16, 185, 129, 0.14); color: #34d399; border-color: rgba(16, 185, 129, 0.3); }
.cat-chip-vis.off { background: rgba(239, 68, 68, 0.12); color: #fca5a5; border-color: rgba(239, 68, 68, 0.3); }
.cat-chip-vis:hover { filter: brightness(1.2); }
.cat-chip.is-hidden { background: rgba(255, 255, 255, 0.03); border-color: rgba(255, 255, 255, 0.12); border-style: dashed; }
.cat-chip.is-hidden .cat-chip-form input { color: var(--text-dim) !important; text-decoration: line-through; }
.cat-hidden-tag { padding: 1px 6px; border-radius: 6px; font-size: 10.5px; font-weight: 700; color: #fca5a5; background: rgba(239, 68, 68, 0.12); }

/* =========================================================
   API Integration (Panel Portal)
   ========================================================= */
.api-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
.api-logo {
  width: 48px; height: 48px; flex-shrink: 0; border-radius: 14px; display: grid; place-items: center;
  font-family: 'Orbitron', sans-serif; font-weight: 800; font-size: 16px; color: #fff;
  background: linear-gradient(135deg, #0ea5e9, #7c3aed); box-shadow: 0 6px 18px rgba(14, 165, 233, 0.35);
}
.api-title { flex: 1; min-width: 0; }
.api-title h2 { margin: 0 0 2px; }
.api-title p { margin: 0; }
.api-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.api-stats > div { padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border); min-width: 0; }
.api-stats small { display: block; font-size: 11px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: .5px; }
.api-stats b { display: block; font-size: 16px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.api-stats b.text-green { color: #34d399; }
.api-form { max-width: 560px; }
.api-note { margin-top: 12px; }
.api-link-list { display: flex; flex-direction: column; gap: 12px; margin: 14px 0; }
.api-prod { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.api-prod-name { padding: 10px 14px; font-weight: 700; color: #fff; background: rgba(124, 58, 237, 0.1); border-bottom: 1px solid var(--border); }
.api-var { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) 96px; gap: 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.api-var:last-child { border-bottom: 0; }
.api-var-info { display: flex; flex-direction: column; min-width: 0; }
.api-var-info b { color: #fff; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.api-var select { margin-top: 0 !important; padding: 9px 12px !important; font-size: 13.5px; }
.api-var .badge { justify-self: end; }
@media (max-width: 600px) {
  .api-head { gap: 10px; }
  .api-logo { width: 40px; height: 40px; font-size: 14px; border-radius: 12px; }
  .api-stats { grid-template-columns: 1fr 1fr; }
  .api-stats > div:last-child { grid-column: 1 / -1; }
  .api-var { grid-template-columns: minmax(0, 1fr) auto; padding: 10px 12px; gap: 8px; }
  .api-var select { grid-column: 1 / -1; grid-row: 2; font-size: 16px !important; }
  .api-form .form-actions .btn { flex: 1; }
}

/* Panel Portal import list */
.pp-rate { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 10px; font-size: 13.5px; color: var(--text-muted); }
.pp-rate input { width: 90px !important; margin: 0 !important; padding: 7px 10px !important; }
.pp-groups { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.pp-group { padding: 0; margin: 0; border-radius: 14px; overflow: hidden; background: rgba(255, 255, 255, 0.02); }
.pp-group[open] { border-color: rgba(124, 58, 237, 0.45); }
.pp-group > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.pp-group > summary::-webkit-details-marker { display: none; }
.pp-group > summary:hover { background: rgba(255, 255, 255, 0.03); }
.pp-group-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pp-group-title b { color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-chev { flex-shrink: 0; color: var(--text-muted); transition: transform .2s ease; }
.pp-group[open] .pp-chev { transform: rotate(180deg); }
.pp-group-body { padding: 4px 14px 14px; border-top: 1px solid var(--border); }
.pp-items { display: flex; flex-direction: column; }
.pp-item { display: grid; grid-template-columns: minmax(0, 1fr) 130px; gap: 6px 12px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.pp-item.is-out { opacity: .55; }
.pp-check { display: flex; align-items: center; gap: 10px; margin: 0; cursor: pointer; min-width: 0; }
.pp-check input { flex-shrink: 0; width: 18px; height: 18px; }
.pp-item-name { display: flex; flex-direction: column; min-width: 0; }
.pp-item-name b { color: #fff; font-size: 14px; }
.pp-item-name small { color: var(--text-muted); font-size: 12px; font-weight: 500; }
.pp-price { display: flex; align-items: center; gap: 6px; }
.pp-price span { color: var(--text-muted); font-weight: 700; }
.pp-price input { margin: 0 !important; padding: 8px 10px !important; }
.pp-links { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; padding-left: 28px; }
.pp-link-tag { display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; color: #6ee7b7; background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.3); }
.pp-link-tag button { width: 20px; height: 20px; border-radius: 50%; border: 0; cursor: pointer; background: transparent; color: #fca5a5; font-size: 14px; line-height: 1; }
.pp-link-tag button:hover { background: rgba(239, 68, 68, 0.2); }
.pp-target { display: grid; grid-template-columns: 1fr 1.3fr 1fr auto; gap: 10px; align-items: end; margin-top: 14px; }
.pp-target label { margin: 0; }
.pp-target.is-existing .pp-new { display: none; }
.pp-target.is-existing { grid-template-columns: 1fr auto; }
.pp-add { white-space: nowrap; }
@media (max-width: 700px) {
  .pp-item { grid-template-columns: minmax(0, 1fr) 110px; }
  .pp-target, .pp-target.is-existing { grid-template-columns: 1fr; }
  .pp-add { width: 100%; }
  .pp-price input, .pp-rate input { font-size: 16px !important; }
}

/* Murubbi mode cards: only one can be chosen; round tick on the chosen one */
.mode-card .check-mark-circle {
  flex: 0 0 22px; width: 22px; height: 22px; margin-left: auto;
  background: transparent; border: 2px solid rgba(255, 255, 255, 0.25); color: transparent; font-size: 12px; font-weight: 900;
}
.mode-card .check-mark-circle::after { content: '\2713'; }
.mode-card:has(input:checked) .check-mark-circle { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 0 12px rgba(124, 58, 237, 0.6); }
.mode-card:not(:has(input:checked)) { background: rgba(255, 255, 255, 0.02); border-color: var(--border); box-shadow: none; transform: none; }
.mode-card:not(:has(input:checked)) .mode-icon-circle { background: rgba(124, 58, 237, 0.2); color: var(--primary-light); box-shadow: none; }

/* Categories: chip + Edit popover (rename / show-hide / delete) */
.cat-item { position: relative; padding: 0; margin: 0; border: 1px solid rgba(124, 58, 237, 0.3); border-radius: 999px; background: rgba(124, 58, 237, 0.1); }
.cat-item.is-hidden { background: rgba(255, 255, 255, 0.03); border-color: rgba(255, 255, 255, 0.14); border-style: dashed; }
.cat-item[open] { border-color: var(--primary-light); z-index: 20; }
.cat-item-head { list-style: none; display: inline-flex; align-items: center; gap: 8px; padding: 5px 5px 5px 12px; cursor: pointer; user-select: none; }
.cat-item-head::-webkit-details-marker { display: none; }
.cat-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.cat-dot.on { background: #34d399; box-shadow: 0 0 6px rgba(52, 211, 153, 0.7); }
.cat-dot.off { background: #f87171; }
.cat-item-name { font-weight: 700; font-size: 13.5px; color: #ede9fe; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-item.is-hidden .cat-item-name { color: var(--text-dim); }
.cat-item-count { min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, 0.08); color: var(--text-muted); }
.cat-item-edit { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #fff; background: rgba(124, 58, 237, 0.45); }
.cat-item-head:hover .cat-item-edit, .cat-item[open] .cat-item-edit { background: var(--primary); }
.cat-pop {
  position: absolute; top: calc(100% + 8px); left: 0; width: 300px; padding: 14px; border-radius: 14px;
  background: #121828; border: 1px solid rgba(124, 58, 237, 0.4); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  display: flex; flex-direction: column; gap: 12px; animation: fadeIn .18s ease;
}
.cat-pop-row { display: flex; align-items: flex-end; gap: 8px; margin: 0; }
.cat-pop-row label { flex: 1; margin: 0; }
.cat-pop-row input { margin-top: 5px; padding: 8px 10px; }
.cat-pop-row + .cat-pop-row { padding-top: 12px; border-top: 1px solid var(--border); align-items: center; justify-content: space-between; }
.cat-pop-vis > div { display: flex; flex-direction: column; min-width: 0; }
.cat-pop-vis b { font-size: 13px; color: #fff; }
.cat-pop .btn { flex-shrink: 0; }
@media (max-width: 600px) {
  .cat-chips { position: relative; }
  .cat-item { position: static; }
  .cat-pop { left: 0; right: 0; width: auto; top: auto; margin-top: 8px; position: absolute; }
  .cat-item-name { max-width: 110px; }
  .cat-pop-row input { font-size: 16px; }
}

/* Payment gateways: step by step setup */
.gw-step .card-header-styled h3 { gap: 10px; }
.gw-num {
  width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--primary), #9333ea);
}
.gw-step.is-done .gw-num { background: var(--green); }
.gw-connected { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.gw-connected code { font-size: 13px; padding: 6px 10px; }
.gw-key-form { margin-top: 14px; max-width: 620px; }
.gw-connected + .gw-key-form { padding-top: 14px; border-top: 1px dashed var(--border); }
.gw-help { padding-left: 18px; line-height: 1.8; margin: 0 0 14px; }
.gw-save-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.gw-save-row .btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; transform: none; }
.gw-switch { display: flex; align-items: center; gap: 10px; margin: 0; }
@media (max-width: 600px) {
  .gw-save-row { flex-direction: column; align-items: stretch; text-align: center; }
  .gw-save-row .btn { width: 100%; }
  .gw-connected .actions { width: 100%; }
  .gw-connected .actions > * { flex: 1; }
  .gw-connected .actions .btn { width: 100%; }
}

/* Category Edit popover must sit above the cards below it */
.card.cat-bar { position: relative; z-index: 30; }
.card.cat-bar:has(.cat-item[open]) { z-index: 60; }

/* Theme picker */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.theme-card, .fx-card { position: relative; margin: 0; cursor: pointer; border-radius: 14px; border: 2px solid var(--border); background: rgba(255, 255, 255, 0.02); transition: border-color .2s, transform .15s, box-shadow .2s; }
.theme-card input, .fx-card input { position: absolute; opacity: 0; pointer-events: none; }
.theme-card:hover, .fx-card:hover { transform: translateY(-2px); border-color: rgba(255, 255, 255, 0.2); }
.theme-card:has(input:checked), .fx-card:has(input:checked) { border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.25); }
.theme-card:has(input:checked)::after, .fx-card:has(input:checked)::after {
  content: '\2713'; position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; font-size: 11px; font-weight: 900; color: #fff; background: var(--primary);
}
.theme-swatch { display: flex; align-items: center; gap: 5px; height: 64px; padding: 0 10px; border-radius: 12px 12px 0 0; }
.theme-swatch i { width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0; }
.theme-swatch i:first-child { width: 24px; height: 24px; }
.theme-swatch b { margin-left: auto; padding: 4px 10px; border-radius: 8px; font-size: 11px; color: #fff; }
.theme-name { display: block; padding: 8px 10px; font-size: 13px; font-weight: 700; color: #fff; }
.fx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.fx-card { display: flex; align-items: center; gap: 10px; padding: 12px; font-size: 13px; font-weight: 700; color: #e5e7eb; }
.fx-ico { width: 30px; height: 30px; flex-shrink: 0; border-radius: 9px; background: #0b0f18; position: relative; overflow: hidden; }
.fx-ico::before { content: ''; position: absolute; inset: 0; }
.fx-off::before { background: linear-gradient(45deg, transparent 45%, #ef4444 45%, #ef4444 55%, transparent 55%); }
.fx-stars::before { background: radial-gradient(circle at 25% 30%, #fff 1px, transparent 2px), radial-gradient(circle at 70% 60%, #a78bfa 1.5px, transparent 2.5px), radial-gradient(circle at 45% 80%, #fff 1px, transparent 2px); }
.fx-network::before { background: linear-gradient(35deg, transparent 48%, #a78bfa 49%, #a78bfa 51%, transparent 52%), radial-gradient(circle at 20% 70%, #a78bfa 2px, transparent 3px), radial-gradient(circle at 80% 30%, #a78bfa 2px, transparent 3px); }
.fx-fireflies::before { background: radial-gradient(circle at 30% 40%, #fde68a 2px, transparent 5px), radial-gradient(circle at 70% 70%, #22d3ee 2px, transparent 5px); }
.fx-snow::before { background: radial-gradient(circle at 30% 30%, #fff 2px, transparent 3px), radial-gradient(circle at 70% 55%, #fff 1.5px, transparent 2.5px), radial-gradient(circle at 45% 80%, #fff 2px, transparent 3px); }
.fx-bubbles::before { background: radial-gradient(circle at 40% 45%, transparent 5px, #22d3ee 6px, transparent 7px), radial-gradient(circle at 72% 75%, transparent 3px, #a78bfa 4px, transparent 5px); }
.fx-embers::before { background: radial-gradient(circle at 35% 70%, #f97316 2px, transparent 4px), radial-gradient(circle at 60% 40%, #fbbf24 1.5px, transparent 3px), radial-gradient(circle at 75% 80%, #ef4444 1.5px, transparent 3px); }
.fx-confetti::before { background: linear-gradient(30deg, transparent 40%, #ec4899 40%, #ec4899 52%, transparent 52%), linear-gradient(-40deg, transparent 60%, #22d3ee 60%, #22d3ee 70%, transparent 70%); }
.fx-matrix::before { content: '01'; color: #22c55e; font: 700 11px monospace; display: grid; place-items: center; }
@media (max-width: 600px) {
  .theme-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .fx-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .theme-form .form-actions .btn { flex: 1; }
}

/* Smaller category chips */
.cat-chips { gap: 6px; }
.cat-item-head { gap: 6px; padding: 3px 3px 3px 9px; }
.cat-dot { width: 6px; height: 6px; }
.cat-item-name { font-size: 12.5px; }
.cat-item-count { min-width: 18px; height: 17px; padding: 0 5px; font-size: 10px; }
.cat-item-edit { padding: 3px 8px; font-size: 11px; gap: 4px; }
.cat-item-edit svg { width: 11px; height: 11px; }
.cat-bar { padding: 14px 18px; }
.cat-bar-head { margin-bottom: 10px; }
.cat-bar-head h2 { font-size: 16px; }
.cat-add input { width: 190px; padding: 7px 11px !important; font-size: 13px !important; }
.cat-add .btn { padding: 7px 12px; }
.cat-tip { margin-top: 8px; font-size: 11.5px; }

/* + Add Product popup */
.ap-modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 16px; }
.ap-modal[hidden] { display: none; }
.ap-backdrop { position: absolute; inset: 0; background: rgba(3, 4, 10, 0.72); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
.ap-box {
  position: relative; width: 100%; max-width: 680px; max-height: calc(100dvh - 32px); overflow-y: auto;
  padding: 20px 22px; border-radius: 18px; background: #111727; border: 1px solid rgba(124, 58, 237, 0.4);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6); animation: fadeIn .2s ease;
}
.ap-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.ap-head h2 { margin: 0; font-size: 18px; }
.ap-x { width: 34px; height: 34px; border: 0; border-radius: 10px; cursor: pointer; font-size: 22px; line-height: 1; color: var(--text-muted); background: rgba(255, 255, 255, 0.05); }
.ap-x:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }
@media (max-width: 600px) {
  .ap-modal { padding: 10px; align-items: flex-end; }
  .ap-box { padding: 16px 14px; border-radius: 18px; }
  .add-product-form .btn-primary { width: 100%; }
  .cat-add input { width: auto; }
}

/* API page: compact connected summary + Edit */
.api-card .api-head { margin-bottom: 12px; }
.api-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px; border-radius: 14px; background: rgba(255, 255, 255, 0.025); border: 1px solid var(--border); }
.api-sum-item { flex: 1 1 110px; min-width: 0; padding: 6px 10px; }
.api-sum-item small { display: block; font-size: 10.5px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: .5px; }
.api-sum-item b { display: block; font-size: 15px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.api-sum-item b.text-green { color: #34d399; }
.api-sum-item b.muted { color: var(--text-muted); }
.api-edit-btn { flex-shrink: 0; gap: 6px; }
.api-edit { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border); animation: fadeIn .2s ease; }
.api-summary + .api-edit { border-top: 0; padding-top: 0; }
.api-note code { word-break: break-all; }

/* Phone: API Integration + Payment Gateways */
@media (max-width: 600px) {
  .api-head { flex-wrap: wrap; }
  .api-head .badge { margin-left: auto; }
  .api-title p { font-size: 12px; }
  .api-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 8px; }
  .api-sum-item { padding: 6px 8px; }
  .api-sum-item b { font-size: 14px; }
  .api-edit-btn { grid-column: 1 / -1; width: 100%; justify-content: center; }
  .api-form .form-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .api-form .form-actions .btn-danger { grid-column: 1 / -1; }
  #import .card-head { flex-wrap: wrap; }
  .pp-group > summary { padding: 10px 12px; }
  .pp-group-body { padding: 4px 12px 12px; }
  .pp-item { grid-template-columns: minmax(0, 1fr) 96px; gap: 6px 8px; }
  .pp-price input { padding: 7px 8px !important; }
  .pp-links { padding-left: 0; }

  .gateway-hero-card { flex-direction: row; align-items: center; flex-wrap: wrap; }
  .hero-left { flex: 1 1 100%; }
  .hero-left p { font-size: 12.5px; }
  .hero-right { margin-left: auto; }
  .mode-card-inner { padding: 14px; gap: 12px; }
  .mode-icon-circle { width: 38px; height: 38px; }
  .mode-info h4 { font-size: 15px; }
  .mode-info p { font-size: 12.5px; }
  .gw-step .card-header-styled { margin-bottom: 14px; }
  .gw-step .card-header-styled h3 { font-size: 15px; }
  .gw-key-form .btn-primary { width: 100%; }
  .wallet-card-input { padding: 12px; }
  .row-2-tight { grid-template-columns: 1fr 110px; }
  .copy-box { flex-direction: row; }
  .copy-box input { font-size: 12px !important; min-width: 0; }
}

/* =========================================================
   Master panel
   ========================================================= */
.mp .container { max-width: 1120px; }
.mp-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mp-stats .stat { margin-bottom: 0; }
.mp-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.mp-bar h2 { margin: 0; }
.mp-bar input { margin-top: 0 !important; max-width: 280px; }
.mp-empty { text-align: center; padding: 44px 20px; }
.mp-empty p { margin-bottom: 14px; }
.mp-sites { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px; }
.mp-site { display: flex; flex-direction: column; gap: 14px; padding: 18px; border-radius: var(--radius-md); background: var(--card); border: 1px solid var(--border); transition: border-color .2s ease; }
.mp-site[hidden] { display: none; }
.mp-site:hover { border-color: rgba(124, 58, 237, .45); }
.mp-site-top { display: flex; align-items: center; gap: 12px; }
.mp-site-top .badge, .mp-hero .badge { flex: none; }
.mp-ava { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 18px; background: linear-gradient(135deg, var(--primary), #ec4899); }
.mp-ava-lg { width: 56px; height: 56px; border-radius: 15px; font-size: 22px; }
.mp-site-id { flex: 1; min-width: 0; }
.mp-site-id b, .mp-site-id h2 { display: block; margin: 0; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-site-id b { font-size: 15.5px; }
.mp-site-id a { display: block; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mp-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 8px; font-size: 11.5px; font-weight: 600; border: 1px solid transparent; }
.mp-chip.on { color: #6ee7b7; background: rgba(16, 185, 129, .1); border-color: rgba(16, 185, 129, .22); }
.mp-chip.off { color: #8b93a3; background: rgba(255, 255, 255, .03); border-color: var(--border); text-decoration: line-through; }
.mp-site-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); }
.mp-back { display: inline-block; margin-bottom: 14px; font-size: 13px; font-weight: 600; color: var(--text-muted); }
.mp-hero { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.mp-hero .mp-site-id { min-width: 160px; }
.mp-cols { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.mp-access .card-head { margin-bottom: 8px; }
.mp-access .card-head h2 { margin: 0; }
.mp-group { margin: 20px 0 10px; font-size: 12.5px; color: var(--text-muted); }
.mp-feats { display: grid; gap: 8px; }
.mp-feat { display: flex; align-items: center; gap: 12px; margin: 0; padding: 12px 14px; border-radius: 12px; cursor: pointer; background: rgba(255, 255, 255, .025); border: 1px solid var(--border); transition: border-color .2s ease, background .2s ease; }
.mp-feat:hover { border-color: rgba(255, 255, 255, .18); }
.mp-feat-ico { flex: none; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: var(--text-dim); background: rgba(255, 255, 255, .04); }
.mp-feat-txt { flex: 1; min-width: 0; }
.mp-feat-txt b { display: block; font-size: 14px; color: #fff; }
.mp-feat-txt small { display: block; font-size: 12px; font-weight: 500; line-height: 1.4; color: var(--text-muted); }
.mp-feat:has(input:checked) { border-color: rgba(16, 185, 129, .3); background: rgba(16, 185, 129, .05); }
.mp-feat:has(input:checked) .mp-feat-ico { color: #34d399; background: rgba(16, 185, 129, .14); }
.mp-feat:has(input:focus-visible) { outline: 2px solid var(--primary-light); outline-offset: 2px; }
.mp-feat .toggle-switch { flex: none; }
.mp-access .gw-save-row { margin-top: 18px; }
.mp .btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.mp-dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 14px; font-size: 13px; }
.mp-dl dt { color: var(--text-muted); }
.mp-dl dd { text-align: right; word-break: break-all; color: #fff; }
.mp-add { max-width: 760px; margin: 0 auto; }
.mp-add h2 { display: flex; align-items: center; gap: 10px; font-size: 17px; }
.mp-add .card > p { margin-bottom: 16px; }
.mp-create { padding: 14px; font-size: 15px; }
@media (max-width: 900px) { .mp-cols { grid-template-columns: 1fr; } }
@media (max-width: 600px) {
  .mp-stats { gap: 8px; }
  .mp-stats .stat { padding: 12px; }
  .mp-stats .stat span { font-size: 10.5px; letter-spacing: 0; }
  .mp-stats .stat b { font-size: 17px; overflow: hidden; text-overflow: ellipsis; }
  .mp-bar { flex-direction: column; align-items: stretch; }
  .mp-bar input { max-width: none; }
  .mp-site { padding: 14px; }
  .mp-site-foot .actions { width: 100%; }
  .mp-site-foot .actions .btn { flex: 1; }
  .mp-feat { padding: 10px 12px; }
}

/* Login details popup + copy rows */
.mp-notice { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-color: rgba(245, 158, 11, .35); background: rgba(245, 158, 11, .07); }
.mp-notice form { flex: none; }
.mp-pop .ap-box { max-width: 440px; text-align: center; padding: 26px 22px 18px; }
.mp-pop .ap-box > h2 { margin: 12px 0 4px; font-size: 22px; }
.mp-pop .ap-box > p { font-size: 13.5px; }
.mp-pop-ico { width: 60px; height: 60px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #10b981, #059669); box-shadow: 0 8px 28px rgba(16, 185, 129, .4); }
.mp-pop-rows { display: grid; gap: 8px; margin: 14px 0; }
.mp-copy { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; text-align: left; font: inherit; color: inherit; cursor: pointer; border-radius: 12px; background: rgba(255, 255, 255, .035); border: 1px solid var(--border); transition: border-color .2s ease; }
.mp-copy:hover { border-color: rgba(124, 58, 237, .5); }
.mp-copy span { flex: 1; min-width: 0; }
.mp-copy small { display: block; font-size: 11px; font-weight: 600; color: var(--text-muted); }
.mp-copy b { display: block; font-size: 13px; line-height: 1.4; color: #fff; word-break: break-all; }
.mp-copy em, .mp-pop .btn em { font-style: normal; }
.mp-copy em { flex: none; font-size: 12px; font-weight: 700; color: var(--primary-light); }
.mp-copy.is-copied em { color: #34d399; }
.mp-pop-done { margin: 8px 0 12px; }
@media (max-width: 600px) {
  .mp-notice { flex-direction: column; align-items: stretch; }
  .mp-notice .btn { width: 100%; }
  .mp-pop { align-items: center !important; }
  .mp-pop .ap-box { padding: 20px 14px 14px; }
}

/* =========================================================
   Keys page
   ========================================================= */
.vgrid { grid-template-columns: 2fr 1fr 90px 190px; }
.vkeys b { font-weight: 800; }
.key-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.key-stats .stat { margin-bottom: 0; }
.key-area { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13.5px; line-height: 1.6; }
.key-count { margin: -8px 0 14px; }
.key-note { margin-top: 12px; }
.kbadge-none { background: rgba(255, 255, 255, .05); color: var(--text-muted); }
.kitem-row { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 14px; padding: 12px 16px; }
.kitem-row::-webkit-details-marker { display: none; }
.kitem-row:hover { background: rgba(255, 255, 255, .03); }
.kitem-row .thumb { width: 56px; height: 40px; flex: none; }
.pitem { padding: 0; scroll-margin-top: 84px; }
.vgrid-btns { align-items: center; }
.vgrid-btns form { display: flex; }
.kitem-chev { flex: none; color: var(--text-muted); transition: transform .2s ease; }
.kitem[open] .kitem-chev { transform: rotate(180deg); }
.kvars { border-top: 1px solid var(--border); padding: 4px 16px; }
.kvar { display: flex; align-items: center; gap: 12px; padding: 11px 0; }
.kvar + .kvar { border-top: 1px dashed var(--border); }
.kvar-info { flex: 1; min-width: 0; }
.kvar-info b { display: block; color: #fff; font-size: 14px; overflow-wrap: anywhere; }
.kvar-info small { display: block; font-size: 12px; }
.kvar .badge, .key-hero .badge { flex: none; }
.kvar-btns { display: flex; gap: 6px; flex: none; }
.key-empty-form { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.key-empty-form select { margin-top: 0; max-width: 380px; }
.key-back { display: inline-block; margin-bottom: 14px; font-size: 13px; font-weight: 600; color: var(--text-muted); }
.key-hero { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.key-hero > div { min-width: 0; }
.key-hero h2 { margin: 0; overflow-wrap: anywhere; }
.key-up > summary { color: #67e8f9; }
.key-up[open] > summary { margin-bottom: 16px; }
.key-tabs { margin-bottom: 14px; }
.key-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; min-height: 34px; }
.key-tools .check { margin: 0; font-size: 13px; }
.key-tools .btn:disabled { opacity: .4; cursor: not-allowed; }
.key-list { display: grid; gap: 8px; }
.key-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .025); border: 1px solid var(--border); }
.key-row:has(input:checked) { border-color: rgba(239, 68, 68, .5); }
.key-row > input { flex: none; }
.key-main { flex: 1; min-width: 0; }
.key-main code { display: block; width: fit-content; max-width: 100%; overflow-wrap: anywhere; font-size: 13px; }
.key-main small { display: block; margin-top: 4px; font-size: 11.5px; line-height: 1.4; }
.key-row .btn { flex: none; }
.key-row.is-sold code { color: var(--text-muted); }
.key-empty { padding: 26px 0; }
.key-page { align-self: center; }
.key-delall { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
@media (max-width: 760px) {
  .vgrid { grid-template-columns: 1fr 1fr; }
  .vgrid > .vgrid-btns { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .key-stats { gap: 8px; }
  .key-stats .stat { padding: 12px 10px; }
  .key-stats .stat span { font-size: 10.5px; letter-spacing: 0; }
  .key-pick { gap: 0; }
  .key-area { font-size: 16px !important; }
  .key-btn-full { width: 100%; padding: 13px; }
  .kitem-row { padding: 10px; gap: 10px; }
  .kitem-row .thumb { width: 46px; height: 46px; }
  .kvars { padding: 2px 10px; }
  .kvar { flex-wrap: wrap; gap: 8px; }
  .kvar-btns { width: 100%; }
  .kvar-btns .btn { flex: 1; padding: 9px; }
  .key-empty-form { flex-direction: column; align-items: stretch; }
  .key-empty-form select { max-width: none; }
  .key-hero { padding: 14px; }
  .key-tabs a { flex: 1; text-align: center; }
  .key-row { gap: 8px; padding: 10px; }
  .key-row .btn { min-height: 38px; padding: 6px 11px; }
  .search-row { gap: 8px; }
  .key-list + .pagination { justify-content: center; }
  .key-delall .btn { width: 100%; }
}
@media (max-width: 760px) { .vgrid-new > input[name=v_name] { grid-column: 1 / -1; } .vgrid-new > input[name=v_price] { grid-column: 1 / -1; } }
@media (max-width: 600px) {
  .pitem-actions { grid-template-columns: minmax(0, 1fr) auto; }
  .pitem-actions .btn-danger { height: 100%; white-space: nowrap; }
  .vgrid-btns > .btn, .vgrid-btns > form .btn { min-height: 38px; }
  .search-row:has(input[type=search]) { flex-direction: row; }
  .search-row:has(input[type=search]) input { min-width: 0; width: auto; }
  .search-row:has(input[type=search]) .btn { width: auto; flex: none; }
}

/* Store picture in the master panel */
.mp-ava { position: relative; overflow: hidden; }
.mp-ava img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.mp-ava.has-img { color: transparent; background: rgba(255, 255, 255, .06); }
.mp-ava.has-img img { opacity: 1; }

/* Customers + expired orders */
.badge-expired { background: rgba(148, 163, 184, .15); color: #cbd5e1; }
.cust-list { display: grid; gap: 10px; }
.cust { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; background: rgba(255, 255, 255, .02); }
.cust-id { flex: 1; min-width: 0; }
.cust-id b, .cust-id small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cust-id b { color: #fff; }
.cust-id small { font-size: 12px; line-height: 1.45; }
.cust-nums { display: flex; gap: 22px; }
.cust-nums small { display: block; font-size: 11px; color: var(--text-dim); }
.cust-nums b { font-size: 13.5px; }
@media (max-width: 760px) {
  .cust { flex-wrap: wrap; }
  .cust-nums { width: 100%; justify-content: space-between; gap: 8px; }
  .cust .actions { width: 100%; }
  .cust .actions .btn, .cust .actions form { flex: 1; }
  .cust .actions form .btn { width: 100%; }
}

/* Footer & Social settings */
.soc-list { display: grid; gap: 10px; }
.soc { display: flex; align-items: center; gap: 13px; padding: 10px 14px; border-radius: 13px; border: 1px solid var(--border); background: rgba(255, 255, 255, .02); }
.soc-ico { flex: none; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: #c4b5fd; background: rgba(124, 58, 237, .16); }
.soc-in { flex: 1; min-width: 0; margin: 0; }
.soc-in input { margin-top: 3px; padding: 8px 11px; }
.soc .toggle-switch { flex: none; margin: 0; }
@media (max-width: 600px) { .soc { padding: 10px; gap: 10px; } .soc-ico { width: 34px; height: 34px; } .soc .toggle-switch { width: 50px; } }

/* Keys: variant picker */
.vp { position: relative; margin-bottom: 16px; }
.vp-label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 600; color: #d1d5db; }
.vp-btn { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 11px 14px; border-radius: 12px; cursor: pointer; text-align: left; font: inherit; font-size: 14.5px; font-weight: 600; color: var(--text-muted); background: rgba(255, 255, 255, .04); border: 1px solid var(--border); transition: border-color .2s ease; }
.vp-btn > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.vp-btn svg { flex: none; transition: transform .2s ease; }
.vp.has-value .vp-btn { color: #fff; }
.vp.is-open .vp-btn, .vp-btn:focus-visible { border-color: var(--border-focus); outline: none; box-shadow: 0 0 0 3px rgba(139, 92, 246, .2); }
.vp.is-open .vp-btn svg { transform: rotate(180deg); }
.vp.is-error .vp-btn { border-color: #ef4444; }
.vp-pop { margin-top: 8px; border-radius: 14px; overflow: hidden; background: #0f1524; border: 1px solid rgba(124, 58, 237, .4); animation: fadeIn .18s ease; }
.vp-search { margin: 10px !important; width: calc(100% - 20px) !important; }
.vp-list { max-height: 340px; overflow-y: auto; padding: 0 10px 10px; }
.vp-group + .vp-group { margin-top: 10px; }
.vp-prod { display: flex; align-items: center; gap: 10px; padding: 7px 6px; }
.vp-prod img { flex: none; width: 34px; height: 24px; border-radius: 6px; object-fit: cover; }
.vp-prod b { min-width: 0; font-size: 13.5px; color: #c4b5fd; overflow-wrap: anywhere; }
.vp-opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 44px; padding: 9px 13px; margin-bottom: 5px; border-radius: 11px; cursor: pointer; text-align: left; font: inherit; font-size: 14px; font-weight: 600; color: #e5e7eb; background: rgba(255, 255, 255, .03); border: 1px solid transparent; }
.vp-opt[hidden], .vp-group[hidden] { display: none; }
.vp-opt:hover, .vp-opt:focus-visible { background: rgba(124, 58, 237, .16); outline: none; }
.vp-opt.is-on { border-color: #8b5cf6; background: rgba(124, 58, 237, .22); }
.vp-opt > span { min-width: 0; overflow-wrap: anywhere; }
.vp-opt em { flex: none; padding: 2px 9px; border-radius: 999px; font-style: normal; font-size: 11.5px; font-weight: 700; }
.vp-opt em.in { color: #34d399; background: rgba(16, 185, 129, .14); }
.vp-opt em.low { color: #fbbf24; background: rgba(245, 158, 11, .14); }
.vp-opt em.out { color: #f87171; background: rgba(239, 68, 68, .13); }
.vp-none { padding: 14px 6px; text-align: center; }
@media (max-width: 600px) { .vp-list { max-height: 46vh; } }

/* Login history */
.side-login { margin: 14px 4px 0; padding: 12px 14px; border-radius: 12px; font-size: 11.5px; line-height: 1.5; color: var(--text-dim); background: rgba(255, 255, 255, .03); border: 1px solid var(--border); overflow-wrap: anywhere; }
.side-login b { color: var(--text-muted); font-weight: 600; }
.lg-list { display: grid; gap: 8px; }
.lg-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: rgba(255, 255, 255, .02); }
.lg-row > div { flex: 1; min-width: 0; }
.lg-row b, .lg-row small { display: block; overflow-wrap: anywhere; }
.lg-row b { font-size: 13.5px; color: #fff; }
.lg-row small { font-size: 12px; }
.lg-row .badge { flex: none; min-width: 78px; justify-content: center; }

/* Telegram settings */
.tg-found { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 14px; }
@media (max-width: 600px) { .gw-step .actions .btn { flex: 1 1 auto; } }

/* Customers: icon buttons, balance popup, details page */
.ic-btn { flex: none; width: 42px; height: 42px; border-radius: 12px; display: inline-grid; place-items: center; cursor: pointer; color: var(--text-muted); background: rgba(255, 255, 255, .05); border: 1px solid var(--border); transition: all .15s ease; }
.ic-btn:hover { color: #fff; border-color: rgba(255, 255, 255, .25); }
.ic-btn.ic-green { color: #34d399; background: rgba(16, 185, 129, .1); border-color: rgba(16, 185, 129, .3); }
.ic-btn.ic-red { color: #f87171; background: rgba(239, 68, 68, .1); border-color: rgba(239, 68, 68, .3); }
.cust-acts { display: flex; align-items: center; gap: 8px; flex: none; }
.cust-acts form { display: flex; }
.cust a.cust-id { color: inherit; }
.cust a.cust-id:hover b { color: var(--primary-light); }
.cust.is-banned { opacity: .72; border-color: rgba(239, 68, 68, .3); }
.cust-nums { min-width: 230px; justify-content: flex-end; }
.bal-box { max-width: 400px; }
.bal-who { display: flex; justify-content: space-between; gap: 12px; padding: 11px 14px; margin-bottom: 14px; border-radius: 12px; font-size: 13.5px; background: rgba(255, 255, 255, .04); border: 1px solid var(--border); }
.bal-who > b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff; }
.bal-who span { flex: none; color: var(--text-muted); }
.bal-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.bal-mode label { margin: 0; cursor: pointer; }
.bal-mode input { position: absolute; opacity: 0; }
.bal-mode span { display: block; padding: 12px; border-radius: 12px; text-align: center; font-weight: 700; font-size: 14px; color: var(--text-muted); background: rgba(255, 255, 255, .04); border: 1px solid var(--border); }
.bal-mode input:checked + span { color: #34d399; border-color: #10b981; background: rgba(16, 185, 129, .13); }
.bal-mode input[value=remove]:checked + span { color: #f87171; border-color: #ef4444; background: rgba(239, 68, 68, .13); }
.bal-mode input:focus-visible + span { outline: 2px solid var(--primary-light); outline-offset: 2px; }
.cd-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.cd-id { flex: 1; min-width: 200px; }
.cd-id h2 { margin: 0; overflow-wrap: anywhere; }
.cd-id span, .cd-id small { display: block; overflow-wrap: anywhere; }
.cd-id small { margin-top: 3px; font-size: 12px; }
.cd-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cd-stats .stat { margin-bottom: 0; }
.cd-list { display: grid; gap: 10px; }
.cd { padding: 15px 18px; border-radius: 16px; background: var(--card); border: 1px solid var(--border); }
.cd-top { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
.cd-top b { color: #fff; font-size: 15px; }
.cd-top strong { margin-left: auto; font-size: 16px; }
.cd dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 20px; margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--border); }
.cd dl div { min-width: 0; }
.cd dt { font-size: 11.5px; color: var(--text-dim); }
.cd dd { font-size: 13.5px; font-weight: 600; color: #e5e7eb; overflow-wrap: anywhere; }
.cd .btn { margin-top: 12px; }
.cp { padding: 0; border: 0; background: none; cursor: pointer; font: inherit; color: inherit; text-align: left; overflow-wrap: anywhere; }
.cp em { font-style: normal; font-size: 11px; font-weight: 700; color: var(--primary-light); white-space: nowrap; }
@media (max-width: 760px) {
  .cust-nums { min-width: 0; justify-content: space-between; }
  .cust .cust-acts { order: 2; }
  .cust .cust-nums { order: 3; }
  .cust-acts { gap: 6px; }
  .cust .ic-btn { width: 38px; height: 38px; }
}
@media (max-width: 600px) {
  .cd-stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .cd-tabs a { flex: 1; text-align: center; }
  .cd { padding: 13px 14px; }
  .cd dl { grid-template-columns: 1fr; gap: 7px; }
  .cd dl div { display: flex; justify-content: space-between; gap: 14px; }
  .cd dt { flex: none; font-size: 12.5px; }
  .cd dd { text-align: right; font-size: 13px; }
  .cd .cp { text-align: right; }
  .cd .btn { width: 100%; }
}

/* Key search */
.ks-card .search-row { margin-bottom: 8px; }
.ks-key { font-size: 15px; font-weight: 700; overflow-wrap: anywhere; min-width: 0; }
.ks-copy { margin: 0 0 0 auto !important; }
.cd .actions { margin-top: 12px; }
.cd .actions .btn { margin-top: 0; }
@media (max-width: 600px) { .cd .ks-copy { width: auto; } .cd .actions .btn { flex: 1; } }

/* category position */
.cat-item-pos { min-width: 17px; height: 17px; padding: 0 4px; border-radius: 6px; font-size: 10px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.3); color: var(--text-muted); }
.cat-pop-row.cat-pop-pos { align-items: flex-end; }
.cat-pos-form { display: flex; align-items: flex-end; gap: 8px; flex: 1; min-width: 0; margin: 0; }
.cat-pos-form label { flex: 1; margin: 0; }
.cat-pos-form input { width: 100%; }
.cat-move { display: flex; gap: 4px; margin: 0; }
.cat-move .btn { min-width: 34px; font-size: 15px; line-height: 1; }
.cat-move .btn:disabled { opacity: 0.35; cursor: not-allowed; }
