/* ==========================================================================
   ONLIFE (安省生活圈) - Modern Clean Light Design System
   Victoria Educational Groups (27 Years) x Shanhe Goods Ecosystem
   Full-Stack Python (Flask) Backend Integration
   ========================================================================== */

:root {
  /* Color Palette - Victoria Educational Groups Official Crimson & Warm Gold Luxe */
  --bg-main: #ffffff;
  --bg-surface: #f8fafc;
  --bg-surface-elevated: #f1f5f9;
  --bg-glass: rgba(255, 255, 255, 0.9);
  --bg-glass-card: #ffffff;
  --bg-glass-hover: #fef2f2;

  --border-subtle: #e2e8f0;
  --border-highlight: #cbd5e1;
  --border-accent: rgba(179, 51, 52, 0.35);

  /* Primary Brand: Victoria Educational Groups Official Crimson Red */
  --primary-500: #b33334;
  --primary-400: #dc2626;
  --primary-600: #991b1b;
  --primary-700: #7f1d1d;
  --primary-gradient: linear-gradient(135deg, #b33334 0%, #dc2626 50%, #991b1b 100%);
  --vic-gradient: linear-gradient(135deg, #b33334 0%, #dc2626 40%, #d97706 100%);
  --emerald-gradient: linear-gradient(135deg, #059669 0%, #0d9488 100%);
  --gold-gradient: linear-gradient(135deg, #b33334 0%, #d97706 50%, #f59e0b 100%);
  --glow-cyan: 0 0 30px rgba(179, 51, 52, 0.18);
  --glow-vic: 0 0 30px rgba(179, 51, 52, 0.22);
  --glow-gold: 0 0 25px rgba(217, 119, 6, 0.18);

  /* Text Colors - High contrast for light background */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-inverse: #ffffff;

  /* Accent status colors */
  --accent-green: #059669;
  --accent-amber: #d97706;
  --accent-rose: #e11d48;
  --accent-purple: #9333ea;

  /* Typography */
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', 'Noto Sans SC', sans-serif;

  /* Layout & Spacing */
  --max-width: 1360px;
  --radius-sm: 6px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* Transitions & Shadows */
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.12);
  --shadow-glow: 0 0 35px rgba(179, 51, 52, 0.14);
  --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
}

body {
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
  background-color: var(--bg-main);
  color: var(--text-primary);
}

/* Container */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* Typography Helpers */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 0.925rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary-gradient);
  color: #ffffff;
  box-shadow: 0 4px 18px rgba(179, 51, 52, 0.28);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(179, 51, 52, 0.4);
  filter: brightness(1.05);
}

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

.btn-secondary:hover {
  background: #fef2f2;
  border-color: rgba(179, 51, 52, 0.25);
  color: var(--primary-500);
  transform: translateY(-2px);
}

.btn-block {
  width: 100%;
}

.gradient-text {
  background: var(--vic-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

/* Top Announcement Bar */
.top-bar {
  background: #f8fafc;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.825rem;
  padding: 8px 0;
  color: var(--text-secondary);
}

.top-bar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  gap: 16px;
  min-height: 28px;
}

.announcement {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
}

.announcement span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.announcement strong {
  color: var(--primary-600);
}

.badge {
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.725rem;
  font-weight: 700;
  flex-shrink: 0;
  white-space: nowrap;
}

.pulse-badge {
  background: var(--gold-gradient);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.25);
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.85;
    transform: scale(0.97);
  }
}

.top-links {
  display: flex;
  align-items: center;
  gap: 18px;
  white-space: nowrap;
  flex-shrink: 0;
}

.location-picker {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--primary-600);
  white-space: nowrap;
  flex-shrink: 0;
}

.city-select {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  white-space: nowrap;
}

.city-select option {
  background: #ffffff;
  color: var(--text-primary);
}

.top-link {
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition-fast);
  white-space: nowrap;
  flex-shrink: 0;
}

.top-link:hover {
  color: var(--primary-600);
}

.divider {
  color: var(--border-subtle);
}

/* Main Navigation Header */
.main-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  transition: var(--transition-fast);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 82px;
  height: 82px;
  gap: 20px;
  flex-wrap: nowrap;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
  white-space: nowrap;
}

.logo-img-box {
  height: 54px;
  width: auto;
  aspect-ratio: 1402 / 1356;
  border-radius: 0;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  box-shadow: none;
  border: none;
  flex-shrink: 0;
  transition: transform var(--transition-bounce);
}

.logo-group:hover .logo-img-box {
  transform: scale(1.05);
}

.brand-logo-img {
  height: 100%;
  width: 100%;
  object-fit: contain;
  display: block;
  image-rendering: auto;
  image-rendering: -webkit-optimize-contrast;
  filter: drop-shadow(0 2px 6px rgba(179, 51, 52, 0.16));
}

.hero-badge-logo {
  height: 22px;
  width: auto;
  aspect-ratio: 1402 / 1356;
  border-radius: 0;
  border: none;
  object-fit: contain;
  display: inline-block;
  vertical-align: middle;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: high-quality;
}

.logo-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  white-space: nowrap;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.2;
  white-space: nowrap;
}

.brand-badge {
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(185, 28, 28, 0.08);
  color: #b91c1c;
  border: 1px solid rgba(185, 28, 28, 0.25);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.brand-sub {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  margin-top: 2px;
  white-space: nowrap;
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin: 0 auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.nav-links li {
  display: inline-flex;
  flex-shrink: 0;
  white-space: nowrap;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 0.885rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
  white-space: nowrap;
  word-break: keep-all;
  flex-shrink: 0;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-500);
  background: rgba(179, 51, 52, 0.08);
}

.feed-count-badge {
  background: var(--primary-500);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  white-space: nowrap;
}

.cart-btn {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  transition: var(--transition-fast);
}

.cart-btn:hover {
  background: #fef2f2;
  color: var(--primary-500);
  border-color: rgba(179, 51, 52, 0.25);
}

.cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--primary-500);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* Mobile Menu Hamburger Button & Slide Drawer */
.mobile-menu-btn {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  cursor: pointer;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.mobile-menu-btn:hover {
  background: #fef2f2;
  color: var(--primary-500);
  border-color: rgba(179, 51, 52, 0.25);
}

.mobile-nav-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1050;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-nav-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav-drawer {
  position: fixed;
  top: 0;
  right: -360px;
  width: 330px;
  max-width: 86vw;
  height: 100vh;
  background: #ffffff;
  box-shadow: -8px 0 25px rgba(0, 0, 0, 0.15);
  z-index: 1055;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
}

.mobile-nav-drawer.active {
  transform: translateX(-360px);
}

.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  background: #fafafa;
}

.mobile-nav-close-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.mobile-nav-close-btn:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fecaca;
}

.mobile-nav-user-card {
  padding: 14px 20px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-subtle);
}

.mobile-location-box {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #334155;
}

.mobile-location-box select {
  flex: 1;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  font-weight: 600;
  color: var(--primary-600);
}

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

.mobile-nav-section-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 14px 6px 4px 6px;
}

.mobile-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.mobile-nav-item i {
  font-size: 1.2rem;
  color: var(--text-muted);
}

.mobile-nav-item:hover, .mobile-nav-item:active {
  background: #f1f5f9;
  color: var(--primary-600);
}

.mobile-nav-item:hover i {
  color: var(--primary-600);
}

.mobile-nav-item.highlight-red {
  background: #fff5f5;
  color: #b33334;
  border: 1px solid #fed7d7;
}

.mobile-nav-item.highlight-red i {
  color: #b33334;
}

.mobile-nav-item.highlight-blue {
  background: #f0f9ff;
  color: #0284c7;
  border: 1px solid #bae6fd;
}

.mobile-nav-item.highlight-blue i {
  color: #0284c7;
}

.mobile-nav-item.admin-gold {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.mobile-nav-item.admin-gold i {
  color: #b45309;
}

.mobile-nav-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-subtle);
  background: #fafafa;
}

/* Hero Section */
.hero-section {
  position: relative;
  padding: 80px 0 60px;
  overflow: hidden;
  text-align: center;
  background: radial-gradient(circle at 50% 10%, rgba(179, 51, 52, 0.05) 0%, transparent 70%);
}

.hero-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
}

.hero-glow-1 {
  width: 500px;
  height: 500px;
  top: -100px;
  left: 20%;
  background: rgba(179, 51, 52, 0.10);
}

.hero-glow-2 {
  width: 450px;
  height: 450px;
  top: 50px;
  right: 20%;
  background: rgba(217, 119, 6, 0.08);
}

.hero-container {
  position: relative;
  z-index: 1;
  max-width: 900px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(179, 51, 52, 0.08);
  border: 1px solid rgba(179, 51, 52, 0.22);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-500);
  margin-bottom: 24px;
}

.hero-title {
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
  line-height: 1.15;
  color: var(--text-primary);
}

.hero-desc {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 36px;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

/* Fast Search Box */
.hero-search-box {
  background: #ffffff;
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-xl);
  padding: 12px 14px;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.08), 0 0 20px rgba(179, 51, 52, 0.06);
  margin-bottom: 48px;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 6px 8px 6px 18px;
  transition: var(--transition-fast);
}

.search-input-wrap:focus-within {
  border-color: var(--primary-500);
  box-shadow: 0 0 15px rgba(179, 51, 52, 0.18);
  background: #ffffff;
}

.search-icon {
  font-size: 1.4rem;
  color: var(--primary-500);
}

.search-input-wrap input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 1.05rem;
  color: var(--text-primary);
  font-family: inherit;
}

.search-input-wrap input::placeholder {
  color: var(--text-muted);
}

.search-action-btn {
  padding: 12px 24px;
  font-size: 0.95rem;
}

.quick-tags {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.quick-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.tag-pill {
  background: #f1f5f9;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  transition: var(--transition-fast);
}

.tag-pill:hover {
  background: rgba(179, 51, 52, 0.08);
  border-color: rgba(179, 51, 52, 0.3);
  color: var(--primary-500);
  transform: translateY(-1px);
}

/* Metrics */
.hero-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.metric-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 12px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-fast);
}

.metric-card:hover {
  border-color: var(--border-highlight);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.metric-num {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
}

.metric-num .unit {
  font-size: 1.1rem;
  color: var(--primary-600);
  margin-left: 2px;
}

.metric-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Sections */
.section {
  padding: 80px 0;
  position: relative;
}

.section-header {
  margin-bottom: 48px;
  text-align: center;
}

.section-header.flex-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  text-align: left;
  flex-wrap: wrap;
  gap: 20px;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.825rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary-600);
  margin-bottom: 8px;
}

.section-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.section-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 650px;
}

/* 6 Core Services Grid */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.service-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary-gradient);
  opacity: 0;
  transition: var(--transition-fast);
}

.service-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-md);
}

.service-card:hover::before {
  opacity: 1;
}

.service-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.service-icon-box {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
}

.icon-electrician {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
}

.icon-plumbing {
  background: rgba(2, 132, 199, 0.12);
  color: #0284c7;
}

.icon-hvac {
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
}

.icon-psw {
  background: rgba(225, 29, 72, 0.12);
  color: #e11d48;
}

.icon-rmt {
  background: rgba(13, 148, 136, 0.12);
  color: #0d9488;
}

.icon-nursing {
  background: rgba(79, 70, 229, 0.12);
  color: #4f46e5;
}

.icon-garden {
  background: rgba(5, 150, 105, 0.12);
  color: #059669;
}

.icon-handyman {
  background: rgba(147, 51, 234, 0.12);
  color: #9333ea;
}

.icon-finance {
  background: rgba(217, 119, 6, 0.12);
  color: #b45309;
}

.service-cert-tag {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: #f1f5f9;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.service-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.service-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 18px;
  line-height: 1.5;
}

.service-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 24px;
}

.service-tag-item {
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  color: var(--text-muted);
}

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

.service-price-wrap {
  display: flex;
  flex-direction: column;
}

.service-price-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.service-price {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-600);
}

/* Technicians Section */
.tech-filter-tabs,
.feed-filter-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

.filter-tab {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.filter-tab:hover {
  color: var(--text-primary);
}

.filter-tab.active {
  background: var(--primary-gradient);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(179, 51, 52, 0.28);
}

.techs-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.tech-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
  position: relative;
}

.tech-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-md);
}

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

.tech-badge-flag {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.badge-vic {
  background: rgba(179, 51, 52, 0.1);
  border: 1px solid rgba(179, 51, 52, 0.3);
  color: #b33334;
}

.badge-social {
  background: rgba(217, 119, 6, 0.12);
  border: 1px solid rgba(217, 119, 6, 0.3);
  color: #b45309;
}

.tech-location-tag {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.tech-profile-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.tech-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #fdf2f2;
  border: 2px solid var(--primary-400);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 12px rgba(179, 51, 52, 0.15);
  flex-shrink: 0;
}

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

.tech-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 3px;
  word-break: break-word;
}

.tech-category {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: block;
}

.tech-certs-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
  background: #f8fafc;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.cert-item {
  font-size: 0.775rem;
  color: var(--primary-600);
  display: flex;
  align-items: center;
  gap: 6px;
}

.tech-stats-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.825rem;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

.tech-rating {
  color: #d97706;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

.tech-orders {
  color: var(--text-muted);
}

.tech-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tech-rate {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.tech-rate span {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: normal;
}

/* Dual-Track Onboarding */
.onboarding-cards-wrap {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
  max-width: 1040px;
  margin: 0 auto;
}

.onboard-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 36px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.onboard-card.highlight-card {
  border-color: rgba(179, 51, 52, 0.38);
  background: linear-gradient(145deg, #ffffff 0%, #fef2f2 100%);
  box-shadow: 0 16px 40px rgba(179, 51, 52, 0.08);
}

.card-glow {
  position: absolute;
  top: -50px;
  right: -50px;
  width: 200px;
  height: 200px;
  background: rgba(179, 51, 52, 0.1);
  border-radius: 50%;
  filter: blur(60px);
}

.onboard-header {
  margin-bottom: 24px;
}

.track-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.student-tag {
  background: var(--gold-gradient);
  color: #ffffff;
}

.social-tag {
  background: rgba(37, 99, 235, 0.12);
  border: 1px solid rgba(37, 99, 235, 0.3);
  color: #1d4ed8;
}

.track-title {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.track-price {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary-600);
}

.sub-price {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.benefit-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 32px;
}

.benefit-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.925rem;
  color: var(--text-secondary);
}

.benefit-list li i {
  color: #059669;
  font-size: 1.15rem;
  margin-top: 2px;
  flex-shrink: 0;
}

.benefit-list li strong {
  color: var(--text-primary);
}

/* Supply Chain Mall Grid */
.supply-stats {
  display: flex;
  gap: 8px;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(5, 150, 105, 0.1);
  border: 1px solid rgba(5, 150, 105, 0.25);
  color: #059669;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.product-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
}

.product-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-highlight);
  box-shadow: var(--shadow-md);
}

.product-icon-wrap {
  height: 140px;
  background: #f8fafc;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  margin-bottom: 14px;
}

.product-name {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.product-tag {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.product-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.product-price {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary-600);
}

/* ==========================================================================
   DYNAMIC COMMUNITY LIFE HUB & AI PUBLISHED FEED
   ========================================================================== */
.ai-live-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--gold-gradient);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  vertical-align: middle;
  margin-left: 8px;
}

.community-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 36px;
}

.feed-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.feed-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-md);
}

.feed-card.ai-generated {
  border-color: rgba(245, 158, 11, 0.35);
  background: linear-gradient(145deg, #ffffff 0%, #fffbeb 100%);
}

.feed-card.highlight-new {
  animation: highlight-pulse 2.5s ease-out;
}

@keyframes highlight-pulse {
  0% {
    transform: scale(1.03);
    box-shadow: 0 0 30px rgba(2, 132, 199, 0.4);
    border-color: var(--primary-500);
  }

  100% {
    transform: scale(1);
    box-shadow: var(--shadow-sm);
    border-color: var(--border-subtle);
  }
}

.feed-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.category-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-full);
}

.badge-tips {
  background: rgba(5, 150, 105, 0.12);
  color: #059669;
}

.badge-career {
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
}

.badge-welfare {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}

.badge-official {
  background: rgba(147, 51, 234, 0.12);
  color: #7e22ce;
}

.ai-pill-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #b45309;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.feed-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.35;
  color: var(--text-primary);
}

.feed-summary {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 18px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.feed-author-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.feed-author-meta i {
  color: var(--primary-600);
}

.feed-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.feed-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.feed-action-btn {
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition-fast);
}

.feed-action-btn:hover {
  color: var(--primary-600);
}

.ai-publish-banner {
  background: linear-gradient(135deg, #f0f9ff 0%, #f5f3ff 100%);
  border: 1px solid rgba(2, 132, 199, 0.25);
  border-radius: var(--radius-lg);
  padding: 24px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.banner-left {
  display: flex;
  align-items: center;
  gap: 18px;
}

.banner-icon {
  width: 48px;
  height: 48px;
  background: var(--gold-gradient);
  color: #ffffff;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.banner-left h4 {
  font-size: 1.15rem;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.banner-left p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Realtime Operations & Dispatch */
.stats-dashboard {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.stat-box {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.stat-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: rgba(2, 132, 199, 0.08);
  color: var(--primary-600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.stat-info {
  display: flex;
  flex-direction: column;
}

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

.stat-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
}

.stat-trend {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 0.725rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.stat-trend.positive {
  background: rgba(5, 150, 105, 0.12);
  color: #059669;
}

.dispatch-ticker-wrap {
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  gap: 0;
}

.ticker-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary-600);
  white-space: nowrap;
  flex-shrink: 0;
  position: relative;
  z-index: 3;
  background: #f8fafc;
  padding-right: 18px;
  box-shadow: 8px 0 16px #f8fafc;
}

.ticker-viewport {
  flex: 1;
  overflow: hidden;
  position: relative;
  mask-image: linear-gradient(90deg, transparent 0%, #000 20px, #000 calc(100% - 20px), transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 20px, #000 calc(100% - 20px), transparent 100%);
}

.ticker-track {
  display: inline-flex;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
  animation: ticker-slide 30s linear infinite;
  white-space: nowrap;
  will-change: transform;
}

.ticker-track:hover {
  animation-play-state: paused;
}

.ticker-bullet {
  color: var(--primary-400);
  padding: 0 16px;
  font-weight: 800;
}

.ticker-item {
  white-space: nowrap;
}

@keyframes ticker-slide {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-50%);
  }
}

/* Footer */
.main-footer {
  background: #f8fafc;
  border-top: 1px solid var(--border-subtle);
  padding: 64px 0 24px;
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 40px;
  margin-bottom: 48px;
}

.footer-brand .brand-name {
  margin-bottom: 12px;
}

.footer-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 18px;
}

.footer-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.f-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  padding: 3px 8px;
  background: #f1f5f9;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}

.footer-heading {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 18px;
  color: var(--text-primary);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.footer-links a:hover {
  color: var(--primary-600);
  padding-left: 4px;
}

.footer-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.5;
}

.footer-phone {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary-600);
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer-bottom {
  border-top: 1px solid var(--border-subtle);
  padding-top: 24px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-bottom-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

/* ==========================================================================
   AI ASSISTANT (BOTTOM RIGHT FLOATING WIDGET)
   ========================================================================== */
.ai-widget-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
}

/* Floating Trigger Button */
.ai-trigger-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  padding: 8px 18px 8px 10px;
  border-radius: var(--radius-full);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
  position: relative;
  transition: var(--transition-smooth);
}

.ai-trigger-btn:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: var(--primary-500);
  box-shadow: 0 15px 40px rgba(179, 51, 52, 0.25);
}

.ai-trigger-icon-wrap {
  width: 38px;
  height: 38px;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: none;
  padding: 0;
}

.ai-trigger-icon-wrap .ai-trigger-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0;
  filter: drop-shadow(0 2px 5px rgba(179, 51, 52, 0.18));
}

.ai-sparkle-icon {
  position: absolute;
  top: -3px;
  right: -3px;
  font-size: 0.9rem;
  color: #f59e0b;
  animation: spin-slow 4s linear infinite;
}

@keyframes spin-slow {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.ai-trigger-label {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.ai-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
}

.ai-subtitle {
  font-size: 0.725rem;
  color: var(--primary-500);
  font-weight: 500;
}

.ai-unread-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 10px;
  height: 10px;
  background: var(--primary-500);
  border-radius: 50%;
  border: 2px solid #ffffff;
  animation: pulse-glow 1.5s infinite;
}

/* Chat Window Modal */
.ai-chat-window {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 420px;
  height: 620px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 48px);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.9) translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-smooth);
}

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

/* AI Header */
.ai-header {
  padding: 16px 20px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ai-header-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-avatar {
  width: 34px;
  height: 34px;
  border-radius: 0;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 0;
  box-shadow: none;
}

.ai-avatar .ai-avatar-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0;
  filter: drop-shadow(0 1px 3px rgba(179, 51, 52, 0.15));
}

.online-status {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 9px;
  height: 9px;
  background: #059669;
  border-radius: 50%;
  border: 2px solid #ffffff;
}

.ai-name {
  font-size: 0.925rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai-version-badge {
  font-size: 0.65rem;
  background: rgba(179, 51, 52, 0.1);
  color: var(--primary-600);
  padding: 1px 5px;
  border-radius: var(--radius-sm);
}

.ai-status-text {
  font-size: 0.725rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.ai-status-text i {
  color: #059669;
}

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

.ai-action-icon-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: var(--transition-fast);
}

.ai-action-icon-btn:hover {
  background: #f1f5f9;
  color: var(--text-primary);
}

/* Quick Pills */
.ai-quick-pills-bar {
  padding: 10px 14px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.ai-quick-pills-bar::-webkit-scrollbar {
  display: none;
}

.ai-pill {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.725rem;
  font-weight: 500;
  white-space: nowrap;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ai-pill:hover {
  background: rgba(179, 51, 52, 0.08);
  border-color: var(--primary-500);
  color: var(--primary-500);
}

/* Message Body */
.ai-messages-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #ffffff;
}

.ai-message {
  display: flex;
  gap: 10px;
  max-width: 95%;
}

.ai-msg-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.ai-msg-user .msg-content {
  background: var(--primary-gradient);
  color: #ffffff;
  border-radius: 16px 4px 16px 16px;
}

.ai-msg-bot .msg-content {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: var(--text-primary);
  border-radius: 4px 16px 16px 16px;
}

.msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 0;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  box-shadow: none;
}

.msg-avatar .ai-avatar-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0;
  filter: drop-shadow(0 1px 3px rgba(179, 51, 52, 0.15));
}

.msg-content {
  padding: 12px 16px;
  font-size: 0.875rem;
  line-height: 1.55;
}

.msg-content p {
  margin-bottom: 8px;
}

.msg-content p:last-child {
  margin-bottom: 0;
}

.msg-feature-list {
  list-style: none;
  margin: 10px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.msg-hint {
  font-size: 0.775rem;
  color: var(--primary-500);
  margin-top: 8px;
}

/* AI Generated Post Preview Card inside Chat */
.ai-generated-preview {
  background: #ffffff;
  border: 1px solid rgba(179, 51, 52, 0.35);
  border-radius: var(--radius-md);
  padding: 14px;
  margin: 10px 0;
  box-shadow: var(--shadow-sm);
}

.preview-badge-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.preview-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.preview-excerpt {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.btn-publish-action {
  width: 100%;
  background: var(--gold-gradient);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 4px 15px rgba(217, 119, 6, 0.25);
  transition: var(--transition-fast);
}

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

.btn-publish-action.published {
  background: #059669;
  color: white;
  box-shadow: none;
  pointer-events: none;
}

/* AI Input */
.ai-input-area {
  padding: 12px 16px;
  background: #f8fafc;
  border-top: 1px solid var(--border-subtle);
}

.ai-input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 6px 8px 6px 14px;
  transition: var(--transition-fast);
}

.ai-input-wrapper:focus-within {
  border-color: var(--primary-500);
  box-shadow: 0 0 12px rgba(179, 51, 52, 0.18);
}

.ai-input-wrapper textarea {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 0.875rem;
  color: var(--text-primary);
  resize: none;
  font-family: inherit;
  max-height: 80px;
}

.ai-input-wrapper textarea::placeholder {
  color: var(--text-muted);
}

.ai-send-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background: var(--primary-gradient);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: var(--transition-fast);
}

.ai-send-btn:hover {
  transform: scale(1.05);
}

.ai-input-footer {
  margin-top: 6px;
  font-size: 0.68rem;
  color: var(--text-muted);
  text-align: center;
}

/* ==========================================================================
   MODALS, OVERLAYS & FORMS
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-smooth);
}

.modal-overlay.open,
.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.15);
  transform: translateY(20px);
  transition: var(--transition-smooth);
}

.modal-card.modal-lg {
  max-width: 760px;
}

.modal-overlay.open .modal-card,
.modal-overlay.active .modal-card {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-icon {
  font-size: 2rem;
  color: var(--primary-500);
}

.modal-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
}

.modal-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.modal-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f1f5f9;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  cursor: pointer;
  outline: none;
  position: relative;
  z-index: 20;
  flex-shrink: 0;
}

.modal-close-btn:hover {
  background: #fee2e2;
  color: #dc2626;
  transform: rotate(90deg) scale(1.05);
}

/* Legal Modals (Terms & Privacy) */
.legal-modal-body {
  max-height: 62vh;
  overflow-y: auto;
  padding: 4px 6px 12px 0;
  color: var(--text-primary);
  font-size: 0.88rem;
  line-height: 1.75;
}

.legal-modal-body::-webkit-scrollbar {
  width: 6px;
}

.legal-modal-body::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.legal-modal-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.legal-section {
  margin-bottom: 20px;
}

.legal-section h4 {
  font-size: 0.975rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.legal-section h4 i {
  color: var(--primary-500);
  font-size: 1.1rem;
}

.legal-section p {
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.legal-section ul {
  padding-left: 20px;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.legal-section li {
  margin-bottom: 4px;
}

.legal-highlight-box {
  background: #fdf2f2;
  border: 1px solid rgba(179, 51, 52, 0.2);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin: 12px 0;
  font-size: 0.85rem;
  color: #991b1b;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.legal-highlight-box i {
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: 2px;
}

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

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

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

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

.form-control {
  width: 100%;
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 0.9rem;
  color: var(--text-primary);
  font-family: inherit;
  outline: none;
  transition: var(--transition-fast);
}

.form-control:focus {
  background: #ffffff;
  border-color: var(--primary-500);
  box-shadow: 0 0 10px rgba(179, 51, 52, 0.18);
}

.form-control option {
  background: #ffffff;
  color: var(--text-primary);
}

.form-time-radios {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.radio-pill {
  padding: 8px 6px;
  font-size: 0.775rem;
  text-align: center;
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.radio-pill input {
  display: none;
}

.radio-pill.active {
  background: rgba(179, 51, 52, 0.1);
  border-color: var(--primary-500);
  color: var(--primary-500);
  font-weight: 700;
}

.price-estimation-box {
  background: #fdf2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 24px;
}

.price-est-label {
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-primary);
}

.price-val {
  color: var(--primary-500);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  margin-left: 6px;
}

.price-note {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

.modal-footer.flex-between {
  justify-content: space-between;
}

/* Onboard Tabs */
.onboard-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.onboard-tab {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-md);
  background: #f1f5f9;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 700;
  transition: var(--transition-fast);
}

.onboard-tab.active {
  background: var(--gold-gradient);
  color: #ffffff;
  border-color: transparent;
}

.track-alert {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #b45309;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.825rem;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Article Modal */
.article-meta-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.825rem;
  color: var(--text-muted);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 20px;
}

.article-modal-body {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text-primary);
}

.article-modal-body h4 {
  margin: 18px 0 8px;
  color: var(--primary-600);
}

.article-modal-body ul {
  padding-left: 20px;
  margin-bottom: 14px;
}

.btn-like {
  padding: 8px 16px;
  background: rgba(225, 29, 72, 0.1);
  border: 1px solid rgba(225, 29, 72, 0.25);
  color: #e11d48;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-fast);
}

.btn-like:hover {
  background: rgba(225, 29, 72, 0.2);
  transform: scale(1.05);
}

/* Business Model Grid */
.business-model-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 10px;
}

.bm-card {
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
}

.bm-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-gradient);
  color: white;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  margin-bottom: 10px;
}

.bm-card h4 {
  font-size: 1rem;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.bm-card p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Cart Drawer */
.cart-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(8px);
  z-index: 1001;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-fast);
}

.cart-drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.cart-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 400px;
  max-width: 90vw;
  background: #ffffff;
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 24px;
  transform: translateX(100%);
  transition: var(--transition-smooth);
  box-shadow: -10px 0 30px rgba(15, 23, 42, 0.1);
}

.cart-drawer-overlay.open .cart-drawer {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.drawer-title {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}

.cart-items-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-item-card {
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cart-item-info h5 {
  font-size: 0.9rem;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.cart-item-price {
  font-size: 0.85rem;
  color: var(--primary-600);
  font-weight: 700;
}

.drawer-footer {
  border-top: 1px solid var(--border-subtle);
  padding-top: 18px;
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.cart-total-price {
  color: var(--primary-600);
  font-size: 1.3rem;
  font-family: var(--font-display);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  color: var(--text-primary);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  animation: toast-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 380px;
}

@keyframes toast-in {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast.toast-success i {
  color: #059669;
  font-size: 1.25rem;
}

.toast.toast-info i {
  color: var(--primary-600);
  font-size: 1.25rem;
}

.toast.toast-error i {
  color: #dc2626;
  font-size: 1.25rem;
}

/* ==========================================================================
   AUTHENTICATION & USER PROFILE STYLES
   ========================================================================== */
.btn-outline-auth {
  background: #ffffff;
  color: var(--text-primary);
  border: 1.5px solid rgba(179, 51, 52, 0.35);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
}

.btn-outline-auth:hover {
  background: #fdf2f2;
  color: var(--primary-500);
  border-color: var(--primary-500);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(179, 51, 52, 0.15);
}

.auth-user-container {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.user-profile-menu {
  position: relative;
}

.user-avatar-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fdf2f2;
  border: 1.5px solid rgba(179, 51, 52, 0.25);
  padding: 6px 14px 6px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition-fast);
}

.user-avatar-btn:hover {
  background: #fee2e2;
  border-color: var(--primary-500);
  transform: translateY(-1px);
}

.user-avatar-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-gradient);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.user-name-label {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-primary);
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-dropdown-card {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 240px;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14);
  padding: 12px;
  z-index: 1000;
  display: none;
  flex-direction: column;
  animation: dropdown-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.user-dropdown-card.show {
  display: flex;
}

@keyframes dropdown-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.user-dropdown-header {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dropdown-user-name {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.dropdown-user-email {
  font-size: 0.775rem;
  color: var(--text-muted);
  word-break: break-all;
}

.dropdown-user-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  background: #fdf2f2;
  color: var(--primary-500);
  border: 1px solid rgba(179, 51, 52, 0.2);
  margin-top: 4px;
}

.user-dropdown-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 6px 0;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.user-dropdown-item:hover {
  background: #f8fafc;
  color: var(--primary-500);
}

.user-dropdown-item.logout-item:hover {
  background: #fef2f2;
  color: #dc2626;
}

/* Dedicated Admin Database Menu Dropdown */
.admin-db-menu-container {
  position: relative;
  display: inline-flex;
}

.admin-db-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fffbeb !important;
  border: 1.5px solid #fde68a !important;
  color: #b45309 !important;
  font-weight: 700 !important;
  padding: 6px 14px !important;
  border-radius: var(--radius-full) !important;
  font-size: 0.85rem !important;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.admin-db-btn:hover {
  background: #fef3c7 !important;
  border-color: #f59e0b !important;
  color: #92400e !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.15);
}

.admin-db-dropdown-card {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 320px;
  background: #ffffff;
  border: 1.5px solid #fde68a;
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 40px rgba(180, 83, 9, 0.16), 0 6px 16px rgba(0, 0, 0, 0.06);
  padding: 8px;
  z-index: 1001;
  display: none;
  flex-direction: column;
  animation: dropdown-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-db-dropdown-card.show {
  display: flex;
}

.admin-db-header {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  padding: 10px 12px;
  border: 1px solid #fde68a;
  margin-bottom: 4px;
}

.admin-db-items-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 420px;
  overflow-y: auto;
  padding: 4px 0;
}

.admin-db-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #334155;
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.admin-db-item i {
  font-size: 1.15rem;
  flex-shrink: 0;
}

.admin-db-item:hover {
  background: #fffbeb;
  color: #b45309;
  transform: translateX(3px);
}

/* Auth Modal Card */
.auth-modal-card {
  max-width: 480px;
  padding: 32px;
}

.auth-brand-logo {
  height: 38px;
  display: flex;
  align-items: center;
}

.auth-logo-img {
  height: 100%;
  width: auto;
  object-fit: contain;
}

.auth-tabs {
  display: flex;
  background: #f1f5f9;
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  gap: 6px;
}

.auth-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.auth-tab.active {
  background: #ffffff;
  color: var(--primary-500);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

/* Social SSO Buttons */
.social-auth-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.social-auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 11px 16px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  position: relative;
}

.google-auth-btn {
  background: #ffffff;
  color: #374151;
  border: 1.5px solid #e5e7eb;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.google-auth-btn:hover {
  background: #f9fafb;
  border-color: #d1d5db;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.linkedin-auth-btn {
  background: #0a66c2;
  color: #ffffff;
  border: 1.5px solid #0a66c2;
  box-shadow: 0 2px 8px rgba(10, 102, 194, 0.25);
}

.linkedin-auth-btn:hover {
  background: #004182;
  border-color: #004182;
  box-shadow: 0 4px 14px rgba(10, 102, 194, 0.35);
  transform: translateY(-1px);
}

.social-icon-svg {
  flex-shrink: 0;
}

.auth-divider {
  display: flex;
  align-items: center;
  margin: 18px 0;
  color: var(--text-muted);
  font-size: 0.775rem;
  font-weight: 600;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.auth-divider span {
  padding: 0 12px;
}

.form-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-link-sm {
  font-size: 0.775rem;
  color: var(--primary-500);
  font-weight: 600;
}

.form-checkbox-row {
  margin-bottom: 18px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.825rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.auth-role-radios {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

.role-radio-pill {
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  background: #f8fafc;
  transition: var(--transition-fast);
}

.role-radio-pill input {
  display: none;
}

.role-radio-pill.active {
  border-color: var(--primary-500);
  background: #fdf2f2;
  color: var(--primary-500);
  font-weight: 700;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 1rem;
}

.auth-footer-terms {
  margin-top: 16px;
  font-size: 0.725rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.4;
}

.auth-footer-terms a {
  color: var(--primary-500);
  text-decoration: underline;
}

/* ==========================================================================
   ADMIN USER MANAGEMENT CONSOLE STYLES
   ========================================================================== */
.admin-modal-card {
  max-width: 900px;
  width: 90vw;
  padding: 28px;
}

.admin-shield-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #d97706, #b45309);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
}

.admin-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.admin-search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  flex: 1;
  max-width: 380px;
}

.admin-search-wrap i {
  color: var(--text-muted);
}

.admin-search-input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.875rem;
  width: 100%;
  color: var(--text-primary);
}

.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  max-height: 420px;
  overflow-y: auto;
}

.admin-users-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.admin-users-table th {
  background: #f8fafc;
  color: var(--text-secondary);
  font-weight: 700;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 2;
}

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

.admin-users-table tr:hover {
  background: #fdf2f2;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.725rem;
  font-weight: 700;
}

.role-badge-admin {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.role-badge-ops {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.role-badge-technician {
  background: #e0e7ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
}

.role-badge-customer {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.provider-pill {
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
}

.table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.btn-tbl-action {
  padding: 4px 10px;
  font-size: 0.775rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.btn-tbl-action:hover {
  background: #f8fafc;
  color: var(--primary-500);
  border-color: var(--primary-500);
}

.btn-tbl-action.delete:hover {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fca5a5;
}

.admin-notice-box {
  background: #fffbeb;
  border: 1px solid #fef3c7;
  color: #b45309;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

/* ==========================================================================
   RESPONSIVE DESIGN (MOBILE-FIRST FLEXIBLE OVERHAUL)
   ========================================================================== */
@media (max-width: 1200px) {
  .header-actions .header-btn-tech,
  .header-actions > .btn-secondary:not(.cart-btn) {
    display: none;
  }
  .nav-link {
    padding: 6px 10px;
    font-size: 0.825rem;
  }
  .brand-sub {
    font-size: 0.7rem;
  }
}

@media (max-width: 992px) {
  .main-nav {
    display: none;
  }
  .mobile-menu-btn {
    display: inline-flex;
  }
  .top-links a:not(#topAuthLink) {
    display: none;
  }
  .header-content {
    min-height: 70px;
    height: auto;
    padding: 8px 0;
  }
  .hero-container {
    padding: 40px 16px 30px;
  }
  .hero-search-box {
    flex-direction: column;
    padding: 12px;
    gap: 10px;
  }
  .hero-search-box .search-input-wrap,
  .hero-search-box .location-input-wrap,
  .hero-search-box .btn {
    width: 100%;
  }
  .services-grid,
  .techs-grid,
  .products-grid,
  .community-grid,
  .stats-dashboard,
  .hero-metrics {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-content {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  /* Top Announcement Bar */
  .top-bar {
    padding: 4px 0;
  }
  .top-bar-content {
    justify-content: space-between;
    font-size: 0.75rem;
    gap: 8px;
  }
  .top-bar .announcement {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: calc(100vw - 110px);
    font-size: 0.75rem;
  }
  .top-links {
    display: flex;
    gap: 6px;
  }
  .location-picker {
    display: none;
  }

  /* Flexible Header */
  .header-content {
    min-height: 62px;
    padding: 6px 0;
    gap: 8px;
  }
  .logo-img-box {
    height: 42px !important;
    width: 42px !important;
  }
  .brand-name {
    font-size: 1.15rem !important;
  }
  .brand-sub {
    display: none !important;
  }
  .header-actions {
    gap: 6px;
  }
  .header-btn-book {
    padding: 6px 12px !important;
    font-size: 0.8rem !important;
  }
  .header-btn-book i {
    display: none;
  }
  .cart-btn, .mobile-menu-btn {
    width: 38px;
    height: 38px;
    font-size: 1.15rem;
  }
  .user-avatar-btn {
    padding: 4px 8px;
    font-size: 0.8rem;
  }
  .user-name-label {
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Grids & Cards */
  .services-grid,
  .techs-grid,
  .products-grid,
  .community-grid,
  .stats-dashboard,
  .hero-metrics,
  .onboarding-cards-wrap,
  .business-model-grid {
    grid-template-columns: 1fr;
  }

  .category-filter-bar {
    overflow-x: auto;
    flex-wrap: nowrap !important;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .category-filter-bar::-webkit-scrollbar {
    display: none;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .ai-chat-window {
    width: 100vw;
    height: 85vh;
    bottom: -24px;
    right: -24px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  /* Responsive Admin Modals */
  .modal-card {
    width: 95vw !important;
    max-width: 95vw !important;
    max-height: 90vh !important;
    margin: 8px auto !important;
    padding: 18px !important;
  }
  .admin-modal-card {
    width: 96vw !important;
    max-width: 96vw !important;
    padding: 14px !important;
  }
  .admin-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 480px) {
  .brand-badge {
    display: none;
  }
  .header-btn-book {
    display: none;
  }
  .hero-title {
    font-size: 1.65rem;
    line-height: 1.3;
  }
  .hero-subtitle {
    font-size: 0.9rem;
  }
}

/* ==========================================================================
   TOAST NOTIFICATION SYSTEM
   ========================================================================== */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 440px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  background: #1e293b;
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  animation: toast-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all 0.3s ease;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-16px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

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

.toast-info {
  background: #1e293b;
  border: 1px solid #334155;
  color: #f8fafc;
}

.toast i {
  font-size: 1.25rem;
  flex-shrink: 0;
}

/* ==========================================================================
   OAUTH ACCOUNT PICKER (GOOGLE & LINKEDIN)
   ========================================================================== */
.oauth-modal-card {
  max-width: 480px;
  width: 92%;
  padding: 24px;
}

.oauth-accounts-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 18px 0;
}

.oauth-account-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: var(--transition-fast);
}

.oauth-account-item:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.oauth-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.oauth-avatar.admin-avatar {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.oauth-avatar.student-avatar {
  background: #fdf2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.oauth-avatar.user-avatar {
  background: #f0f9ff;
  color: #0284c7;
  border: 1px solid #bae6fd;
}

.oauth-avatar.linkedin-avatar {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.oauth-avatar.add-avatar {
  background: #f1f5f9;
  color: #64748b;
  font-size: 1.1rem;
}

.oauth-account-info {
  flex: 1;
  min-width: 0;
}

.oauth-account-name {
  font-size: 0.925rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.oauth-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.oauth-badge.admin-badge {
  background: #fef3c7;
  color: #92400e;
}

.oauth-badge.tech-badge {
  background: #fdf2f2;
  color: #b91c1c;
}

.oauth-badge.user-badge {
  background: #f1f5f9;
  color: #475569;
}

.oauth-account-email {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.oauth-arrow {
  color: var(--text-muted);
  font-size: 1.1rem;
}

.oauth-modal-footer {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
  border-top: 1px solid var(--border-subtle);
  padding-top: 14px;
}

.service-admin-quick-edit-btn {
  font-size: 0.725rem;
  font-weight: 700;
  color: #b45309;
  background: #fef3c7;
  border: 1px solid #fde68a;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.service-admin-quick-edit-btn:hover {
  background: #fde68a;
  color: #78350f;
  transform: scale(1.04);
}

@keyframes pulseGreen {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  }

  70% {
    box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

.dispatch-live-status-card {
  animation: fadeIn 0.3s ease-in-out;
}

/* ==========================================
   GEO-DISTANCE & RADIUS CALCULATION STYLES
   ========================================== */
.tech-geo-filter-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  margin-bottom: 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}

.sort-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-sort-pill {
  background: var(--bg-body);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-sort-pill:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
  border-color: var(--border-focus);
}

.btn-sort-pill.active {
  background: var(--primary-600);
  color: #ffffff;
  border-color: var(--primary-600);
  box-shadow: 0 2px 8px rgba(179, 51, 52, 0.25);
}

.distance-badge-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 10px 0 12px 0;
  padding: 8px 12px;
  background: rgba(2, 132, 199, 0.06);
  border: 1px solid rgba(2, 132, 199, 0.18);
  border-radius: var(--radius-md);
}

.distance-main-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 700;
  color: #0369a1;
}

.distance-sub-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.radius-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
}

.radius-tag.within {
  background: #dcfce7;
  color: #166534;
}

.radius-tag.out {
  background: #fef3c7;
  color: #92400e;
}

/* User Management Role Badges */
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
}

.role-badge-admin {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.role-badge-ops {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.role-badge-store {
  background: #ffedd5;
  color: #c2410c;
  border: 1px solid #fed7aa;
}

.role-badge-technician {
  background: #fdf2f2;
  color: #b33334;
  border: 1px solid #fca5a5;
}

.role-badge-customer {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

/* ========================================================= */
/* TECHNICIAN AVAILABILITY & INTERACTIVE CALENDAR STYLES     */
/* ========================================================= */

.cal-mode-btn {
  border: none;
  background: transparent;
  padding: 5px 12px;
  border-radius: 8px;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.cal-mode-btn.active {
  background: white;
  color: var(--primary-600);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.cal-day-cell {
  aspect-ratio: 1;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.18s ease;
  background: #ffffff;
  position: relative;
  user-select: none;
}

.cal-day-cell:hover:not(.disabled) {
  border-color: var(--primary-400);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

.cal-day-cell.selected {
  border-color: var(--primary-600);
  background: #fff5f5;
  box-shadow: 0 0 0 2px rgba(179, 51, 52, 0.3);
}

.cal-day-cell.today {
  border: 2px solid #38bdf8;
}

.cal-day-cell.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  background: #f8fafc;
}

.cal-day-num {
  font-size: 0.85rem;
  font-weight: 700;
  color: #1e293b;
  margin-top: 2px;
}

.cal-day-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-bottom: 3px;
}

.dot-available { background: #22c55e; }
.dot-partial { background: #eab308; }
.dot-busy { background: #ef4444; }
.dot-day_off { background: #94a3b8; }

.status-pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.status-available { background: #dcfce7; color: #15803d; }
.status-busy { background: #fee2e2; color: #b91c1c; }
.status-day_off { background: #f1f5f9; color: #475569; }

.cal-slot-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cal-slot-card:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.cal-slot-card.selected {
  border-color: var(--primary-500);
  background: #fff5f5;
}

.cal-slot-card.active-slot {
  border-color: #86efac;
  background: #f0fdf4;
}

.cal-slot-card.inactive-slot {
  opacity: 0.6;
  background: #f8fafc;
}

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

.cal-slot-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.cal-slot-card.active-slot .cal-slot-icon {
  background: #dcfce7;
  color: #166534;
}

.cal-slot-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #0f172a;
}

.cal-slot-time {
  font-size: 0.75rem;
  color: #64748b;
}

.tech-cal-btn {
  transition: all 0.2s ease;
}

.tech-cal-btn:hover {
  background: #fdf2f2 !important;
  color: var(--primary-600) !important;
  border-color: var(--primary-300) !important;
}

@media (max-width: 768px) {
  .calendar-layout-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Homepage Dedicated Portals Gateway Cards */
.portal-card {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease !important;
}

.portal-card:hover {
  transform: translateY(-6px) !important;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.08) !important;
  border-color: var(--primary-300) !important;
}

.portal-card:hover .ph-arrow-right {
  transform: translateX(4px);
  transition: transform 0.2s ease;
}