/* ═══════════════════════════════════════════════════════════
   TopoOrganizer - Estilos principais
   ═══════════════════════════════════════════════════════════ */

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

/* ── Dashboard Design Tokens ─────────────────────────── */
:root {
  --bg-primary: #f5f6f8;
  --bg-secondary: #e8eaef;
  --bg-card: rgba(255,255,255,0.85);
  --text-primary: #0f1219;
  --text-secondary: #4a4f5e;
  --text-muted: #7c8290;
  --border-color: rgba(0,0,0,0.10);
  --glass-bg: rgba(255,255,255,0.4);
  --accent-color: #007AFF;
  --accent-hover: #0066d6;
}

[data-theme="dark"] {
  --bg-primary: #0B0E14;
  --bg-secondary: #10131a;
  --bg-card: rgba(16,19,24,0.65);
  --text-primary: #e6edf3;
  --text-secondary: #8b95a5;
  --text-muted: #505868;
  --border-color: rgba(255,255,255,0.04);
  --glass-bg: rgba(16,19,24,0.4);
}

:root {
  --primary: #007AFF;
  --primary-dark: #0066d6;
  --primary-light: rgba(0,122,255,0.1);
  --secondary: var(--bg-secondary);
  --accent: #10b981;
  --accent-light: #d1fae5;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --error: #ef4444;
  --error-light: #fee2e2;
  --bg: var(--bg-primary);
  --card: var(--bg-card);
  --text: var(--text-primary);
  --text-muted: var(--text-muted);
  --border: var(--border-color);
  --sidebar-bg: var(--bg-secondary);
  --sidebar-text: var(--text-secondary);
  --sidebar-active: #007AFF;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  --transition: 0.2s ease;
}

[data-theme="dark"] {
  --primary-light: rgba(0,122,255,0.15);
  --accent-light: rgba(16,185,129,0.15);
  --warning-light: rgba(245,158,11,0.15);
  --error-light: rgba(239,68,68,0.15);
  --shadow: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.4);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  font-size: 14px;
  min-height: 100vh;
}

/* ── Navbar ────────────────────────────────────────────── */
#navbar {
  height: 64px;
  background: color-mix(in srgb, var(--bg-primary) 60%, transparent);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
}

.navbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.navbar-left a {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s;
}

.navbar-left a:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

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

.navbar-brand small {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 8px;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

#btn-theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  color: var(--text-muted);
  transition: all 0.2s;
  display: flex;
  align-items: center;
}

#btn-theme-toggle:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.navbar-separator {
  width: 1px;
  height: 24px;
  background: var(--border-color);
  margin: 0 4px;
}

.user-avatar-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar-wrapper .user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.user-avatar-wrapper .user-role {
  font-size: 11px;
  color: var(--text-muted);
}

#user-avatar-img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--border-color);
}

#user-avatar-fallback {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #007AFF, #5856d6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 0 0 1px var(--border-color);
}

/* ── Layout ────────────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
  padding-top: 64px;
}

/* ── Sidebar Toggle ───────────────────────────────────── */
#btn-sidebar-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  color: var(--text-muted);
  transition: all 0.2s;
  align-items: center;
}

#btn-sidebar-toggle:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

/* ── Sidebar Overlay (mobile) ─────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  top: 64px;
  background: rgba(0,0,0,0.4);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.sidebar-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ── Sidebar ───────────────────────────────────────────── */
.sidebar {
  width: 240px;
  min-width: 240px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 64px;
  right: 0;
  bottom: 0;
  z-index: 100;
  overflow-y: auto;
  border-left: 1px solid var(--border-color);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo svg {
  color: #007AFF;
}

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

.sidebar-logo .subtitle {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 500;
  color: var(--sidebar-text);
  user-select: none;
}

.nav-item:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.nav-item.active {
  background: #007AFF;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,122,255,0.3);
}

.nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.nav-item .nav-badge {
  margin-left: auto;
  background: rgba(0,122,255,0.15);
  color: #007AFF;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  min-width: 22px;
  text-align: center;
}

.nav-item.active .nav-badge {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

.sidebar-stats {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
}

.sidebar-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
}

.sidebar-stat-label {
  font-size: 12px;
  color: var(--sidebar-text);
}

.sidebar-stat-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

/* ── Main Content ──────────────────────────────────────── */
.main-content {
  flex: 1;
  margin-right: 240px;
  padding: 32px;
  max-width: 100%;
  overflow-x: hidden;
}

.section {
  animation: fadeIn 0.2s ease;
}

.section.hidden {
  display: none !important;
}

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

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

.section-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.section-header p {
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Cards ─────────────────────────────────────────────── */
.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
}

/* ── Drop Zone ─────────────────────────────────────────── */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 32px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--card);
  margin-bottom: 20px;
}

.drop-zone:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.drop-zone.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: scale(1.01);
  box-shadow: var(--shadow-md);
}

.drop-zone-icon {
  color: var(--primary);
  margin-bottom: 12px;
}

.drop-zone-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.drop-zone-hint {
  font-size: 13px;
  color: var(--text-muted);
}

.drop-zone-formats {
  margin-top: 12px;
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
}

.format-tag {
  background: var(--bg);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
}

/* ── Import Actions ────────────────────────────────────── */
.import-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

/* ── File Cards ────────────────────────────────────────── */
.file-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
}

.file-card:hover {
  box-shadow: var(--shadow-md);
}

.file-card-disabled {
  opacity: 0.45;
  background: var(--bg);
}

.file-card-disabled:hover {
  opacity: 0.55;
}

.file-card-disabled .file-name {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* ── Toggle Switch ─────────────────────────────────────── */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 20px;
  transition: all var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: all var(--transition);
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--accent);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(16px);
}

.file-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
}

.file-icon {
  color: var(--primary);
  flex-shrink: 0;
}

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

.file-name {
  display: block;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-meta {
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Badges ────────────────────────────────────────────── */
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.badge-success {
  background: var(--accent-light);
  color: #065f46;
}

.badge-error {
  background: var(--error-light);
  color: #991b1b;
}

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

.badge-info {
  background: var(--primary-light);
  color: #1e40af;
}

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

.badge-warning {
  background: var(--warning-light);
  color: #92400e;
}

/* ── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border: none;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  font-family: inherit;
}

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

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  box-shadow: 0 2px 8px rgba(0,122,255,0.3);
}

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

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

.btn-success {
  background: var(--accent);
  color: #fff;
}

.btn-success:hover:not(:disabled) {
  background: #059669;
}

.btn-danger {
  background: var(--error);
  color: #fff;
}

.btn-danger:hover:not(:disabled) {
  background: #dc2626;
}

.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  color: var(--text-muted);
  transition: all var(--transition);
  display: inline-flex;
}

.btn-icon:hover {
  background: var(--error-light);
  color: var(--error);
}

/* ── Progress Bar ──────────────────────────────────────── */
.progress-container {
  margin: 16px 0;
}

.progress-bar-track {
  width: 100%;
  height: 6px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 3px;
  transition: width 0.3s ease;
  width: 0%;
}

/* ── Analysis Cards ────────────────────────────────────── */
.analysis-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.analysis-card.error-card {
  border-color: var(--error);
  border-left: 4px solid var(--error);
}

.analysis-card-disabled {
  opacity: 0.4;
  border-left: 4px solid #cbd5e1;
}

.analysis-card-disabled:hover {
  opacity: 0.55;
}

.analysis-card-disabled h3 {
  text-decoration: line-through;
  color: var(--text-muted);
}

.analysis-card-disabled .analysis-controls,
.analysis-card-disabled .col-mapping,
.analysis-card-disabled .table-wrapper,
.analysis-card-disabled .invalid-details,
.analysis-card-disabled h4 {
  pointer-events: none;
}

.analysis-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}

.analysis-header h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
}

.analysis-badges {
  display: flex;
  gap: 6px;
}

.analysis-controls {
  display: flex;
  gap: 24px;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--bg);
  border-radius: var(--radius);
  flex-wrap: wrap;
  align-items: center;
}

.analysis-card h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
  margin-top: 16px;
}

/* ── Column Mapping ────────────────────────────────────── */
.col-mapping {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}

.col-map-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 13px;
}

.col-map-item label {
  font-weight: 600;
  font-size: 12px;
  color: var(--text-muted);
  min-width: 60px;
}

.col-type-select {
  padding: 4px 8px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 12px;
  font-family: inherit;
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
}

.confidence {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
}

/* ── Column Tags ───────────────────────────────────────── */
.col-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.col-tag-ponto { background: #dbeafe; color: #1e40af; }
.col-tag-norte { background: #d1fae5; color: #065f46; }
.col-tag-este { background: #fef3c7; color: #92400e; }
.col-tag-cota { background: #e0e7ff; color: #3730a3; }
.col-tag-descricao { background: #fce7f3; color: #9d174d; }

.col-tag-latitude { background: #ccfbf1; color: #134e4a; }
.col-tag-longitude { background: #cffafe; color: #155e75; }
.col-tag-desconhecido { background: #f1f5f9; color: #64748b; }

/* ── Tables ────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

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

.data-table th {
  background: var(--bg);
  padding: 8px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 7px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.data-table tbody tr:hover {
  background: var(--bg-secondary);
}

.data-table .header-row th {
  background: var(--bg-secondary);
  font-style: italic;
  font-weight: 500;
  color: var(--text-primary);
}

.original-header {
  font-size: 11px !important;
}

.row-duplicate {
  background: var(--warning-light) !important;
}

.row-warning {
  background: #fefce8 !important;
}

.table-info {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* ── Pagination ────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}

.page-info {
  font-size: 13px;
  color: var(--text-muted);
}

/* ── Control Group ─────────────────────────────────────── */
.control-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.control-group label {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
}

.input-sm {
  padding: 5px 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 12px;
  font-family: inherit;
  background: var(--bg-card);
  color: var(--text-primary);
}

/* ── Filter Bar ────────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: end;
  margin-bottom: 16px;
  padding: 16px;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-group label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Export Grid ───────────────────────────────────────── */
.export-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.export-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all var(--transition);
}

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

.export-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
}

.export-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}

.export-icon-civil3d { background: #dbeafe; color: #2563eb; }
.export-icon-excel { background: #d1fae5; color: #059669; }
.export-icon-csv { background: #fef3c7; color: #d97706; }
.export-icon-kmz { background: #ccfbf1; color: #0d9488; }
.export-icon-txt { background: #e0e7ff; color: #4f46e5; }

.coord-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.coord-options select {
  flex: 1;
  min-width: 140px;
}

.text-xs {
  font-size: 11px !important;
  margin-top: 4px;
}

.export-options {
  font-size: 13px;
}

.export-options label {
  display: block;
  font-weight: 600;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
  margin-top: 8px;
}

.export-options select {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 12px;
  font-family: inherit;
  background: var(--bg-card);
  color: var(--text-primary);
}

.export-card .btn {
  margin-top: auto;
  justify-content: center;
}

.toggle-option {
  display: flex !important;
  align-items: center;
  gap: 6px;
  font-size: 12px !important;
  font-weight: 500 !important;
  color: var(--text) !important;
  cursor: pointer;
  margin-bottom: 4px;
}

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
}

.checkbox-group label {
  display: inline-flex !important;
  align-items: center;
  gap: 4px;
  font-weight: 500 !important;
  font-size: 12px !important;
  color: var(--text) !important;
  cursor: pointer;
}

/* ── Templates ─────────────────────────────────────────── */
.template-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  font-size: 13px;
  gap: 12px;
}

.template-item > div {
  display: flex;
  gap: 6px;
}

/* ── Report Summary ────────────────────────────────────── */
.report-summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.03em;
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

.stat-warning .stat-value { color: var(--warning); }
.stat-error .stat-value { color: var(--error); }

/* ── Invalid Details ───────────────────────────────────── */
.invalid-details {
  margin-top: 12px;
}

.invalid-details summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.invalid-list {
  margin-top: 8px;
  padding-left: 20px;
  font-size: 12px;
}

.invalid-list li {
  margin-bottom: 4px;
  word-break: break-all;
}

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

.empty-icon {
  color: var(--border);
  margin-bottom: 16px;
}

.empty-state p {
  margin-bottom: 4px;
}

/* ── Toast Notifications ───────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  max-width: 360px;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-success {
  background: var(--accent);
  color: #fff;
}

.toast-error {
  background: var(--error);
  color: #fff;
}

/* ── Utility Classes ───────────────────────────────────── */
.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }
.text-error { color: var(--error); }
.text-warning { color: var(--warning); }
.text-center { text-align: center; }
.text-mono { font-family: 'Cascadia Code', 'Fira Code', monospace; font-size: 12px; }
.mt-2 { margin-top: 12px; }
.mt-4 { margin-top: 24px; }
.mb-2 { margin-bottom: 12px; }

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 900px) {
  #btn-sidebar-toggle {
    display: flex;
  }

  .sidebar {
    width: 260px;
    min-width: 260px;
    transform: translateX(100%);
    box-shadow: none;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: -4px 0 24px rgba(0,0,0,0.15);
  }

  .sidebar-overlay {
    display: block;
  }

  .main-content {
    margin-right: 0;
    padding: 20px;
  }

  .export-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .main-content {
    padding: 12px;
  }

  .analysis-controls {
    flex-direction: column;
    align-items: flex-start;
  }

  .filter-bar {
    flex-direction: column;
  }

  .import-actions {
    flex-direction: column;
  }
}
