/* Payment Lock — UI SaaS fintech premium
   Direction artistique : sidebar bleu nuit, contenu clair, cartes blanches,
   bordures fines, ombres discrètes. Palette bleu / blanc / gris / vert / ambre / rouge.
   Typographie Inter. CSS natif uniquement. */

/* ==========================================================================
   1. Design tokens
   ========================================================================== */

:root {
  /* Bleu nuit (navigation) */
  --navy-900: #080e1f;
  --navy-800: #0b1226;
  --navy-700: #111c38;
  --navy-600: #1b2947;
  --sidebar-text: #c7d2e4;
  --sidebar-text-strong: #ffffff;
  --sidebar-text-muted: #7d8cab;
  --sidebar-line: rgba(255, 255, 255, 0.08);
  --sidebar-hover: rgba(255, 255, 255, 0.06);
  --sidebar-active-bg: rgba(59, 130, 246, 0.18);
  --sidebar-active-line: #3b82f6;

  /* Accent */
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-soft: #eff4ff;
  --accent-soft-strong: #dbe7ff;
  --accent-ring: rgba(37, 99, 235, 0.16);

  /* Surfaces */
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f5f9;

  /* Texte */
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --text-inverse: #ffffff;

  /* Bordures */
  --border: #e6e9ef;
  --border-strong: #d8dde6;

  /* Statuts */
  --green: #15803d;
  --green-bg: #e9f9ef;
  --green-border: #b5e6c6;
  --amber: #b45309;
  --amber-bg: #fff5e5;
  --amber-border: #f4d9a3;
  --red: #dc2626;
  --red-bg: #fdecec;
  --red-border: #f5c2c2;
  --blue: #2563eb;
  --blue-bg: #eef4ff;
  --blue-border: #c7dbff;

  /* Rayons */
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 18px;
  --r-pill: 999px;

  /* Ombres discrètes */
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.07), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 6px 18px -8px rgba(16, 24, 40, 0.16);
  --shadow-lg: 0 20px 45px -22px rgba(16, 24, 40, 0.24);
  --shadow-focus: 0 0 0 4px var(--accent-ring);

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --sidebar-w: 264px;
}

/* ==========================================================================
   2. Base
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: -0.011em;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 160ms var(--ease);
}

a:hover,
a:focus-visible {
  color: var(--accent-strong);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

h1,
h2,
h3,
p {
  margin: 0;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.mono {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
  letter-spacing: 0;
}

.nowrap {
  white-space: nowrap;
}

.grid-full {
  grid-column: 1 / -1;
}

.self-start {
  align-self: flex-start;
}

/* ==========================================================================
   3. Structure de l'application
   ========================================================================== */

.app-shell {
  min-height: 100dvh;
  display: flex;
}

.layout-app .app-shell {
  flex-direction: row;
  align-items: stretch;
}

.layout-auth .app-shell {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(1.25rem, 5vw, 3rem) clamp(1.25rem, 5vw, 2rem);
  background:
    radial-gradient(60% 55% at 50% -10%, #eef3ff 0%, rgba(238, 243, 255, 0) 70%),
    var(--bg);
}

/* --- Sidebar (bleu nuit) --- */

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--navy-800) 0%, var(--navy-900) 100%);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.4rem 1rem 1.1rem;
  position: sticky;
  top: 0;
  height: 100dvh;
}

.sidebar::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(120% 60% at 0% 0%, rgba(59, 130, 246, 0.16) 0%, transparent 60%);
}

.sidebar > * {
  position: relative;
  z-index: 1;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-top: 1.4rem;
  flex: 1;
}

.side-nav-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--sidebar-text-muted);
  padding: 0 0.75rem 0.6rem;
}

.side-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.62rem 0.75rem;
  border-radius: var(--r-md);
  color: var(--sidebar-text);
  font-size: 0.925rem;
  font-weight: 500;
  position: relative;
  transition: background 160ms var(--ease), color 160ms var(--ease);
}

.side-link i {
  font-size: 1.05rem;
  color: var(--sidebar-text-muted);
  transition: color 160ms var(--ease);
}

.side-link:hover,
.side-link:focus-visible {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-strong);
}

.side-link:hover i,
.side-link:focus-visible i {
  color: var(--sidebar-text-strong);
}

.side-link.is-active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-text-strong);
  font-weight: 600;
}

.side-link.is-active::before {
  content: "";
  position: absolute;
  left: -1rem;
  top: 0.45rem;
  bottom: 0.45rem;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--sidebar-active-line);
}

.side-link.is-active i {
  color: #93c5fd;
}

.side-link--muted {
  color: var(--sidebar-text-muted);
}

.sidebar-foot {
  border-top: 1px solid var(--sidebar-line);
  padding-top: 0.9rem;
  margin-top: 0.5rem;
}

/* --- Marque --- */

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  padding: 0.35rem 0.5rem;
  border-radius: var(--r-md);
}

.brand-mark {
  width: 2.6rem;
  height: 2.6rem;
  flex-shrink: 0;
  border-radius: 0.85rem;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, #3b82f6 0%, #1d4ed8 100%);
  box-shadow: 0 10px 24px -12px rgba(37, 99, 235, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.brand-mark i {
  font-size: 1.35rem;
  color: #fff;
}

.brand-mark--lg {
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 1.1rem;
  margin-bottom: 0.9rem;
}

.brand-mark--lg i {
  font-size: 1.7rem;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
}

.brand-title {
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.02em;
  color: var(--sidebar-text-strong);
}

.brand-subtitle {
  font-size: 0.78rem;
  color: var(--sidebar-text-muted);
}

/* --- Colonne de contenu --- */

.app-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.layout-auth .app-content {
  display: contents;
}

/* --- Topbar --- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem clamp(1.25rem, 4vw, 2.5rem);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid var(--border);
}

.topbar-context {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar-eyebrow {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--text-3);
  line-height: 1.3;
}

.topbar-title {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.nav-toggle-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  transition: background 160ms var(--ease), border-color 160ms var(--ease);
}

.nav-toggle-btn:hover {
  background: var(--surface-3);
}

.nav-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.nav-backdrop {
  display: none;
}

/* --- Zone principale --- */

.app-main {
  flex: 1;
  width: 100%;
  margin: 0 auto;
  padding: clamp(1.4rem, 4vw, 2.75rem) clamp(1.25rem, 4vw, 2.5rem);
  display: flex;
  flex-direction: column;
  gap: clamp(1.25rem, 3vw, 2rem);
}

.layout-auth .app-main {
  max-width: none;
  width: 100%;
  align-items: center;
  justify-content: center;
  padding: 0;
  gap: 1.5rem;
}

.layout-auth .panel-grid-main {
  grid-column: 1 / -1;
}

/* ==========================================================================
   4. Panneau / cartes
   ========================================================================== */

.card-panel {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.layout-auth .card-panel {
  box-shadow: var(--shadow-lg);
}

.auth-card {
  width: min(460px, 100%);
}

.auth-card--wide {
  width: min(520px, 100%);
}

.card-panel-header {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: clamp(1.5rem, 3.5vw, 2.25rem) clamp(1.4rem, 4vw, 2.5rem) 1.1rem;
  border-bottom: 1px solid var(--border);
}

.auth-card .card-panel-header {
  padding-bottom: 1.4rem;
}

.panel-kicker {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent);
  font-weight: 600;
}

.panel-title {
  font-size: clamp(1.5rem, 3.2vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text);
}

.panel-subtitle {
  color: var(--text-2);
  font-size: 0.95rem;
  max-width: 62ch;
}

.card-panel-body {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(1.25rem, 3vw, 2rem);
  padding: clamp(1.4rem, 4vw, 2.25rem) clamp(1.4rem, 4vw, 2.5rem) clamp(1.5rem, 4vw, 2.5rem);
}

.panel-grid-main {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: clamp(1.1rem, 2.5vw, 1.6rem);
}

.panel-grid-aside {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: clamp(1.1rem, 2.5vw, 1.6rem);
}

@media (min-width: 1080px) {
  .panel-grid-main {
    grid-column: 1 / 8;
  }
  .panel-grid-aside {
    grid-column: 8 / -1;
  }
}

.glass-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 100%;
}

.layout-auth .glass-card {
  box-shadow: var(--shadow-sm);
}

.glass-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem clamp(1rem, 2.5vw, 1.4rem) 0.85rem;
}

.card-heading-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.card-kicker {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-3);
  font-weight: 600;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

.card-subtitle {
  margin: 0;
  color: var(--text-2);
  font-size: 0.9rem;
}

.glass-card-body {
  display: flex;
  flex-direction: column;
  gap: clamp(1rem, 2.2vw, 1.4rem);
  padding: 0 clamp(1rem, 2.5vw, 1.4rem) clamp(1.2rem, 2.5vw, 1.6rem);
}

.glass-card-body--form {
  padding-top: 1.4rem;
}

.glass-card-body--tight {
  gap: 1.25rem;
}

/* ==========================================================================
   5. Statistiques
   ========================================================================== */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1.1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  transition: box-shadow 200ms var(--ease), transform 200ms var(--ease), border-color 200ms var(--ease);
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.stat-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-2);
}

.stat-icon {
  width: 2.1rem;
  height: 2.1rem;
  flex-shrink: 0;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  font-size: 1rem;
}

.dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot.is-paid,
.stat-icon.is-paid {
  background: var(--green);
}

.dot.is-warning,
.stat-icon.is-warning {
  background: var(--amber);
}

.dot.is-suspended,
.stat-icon.is-suspended {
  background: var(--red);
}

.stat-icon.is-paid {
  color: var(--green);
  background: var(--green-bg);
}

.stat-icon.is-warning {
  color: var(--amber);
  background: var(--amber-bg);
}

.stat-icon.is-suspended {
  color: var(--red);
  background: var(--red-bg);
}

.dot.is-paid {
  box-shadow: 0 0 0 4px var(--green-bg);
}

.dot.is-warning {
  box-shadow: 0 0 0 4px var(--amber-bg);
}

.dot.is-suspended {
  box-shadow: 0 0 0 4px var(--red-bg);
}

.stat-value {
  font-size: clamp(1.7rem, 3.5vw, 2.15rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text);
}

/* ==========================================================================
   6. Tableau
   ========================================================================== */

.table-scroller {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-modern {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

.table-modern thead tr {
  background: var(--surface-2);
}

.table-modern th,
.table-modern td {
  padding: 0.85rem 1.1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.table-modern th {
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
}

.table-modern td {
  font-size: 0.9rem;
  color: var(--text);
}

.table-modern tbody tr {
  transition: background 140ms var(--ease);
}

.table-modern tbody tr:hover {
  background: var(--surface-2);
}

.table-modern tbody tr:last-child td {
  border-bottom: none;
}

.cell-muted {
  color: var(--text-3);
}

.cell-sub {
  margin-top: 0.15rem;
  font-size: 0.82rem;
  color: var(--text-3);
}

/* ==========================================================================
   7. Badges de statut
   ========================================================================== */

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.28rem 0.7rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.35;
  white-space: nowrap;
}

.status-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--text-3);
}

.status-pill.is-paid {
  color: var(--green);
  background: var(--green-bg);
  border-color: var(--green-border);
}

.status-pill.is-paid .status-dot {
  background: var(--green);
}

.status-pill.is-warning {
  color: var(--amber);
  background: var(--amber-bg);
  border-color: var(--amber-border);
}

.status-pill.is-warning .status-dot {
  background: var(--amber);
}

.status-pill.is-suspended {
  color: var(--red);
  background: var(--red-bg);
  border-color: var(--red-border);
}

.status-pill.is-suspended .status-dot {
  background: var(--red);
}

.status-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: var(--text-2);
  white-space: nowrap;
}

.status-inline .status-dot {
  background: var(--green);
  box-shadow: 0 0 0 4px var(--green-bg);
}

.status-pill--start {
  align-self: flex-start;
}

/* ==========================================================================
   8. Formulaires
   ========================================================================== */

.form-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(0.9rem, 2vw, 1.25rem);
}

.form-field {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

@media (min-width: 720px) {
  .form-field.half {
    grid-column: span 6;
  }
  .form-field.third {
    grid-column: span 4;
  }
}

.field-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
}

.field-hint {
  color: var(--text-3);
  font-size: 0.82rem;
  font-weight: 400;
}

.input-shell {
  display: flex;
  align-items: center;
  border-radius: var(--r-md);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
  overflow: hidden;
}

.input-shell:hover {
  border-color: #c3ccd9;
}

.input-shell:focus-within {
  border-color: var(--accent);
  box-shadow: var(--shadow-focus);
}

.input-shell.is-invalid {
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.14);
}

.input-shell input,
.input-shell select,
.input-shell textarea {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0.68rem 0.9rem;
  font-size: 0.92rem;
  color: var(--text);
  outline: none;
}

.input-shell select {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%2364748b'%3E%3Cpath d='M4.2 6l3.8 3.8L11.8 6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
  padding-right: 2.2rem;
}

.input-shell textarea {
  min-height: 104px;
  resize: vertical;
  line-height: 1.65;
}

.input-shell input::placeholder,
.input-shell textarea::placeholder {
  color: var(--text-3);
}

.input-adornment {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.9rem;
  align-self: stretch;
  color: var(--text-3);
  border-left: 1px solid var(--border);
  cursor: pointer;
  transition: color 160ms var(--ease), background 160ms var(--ease);
}

.input-adornment:hover,
.input-adornment:focus-visible {
  color: var(--accent);
  background: var(--surface-2);
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  justify-content: flex-end;
}

.form-delete {
  margin-top: 1.1rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border);
}

/* ==========================================================================
   9. Boutons
   ========================================================================== */

.btn-primary,
.btn-ghost-soft,
.btn-ghost,
.btn-danger-soft {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1;
  padding: 0.68rem 1.15rem;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background 160ms var(--ease), color 160ms var(--ease),
    border-color 160ms var(--ease), box-shadow 160ms var(--ease), transform 120ms var(--ease);
}

.btn-primary {
  background: var(--accent);
  color: var(--text-inverse);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.12), 0 6px 16px -10px rgba(37, 99, 235, 0.85);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--accent-strong);
  color: var(--text-inverse);
  box-shadow: 0 8px 20px -10px rgba(37, 99, 235, 0.95);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-ghost-soft {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
  box-shadow: var(--shadow-xs);
}

.btn-ghost-soft:hover,
.btn-ghost-soft:focus-visible {
  background: var(--surface-2);
  border-color: #c3ccd9;
  color: var(--text);
}

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  padding: 0.5rem 0.75rem;
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  background: var(--surface-3);
  color: var(--text);
}

.btn-danger-soft {
  background: var(--red-bg);
  border-color: var(--red-border);
  color: var(--red);
}

.btn-danger-soft:hover,
.btn-danger-soft:focus-visible {
  background: #fbdcdc;
  border-color: #efb0b0;
  color: #b91c1c;
}

.btn-sm {
  padding: 0.52rem 0.9rem;
  font-size: 0.85rem;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

/* ==========================================================================
   10. Alertes
   ========================================================================== */

.alert {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.8rem 1rem;
  border-radius: var(--r-md);
  border: 1px solid var(--red-border);
  background: var(--red-bg);
  color: #991b1b;
  font-size: 0.9rem;
  font-weight: 500;
}

.alert i {
  font-size: 1.05rem;
  color: var(--red);
}

.alert-success {
  border-color: var(--green-border);
  background: var(--green-bg);
  color: #166534;
}

.alert-success i {
  color: var(--green);
}

/* ==========================================================================
   11. État vide
   ========================================================================== */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.55rem;
  padding: clamp(2rem, 5vw, 3rem) 1rem;
  color: var(--text-2);
}

.empty-state strong {
  color: var(--text);
  font-weight: 600;
}

.empty-state-icon {
  width: 3.2rem;
  height: 3.2rem;
  border-radius: var(--r-lg);
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1.4rem;
  margin-bottom: 0.35rem;
}

/* ==========================================================================
   12. Pied de page
   ========================================================================== */

.app-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  text-align: center;
  padding: 1.25rem clamp(1.25rem, 4vw, 2.5rem) 1.5rem;
  color: var(--text-3);
}

.layout-auth .app-footer {
  padding: 1.5rem 0 0;
}

.footer-text {
  font-size: 0.85rem;
  color: var(--text-2);
  font-weight: 500;
}

.footer-subtle {
  font-size: 0.78rem;
}

/* ==========================================================================
   13. Animations
   ========================================================================== */

.fade-in {
  animation: fade-in 380ms var(--ease-out) both;
}

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

/* ==========================================================================
   14. Responsive
   ========================================================================== */

@media (max-width: 1023px) {
  .nav-toggle-btn {
    display: inline-flex;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 60;
    width: min(280px, 84vw);
    transform: translateX(-100%);
    transition: transform 260ms var(--ease);
    box-shadow: var(--shadow-lg);
  }

  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(8, 14, 31, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 220ms var(--ease), visibility 220ms var(--ease);
  }

  .nav-toggle:checked ~ .app-shell .sidebar {
    transform: translateX(0);
  }

  .nav-toggle:checked ~ .app-shell .nav-backdrop {
    opacity: 1;
    visibility: visible;
  }

  .nav-toggle:focus-visible ~ .app-shell .nav-toggle-btn {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }
}

@media (max-width: 640px) {
  .topbar {
    padding: 0.75rem 1rem;
  }

  .topbar-actions .status-inline {
    display: none;
  }

  .app-main {
    padding: 1.25rem 1rem 1.5rem;
  }

  .card-panel-body {
    padding: 1.15rem 1.1rem 1.4rem;
  }

  .card-panel-header,
  .glass-card-header,
  .glass-card-body {
    padding-left: 1.1rem;
    padding-right: 1.1rem;
  }

  .form-actions {
    justify-content: stretch;
  }

  .form-actions .btn-primary {
    width: 100%;
    justify-content: center;
  }
}

/* ==========================================================================
   15. Accessibilité — mouvement réduit
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
