/* ===== ANTI-FLICKER: Instant State Control (must be first) ===== */
/* Default: Show login, hide dashboard */
#loginPage {
  display: flex;
  opacity: 1;
  visibility: visible;
  transition: opacity 200ms ease;
}

#dashboardContainer {
  display: none;
  opacity: 0;
  visibility: hidden;
}

/* Authenticated: Hide login, show dashboard */
body.authenticated #loginPage {
  display: none;
  opacity: 0;
  visibility: hidden;
}

body.authenticated #dashboardContainer {
  display: flex;
  opacity: 1;
  visibility: visible;
  transition: opacity 300ms ease 50ms;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  #loginPage, #dashboardContainer {
    transition: none !important;
  }
}

/* Spinner (single definition, JS toggles display) */
.auth-spinner-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: none; /* shown by JS */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 999999;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 5px solid rgba(255,255,255,0.3);
  border-top: 5px solid white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.spinner-text {
  color: white;
  margin-top: 24px;
  font-size: 18px;
  font-weight: 600;
}

/* ========== PREMIUM ENTERPRISE DESIGN SYSTEM ========== */
:root {
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --secondary: #64748b;
  --success: #059669;
  --danger: #dc2626;
  --warning: #d97706;
  --background: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  background: var(--background);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ========== ANIMATIONS (generic, non-conflicting) ========== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideIn {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}
@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.fade-in { animation: fadeIn 0.3s ease-out; }
.slide-in { animation: slideIn 0.4s ease-out; }

/* ========== LOGIN PAGE STYLES ========== */
/* Important: remove container-level opacity/animation to avoid flicker when state toggles */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px;
  /* No opacity or animation here to prevent “reload” jump */
}

.login-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  padding: 48px;
  max-width: 440px;
  width: 100%;
  transform: scale(0.98);
  animation: fadeIn 0.35s ease-out, scaleUp 0.35s ease-out;
}

@keyframes scaleUp {
  to { transform: scale(1); }
}

.login-logo {
  font-size: 32px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 12px;
  color: var(--primary);
}

.login-subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 32px;
  font-size: 14px;
}

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

.form-label {
  display: block;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-primary);
  font-size: 14px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  transition: all 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-input:read-only {
  background: #f8fafc;
  cursor: not-allowed;
}

.form-input + small {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-secondary);
}

.btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary-full {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-primary-full:hover { background: var(--primary-dark); transform: translateY(-1px); }

.error-message {
  background: #fef2f2;
  color: #991b1b;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
  display: none;
  animation: fadeIn 0.3s ease-out;
}

/* ========== DASHBOARD LAYOUT ========== */
.dashboard-container {
  display: none;
  min-height: 100vh;
}
.dashboard-container.active {
  display: flex;
  animation: fadeIn 0.4s ease-out;
}

/* ========== MOBILE MENU TOGGLE BUTTON ========== */
.mobile-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  margin-right: 12px;
  transition: all 0.2s;
}
.mobile-menu-toggle:hover { background: #f8fafc; border-color: var(--primary); }
.mobile-menu-toggle svg { width: 20px; height: 20px; color: var(--text-primary); }

/* ========== MOBILE OVERLAY ========== */
.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.mobile-overlay.active { display: block; opacity: 1; }

/* ========== SIDEBAR ========== */
.sidebar {
  width: 260px;
  background: white;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  animation: slideIn 0.4s ease-out;
  position: relative;
  z-index: 100;
}
.sidebar-header { padding: 24px; border-bottom: 1px solid var(--border); }
.sidebar-logo { font-size: 22px; font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.sidebar-tagline { font-size: 13px; color: var(--text-secondary); }
.sidebar-nav { flex: 1; padding: 16px; overflow-y: auto; }

.nav-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  margin-bottom: 4px;
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  cursor: pointer;
}
.nav-item:hover { background: #f1f5f9; color: var(--primary); }
.nav-item.active { background: #eff6ff; color: var(--primary); }
.nav-item svg { width: 18px; height: 18px; margin-right: 10px; flex-shrink: 0; }

.draft-badge {
  margin-left: auto;
  background: #2563eb;
  color: white;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

.sidebar-footer { padding: 16px; border-top: 1px solid var(--border); }
.plan-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 16px;
  border-radius: 10px;
  color: white;
}
.plan-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.plan-name { font-weight: 600; font-size: 14px; }
.upgrade-link { font-size: 12px; color: white; text-decoration: underline; cursor: pointer; }
.plan-details { font-size: 12px; opacity: 0.9; margin-bottom: 12px; min-height: 18px; }
.quota-bar { height: 6px; background: rgba(255,255,255,0.3); border-radius: 3px; overflow: hidden; margin-bottom: 8px; }
.quota-fill { height: 100%; background: white; border-radius: 3px; transition: width 0.5s ease; }
.quota-text { font-size: 11px; opacity: 0.9; }

/* ========== MAIN CONTENT ========== */
.main-content { flex: 1; overflow-y: auto; background: var(--background); }

.top-bar {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 16px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
}
.top-bar-left { display: flex; align-items: center; gap: 12px; }
.top-bar-left h1.dashboard-header-title { font-size: 1.75rem; font-weight: 700; color: #0f172a; margin-bottom: 2px; }
.top-bar-left p.dashboard-header-subtitle { font-size: 0.95rem; font-weight: 500; color: #6b7280; }

.top-bar-right { display: flex; align-items: center; gap: 16px; position: relative; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #ffffff;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover { background: #f9fafb; color: var(--primary); box-shadow: var(--shadow-md); }
.btn-secondary svg { width: 16px; height: 16px; }
.btn-secondary.refreshing svg { animation: spin 1s linear infinite; }

.btn-secondary-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border: 1px solid var(--border);
  background: white;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-secondary-sm:hover { background: #f1f5f9; }

.btn-secondary-full {
  width: 100%;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: white;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  text-decoration: none;
  color: var(--text-primary);
}
.btn-secondary-full:hover { background: #f1f5f9; border-color: var(--primary); }
.btn-secondary-full svg { width: 16px; height: 16px; }

.user-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  cursor: pointer;
  transition: all 0.2s;
}
.user-menu:hover { background: #e2e8f0; }

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
}
.user-menu span#userLoginId { font-size: 0.85rem; font-weight: 500; }
.user-menu svg { width: 16px; height: 16px; }

.user-dropdown {
  position: absolute;
  right: 0;
  top: 110%;
  min-width: 180px;
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  padding: 6px 0;
  display: none;
  z-index: 20;
  animation: fadeIn 0.2s ease-out;
}
.user-dropdown.show { display: block; }
.user-dropdown-item {
  width: 100%;
  padding: 10px 16px;
  text-align: left;
  font-size: 0.85rem;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: background 0.15s;
  color: var(--text-primary);
}
.user-dropdown-item:hover { background: #f1f5f9; }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

.content-area { padding: 32px; }
.page-section { display: none; }
.page-section.active { display: block; animation: fadeIn 0.3s ease-out; }

/* ========== STATS GRID ========== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}
.stat-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}
.stat-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.stat-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; margin-bottom: 16px;
}
.stat-icon svg { width: 24px; height: 24px; }
.stat-value { font-size: 32px; font-weight: 700; margin-bottom: 4px; }
.stat-label { font-size: 14px; color: var(--text-secondary); margin-bottom: 8px; }
.stat-change { font-size: 12px; font-weight: 500; }
.stat-change.positive { color: var(--success); }
.stat-change.negative { color: var(--danger); }

.stat-card-compact {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}
.stat-card-compact .stat-label { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.stat-card-compact .stat-value { font-size: 28px; font-weight: 700; }

/* ========== CHARTS ========== */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}
.chart-grid-full { margin-bottom: 32px; }
.chart-card { background: white; border: 1px solid var(--border); border-radius: 12px; padding: 24px; }
.chart-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; color: var(--text-primary); }
.chart-container { height: 300px; position: relative; }
.chart-container-lg { height: 400px; position: relative; }

/* ========== TABLES ========== */
.table-card { background: white; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.table-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.table-header h3 { font-size: 18px; font-weight: 600; }
.table-responsive { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead { background: #f8fafc; }
.data-table th {
  padding: 12px 24px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.data-table td { padding: 16px 24px; border-top: 1px solid var(--border); font-size: 14px; }
.data-table tbody tr { transition: background 0.15s; }
.data-table tbody tr:hover { background: #f8fafc; }
.empty-state {
  text-align: center;
  padding: 48px 24px !important;
  color: var(--text-secondary);
  font-style: italic;
}

/* ========== FILTERS ========== */
.filters-bar {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 20px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.filter-group { display: flex; flex-direction: column; gap: 6px; }
.filter-group label { font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.filter-select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  background: white;
  cursor: pointer;
}
.filter-select:focus { outline: none; border-color: var(--primary); }

.search-box { flex: 1; min-width: 200px; position: relative; display: flex; align-items: center; }
.search-box svg { position: absolute; left: 12px; width: 16px; height: 16px; color: var(--text-secondary); }
.search-box input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
}
.search-box input:focus { outline: none; border-color: var(--primary); }

/* ========== SETTINGS ========== */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 24px;
}
.settings-card { background: white; border: 1px solid var(--border); border-radius: 12px; padding: 24px; }
.settings-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.settings-description {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.6;
}
.plan-info { margin-bottom: 20px; }
.plan-badge {
  display: inline-block;
  padding: 6px 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 16px;
}
.plan-stat {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.plan-stat:last-child { border-bottom: none; }
.plan-stat span { color: var(--text-secondary); }
.plan-stat strong { color: var(--text-primary); }

.forwarding-address {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  font-family: 'Courier New', monospace;
  font-size: 15px;
  text-align: center;
  margin-bottom: 16px;
  color: var(--primary);
  font-weight: 600;
}

.faq-item { padding: 16px 0; border-bottom: 1px solid var(--border); }
.faq-item:last-of-type { border-bottom: none; padding-bottom: 16px; margin-bottom: 16px; }
.faq-item strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text-primary);
  font-size: 14px;
}
.faq-item p { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }

/* ========== MOBILE RESPONSIVE ========== */
@media (max-width: 768px) {
  .mobile-menu-toggle { display: flex; }

  .sidebar {
    position: fixed;
    left: -260px;
    height: 100vh;
    z-index: 100;
    transition: left 0.3s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.mobile-open { left: 0; }

  .stats-grid, .chart-grid, .settings-grid { grid-template-columns: 1fr; }

  .top-bar { padding: 12px 16px; }
  .top-bar-left { flex-direction: column; align-items: flex-start; gap: 0; }
  .top-bar-left h1.dashboard-header-title { font-size: 1.25rem; }
  .top-bar-left p.dashboard-header-subtitle { font-size: 0.8rem; }

  .content-area { padding: 16px; }
  .login-card { padding: 32px 24px; }

  .filters-bar { flex-direction: column; align-items: stretch; }
  .filter-group { width: 100%; }
  .search-box { min-width: 100%; }
  .chart-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }

  .btn-secondary span { display: none; }
  .user-menu span#userLoginId { display: none; }
}

@media (max-width: 480px) {
  .top-bar-left h1.dashboard-header-title { font-size: 1.1rem; }
  .stats-grid { grid-template-columns: 1fr; }
  .stat-card { padding: 16px; }
  .chart-card { padding: 16px; }
  .data-table th, .data-table td { padding: 8px 12px; font-size: 12px; }
}

/* ========== LOADING STATES ========== */
.loading { opacity: 0.6; pointer-events: none; }
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}
@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ========== PRINT STYLES ========== */
@media print {
  .sidebar, .top-bar, .filters-bar, .btn-secondary, .btn-secondary-sm, .btn-primary-full {
    display: none !important;
  }
  .main-content { overflow: visible; }
  .page-section { display: block !important; }
}

/* Upload Modal Styles */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.modal-content {
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  width: 90%;
  max-width: 800px;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
}
.modal-header h2 { margin: 0; font-size: 20px; color: var(--text-primary); }
.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 32px;
  height: 32px;
}
.modal-close:hover { color: var(--text-primary); }
.modal-body { padding: 24px; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid #e5e7eb;
}

/* Upload Section */
.upload-section {
  margin-bottom: 24px;
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
}
.upload-section h4 { margin: 0 0 12px 0; font-size: 15px; color: var(--text-primary); }
.file-input { display: none; }
.file-label {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; background: #2563eb; color: white; border-radius: 6px;
  cursor: pointer; font-size: 14px; transition: background 0.2s;
}
.file-label:hover { background: #1d4ed8; }
.file-list { margin-top: 12px; font-size: 13px; color: var(--text-secondary); }
.file-list-item {
  padding: 8px; background: white; border: 1px solid #e5e7eb;
  border-radius: 4px; margin-top: 4px;
}

/* ========== AGENT DATA CARDS ========== */
.agent-category-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  transition: all 0.3s ease;
}
.agent-category-card:hover { border-color: #2563eb; box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1); }

.agent-header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.agent-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.agent-title { margin: 0 0 4px 0; font-size: 15px; font-weight: 600; color: var(--text-primary); }
.agent-subtitle { margin: 0; font-size: 12px; color: var(--text-secondary); }
.agent-stats {
  display: flex; gap: 16px; padding: 12px; background: #f9fafb; border-radius: 8px;
}
.agent-stat-item { flex: 1; text-align: center; }
.agent-stat-item .stat-number {
  display: block; font-size: 16px; font-weight: 700; color: var(--text-primary); margin-bottom: 2px;
}
.agent-stat-item .stat-text {
  display: block; font-size: 11px; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.5px;
}

.btn-icon {
  width: 36px; height: 36px; border-radius: 8px;
  border: 1px solid #e5e7eb; background: white; color: var(--text-secondary);
  cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s;
}
.btn-icon:hover { background: #2563eb; border-color: #2563eb; color: white; }

/* ========== FILE DROP ZONE ========== */
.file-drop-zone {
  border: 2px dashed #d1d5db;
  border-radius: 12px;
  padding: 40px 20px;
  text-align: center;
  transition: all 0.3s;
  cursor: pointer;
  background: #f9fafb;
}
.file-drop-zone:hover { border-color: #2563eb; background: #eff6ff; }
.file-drop-zone.dragover { border-color: #2563eb; background: #eff6ff; border-style: solid; }

/* ========== SELECTED FILES ========== */
#fileItems { display: flex; flex-direction: column; gap: 8px; }
.file-item {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 8px;
}
.file-item-icon {
  width: 36px; height: 36px; background: #eff6ff; color: #2563eb;
  border-radius: 6px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.file-item-info { flex: 1; min-width: 0; }
.file-item-name {
  font-size: 14px; font-weight: 500; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.file-item-size { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.file-item-remove {
  width: 28px; height: 28px; border: none; background: #fee2e2; color: #dc2626;
  border-radius: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s;
}
.file-item-remove:hover { background: #dc2626; color: white; }

/* ========== MODAL STYLES ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(2px);
}
.modal-content {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  width: 90%;
  max-width: 650px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px; border-bottom: 1px solid #e5e7eb;
}
.modal-header h2 {
  margin: 0; font-size: 20px; color: var(--text-primary);
  display: flex; align-items: center;
}
.modal-close {
  background: none; border: none; font-size: 32px; color: var(--text-secondary);
  cursor: pointer; line-height: 1; padding: 0; width: 36px; height: 36px;
  border-radius: 6px; transition: all 0.2s;
}
.modal-close:hover { background: #f3f4f6; color: var(--text-primary); }
.modal-body { padding: 24px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 12px;
  padding: 20px 24px; border-top: 1px solid #e5e7eb;
}

/* ========== EMPTY STATE ========== */
.empty-state { text-align: center; padding: 60px 20px !important; color: var(--text-secondary); }
.empty-state i { display: block; margin: 0 auto 12px; }
.empty-state p { margin: 0; font-size: 14px; }
