/* ==========================================================================
   Universal Address Resolution Platform — Client Design System (main.css)
   Full parity with Central Server Design System + Mobile-First Enhancements
   ========================================================================== */

:root {
  /* ==========================================================================
     Black + Blue + White Premium Design System Tokens (Client)
     ========================================================================== */

  /* Surface Colors */
  --bg-deep: #050505;
  --bg-app: #08090B;
  --surface: #0D1014;
  --surface-secondary: #12161C;
  --surface-hover: #171C23;
  --surface-elevated: #171C23;
  --border: #222933;
  --border-color: #222933;
  --border-focus: #1677FF;

  /* Blue Accent Colors */
  --primary-50: rgba(22, 119, 255, 0.08);
  --primary-100: rgba(22, 119, 255, 0.15);
  --primary-200: #85b8ff;
  --primary-300: #4797ff;
  --primary-400: #2388FF;
  --primary-500: #1677FF;
  --primary-600: #1677FF;
  --primary-700: #0D5FD7;
  --primary-800: #0a469e;
  --primary-900: #083475;

  --primary-blue: #1677FF;
  --bright-blue: #2388FF;
  --dark-blue: #0D5FD7;
  --brand-accent: #FBBF24;

  /* Secondary Accents (Controlled & Subtle) */
  --teal-500: #14b8a6;
  --teal-600: #0d9488;
  --cyan-500: #06b6d4;
  --indigo-500: #6366f1;
  --indigo-600: #4f46e5;
  --purple-500: #8b5cf6;

  /* Status Colors (Visually Restrained) */
  --success-50: rgba(22, 163, 74, 0.12);
  --success-100: rgba(22, 163, 74, 0.2);
  --success-500: #16a34a;
  --success-600: #15803d;

  --warning-50: rgba(217, 119, 6, 0.12);
  --warning-100: rgba(217, 119, 6, 0.2);
  --warning-500: #d97706;
  --warning-600: #b45309;

  --error-50: rgba(220, 38, 38, 0.12);
  --error-100: rgba(220, 38, 38, 0.2);
  --error-500: #dc2626;
  --error-600: #b91c1c;

  /* Typography Colors */
  --text-white: #FFFFFF;
  --text-primary: #F5F7FA;
  --text-main: #F5F7FA;
  --text-secondary: #A7AFBA;
  --text-muted: #707985;

  /* Gradients & Shadows */
  --hero-gradient: linear-gradient(135deg, #1677FF 0%, #2388FF 100%);
  --card-gradient: #0D1014;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 12px 0 rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 10px 24px -3px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 20px 30px -5px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 18px 0 rgba(22, 119, 255, 0.25);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Fonts */
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Dark & Default Theme System */
:root,
[data-theme="dark"] {
  --bg-deep: #050505;
  --bg-app: #08090B;
  --surface: #0D1014;
  --surface-secondary: #12161C;
  --surface-hover: #171C23;
  --surface-elevated: #171C23;
  --border: #222933;
  --border-color: #222933;
  --border-focus: #1677FF;
  --text-white: #FFFFFF;
  --text-primary: #F5F7FA;
  --text-main: #F5F7FA;
  --text-secondary: #A7AFBA;
  --text-muted: #707985;
  --card-gradient: #0D1014;
  --footer-bg: #08090B;
  --input-bg: #0D1014;
  --input-border: #222933;
  --input-text: #F5F7FA;
  --table-header-bg: #0D1014;
  --table-row-hover: #12161C;
  --brand-accent: #FBBF24;
}

/* Light Theme System (Preserves Blue Accent Discipline) */
[data-theme="light"] {
  --bg-deep: #EEF2F6;
  --bg-app: #F8FAFC;
  --surface: #FFFFFF;
  --surface-secondary: #F1F5F9;
  --surface-hover: #E2E8F0;
  --surface-elevated: #FFFFFF;
  --border: #E2E8F0;
  --border-color: #E2E8F0;
  --border-focus: #1677FF;
  --text-white: #0F172A;
  --text-primary: #0F172A;
  --text-main: #0F172A;
  --text-secondary: #475569;
  --text-muted: #64748B;
  --brand-accent: #D97706;
  --card-gradient: #FFFFFF;
  --footer-bg: #F1F5F9;
  --input-bg: #FFFFFF;
  --input-border: #CBD5E1;
  --input-text: #0F172A;
  --table-header-bg: #F8FAFC;
  --table-row-hover: #F1F5F9;
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 14px 0 rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 30px -5px rgba(0, 0, 0, 0.12);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-left: max(0px, env(safe-area-inset-left));
  padding-right: max(0px, env(safe-area-inset-right));
  padding-bottom: max(0px, env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--primary-600);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-700);
}

/* Desktop Navigation Header */
header.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.02em;
  cursor: pointer;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: transparent;
  box-shadow: none;
}

.brand-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.brand-title {
  line-height: 1.1;
  color: var(--text-primary);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.02em;
}

.brand-title .brand-highlight {
  color: var(--brand-accent, #FBBF24);
}

.brand-subtitle {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: -0.01em;
  margin-top: 2px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.nav-btn:hover {
  color: var(--primary-600);
  background: var(--surface-secondary);
}

.nav-btn.active {
  color: var(--primary-600);
  background: var(--primary-50);
  border-color: var(--primary-200);
}

[data-theme="dark"] .nav-btn.active {
  color: var(--primary-400);
  background: rgba(56, 139, 253, 0.15);
  border-color: rgba(56, 139, 253, 0.3);
}

.nav-btn-cta {
  background: var(--primary-600) !important;
  color: #ffffff !important;
  border-color: var(--primary-600) !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.nav-btn-cta:hover {
  background: var(--primary-700) !important;
  color: #ffffff !important;
  transform: translateY(-1px);
}

/* Mobile Nav Toggle */
.mobile-nav-toggle {
  display: none;
  background: var(--surface-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mobile-nav-toggle:hover {
  background: var(--surface-hover);
  border-color: var(--primary-400);
}

/* Mobile Nav Drawer */
.mobile-nav-drawer {
  background: var(--surface);
  border-bottom: 2px solid var(--border);
  box-shadow: var(--shadow-lg);
  position: sticky;
  top: 61px;
  z-index: 99;
  animation: slideDownNav 0.2s ease-out;
}

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

.mobile-drawer-inner {
  padding: 18px 24px 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  max-width: 960px;
  margin: 0 auto;
}

.mobile-drawer-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mobile-drawer-heading {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.mobile-drawer-link {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  background: var(--surface-secondary);
  border: none;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.mobile-drawer-link:hover {
  background: var(--primary-50);
  color: var(--primary-600);
}

[data-theme="dark"] .mobile-drawer-link:hover {
  background: rgba(56, 139, 253, 0.15);
  color: var(--primary-400);
}

.mobile-drawer-link.active {
  background: var(--primary-100);
  color: var(--primary-700);
  font-weight: 700;
}

[data-theme="dark"] .mobile-drawer-link.active {
  background: rgba(56, 139, 253, 0.25);
  color: var(--primary-400);
}

.mobile-drawer-link.cta {
  background: var(--primary-600);
  color: #fff;
  font-weight: 700;
}

.mobile-drawer-link.cta:hover {
  background: var(--primary-700);
  color: #fff;
}

/* Status Pill */
.status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-family: var(--font-mono);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: var(--surface-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  transition: all 0.25s ease;
}

.status-pill.offline {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
}

.server-status-dot-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-secondary);
  border: 1px solid var(--border);
  transition: all 0.25s ease;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--warning-500);
  transition: background 0.3s ease, box-shadow 0.3s ease;
  display: inline-block;
}

.status-dot.online {
  background: #22c55e;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.8);
}

.status-dot.offline {
  background: #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.8);
}

.theme-toggle-btn {
  background: var(--surface-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
  background: var(--surface-hover);
}

.theme-toggle-btn .theme-icon-sun {
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle-btn .theme-icon-moon {
  display: none;
  align-items: center;
  justify-content: center;
}

[data-theme="light"] .theme-toggle-btn .theme-icon-sun {
  display: none !important;
}

[data-theme="light"] .theme-toggle-btn .theme-icon-moon {
  display: flex !important;
}

/* Fallback Outage Alert Banner (Sticky Warning) */
#fallback-banner {
  display: none;
  background: #171012;
  border-bottom: 1px solid #7f1d1d;
  color: #fca5a5;
  padding: 12px 24px;
  font-size: 13.5px;
  font-weight: 600;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 61px;
  z-index: 95;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

[data-theme="light"] #fallback-banner {
  background: #fee2e2;
  border-bottom-color: #f87171;
  color: #991b1b;
}

[data-theme="light"] .status-pill.offline {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #b91c1c;
}

/* Main Content Layout */
main.app-main {
  flex: 1;
  max-width: 1160px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 20px 100px;
}

.view-section {
  display: none;
}

.view-section.active {
  display: block;
  animation: fadeIn 0.25s ease-out;
}

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

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.card-header {
  margin-bottom: 20px;
}

.card-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.card-desc {
  color: var(--text-secondary);
  font-size: 14.5px;
  line-height: 1.6;
}

/* Hero Section */
.hero-section {
  text-align: center;
  padding: 30px 0 24px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-50);
  color: var(--primary-700);
  padding: 7px 18px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 18px;
  border: 1px solid var(--primary-200);
}

[data-theme="dark"] .hero-badge {
  background: rgba(37, 99, 235, 0.15);
  color: var(--primary-400);
  border-color: rgba(37, 99, 235, 0.3);
}

.hero-title {
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.15;
  margin-bottom: 18px;
  color: var(--text-primary);
}

.hero-gradient {
  background: var(--hero-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 17.5px;
  color: var(--text-secondary);
  max-width: 680px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

/* Hero Distinguished Value Pillars (Lookable & Beautiful) */
.hero-pillars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 20px;
  max-width: 1080px;
  margin: 28px auto 38px;
  text-align: left;
}

.hero-pillar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  position: relative;
  overflow: hidden;
}

[data-theme="dark"] .hero-pillar-card {
  background: #0E1218;
  border-color: #1F2733;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
}

[data-theme="light"] .hero-pillar-card {
  background: #FFFFFF;
  border-color: #E2E8F0;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.05);
}

.hero-pillar-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary-600, #1677FF);
  box-shadow: 0 10px 30px rgba(22, 119, 255, 0.15);
}

.pillar-top-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.pillar-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pillar-icon-box.pillar-privacy {
  background: rgba(139, 92, 246, 0.12);
  color: #A78BFA;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.pillar-icon-box.pillar-permanent {
  background: rgba(22, 119, 255, 0.12);
  color: #2388FF;
  border: 1px solid rgba(22, 119, 255, 0.3);
}

.pillar-icon-box.pillar-delivery {
  background: rgba(16, 185, 129, 0.12);
  color: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.pillar-badge {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-block;
}

.pillar-badge.badge-privacy {
  background: rgba(139, 92, 246, 0.15);
  color: #A78BFA;
}

.pillar-badge.badge-permanent {
  background: rgba(22, 119, 255, 0.15);
  color: #2388FF;
}

.pillar-badge.badge-delivery {
  background: rgba(16, 185, 129, 0.15);
  color: #10B981;
}

.pillar-title {
  font-size: 17.5px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 8px;
  line-height: 1.3;
}

.pillar-desc {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

.pillar-desc strong {
  color: var(--text-primary);
}

/* Contact Person & Phone Field Styling */
.phone-toggle-box {
  transition: border-color 0.2s ease, background 0.2s ease;
}

.phone-toggle-box.active {
  border-color: rgba(22, 119, 255, 0.4);
  background: rgba(22, 119, 255, 0.03);
}

.btn-contact-call {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #1677FF;
  color: #FFFFFF;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-contact-call:hover {
  background: #2388FF;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(22, 119, 255, 0.3);
}

/* Search Box / Quick Resolver Interactive Bar */
.search-box {
  width: 100%;
  max-width: 580px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  background: var(--surface);
  padding: 5px 6px 5px 14px;
  border-radius: var(--radius-full, 9999px);
  border: 2px solid var(--border);
  box-shadow: var(--shadow-md);
  transition: border-color 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
  position: relative;
}

[data-theme="dark"] .search-box {
  border-color: #222933;
  background: #0D1014;
}

.search-box:focus-within {
  border-color: var(--primary-600, #1677FF);
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.16);
}

.search-box-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-600, #1677FF);
  flex-shrink: 0;
  margin-right: 8px;
}

.search-input {
  flex: 1 1 auto;
  min-width: 0; /* Prevents input from forcing overflow on narrow mobile screens */
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 16px; /* Prevents auto-zoom in iOS Safari */
  font-weight: 700;
  color: var(--text-primary);
  text-transform: lowercase;
  padding: 10px 8px 10px 0;
  line-height: normal;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.search-input::placeholder {
  font-family: var(--font-sans);
  font-weight: 500;
  color: var(--text-muted);
  text-transform: none;
  font-size: 14.5px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

#btn-resolve {
  flex-shrink: 0; /* Prevents button from shrinking or deforming */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  min-height: 44px;
  padding: 0 22px;
  border-radius: var(--radius-full, 9999px);
  font-size: 14.5px;
  font-weight: 700;
  background: var(--primary-600, #1677FF);
  color: #FFFFFF !important;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(22, 119, 255, 0.35);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  margin-left: auto;
  box-sizing: border-box;
}

#btn-resolve:hover:not(:disabled) {
  background: var(--bright-blue, #2388FF);
  box-shadow: 0 6px 18px rgba(22, 119, 255, 0.45);
  transform: translateY(-1px);
}

#btn-resolve:active:not(:disabled) {
  transform: scale(0.98);
}

#btn-resolve:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}


/* Quick Chips */
.chip-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.chip {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-size: 12.5px;
  font-family: var(--font-mono);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.chip:hover {
  color: var(--primary-600);
  border-color: var(--primary-500);
  background: var(--primary-50);
}

[data-theme="dark"] .chip:hover {
  background: rgba(37, 99, 235, 0.15);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  line-height: 1.25;
  text-decoration: none;
}

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

.btn-primary {
  background: var(--primary-600);
  color: white;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
  background: var(--primary-700);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.5);
  color: white;
}

.btn-gradient {
  background: var(--hero-gradient);
  color: white;
  border: none;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.35);
}

.btn-gradient:hover {
  opacity: 0.95;
  box-shadow: var(--shadow-glow);
  color: white;
}

.btn-secondary {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--surface-secondary);
  border-color: var(--primary-400);
}

.btn-success {
  background: var(--success-600);
  color: white;
}

.btn-success:hover {
  background: #15803d;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 15.5px;
  border-radius: var(--radius-lg);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge-public { background: rgba(37, 99, 235, 0.1); color: var(--primary-600); }
.badge-active { background: rgba(34, 197, 94, 0.1); color: var(--success-600); }
.badge-inactive { background: rgba(148, 163, 184, 0.15); color: var(--text-muted); }
.badge-mono { font-family: var(--font-mono); font-size: 13.5px; }

/* Stat Icons */
.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.icon-blue { background: rgba(37, 99, 235, 0.1); color: var(--primary-600); }
.icon-teal { background: rgba(20, 184, 166, 0.1); color: var(--teal-500); }
.icon-green { background: rgba(34, 197, 94, 0.1); color: var(--success-500); }
.icon-orange { background: rgba(245, 158, 11, 0.1); color: var(--warning-500); }
.icon-purple { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }
.icon-indigo { background: rgba(99, 102, 241, 0.1); color: var(--indigo-500); }

/* Category & Reach Interactive Selection Cards */
.reach-card {
  border: 2px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.reach-card:hover {
  border-color: var(--primary-400);
}

.reach-card-active {
  border-color: var(--primary-600);
  background: rgba(37, 99, 235, 0.04);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

.reach-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.reach-icon {
  font-size: 26px;
}

.reach-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.reach-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.reach-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group.full {
  grid-column: 1 / -1;
}

label.form-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

input.form-control, select.form-control, textarea.form-control {
  width: 100%;
  padding: 11px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  font-size: 14.5px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input.form-control:focus, select.form-control:focus, textarea.form-control:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

/* Secret Edit ID Box */
.secret-box {
  background: var(--surface-secondary);
  border: 2px dashed var(--warning-500);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin: 18px 0;
}

.secret-label {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--warning-600);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.secret-value {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

/* Saved Addresses Grid */
.saved-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.saved-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  transition: transform 0.2s, border-color 0.2s;
}

.saved-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary-500);
  box-shadow: var(--shadow-md);
}

/* Mobile Bottom Navigation Bar */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 8px 12px max(14px, env(safe-area-inset-bottom));
  z-index: 100;
  justify-content: space-around;
  align-items: center;
  backdrop-filter: blur(16px);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .mobile-nav {
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  transition: color 0.2s, transform 0.1s;
}

.mobile-nav-item.active {
  color: var(--primary-600);
  font-weight: 700;
}

.mobile-nav-item svg {
  width: 22px;
  height: 22px;
}

/* Global Toast Notification */
.toast {
  position: fixed;
  bottom: 84px;
  right: 20px;
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary-600);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  display: none;
  font-weight: 700;
  font-size: 14px;
  z-index: 1000;
  animation: toastIn 0.2s ease-out;
}

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

/* Client Notification Popup Modal */
#client-notification-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1050;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.notif-popup-card {
  background: #12161C;
  border: 1px solid #222933;
  border-radius: 18px;
  max-width: 520px;
  width: 100%;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: notifPopupSlideIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes notifPopupSlideIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.notif-popup-header {
  padding: 18px 22px 14px;
  border-bottom: 1px solid #1C232D;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.notif-icon-badge {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.notif-icon-badge.maintenance {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.notif-icon-badge.announcement {
  background: rgba(22, 119, 255, 0.15);
  border: 1px solid rgba(22, 119, 255, 0.35);
}

.notif-icon-badge.critical {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.notif-icon-badge.warning {
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid rgba(234, 179, 8, 0.35);
}

.notif-icon-badge.info {
  background: rgba(14, 165, 233, 0.15);
  border: 1px solid rgba(14, 165, 233, 0.35);
}

.notif-pill {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
}

.notif-pill.maintenance {
  background: rgba(245, 158, 11, 0.12);
  color: #F59E0B;
}

.notif-pill.announcement {
  background: rgba(22, 119, 255, 0.12);
  color: #2388FF;
}

.notif-pill.critical {
  background: rgba(239, 68, 68, 0.12);
  color: #EF4444;
}

.notif-pill.warning {
  background: rgba(234, 179, 8, 0.12);
  color: #EAB308;
}

.notif-pill.info {
  background: rgba(14, 165, 233, 0.12);
  color: #38BDF8;
}

.notif-close-btn {
  background: #171C23;
  border: 1px solid #222933;
  color: #A7AFBA;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  transition: all 0.2s ease;
}

.notif-close-btn:hover {
  background: #222933;
  color: #FFFFFF;
}

.notif-popup-body {
  padding: 22px;
}

.notif-title {
  font-size: 20px;
  font-weight: 800;
  color: #F5F7FA;
  margin: 0 0 10px;
  line-height: 1.3;
}

.notif-message {
  font-size: 14px;
  color: #A7AFBA;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.notif-popup-footer {
  padding: 14px 22px;
  background: #0D1014;
  border-top: 1px solid #1C232D;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}


/* Responsive Rules */
@media (max-width: 1080px) {
  header.app-header .nav-links .nav-btn { display: none; }
  .mobile-nav-toggle { display: inline-flex !important; }
}

@media (max-width: 768px) {
  .status-pill { display: none !important; }
  .mobile-nav { display: flex; }
  main.app-main { padding: 18px 16px 110px; }
  .hero-title { font-size: 34px; }
  .hero-subtitle { font-size: 15px; }
  .form-grid { grid-template-columns: 1fr; }
  .card { padding: 18px; }
}

/* Mobile & Touch Viewport Rules for Search Box & Resolve Button */
@media (max-width: 560px) {
  .search-box {
    padding: 4px 4px 4px 12px;
    border-radius: var(--radius-full, 9999px);
    margin-bottom: 14px;
  }

  .search-box-icon {
    margin-right: 6px;
  }

  .search-box-icon svg {
    width: 20px;
    height: 20px;
  }

  .search-input {
    font-size: 15.5px;
    padding: 8px 6px 8px 0;
  }

  .search-input::placeholder {
    font-size: 13.5px;
  }

  #btn-resolve {
    height: 40px;
    min-height: 40px;
    padding: 0 16px;
    font-size: 13.5px;
    gap: 6px;
    border-radius: var(--radius-full, 9999px);
  }

  #btn-resolve .btn-resolve-icon,
  #btn-resolve svg {
    width: 14px;
    height: 14px;
  }
}

@media (max-width: 390px) {
  .search-box {
    padding: 4px 4px 4px 10px;
  }

  .search-box-icon {
    margin-right: 4px;
  }

  .search-box-icon svg {
    width: 18px;
    height: 18px;
  }

  .search-input {
    font-size: 14.5px;
  }

  .search-input::placeholder {
    font-size: 12.5px;
  }

  #btn-resolve {
    height: 38px;
    min-height: 38px;
    padding: 0 12px;
    font-size: 13px;
    gap: 4px;
  }

  #btn-resolve .btn-resolve-icon,
  #btn-resolve svg {
    width: 13px;
    height: 13px;
  }
}

