/* ──────────────────────────────────────────────────────────────────────────
   LUFFY PANEL — style.css
   Dark theme matching profex: #0a0a0f bg, #111118 cards, #1e1e2a borders
────────────────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg:         #080808;
  --bg-card:    #111111;
  --bg-card2:   #0d0d0d;
  --bg-input:   #111111;
  --border:     #1f1f1f;
  --border2:    #1a1a1a;
  --border3:    #222222;
  --text:       #ffffff;
  --text-dim:   #cccccc;
  --text-muted: #888888;
  --text-faint: #555555;
  --text-ghost: #444444;
  --red:        #ef4444;
  --red-glow:   rgba(239,68,68,0.3);
  --green:      #22c55e;
  --green-glow: rgba(34,197,94,0.3);
  --yellow:     #facc15;
  --purple:     #a855f7;
  --amber:      #f59e0b;
  --blue:       #0088cc;
  --accent-red: #dc2626;
}

html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: #3a3a3a; }

/* ── Utility ── */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ────────────────────────────────────────────────────────────────────────── */
/*  LOGIN PAGE                                                                */
/* ────────────────────────────────────────────────────────────────────────── */

#login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 60% 0%, hsla(0,60%,12%,0.5) 0%, transparent 60%),
    radial-gradient(ellipse at 0% 100%, hsl(220,30%,8%) 0%, hsl(220,25%,5%) 100%);
}

.login-grid-bg {
  position: absolute;
  inset: 0;
  opacity: 0.03;
  background-image:
    linear-gradient(hsl(220,15%,92%) 1px, transparent 1px),
    linear-gradient(90deg, hsl(220,15%,92%) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.login-glow1 {
  position: absolute;
  top: 0; right: 25%;
  width: 24rem; height: 24rem;
  border-radius: 50%;
  background: radial-gradient(circle, #ef4444, transparent);
  opacity: 0.10;
  filter: blur(60px);
  pointer-events: none;
}

.login-glow2 {
  position: absolute;
  bottom: 0; left: 25%;
  width: 20rem; height: 20rem;
  border-radius: 50%;
  background: radial-gradient(circle, #f97316, transparent);
  opacity: 0.08;
  filter: blur(60px);
  pointer-events: none;
}

.login-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 440px;
  padding: 2rem 1rem;
}

/* Logo section */
.login-logo-wrap {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4rem; height: 4rem;
  border-radius: 1rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #dc2626, #f97316);
  box-shadow: 0 8px 32px rgba(220,38,38,0.4);
}

.login-logo-icon svg { width: 2rem; height: 2rem; color: white; }

.login-title-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 2.5rem;
}

.login-title {
  font-size: 2.25rem;
  font-weight: 800;
  font-style: italic;
  letter-spacing: -0.03em;
  color: white;
  animation: fadeInUp 0.8s ease-out forwards;
}

.login-title .accent { color: #f97316; }

.login-title .logo-dot {
  width: 0.375rem; height: 0.375rem;
  background: #f97316;
  border-radius: 50%;
  margin-left: -0.2em;
  margin-top: -0.8em;
  box-shadow: 0 0 6px #f97316;
  animation: glint 1.5s infinite;
}

.login-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  animation: fadeInUp 0.8s ease-out 0.3s both;
}

/* Glass card */
.glass-card {
  background: rgba(14,14,20,0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 1.5rem;
  padding: 1.75rem;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
}

/* Saved accounts */
.saved-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.saved-header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.saved-count {
  font-size: 0.7rem;
  color: var(--text-muted);
  background: rgba(255,255,255,0.05);
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
}

.saved-list {
  max-height: 13rem;
  overflow-y: auto;
  padding-right: 0.25rem;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.saved-empty {
  text-align: center;
  padding: 2rem 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.saved-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border3);
  cursor: pointer;
  transition: all 0.2s;
}
.saved-item:hover {
  border-color: rgba(220,38,38,0.4);
  background: rgba(220,38,38,0.05);
}

.saved-item-info { flex: 1; min-width: 0; }
.saved-item-url {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.saved-item-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: monospace;
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.saved-item-actions { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }

.btn-icon {
  padding: 0.375rem;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-icon svg { width: 0.75rem; height: 0.75rem; }

.btn-icon-share {
  background: rgba(30,58,138,0.5);
  border: 1px solid rgba(30,58,138,0.4);
  color: #60a5fa;
}
.btn-icon-share:hover { background: rgba(30,58,138,0.7); }

.btn-icon-del {
  background: rgba(127,29,29,0.5);
  border: 1px solid rgba(127,29,29,0.4);
  color: #f87171;
}
.btn-icon-del:hover { background: rgba(127,29,29,0.7); }

.chevron-right { color: var(--text-muted); }

/* New account button */
.btn-new-account {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  border-radius: 0.75rem;
  border: 1px dashed var(--border3);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-new-account:hover {
  border-color: rgba(220,38,38,0.5);
  background: rgba(220,38,38,0.05);
  color: #f87171;
}

/* New account form */
#new-account-form { display: none; }

.form-back-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}
.btn-back {
  padding: 0.375rem;
  border-radius: 0.5rem;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-muted);
  transition: background 0.2s;
}
.btn-back:hover { background: rgba(255,255,255,0.05); }
.btn-back svg { width: 1rem; height: 1rem; transform: rotate(180deg); display: block; }
.form-title { font-size: 0.9rem; font-weight: 600; color: var(--text); }

/* APK drop zone */
.apk-section { margin-bottom: 1.25rem; }
.apk-label-text {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.apk-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.25rem 1rem;
  border-radius: 0.75rem;
  border: 2px dashed #2a2a2a;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}
.apk-dropzone:hover {
  border-color: rgba(249,115,22,0.4);
  background: rgba(249,115,22,0.05);
}
.apk-dropzone-icon {
  width: 2.5rem; height: 2.5rem;
  border-radius: 0.75rem;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  display: flex; align-items: center; justify-content: center;
}
.apk-dropzone-icon svg { width: 1.25rem; height: 1.25rem; color: #555; }
.apk-dropzone:hover .apk-dropzone-icon { border-color: rgba(249,115,22,0.3); }
.apk-dropzone:hover .apk-dropzone-icon svg { color: #f97316; }
.apk-dropzone-text { text-align: center; }
.apk-dropzone-title { font-size: 0.8rem; font-weight: 600; color: #666; }
.apk-dropzone:hover .apk-dropzone-title { color: #999; }
.apk-dropzone-sub { font-size: 0.65rem; color: #444; margin-top: 0.125rem; }

.apk-scanning {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.5rem;
  border-radius: 0.75rem;
  border: 1px solid #1f1f1f;
  background: #0d0d0d;
}
.apk-scanning.visible { display: flex; }
.spin { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.apk-error {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  border-radius: 0.75rem;
  background: rgba(127,29,29,0.2);
  border: 1px solid rgba(127,29,29,0.4);
}
.apk-error.visible { display: flex; }
.apk-error p { font-size: 0.75rem; color: #f87171; flex: 1; }

.apk-success {
  display: none;
  border-radius: 0.75rem;
  border: 1px solid rgba(20,83,45,0.4);
  background: rgba(4,47,23,0.2);
  overflow: hidden;
}
.apk-success.visible { display: block; }
.apk-success-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid rgba(20,83,45,0.3);
  background: rgba(4,47,23,0.3);
}
.apk-success-header span { font-size: 0.75rem; font-weight: 600; color: #4ade80; }
.apk-success-body { padding: 0.75rem; display: flex; flex-direction: column; gap: 0.5rem; }
.apk-field-label { font-size: 0.6rem; color: #555; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.25rem; }
.apk-field-val {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #0a0a0a;
  border-radius: 0.5rem;
  padding: 0.375rem 0.625rem;
  border: 1px solid #1a1a1a;
}
.apk-field-val span { font-size: 0.7rem; font-family: monospace; color: #4ade80; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Form fields */
.form-fields { display: flex; flex-direction: column; gap: 1rem; }
.field-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.field-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border3);
  outline: none;
  font-size: 0.8rem;
  color: var(--text);
  font-family: monospace;
  transition: all 0.2s;
}
.field-input::placeholder { color: rgba(136,136,136,0.5); }
.field-input:focus { border-color: #dc2626; box-shadow: 0 0 0 2px rgba(220,38,38,0.2); }

/* Form buttons */
.form-actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; }

.btn-connect {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  border-radius: 0.75rem;
  border: none;
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: white;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(220,38,38,0.35);
  transition: opacity 0.2s;
}
.btn-connect:hover { opacity: 0.9; }
.btn-connect:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-cancel {
  padding: 0.75rem 1.25rem;
  border-radius: 0.75rem;
  border: none;
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-cancel:hover { background: rgba(255,255,255,0.08); }

.form-error {
  display: none;
  text-align: center;
  font-size: 0.8rem;
  color: #f87171;
  margin-top: 1rem;
  animation: fadeInUp 0.3s ease-out;
}
.form-error.visible { display: block; }

/* Footer */
.login-footer {
  text-align: center;
  font-size: 0.7rem;
  color: rgba(136,136,136,0.4);
  margin-top: 1.5rem;
}

/* ────────────────────────────────────────────────────────────────────────── */
/*  DASHBOARD                                                                 */
/* ────────────────────────────────────────────────────────────────────────── */

#dashboard-page {
  min-height: 100vh;
  background: var(--bg);
  flex-direction: column;
}
#dashboard-page.visible { display: flex; }

/* Header */
.dash-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(10,10,10,0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border2);
}

.dash-header-inner {
  max-width: 1800px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.logo-icon {
  width: 1.75rem; height: 1.75rem;
  border-radius: 0.5rem;
  background: linear-gradient(135deg, #dc2626, #f97316);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(220,38,38,0.4);
}
.logo-icon svg { width: 0.875rem; height: 0.875rem; color: white; }

.logo-text {
  font-size: 1rem;
  font-weight: 800;
  font-style: italic;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.02em;
}
.logo-text .accent { color: #f97316; }
.logo-dot {
  width: 0.375rem; height: 0.375rem;
  background: #f97316;
  border-radius: 50%;
  margin-left: -0.2em;
  margin-top: -0.8em;
  box-shadow: 0 0 6px #f97316;
  animation: glint 1.5s infinite;
}

@keyframes glint {
  0%, 100% { transform: scale(1); opacity: 0; }
  50% { transform: scale(1.5); opacity: 1; }
}

/* Search */
.search-wrap {
  position: relative;
  flex: 1;
  max-width: 22rem;
}
.search-wrap svg {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1rem; height: 1rem;
  color: var(--text-ghost);
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 0.5rem 1rem 0.5rem 2.25rem;
  border-radius: 0.75rem;
  background: #111;
  border: 1px solid #222;
  outline: none;
  font-size: 0.8rem;
  color: var(--text);
  transition: border-color 0.2s;
}
.search-input::placeholder { color: var(--text-ghost); }
.search-input:focus { border-color: #333; }

/* Header right */
.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.connected-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  border-radius: 999px;
  background: rgba(4,47,23,0.4);
  border: 1px solid rgba(20,83,45,0.4);
}
.connected-dot {
  width: 0.5rem; height: 0.5rem;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
}
.connected-badge span { font-size: 0.7rem; font-weight: 600; color: #4ade80; }

.clock-badge {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border-radius: 999px;
  background: #111;
  border: 1px solid #1e1e1e;
}
.clock-badge svg { width: 0.875rem; height: 0.875rem; color: var(--text-faint); }
.clock-badge span { font-size: 0.75rem; font-family: monospace; font-weight: 700; color: var(--text-muted); }

.btn-logout {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid #222;
  background: #111;
  font-size: 0.7rem;
  color: #666;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-logout:hover { color: #f87171; border-color: rgba(127,29,29,0.4); }
.btn-logout svg { width: 0.875rem; height: 0.875rem; }

/* Error banner */
.error-banner {
  display: none;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(127,29,29,0.2);
  border: 1px solid rgba(127,29,29,0.3);
  border-radius: 0.75rem;
  margin: 0.75rem 1.5rem;
}
.error-banner.visible { display: flex; }
.error-banner svg { width: 1rem; height: 1rem; color: #f87171; flex-shrink: 0; margin-top: 0.1rem; }
.error-banner p { font-size: 0.75rem; color: #fca5a5; flex: 1; line-height: 1.5; }
.error-banner button { color: #7f1d1d; cursor: pointer; border: none; background: transparent; }
.error-banner button:hover { color: #f87171; }
.error-banner button svg { width: 0.875rem; height: 0.875rem; }

/* Stats row */
.stats-bar {
  border-bottom: 1px solid var(--border2);
  background: #0a0a0a;
}
.stats-bar-inner {
  max-width: 1800px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.stats-group { display: flex; align-items: center; gap: 1.25rem; }

.stat-item {}
.stat-label {
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-ghost);
  margin-bottom: 0.125rem;
}
.stat-value {
  font-size: 1.125rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1;
}
.stat-value.green { color: #4ade80; }
.stat-value.dim { color: var(--text-faint); }
.stat-value.purple { color: #c084fc; }

/* Filters */
.filters-group {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.375rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  background: transparent;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-faint);
  cursor: pointer;
  text-transform: capitalize;
  transition: all 0.2s;
}
.filter-btn:hover { color: var(--text-muted); }
.filter-btn.active { background: rgba(220,38,38,0.15); border-color: rgba(220,38,38,0.35); color: #f87171; }
.filter-btn.active-bank { background: rgba(34,197,94,0.1); border-color: rgba(34,197,94,0.3); color: #4ade80; }
.filter-btn.active-card { background: rgba(168,85,247,0.1); border-color: rgba(168,85,247,0.3); color: #c084fc; }

.divider-v { width: 1px; height: 1rem; background: #222; }

.sort-select {
  background: #111;
  border: 1px solid #222;
  color: #666;
  font-size: 0.7rem;
  border-radius: 0.5rem;
  padding: 0.375rem 0.5rem;
  outline: none;
  cursor: pointer;
}

.btn-refresh {
  padding: 0.5rem;
  border-radius: 0.5rem;
  border: 1px solid #222;
  background: #111;
  color: var(--text-faint);
  cursor: pointer;
  transition: all 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.btn-refresh:hover { color: var(--text-muted); border-color: #333; }
.btn-refresh svg { width: 0.875rem; height: 0.875rem; }
.btn-refresh.spinning svg { animation: spin 0.8s linear infinite; }

/* Main content */
.dash-main {
  flex: 1;
  max-width: 1800px;
  margin: 0 auto;
  width: 100%;
  padding: 1.5rem;
}

/* Loading state */
.loading-state { display: none; }
.loading-state.visible { display: block; }
.loading-spinner-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.spinner {
  width: 1rem; height: 1rem;
  border: 2px solid #333;
  border-top-color: #dc2626;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.spinner.green { border-top-color: #22c55e; }
.spinner.blue { border-top-color: #0088cc; }
.loading-text { font-size: 0.8rem; color: var(--text-faint); }

/* Empty state */
.empty-state {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6rem 0;
  text-align: center;
}
.empty-state.visible { display: flex; }
.empty-icon {
  width: 4rem; height: 4rem;
  border-radius: 1rem;
  background: #111;
  border: 1px solid #1e1e1e;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.25rem;
}
.empty-icon svg { width: 2rem; height: 2rem; color: #2a2a2a; }
.empty-title { font-size: 0.9rem; font-weight: 700; color: var(--text-ghost); }
.empty-sub { font-size: 0.8rem; color: #333; margin-top: 0.375rem 0 1.25rem; }
.auto-refresh-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: #111;
  border: 1px solid #1e1e1e;
  margin-top: 1rem;
}
.pulse-dot {
  width: 0.5rem; height: 0.5rem;
  border-radius: 50%;
  background: #dc2626;
  animation: pulseDot 1.5s ease-in-out infinite;
}
@keyframes pulseDot { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.5;transform:scale(0.8)} }
.auto-refresh-badge span { font-size: 0.7rem; color: var(--text-faint); }

/* Filter empty */
.filter-empty {
  display: none;
  grid-column: 1/-1;
  padding: 4rem 0;
  text-align: center;
}
.filter-empty.visible { display: block; }
.filter-empty p { font-size: 0.8rem; color: var(--text-ghost); }

/* Cards grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

/* SMS loading banner */
.sms-loading-banner {
  display: none;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.75rem;
  background: #111;
  border: 1px solid #1e1e1e;
  width: fit-content;
}
.sms-loading-banner.visible { display: flex; }
.sms-loading-banner span { font-size: 0.7rem; color: var(--text-faint); }

/* ── DEVICE CARD ── */
.device-card {
  background: #111111;
  border: 1px solid #1f1f1f;
  border-radius: 1rem;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.device-card:hover {
  border-color: #2a2a2a;
  background: #161616;
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
  transform: translateY(-1px);
}
.device-card:active { transform: translateY(0); }
.device-card.online { border-color: rgba(34,197,94,0.2); }

/* Card header */
.card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.card-wifi-icon {
  width: 2.5rem; height: 2.5rem;
  border-radius: 0.75rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  border: 1px solid #262626;
  background: #1a1a1a;
}
.card-wifi-icon.online { background: rgba(34,197,94,0.1); border-color: rgba(34,197,94,0.25); }
.card-wifi-icon svg { width: 1.25rem; height: 1.25rem; color: var(--text-ghost); }
.card-wifi-icon.online svg { color: #4ade80; }
.card-name-wrap { flex: 1; min-width: 0; }
.card-name { font-size: 0.8rem; font-weight: 700; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-id { font-size: 0.65rem; font-family: monospace; color: var(--text-faint); margin-top: 0.125rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-badges { display: flex; align-items: center; gap: 0.25rem; flex-shrink: 0; }
.card-badges svg { width: 0.875rem; height: 0.875rem; }
.badge-upi { color: #f59e0b; }
.badge-bank { color: #4ade80; }
.badge-card-b { color: #c084fc; }

/* Card 2x2 grid */
.card-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 0.75rem; }
.card-field-label { font-size: 0.55rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-ghost); margin-bottom: 0.25rem; }
.card-field-value { font-size: 0.8rem; font-weight: 700; color: #ccc; }
.card-field-mono { font-family: monospace; font-size: 0.75rem; font-weight: 500; color: #aaa; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Battery widget */
.battery-widget { display: flex; align-items: center; gap: 0.375rem; }
.battery-body {
  position: relative;
  display: flex;
  align-items: center;
  width: 1.625rem; height: 0.75rem;
  padding: 2px;
  border-radius: 3px;
  border: 1px solid #555;
}
.battery-fill { border-radius: 1.5px; height: 100%; transition: width 0.5s; }
.battery-cap { width: 3px; height: 5px; background: #555; border-radius: 0 2px 2px 0; margin-left: -1px; }
.battery-pct { font-size: 0.7rem; font-weight: 700; font-family: monospace; }

/* Card bank row */
.card-bank-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.65rem 0.85rem;
  border-radius: 0.85rem;
  background: linear-gradient(135deg, rgba(4,47,23,0.55) 0%, rgba(5,78,35,0.3) 100%);
  border: 1px solid rgba(74,222,128,0.25);
  margin-bottom: 0.75rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.card-bank-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-bank-row-bottom {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}
.card-bank-name {
  color: #86efac;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  letter-spacing: 0.01em;
}
.card-bank-name svg { width: 1rem; height: 1rem; }
.card-bank-amount {
  color: #fff;
  font-weight: 900;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  text-shadow: 0 0 12px rgba(74,222,128,0.4);
}
.card-bank-txn {
  color: #4ade80;
  font-weight: 700;
  font-size: 0.78rem;
  background: rgba(74,222,128,0.12);
  border-radius: 0.4rem;
  padding: 0.1rem 0.4rem;
}
.card-bank-txn.debit {
  color: #f87171;
  background: rgba(248,113,113,0.12);
}

/* Card footer */
.card-footer { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.status-dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; flex-shrink: 0; }
.status-dot.online { background: #22c55e; box-shadow: 0 0 6px #22c55e; }
.status-dot.offline { background: #333; }
.status-text { font-size: 0.75rem; font-weight: 600; }
.status-text.online { color: #4ade80; }
.status-text.offline { color: var(--text-faint); }
.last-seen { font-size: 0.6rem; font-family: monospace; color: var(--text-ghost); background: #111; padding: 0.125rem 0.375rem; border-radius: 0.25rem; border: 1px solid #1e1e1e; }
.upi-badge { margin-left: auto; padding: 0.125rem 0.5rem; border-radius: 999px; background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.2); font-size: 0.6rem; font-weight: 700; color: #fbbf24; }

/* ── SKELETON CARDS ── */
.skeleton-card {
  background: #111;
  border: 1px solid #1f1f1f;
  border-radius: 1rem;
  padding: 1rem;
  animation: skelPulse 1.5s ease-in-out infinite;
}
@keyframes skelPulse { 0%,100%{opacity:1} 50%{opacity:0.5} }
.skel-header { display: flex; align-items: flex-start; gap: 0.75rem; margin-bottom: 0.75rem; }
.skel-box { border-radius: 0.5rem; background: #1a1a1a; }
.skel-w10-h10 { width: 2.5rem; height: 2.5rem; }
.skel-line1 { height: 0.75rem; background: #1a1a1a; border-radius: 0.375rem; flex: 1; margin-bottom: 0.375rem; }
.skel-line2 { height: 0.5rem; background: #151515; border-radius: 0.375rem; width: 60%; }
.skel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 0.75rem; }
.skel-field { height: 2rem; background: #151515; border-radius: 0.75rem; }
.skel-footer { height: 2.5rem; background: #131313; border-radius: 0.75rem; }

/* ── TOAST ── */
#toast {
  display: none;
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  padding: 0.75rem 1.25rem;
  border-radius: 1rem;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  font-size: 0.8rem;
  font-weight: 600;
  color: white;
  box-shadow: 0 16px 48px rgba(0,0,0,0.6);
  white-space: nowrap;
}
#toast.visible { display: block; animation: toastIn 0.3s ease-out; }
@keyframes toastIn { from { opacity:0; transform: translateX(-50%) translateY(12px); } to { opacity:1; transform: translateX(-50%) translateY(0); } }

/* ────────────────────────────────────────────────────────────────────────── */
/*  DETAIL PANEL                                                              */
/* ────────────────────────────────────────────────────────────────────────── */

#detail-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
}
#detail-overlay.visible { display: flex; }

.detail-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.detail-panel {
  position: relative;
  margin-left: auto;
  width: 100%;
  max-width: 28rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #0d0d0d;
  border-left: 1px solid #1f1f1f;
  box-shadow: -24px 0 80px rgba(0,0,0,0.6);
  animation: slideInRight 0.25s ease-out;
}
@keyframes slideInRight { from { transform: translateX(100%); } to { transform: translateX(0); } }

/* Detail header */
.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #1a1a1a;
}
.detail-header-left { display: flex; align-items: center; gap: 0.75rem; }
.detail-device-icon {
  width: 2.25rem; height: 2.25rem;
  border-radius: 0.75rem;
  display: flex; align-items: center; justify-content: center;
  background: #1a1a1a;
  border: 1px solid #262626;
}
.detail-device-icon.online { background: rgba(34,197,94,0.1); border-color: rgba(34,197,94,0.25); }
.detail-device-icon svg { width: 1rem; height: 1rem; color: var(--text-ghost); }
.detail-device-icon.online svg { color: #4ade80; }
.detail-name { font-size: 0.8rem; font-weight: 700; color: white; }
.detail-id { font-size: 0.65rem; font-family: monospace; color: var(--text-faint); margin-top: 0.125rem; }
.detail-header-right { display: flex; align-items: center; gap: 0.5rem; }

.btn-detail-del {
  padding: 0.5rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(127,29,29,0.3);
  background: rgba(127,29,29,0.2);
  color: #f87171;
  cursor: pointer;
  transition: all 0.2s;
  display: flex; align-items: center;
}
.btn-detail-del:hover { background: rgba(127,29,29,0.4); }
.btn-detail-del svg { width: 1rem; height: 1rem; }

.btn-detail-close {
  padding: 0.5rem;
  border-radius: 0.75rem;
  border: 1px solid #262626;
  background: #1a1a1a;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  display: flex; align-items: center;
}
.btn-detail-close:hover { color: white; }
.btn-detail-close svg { width: 1rem; height: 1rem; }

/* Detail status bar */
.detail-status-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1.25rem;
  background: #0a0a0a;
  border-bottom: 1px solid #1a1a1a;
  flex-wrap: wrap;
}
.detail-status-item { display: flex; align-items: center; gap: 0.375rem; font-size: 0.7rem; }
.detail-bat { font-size: 0.65rem; color: var(--text-faint); }
.detail-bat-val { font-weight: 700; }
.detail-upi-badge { padding: 0.125rem 0.5rem; border-radius: 999px; background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.2); font-size: 0.65rem; font-weight: 700; color: #fbbf24; }
.detail-bank-badge { padding: 0.125rem 0.5rem; border-radius: 999px; background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.2); font-size: 0.65rem; font-weight: 700; color: #4ade80; }
.detail-card-badge { padding: 0.125rem 0.5rem; border-radius: 999px; background: rgba(168,85,247,0.1); border: 1px solid rgba(168,85,247,0.2); font-size: 0.65rem; font-weight: 700; color: #c084fc; }

/* Tabs */
.detail-tabs {
  display: flex;
  border-bottom: 1px solid #1a1a1a;
  padding: 0 0.5rem;
  overflow-x: auto;
}
.tab-btn {
  padding: 0.75rem 0.75rem;
  font-size: 0.65rem;
  font-weight: 700;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.tab-btn:hover { color: var(--text-muted); }
.tab-btn.active { border-bottom-color: #dc2626; color: #f87171; }
.tab-btn.active-bank { border-bottom-color: #22c55e; color: #4ade80; }
.tab-btn.active-card-tab { border-bottom-color: #a855f7; color: #c084fc; }

/* Tab content */
.detail-body { flex: 1; overflow-y: auto; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* Info rows */
.info-section { padding: 1rem 1.25rem; }
.info-offline-box {
  margin-bottom: 1rem;
  padding: 0.75rem;
  border-radius: 0.75rem;
  background: rgba(127,29,29,0.15);
  border: 1px solid rgba(127,29,29,0.3);
  border-left: 2px solid rgba(220,38,38,0.5);
}
.info-offline-label { font-size: 0.55rem; text-transform: uppercase; letter-spacing: 0.1em; color: #7f1d1d; font-weight: 700; margin-bottom: 0.25rem; }
.info-offline-time { font-size: 1rem; font-weight: 900; color: #f87171; }
.info-offline-ts { font-size: 0.65rem; font-family: monospace; color: rgba(248,113,113,0.5); margin-top: 0.125rem; }

.info-online-box {
  margin-bottom: 1rem;
  padding: 0.75rem;
  border-radius: 0.75rem;
  background: rgba(4,47,23,0.15);
  border: 1px solid rgba(20,83,45,0.3);
}
.info-online-label { font-size: 0.55rem; text-transform: uppercase; letter-spacing: 0.1em; color: #14532d; font-weight: 700; margin-bottom: 0.25rem; }
.info-online-ts { font-size: 0.65rem; font-family: monospace; color: #22c55e; }

.info-section-label { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-ghost); font-weight: 700; margin-bottom: 0.75rem; }

.info-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0.625rem 0;
  border-bottom: 1px solid #1a1a1a;
}
.info-row:last-child { border-bottom: none; }
.info-row-label { font-size: 0.7rem; color: var(--text-faint); font-weight: 500; flex-shrink: 0; width: 8rem; }
.info-row-value { font-size: 0.7rem; font-weight: 600; color: #ccc; text-align: right; word-break: break-all; }
.info-row-value.mono { font-family: monospace; }
.info-row-value.highlight { color: #60a5fa; }
.info-row-value.highlight2 { color: #c084fc; }

/* Bank SMS tab */
.bank-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid #1a1a1a;
}
.bank-header-info { font-size: 0.7rem; color: var(--text-faint); }
.bank-header-count { font-size: 0.65rem; color: rgba(34,197,94,0.6); margin-top: 0.125rem; }
.btn-refresh-sms {
  padding: 0.375rem;
  border-radius: 0.5rem;
  border: none;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-refresh-sms:hover { background: rgba(255,255,255,0.05); color: var(--text-muted); }
.btn-refresh-sms svg { width: 0.875rem; height: 0.875rem; display: block; }

.bank-list { padding: 0.75rem 1rem; display: flex; flex-direction: column; gap: 0.5rem; }

.bank-summary-box {
  padding: 0.75rem;
  border-radius: 0.75rem;
  background: #081410;
  border: 1px solid rgba(20,83,45,0.4);
  margin-bottom: 0.25rem;
}
.bank-summary-label { font-size: 0.55rem; text-transform: uppercase; letter-spacing: 0.1em; color: #22c55e; opacity: 0.6; margin-bottom: 0.25rem; }
.bank-summary-amount { display: flex; align-items: baseline; gap: 0.5rem; }
.bank-summary-symbol { font-size: 1rem; font-weight: 900; color: #4ade80; }
.bank-summary-val { font-size: 1.5rem; font-weight: 900; color: white; }
.bank-summary-acc { font-size: 0.7rem; font-family: monospace; color: #22c55e; opacity: 0.6; }

.bank-item {
  padding: 0.75rem;
  border-radius: 0.75rem;
  background: #0a1410;
  border: 1px solid rgba(20,83,45,0.3);
  border-left: 2px solid rgba(34,197,94,0.6);
}
.bank-item-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.bank-item-left { display: flex; align-items: center; gap: 0.5rem; }
.bank-item-icon {
  width: 1.5rem; height: 1.5rem;
  border-radius: 0.375rem;
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.2);
  display: flex; align-items: center; justify-content: center;
}
.bank-item-icon svg { width: 0.75rem; height: 0.75rem; color: #4ade80; }
.bank-item-name { font-size: 0.75rem; font-weight: 700; color: #4ade80; }
.bank-item-sender { font-size: 0.6rem; color: var(--text-ghost); font-family: monospace; margin-left: 0.375rem; }
.bank-item-acc { font-size: 0.65rem; font-family: monospace; color: var(--text-faint); background: #111; padding: 0.125rem 0.375rem; border-radius: 0.25rem; }
.bank-item-txn {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
}
.bank-item-txn.credit { background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.2); color: #4ade80; }
.bank-item-txn.debit { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.2); color: #f87171; }
.bank-item-txn svg { width: 0.75rem; height: 0.75rem; }

.bank-item-amounts { display: flex; align-items: flex-end; justify-content: space-between; }
.bank-item-bal-label { font-size: 0.55rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-ghost); margin-bottom: 0.125rem; }
.bank-item-bal { font-size: 1.25rem; font-weight: 900; color: white; }
.bank-item-bal-sym { font-size: 0.8rem; color: #4ade80; margin-right: 0.1em; }
.bank-item-txn-amount { text-align: right; }
.bank-item-txn-label { font-size: 0.55rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-ghost); margin-bottom: 0.125rem; }
.bank-item-txn-val { font-size: 0.8rem; font-weight: 700; }
.bank-item-txn-val.credit { color: #4ade80; }
.bank-item-txn-val.debit { color: #f87171; }

.bank-item-raw { font-size: 0.65rem; color: #333; margin-top: 0.5rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bank-item-ts { font-size: 0.55rem; color: #2a2a2a; font-family: monospace; margin-top: 0.25rem; }

.tab-loading { padding: 3rem 0; text-align: center; }
.tab-loading .spinner { margin: 0 auto 0.75rem; }
.tab-loading p { font-size: 0.75rem; color: var(--text-faint); }

.tab-empty { padding: 3rem 0; text-align: center; }
.tab-empty svg { width: 2.5rem; height: 2.5rem; color: #2a2a2a; margin: 0 auto 0.75rem; }
.tab-empty-title { font-size: 0.8rem; font-weight: 600; color: var(--text-ghost); }
.tab-empty-sub { font-size: 0.7rem; color: #333; margin-top: 0.25rem; padding: 0 1rem; line-height: 1.5; }

/* SMS tab */
.sms-header {
  display: flex;
  flex-direction: column;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid #1a1a1a;
  gap: 0.5rem;
}
.sms-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sms-header span { font-size: 0.7rem; color: var(--text-faint); }
.sms-search-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.sms-search-input {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 0.5rem;
  color: var(--text-primary);
  font-size: 0.78rem;
  padding: 0.4rem 0.75rem;
  outline: none;
  transition: border-color 0.2s;
}
.sms-search-input::placeholder { color: var(--text-faint); }
.sms-search-input:focus { border-color: rgba(99,102,241,0.5); }
.sms-search-count {
  font-size: 0.68rem;
  color: var(--text-faint);
  white-space: nowrap;
  min-width: 4rem;
  text-align: right;
}

.sms-list { padding: 0.75rem 1rem; display: flex; flex-direction: column; gap: 0.5rem; }

.sms-item {
  padding: 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid #1e1e1e;
  border-left: 2px solid;
}
.sms-item.bank-sms { background: #0a130d; border-left-color: rgba(34,197,94,0.5); }
.sms-item.card-sms { background: #100d18; border-left-color: rgba(168,85,247,0.5); }
.sms-item.other-sms { background: #111; border-left-color: rgba(220,38,38,0.5); }

.sms-item-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.sms-sender { font-size: 0.75rem; font-weight: 700; }
.sms-sender.bank-sms { color: #4ade80; }
.sms-sender.card-sms { color: #c084fc; }
.sms-sender.other-sms { color: #f87171; }
.sms-time { font-size: 0.65rem; color: var(--text-ghost); font-family: monospace; }
.sms-text { font-size: 0.75rem; color: #aaa; line-height: 1.5; }

/* Send tab */
.send-section { padding: 1rem 1.25rem; display: flex; flex-direction: column; gap: 1rem; }
.send-label { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-faint); margin-bottom: 0.5rem; }
.sim-btns { display: flex; gap: 0.5rem; }
.sim-btn {
  flex: 1;
  padding: 0.625rem;
  border-radius: 0.75rem;
  border: 1px solid #222;
  background: #111;
  font-size: 0.8rem;
  font-weight: 700;
  color: #666;
  cursor: pointer;
  transition: all 0.2s;
}
.sim-btn:hover { border-color: #333; color: #888; }
.sim-btn.active { background: #dc2626; border-color: #dc2626; color: white; box-shadow: 0 4px 12px rgba(220,38,38,0.35); }

.send-input, .send-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background: #111;
  border: 1px solid #222;
  outline: none;
  font-size: 0.8rem;
  color: white;
  font-family: monospace;
  transition: border-color 0.2s;
}
.send-input::placeholder, .send-textarea::placeholder { color: var(--text-ghost); }
.send-input:focus, .send-textarea:focus { border-color: rgba(220,38,38,0.5); box-shadow: 0 0 0 1px rgba(220,38,38,0.2); }
.send-textarea { resize: none; }
.send-char-count { font-size: 0.65rem; color: var(--text-ghost); text-align: right; margin-top: 0.25rem; }

.btn-send {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem;
  border-radius: 0.75rem;
  border: none;
  background: #dc2626;
  color: white;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(220,38,38,0.35);
  transition: all 0.2s;
}
.btn-send:hover { background: #b91c1c; }
.btn-send:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-send svg { width: 1rem; height: 1rem; }

.btn-use-number {
  width: 100%;
  padding: 0.625rem;
  border-radius: 0.75rem;
  border: 1px solid #222;
  background: #111;
  font-size: 0.7rem;
  color: #666;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-use-number:hover { color: #888; border-color: #333; }

/* ── Animations ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Card tab (purple) ── */
.card-list { padding: 0.75rem 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.card-item {
  padding: 0.75rem;
  border-radius: 0.75rem;
  background: #0f0a1a;
  border: 1px solid rgba(88,28,135,0.3);
  border-left: 2px solid rgba(168,85,247,0.6);
}
.card-item-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.card-item-left { display: flex; align-items: center; gap: 0.5rem; }
.card-item-icon {
  width: 1.5rem; height: 1.5rem;
  border-radius: 0.375rem;
  background: rgba(168,85,247,0.1);
  border: 1px solid rgba(168,85,247,0.2);
  display: flex; align-items: center; justify-content: center;
}
.card-item-icon svg { width: 0.75rem; height: 0.75rem; color: #c084fc; }
.card-item-type { font-size: 0.75rem; font-weight: 700; color: #c084fc; }
.card-item-exp { font-size: 0.65rem; color: var(--text-faint); font-family: monospace; }
.card-item-number { font-family: monospace; font-size: 0.75rem; color: #aaa; letter-spacing: 0.1em; }
.card-item-cvv { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.5rem; }
.card-item-cvv-label { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); }
.card-item-cvv-val { font-size: 0.75rem; font-family: monospace; color: #c084fc; }
.card-item-raw { font-size: 0.65rem; color: #333; margin-top: 0.5rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ── Responsive ── */
/* ── Mobile / Responsive ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Stats + Filters bar — two rows */
  .stats-bar-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0;
  }
  .stats-group {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0;
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid #1a1a1a;
  }
  .stats-group::-webkit-scrollbar { display: none; }
  .stat-item {
    flex-shrink: 0;
    padding: 0 0.875rem;
    border-right: 1px solid #1a1a1a;
  }
  .stat-item:last-child { border-right: none; }
  .stats-sep { display: none; }

  /* Filters — full width scrollable row, ALWAYS VISIBLE */
  .filters-group {
    display: flex !important;
    margin-left: 0;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    align-items: center;
    flex-wrap: nowrap;
  }
  .filters-group::-webkit-scrollbar { display: none; }
  .filter-btn {
    flex-shrink: 0;
    padding: 0.3rem 0.625rem;
    font-size: 0.68rem;
  }
  .divider-v { flex-shrink: 0; }
  .sort-select { flex-shrink: 0; font-size: 0.68rem; padding: 0.3rem 0.375rem; }
  .btn-refresh { flex-shrink: 0; }

  /* Dashboard header */
  .dash-header { padding: 0.625rem 0.75rem; flex-wrap: wrap; gap: 0.5rem; }
  .header-right { gap: 0.5rem; }
  .clock-badge { display: none; }
  .connected-badge span { font-size: 0.65rem; }

  /* Device grid — 1 column */
  .dash-main { padding: 0.75rem; }
  .devices-grid { grid-template-columns: 1fr !important; }

  /* Detail panel — full-screen bottom sheet on mobile */
  #detail-overlay { align-items: flex-end; }
  .detail-backdrop { display: none; }
  .detail-panel {
    max-width: 100% !important;
    width: 100% !important;
    height: 90vh !important;
    border-left: none;
    border-top: 1px solid #1f1f1f;
    border-radius: 1.25rem 1.25rem 0 0;
    animation: slideInUp 0.28s cubic-bezier(.32,.72,0,1) !important;
  }
  @keyframes slideInUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
  }

  /* Detail header */
  .detail-header { padding: 0.875rem 1rem; }
  .detail-status-bar { padding: 0.5rem 1rem; gap: 0.5rem; overflow-x: auto; flex-wrap: nowrap; }
  .detail-status-bar::-webkit-scrollbar { display: none; }

  /* Detail tabs — scrollable, always visible */
  .detail-tabs {
    display: flex !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0 0.25rem;
    gap: 0;
  }
  .detail-tabs::-webkit-scrollbar { display: none; }
  .tab-btn {
    flex-shrink: 0;
    padding: 0.75rem 0.875rem;
    font-size: 0.7rem;
  }

  /* Tab panes — always block when active */
  .tab-pane { display: none !important; }
  .tab-pane.active { display: block !important; }

  /* Detail body */
  .detail-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }

  /* Sections */
  .info-section { padding: 0.875rem 1rem; }
  .sms-item { padding: 0.75rem 1rem; }
  .bank-section { padding: 0.75rem 1rem; }

  /* Send tab */
  .send-section { padding: 0.875rem 1rem; }
  .forward-row { flex-wrap: wrap; gap: 0.5rem; }
  .forward-input { width: 100%; flex: none; }
  .btn-forward, .btn-forward-off {
    flex: 1;
    justify-content: center;
    text-align: center;
    padding: 0.625rem 0.5rem;
  }
  .sim-btns { gap: 0.5rem; }
  .sim-btn { flex: 1; text-align: center; }
  .btn-send { width: 100%; justify-content: center; }
  .btn-use-number { width: 100%; }
  .cards-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
  .detail-panel { height: 95vh !important; }
  .tab-btn { padding: 0.625rem 0.5rem; font-size: 0.62rem; }
  .detail-name { font-size: 0.75rem; }
  .detail-id { font-size: 0.58rem; }
  .detail-bank-badge, .detail-card-badge, .detail-upi-badge { font-size: 0.6rem; padding: 0.1rem 0.375rem; }
}

/* -- Forward sections -------------------------------------------------------- */
.send-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
  letter-spacing: 0.03em;
}
.send-section-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 0.625rem;
}
.forward-section {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  margin-top: 0.25rem;
}
.forward-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.forward-input { flex: 1; margin-bottom: 0 !important; }
.btn-forward {
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 0.4rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.btn-forward:hover { background: #1d4ed8; }
.btn-forward:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-forward-off {
  background: #374151;
  color: #9ca3af;
  border: none;
  border-radius: 0.4rem;
  padding: 0.5rem 0.625rem;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.btn-forward-off:hover { background: #4b5563; color: #f3f4f6; }

/* ── Bot Tab ────────────────────────────────────────────────────────────── */
.bot-section { display: flex; flex-direction: column; gap: 0; }

/* Status bar */
.bot-status-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: #0a0a0a;
  border-bottom: 1px solid #1a1a1a;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}
.bot-status-dot {
  width: 0.5rem; height: 0.5rem;
  border-radius: 50%;
  background: #374151;
  transition: background 0.3s, box-shadow 0.3s;
  flex-shrink: 0;
}
.bot-status-dot.online {
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34,197,94,0.6);
  animation: pulseDot 2s infinite;
}
@keyframes pulseDot {
  0%,100% { box-shadow: 0 0 6px rgba(34,197,94,0.4); }
  50%      { box-shadow: 0 0 14px rgba(34,197,94,0.8); }
}
.bot-status-count {
  margin-left: auto;
  font-size: 0.65rem;
  color: var(--text-faint);
  background: #1a1a1a;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
}

/* Config block */
.bot-config-block { padding: 1rem 1.25rem; border-bottom: 1px solid #1a1a1a; }
.bot-field { margin-top: 0.875rem; }
.bot-hint { font-size: 0.65rem; color: var(--text-faint); margin-top: 0.25rem; }

/* Direction cards */
.bot-directions {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid #1a1a1a;
}
.bot-dir-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  background: #111;
  border: 1px solid #1f1f1f;
  border-radius: 0.625rem;
}
.bot-dir-icon { font-size: 1.25rem; flex-shrink: 0; line-height: 1; margin-top: 0.1rem; }
.bot-dir-title { font-size: 0.75rem; font-weight: 700; color: var(--text); margin-bottom: 0.25rem; }
.bot-dir-desc { font-size: 0.68rem; color: var(--text-muted); line-height: 1.5; }
.bot-dir-desc code {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 0.25rem;
  padding: 0.05rem 0.3rem;
  font-family: monospace;
  font-size: 0.65rem;
  color: #60a5fa;
}

/* Log */
.bot-log-wrap { padding: 0.875rem 1.25rem; border-bottom: 1px solid #1a1a1a; }
.bot-log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}
.bot-log-clear {
  font-size: 0.62rem;
  color: var(--text-faint);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  transition: color 0.15s;
}
.bot-log-clear:hover { color: #f87171; }
.bot-log {
  background: #060606;
  border: 1px solid #1a1a1a;
  border-radius: 0.5rem;
  padding: 0.625rem;
  max-height: 9rem;
  overflow-y: auto;
  font-size: 0.65rem;
  font-family: monospace;
  line-height: 1.6;
}
.bot-log-empty { color: var(--text-faint); font-style: italic; }
.bot-log-entry { color: #ccc; border-bottom: 1px solid #111; padding: 0.125rem 0; }
.bot-log-entry .log-time { color: var(--text-faint); }
.bot-log-entry .log-ok { color: #4ade80; }
.bot-log-entry .log-err { color: #f87171; }
.bot-log-entry .log-info { color: #60a5fa; }
.bot-log-entry .log-fwd { color: #c084fc; }

/* Controls */
.bot-controls {
  display: flex;
  gap: 0.625rem;
  padding: 1rem 1.25rem;
}
.bot-btn-start {
  flex: 1;
  padding: 0.625rem;
  border-radius: 0.5rem;
  border: none;
  background: #16a34a;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.bot-btn-start:hover { background: #15803d; }
.bot-btn-start.running { background: #dc2626; }
.bot-btn-start.running:hover { background: #b91c1c; }
.bot-btn-save {
  padding: 0.625rem 0.875rem;
  border-radius: 0.5rem;
  border: 1px solid #333;
  background: #1a1a1a;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.bot-btn-save:hover { background: #222; color: var(--text); }

/* Tab active color for bot */
.tab-btn.active-bot { border-bottom-color: #22c55e; color: #4ade80; }
