@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  /* Palette sobre et professionnelle */
  --bg: #fafbfc;
  --bg-secondary: #f4f6f8;
  --card: #ffffff;
  --text: #1a202c;
  --text-secondary: #4a5568;
  --text-tertiary: #718096;
  
  /* Accents minimalistes */
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  
  /* Bordures subtiles */
  --border: #e2e8f0;
  --border-hover: #cbd5e0;
  
  /* Ombres douces */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  
  --radius: 12px;
  --font: 'DM Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', 'Courier New', monospace;
}

[data-theme="dark"] {
  --bg: #0f1419;
  --bg-secondary: #1a1f2e;
  --card: #1e2433;
  --text: #f7f9fb;
  --text-secondary: #b4bcd0;
  --text-tertiary: #8892a6;
  --border: #2d3748;
  --border-hover: #4a5568;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
}

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header minimaliste */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 251, 252, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}

[data-theme="dark"] .topbar {
  background: rgba(15, 20, 25, 0.95);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 16px;
}

.brand-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}

.brand-subtitle {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 500;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Boutons sobres */
.btn {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn:hover {
  border-color: var(--border-hover);
  background: var(--bg-secondary);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--bg-secondary);
}

/* Hero restructuré */
.hero {
  padding: 60px 0 40px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 6px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
}

h1 {
  font-size: 42px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}

@media (max-width: 768px) {
  h1 { font-size: 32px; }
}

.gradient-text {
  color: var(--accent);
}

.lead {
  font-size: 18px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 32px;
  max-width: 65ch;
}

/* Stats en ligne */
.hero-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.mini-card {
  padding: 20px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.mini-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--border-hover);
}

.mini-card-title {
  font-size: 11px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  margin-bottom: 8px;
}

.mono {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
}

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot-muted {
  background: var(--text-tertiary);
  opacity: 0.5;
}

.dot-ok {
  background: var(--success);
}

.dot-bad {
  background: var(--error);
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Sections */
.section {
  padding: 60px 0;
}

.section.alt {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-head {
  margin-bottom: 40px;
}

.section-head h2 {
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.section-head p {
  font-size: 16px;
  color: var(--text-secondary);
}

/* Layout principal - Sidebar + Content */
.grid-2 {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 32px;
  align-items: start;
}

@media (max-width: 1100px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

@media (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr; }
}

/* Cards épurées */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow);
}

.card-head {
  padding: 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}

.card-title {
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
  margin-bottom: 4px;
}

.card-subtitle {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.pill {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.card-body {
  padding: 24px;
}

/* Panel simple */
.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}

.panel-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.panel-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  margin-bottom: 4px;
}

.panel-subtitle {
  color: var(--text-secondary);
  font-size: 13px;
}

.panel-body {
  padding: 20px;
}

.panel.subtle {
  background: var(--bg-secondary);
  box-shadow: none;
}

/* Steps */
.steps {
  list-style: none;
  display: grid;
  gap: 12px;
}

.steps li {
  display: flex;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 14px;
}

.step-num {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

.small-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (max-width: 640px) {
  .small-grid { grid-template-columns: 1fr; }
}

.small {
  padding: 14px;
  border-radius: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
}

.small-label {
  font-size: 11px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  margin-bottom: 6px;
}

.small-value {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}

.subtle-title {
  font-size: 11px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  margin-bottom: 10px;
}

.link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.link:hover {
  border-bottom-color: var(--accent);
}

/* Forms minimalistes */
.field {
  margin-bottom: 20px;
}

label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 6px;
}

input,
select {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 8px;
  outline: none;
  transition: all 0.2s ease;
  font-size: 14px;
  font-family: inherit;
  font-weight: 500;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: var(--bg-secondary);
}

input::placeholder {
  color: var(--text-tertiary);
}

small {
  display: block;
  color: var(--text-tertiary);
  font-size: 12px;
  margin-top: 4px;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.form-msg {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  font-size: 14px;
  min-height: 20px;
}

/* Tabs épurés */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  overflow-x: auto;
}

.tab {
  padding: 12px 20px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* File upload simple */
.file-upload {
  position: relative;
  padding: 40px 24px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg-secondary);
}

.file-upload:hover {
  border-color: var(--accent);
  background: var(--card);
}

.file-upload.dragover {
  border-color: var(--accent);
  background: rgba(37, 99, 235, 0.05);
}

.file-upload input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.6;
}

.upload-text {
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
}

.upload-hint {
  color: var(--text-tertiary);
  font-size: 13px;
}

.file-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-top: 16px;
}

.file-name {
  font-size: 14px;
  font-weight: 600;
}

.file-size {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-left: 10px;
}

.btn-remove {
  padding: 6px 12px;
  background: transparent;
  color: var(--error);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-remove:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--error);
}

/* Multi-person */
.person-entry {
  padding: 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.person-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.person-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}

.btn-remove-person {
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-remove-person:hover {
  color: var(--error);
  border-color: var(--error);
}

.btn-add-person {
  width: 100%;
  padding: 14px;
  background: transparent;
  border: 2px dashed var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 16px;
}

.btn-add-person:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(37, 99, 235, 0.05);
}

/* Result */
.result {
  padding: 32px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent) 0%, #1d4ed8 100%);
  color: #fff;
  box-shadow: var(--shadow-lg);
}

.result-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  opacity: 0.9;
  margin-bottom: 8px;
}

.result-value {
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.result-hint {
  font-size: 14px;
  opacity: 0.9;
}

/* Table */
.results-table-container {
  overflow-x: auto;
  margin-top: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.results-table th {
  background: var(--bg-secondary);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.results-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.results-table tr:hover {
  background: var(--bg-secondary);
}

.results-table tr:last-child td {
  border-bottom: none;
}

.export-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.btn-export {
  padding: 10px 20px;
  background: var(--success);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-export:hover {
  background: #059669;
}

/* Mono blocks */
.mono-block {
  margin-top: 20px;
}

.mono-block-title {
  font-size: 11px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  margin-bottom: 8px;
}

pre {
  margin: 0;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  overflow: auto;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  color: var(--text);
}

/* Quality check */
.quality-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--bg-secondary);
  border-radius: 8px;
  margin-bottom: 10px;
  border-left: 3px solid var(--border);
}

.quality-item.success {
  border-left-color: var(--success);
}

.quality-item.warning {
  border-left-color: var(--warning);
}

.quality-item.error {
  border-left-color: var(--error);
}

.quality-label {
  font-size: 14px;
  font-weight: 600;
}

.quality-value {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.quality-badge {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}

.quality-badge.success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.quality-badge.warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.quality-badge.error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
}

/* Info cards */
.info-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}

.info-card:hover {
  box-shadow: var(--shadow);
}

.info-title {
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 10px;
}

.info-text {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 14px;
}

.panel.wide {
  margin-top: 24px;
}

.bullets {
  margin: 0;
  padding-left: 20px;
  color: var(--text-secondary);
  line-height: 1.8;
  font-size: 14px;
}

.bullets li {
  margin-bottom: 8px;
}

/* Disclaimer */
.disclaimer {
  margin-top: 24px;
  padding: 16px 20px;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--text-secondary);
  font-size: 14px;
}

/* Footer */
.footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  margin-top: 60px;
  background: var(--bg-secondary);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--text-tertiary);
  flex-wrap: wrap;
  font-size: 14px;
}

/* Loading */
.spinner {
  display: none;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.loading .spinner {
  display: inline-block;
}

.loading .btn-text {
  opacity: 0.7;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Details */
details summary {
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-bottom: 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
}

details summary:hover {
  border-color: var(--border-hover);
}

details[open] summary {
  margin-bottom: 16px;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }
  
  .card-body,
  .panel-body {
    padding: 20px;
  }
  
  .result-value {
    font-size: 36px;
  }
  
  .grid-3 {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-hover);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

/* wrapper */
.tabs {
  position: relative;
  overflow-x: auto;
  scrollbar-width: thin; /* Firefox */
}

/* fade hint */
.tabs::before,
.tabs::after {
  content: "";
  position: sticky;
  top: 0;
  width: 28px;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.tabs::before {
  left: 0;
  background: linear-gradient(to right, var(--card), transparent);
}

.tabs::after {
  right: 0;
  background: linear-gradient(to left, var(--card), transparent);
}
