/* Chime Payment Verification System - Premium Fintech & Full Mobile Responsive Stylesheet */
:root {
  --bg-page: #f1f5f9;
  --bg-card: #ffffff;
  --navy-950: #06101e;
  --navy-900: #0d1e36;
  --navy-800: #152c4e;
  --navy-700: #1e3a63;
  --text-main: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --border-light: #e2e8f0;
  --border-row: #f1f5f9;
  --chime-green: #00875a;
  --chime-green-dark: #006e49;
  --chime-green-bg: #ecfdf5;
  --chime-accent: #10b981;
  --gmail-red: #ea4335;
  --outlook-blue: #0078d4;
  --sidebar-width: 272px;
  --radius-xl: 18px;
  --radius-lg: 15px;
  --radius-md: 11px;
  --radius-sm: 8px;
  --shadow-card: 0 12px 32px -12px rgba(13, 30, 54, 0.08), 0 4px 14px -3px rgba(13, 30, 54, 0.04);
  --shadow-hover: 0 18px 38px -12px rgba(13, 30, 54, 0.13), 0 6px 18px -4px rgba(13, 30, 54, 0.06);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: radial-gradient(circle at 10% 0%, #eef6ff 0%, #f1f5f9 45%, #edf2f7 100%);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* App Shell: Left Sidebar + Main Area */
.app-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* Left Sidebar - Premium Dark Navy Gradient */
.app-sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #071224 0%, #0d1e36 55%, #081528 100%);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 70;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 8px 0 30px rgba(6, 16, 30, 0.18);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 18px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand {
  padding: 20px 20px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-decoration: none;
  color: #ffffff;
}

.sidebar-close-btn {
  display: none;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #e2e8f0;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #00875a 0%, #10b981 100%);
  color: #ffffff;
  font-weight: 800;
  font-size: 19px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35);
}

.brand-title {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.02em;
  display: block;
}

.brand-sub {
  font-size: 11.5px;
  color: #94a3b8;
  display: block;
  font-weight: 500;
}

.sidebar-section-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  padding: 18px 20px 8px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 4px 12px 16px;
  flex: 1;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10.5px 13px;
  border-radius: 10px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.18s ease;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.nav-item-left {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.nav-icon {
  width: 22px;
  text-align: center;
  font-size: 15px;
  opacity: 0.92;
  flex-shrink: 0;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
  transform: translateX(2px);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.24) 0%, rgba(16, 185, 129, 0.06) 100%);
  color: #ffffff;
  font-weight: 600;
  border-left: 3px solid #10b981;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.nav-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  flex-shrink: 0;
}

.nav-badge.green {
  background: rgba(16, 185, 129, 0.24);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.28);
}

.nav-badge.amber {
  background: rgba(245, 158, 11, 0.24);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.28);
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(6, 16, 30, 0.85);
}

.admin-profile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e3a63 0%, #0f2942 100%);
  border: 1px solid rgba(52, 211, 153, 0.35);
  color: #34d399;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.admin-name {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  max-width: 125px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-role {
  font-size: 11px;
  color: #94a3b8;
}

/* Main Content Wrapper */
.app-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: calc(100% - var(--sidebar-width));
}

/* Topbar inside Main - Frosted Glass */
.topbar {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar-inner {
  padding: 13px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.mobile-menu-btn {
  display: none;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  color: var(--navy-900);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
  flex-shrink: 0;
}

.page-Select-heading {
  font-size: 16.5px;
  font-weight: 800;
  color: var(--navy-900);
  letter-spacing: -0.01em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(8, 20, 38, 0.58);
  backdrop-filter: blur(3px);
  z-index: 65;
}

/* Mobile Fixed Bottom Navigation Bar */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(13, 30, 54, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 50;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -8px 25px rgba(6, 16, 30, 0.22);
}

.mobile-bottom-nav a,
.mobile-bottom-nav button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #94a3b8;
  text-decoration: none;
  font-size: 10.5px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 9px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.mobile-bottom-nav a.active {
  color: #34d399;
  background: rgba(16, 185, 129, 0.14);
}

.mobile-bottom-nav .mb-icon {
  font-size: 16px;
  line-height: 1;
}

/* Buttons & Chips */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.16s ease;
  white-space: nowrap;
  font-family: inherit;
}

.btn:active {
  transform: scale(0.98);
}

.btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.btn-outline {
  background: #ffffff;
  border-color: var(--border-light);
  color: var(--text-main);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.btn-outline:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.btn-gmail {
  background: #ffffff;
  border-color: #dadce0;
  color: #1f2937;
}

.btn-gmail:hover {
  background: #fef2f2;
  border-color: #fca5a5;
}

.btn-outlook {
  background: linear-gradient(135deg, #0078d4 0%, #0284c7 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 120, 212, 0.22);
}

.btn-outlook:hover {
  background: #006cbe;
}

.btn-primary {
  background: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-800) 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(13, 30, 54, 0.18);
}

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

.btn-green {
  background: linear-gradient(135deg, #00875a 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 135, 90, 0.24);
}

.btn-green:hover {
  background: var(--chime-green-dark);
}

.btn-danger {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}

.btn-danger:hover {
  background: #dc2626;
  color: #ffffff;
}

.btn-sm {
  padding: 5.5px 10.5px;
  font-size: 12px;
  border-radius: 7px;
}

/* Quick Tag Chips inside Modals */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.chip:hover {
  background: #ecfdf5;
  color: #047857;
  border-color: #6ee7b7;
}

/* Content Body Area */
.content-body {
  padding: 26px 28px 80px;
  max-width: 1380px;
  width: 100%;
  margin: 0 auto;
}

.layout-grid-2col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: start;
}

/* Admin KPI Cards Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.kpi-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(226, 232, 240, 0.9);
  padding: 20px 22px;
  box-shadow: var(--shadow-card);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  position: relative;
  overflow: hidden;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.kpi-card.navy {
  background: linear-gradient(135deg, #0b192e 0%, #132c4e 100%);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.1);
}

.kpi-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 7px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kpi-card.navy .kpi-label {
  color: #94a3b8;
}

.kpi-value {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 25px;
  font-weight: 900;
  color: var(--navy-900);
  line-height: 1.2;
}

.kpi-card.navy .kpi-value {
  color: #ffffff;
}

.kpi-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

.kpi-card.navy .kpi-sub {
  color: #cbd5e1;
}

/* Main White Sheet */
.payments-sheet {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(226, 232, 240, 0.85);
  padding: 30px 32px;
  min-width: 0;
}

.sheet-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.sheet-title {
  font-family: 'Merriweather', Georgia, Cambria, serif;
  font-size: 27px;
  font-weight: 900;
  color: var(--navy-900);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.sheet-subtitle {
  font-size: 14.5px;
  color: var(--text-muted);
}

/* Dark Navy Total Banner - Premium Gradient */
.total-banner {
  background: linear-gradient(135deg, #091526 0%, #102542 60%, #07352c 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  box-shadow: 0 14px 32px -10px rgba(9, 21, 38, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.total-banner-label {
  font-size: 13.5px;
  color: #cbd5e1;
  font-weight: 500;
  margin-bottom: 6px;
}

.total-banner-amount {
  font-family: 'Merriweather', Georgia, Cambria, serif;
  font-size: 34px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.total-banner-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.stat-chip {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 9px 14px;
  border-radius: 10px;
  min-width: 115px;
}

.stat-chip-label {
  font-size: 10.5px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.stat-chip-val {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
}

.stat-chip-val.green {
  color: #34d399;
}

/* Admin Cashed (USD) Premium Card & Add/Minus Buttons */
.admin-cash-card {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.16) 0%, rgba(15, 23, 42, 0.78) 100%);
  border: 1.5px solid rgba(52, 211, 153, 0.42);
  border-radius: 15px;
  padding: 13px 16px;
  min-width: 310px;
  max-width: 430px;
  flex: 1;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.admin-cash-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 11px;
}

.admin-cash-metric-box {
  border-radius: 11px;
  padding: 9px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.admin-cash-metric-box.cashed {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.22) 0%, rgba(6, 78, 59, 0.42) 100%);
  border: 1px solid rgba(52, 211, 153, 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.admin-cash-metric-box.uncashed {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.22) 0%, rgba(120, 53, 15, 0.42) 100%);
  border: 1px solid rgba(251, 191, 36, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.admin-cash-metric-lbl {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 4px;
}

.admin-cash-metric-box.cashed .admin-cash-metric-lbl {
  color: #6ee7b7;
}

.admin-cash-metric-box.uncashed .admin-cash-metric-lbl {
  color: #fde68a;
}

.admin-cash-metric-val {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.admin-cash-metric-box.cashed .admin-cash-metric-val {
  color: #34d399;
  text-shadow: 0 2px 10px rgba(52, 211, 153, 0.3);
}

.admin-cash-metric-box.uncashed .admin-cash-metric-val {
  color: #fbbf24;
  text-shadow: 0 2px 10px rgba(251, 191, 36, 0.3);
}

.admin-cash-input-field {
  width: 100%;
  padding: 7px 8px 7px 23px;
  border-radius: 9px;
  border: 1.5px solid rgba(52, 211, 153, 0.35);
  background: rgba(6, 15, 29, 0.78);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 800;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.admin-cash-input-field:focus {
  border-color: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.22);
}

.admin-cash-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 9px;
  padding: 7px 13px;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.admin-cash-btn .btn-ico {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  background: rgba(255, 255, 255, 0.22);
}

.admin-cash-btn-add {
  background: linear-gradient(135deg, #10b981 0%, #059669 55%, #047857 100%);
  color: #ffffff;
  border: 1px solid rgba(110, 231, 183, 0.45);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.admin-cash-btn-add:hover {
  transform: translateY(-1.5px);
  filter: brightness(1.08);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.55);
}

.admin-cash-btn-sub {
  background: linear-gradient(135deg, #f43f5e 0%, #e11d48 55%, #be123c 100%);
  color: #ffffff;
  border: 1px solid rgba(253, 164, 175, 0.42);
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.admin-cash-btn-sub:hover {
  transform: translateY(-1.5px);
  filter: brightness(1.08);
  box-shadow: 0 6px 18px rgba(244, 63, 94, 0.52);
}

.admin-cash-btn:active {
  transform: translateY(0);
}

/* Filter Bar */
.filter-bar {
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 15px;
  margin-bottom: 18px;
}

.filter-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 0.9fr auto;
  gap: 10px;
  align-items: end;
}

.field-group label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.input-control {
  width: 100%;
  padding: 9.5px 12px;
  font-size: 13.5px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: var(--text-main);
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input-control:focus {
  outline: none;
  border-color: var(--chime-green);
  box-shadow: 0 0 0 3px rgba(0, 135, 90, 0.12);
}

.preset-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #e2e8f0;
}

.preset-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.preset-pill {
  font-size: 12px;
  padding: 4.5px 11px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: var(--text-secondary);
  cursor: pointer;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.15s ease;
}

.preset-pill:hover,
.preset-pill.active {
  background: var(--navy-900);
  color: #ffffff;
  border-color: var(--navy-900);
}

/* Bulk Admin Action Bar */
.bulk-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--navy-900);
  color: #ffffff;
  padding: 11px 16px;
  border-radius: 10px;
  margin-bottom: 14px;
  font-size: 13px;
}

.bulk-bar.active {
  display: flex;
}

/* Payments & Data Tables */
.table-wrapper {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: #ffffff;
  width: 100%;
}

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

.payments-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 13px 15px;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}

.payments-table td {
  padding: 14px 15px;
  font-size: 13.5px;
  color: #1e293b;
  border-bottom: 1px solid var(--border-row);
  vertical-align: middle;
}

.payments-table tbody tr:last-child td {
  border-bottom: none;
}

.payments-table tbody tr:hover {
  background: #f8fafc;
}

.col-date {
  white-space: nowrap;
  color: #334155;
  font-variant-numeric: tabular-nums;
}

.date-sub {
  display: block;
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}

.col-from {
  white-space: nowrap;
  color: #334155;
}

.provider-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 99px;
  margin-left: 6px;
  vertical-align: middle;
}

.provider-pill.gmail {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.provider-pill.outlook {
  background: #eff6ff;
  color: #0284c7;
  border: 1px solid #bfdbfe;
}

.sender-highlight {
  background: #e2e8f0;
  padding: 2px 5px;
  border-radius: 4px;
  font-weight: 600;
}

.col-amount {
  font-weight: 700;
  color: var(--chime-green);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Verification Badge */
.verify-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5.5px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
}

.verify-btn.verified {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.verify-btn.unverified {
  background: #f8fafc;
  color: #475569;
  border-color: #cbd5e1;
}

.verify-btn.unverified:hover {
  background: var(--navy-900);
  color: #ffffff;
  border-color: var(--navy-900);
}

/* Right Sidebar & Section Cards */
.sidebar-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.side-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(226, 232, 240, 0.85);
  padding: 22px;
  min-width: 0;
}

.side-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy-900);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.side-card-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* Verify Form Result Box */
.verify-results {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.verify-match-item {
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 11px 13px;
  background: #f8fafc;
  font-size: 13px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.verify-match-item:hover {
  border-color: #cbd5e1;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.04);
}

.verify-match-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  margin-bottom: 3px;
}

/* Connected Mailboxes List */
.mailbox-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mailbox-item {
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 11px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #fcfdfe;
}

.mailbox-email {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  word-break: break-all;
}

.mailbox-meta {
  font-size: 11.5px;
  color: var(--text-muted);
}

/* Progress Bar */
.bar-track {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 99px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #00875a 0%, #10b981 100%);
  border-radius: 99px;
}

/* Alerts / Flash Banners */
.alert {
  padding: 13px 16px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 13.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.alert-success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.alert-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 20, 38, 0.62);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-dialog {
  background: #ffffff;
  border-radius: var(--radius-xl);
  max-width: 600px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  padding: 26px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--navy-900);
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
}

.code-uri {
  display: block;
  background: #f1f5f9;
  padding: 8px 11px;
  border-radius: 6px;
  font-family: monospace;
  font-size: 12.5px;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  margin-top: 4px;
  word-break: break-all;
}

/* ==================== COMPREHENSIVE MOBILE & TABLET RESPONSIVENESS ==================== */
@media (max-width: 1140px) {
  .layout-grid-2col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1024px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
}

@media (max-width: 960px) {
  .app-sidebar {
    transform: translateX(-100%);
    width: 280px;
  }
  .app-sidebar.open {
    transform: translateX(0);
  }
  .sidebar-close-btn {
    display: inline-flex;
  }
  .sidebar-overlay.open {
    display: block;
  }
  .app-main {
    margin-left: 0;
    width: 100%;
  }
  .mobile-menu-btn {
    display: inline-flex;
  }
  .mobile-bottom-nav {
    display: flex;
  }
  .topbar-inner {
    padding: 11px 16px;
  }
  .content-body {
    padding: 18px 16px 96px;
  }
}

@media (max-width: 768px) {
  .filter-grid {
    grid-template-columns: 1fr 1fr;
  }
  .total-banner {
    padding: 18px 18px;
    gap: 14px;
  }
  .total-banner-amount {
    font-size: 28px;
  }
  .total-banner-stats {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .stat-chip {
    min-width: 0;
    padding: 8px 11px;
  }
  .payments-sheet {
    padding: 18px 15px;
    border-radius: 14px;
  }
  .side-card {
    padding: 16px 15px;
    border-radius: 14px;
  }
  .sheet-title {
    font-size: 22px;
  }
  .sheet-subtitle {
    font-size: 13px;
  }
  /* Automatically make any inline 2-column or auto-fit grids stack cleanly on mobile */
  div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
  form[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 540px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .kpi-card {
    padding: 14px 14px;
  }
  .kpi-value {
    font-size: 19px;
  }
  .kpi-label {
    font-size: 11px;
  }
  .kpi-sub {
    font-size: 11px;
  }
  .filter-grid {
    grid-template-columns: 1fr;
  }
  .topbar-inner {
    padding: 10px 12px;
    gap: 10px;
  }
  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }
  .topbar-actions .btn {
    flex: 1;
    justify-content: center;
    padding: 8px 10px;
    font-size: 12px;
  }
  .page-Select-heading {
    font-size: 15px;
  }
  .payments-table th,
  .payments-table td {
    padding: 10px 11px;
    font-size: 12.5px;
  }
  .modal-backdrop {
    padding: 10px;
  }
  .modal-dialog {
    padding: 18px 16px;
    border-radius: 15px;
  }
}

@media print {
  .app-sidebar,
  .topbar,
  .filter-bar,
  .sidebar-stack,
  .bulk-bar,
  .btn,
  .mobile-bottom-nav,
  .modal-backdrop {
    display: none !important;
  }
  .app-main {
    margin-left: 0 !important;
    width: 100% !important;
  }
  .layout-grid-2col {
    grid-template-columns: 1fr !important;
  }
  .payments-sheet {
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
  }
}

/* ==================== MODERN PREMIUM DARK MODE THEME ==================== */
:root.dark-mode,
html.dark-mode,
body.dark-mode {
  --bg-page: #070e1b;
  --bg-card: #0d1e36;
  --navy-950: #040810;
  --navy-900: #0b1a30;
  --navy-800: #122849;
  --navy-700: #1a355d;
  --text-main: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border-light: rgba(255, 255, 255, 0.09);
  --border-row: rgba(255, 255, 255, 0.06);
  --chime-green-bg: rgba(16, 185, 129, 0.16);
  --shadow-card: 0 16px 36px -10px rgba(0, 0, 0, 0.55), 0 4px 14px -2px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 20px 42px -10px rgba(0, 0, 0, 0.72), 0 6px 18px -3px rgba(0, 0, 0, 0.45);
}

body.dark-mode {
  background: radial-gradient(circle at 12% 0%, #0e223d 0%, #07101e 52%, #040812 100%) !important;
  color: #f1f5f9 !important;
}

/* Topbar Dark */
body.dark-mode .topbar {
  background: rgba(10, 21, 38, 0.94) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09) !important;
}

body.dark-mode .page-Select-heading {
  color: #ffffff !important;
}

body.dark-mode .mobile-menu-btn {
  background: #10243e !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
}

/* Cards & Sheets Dark */
body.dark-mode .payments-sheet,
body.dark-mode .side-card,
body.dark-mode .kpi-card:not(.navy),
body.dark-mode .modal-dialog {
  background: #0d1e36 !important;
  border-color: rgba(255, 255, 255, 0.09) !important;
  color: #f1f5f9 !important;
}

body.dark-mode .sheet-title,
body.dark-mode .side-card-title,
body.dark-mode .modal-title,
body.dark-mode .kpi-value {
  color: #ffffff !important;
}

body.dark-mode .sheet-subtitle,
body.dark-mode .side-card-desc,
body.dark-mode .kpi-label,
body.dark-mode .kpi-sub {
  color: #94a3b8 !important;
}

/* Table Dark */
body.dark-mode .table-wrapper {
  background: #091527 !important;
  border-color: rgba(255, 255, 255, 0.09) !important;
}

body.dark-mode .payments-table th {
  background: #0b1a30 !important;
  color: #94a3b8 !important;
  border-bottom-color: rgba(255, 255, 255, 0.09) !important;
}

body.dark-mode .payments-table td {
  color: #e2e8f0 !important;
  border-bottom-color: rgba(255, 255, 255, 0.06) !important;
}

body.dark-mode .payments-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.04) !important;
}

body.dark-mode .col-date,
body.dark-mode .col-from {
  color: #cbd5e1 !important;
}

body.dark-mode .date-sub {
  color: #94a3b8 !important;
}

/* Filter Bar & Inputs Dark */
body.dark-mode .filter-bar {
  background: #0a172a !important;
  border-color: rgba(255, 255, 255, 0.09) !important;
}

body.dark-mode .field-group label {
  color: #cbd5e1 !important;
}

body.dark-mode .input-control,
body.dark-mode select.input-control,
body.dark-mode input.input-control,
body.dark-mode textarea.input-control {
  background: #071222 !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  color: #f8fafc !important;
}

body.dark-mode .input-control:focus {
  border-color: #10b981 !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22) !important;
}

body.dark-mode .input-control::placeholder {
  color: #64748b !important;
}

body.dark-mode .preset-row {
  border-top-color: rgba(255, 255, 255, 0.09) !important;
}

body.dark-mode .preset-pill {
  background: #0f233d !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #cbd5e1 !important;
}

body.dark-mode .preset-pill:hover,
body.dark-mode .preset-pill.active {
  background: #10b981 !important;
  border-color: #10b981 !important;
  color: #ffffff !important;
}

/* Buttons & Chips in Dark Mode */
body.dark-mode .btn-outline {
  background: #0f243f !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  color: #e2e8f0 !important;
}

body.dark-mode .btn-outline:hover {
  background: #153257 !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
  color: #ffffff !important;
}

body.dark-mode .btn-gmail {
  background: #12243d !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  color: #f1f5f9 !important;
}

body.dark-mode .chip {
  background: #0e223d !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  color: #cbd5e1 !important;
}

body.dark-mode .chip:hover {
  background: #059669 !important;
  color: #ffffff !important;
  border-color: #10b981 !important;
}

body.dark-mode .verify-btn.unverified {
  background: #0e223d !important;
  color: #cbd5e1 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

body.dark-mode .verify-btn.unverified:hover {
  background: #10b981 !important;
  color: #ffffff !important;
  border-color: #10b981 !important;
}

body.dark-mode .verify-match-item {
  background: #071324 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: #cbd5e1 !important;
}

body.dark-mode .mailbox-item {
  background: #09172b !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode .mailbox-email {
  color: #f1f5f9 !important;
}

body.dark-mode .sender-highlight {
  background: rgba(255, 255, 255, 0.14) !important;
  color: #34d399 !important;
}

body.dark-mode .code-uri {
  background: #071222 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #38bdf8 !important;
}

body.dark-mode .close-btn {
  color: #94a3b8 !important;
}

body.dark-mode .close-btn:hover {
  color: #ffffff !important;
}

/* Chime Cards in Dark Mode */
body.dark-mode .chime-card {
  background: #0d1e36 !important;
  border-color: rgba(255, 255, 255, 0.09) !important;
  color: #f1f5f9 !important;
}

body.dark-mode .chime-card.is-suspended {
  background: #111a28 !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
}

body.dark-mode .chime-copy {
  background: #0f243f !important;
  color: #34d399 !important;
  border-color: rgba(52, 211, 153, 0.3) !important;
}

body.dark-mode .chime-copy:hover {
  background: #10b981 !important;
  color: #ffffff !important;
}

/* Theme Toggle Button Specific Styling */
.theme-toggle-btn {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #cbd5e1;
  color: #0f172a;
  border-radius: 999px;
  padding: 6.5px 13px;
  font-weight: 700;
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.theme-toggle-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

body.dark-mode .theme-toggle-btn {
  background: #112644 !important;
  border-color: rgba(255, 255, 255, 0.16) !important;
  color: #fbbf24 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

body.dark-mode .theme-toggle-btn:hover {
  background: #17335c !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
  color: #fef08a !important;
}

/* Direct inline overrides for dark mode consistency */
body.dark-mode [style*="background:#ffffff"],
body.dark-mode [style*="background:#fff"],
body.dark-mode [style*="background: #ffffff"],
body.dark-mode [style*="background: #fff"],
body.dark-mode [style*="background:#f8fafc"],
body.dark-mode [style*="background: #f8fafc"] {
  background: #0d1e36 !important;
  border-color: rgba(255, 255, 255, 0.09) !important;
  color: #f1f5f9 !important;
}

body.dark-mode [style*="background:#f1f5f9"],
body.dark-mode [style*="background: #f1f5f9"] {
  background: #091527 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode [style*="color:#0f172a"],
body.dark-mode [style*="color: #0f172a"],
body.dark-mode [style*="color:#0d1e36"],
body.dark-mode [style*="color: #0d1e36"],
body.dark-mode [style*="color:#1e293b"],
body.dark-mode [style*="color: #1e293b"],
body.dark-mode [style*="color:#334155"],
body.dark-mode [style*="color: #334155"] {
  color: #f1f5f9 !important;
}

body.dark-mode [style*="color:#64748b"],
body.dark-mode [style*="color: #64748b"],
body.dark-mode [style*="color:#475569"],
body.dark-mode [style*="color: #475569"] {
  color: #94a3b8 !important;
}

/* Polished Dark Mode Tint Overrides for Status & Metric Chips */
body.dark-mode [style*="background:#f0fdf4"],
body.dark-mode [style*="background: #f0fdf4"] {
  background: rgba(16, 185, 129, 0.12) !important;
  border-color: rgba(52, 211, 153, 0.25) !important;
}

body.dark-mode [style*="background:#ecfdf5"],
body.dark-mode [style*="background: #ecfdf5"] {
  background: rgba(16, 185, 129, 0.18) !important;
  border-color: rgba(52, 211, 153, 0.35) !important;
  color: #34d399 !important;
}

body.dark-mode [style*="background:#eff6ff"],
body.dark-mode [style*="background: #eff6ff"] {
  background: rgba(14, 165, 233, 0.18) !important;
  border-color: rgba(56, 189, 248, 0.35) !important;
  color: #38bdf8 !important;
}

body.dark-mode [style*="background:#fefce8"],
body.dark-mode [style*="background: #fefce8"] {
  background: rgba(245, 158, 11, 0.18) !important;
  border-color: rgba(251, 191, 36, 0.35) !important;
  color: #fbbf24 !important;
}

/* ==================== PREMIUM LIVE SUPPORT CHAT WIDGET ==================== */
.live-chat-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 95;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid rgba(52, 211, 153, 0.45);
  background: linear-gradient(135deg, #0b1a30 0%, #064e3b 100%);
  color: #ffffff;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 14px 32px rgba(6, 78, 59, 0.42), 0 4px 12px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s ease;
}

.live-chat-fab:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 18px 38px rgba(16, 185, 129, 0.45), 0 6px 16px rgba(0, 0, 0, 0.4);
}

.live-chat-fab:active {
  transform: scale(0.97);
}

.live-chat-fab-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7);
  animation: chatPulse 2s infinite;
  flex-shrink: 0;
}

@keyframes chatPulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.75); }
  70% { box-shadow: 0 0 0 9px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.live-chat-badge {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 21px;
  height: 21px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ef4444;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.55);
}

.live-chat-badge.visible {
  display: inline-flex;
}

.live-chat-popup {
  position: fixed;
  right: 24px;
  bottom: 88px;
  z-index: 96;
  width: 390px;
  max-width: calc(100vw - 24px);
  height: 550px;
  max-height: calc(100vh - 115px);
  background: #ffffff;
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 20px;
  box-shadow: 0 26px 64px -12px rgba(6, 16, 30, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.08);
  overflow: hidden;
  opacity: 0;
  transform: translateY(18px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.live-chat-popup.is-admin {
  width: 730px;
}

.live-chat-popup.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

body.dark-mode .live-chat-popup {
  background: #0a172a !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 28px 70px -10px rgba(0, 0, 0, 0.78), 0 0 0 1px rgba(52, 211, 153, 0.15) !important;
}

.chat-shell {
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.chat-sidebar {
  width: 245px;
  flex-shrink: 0;
  border-right: 1px solid #e2e8f0;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

body.dark-mode .chat-sidebar {
  background: #071120 !important;
  border-right-color: rgba(255, 255, 255, 0.08) !important;
}

.chat-sidebar-head {
  padding: 13px 12px 10px;
  border-bottom: 1px solid #e2e8f0;
}

body.dark-mode .chat-sidebar-head {
  border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

.chat-sidebar-title {
  font-size: 12.5px;
  font-weight: 800;
  color: #0f172a;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

body.dark-mode .chat-sidebar-title {
  color: #cbd5e1 !important;
}

.chat-search-input {
  width: 100%;
  padding: 7px 10px;
  border-radius: 9px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  font-size: 12px;
  color: #0f172a;
  font-family: inherit;
  outline: none;
}

body.dark-mode .chat-search-input {
  background: #0d1e36 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #f1f5f9 !important;
}

.chat-conv-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-conv-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 11px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
  text-align: left;
  background: transparent;
  width: 100%;
  font-family: inherit;
}

.chat-conv-item:hover {
  background: rgba(15, 23, 42, 0.05);
}

body.dark-mode .chat-conv-item:hover {
  background: rgba(255, 255, 255, 0.05) !important;
}

.chat-conv-item.active {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
}

.chat-conv-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
  flex-shrink: 0;
}

.chat-conv-avatar.merchant {
  background: linear-gradient(135deg, #059669, #047857);
}

.chat-conv-avatar.sub_user {
  background: linear-gradient(135deg, #0284c7, #1d4ed8);
}

.chat-conv-info {
  flex: 1;
  min-width: 0;
}

.chat-conv-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.chat-conv-name {
  font-size: 12.5px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.dark-mode .chat-conv-name {
  color: #f1f5f9 !important;
}

.chat-conv-role {
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 99px;
  flex-shrink: 0;
}

.chat-conv-role.merchant {
  background: rgba(16, 185, 129, 0.16);
  color: #10b981;
}

.chat-conv-role.sub_user {
  background: rgba(56, 189, 248, 0.16);
  color: #38bdf8;
}

.chat-conv-preview {
  font-size: 11px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

body.dark-mode .chat-conv-preview {
  color: #94a3b8 !important;
}

.chat-conv-unread {
  background: #ef4444;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.chat-header {
  background: linear-gradient(135deg, #0b192e 0%, #0d2b3e 55%, #064e3b 100%);
  color: #ffffff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  flex-shrink: 0;
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.chat-header-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  position: relative;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.35);
}

.chat-header-avatar::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #34d399;
  border: 2px solid #0b192e;
}

.chat-header-title {
  font-size: 14.5px;
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-header-sub {
  font-size: 11px;
  color: #a7f3d0;
  font-weight: 500;
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.chat-icon-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #ffffff;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  transition: background 0.15s ease;
}

.chat-icon-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

.chat-back-btn {
  display: none;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f8fafc;
}

body.dark-mode .chat-messages {
  background: radial-gradient(circle at top right, rgba(16, 185, 129, 0.06), transparent 55%), #081222 !important;
}

.chat-empty-state {
  margin: auto;
  text-align: center;
  padding: 20px 14px;
  max-width: 280px;
}

.chat-empty-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 10px;
  border-radius: 14px;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.chat-empty-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
}

body.dark-mode .chat-empty-title {
  color: #f1f5f9 !important;
}

.chat-empty-desc {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 12px;
}

body.dark-mode .chat-empty-desc {
  color: #94a3b8 !important;
}

.chat-quick-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.chat-msg-row {
  display: flex;
  flex-direction: column;
  max-width: 82%;
}

.chat-msg-row.mine {
  align-self: flex-end;
  align-items: flex-end;
}

.chat-msg-row.theirs {
  align-self: flex-start;
  align-items: flex-start;
}

.chat-bubble {
  padding: 9px 13px;
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
  white-space: pre-wrap;
}

.chat-msg-row.mine .chat-bubble {
  background: linear-gradient(135deg, #00875a 0%, #059669 100%);
  color: #ffffff;
  border-radius: 15px 15px 4px 15px;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
}

.chat-msg-row.theirs .chat-bubble {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  border-radius: 15px 15px 15px 4px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

body.dark-mode .chat-msg-row.theirs .chat-bubble {
  background: #132744 !important;
  color: #f1f5f9 !important;
  border-color: rgba(255, 255, 255, 0.09) !important;
}

.chat-img-attach {
  display: block;
  max-width: 210px;
  max-height: 180px;
  border-radius: 10px;
  margin-bottom: 6px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.2);
  object-fit: cover;
}

.chat-meta {
  font-size: 10px;
  color: #64748b;
  margin-top: 3px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

body.dark-mode .chat-meta {
  color: #94a3b8 !important;
}

.chat-read-tick {
  color: #10b981;
  font-weight: 700;
}

.chat-attach-preview {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(16, 185, 129, 0.12);
  border-top: 1px solid rgba(16, 185, 129, 0.25);
  font-size: 11.5px;
  color: #047857;
  font-weight: 600;
}

body.dark-mode .chat-attach-preview {
  color: #34d399 !important;
}

.chat-attach-preview.visible {
  display: flex;
}

.chat-footer {
  padding: 10px 12px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

body.dark-mode .chat-footer {
  background: #0b192e !important;
  border-top-color: rgba(255, 255, 255, 0.09) !important;
}

.chat-attach-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.chat-attach-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

body.dark-mode .chat-attach-btn {
  background: #132744 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #cbd5e1 !important;
}

body.dark-mode .chat-attach-btn:hover {
  background: #1a355d !important;
  color: #ffffff !important;
}

.chat-input {
  flex: 1;
  padding: 9px 13px;
  border-radius: 11px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #0f172a;
  font-family: inherit;
  font-size: 13px;
  outline: none;
  min-width: 0;
}

.chat-input:focus {
  border-color: #10b981;
  background: #ffffff;
}

body.dark-mode .chat-input {
  background: #071222 !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  color: #f8fafc !important;
}

body.dark-mode .chat-input:focus {
  border-color: #10b981 !important;
}

.chat-send-btn {
  background: linear-gradient(135deg, #00875a 0%, #10b981 100%);
  border: none;
  color: #ffffff;
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.chat-send-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.chat-send-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

@media (max-width: 960px) {
  .live-chat-fab {
    right: 14px;
    bottom: 72px;
    padding: 10px 14px;
    font-size: 12.5px;
  }
  .live-chat-popup {
    right: 12px;
    bottom: 124px;
    max-height: calc(100vh - 145px);
  }
}

@media (max-width: 680px) {
  .live-chat-popup.is-admin {
    width: calc(100vw - 20px);
    right: 10px;
  }
  .live-chat-popup.is-admin .chat-sidebar {
    width: 100%;
  }
  .live-chat-popup.is-admin.mobile-thread-open .chat-sidebar {
    display: none;
  }
  .live-chat-popup.is-admin:not(.mobile-thread-open) .chat-main {
    display: none;
  }
  .live-chat-popup.is-admin .chat-back-btn {
    display: inline-flex;
  }
}

/* ==================== PREMIUM VOICE CALL OVERLAY ==================== */
.chat-call-trigger {
  background: rgba(16, 185, 129, 0.28) !important;
  border-color: rgba(52, 211, 153, 0.48) !important;
  color: #a7f3d0 !important;
}

.chat-call-trigger:hover {
  background: #10b981 !important;
  color: #ffffff !important;
}

.live-call-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: linear-gradient(160deg, rgba(8, 19, 36, 0.96) 0%, rgba(6, 78, 59, 0.95) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  text-align: center;
  color: #ffffff;
}

.live-call-overlay.active {
  display: flex;
  animation: callFadeIn 0.22s ease;
}

@keyframes callFadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.call-pulse-ring {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.call-pulse-ring::before,
.call-pulse-ring::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid rgba(52, 211, 153, 0.55);
  animation: callRipple 1.8s infinite ease-out;
}

.call-pulse-ring::after {
  animation-delay: 0.9s;
}

@keyframes callRipple {
  0% { transform: scale(0.92); opacity: 0.9; }
  100% { transform: scale(1.42); opacity: 0; }
}

.call-peer-avatar {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  font-size: 32px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 28px rgba(16, 185, 129, 0.45);
  position: relative;
  z-index: 2;
}

.call-peer-name {
  font-size: 19px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 4px;
}

.call-status-text {
  font-size: 13px;
  font-weight: 600;
  color: #a7f3d0;
  margin-bottom: 28px;
  letter-spacing: 0.02em;
}

.call-actions-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.call-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  border: none;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
  cursor: pointer;
  transition: transform 0.16s ease, filter 0.16s ease;
}

.call-action-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.call-accept {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 8px 22px rgba(16, 185, 129, 0.45);
}

.call-end {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 8px 22px rgba(239, 68, 68, 0.45);
}

.call-mute {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.call-mute.muted {
  background: #f59e0b;
  color: #0b192e;
  border-color: #fbbf24;
}




