:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --sidebar: #0a0a0a;
  --sidebar-2: #1c1c1e;
  --accent: #22d3ee;
  --accent-2: #7c3aed;
  --ok: #059669;
  --warn: #d97706;
  --danger: #dc2626;
  --woo: #9b5de5;
  --shopify: #95bf47;
  --magento: #f26322;
  --shadow: 0 1px 2px rgba(15,23,42,.06), 0 8px 24px rgba(15,23,42,.04);
  --radius: 14px;
  --sidebar-w: 268px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
  font-size: 14.5px;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 100%);
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  color: #fff; text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-logo { height: 32px; width: auto; display: block; flex-shrink: 0; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center; font-weight: 800; color: #fff; letter-spacing: -.5px;
}
.brand h1 { font-size: 15px; font-weight: 700; letter-spacing: -.2px; }
.brand p { font-size: 11px; color: #94a3b8; font-weight: 500; }
.nav { padding: 14px 12px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav a {
  color: #cbd5e1; text-decoration: none; padding: 9px 12px; border-radius: 8px;
  font-weight: 550; font-size: 13.5px; display: flex; align-items: center; gap: 10px;
}
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav a.active { background: rgba(34,211,238,.14); color: #67e8f9; }
.nav .sec { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: #64748b; padding: 14px 12px 6px; }
.sidebar-user {
  padding: 14px 16px 18px; border-top: 1px solid rgba(255,255,255,.06);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.sidebar-user .who { font-size: 12px; color: #94a3b8; }
.sidebar-user .who strong { display: block; color: #e2e8f0; font-size: 13px; }
.main { flex: 1; min-width: 0; }
.top {
  background: var(--surface); border-bottom: 1px solid var(--line);
  padding: 16px 28px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
}
.top h2 { font-size: 22px; letter-spacing: -.4px; }
.top .lead { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.content { padding: 24px 28px 64px; max-width: 1280px; }
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.kpi, .card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.kpi { padding: 18px 18px 16px; }
.kpi .lbl { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.kpi .val { font-size: 28px; font-weight: 750; letter-spacing: -.6px; margin-top: 4px; }
.kpi .sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.card { overflow: hidden; margin-bottom: 16px; }
.card-h {
  padding: 14px 18px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.card-h h3 { font-size: 15px; }
.card-b { padding: 18px; }
.card-b.tight { padding: 0; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); background: #f8fafc; }
td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: #f8fafc; }
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .02em;
  background: #f1f5f9; color: #334155;
}
.badge.ok { background: #d1fae5; color: #065f46; }
.badge.warn { background: #fef3c7; color: #92400e; }
.badge.danger { background: #fee2e2; color: #991b1b; }
.badge.info { background: #dbeafe; color: #1e3a8a; }
.badge.woo { background: #f3e8ff; color: #6b21a8; }
.badge.shopify { background: #ecfccb; color: #3f6212; }
.badge.magento { background: #ffedd5; color: #9a3412; }
.badge.muted { background: #f1f5f9; color: #64748b; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 8px 14px; border-radius: 9px; font-weight: 600; font-size: 13px; cursor: pointer;
}
.btn:hover { background: #f8fafc; text-decoration: none; }
.btn-primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-primary:hover { background: #1e293b; }
.btn-accent { background: var(--accent); color: #042f2e; border-color: var(--accent); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.field { margin-bottom: 14px; }
label { display: block; font-size: 12.5px; font-weight: 650; margin-bottom: 5px; color: #334155; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%; max-width: 520px; padding: 9px 11px; border: 1px solid #cbd5e1; border-radius: 9px; font-size: 14px; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.alert { padding: 12px 14px; border-radius: 10px; margin-bottom: 14px; font-size: 13.5px; }
.alert-error { background: #fef2f2; color: #991b1b; }
.alert-ok { background: #ecfdf5; color: #065f46; }
.alert-info { background: #eff6ff; color: #1e3a8a; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.filters .field { margin: 0; min-width: 160px; }
.filters input, .filters select { max-width: 220px; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
.muted { color: var(--muted); }
.prose h2 { font-size: 18px; margin: 22px 0 8px; }
.prose h3 { font-size: 15px; margin: 16px 0 6px; }
.prose p, .prose li { margin-bottom: 8px; }
.prose ol, .prose ul { padding-left: 20px; margin-bottom: 10px; }
.prose code { background: #f1f5f9; padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.stat-item { text-align: center; padding: 8px 4px; border-radius: 8px; }
.stat-item.pending { background: #fef3c7; }
.stat-item.processing { background: #dbeafe; }
.stat-item.completed { background: #d1fae5; }
.stat-item.failed { background: #fee2e2; }
.stat-number { font-size: 18px; font-weight: 750; }
.stat-label { font-size: 10px; text-transform: uppercase; letter-spacing: .3px; opacity: .8; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.on { background: var(--ok); }
.dot.off { background: #cbd5e1; }
.dot.degraded { background: var(--warn); }
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
.login-logo { height: 40px; width: auto; margin-bottom: 28px; display: block; }
.login-brand {
  background: radial-gradient(900px 500px at 12% 8%, rgba(34,211,238,.22), transparent 50%),
              radial-gradient(800px 480px at 90% 90%, rgba(124,58,237,.28), transparent 46%),
              linear-gradient(160deg, #0a0a0a 0%, #1c1c1e 55%, #111113 100%);
  color: #fff; padding: 56px 64px; display: flex; flex-direction: column; justify-content: space-between;
}
.login-brand h1 { font-size: 34px; letter-spacing: -.8px; margin: 18px 0 10px; }
.login-brand p { color: #94a3b8; max-width: 440px; font-size: 15px; }
.login-panel { display: grid; place-items: center; padding: 40px; background: #fff; }
.login-box { width: 100%; max-width: 400px; }
.login-box h2 { font-size: 24px; margin-bottom: 6px; }
.login-box .lead { margin-bottom: 22px; }
.login-box input { max-width: none; margin-bottom: 10px; }
.login-box .btn { width: 100%; padding: 12px; margin-top: 6px; }
.pill { font-size: 11px; padding: 4px 10px; border-radius: 999px; background: rgba(14,165,164,.15); color: #5eead4; display: inline-block; font-weight: 650; }
.err { word-break: break-word; max-width: 420px; }
.impersonate-bar {
    background: #f59e0b;
    color: #1c1917;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 13.5px;
    font-weight: 600;
}
.impersonate-bar .btn { background: #1c1917; color: #fff; border-color: #1c1917; }
.sec-title { font-size: 15px; margin: 8px 0 4px; letter-spacing: -.2px; }
.kind-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.price-grid { display: flex; flex-direction: column; gap: 8px; }
.price-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); }
.price-card .name { font-weight: 700; font-size: 14px; }
.price-card .price { font-size: 18px; font-weight: 750; letter-spacing: -.3px; margin: 4px 0; color: var(--ink); }
.price-card p { color: var(--muted); font-size: 12.5px; margin-bottom: 6px; }
.price-card ul { margin: 0 0 0 16px; color: var(--muted); font-size: 12.5px; }
@media (max-width: 960px) {
  .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .login-wrap { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .sidebar { display: none; }
  .content, .top { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 640px) {
  .grid-4, .grid-3, .grid-2, .stat-row { grid-template-columns: 1fr 1fr; }
}
