:root {
  --bg: #070b14;
  --bg-elev: #0d1424;
  --bg-card: rgba(16, 25, 45, 0.88);
  --bg-hover: rgba(30, 45, 78, 0.65);
  --border: rgba(148, 163, 184, 0.16);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --emerald: #10b981;
  --emerald-soft: rgba(16, 185, 129, 0.14);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.16);
  --rose: #ef4444;
  --rose-soft: rgba(239, 68, 68, 0.18);
  --sky: #38bdf8;
  --sky-soft: rgba(56, 189, 248, 0.15);
  --radius: 14px;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.48);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at top right, #11223d 0%, #070b14 55%);
  color: var(--text);
  font-family: "Inter", "Noto Sans Bengali", "Segoe UI", system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* Buttons & Inputs */
button, input, textarea, select {
  font-family: inherit;
  color: inherit;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  background: var(--bg-elev);
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { background: var(--bg-hover); border-color: rgba(148,163,184,0.35); }
.btn:active { transform: scale(0.98); }
.btn-primary { background: linear-gradient(135deg, #10b981, #059669); color: #04130d; border: none; }
.btn-primary:hover { background: linear-gradient(135deg, #34d399, #10b981); }
.btn-danger { background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff; border: none; }
.btn-amber { background: linear-gradient(135deg, #f59e0b, #d97706); color: #160c00; border: none; }
.btn-sm { padding: 6px 11px; font-size: 12px; border-radius: 8px; }
.btn-block { width: 100%; }

.input, textarea, select {
  width: 100%;
  background: rgba(7, 11, 20, 0.85);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus, textarea:focus, select:focus {
  border-color: var(--emerald);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg-elev);
}
.badge-emerald { background: var(--emerald-soft); color: #34d399; border-color: rgba(16,185,129,0.35); }
.badge-amber { background: var(--amber-soft); color: #fbbf24; border-color: rgba(245,158,11,0.35); }
.badge-rose { background: var(--rose-soft); color: #fca5a5; border-color: rgba(239,68,68,0.45); }
.badge-sky { background: var(--sky-soft); color: #7dd3fc; border-color: rgba(56,189,248,0.35); }

/* Auth Gate */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow);
}
.auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.auth-shield {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: linear-gradient(135deg, #10b981, #0ea5e9);
  display: grid;
  place-items: center;
  font-size: 24px;
  color: #051310;
  font-weight: 800;
}
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.alert-box {
  padding: 11px 13px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 14px;
  border: 1px solid rgba(239,68,68,0.4);
  background: var(--rose-soft);
  color: #fecaca;
}
.info-box {
  padding: 11px 13px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 14px;
  border: 1px solid rgba(56,189,248,0.35);
  background: var(--sky-soft);
  color: #bae6fd;
}

/* App Shell */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(7, 11, 20, 0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-dot {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #10b981, #06b6d4);
  display: grid;
  place-items: center;
  font-weight: 900;
  color: #031510;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.search-wrap {
  position: relative;
  min-width: 220px;
  flex: 1;
  max-width: 340px;
}

.layout {
  display: grid;
  grid-template-columns: 270px 1fr;
  flex: 1;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}

/* Sidebar 13 Tabs */
.sidebar {
  border-right: 1px solid var(--border);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(10, 16, 30, 0.55);
}
.tab-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s ease;
}
.tab-btn:hover { background: var(--bg-hover); color: var(--text); }
.tab-btn.active {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.2), rgba(14, 165, 233, 0.1));
  color: #fff;
  border-color: rgba(16, 185, 129, 0.42);
}
.tab-pill-count {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.15);
}

/* Mobile Horizontal Tab Strip */
.mobile-tabs {
  display: none;
  overflow-x: auto;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 16, 30, 0.85);
  scrollbar-width: none;
}
.mobile-tabs::-webkit-scrollbar { display: none; }
.mobile-tab-chip {
  white-space: nowrap;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text-muted);
  cursor: pointer;
}
.mobile-tab-chip.active {
  background: var(--emerald-soft);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.5);
}

/* Main Content */
.main-content {
  padding: 18px 22px 84px;
  min-width: 0;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.card-title { margin: 0; font-size: 16px; font-weight: 700; }
.muted { color: var(--text-muted); font-size: 13px; }

/* Checklist */
.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 11px 12px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: rgba(7, 11, 20, 0.55);
  margin-bottom: 8px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.checklist-item.done { opacity: 0.72; border-color: rgba(16, 185, 129, 0.3); }
.checklist-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--emerald);
  cursor: pointer;
  flex-shrink: 0;
}
.checklist-label { font-size: 13.5px; line-height: 1.5; word-break: break-word; }

/* Command Box & List */
.cmd-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(7, 11, 20, 0.65);
  margin-bottom: 8px;
}
.cmd-text { font-size: 14px; line-height: 1.45; }

/* Bank Alert Cards */
.bank-alert-card {
  border: 1px solid rgba(239, 68, 68, 0.45);
  background: linear-gradient(135deg, rgba(127, 29, 29, 0.28), rgba(15, 23, 42, 0.92));
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
}
.bank-alert-card.acked {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 25, 45, 0.8);
}

/* Rendered Markdown */
.md-body {
  font-size: 14px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.md-body h1, .md-body h2, .md-body h3 {
  margin-top: 1.15em;
  margin-bottom: 0.55em;
  color: #f8fafc;
}
.md-body h1 { font-size: 20px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.md-body h2 { font-size: 17px; color: #34d399; }
.md-body h3 { font-size: 15px; color: #7dd3fc; }
.md-body a { color: #38bdf8; text-decoration: none; }
.md-body a:hover { text-decoration: underline; }
.md-body hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.md-body ul { padding-left: 20px; }
.md-body li { margin-bottom: 6px; }
.md-body code {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 6px;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 12.5px;
  color: #fde68a;
}
.copy-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 5px;
  padding: 1px 6px;
  font-size: 11px;
  border-radius: 6px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.14);
  color: #7dd3fc;
  cursor: pointer;
}
.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 12px 0;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.md-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.md-body th, .md-body td {
  padding: 9px 11px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.md-body th {
  background: rgba(15, 23, 42, 0.9);
  color: #93c5fd;
  font-weight: 700;
}
.md-body tr:hover td { background: rgba(30, 41, 59, 0.45); }

/* Emergency Ringing Full-Screen Call Overlay */
.call-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: radial-gradient(circle at top, #7f1d1d 0%, #1b060a 52%, #05070e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.call-card {
  width: 100%;
  max-width: 470px;
  background: rgba(15, 18, 28, 0.92);
  border: 2px solid rgba(239, 68, 68, 0.75);
  border-radius: 24px;
  padding: 26px;
  text-align: center;
  box-shadow: 0 0 80px rgba(239, 68, 68, 0.48);
  animation: pulseGlow 1.3s infinite ease-in-out;
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 36px rgba(239, 68, 68, 0.45); }
  50% { box-shadow: 0 0 78px rgba(239, 68, 68, 0.85); }
}
.call-avatar {
  width: 82px;
  height: 82px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ef4444, #f59e0b);
  display: grid;
  place-items: center;
  font-size: 36px;
  animation: ringShake 0.7s infinite;
}
@keyframes ringShake {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(-12deg); }
  40% { transform: rotate(12deg); }
  60% { transform: rotate(-10deg); }
  80% { transform: rotate(10deg); }
}
.call-bank-box {
  text-align: left;
  background: rgba(7, 11, 20, 0.85);
  border: 1px solid rgba(248, 113, 113, 0.35);
  border-radius: 14px;
  padding: 14px;
  margin: 16px 0;
  font-size: 13.5px;
  line-height: 1.65;
}
.call-actions {
  display: grid;
  gap: 10px;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 800;
  background: rgba(2, 6, 16, 0.78);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-card {
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.selfie-preview {
  width: 100%;
  max-height: 280px;
  border-radius: 12px;
  background: #000;
  object-fit: cover;
  border: 1px solid var(--border);
}

.toast {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 1200;
  background: #0f172a;
  border: 1px solid rgba(16, 185, 129, 0.55);
  color: #f8fafc;
  padding: 11px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  box-shadow: var(--shadow);
}

@media (max-width: 920px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .mobile-tabs { display: flex; }
  .main-content { padding: 14px 12px 90px; }
  .search-wrap { max-width: 100%; min-width: 150px; }
}
