/* ==========================================================================
   THOR Atelier — Design System
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Palette — bleu THOR profond + accent ambre */
  --thor-blue:        #0b3d91;
  --thor-blue-dark:   #062967;
  --thor-blue-light:  #2c5fc9;
  --thor-amber:       #d97706;
  --thor-amber-soft:  #fbbf24;

  /* Statut */
  --green:    #16a34a;
  --green-bg: #dcfce7;
  --red:      #dc2626;
  --red-bg:   #fee2e2;
  --warn:     #f59e0b;
  --warn-bg:  #fef3c7;
  --info:     #0284c7;
  --info-bg:  #e0f2fe;

  /* Neutres */
  --bg:           #f8fafc;
  --surface:      #ffffff;
  --surface-alt:  #f1f5f9;
  --border:       #e2e8f0;
  --border-strong:#cbd5e1;
  --text:         #0f172a;
  --text-muted:   #64748b;
  --text-subtle:  #94a3b8;

  /* Typography */
  --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Radius / Shadows */
  --radius-sm: 4px;
  --radius:    8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow:    0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 25px rgba(15, 23, 42, 0.08), 0 4px 10px rgba(15, 23, 42, 0.04);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--thor-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

code, kbd, pre { font-family: var(--font-mono); font-size: 0.92em; }

/* ── Layout ─────────────────────────────────────────────────────── */
.layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--thor-blue-dark);
  color: white;
  padding: 1.5rem 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-brand {
  padding: 0 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.sidebar-logo {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.25));
}
.sidebar-brand-text { line-height: 1.1; }
.sidebar-brand .brand-name {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  color: white;
}
.sidebar-brand .brand-sub {
  font-size: 0.78rem;
  color: var(--thor-amber-soft);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
}
.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
  flex: 1;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1.5rem;
  color: rgba(255,255,255,0.75);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.15s;
}
.sidebar-nav a:hover {
  color: white;
  background: rgba(255,255,255,0.06);
  text-decoration: none;
}
.sidebar-nav a.active {
  color: white;
  background: var(--thor-blue);
  border-left: 3px solid var(--thor-amber-soft);
  padding-left: calc(1.5rem - 3px);
}
.sidebar-nav .icon { font-size: 1.05rem; flex-shrink: 0; }

.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 0.8rem;
}
.sidebar-footer .username { color: white; font-weight: 600; }
.sidebar-footer .role { color: rgba(255,255,255,0.6); font-size: 0.75rem; }
.sidebar-footer a {
  color: rgba(255,255,255,0.7);
  font-size: 0.8rem;
  margin-top: 0.5rem;
  display: inline-block;
}

/* ── Main ────────────────────────────────────────────────────────── */
.main {
  padding: 1.5rem 2rem;
  max-width: 1400px;
}
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.page-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.page-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

/* ── Cards ───────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -1.25rem -1.25rem 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

/* KPI cards (dashboard) */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  position: relative;
  overflow: hidden;
}
.kpi-label {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.kpi-value {
  font-size: 1.85rem;
  font-weight: 700;
  margin-top: 0.4rem;
  letter-spacing: -0.02em;
  color: var(--thor-blue-dark);
}
.kpi-delta {
  font-size: 0.78rem;
  margin-top: 0.2rem;
  color: var(--text-muted);
}
.kpi.accent::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: var(--thor-amber);
}

/* ── Tables ──────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
th {
  text-align: left;
  padding: 0.7rem 1rem;
  background: var(--surface-alt);
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border);
}
tr:last-child td { border-bottom: none; }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: var(--surface-alt); }

/* ── Badges ──────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: lowercase;
}
.badge-recu        { background: var(--info-bg);  color: var(--info); }
.badge-diagnostic  { background: var(--warn-bg);  color: var(--warn); }
.badge-attente     { background: var(--warn-bg);  color: var(--warn); }
.badge-encours     { background: #ddd6fe;          color: #6d28d9; }
.badge-pret        { background: var(--green-bg); color: var(--green); }
.badge-livre       { background: #dbeafe;          color: var(--thor-blue); }
.badge-annule      { background: var(--red-bg);   color: var(--red); }
.badge-paid        { background: var(--green-bg); color: var(--green); }
.badge-partial     { background: var(--warn-bg);  color: var(--warn); }
.badge-unpaid      { background: var(--red-bg);   color: var(--red); }
.badge-cancelled   { background: var(--surface-alt); color: var(--text-muted); }

.priority-low      { color: var(--text-muted); }
.priority-medium   { color: var(--info); }
.priority-high     { color: var(--warn); font-weight: 600; }
.priority-urgent   { color: var(--red); font-weight: 700; }

/* ── Forms ───────────────────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.field { display: flex; flex-direction: column; gap: 0.3rem; }
.field label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
input, select, textarea {
  font-family: inherit;
  font-size: 0.92rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--thor-blue);
  box-shadow: 0 0 0 3px rgba(11, 61, 145, 0.12);
}
textarea { resize: vertical; min-height: 80px; }

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
  text-decoration: none;
}
.btn:hover { background: var(--surface-alt); text-decoration: none; }
.btn-primary {
  background: var(--thor-blue);
  color: white;
  border-color: var(--thor-blue);
}
.btn-primary:hover {
  background: var(--thor-blue-dark);
  border-color: var(--thor-blue-dark);
}
.btn-danger {
  background: var(--red);
  color: white;
  border-color: var(--red);
}
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover { background: var(--surface-alt); color: var(--text); }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }

/* ── Toolbar (filtres, recherche) ────────────────────────────────── */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 1rem;
}
.toolbar input[type="search"], .toolbar input[type="text"] {
  flex: 1;
  min-width: 220px;
  max-width: 380px;
}
.toolbar .spacer { flex: 1; }

/* ── Alerts / messages flash ─────────────────────────────────────── */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.alert-error   { background: var(--red-bg);   color: var(--red); }
.alert-success { background: var(--green-bg); color: var(--green); }
.alert-warn    { background: var(--warn-bg);  color: var(--warn); }
.alert-info    { background: var(--info-bg);  color: var(--info); }

/* ── Login ───────────────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--thor-blue-dark) 0%, var(--thor-blue) 100%);
}
.login-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}
.login-brand {
  text-align: center;
  margin-bottom: 1.75rem;
}
.login-logo {
  width: 220px;
  max-width: 80%;
  height: auto;
  display: block;
  margin: 0 auto 0.75rem;
}
.login-brand p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* ── Détail réparation : timeline ────────────────────────────────── */
.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
}
.timeline li {
  position: relative;
  padding-left: 2rem;
  padding-bottom: 1rem;
}
.timeline li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--thor-blue);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--border-strong);
}
.timeline .ts {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.timeline .note {
  margin-top: 0.2rem;
  color: var(--text);
}

/* ── Misc ────────────────────────────────────────────────────────── */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.gap { gap: 1rem; }
.gap-sm { gap: 0.5rem; }
.mt { margin-top: 1rem; }
.mb { margin-bottom: 1rem; }
.text-muted { color: var(--text-muted); }
.text-mono { font-family: var(--font-mono); }
.text-right { text-align: right; }
.tabular { font-variant-numeric: tabular-nums; }

/* HTMX feedback */
.htmx-request { opacity: 0.6; pointer-events: none; }
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: inline; }

/* ── Bandeau de licence ──────────────────────────────────────────── */
.license-banner {
  padding: 0.6rem 1.5rem;
  font-size: 0.88rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  z-index: 100;
}
.license-banner-warn {
  background: var(--warn-bg);
  color: #92400e;
  border-bottom: 2px solid var(--warn);
}
.license-banner-error {
  background: var(--red);
  color: white;
  border-bottom: 2px solid #991b1b;
}
.license-banner-warn .btn-primary {
  background: var(--warn);
  border-color: var(--warn);
}

/* ── Responsive mobile (PWA Android/iPhone) ──────────────────────── */
@media (max-width: 768px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    height: auto;
    width: 100%;
    z-index: 50;
    padding: 0;
    flex-direction: column;
    border-top: 2px solid var(--thor-blue);
  }
  .sidebar-brand,
  .sidebar-footer {
    display: none;  /* on cache la marque/footer sur mobile pour gagner de la place */
  }
  .sidebar-nav {
    display: flex;
    overflow-x: auto;
    margin: 0;
    padding: 0.4rem 0.5rem;
    -webkit-overflow-scrolling: touch;
    /* Safe area pour iPhone (encoche basse) */
    padding-bottom: max(0.4rem, env(safe-area-inset-bottom));
  }
  .sidebar-nav li {
    flex-shrink: 0;
  }
  .sidebar-nav a {
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 0.7rem;
    font-size: 0.7rem;
    gap: 0.15rem;
    min-width: 64px;
    border-radius: 6px;
  }
  .sidebar-nav a.active {
    background: var(--thor-blue);
    border-left: none;
    padding-left: 0.7rem;
  }
  .sidebar-nav .icon {
    font-size: 1.4rem;
  }
  .main {
    padding: 1rem;
    padding-bottom: 90px;  /* place pour la barre fixed bottom */
    max-width: 100%;
  }
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  /* Tableaux scrollables horizontalement */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { font-size: 0.85rem; }
  th, td { padding: 0.5rem; }
  /* KPI grid : 2 colonnes plutôt que tout sur une */
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
  }
  .kpi { padding: 0.85rem; }
  .kpi-value { font-size: 1.4rem; }
  /* Layout 2-col → 1-col pour les fiches détail */
  .main > div[style*="grid-template-columns: 2fr 1fr"],
  .main > div[style*="grid-template-columns:2fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}

/* ==========================================================================
   Recherche globale — trigger sidebar + palette modale (Cmd+K)
   ========================================================================== */

.sidebar-search-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: calc(100% - 1.5rem);
  margin: 0.25rem 0.75rem 0.75rem;
  padding: 0.55rem 0.75rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius);
  color: rgba(255,255,255,0.75);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.sidebar-search-trigger:hover {
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.2);
}
.search-trigger-icon { font-size: 0.95rem; flex-shrink: 0; }
.search-trigger-label { flex: 1; text-align: left; opacity: 0.8; }
.search-trigger-kbd {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  background: rgba(0,0,0,0.25);
  border-radius: 4px;
  color: rgba(255,255,255,0.7);
}

/* ── Modale palette ────────────────────────────────────────────────────── */
.search-palette {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 12vh;
  animation: searchFadeIn 0.15s ease-out;
}
.search-palette[hidden] { display: none; }

@keyframes searchFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.search-palette-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
}
.search-palette-modal {
  position: relative;
  width: 90%;
  max-width: 640px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--border);
  overflow: hidden;
  animation: searchSlideIn 0.18s ease-out;
}
@keyframes searchSlideIn {
  from { transform: translateY(-12px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

.search-palette-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.search-palette-icon { font-size: 1.05rem; color: var(--text-muted); }
#search-palette-input {
  flex: 1;
  border: none;
  outline: none;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  background: transparent;
  color: var(--text);
}
#search-palette-input::placeholder { color: var(--text-subtle); }
.search-palette-kbd {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  color: var(--text-muted);
  background: var(--surface-alt);
}

.search-palette-results {
  max-height: 60vh;
  overflow-y: auto;
}

.search-empty {
  padding: 2.25rem 1rem;
  text-align: center;
}
.search-hint { color: var(--text-muted); margin: 0 0 0.25rem; }
.search-hint-sub { color: var(--text-subtle); font-size: 0.85rem; margin: 0; }

.search-results-list {
  list-style: none;
  margin: 0;
  padding: 0.4rem;
}
.search-result {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  outline: none;
  transition: background 0.12s;
}
.search-result:hover,
.search-result:focus {
  background: var(--surface-alt);
  text-decoration: none;
}
.search-result:focus-visible {
  box-shadow: 0 0 0 2px var(--thor-blue-light);
}
.search-result-icon {
  font-size: 1.15rem;
  width: 1.5rem;
  text-align: center;
  flex-shrink: 0;
}
.search-result-body { flex: 1; min-width: 0; }
.search-result-title {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-result-sub {
  display: block;
  color: var(--text-muted);
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-result-kind {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 0.15rem 0.4rem;
  background: var(--surface-alt);
  border-radius: 4px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.search-footer {
  display: flex;
  gap: 1rem;
  padding: 0.5rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--surface-alt);
  font-size: 0.72rem;
  color: var(--text-muted);
}
.search-footer-key {
  font-family: var(--font-mono);
  padding: 0.05rem 0.3rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  margin-right: 0.25rem;
}

@media (max-width: 600px) {
  .search-palette { padding-top: 5vh; }
  .search-palette-modal { width: 96%; }
  .search-trigger-kbd { display: none; }
}

/* ==========================================================================
   Photos de réparation — galerie before/after
   ========================================================================== */

.photo-section {
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border);
}
.photo-section:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.photo-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.photo-section-title {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.5rem;
}
.photo-thumb {
  position: relative;
  margin: 0;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-alt);
  border: 1px solid var(--border);
}
.photo-thumb a { display: block; height: 100%; }
.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s;
}
.photo-thumb:hover img { transform: scale(1.05); }

.photo-thumb form {
  position: absolute;
  top: 4px;
  right: 4px;
  margin: 0;
}
.photo-delete {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: rgba(15,23,42,0.7);
  color: white;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s;
}
.photo-delete:hover { background: var(--red); }

.text-sm     { font-size: 0.85rem; }
.text-muted  { color: var(--text-muted); }
.text-subtle { color: var(--text-subtle); }

/* ==========================================================================
   Journal d'audit — badges colorés par préfixe d'action
   ========================================================================== */

.audit-action {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: var(--surface-alt);
  color: var(--text);
}
.audit-action-auth     { background: var(--info-bg);  color: var(--info); }
.audit-action-user     { background: #e9d5ff;        color: #7e22ce; }
.audit-action-invoice  { background: var(--green-bg); color: var(--green); }
.audit-action-repair   { background: #fed7aa;        color: #c2410c; }
.audit-action-backup   { background: #ddd6fe;        color: #5b21b6; }
.audit-action-cash     { background: var(--warn-bg);  color: var(--warn); }
.audit-action-settings { background: var(--red-bg);   color: var(--red); }

.audit-details {
  margin: 0.4rem 0 0;
  padding: 0.5rem 0.75rem;
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  white-space: pre-wrap;
  word-break: break-word;
  max-width: 500px;
}
