@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

:root {
  --radius: 0.5rem;

  --primary: #0ea5e9;
  --primary-foreground: #ffffff;
  --primary-soft: rgba(14, 165, 233, 0.12);

  --background: #ffffff;
  --foreground: #0f172a;
  --muted: rgba(15, 23, 42, 0.62);

  --card: #ffffff;
  --card-foreground: #0f172a;

  /* Surfaces elevees / secondaires (equivalents clairs) */
  --surface-raised: #f1f5f9;
  --surface-muted: #f8fafc;

  --border: rgba(15, 23, 42, 0.1);
  --input: rgba(15, 23, 42, 0.14);
  --ring: rgba(14, 165, 233, 0.32);

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 6px 18px rgba(15, 23, 42, 0.05);
}

.theme-dark {
  --primary: #7dd3fc;
  --primary-foreground: #071018;
  --primary-soft: rgba(125, 211, 252, 0.14);

  /* Palette "charbon" facon dashboard admin */
  --background: #1e1e1e;
  --foreground: #f4f4f5;
  --muted: rgba(244, 244, 245, 0.58);

  --card: #171717;
  --card-foreground: #f4f4f5;

  /* Surfaces elevees / secondaires (sidebar-card, chips, barres) */
  --surface-raised: #2d2d2d;
  --surface-muted: #232323;

  --border: rgba(244, 244, 245, 0.1);
  --input: rgba(244, 244, 245, 0.14);
  --ring: rgba(125, 211, 252, 0.36);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 26px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html,
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

.card {
  background: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.5rem;
  padding: 0 1rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease, transform 160ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:focus-visible,
.input:focus-visible,
.table-modern tbody tr:focus-within {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

.btn-primary:hover {
  filter: brightness(0.96);
}

.btn-ghost {
  background: transparent;
  color: var(--foreground);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
}

.input,
select.input,
textarea.input {
  width: 100%;
  min-height: 2.5rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--input);
  background: var(--card);
  color: var(--foreground);
  font-size: 0.92rem;
}

.input::placeholder,
.muted {
  color: var(--muted);
}

.table-modern {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
}

.table-modern thead th {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  padding: 0.8rem 0.9rem;
  border-bottom: 1px solid var(--border);
}

.table-modern tbody td {
  padding: 0.8rem 0.9rem;
  border-bottom: 1px solid var(--border);
  color: var(--foreground);
}

.table-modern tbody tr:last-child td {
  border-bottom: 0;
}

.table-modern tbody tr:hover {
  background: color-mix(in srgb, var(--primary-soft) 70%, transparent);
}

.stack-v {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.meta-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.section-gap {
  margin-top: 1.25rem;
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.panel-scroll {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 270px;
  overflow-y: auto;
}

.panel-scroll-tight {
  gap: 0.65rem;
  max-height: 280px;
}

.muted-center {
  margin-top: 1rem;
  text-align: center;
}

.muted-center-tight {
  margin-top: 0.75rem;
}

.status-chip {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--muted);
}

.mini-label {
  font-size: 0.88rem;
}

.btn-compact {
  min-height: 0;
  width: fit-content;
  padding: 0.35rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 700;
}

.is-hidden {
  display: none !important;
}

.code-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  background: color-mix(in srgb, var(--card) 92%, var(--primary-soft));
  color: var(--primary);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.74rem;
  line-height: 1;
  padding: 0.32rem 0.5rem;
}

@media (max-width: 768px) {
  .btn {
    width: 100%;
  }
}
