/* ==========================================================================
   Universal Address Resolution Platform - Design System & Modern CSS
   ========================================================================== */

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

  /* 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;

  /* 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;

  /* Spacing */
  --sidebar-width: 260px;
  --header-height: 64px;

  /* 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;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

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

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

/* Layout App Shell */
.app-container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  transition: transform 0.3s ease;
}

.sidebar-brand {
  height: var(--header-height);
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

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

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

.sidebar-brand-text {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

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

.sidebar-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 12px 12px 4px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.18s ease;
}

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

.sidebar-item.active {
  background: var(--primary-50);
  color: var(--primary-600);
  font-weight: 600;
}

[data-theme="dark"] .sidebar-item.active {
  background: var(--surface-secondary);
  color: var(--primary-400);
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Main Content Area */
.main-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.no-sidebar .main-wrapper {
  margin-left: 0;
  width: 100%;
}

/* Admin Interface Theme */
.sidebar {
  background: #08090B;
  border-right: 1px solid var(--border);
}

.sidebar-brand {
  border-bottom: 1px solid var(--border);
}

.sidebar-item {
  color: var(--text-secondary);
}

.sidebar-item:hover {
  background: var(--surface-secondary);
  color: var(--text-primary);
}

.sidebar-item.active {
  background: rgba(22, 119, 255, 0.15);
  color: var(--bright-blue);
  font-weight: 700;
  border-left: 3px solid var(--primary-blue);
}

.theme-toggle-btn {
  background: var(--surface-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  width: 38px;
  height: 38px;
  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);
  border-color: var(--primary-400);
  transform: translateY(-1px);
}

.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;
}

.top-header {
  height: var(--header-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.header-search {
  position: relative;
  width: 320px;
}

.header-search input {
  width: 100%;
  padding: 8px 14px 8px 36px;
  background: var(--surface-secondary);
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s ease;
}

.header-search input:focus {
  background: var(--surface);
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.header-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Top Nav Menu on Server Side */
.top-nav-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 12px;
  flex-wrap: wrap;
}

.top-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.top-nav-link:hover {
  color: var(--primary-600);
  background: var(--surface-secondary);
  text-decoration: none;
}

.top-nav-link.active {
  color: var(--primary-600);
  background: var(--primary-50);
  font-weight: 700;
}

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

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

.top-nav-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: var(--header-height);
  z-index: 29;
  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);
  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;
}

@media (max-width: 1080px) {
  .top-nav-menu {
    display: none;
  }
  .mobile-nav-toggle {
    display: inline-flex;
  }
}

.content-body {
  padding: 32px 36px;
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 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 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.card-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Typography Hierarchy */
h1.page-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 6px;
}

p.page-description {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

/* Metric / Stats Cards */
.grid-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease;
}

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

.stat-info .stat-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.stat-info .stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 4px;
  letter-spacing: -0.02em;
}

.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-amber { background: rgba(245, 158, 11, 0.1); color: var(--warning-500); }
.icon-red { background: rgba(239, 68, 68, 0.1); color: var(--error-500); }
.icon-purple { background: rgba(147, 51, 234, 0.1); color: #9333ea; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.18s 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 1px 2px 0 rgba(37, 99, 235, 0.2);
}

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

.btn-gradient {
  background: var(--hero-gradient);
  color: white;
  border: none;
  box-shadow: var(--shadow-sm);
}

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

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

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

.btn-danger {
  background: var(--error-50);
  border-color: rgba(239, 68, 68, 0.2);
  color: var(--error-600);
}

.btn-danger:hover {
  background: var(--error-600);
  color: white;
}

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

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

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-md);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  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-delivery { background: rgba(20, 184, 166, 0.1); color: var(--teal-600); }
.badge-residential { background: rgba(99, 102, 241, 0.1); color: var(--indigo-600); }
.badge-business { background: rgba(245, 158, 11, 0.1); color: var(--warning-600); }
.badge-local { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.badge-intl { background: rgba(6, 182, 212, 0.1); color: var(--cyan-500); }

/* Form Controls */
.form-group {
  margin-bottom: 20px;
}

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

.form-label .required {
  color: var(--error-500);
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s ease;
}

.form-control:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

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

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

/* Public ID Display Badge */
.public-id-badge {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary-600);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.05em;
  display: inline-block;
  border: 1px dashed rgba(37, 99, 235, 0.3);
}

/* Data Tables */
.table-container {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.table th {
  background: var(--surface-secondary);
  color: var(--text-secondary);
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
}

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

.table tr:hover td {
  background: rgba(59, 130, 246, 0.02);
}

/* Multi-Step Wizard */
.wizard-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 24px;
}

.wizard-step {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 13px;
}

.wizard-step.active {
  color: var(--primary-600);
  font-weight: 700;
}

.wizard-step.completed {
  color: var(--success-600);
}

.wizard-step-num {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  background: var(--surface-secondary);
}

.wizard-step.active .wizard-step-num {
  background: var(--primary-600);
  color: white;
}

.wizard-step.completed .wizard-step-num {
  background: var(--success-500);
  color: white;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 100;
}

.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xl);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
  min-width: 280px;
  animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

@keyframes toastSlideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 90;
  padding: 20px;
}

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

.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  position: relative;
  animation: modalPop 0.25s ease-out;
}

@keyframes modalPop {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* System 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: var(--surface);
  border: 1px solid var(--border);
  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 var(--border);
  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: var(--surface-hover, rgba(255,255,255,0.06));
  border: 1px solid var(--border);
  color: var(--text-secondary);
  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: var(--border);
  color: var(--text-primary);
}

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

.notif-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 10px;
  line-height: 1.3;
}

.notif-message {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.notif-popup-footer {
  padding: 14px 22px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 32px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  margin-bottom: 24px;
}

.timeline-dot {
  position: absolute;
  left: -32px;
  top: 4px;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--primary-100);
  border: 2px solid var(--primary-600);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Mobile Responsive */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-wrapper {
    margin-left: 0;
  }
  .form-grid-2, .form-grid-3 {
    grid-template-columns: 1fr;
  }
  .content-body {
    padding: 20px 16px;
  }
  .wizard-steps {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

/* ==========================================================================
   CLS-Safe Monetization & Ad Slot Containers (Core Web Vitals Protection)
   ========================================================================== */
.ad-slot-container {
  min-height: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 16px 0;
  contain: layout style;
}

.ad-slot-banner {
  width: 100%;
  max-width: 728px;
  min-height: 90px;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.ad-slot-mobile-banner {
  width: 100%;
  max-width: 320px;
  min-height: 50px;
}

/* Platform Semantic Footer Link Hover */
.app-footer a:hover {
  color: var(--primary-600) !important;
  text-decoration: underline !important;
}

/* 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);
}

/* Quick Search Box / Resolver Interactive Bar (Server Parity) */
.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;
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 16px;
  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;
  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;
}

/* 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;
  }
}

