/* Jetons repris de Aeroven (src/index.css). Les noms sont les mêmes pour un futur branchement. */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

:root {
  --bg-page: #f6f6f3;
  --bg-card: #ffffff;
  --bg-input: #f6f6f3;
  --bg-hover: #f6f6f3;
  --bg-header: #003366;
  --border: #f1f1f1;
  --border-subtle: #e5e5e2;
  --text-primary: #131313;
  --text-secondary: #454545;
  --text-muted: #7d7d7d;
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.06);
  --color-primary: #003366;
  --color-primary-light: #004080;
  --color-primary-dark: #002244;
  --color-primary-50: #e6eef5;
  --color-accent: #f59e0b;
  --color-success: #10b981;
  --color-danger: #ef4444;
  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-border: #e2e8f0;
  --color-text: #0f172a;
  --map-well: #131313;
  --porte: #f59e0b;
}

.dark {
  --bg-page: #0d0d12;
  --bg-card: #18181f;
  --bg-input: #1e1e28;
  --bg-hover: #22222e;
  --bg-header: #001a33;
  --border: #2a2a36;
  --border-subtle: #2a2a36;
  --text-primary: #e8e8ec;
  --text-secondary: #b0b0ba;
  --text-muted: #8888a0;
  --shadow-card: 0 1px 4px rgba(0, 0, 0, 0.4);
  --color-bg: #0f172a;
  --color-surface: #1e293b;
  --color-border: #334155;
  --color-text: #f1f5f9;
  --map-well: #0d0d12;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: Inter, system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.45;
}
button, a.tool-link, input, select {
  font-family: inherit;
}
details:not([open]) > :not(summary) { display: none; }
button, a.tool-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-secondary);
  border-radius: 12px;
  padding: 6px 12px;
  min-height: 36px;
  cursor: pointer;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
button:hover, a.tool-link:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
button.on, a.tool-link.on, button.primary {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}
button.on:hover, a.tool-link.on:hover, button.primary:hover {
  background: var(--color-primary-light);
  color: #fff;
}
button:disabled { opacity: 0.45; cursor: default; }
button:focus-visible, a.tool-link:focus-visible, input:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
#del:not(:disabled) {
  color: var(--color-danger);
  border-color: color-mix(in srgb, var(--color-danger) 35%, var(--border));
}
input[type="checkbox"] { accent-color: var(--color-primary); }
input[type="search"], input[type="text"], input[type="datetime-local"] {
  width: 100%;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 14px;
}
header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  flex-wrap: nowrap;
  min-height: 52px;
}
header input[type="search"] {
  flex: 1 1 160px;
  width: auto;
  min-width: 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
.brand img { width: 36px; height: 36px; border-radius: 8px; display: block; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand strong {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.brand-text span { font-size: 11px; color: var(--text-muted); line-height: 1.2; }
.pages, .tools { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
#theme-toggle { min-width: 36px; padding-inline: 10px; flex: none; }
#status {
  margin: 0;
  padding: 2px 14px 6px;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shell {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 12px;
  padding: 0 12px 12px;
}
#drawer {
  width: 320px;
  flex: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
}
#drawer.is-shut { display: none; }
.drawer-tabs {
  display: flex;
  gap: 4px;
  padding: 8px;
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 2;
}
.drawer-tabs button { flex: 1; padding: 6px 4px; min-height: 32px; }
.drawer-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 12px 12px;
  min-height: 0;
}
.drawer-panel[hidden] { display: none; }
.drawer-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.outil {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 10px 0 2px;
  border-top: 1px solid var(--border);
}
.drawer-panel > .outil:first-child,
.drawer-panel > .hint + .outil { border-top: 0; padding-top: 0; }
.outil > strong { font-size: 13px; font-weight: 650; }
.outil .hint, .outil > p { margin: 0; }
#bilan-etat { margin: 0; font-size: 12px; color: var(--text-primary); }
#bilan { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
#bilan li {
  margin: 0;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.35;
}
#bilan li strong { display: block; color: var(--text-primary); font-weight: 600; }
#bilan li p { margin: 2px 0 0; }
#bilan li.echec { border-color: var(--color-danger); }
.exag-note { margin: 0; font-size: 12px; color: var(--text-muted); }
@media (max-width: 800px) {
  .brand-text { display: none; }
  .pages { flex-wrap: nowrap; }
  header { flex-wrap: wrap; gap: 6px; padding: 6px 8px; min-height: 0; }
  header input[type="search"] { order: 5; flex: 1 1 100%; }
  button, a.tool-link { padding: 6px 8px; }
  #status { padding: 0 10px 2px; }
  .shell { flex-direction: column; gap: 6px; padding: 0 8px 6px; }
  #drawer { order: 2; width: auto; flex: 0 1 42%; max-height: 42%; }
  #viewport, #stage { order: 1; flex: 1 1 auto; min-height: 52vh; }
}
