:root {
  --bg: #0d1117;
  --surface: #161b22;
  --surface2: #21262d;
  --border: #30363d;
  --text: #c9d1d9;
  --muted: #8b949e;
  --accent: #3570c3;
  --green: #2ea043;
  --red: #9b2c2c;
}

[data-theme="light"] {
  --bg: #f5f5f5;
  --surface: #ffffff;
  --surface2: #e8eaed;
  --border: #dadce0;
  --text: #202124;
  --muted: #5f6368;
  --accent: #1a73e8;
  --green: #188038;
  --red: #c5221f;
}

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes slideIn { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* Layout */
.wrap { margin: 0 auto; padding: 16px 20px; }
.bar {
  background: var(--surface);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
  font-size: 12px;
}
.bar .sep { width: 1px; height: 24px; background: var(--border); flex-shrink: 0; }

/* Grid & KPI */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 4px; margin-bottom: 6px; }
.grid-compact { grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: 3px; }

.kpi { padding: 8px 10px; border-radius: 6px; background: var(--surface); }
.kpi .t { font-size: 8px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; font-weight: 600; margin-bottom: 0; }
.kpi .v { font-size: 16px; font-weight: 700; line-height: 1.2; color: var(--text); }

/* Stats chips */
.toolbar-stats { display:inline-flex; align-items:center; min-width:0; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.stats-inline { display:flex; align-items:center; gap:4px; flex-wrap:nowrap; min-width:0; }
.s-chip { display:inline-flex; align-items:baseline; gap:3px; background:var(--surface2); padding:2px 7px; border-radius:4px; white-space:nowrap; font-size:11px; }
.s-lbl { color:var(--muted); font-size:8px; text-transform:uppercase; font-weight:600; letter-spacing:0.02em; }
.s-val { font-weight:700; color:var(--text); font-size:12px; }
.s-blocked { color:var(--red); }
.s-sub { color:var(--muted); font-size:9px; margin-left:1px; }
.s-div { width:1px; height:14px; background:var(--border); margin:0 2px; flex-shrink:0; }
.s-cb { color:var(--accent); font-weight:700; cursor:pointer; border-bottom:1px dashed var(--accent); }

/* Panel & Toolbar */
.panel { background: var(--surface); border-radius: 8px; padding: 12px; }
.panel h2 { margin: 0; font-size: 15px; font-weight: 600; }
.toolbar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }

/* Buttons - unified */
.btn {
  border: none;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
  line-height: 1;
  background: var(--surface2);
  color: var(--text);
}
.btn:hover { opacity: 0.8; }
.btn-ghost { background: transparent; color: var(--text); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-red { background: var(--red); color: #fff; }
.btn-sm { padding: 4px 7px; font-size: 10px; border-radius: 4px; }
.btn-lg { padding: 12px; font-size: 14px; border-radius: 8px; width: 100%; }
.btn-submit { background: var(--accent); color: #fff; padding: 8px 16px; border-radius: 6px; border: none; cursor: pointer; font-weight: 600; }
.btn-submit:hover { opacity: 0.8; }
.btn-submit:active { transform: translateY(1px); }
.btn-cancel, .cancel-submit { padding: 8px 16px; background: var(--border); color: var(--text); border: none; border-radius: 6px; cursor: pointer; }
.btn-cancel:hover, .cancel-submit:hover { opacity: 0.8; }

/* Compact buttons */
.b { border:none; border-radius:3px; padding:2px 5px; font-size:9px; font-weight:600; cursor:pointer; line-height:1.2; background:var(--surface2); color:var(--text); flex-shrink:0; }
.b:hover { opacity:0.8; }
.b.r { background:var(--red); color:#fff; }
.btn-claim { border:none; border-radius:6px; padding:4px 12px; background:var(--green); color:#fff; font-size:10px; font-weight:700; cursor:pointer; transition:opacity 0.15s; }
.btn-claim:hover { opacity:0.8; }
.btn-toggle { display:inline-block; padding:1px 6px; border-radius:4px; cursor:pointer; font-size:10px; font-weight:700; line-height:16px; color:#fff; user-select:none; transition:.15s; }
.btn-toggle:hover { filter:brightness(1.15); }
.btn-toggle:active { filter:brightness(.85); }
.btn-toggle-group { display:inline-flex; gap:3px; margin-right:6px; vertical-align:middle; }

/* Tables - unified responsive */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--surface2); text-align: left; vertical-align: top; }
th { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
tr:hover td { background: rgba(255,255,255,0.02); }
tr.group-sep:hover td, tr.group-sep td:hover { background: none; }

/* Table variants */
.pm-table { width:100%; border-collapse:collapse; font-size:12px; }
.pm-table thead th { padding:10px 12px; text-align:left; font-size:10px; font-weight:600; color:var(--muted); text-transform:uppercase; letter-spacing:0.3px; border-bottom:1px solid var(--border); }
.pm-table tbody td { padding:10px 12px; border-bottom:1px solid var(--surface2); vertical-align:middle; }
.pm-table tbody tr:hover td { background:rgba(255,255,255,0.02); }

.orders-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.orders-table th { padding: 4px 8px; font-size: 9px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; background: rgba(0,0,0,0.15); border-bottom: 1px solid var(--border); }
.orders-table td { padding: 6px 8px; border-bottom: 1px solid rgba(255,255,255,0.04); vertical-align: middle; }
.orders-table tr:last-child td { border-bottom: none; }

.ot { width:100%; border-collapse:collapse; font-size:10px; }
.ot th { padding:2px 4px; font-size:8px; font-weight:600; color:var(--muted); text-transform:uppercase; background:rgba(0,0,0,0.1); border-bottom:1px solid var(--border); text-align:left; }
.ot td { padding:3px 4px; border-bottom:1px solid rgba(255,255,255,0.03); vertical-align:middle; }
.ot tr:hover td { background:rgba(255,255,255,0.03); }

/* Table cells */
.acc-head td { padding: 12px 10px 6px; }
.acc-head:not(:first-of-type) td { border-top: 1px solid var(--border); }
.orders-row td { padding: 0; border-bottom: none; }
.group-sep td { padding: 0; height: 18px; border: none; background: transparent; }

.cell-card { font-size: 15px; font-weight: 600; font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace; letter-spacing: 0.03em; color: var(--text); }
.cell-balance { font-size: 17px; font-weight: 700; font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace; letter-spacing: 0.02em; }
.cell-delta .status { font-size: 13px; padding: 3px 10px; font-weight: 700; }
.cell-changed { line-height: 1.3; }
.cell-time { font-size: 13px; font-weight: 600; }
.cell-date { font-size: 10px; color: var(--muted); }

/* Status badges - unified */
.status, .s, .badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.2;
}
.s { padding: 1px 5px; font-size: 8px; text-transform: uppercase; }
.badge { padding: 1px 8px; font-size: 10px; }

.status-active, .status-confirmed, .s-active, .s-cf, .s-confirmed, .badge-green { background: rgba(88,166,255,0.12); color: var(--accent); }
.status-positive, .s-up, .s-positive { background: rgba(63,185,80,0.12); color: var(--green); }
.status-blocked, .status-error, .status-rejected, .s-dn, .s-blocked, .s-error, .s-rejected, .s-cancelled { background: rgba(248,81,73,0.12); color: var(--red); }
.status-pending, .s-pd, .s-pending { background: rgba(139,148,158,0.12); color: var(--muted); }
.status-matched, .s-matched { background: rgba(88,166,255,0.12); color: #58a6ff; }
.s-pin { background: rgba(255,179,0,0.12); color: #ffb300; }
.s-bank { background: var(--surface2); color: var(--muted); font-weight: 500; }
.badge-accent { background: rgba(53,112,195,0.12); color: var(--accent); }

/* Status badge with dot */
.status-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px; font-size: 10px; font-weight: 700;
}
.status-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.status-default { background: rgba(139,148,158,0.12); color: var(--muted); }
.status-default::before { background: var(--muted); }
.status-success { background: rgba(46,160,67,0.12); color: var(--green); }
.status-success::before { background: var(--green); }
.status-error { background: rgba(155,44,44,0.12); color: var(--red); }
.status-error::before { background: var(--red); }
.status-info { background: rgba(53,112,195,0.15); color: #58a6ff; }
.status-info::before { background: #58a6ff; }
.status-warning { background: rgba(255,179,0,0.12); color: #ffb300; }
.status-warning::before { background: #ffb300; }
.status-accent { background: rgba(53,112,195,0.12); color: var(--accent); }
.status-accent::before { background: var(--accent); }

/* Order specific */
.order-row-auto-confirm { background: rgba(63, 185, 80, 0.15) !important; transition: background 0.3s ease; border-left: 3px solid var(--green); }
.order-row-auto-confirm td { border-bottom-color: rgba(63, 185, 80, 0.3) !important; color: var(--text) !important; }
.auto-confirm-timer { display: inline-flex; align-items: center; gap: 4px; color: var(--green); font-weight: 700; font-family: 'JetBrains Mono', monospace; font-size: 11px; }

.order-row td { border-bottom: 1px solid rgba(255,255,255,0.08); border-right: 1px solid rgba(255,255,255,0.04); }
.order-row:last-child td { border-bottom: none; }
.order-row:hover td { background: rgba(255,255,255,0.03); }
.order-id { font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace; font-size: 11px; cursor: pointer; color: var(--muted); }
.order-id:hover { color: var(--accent); }
.order-amount { font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace; font-size: 13px; font-weight: 700; }
.order-state { font-size: 11px; font-weight: 500; }
.timer-chip { font-size: 11px; font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace; color: var(--accent); }

/* Orders wrap */
.orders-wrap { background: var(--surface2); border-radius: 6px; border: 1px solid var(--border); overflow: hidden; }
.orders-title { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; padding: 8px 10px 6px; border-bottom: 1px solid var(--border); }

/* Toggles - unified */
.toggle, .tog { position: relative; display: inline-block; vertical-align: middle; }
.toggle { width: 32px; height: 18px; }
.tog { width: 24px; height: 14px; flex-shrink: 0; }
.toggle input, .tog input { opacity: 0; width: 0; height: 0; }
.toggle .slider, .tog-s { position: absolute; cursor: pointer; inset: 0; background: var(--border); border-radius: 20px; transition: 0.2s; }
.toggle .slider::before { content: ''; position: absolute; left: 2px; bottom: 2px; width: 14px; height: 14px; background: #fff; border-radius: 50%; transition: 0.2s; }
.tog-s::before { content: ''; position: absolute; left: 2px; bottom: 1px; width: 10px; height: 10px; background: #fff; border-radius: 50%; transition: 0.2s; }
.toggle input:checked + .slider, .tog input:checked + .tog-s { background: var(--accent); }
.toggle input:checked + .slider::before { transform: translateX(14px); }
.tog input:checked + .tog-s::before { transform: translateX(10px); }

/* Theme toggle */
.theme-btn { font-size: 14px; padding: 0 4px; min-width: 28px; text-align: center; background: transparent; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; color: var(--text); line-height: 24px; }

/* Inputs */
input[type="checkbox"] { accent-color: var(--green); cursor: pointer; }
input[type="number"], input[type="text"] {
  background: var(--surface2); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; font-size: 12px;
}
.form-group { margin-bottom: 10px; }
.form-group label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 12px; background: var(--surface2); color: var(--text); outline: none;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { border-color: var(--accent); }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }

/* Account cards */
.account-cards { display: flex; flex-direction: column; gap: 4px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.card-bd { display: flex; }
.card-l { flex: 0 0 260px; padding: 4px 8px; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
.card-r { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-x: auto; -webkit-overflow-scrolling: touch; }

.cl1 { display: flex; align-items: center; gap: 4px; flex-wrap: nowrap; font-size: 10px; line-height: 1.2; min-height: 18px; }
.cl1-n { font-size: 13px; font-weight: 700; min-width: 60px; flex-shrink: 0; }
.cc { font-family: 'JetBrains Mono','Fira Code','Consolas',monospace; font-size: 16px; letter-spacing: 0.04em; font-weight: 700; min-width: 50px; flex-shrink: 0; }
.cb { font-size: 13px; font-weight: 700; cursor: pointer; min-width: 80px; flex-shrink: 0; }
.cb:hover { opacity: 0.7; }

.d { font-size: 14px; font-weight: 800; min-width: 60px; flex-shrink: 0; text-align: right; }
.d.up { color: var(--green); }
.d.dn { color: var(--red); }
.d.z { color: var(--muted); }

.t { font-size: 12px; font-weight: 700; min-width: 40px; flex-shrink: 0; }
.td { font-size: 10px; color: var(--muted); font-weight: 500; min-width: 70px; flex-shrink: 0; }

.cl2, .cl3 { display: flex; align-items: center; gap: 4px; min-height: 18px; flex-wrap: nowrap; }
.cl4 { display: flex; align-items: center; gap: 4px; min-height: 24px; flex-wrap: wrap; }

.thumbs { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; cursor: pointer; flex-shrink: 0; }
.thumb { width: 48px; height: 32px; object-fit: cover; border-radius: 4px; background: #000; cursor: pointer; }
.thumb:hover { opacity: 0.7; }
.th { width: 28px; height: 18px; object-fit: cover; border-radius: 2px; background: #000; cursor: pointer; }
.th:hover { opacity: 0.7; }

.cr-h { padding: 4px 8px; font-size: 9px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; border-bottom: 1px solid var(--border); }

.oid { font-family: 'JetBrains Mono','Fira Code','Consolas',monospace; font-size: 9px; cursor: pointer; color: var(--muted); min-width: 50px; flex-shrink: 0; }
.oid:hover { color: var(--accent); }
.tmr { font-size: 9px; font-family: 'JetBrains Mono','Fira Code','Consolas',monospace; color: var(--accent); }
.mon-timer { font-size: 10px; font-family: 'JetBrains Mono','Fira Code','Consolas',monospace; color: var(--muted); font-weight: 600; flex-shrink: 0; }

/* Payout market */
.id-chip { display: inline-block; padding: 2px 8px; border-radius: 999px; font-family: 'JetBrains Mono',monospace; font-size: 10px; font-weight: 600; background: rgba(53,112,195,0.12); color: var(--accent); cursor: pointer; }
.id-chip:hover { opacity: 0.8; }
.bank-cell { display: flex; align-items: center; gap: 6px; min-width: 0; }
.bank-logo { width: 28px; height: 28px; border-radius: 6px; background: var(--surface2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.bank-logo img { width: 20px; height: 20px; object-fit: contain; }
.req-cell { min-width: 0; }
.req-value { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; font-family: 'JetBrains Mono',monospace; font-size: 12px; font-weight: 500; }
.req-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy-btn { cursor: pointer; color: var(--muted); font-size: 13px; flex-shrink: 0; line-height: 1; transition: color 0.15s; font-style: normal; }
.copy-btn:hover { color: var(--text); }
.countdown { font-family: 'JetBrains Mono',monospace; }
.countdown .tmr-val { transition: color 0.3s; }

/* Action menu */
.action-menu-wrapper { position: relative; display: inline-block; }
.action-menu-btn { border: none; background: var(--surface2); color: var(--text); width: 28px; height: 28px; border-radius: 6px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 16px; line-height: 1; transition: background 0.15s; }
.action-menu-btn:hover { background: var(--border); }
.action-menu { display: none; position: fixed; z-index: 200; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 4px; min-width: 180px; box-shadow: 0 8px 24px rgba(0,0,0,0.5); }
.action-menu.open { display: block; }
.action-menu-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 6px; cursor: pointer; font-size: 12px; color: var(--text); white-space: nowrap; transition: background 0.1s; }
.action-menu-item:hover { background: var(--surface2); }
.action-icon { font-size: 14px; width: 18px; text-align: center; flex-shrink: 0; }
.success-icon { color: var(--green); }
.primary-icon { color: var(--accent); }
.warning-icon { color: #ffb300; }
.error-icon { color: var(--red); }

/* Banners */
.conn-banner { display: none; background: var(--red); color: #fff; padding: 4px 10px; border-radius: 6px; font-size: 11px; font-weight: 600; }
.conn-banner.show { display: inline-block; }
.uipay-auth-banner { display: inline-block; padding: 4px 10px; border-radius: 6px; font-size: 11px; font-weight: 600; }
.uipay-auth-banner.ok { background: rgba(63,185,80,0.15); color: var(--green); }
.uipay-auth-banner.warn { background: rgba(255,179,0,0.15); color: #ffb300; }
.uipay-auth-banner.error { background: rgba(248,81,73,0.15); color: var(--red); animation: pulse-warn 1.5s ease-in-out infinite; }
@keyframes pulse-warn { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* Loading */
.row-loading { display: none; align-items: center; gap: 4px; font-size: 10px; color: var(--muted); }
.row-loading.show { display: inline-flex; }
.spinner-sm { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--surface2); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
.ldr { display: none; align-items: center; }
.ldr.show { display: inline-flex; }
.ldrtxt { font-size: 9px; color: var(--muted); margin-left: 4px; }
.sp { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--accent); animation: spin 0.8s linear infinite; display: inline-block; }

.loader { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: none; align-items: center; justify-content: center; flex-direction: column; gap: 12px; z-index: 300; }
.loader.show { display: flex; }
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--surface2); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }

/* Modals */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: none; align-items: center; justify-content: center; z-index: 200; }
.modal-overlay.open { display: flex; }
.modal { background: var(--surface); border-radius: 10px; padding: 20px; width: min(520px, 92vw); max-height: 85vh; overflow: auto; }

.confirm-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: none; align-items: center; justify-content: center; z-index: 250; }
.confirm-overlay.open { display: flex; }
.confirm-card { background: var(--surface); border-radius: 10px; padding: 20px; width: min(400px, 92vw); max-width: 500px; }
.confirm-card .head { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.confirm-card .head h3 { margin: 0; font-size: 16px; font-weight: 600; color: var(--text); }
.confirm-card .body { margin-bottom: 16px; }
.confirm-card .fact-row { margin-bottom: 16px; }
.confirm-card .fact-row input { width: 100%; padding: 8px; background: var(--surface2); border: 1px solid var(--border); border-radius: 6px; color: var(--text); }
.confirm-card .actions { display: flex; gap: 8px; justify-content: flex-end; }

/* Toast */
.toast { position: fixed; right: 16px; bottom: 16px; background: var(--surface2); color: var(--text); padding: 8px 12px; border-radius: 6px; font-size: 12px; z-index: 400; animation: slideIn 0.25s ease; }

/* Utilities */
.muted { color: var(--muted); font-size: 9px; line-height: 1.1; }
.m { color: var(--muted); }
.hidden { display: none; }

/* Responsive helpers */
@media (min-width: 640px) { .sm-inline { display: inline; } }

/* Responsive - mobile first approach */
@media (max-width: 768px) {
  .wrap { padding: 8px; }
  .grid { grid-template-columns: repeat(3, 1fr); gap: 3px; }
  .bar { padding: 4px 6px; gap: 3px; font-size: 10px; }
  .bar .btn, .bar input { font-size: 10px; padding: 3px 5px; }
  .kpi .v { font-size: 14px; }
  .kpi { padding: 6px 8px; }
  .panel { padding: 8px; }
  table { font-size: 10px; }
  th, td { padding: 4px 3px; }
  .group-sep td { padding: 0; }
  .card-bd { flex-direction: column; }
  .card-l { flex: none; border-right: none; border-bottom: 1px solid var(--border); }
}

@media (max-width: 480px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .modal { padding: 12px; width: 96vw; }
}

/* Bar at bottom */
.bar-bottom { position: fixed; bottom: 0; left: 0; right: 0; margin: 0; border-radius: 0; border-top: 1px solid var(--border); z-index: 100; }
.bar-bottom .btn { font-size: 10px; padding: 4px 7px; }
.wrap { padding-bottom: 72px; }

/* Bottom spacer to prevent content overlap */
.bottom-spacer {
    height: 60px;
    width: 100%;
}

/* Tab bar responsive - NEW */
.tab-bar { display: flex; gap: 4px; margin: 8px 0; border-bottom: 1px solid var(--border); padding-bottom: 4px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tab-btn { padding: 6px 12px; border: none; border-radius: 6px 6px 0 0; cursor: pointer; font-size: 12px; font-weight: 600; background: var(--surface); color: var(--text); white-space: nowrap; flex-shrink: 0; }
.tab-btn.tab-active { background: var(--accent); color: #fff; }

/* Subtab bar responsive */
.subtab-bar { display: flex; gap: 4px; flex-wrap: wrap; margin: 0 0 8px; }
.subtab-btn { padding: 5px 12px; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; font-size: 11px; font-weight: 600; background: var(--surface); color: var(--text); }
.subtab-btn.subtab-active { background: var(--accent); color: #fff; }

/* Table scroll wrapper for mobile */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Orders table scroll wrapper */
.ot-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ot-wrap .ot th, .ot-wrap .ot td { white-space: nowrap; }
.ot-wrap .ot td { padding: 2px 4px; }

/* Light theme refinements */
[data-theme="light"] .loader { background: rgba(0,0,0,0.3); }
[data-theme="light"] .th { background: var(--surface2); }
[data-theme="light"] .order-row td { border-bottom: 1px solid rgba(0,0,0,0.06); border-right: 1px solid rgba(0,0,0,0.03); }
[data-theme="light"] .order-row:hover td { background: rgba(0,0,0,0.02); }
[data-theme="light"] tr:hover td { background: rgba(0,0,0,0.02); }