:root {
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --border-color: #e2e8f0;
  --border-light: #edf2f7;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  
  --success: #10b981;
  --success-dark: #059669;
  --success-light: #ecfdf5;
  
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  
  --danger: #ef4444;
  --danger-light: #fef2f2;
  
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
}

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

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

/* ---------------- Top Navbar ---------------- */
.top-nav {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 50;
}

.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

/* Tab Navigation */
.tab-nav {
  display: flex;
  gap: 6px;
  background: var(--bg-subtle);
  padding: 4px;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: var(--text-main);
}

.tab-btn.active {
  background: var(--bg-card);
  color: var(--primary);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* Actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sound-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #cbd5e1;
  transition: .25s;
  border-radius: 20px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .25s;
  border-radius: 50%;
}

input:checked + .slider { background-color: var(--primary); }
input:checked + .slider:before { transform: translateX(16px); }

.status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--success-light);
  color: var(--success-dark);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
}

/* ---------------- Layout & Main ---------------- */
.main-wrapper {
  max-width: 1100px;
  margin: 1.75rem auto;
  padding: 0 1.5rem 3rem;
}

.tab-view {
  display: none;
}

.tab-view.active {
  display: block;
}

/* Quick Stats */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow-sm);
}

.stat-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
}

.stat-val {
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 4px;
  letter-spacing: -0.02em;
}

.stat-val.active-val {
  color: var(--success-dark);
}

/* ---------------- Spotlight OTP Card ---------------- */
.live-card-container {
  margin-bottom: 1.5rem;
}

/* Empty State */
.empty-state {
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 3.5rem 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.radar-pulse {
  position: relative;
  width: 52px;
  height: 52px;
  margin: 0 auto 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.radar-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary);
}

.radar-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid var(--primary);
  opacity: 0.4;
  animation: radarPing 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes radarPing {
  0% { transform: scale(0.6); opacity: 0.8; }
  100% { transform: scale(1.6); opacity: 0; }
}

.empty-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-main);
}

.empty-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 6px;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
}

/* Active Live OTP Card */
.active-otp-card {
  background: var(--bg-card);
  border: 2px solid #93c5fd;
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  box-shadow: var(--shadow-md);
  position: relative;
  animation: slideInDown 0.3s ease;
}

@keyframes slideInDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.otp-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.sender-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sender-badge {
  background: #dbeafe;
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  letter-spacing: 0.02em;
}

.sim-badge {
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid #bfdbfe;
  letter-spacing: 0.02em;
}

/* Hardware SIM Chips in Connected Devices */
.sim-chip-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sim-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.8rem;
  width: fit-content;
}

.sim-chip-slot {
  background: #2563eb;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.03em;
}

.sim-chip-num {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: #0f172a;
}

.sim-chip-carrier {
  font-size: 0.72rem;
  color: #334155;
  background: #e2e8f0;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.sim-chip-lock {
  font-size: 0.72rem;
  opacity: 0.75;
}

.sim-chip-placeholder {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.8rem;
}

.time-stamp {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.badge-live {
  background: var(--success);
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  letter-spacing: 0.05em;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.otp-display-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin: 1.25rem 0 1.5rem;
  background: var(--bg-subtle);
  padding: 1.25rem 1.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
}

.otp-code-digits {
  font-family: 'JetBrains Mono', monospace;
  font-size: 2.85rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  color: var(--text-main);
  user-select: all;
}

.otp-code-digits.masked {
  letter-spacing: 0.15em;
  color: var(--text-muted);
}

.otp-btn-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-copy-main {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: white;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-copy-main:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-copy-main:active {
  transform: translateY(0);
}

.btn-ghost {
  background: white;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  font-weight: 500;
  font-size: 0.9rem;
  padding: 9px 15px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-ghost:hover {
  background: var(--bg-subtle);
}

.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

/* Validity Bar */
.validity-wrapper {
  margin-top: 1rem;
}

.validity-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.validity-track {
  width: 100%;
  height: 6px;
  background: var(--border-color);
  border-radius: 10px;
  overflow: hidden;
}

.validity-fill {
  height: 100%;
  background: var(--success);
  width: 100%;
  transition: width 1s linear, background-color 0.5s ease;
}

/* ---------------- History Card ---------------- */
.history-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.15rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.card-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
}

.card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.btn-text-action {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
}

.btn-text-action:hover {
  color: var(--danger);
}

.history-list {
  padding: 0.5rem 0;
}

.history-empty {
  color: var(--text-muted);
  text-align: center;
  font-size: 0.88rem;
  padding: 2.5rem 1rem;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.15s ease;
}

.history-item:last-child {
  border-bottom: none;
}

.history-item:hover {
  background: var(--bg-subtle);
}

.item-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.item-sender {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-main);
}

.item-time {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.item-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.item-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  background: var(--bg-subtle);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.btn-copy-sm {
  background: white;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 5px 10px;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-copy-sm:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: #bfdbfe;
}

/* ---------------- Table ---------------- */
.table-responsive {
  overflow-x: auto;
}

.clean-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.clean-table th {
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.clean-table td {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.88rem;
  color: var(--text-main);
}

.clean-table tr:hover td {
  background: var(--bg-subtle);
}

.badge-approved {
  background: var(--success-light);
  color: var(--success-dark);
  font-weight: 600;
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 12px;
}

.badge-pending {
  background: var(--warning-light);
  color: var(--warning);
  font-weight: 600;
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 12px;
}

/* ---------------- Modal ---------------- */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-card {
  background: white;
  width: 100%;
  max-width: 440px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: slideInDown 0.2s ease;
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-body {
  padding: 1.5rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 9px 12px;
  border-radius: 7px;
  border: 1px solid var(--border-color);
  font-size: 0.9rem;
  color: var(--text-main);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.modal-footer {
  padding: 1rem 1.5rem;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ---------------- Toast ---------------- */
.toast-hub {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: #1e293b;
  color: white;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.88rem;
  box-shadow: var(--shadow-lg);
  animation: slideInUp 0.2s ease;
}

.toast-success { border-left: 4px solid var(--success); }
.toast-info { border-left: 4px solid var(--primary); }
.toast-warn { border-left: 4px solid var(--warning); }

@keyframes slideInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 768px) {
  .nav-container { flex-direction: column; align-items: stretch; }
  .nav-actions { justify-content: space-between; }
  .stats-row { grid-template-columns: 1fr; }
  .otp-display-zone { flex-direction: column; align-items: stretch; text-align: center; }
  .otp-code-digits { font-size: 2.2rem; }
  .otp-btn-group { justify-content: center; }
}
