/* ==========================================================================
   پولاد سازه - سبک مونوکروم متالیک سوئیسی (Swiss Engineering & Titanium)
   Poulad Sazeh Exhibition Registration System - Swiss Precision Design
   ========================================================================== */

/* ☀️ حالت روز (Swiss Architectural Light Mode) */
:root {
  --primary: #1c1917;         /* تیتانیوم دودی سوئیسی */
  --primary-dark: #0c0a09;    /* مشکی مات عمیق */
  --primary-light: #44403c;   /* تیتانیوم متوسط */
  --accent: #d97706;          /* کهربایی متالیک / شامپاینی صنعتی */
  --accent-light: #f59e0b;    /* طلایی صنعتی */
  --accent-hover: #b45309;    /* کهربایی گرم */
  
  --bg-main: #f5f5f4;         /* زمینه سنگی خاکستری ملایم */
  --bg-card: #ffffff;         /* کارت سفید خالص */
  --bg-input: #f5f5f4;        /* فیلد ورودی خنثی */
  --bg-subtle: #e7e5e4;       /* زمینه فرعی */
  
  --header-bg: #ffffff;       /* هدر متالیک روشن */
  --header-text: #1c1917;
  --header-border: #d6d3d1;
  --header-logo-bg: #f5f5f4;
  
  --text-main: #1c1917;       /* متن تیره با خوانایی بالا */
  --text-muted: #78716c;      /* متن کم‌رنگ مهندسی */
  --text-light: #a8a29e;
  
  --border-color: #d6d3d1;    /* حاشیه‌های مویی ۱ پیکسلی دقیق */
  --border-focus: #1c1917;    /* کادر فوکوس مونوکروم */
  
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --danger-text: #991b1b;
  
  --warning: #d97706;
  --warning-bg: #fef3c7;
  --warning-text: #92400e;
  
  --success: #15803d;
  --success-bg: #dcfce7;
  --success-text: #14532d;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 3px 8px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 20px rgba(0, 0, 0, 0.08);
  
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-full: 9999px;
}

/* 🌙 حالت شب (Swiss Brushed Dark Titanium Mode) */
[data-theme="dark"] {
  --primary: #fafaf9;         /* سفید تیتانیومی */
  --primary-dark: #f5f5f4;    /* نقره‌ای تیتانیوم */
  --primary-light: #d6d3d1;
  --accent: #f59e0b;          /* کهربایی طلایی متالیک */
  --accent-light: #fbbf24;
  --accent-hover: #d97706;
  
  --bg-main: #141413;         /* تخته تیتانیوم مات */
  --bg-card: #1c1917;         /* پنل متالیک تیره */
  --bg-input: #292524;        /* فیلد خاکستری تیره */
  --bg-subtle: #292524;
  
  --header-bg: #181816;       /* هدر تیره لوکس */
  --header-text: #fafaf9;
  --header-border: #383533;
  --header-logo-bg: #292524;
  
  --text-main: #fafaf9;       /* سفید متالیک */
  --text-muted: #a8a29e;      /* خاکستری روشن خوانا */
  --text-light: #78716c;
  
  --border-color: #383533;    /* حاشیه‌های ۱ پیکسلی مهندسی */
  --border-focus: #f59e0b;
  
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.15);
  --danger-text: #fca5a5;
  
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.15);
  --warning-text: #fde68a;
  
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.15);
  --success-text: #6ee7b7;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.65);
}

@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

body {
  font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  direction: rtl;
  text-align: right;
  line-height: 1.6;
  font-size: 15px;
  min-height: 100vh;
  padding-bottom: 80px; /* Space for bottom navigation on mobile */
  user-select: none;
}

input, textarea, select {
  user-select: text;
}

/* Header */
.app-header {
  background: var(--header-bg);
  color: var(--header-text);
  padding: 14px 20px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
  border-bottom: 2px solid var(--accent);
}

.header-container {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.brand-logo-icon {
  width: 42px;
  height: 42px;
  background: var(--header-logo-bg);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-titles h1 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--header-text);
  line-height: 1.2;
}

.brand-titles p {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 500;
}

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

.network-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-muted);
  transition: all 0.3s ease;
}

.network-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.network-badge.online {
  background: var(--success-bg);
  border-color: var(--success);
  color: var(--success-text);
}

.network-badge.online .dot {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: pulseGreen 1.5s infinite;
}

.network-badge.offline {
  background: var(--warning-bg);
  border-color: var(--warning);
  color: var(--warning-text);
}

.network-badge.offline .dot {
  background: var(--warning);
}

.network-badge.syncing {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.5);
  color: #93c5fd;
}

@keyframes pulseGreen {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.badge-device {
  background: var(--bg-input);
  color: var(--text-main);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--border-color);
}

.badge-device:hover {
  border-color: var(--accent);
}

.badge-count {
  background: var(--accent);
  color: white;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Theme Toggle Button */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-main);
  transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.btn-icon-header {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-icon-header:hover {
  border-color: var(--accent);
}

/* Install Banner */
.install-banner {
  background: var(--bg-card);
  color: var(--text-main);
  border-bottom: 2px solid var(--accent);
  padding: 10px 16px;
  display: none; /* Shown dynamically via JS */
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  box-shadow: var(--shadow-sm);
}

.install-banner.show {
  display: flex;
}

.install-banner button {
  background: var(--accent);
  color: white;
  border: none;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: 0.8rem;
  font-family: inherit;
}

/* Container */
.container {
  max-width: 900px;
  margin: 16px auto;
  padding: 0 16px;
}

/* Tab Content Visibility */
.tab-content {
  display: none;
  animation: fadeIn 0.2s ease-in-out;
}

.tab-content.active {
  display: block;
}

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

/* Bottom Navigation Bar */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -3px 10px rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: space-around;
  padding: 6px 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.nav-item {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  min-width: 68px;
}

.nav-item svg {
  width: 22px;
  height: 22px;
  margin-bottom: 3px;
  stroke: currentColor;
  transition: transform 0.2s;
}

.nav-item.active {
  color: var(--accent);
  font-weight: 800;
}

.nav-item.active svg {
  transform: scale(1.15);
  stroke: var(--accent);
}

/* Card Component */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  padding: 20px;
  margin-bottom: 20px;
}

.card-title-box {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1.5px solid var(--border-color);
}

.card-title-box h2 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary-dark);
}

.card-title-box svg {
  color: var(--primary);
}

/* Intake Mode Switcher (Speed Run vs Full Profile) */
.intake-mode-switcher {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 8px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.intake-mode-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1.5px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
  text-align: right;
}

.intake-mode-btn .mode-icon {
  font-size: 1.35rem;
  flex-shrink: 0;
}

.intake-mode-btn .mode-text {
  display: flex;
  flex-direction: column;
}

.intake-mode-btn .mode-text strong {
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.3;
}

.intake-mode-btn .mode-text small {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.intake-mode-btn:hover {
  background: var(--bg-subtle);
  border-color: var(--border-color);
}

.intake-mode-btn.active {
  background: var(--bg-card);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.18);
}

.intake-mode-btn.active .mode-text strong {
  color: var(--accent);
}

/* Smart Paste Button */
.btn-smart-paste {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: inherit;
  padding: 5px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-smart-paste:hover {
  background: var(--bg-subtle);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

/* Collapsible Project & Org Details in Quick Mode */
.details-expand-toggle {
  width: 100%;
  padding: 12px 18px;
  background: var(--bg-card);
  border: 1.5px dashed var(--border-color);
  border-radius: var(--radius-lg);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 16px;
}

.details-expand-toggle:hover {
  border-color: var(--accent);
  background: var(--bg-subtle);
  color: var(--accent);
}

.details-expand-toggle .toggle-icon {
  font-size: 1.1rem;
  transition: transform 0.25s ease;
}

.details-expand-toggle.open .toggle-icon {
  transform: rotate(180deg);
}

.secondary-details-wrap {
  display: block;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.secondary-details-wrap.collapsed {
  display: none;
}

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

@media (min-width: 640px) {
  .form-grid.two-cols {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.form-label {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 3px;
}

.label-hint-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.label-hint-badge.required {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.label-hint-badge.optional {
  background: var(--bg-input);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.required-star {
  color: var(--danger);
  font-weight: 900;
}

.form-control {
  width: 100%;
  padding: 12px 14px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text-main);
  background-color: var(--bg-input);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  outline: none;
  transition: all 0.2s ease;
}

.form-control:focus {
  background-color: var(--bg-card);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.18);
}

textarea.form-control {
  min-height: 90px;
  resize: vertical;
}

/* Quick Suggestion Chips */
.quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.chip-btn {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  font-family: inherit;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  user-select: none;
}

.chip-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.chip-btn.active {
  background: var(--bg-subtle);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 800;
  box-shadow: 0 0 0 1px var(--accent);
}

/* Checkbox and Option Cards */
.options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 4px;
}

@media (min-width: 640px) {
  .options-grid.four-cols {
    grid-template-columns: repeat(4, 1fr);
  }
  .options-grid.three-cols {
    grid-template-columns: repeat(3, 1fr);
  }
}

.custom-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

.custom-option .opt-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.custom-option .opt-title strong {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-main);
}

.custom-option .opt-title small {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.custom-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.custom-option .opt-box {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-input);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.custom-option input[type="radio"] + .opt-box {
  border-radius: 50%;
}

.custom-option input:checked + .opt-box {
  background: var(--accent);
  border-color: var(--accent);
}

.custom-option input:checked + .opt-box::after {
  content: "";
  display: block;
}

.custom-option input[type="checkbox"]:checked + .opt-box::after {
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
  margin-bottom: 2px;
}

.custom-option input[type="radio"]:checked + .opt-box::after {
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 50%;
}

.custom-option:hover {
  background: var(--bg-subtle);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.custom-option.selected {
  border-color: var(--accent);
  background: var(--bg-subtle);
  color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 3px 10px rgba(217, 119, 6, 0.15);
}

.custom-option.selected .opt-title strong {
  color: var(--accent);
}

/* Host Section Card Styling */
.host-section-card {
  background: var(--bg-input);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-top: 10px;
}

.host-badge-header {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: var(--bg-card);
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 14px;
}

/* Priority Option Variants */
.priority-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.priority-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 8px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg-card);
  color: var(--text-main);
  text-align: center;
  gap: 6px;
}

.priority-option:hover {
  background: var(--bg-subtle);
  border-color: var(--accent);
}

.priority-option input {
  display: none;
}

.priority-option .p-indicator {
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.priority-option.urgent .p-indicator { background: var(--danger); box-shadow: 0 0 6px rgba(239, 68, 68, 0.4); }
.priority-option.medium .p-indicator { background: var(--warning); box-shadow: 0 0 6px rgba(245, 158, 11, 0.4); }
.priority-option.low .p-indicator { background: var(--success); box-shadow: 0 0 6px rgba(16, 185, 129, 0.4); }

.priority-option .p-title {
  font-size: 0.85rem;
  font-weight: 700;
}

.priority-option.urgent.selected {
  border-color: var(--danger);
  background: var(--danger-bg);
  color: var(--danger-text);
}

.priority-option.medium.selected {
  border-color: var(--warning);
  background: var(--warning-bg);
  color: var(--warning-text);
}

.priority-option.low.selected {
  border-color: var(--success);
  background: var(--success-bg);
  color: var(--success-text);
}

/* Voice Input Button */
.voice-input-wrapper {
  position: relative;
}

.voice-btn {
  position: absolute;
  left: 8px;
  bottom: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  border-radius: var(--radius-full);
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.voice-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
  border-color: var(--accent);
}

.voice-btn.recording {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
  animation: pulse 1s infinite alternate;
}

@keyframes pulse {
  from { opacity: 0.8; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1.04); }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}

.btn-primary {
  background: var(--primary);
  color: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

.btn-accent {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 3px 8px rgba(217, 119, 6, 0.25);
}

.btn-accent:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-subtle);
}

.btn-success {
  background: var(--success);
  color: white;
  box-shadow: 0 3px 8px rgba(21, 128, 61, 0.25);
}

.form-actions-row {
  display: flex;
  gap: 12px;
  margin-top: 14px;
}

/* Search and Filters Bar */
.search-filter-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.search-input-box {
  position: relative;
  margin-bottom: 12px;
}

.search-input-box svg {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  pointer-events: none;
}

.search-input-box input {
  padding-right: 40px;
}

.filter-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.filter-pills::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  background: var(--bg-input);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.filter-pill.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

/* Visitor Cards List */
.visitors-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.visitor-item-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

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

.visitor-item-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 5px;
  height: 100%;
}

.visitor-item-card.priority-urgent::before { background: var(--danger); }
.visitor-item-card.priority-medium::before { background: var(--warning); }
.visitor-item-card.priority-low::before { background: var(--success); }

.item-top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.item-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.item-meta {
  font-size: 0.75rem;
  color: var(--text-light);
}

.item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

.tag-badge {
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  background: var(--bg-input);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.tag-badge.company {
  background: var(--bg-subtle);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.tag-badge.urgent {
  background: var(--danger-bg);
  color: var(--danger-text);
  font-weight: 700;
}

.tag-badge.medium {
  background: var(--warning-bg);
  color: var(--warning-text);
  font-weight: 700;
}

.tag-badge.low {
  background: var(--success-bg);
  color: var(--success-text);
  font-weight: 700;
}

.tag-badge.status {
  background: var(--bg-subtle);
  color: var(--accent);
  border: 1px solid var(--border-color);
  font-weight: 700;
}

.tag-badge.lead-step {
  background: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  font-weight: 700;
}

.item-notes-box {
  font-size: 0.82rem;
  color: var(--text-main);
  background: var(--bg-subtle);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  margin: 6px 0;
  border-right: 3px solid var(--accent);
  white-space: pre-wrap;
  line-height: 1.5;
}

.item-phone-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-color);
}

.item-phone {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--accent);
  direction: ltr;
  text-align: left;
}

.item-actions {
  display: flex;
  gap: 6px;
}

.btn-action-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-main);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}

.btn-action-icon.call {
  background: var(--success-bg);
  color: var(--success-text);
  border-color: var(--success);
}

.btn-action-icon:hover {
  border-color: var(--accent);
  filter: brightness(0.95);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state svg {
  width: 56px;
  height: 56px;
  stroke: var(--border-color);
  margin-bottom: 12px;
}

.empty-state h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

/* Analytics Dashboard */
.analytics-control-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin-bottom: 20px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.analytics-filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 200px;
}

.analytics-filter-group label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.analytics-select {
  padding: 6px 12px;
  font-size: 0.84rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-main);
  cursor: pointer;
  width: auto;
  min-width: 170px;
}

.analytics-actions {
  display: flex;
  gap: 8px;
  margin-right: auto;
}

.analytics-btn-print {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  padding: 7px 14px;
  font-weight: 700;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.15s ease;
}

.analytics-btn-print:hover {
  background: var(--bg-subtle);
  border-color: var(--accent);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

@media (min-width: 640px) {
  .kpi-grid.six-cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .kpi-grid.six-cards {
    grid-template-columns: repeat(6, 1fr);
  }
}

.kpi-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px 14px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.kpi-card .kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kpi-card .kpi-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.kpi-card .kpi-icon {
  font-size: 1.15rem;
}

.kpi-card .kpi-value {
  font-size: 1.65rem;
  font-weight: 900;
  color: var(--text-main);
  line-height: 1.2;
}

.kpi-card .kpi-sub {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 2px;
}

.kpi-card.urgent .kpi-value { color: var(--danger); }
.kpi-card.urgent .kpi-sub { color: var(--danger); }
.kpi-card.urgent { border-top: 3px solid var(--danger); }

.kpi-card.execution .kpi-value { color: var(--accent); }
.kpi-card.execution { border-top: 3px solid var(--accent); }

.kpi-card.pipeline .kpi-value { color: var(--success); }
.kpi-card.pipeline { border-top: 3px solid var(--success); }

.kpi-card.industrial .kpi-value { color: #f97316; }
.kpi-card.industrial { border-top: 3px solid #f97316; }

.kpi-card.peak .kpi-value { color: #8b5cf6; }
.kpi-card.peak { border-top: 3px solid #8b5cf6; }

/* BI Insights Box */
.bi-insights-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.bi-insights-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.bi-insights-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 768px) {
  .bi-insights-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.bi-insight-item {
  background: var(--bg-card);
  backdrop-filter: blur(4px);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 0.84rem;
  color: var(--text-main);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--border-color);
}

.bi-insight-icon {
  font-size: 1.1rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Charts Grid */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

@media (min-width: 768px) {
  .charts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.chart-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 18px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

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

.chart-card h3 {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
}

.chart-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  background: var(--bg-input);
  color: var(--text-muted);
  border-radius: 4px;
}

.chart-container {
  position: relative;
  height: 250px;
  width: 100%;
}

/* Leaderboard Table */
.leaderboard-card {
  overflow: hidden;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.leaderboard-table th {
  background: var(--bg-input);
  color: var(--text-muted);
  font-weight: 800;
  padding: 10px 12px;
  text-align: right;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
}

.leaderboard-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  vertical-align: middle;
}

.leaderboard-table tr:hover {
  background: var(--bg-subtle);
}

.staff-rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 800;
  background: var(--bg-subtle);
  color: var(--text-main);
}

.staff-rank-badge.rank-1 { background: #fef3c7; color: #b45309; }
.staff-rank-badge.rank-2 { background: var(--bg-subtle); color: var(--text-muted); }
.staff-rank-badge.rank-3 { background: #ffedd5; color: #c2410c; }

.leaderboard-progress-container {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 120px;
}

.leaderboard-progress-bar {
  flex: 1;
  height: 7px;
  background: var(--bg-subtle);
  border-radius: 10px;
  overflow: hidden;
}

.leaderboard-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  border-radius: 10px;
}

/* Toast Notification */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 90%;
  width: 360px;
}

.toast {
  background: #0f172a;
  color: white;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

.toast.success { background: #065f46; border-right: 4px solid #10b981; }
.toast.error { background: #991b1b; border-right: 4px solid #ef4444; }
.toast.info { background: #1e3a8a; border-right: 4px solid #3b82f6; }

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

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

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

.modal-box {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  max-width: 550px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  animation: popIn 0.2s ease;
}

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

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
}

.btn-close-modal {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-full);
}

.btn-close-modal:hover {
  color: var(--accent);
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Details View Table */
.details-table {
  width: 100%;
  border-collapse: collapse;
}

.details-table tr {
  border-bottom: 1px solid var(--border-color);
}

.details-table td {
  padding: 10px 6px;
  font-size: 0.9rem;
  color: var(--text-main);
}

.details-table td:first-child {
  font-weight: 700;
  color: var(--text-muted);
  width: 35%;
}

/* Export Tab Cards */
.export-hero-card {
  background: var(--bg-card);
  color: var(--text-main);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  text-align: center;
}

.export-hero-card h2 {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--text-main);
  margin-bottom: 8px;
}

.export-hero-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.excel-btn-lg {
  background: #10b981;
  color: white;
  font-weight: 800;
  font-size: 1.05rem;
  padding: 15px 28px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
  transition: all 0.2s;
}

.excel-btn-lg:hover {
  background: #059669;
  transform: translateY(-2px);
}

.features-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 20px;
  text-align: right;
}

@media (min-width: 640px) {
  .features-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

.feature-box {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 0.85rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.feature-box svg {
  color: var(--accent);
  flex-shrink: 0;
}

/* Excel Live Sync Info Box */
.excel-live-info-box {
  background: var(--bg-subtle);
  border: 1.5px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-top: 16px;
  font-size: 0.84rem;
  color: var(--text-main);
  text-align: center;
  line-height: 1.6;
}

.excel-live-info-box code {
  background: var(--bg-input);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-weight: 700;
}

/* Users Management Table (Admin) */
.users-admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.users-admin-table th {
  background: var(--bg-subtle);
  color: var(--text-main);
  font-weight: 800;
  padding: 10px 12px;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
}

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

.users-admin-table tr:hover {
  background: var(--bg-subtle);
}

.user-role-badge {
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  display: inline-block;
}

.user-role-badge.admin {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger);
}

.user-role-badge.staff {
  background: var(--bg-subtle);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

/* Print Utilities */
@media print {
  body {
    padding: 0 !important;
    background: #fff !important;
    color: #000 !important;
  }
  .app-header, .bottom-nav, .nav-tabs, .analytics-control-bar, .toast-container, .btn, .btn-action-icon, #fileProtocolWarning, #installBanner, .search-filter-card {
    display: none !important;
  }
  .tab-content {
    display: none !important;
  }
  #tab-analytics {
    display: block !important;
    padding: 0 !important;
    max-width: 100% !important;
  }
  .kpi-grid.six-cards {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
    margin-bottom: 12px !important;
  }
  .kpi-card {
    box-shadow: none !important;
    border: 1px solid #cbd5e1 !important;
    padding: 10px !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .bi-insights-card {
    box-shadow: none !important;
    border: 1px solid #cbd5e1 !important;
    background: #f8fafc !important;
    margin-bottom: 14px !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .charts-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }
  .chart-card {
    box-shadow: none !important;
    border: 1px solid #cbd5e1 !important;
    padding: 12px !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .chart-container {
    height: 220px !important;
  }
  .leaderboard-card {
    box-shadow: none !important;
    border: 1px solid #cbd5e1 !important;
    break-inside: avoid;
    page-break-inside: avoid;
    margin-top: 14px !important;
  }
  .leaderboard-table th, .leaderboard-table td {
    padding: 6px 8px !important;
    font-size: 0.75rem !important;
  }
}
