/* ??????????????????????????????????????????????????????????????????????????
   SPYGLASS 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:         #060b14;
  --bg-card:    #0d1522;
  --bg-card2:   #0a111d;
  --bg-input:   #0d1522;
  --border:     #1a2838;
  --border2:    #16222f;
  --border3:    #1e2c3d;
  --text:       #ffffff;
  --text-dim:   #ccddEE;
  --text-muted: #8fa3b8;
  --text-faint: #557088;
  --text-ghost: #44607a;
  --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: #2a3d52; border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: #3d5570; }

/* ?? 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(190,65%,14%,0.5) 0%, transparent 60%),
    radial-gradient(ellipse at 0% 100%, hsl(215,45%,9%) 0%, hsl(215,40%,5%) 100%);
}

.login-grid-bg {
  position: absolute;
  inset: 0;
  opacity: 0.045;
  background-image:
    linear-gradient(hsl(190,50%,80%) 1px, transparent 1px),
    linear-gradient(90deg, hsl(190,50%,80%) 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, #06b6d4, transparent);
  opacity: 0.12;
  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, #0ea5e9, transparent);
  opacity: 0.10;
  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, #06b6d4, #0ea5e9);
  box-shadow: 0 8px 32px rgba(6,182,212,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: #67e8f9; }

.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(148,197,230,0.08);
  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(148,197,230,0.06);
  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(6,182,212,0.45);
  background: rgba(6,182,212,0.06);
}

.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(6,182,212,0.5);
  background: rgba(6,182,212,0.06);
  color: #67e8f9;
}

/* 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(148,197,230,0.06); }
.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: #06b6d4; box-shadow: 0 0 0 2px rgba(6,182,212,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, #06b6d4, #0284c7);
  color: white;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(6,182,212,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(148,197,230,0.06);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-cancel:hover { background: rgba(148,197,230,0.09); }

.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, #06b6d4, #0ea5e9);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(6,182,212,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: #67e8f9; }
.logo-dot {
  width: 0.375rem; height: 0.375rem;
  background: #67e8f9;
  border-radius: 50%;
  margin-left: -0.2em;
  margin-top: -0.8em;
  box-shadow: 0 0 6px #67e8f9;
  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: #0c1624;
  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: #0c1624;
  border: 1px solid #1e2c3d;
}
.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: #0c1624;
  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: #0c1624;
  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: #0c1624;
  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 #1e3245;
  border-top-color: #06b6d4;
  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: #0c1624;
  border: 1px solid #1e2c3d;
  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: #0c1624;
  border: 1px solid #1e2c3d;
  margin-top: 1rem;
}
.pulse-dot {
  width: 0.5rem; height: 0.5rem;
  border-radius: 50%;
  background: #06b6d4;
  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: #0c1624;
  border: 1px solid #1e2c3d;
  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: #0c1624; padding: 0.125rem 0.375rem; border-radius: 0.25rem; border: 1px solid #1e2c3d; }
.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: #0c1624;
  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;
  overflow: hidden;
}
@keyframes slideInRight { from { transform: translateX(100%); } to { transform: translateX(0); } }

/* Detail header  sticky + flex-shrink:0 keeps it ALWAYS at top, never scrolls */
.detail-header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #1a1a1a;
  background: #0d0d0d;
  flex-shrink: 0;
  z-index: 20;
}
.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;
  flex-shrink: 0;   /* prevent right side being squished on small phones */
}

.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.55rem;
  border-radius: 0.75rem;
  border: 1px solid #333;
  background: #1e2c3d;
  color: #ccc;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;       /* never shrink  always visible */
  min-width: 2.25rem;
  min-height: 2.25rem;
  z-index: 10;
}
.btn-detail-close:hover { background: #2a3d52; color: white; border-color: #444; }
.btn-detail-close svg { width: 1.1rem; height: 1.1rem; }

/* On mobile: make close button even bigger and always in top-right */
@media (max-width: 640px) {
  .detail-header-right {
    gap: 0.4rem;
    flex-shrink: 0;
  }
  .btn-detail-close {
    min-width: 2.5rem;
    min-height: 2.5rem;
    padding: 0.65rem;
    border-color: #444;
    background: #222;
    color: white;
  }
  .btn-detail-close svg { width: 1.25rem; height: 1.25rem; }
  .btn-detail-del {
    min-width: 2.5rem;
    min-height: 2.5rem;
    padding: 0.65rem;
  }
}

/* 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: #06b6d4; color: #67e8f9; }
.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;
  overflow-x: hidden;
  overscroll-behavior: contain;
  min-height: 0; /* critical: lets flex child scroll within its allocated space */
}
.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(148,197,230,0.06); 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: #0c1624; 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(148,197,230,0.09);
  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 #1e2c3d;
  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: #0c1624; 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: #0c1624;
  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: #0c1624;
  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: #0c1624;
  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;
    max-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;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  @keyframes slideInUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
  }
  /* Drag handle  visual cue that panel is a bottom sheet */
  .detail-panel::before {
    content: '';
    display: block;
    width: 2.5rem;
    height: 0.25rem;
    background: #333;
    border-radius: 999px;
    margin: 0.5rem auto 0;
    flex-shrink: 0;
  }

  /* Detail header  fixed at top of bottom sheet */
  .detail-header {
    padding: 0.875rem 1rem;
    background: #0d0d0d;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 20;
  }
  /* Status bar and tabs also must never scroll away */
  .detail-status-bar { padding: 0.5rem 1rem; gap: 0.5rem; overflow-x: auto; flex-wrap: nowrap; flex-shrink: 0; }
  .detail-status-bar::-webkit-scrollbar { display: none; }

  /* Detail tabs  flex-shrink:0 keeps them always visible */
  .detail-tabs {
    display: flex !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0 0.25rem;
    gap: 0;
    flex-shrink: 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  only scrollable region */
  .detail-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
  }

  /* 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: #0c1624;
  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 #0f1a2a; 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; }

/* ?? 1-Tap Copy Mode Toggle Switch ????????????????????????????????????????? */
.copy-toggle-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
  padding: 0.2rem 0.45rem;
  border-radius: 0.5rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  transition: all 0.2s ease;
}
.copy-toggle-switch:hover {
  background: rgba(148,197,230,0.06);
  border-color: rgba(255,255,255,0.12);
}
.copy-toggle-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
  transition: color 0.2s ease;
}
.copy-toggle-switch input {
  display: none;
}
.copy-toggle-slider {
  position: relative;
  width: 2rem;
  height: 1.1rem;
  background: #262626;
  border: 1px solid #3a3a3a;
  border-radius: 999px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.copy-toggle-slider::before {
  content: '';
  position: absolute;
  top: 1px;
  left: 1px;
  width: 0.85rem;
  height: 0.85rem;
  background: #737373;
  border-radius: 50%;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.copy-toggle-switch input:checked + .copy-toggle-slider {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.6);
}
.copy-toggle-switch input:checked + .copy-toggle-slider::before {
  transform: translateX(0.9rem);
  background: #4ade80;
  box-shadow: 0 0 6px rgba(74, 222, 128, 0.6);
}
.copy-toggle-switch input:checked ~ .copy-toggle-label {
  color: #4ade80;
}

/* Refresh button animation */
.btn-refresh-sms {
  padding: 0.35rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(148,197,230,0.09);
  background: rgba(255,255,255,0.04);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-refresh-sms:hover {
  background: rgba(148,197,230,0.09);
  color: var(--text);
  border-color: rgba(255,255,255,0.15);
}
.btn-refresh-sms.spinning svg {
  animation: spin 0.75s linear infinite;
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}



/* When copy mode ON  SMS items show pointer + subtle outline */
.sms-list.copy-mode-on .sms-item {
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 0.55rem;
  transition: background 0.15s, border-color 0.15s;
}
.sms-list.copy-mode-on .sms-item:hover {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.1);
}
.sms-list.copy-mode-on .sms-item:active {
  background: rgba(34,197,94,0.08);
  border-color: rgba(34,197,94,0.35);
}

/* Copy flash animation  brief green glow on copied item */
@keyframes copyFlash {
  0%   { background: rgba(34,197,94,0.22); box-shadow: 0 0 0 2px rgba(34,197,94,0.4); }
  70%  { background: rgba(34,197,94,0.08); box-shadow: 0 0 0 1px rgba(34,197,94,0.15); }
  100% { background: transparent; box-shadow: none; }
}
.sms-item.copy-flashing {
  animation: copyFlash 0.55s ease-out forwards;
  border-radius: 0.55rem;
}

/* Copied badge that briefly appears */
.sms-copy-badge {
  display: none;          /* hidden by default  shown only on copy */
  font-size: 0.6rem;
  font-weight: 700;
  color: #4ade80;
  background: rgba(34,197,94,0.15);
  border: 1px solid rgba(34,197,94,0.35);
  border-radius: 0.3rem;
  padding: 0.1rem 0.35rem;
  margin-left: 0.4rem;
  vertical-align: middle;
  pointer-events: none;
  transition: opacity 0.15s;
}
.sms-copy-badge.show {
  display: inline-block;  /* only visible when JS adds .show */
}

/* Copy mode hint bar shown inside sms-list when mode is active */
.copy-mode-hint {
  font-size: 0.67rem;
  color: #4ade80;
  background: rgba(34,197,94,0.07);
  border: 1px solid rgba(34,197,94,0.2);
  border-radius: 0.45rem;
  padding: 0.4rem 0.7rem;
  margin-bottom: 0.5rem;
  text-align: center;
  letter-spacing: 0.01em;
}


/* -- Priority Filter Button ----------------------------------------------- */
.filter-btn-priority {
  color: #f87171 !important;
  border-color: rgba(239,68,68,0.45) !important;
  background: rgba(239,68,68,0.12) !important;
  font-weight: 800 !important;
  letter-spacing: 0.01em;
}
.filter-btn-priority.active,
.filter-btn-priority:hover {
  background: rgba(239,68,68,0.28) !important;
  border-color: #ef4444 !important;
  color: #fff !important;
  box-shadow: 0 0 10px rgba(239,68,68,0.3);
}

/* -- Priority Empty Card (Main Grid) -------------------------------------- */
.priority-empty-card {
  grid-column: 1 / -1;
  background: linear-gradient(145deg, #0f0d1b, #120e24);
  border: 1px dashed rgba(168,85,247,0.35);
  border-radius: 1rem;
  padding: 3rem 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}
.priority-empty-icon {
  font-size: 2.5rem;
  line-height: 1;
}
.priority-empty-card h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: #e9d5ff;
}
.priority-empty-card p {
  font-size: 0.78rem;
  color: #8a9bb0;
  max-width: 24rem;
  line-height: 1.4;
}

/* -- Priority Banner (Active Grid Header) ---------------------------------- */
.priority-grid-banner {
  grid-column: 1 / -1;
  background: linear-gradient(90deg, rgba(239,68,68,0.15), rgba(168,85,247,0.15));
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 0.75rem;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.priority-banner-txt {
  font-size: 0.75rem;
  font-weight: 700;
  color: #f87171;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.priority-banner-rescan {
  background: rgba(168,85,247,0.2);
  border: 1px solid rgba(168,85,247,0.4);
  color: #d8b4fe;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
}
.priority-banner-rescan:hover {
  background: rgba(168,85,247,0.4);
  color: #fff;
}

/* -- Magic Scan Button ---------------------------------------------------- */
.btn-magic-scan {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(168,85,247,0.65);
  background: linear-gradient(135deg, rgba(168,85,247,0.32) 0%, rgba(220,38,38,0.28) 100%);
  color: #f3e8ff;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.02em;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
  animation: magicPulse 2.8s ease-in-out infinite;
}
.btn-magic-scan:hover {
  background: linear-gradient(135deg, rgba(168,85,247,0.55) 0%, rgba(220,38,38,0.48) 100%);
  border-color: #c084fc;
  color: #fff;
  box-shadow: 0 0 18px rgba(168,85,247,0.55);
  transform: scale(1.04);
}
.btn-magic-scan:active { transform: scale(0.96); }
.magic-scan-icon { font-size: 0.85rem; line-height: 1; flex-shrink: 0; }

@keyframes magicPulse {
  0%, 100% { box-shadow: 0 0 6px rgba(168,85,247,0.3); }
  50%       { box-shadow: 0 0 16px rgba(168,85,247,0.6), 0 0 25px rgba(220,38,38,0.25); }
}

@media (max-width: 640px) {
  .btn-magic-scan {
    padding: 0.35rem 0.7rem;
    font-size: 0.7rem;
  }
  .magic-scan-txt { display: inline !important; }
}

/* -- Magic Scan Overlay --------------------------------------------------- */
#magic-scan-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}
#magic-scan-overlay.open { display: flex; }

/* -- Modal Shell ---------------------------------------------------------- */
.magic-scan-modal {
  background: #0d0c18;
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: 1rem;
  width: 100%;
  max-width: 44rem;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 0 60px rgba(168, 85, 247, 0.15), 0 30px 80px rgba(0, 0, 0, 0.8);
}
@media (max-width: 640px) {
  #magic-scan-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .magic-scan-modal {
    border-radius: 1.25rem 1.25rem 0 0;
    max-height: 92vh;
    max-width: 100%;
  }
}

/* -- Modal Header --------------------------------------------------------- */
.magic-scan-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem 0.85rem;
  border-bottom: 1px solid rgba(168, 85, 247, 0.15);
  flex-shrink: 0;
}
.magic-scan-title-row { display: flex; align-items: center; gap: 0.65rem; }
.magic-scan-title-icon {
  width: 2.1rem; height: 2.1rem; border-radius: 0.65rem; flex-shrink: 0;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.35), rgba(220, 38, 38, 0.28));
  border: 1px solid rgba(168, 85, 247, 0.4);
  display: flex; align-items: center; justify-content: center; color: #d8b4fe;
}
.magic-scan-title-icon svg { width: 1.1rem; height: 1.1rem; }
.magic-scan-title {
  font-size: 1.05rem; font-weight: 800;
  background: linear-gradient(135deg, #d8b4fe, #f87171);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.magic-scan-subtitle { font-size: 0.7rem; color: #6a7b90; margin-top: 0.1rem; }
.magic-scan-close {
  background: rgba(255, 255, 255, 0.05); border: 1px solid #1e2a3a;
  border-radius: 0.5rem; padding: 0.4rem; cursor: pointer; color: #667;
  flex-shrink: 0; transition: all 0.15s; line-height: 0;
}
.magic-scan-close:hover { background: rgba(255, 255, 255, 0.1); color: #ccc; }
.magic-scan-close svg { width: 0.95rem; height: 0.95rem; display: block; }

/* -- Progress ------------------------------------------------------------- */
.magic-progress-wrap { padding: 0.75rem 1.25rem 0.65rem; flex-shrink: 0; border-bottom: 1px solid rgba(168, 85, 247, 0.1); }
.magic-progress-bar { height: 4px; background: rgba(255, 255, 255, 0.06); border-radius: 999px; overflow: hidden; margin-bottom: 0.45rem; }
.magic-progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #7c3aed, #ec4899, #ef4444);
  border-radius: 999px; transition: width 0.35s ease;
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.6);
}
.magic-progress-label { font-size: 0.68rem; color: #7a8b9e; font-weight: 600; }

/* -- Results List --------------------------------------------------------- */
.magic-results {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 0.75rem 0.85rem 1rem;
  display: flex; flex-direction: column; gap: 0.45rem;
}
.magic-results::-webkit-scrollbar { width: 4px; }
.magic-results::-webkit-scrollbar-thumb { background: #2a2a45; border-radius: 2px; }

/* Empty state */
.magic-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 3rem 1rem; color: #556; gap: 0.6rem; font-size: 0.8rem;
}
.magic-empty svg { width: 2.2rem; height: 2.2rem; opacity: 0.3; }

/* Section Header */
.magic-section-header {
  font-size: 0.62rem; font-weight: 800; letter-spacing: 0.08em;
  color: #3d4f66; text-transform: uppercase; padding: 0.4rem 0.2rem 0.15rem;
}

/* -- Result Card  FLEX LAYOUT (NO GRID CORRUPTION) ----------------------- */
.magic-result-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}
.magic-result-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(168, 85, 247, 0.35);
  transform: translateY(-1px);
}

/* Left Tier Stripe */
.magic-result-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
}
.magic-result-card.tier-CRITICAL::before { background: #ef4444; }
.magic-result-card.tier-HIGH::before     { background: #f97316; }
.magic-result-card.tier-MED::before      { background: #facc15; }
.magic-result-card.tier-LOW::before      { background: #2a2a3e; }

/* Card Left Section */
.magic-card-left {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  flex: 1;
  min-width: 0;
}

/* Rank Badge */
.magic-rank {
  width: 1.75rem; height: 1.75rem; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem; font-weight: 800; border: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 0.1rem;
}
.tier-CRITICAL .magic-rank { background: rgba(239,68,68,0.2); color: #f87171; border-color: rgba(239,68,68,0.4); }
.tier-HIGH     .magic-rank { background: rgba(249,115,22,0.2); color: #fb923c; border-color: rgba(249,115,22,0.4); }
.tier-MED      .magic-rank { background: rgba(250,204,21,0.15); color: #fde047; border-color: rgba(250,204,21,0.35); }
.tier-LOW      .magic-rank { background: rgba(255,255,255,0.03); color: #444; border-color: #1e2c3d; }

/* Details Container */
.magic-dev-details {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  min-width: 0;
}

.magic-dev-title-line {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.magic-dev-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: #eee;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 13rem;
}
.magic-online-dot {
  width: 0.4rem; height: 0.4rem; border-radius: 50%;
  background: #22c55e; box-shadow: 0 0 4px rgba(34,197,94,0.7); flex-shrink: 0;
}
.magic-tier-badge {
  font-size: 0.52rem; font-weight: 800; padding: 0.08rem 0.38rem;
  border-radius: 999px; letter-spacing: 0.05em; flex-shrink: 0;
}
.tier-CRITICAL .magic-tier-badge { background: rgba(239,68,68,0.22); color: #f87171; border: 1px solid rgba(239,68,68,0.38); }
.tier-HIGH     .magic-tier-badge { background: rgba(249,115,22,0.2); color: #fb923c; border: 1px solid rgba(249,115,22,0.35); }
.tier-MED      .magic-tier-badge { background: rgba(250,204,21,0.15); color: #fde047; border: 1px solid rgba(250,204,21,0.28); }
.tier-LOW      .magic-tier-badge { background: rgba(255,255,255,0.03); color: #444; border: 1px solid #1e2c3d; }

.magic-chips-line {
  display: flex;
  align-items: center;
  gap: 0.28rem;
  flex-wrap: wrap;
}
.magic-chip {
  display: inline-flex; align-items: center; gap: 0.2rem;
  font-size: 0.6rem; font-weight: 600; padding: 0.12rem 0.45rem;
  border-radius: 999px; white-space: nowrap;
}
.magic-chip.bank   { background: rgba(34,197,94,0.12);  color: #4ade80; border: 1px solid rgba(34,197,94,0.25); }
.magic-chip.amount { background: rgba(250,204,21,0.12); color: #fde047; border: 1px solid rgba(250,204,21,0.25); }
.magic-chip.card   { background: rgba(168,85,247,0.12); color: #c084fc; border: 1px solid rgba(168,85,247,0.28); }
.magic-chip.upi    { background: rgba(249,115,22,0.12); color: #fb923c; border: 1px solid rgba(249,115,22,0.28); }
.magic-chip.recent { background: rgba(239,68,68,0.1);   color: #f87171; border: 1px solid rgba(239,68,68,0.25); }

.magic-sms-snippet {
  font-size: 0.6rem; color: #5a6e82; font-style: italic;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}

/* Card Right Section */
.magic-card-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.magic-score-box {
  text-align: right;
  line-height: 1;
  min-width: 2.4rem;
}
.magic-score-num {
  font-size: 0.95rem;
  font-weight: 900;
  display: block;
}
.tier-CRITICAL .magic-score-num { color: #f87171; }
.tier-HIGH     .magic-score-num { color: #fb923c; }
.tier-MED      .magic-score-num { color: #fde047; }
.tier-LOW      .magic-score-num { color: #333; }
.magic-score-lbl {
  font-size: 0.52rem;
  color: #445;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.magic-arrow-btn {
  color: #2a3445;
  transition: color 0.15s;
  line-height: 0;
}
.magic-result-card:hover .magic-arrow-btn { color: #a855f7; }
.magic-arrow-btn svg { width: 0.85rem; height: 0.85rem; display: block; }

/* -- Modal Footer (Done Button) ------------------------------------------- */
.magic-scan-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid rgba(168, 85, 247, 0.15);
  background: rgba(13, 12, 24, 0.8);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.btn-magic-done {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.65rem 1.2rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(168, 85, 247, 0.5);
  background: linear-gradient(135deg, #7c3aed 0%, #dc2626 100%);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 0 16px rgba(124, 58, 237, 0.35);
}
.btn-magic-done:hover {
  background: linear-gradient(135deg, #6d28d9 0%, #b91c1c 100%);
  border-color: #a855f7;
  box-shadow: 0 0 24px rgba(124, 58, 237, 0.55);
  transform: translateY(-1px);
}
.btn-magic-done:active { transform: translateY(0); }
.btn-magic-done svg { width: 1rem; height: 1rem; }


/* ??????????????????????????????????????????????????????
   AADHAAR TAB   Full styles
?????????????????????????????????????????????????????? */
.tab-btn-aadhaar { color: #f97316 !important; border-color: #f9731633 !important; }
.tab-btn-aadhaar.active { background: #f9731622 !important; color: #fb923c !important; border-color: #f9731666 !important; }

.aadhaar-section { padding: 0.8rem 0.2rem; display:flex; flex-direction:column; gap:0; }

/* Step indicator */
.aadhaar-steps { display:flex; align-items:center; justify-content:center; gap:0; margin-bottom:0.8rem; }
.aadhaar-step { display:flex; flex-direction:column; align-items:center; gap:0.2rem; opacity:0.35; transition:opacity 0.3s; }
.aadhaar-step.active { opacity:1; }
.aadhaar-step.done { opacity:0.7; }
.astep-num { width:24px; height:24px; border-radius:50%; background:#1e2c3d; border:2px solid #333; display:flex; align-items:center; justify-content:center; font-size:0.7rem; font-weight:700; color:#aaa; transition:all 0.3s; }
.aadhaar-step.active .astep-num { background:#f97316; border-color:#f97316; color:#fff; box-shadow:0 0 10px #f9731666; }
.aadhaar-step.done .astep-num { background:#22c55e; border-color:#22c55e; color:#fff; }
.astep-label { font-size:0.58rem; color:#555; font-weight:600; text-transform:uppercase; letter-spacing:0.05em; }
.aadhaar-step.active .astep-label { color:#f97316; }
.aadhaar-step-line { flex:1; height:2px; background:#222; max-width:40px; margin-bottom:12px; }

/* API status bar */
.aadhaar-api-bar { display:flex; align-items:center; gap:0.4rem; background:#0c1624; border:1px solid #1e2c3d; border-radius:8px; padding:0.4rem 0.7rem; margin-bottom:0.8rem; font-size:0.7rem; color:#666; }
.aadhaar-api-dot { width:7px; height:7px; border-radius:50%; background:#333; flex-shrink:0; transition:background 0.4s; }
.aadhaar-api-dot.online { background:#22c55e; box-shadow:0 0 6px #22c55e88; }
.aadhaar-api-dot.offline { background:#ef4444; }
.aadhaar-api-hint { margin-left:auto; color:#444; font-size:0.65rem; }

/* Panes */
.aadhaar-pane { display:none; flex-direction:column; gap:0.6rem; animation: aFadeIn 0.25s ease; }
.aadhaar-pane.active { display:flex; }
@keyframes aFadeIn { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:none} }

.aadhaar-step-title { font-size:0.85rem; font-weight:700; color:#e5e5e5; margin:0; }
.aadhaar-step-desc { font-size:0.72rem; color:#555; margin:0; }

.aadhaar-field { display:flex; flex-direction:column; gap:0.3rem; }
.aadhaar-label { font-size:0.68rem; font-weight:600; color:#666; text-transform:uppercase; letter-spacing:0.07em; }
.aadhaar-input { background:#0c1624; border:1px solid #1e2c3d; border-radius:8px; padding:0.55rem 0.8rem; color:#e5e5e5; font-size:0.82rem; font-family:inherit; outline:none; transition:border-color 0.2s; }
.aadhaar-input:focus { border-color:#f97316; }
.aadhaar-input.mono { font-family:monospace; letter-spacing:0.08em; }

.aadhaar-err { background:#ef444418; border:1px solid #ef444444; border-radius:8px; padding:0.5rem 0.7rem; font-size:0.72rem; color:#f87171; }

/* Buttons */
.aadhaar-btn-primary { background:linear-gradient(135deg,#f97316,#ea580c); border:none; border-radius:10px; padding:0.65rem 1rem; color:#fff; font-weight:700; font-size:0.8rem; cursor:pointer; transition:opacity 0.2s,transform 0.1s; width:100%; }
.aadhaar-btn-primary:hover { opacity:0.88; }
.aadhaar-btn-primary:active { transform:scale(0.97); }
.aadhaar-btn-primary:disabled { opacity:0.45; cursor:not-allowed; }
.aadhaar-btn-back { background:#1a1a1a; border:1px solid #1e2c3d; border-radius:10px; padding:0.55rem 0.9rem; color:#888; font-size:0.78rem; cursor:pointer; transition:background 0.2s; }
.aadhaar-btn-back:hover { background:#222; color:#aaa; }
.aadhaar-btn-row { display:flex; gap:0.5rem; }
.aadhaar-btn-row .aadhaar-btn-primary { flex:1; }
.aadhaar-btn-pdf { background:linear-gradient(135deg,#0ea5e9,#0284c7); border:none; border-radius:10px; padding:0.65rem 1rem; color:#fff; font-weight:700; font-size:0.8rem; cursor:pointer; width:100%; transition:opacity 0.2s; }
.aadhaar-btn-pdf:hover { opacity:0.88; }
.aadhaar-btn-refresh { background:none; border:1px solid #333; border-radius:8px; padding:0.35rem 0.6rem; color:#888; cursor:pointer; font-size:0.9rem; transition:all 0.2s; flex-shrink:0; }
.aadhaar-btn-refresh:hover { background:#1a1a1a; color:#f97316; border-color:#f97316; }

/* Captcha */
.aadhaar-captcha-wrap { display:flex; align-items:center; gap:0.6rem; }
.aadhaar-captcha-img { width:180px; height:60px; border-radius:8px; border:2px solid #2a2a2a; object-fit:cover; background:#0a0a0a; }
.aadhaar-auto-badge { background:#f9731618; border:1px solid #f9731655; border-radius:6px; padding:0.25rem 0.55rem; font-size:0.68rem; color:#fb923c; font-weight:600; display:inline-block; }

/* OTP auto-read */
.aadhaar-otp-info { font-size:0.75rem; color:#555; }
.aadhaar-mobile-disp { color:#f97316; font-weight:700; font-family:monospace; }
.aadhaar-auto-otp-bar { display:flex; align-items:center; gap:0.4rem; background:#0ea5e910; border:1px solid #0ea5e930; border-radius:8px; padding:0.4rem 0.7rem; font-size:0.7rem; color:#38bdf8; }
.aa-otp-dot { width:7px; height:7px; border-radius:50%; background:#0ea5e9; flex-shrink:0; }
.aa-otp-dot.pulse { animation: aPulse 1.4s ease-in-out infinite; }
@keyframes aPulse { 0%,100%{box-shadow:0 0 0 0 #0ea5e966} 50%{box-shadow:0 0 0 6px transparent} }

/* Result card */
.aadhaar-result-card { background:linear-gradient(135deg,#1a0a00,#0f0800); border:1px solid #f9731644; border-radius:14px; padding:1rem; text-align:center; }
.aadhaar-result-icon { font-size:2rem; margin-bottom:0.3rem; }
.aadhaar-result-label { font-size:0.65rem; color:#f97316; text-transform:uppercase; letter-spacing:0.1em; font-weight:700; margin:0; }
.aadhaar-result-eid { font-family:monospace; font-size:0.7rem; color:#fb923c; word-break:break-all; margin:0.3rem 0 0; letter-spacing:0.05em; }
.aadhaar-result-name { font-size:0.85rem; font-weight:700; color:#e5e5e5; margin:0.2rem 0 0; }

/* Aadhaar details card */
.aadhaar-details-card { background:#0c1a0c; border:1px solid #22c55e44; border-radius:14px; padding:0.9rem; }
.aadhaar-det-header { display:flex; align-items:center; gap:0.5rem; font-size:0.78rem; font-weight:700; color:#4ade80; margin-bottom:0.7rem; border-bottom:1px solid #1a2e1a; padding-bottom:0.5rem; }
.aadhaar-det-copy { margin-left:auto; background:#1a2e1a; border:1px solid #22c55e33; border-radius:6px; padding:0.2rem 0.5rem; font-size:0.65rem; color:#4ade80; cursor:pointer; }
.aadhaar-det-row { display:flex; align-items:flex-start; gap:0.5rem; padding:0.3rem 0; border-bottom:1px solid #1a2e1a11; }
.aadhaar-det-key { font-size:0.65rem; color:#555; font-weight:600; text-transform:uppercase; letter-spacing:0.05em; min-width:80px; flex-shrink:0; }
.aadhaar-det-val { font-size:0.75rem; color:#d1fae5; font-weight:600; }
.aadhaar-det-val.mono { font-family:monospace; letter-spacing:0.06em; }
.aadhaar-pdf-dl-btn { display:block; text-align:center; margin-top:0.7rem; background:#22c55e22; border:1px solid #22c55e55; border-radius:8px; padding:0.5rem; font-size:0.75rem; color:#4ade80; text-decoration:none; font-weight:700; transition:background 0.2s; }
.aadhaar-pdf-dl-btn:hover { background:#22c55e33; }

.aadhaar-pdf-section { display:flex; flex-direction:column; gap:0.6rem; margin-top:0.6rem; }

/* -- Aadhaar Tab Styles --------------------------------------------------- */
.aadhaar-pane-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0.25rem 0.1rem;
}

.aadhaar-header-box {
  background: linear-gradient(135deg, rgba(37,99,235,0.18), rgba(168,85,247,0.12));
  border: 1px solid rgba(59,130,246,0.3);
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
}

.aadhaar-title-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.aadhaar-badge-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.aadhaar-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #60a5fa;
  margin: 0;
}

.aadhaar-subtitle {
  font-size: 0.68rem;
  color: #94a3b8;
  margin-top: 0.15rem;
}

.aadhaar-card {
  background: rgba(15,23,42,0.6);
  border: 1px solid rgba(148,197,230,0.09);
  border-radius: 0.75rem;
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.aadhaar-card-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #f1f5f9;
  margin: 0;
}

.aadhaar-card-desc {
  font-size: 0.68rem;
  color: #64748b;
  margin: 0;
}

.aadhaar-number-selector {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.2rem;
}

.aadhaar-num-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(148,197,230,0.09);
  background: rgba(255,255,255,0.02);
  cursor: pointer;
  transition: all 0.15s;
}

.aadhaar-num-option:hover {
  background: rgba(59,130,246,0.1);
  border-color: rgba(59,130,246,0.4);
}

.aadhaar-num-option.selected {
  background: rgba(59,130,246,0.2);
  border-color: #3b82f6;
  box-shadow: 0 0 10px rgba(59,130,246,0.25);
}

.aadhaar-num-txt {
  font-size: 0.8rem;
  font-weight: 700;
  font-family: monospace;
  color: #38bdf8;
}

.aadhaar-num-lbl {
  font-size: 0.62rem;
  color: #94a3b8;
}

.btn-aadhaar-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1rem;
  border-radius: 0.6rem;
  border: 1px solid #3b82f6;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 0 14px rgba(37,99,235,0.3);
  margin-top: 0.4rem;
}

.btn-aadhaar-action:hover {
  background: linear-gradient(135deg, #1d4ed8, #6d28d9);
  box-shadow: 0 0 20px rgba(37,99,235,0.5);
  transform: translateY(-1px);
}

.aadhaar-status-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.aadhaar-status-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: #38bdf8;
}

.aadhaar-spinner {
  width: 0.9rem;
  height: 0.9rem;
  border: 2px solid rgba(56,189,248,0.2);
  border-top-color: #38bdf8;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.aadhaar-log-box {
  background: #020617;
  border: 1px solid #1e293b;
  border-radius: 0.5rem;
  padding: 0.6rem 0.75rem;
  font-family: monospace;
  font-size: 0.65rem;
  color: #cbd5e1;
  max-height: 12rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.aadhaar-log-item {
  line-height: 1.3;
}

.aadhaar-log-item.info { color: #94a3b8; }
.aadhaar-log-item.ok   { color: #4ade80; font-weight: 700; }
.aadhaar-log-item.warn { color: #fbbf24; }
.aadhaar-log-item.error{ color: #f87171; font-weight: 700; }

.aadhaar-otp-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.2rem;
}

.aadhaar-input {
  flex: 1;
  background: #090d16;
  border: 1px solid #1e293b;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  color: #fff;
  font-family: monospace;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
}

.btn-aadhaar-submit {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid #3b82f6;
  background: #2563eb;
  color: #fff;
  font-weight: 700;
  font-size: 0.72rem;
  cursor: pointer;
}

.aadhaar-result-card {
  background: linear-gradient(145deg, #064e3b 0%, #0f172a 100%);
  border: 1px solid #10b981;
}

.aadhaar-result-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.aadhaar-result-icon {
  font-size: 1.6rem;
}

.aadhaar-result-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: #34d399;
  margin: 0;
}

.aadhaar-result-num {
  font-size: 0.82rem;
  font-weight: 700;
  font-family: monospace;
  color: #a7f3d0;
  margin-top: 0.15rem;
}

.aadhaar-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.4rem;
  background: rgba(0,0,0,0.25);
  padding: 0.65rem;
  border-radius: 0.5rem;
}

.aadhaar-detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.aadhaar-detail-item.full-width {
  grid-column: 1 / -1;
}

.aadhaar-detail-item .lbl {
  font-size: 0.58rem;
  color: #6ee7b7;
  text-transform: uppercase;
  font-weight: 700;
}

.aadhaar-detail-item .val {
  font-size: 0.72rem;
  color: #f0fdf4;
  font-weight: 600;
}

.btn-aadhaar-pdf-download {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1rem;
  border-radius: 0.5rem;
  background: #059669;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
  border: 1px solid #34d399;
  box-shadow: 0 0 12px rgba(16,185,129,0.3);
  margin-top: 0.5rem;
  transition: all 0.15s;
}

.btn-aadhaar-pdf-download:hover {
  background: #10b981;
  box-shadow: 0 0 18px rgba(16,185,129,0.5);
}


/* ── Aadhaar Phone Input & Chips ────────────────────────────────────────── */
.aadhaar-phone-input-wrap {
  display: flex;
  align-items: center;
  background: #090d16;
  border: 1px solid #3b82f6;
  border-radius: 0.6rem;
  padding: 0.2rem 0.75rem;
  margin-top: 0.2rem;
  box-shadow: 0 0 10px rgba(59,130,246,0.15);
}
.aadhaar-phone-prefix {
  font-size: 0.85rem;
  font-weight: 800;
  color: #38bdf8;
  padding-right: 0.6rem;
  border-right: 1px solid rgba(255,255,255,0.12);
  margin-right: 0.6rem;
}
.aadhaar-phone-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #ffffff;
  font-family: monospace;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  outline: none;
  padding: 0.45rem 0;
}
.aadhaar-chips-title {
  font-size: 0.62rem;
  color: #64748b;
  font-weight: 600;
  margin-top: 0.4rem;
}
.aadhaar-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.2rem;
}
.aadhaar-num-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.03);
  cursor: pointer;
  transition: all 0.15s;
}
.aadhaar-num-chip:hover {
  background: rgba(59,130,246,0.15);
  border-color: rgba(59,130,246,0.4);
}
.aadhaar-num-chip.selected {
  background: rgba(59,130,246,0.25);
  border-color: #3b82f6;
  box-shadow: 0 0 10px rgba(59,130,246,0.3);
}
.chip-num {
  font-size: 0.75rem;
  font-weight: 700;
  font-family: monospace;
  color: #38bdf8;
}
.chip-lbl {
  font-size: 0.58rem;
  color: #94a3b8;
}

/* ── TELEGRAM HEADER BUTTON & MODAL POPUP ────────────────────────── */
.btn-telegram-header {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.38rem 0.85rem;
  border-radius: 0.6rem;
  background: linear-gradient(135deg, rgba(0,136,204,0.2) 0%, rgba(34,158,217,0.3) 100%);
  border: 1px solid rgba(56,189,248,0.45);
  color: #38bdf8;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.25s ease;
  box-shadow: 0 0 15px rgba(0,136,204,0.15);
}
.btn-telegram-header:hover {
  background: linear-gradient(135deg, rgba(0,136,204,0.4) 0%, rgba(34,158,217,0.6) 100%);
  border-color: #38bdf8;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 0 20px rgba(0,136,204,0.4);
}
.tg-header-icon {
  width: 1.1rem;
  height: 1.1rem;
  fill: currentColor;
}

.tg-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(4, 8, 16, 0.82);
  backdrop-filter: blur(10px);
  animation: fadeInTgOverlay 0.3s ease-out forwards;
}

@keyframes fadeInTgOverlay {
  from { opacity: 0; }
  to { opacity: 1; }
}

.tg-popup-card {
  position: relative;
  width: 100%;
  max-width: 24rem;
  background: linear-gradient(145deg, #0b1320, #080d17);
  border: 1px solid rgba(56,189,248,0.3);
  border-radius: 1.5rem;
  padding: 1.75rem 1.5rem 1.5rem;
  text-align: center;
  box-shadow: 0 0 50px rgba(0,136,204,0.25), 0 25px 50px rgba(0,0,0,0.8);
  animation: scaleInTgCard 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes scaleInTgCard {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.tg-popup-close-icon {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(148,197,230,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 0.6rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s ease;
}
.tg-popup-close-icon:hover {
  background: rgba(255,255,255,0.15);
  color: #ffffff;
}
.tg-popup-close-icon svg {
  width: 1rem;
  height: 1rem;
}

.tg-popup-icon-wrap {
  position: relative;
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1.25rem;
  border-radius: 1.25rem;
  background: linear-gradient(135deg, #0088cc, #229ed9);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 30px rgba(0,136,204,0.5);
}
.tg-popup-icon-glow {
  position: absolute;
  inset: -6px;
  border-radius: 1.5rem;
  background: rgba(34,158,217,0.3);
  filter: blur(10px);
  z-index: -1;
}
.tg-popup-icon {
  width: 2.25rem;
  height: 2.25rem;
  color: #ffffff;
}

.tg-popup-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.tg-popup-subtitle {
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.tg-popup-channel-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  border-radius: 2rem;
  background: rgba(0,136,204,0.12);
  border: 1px solid rgba(56,189,248,0.3);
  color: #38bdf8;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  font-family: monospace;
}

.tg-popup-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.btn-tg-popup-join {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.75rem;
  border-radius: 0.85rem;
  background: linear-gradient(135deg, #0088cc 0%, #229ed9 100%);
  border: 1px solid rgba(255,255,255,0.2);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.25s ease;
  box-shadow: 0 0 25px rgba(0,136,204,0.4);
}
.btn-tg-popup-join:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 35px rgba(0,136,204,0.6);
  filter: brightness(1.1);
}

.btn-tg-popup-dismiss {
  width: 100%;
  padding: 0.65rem;
  border-radius: 0.85rem;
  background: rgba(148,197,230,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-tg-popup-dismiss:hover {
  background: rgba(255,255,255,0.1);
  color: #94a3b8;
}

/* ── RESPONSIVE MOBILE FIXES FOR SMARTPHONES & TABLETS ─────────── */
@media (max-width: 768px) {
  .dash-header-inner {
    padding: 0.5rem 0.85rem !important;
    gap: 0.5rem !important;
    flex-wrap: wrap !important;
  }
  
  .logo-brand {
    order: 1;
  }
  
  .header-right {
    order: 2;
    margin-left: auto;
    gap: 0.4rem !important;
  }
  
  .search-wrap {
    order: 3;
    width: 100% !important;
    max-width: 100% !important;
    margin-top: 0.25rem !important;
  }
  
  .clock-badge {
    display: none !important;
  }

  .connected-badge {
    padding: 0.25rem 0.5rem !important;
    font-size: 0.65rem !important;
  }

  .btn-telegram-header {
    padding: 0.32rem 0.6rem !important;
    font-size: 0.72rem !important;
  }

  .btn-logout {
    padding: 0.32rem 0.6rem !important;
    font-size: 0.72rem !important;
  }

  .stats-bar-inner {
    padding: 0.6rem 0.85rem !important;
    gap: 0.85rem !important;
  }

  .stats-group {
    gap: 0.75rem !important;
    flex-wrap: wrap !important;
  }

  .tg-popup-card {
    max-width: 92vw !important;
    padding: 1.25rem 1rem 1rem !important;
    border-radius: 1.25rem !important;
  }

  .tg-popup-title {
    font-size: 1.1rem !important;
  }

  .tg-popup-subtitle {
    font-size: 0.75rem !important;
    margin-bottom: 1rem !important;
  }

  .aadhaar-details-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ═══════════════════════════════════════════════════════════════
   AADHAAR UI OVERHAUL — Step progress, OTP boxes, cancel/retry
   ═══════════════════════════════════════════════════════════════ */

/* Step progress bar */
.adh-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 0 0 14px 0;
  padding: 10px 8px;
  background: rgba(15,23,42,0.6);
  border-radius: 10px;
  border: 1px solid rgba(148,197,230,0.08);
}
.adh-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  opacity: 0.35;
  transition: opacity 0.3s;
}
.adh-step.active { opacity: 1; }
.adh-step.done   { opacity: 0.75; }
.adh-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(148,197,230,0.09);
  border: 2px solid rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
  transition: background 0.3s, border-color 0.3s, color 0.3s;
}
.adh-step.active .adh-step-num {
  background: #3b82f6;
  border-color: #60a5fa;
  color: #fff;
  box-shadow: 0 0 10px rgba(59,130,246,0.5);
}
.adh-step.done .adh-step-num {
  background: #22c55e33;
  border-color: #22c55e;
  color: #4ade80;
}
.adh-step-lbl {
  font-size: 0.6rem;
  color: #64748b;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.adh-step.active .adh-step-lbl { color: #93c5fd; }
.adh-step.done .adh-step-lbl   { color: #4ade80; }
.adh-step-line {
  flex: 1;
  height: 2px;
  background: rgba(148,197,230,0.09);
  min-width: 20px;
  max-width: 40px;
  border-radius: 2px;
}

/* Cancel / Retry buttons */
.adh-action-row {
  display: flex;
  gap: 8px;
  margin: 8px 0 6px 0;
}
.adh-btn-cancel,
.adh-btn-retry {
  flex: 1;
  padding: 7px 10px;
  border-radius: 7px;
  border: 1px solid;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
  letter-spacing: 0.2px;
}
.adh-btn-cancel {
  background: rgba(239,68,68,0.1);
  border-color: rgba(239,68,68,0.3);
  color: #f87171;
}
.adh-btn-cancel:hover {
  background: rgba(239,68,68,0.22);
  border-color: #ef4444;
  box-shadow: 0 0 8px rgba(239,68,68,0.3);
}
.adh-btn-retry {
  background: rgba(59,130,246,0.1);
  border-color: rgba(59,130,246,0.3);
  color: #60a5fa;
}
.adh-btn-retry:hover {
  background: rgba(59,130,246,0.22);
  border-color: #3b82f6;
  box-shadow: 0 0 8px rgba(59,130,246,0.3);
}

/* Substatus line */
.adh-substatus {
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 2px;
  min-height: 14px;
}

/* OTP card glow */
.adh-otp-card {
  border-color: rgba(56,189,248,0.25) !important;
}

/* OTP boxes */
.adh-otp-boxes {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 14px 0 12px 0;
}
.adh-otp-box {
  width: 42px;
  height: 52px;
  border-radius: 10px;
  background: rgba(15,23,42,0.9);
  border: 2px solid rgba(56,189,248,0.25);
  color: #e2e8f0;
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.1s;
  caret-color: #38bdf8;
  -webkit-appearance: none;
}
.adh-otp-box:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56,189,248,0.35);
  transform: translateY(-2px);
}
.adh-otp-box:not(:placeholder-shown) {
  border-color: rgba(56,189,248,0.5);
  background: rgba(56,189,248,0.07);
}
.adh-otp-sep {
  color: #475569;
  font-size: 1.2rem;
  user-select: none;
  flex-shrink: 0;
  line-height: 1;
}

/* OTP action row */
.adh-otp-action-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}
.adh-btn-retry-sm {
  padding: 7px 12px;
  border-radius: 7px;
  background: rgba(59,130,246,0.1);
  border: 1px solid rgba(59,130,246,0.3);
  color: #60a5fa;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
}
.adh-btn-retry-sm:hover {
  background: rgba(59,130,246,0.2);
  border-color: #3b82f6;
}

/* Countdown ring */
.adh-otp-timer-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 4px;
}
.adh-otp-timer {
  position: relative;
  width: 52px;
  height: 52px;
}
.adh-otp-ring {
  width: 52px;
  height: 52px;
  transform: rotate(-90deg);
}
.adh-ring-bg {
  fill: none;
  stroke: rgba(255,255,255,0.07);
  stroke-width: 3;
}
.adh-ring-fill {
  fill: none;
  stroke: #38bdf8;
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dasharray 0.9s linear, stroke 0.5s;
}
.adh-otp-sec {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.8rem;
  font-weight: 800;
  color: #e2e8f0;
  font-variant-numeric: tabular-nums;
}

/* Responsive */
@media (max-width: 480px) {
  .adh-otp-box { width: 36px; height: 46px; font-size: 1.2rem; }
  .adh-otp-boxes { gap: 4px; }
  .adh-step-lbl { display: none; }
  .adh-steps { padding: 8px 4px; }
}
