/* ═══════════════════════════════════════════════════════
   NEURONES IT — PORTAIL CLIENT — Design System v2
   ═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ─── Variables ─────────────────────────────────────────────────────────── */
:root {
  --brand:        #F7941D;
  --brand-dark:   #e07a08;
  --brand-glow:   rgba(247,148,29,0.18);
  --navy:         #0f172a;
  --navy-mid:     #1e293b;
  --navy-soft:    #334155;
  --slate:        #64748b;
  --muted:        #94a3b8;
  --surface:      #ffffff;
  --bg:           #f1f5f9;
  --border:       #e2e8f0;
  --border-focus: #F7941D;
  --success:      #10b981;
  --danger:       #ef4444;
  --warning:      #f59e0b;
  --info:         #3b82f6;
  --r-sm:         6px;
  --r:            10px;
  --r-lg:         16px;
  --r-xl:         24px;
  --shadow-xs:    0 1px 2px rgba(15,23,42,.06);
  --shadow-sm:    0 2px 8px rgba(15,23,42,.08);
  --shadow:       0 4px 20px rgba(15,23,42,.10);
  --shadow-lg:    0 16px 48px rgba(15,23,42,.16);
  --shadow-brand: 0 8px 24px rgba(247,148,29,.30);
}

/* ─── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--navy-mid);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

/* ══════════════════════════════════════════════════════
   AUTH PAGE — Split layout
   ══════════════════════════════════════════════════════ */
.auth-root {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 420px 1fr;
}

/* ─── Panneau gauche (brand) ─────────────────────────── */
.auth-brand-panel {
  background: #111111;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3rem 2.5rem;
  min-height: 100vh;
}
.auth-brand-panel::before {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(247,148,29,.22) 0%, transparent 70%);
  top: -120px; right: -120px;
  pointer-events: none;
}
.auth-brand-panel::after {
  content: '';
  position: absolute;
  width: 350px; height: 350px;
  background: radial-gradient(circle, rgba(247,148,29,.12) 0%, transparent 70%);
  bottom: -80px; left: -80px;
  pointer-events: none;
}
.brand-logo-wrap img {
  height: 48px;
  filter: brightness(0) invert(1);
  position: relative; z-index: 1;
}
.brand-content { position: relative; z-index: 1; }
.brand-tagline {
  font-size: 1.7rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
  margin-bottom: 1rem;
}
.brand-tagline span { color: var(--brand); }
.brand-sub {
  color: rgba(255,255,255,.55);
  font-size: .9rem;
  line-height: 1.65;
}
.brand-features { position: relative; z-index: 1; }
.brand-feature {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem 0;
  border-bottom: 1px solid rgba(255,255,255,.07);
  color: rgba(255,255,255,.7);
  font-size: .85rem;
}
.brand-feature:last-child { border: none; }
.brand-feature i { color: var(--brand); font-size: 1rem; flex-shrink: 0; }

/* ─── Panneau droit (formulaire) ─────────────────────── */
.auth-form-panel {
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 2rem;
  min-height: 100vh;
}
.auth-form-inner {
  width: 100%;
  max-width: 420px;
  animation: fadeUp .4s cubic-bezier(.22,1,.36,1);
}
@keyframes fadeUp {
  from { opacity:0; transform:translateY(16px); }
  to   { opacity:1; transform:translateY(0); }
}
/* ─── Header mobile (logo au-dessus du form) ─────────── */
/* Caché sur desktop, affiché sur mobile/tablette         */
.auth-mobile-header {
  display: none;
}
@media (max-width: 900px) {
  .auth-mobile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .6rem;
    background: #111111;
    border-radius: var(--r-lg);
    padding: 1.5rem 1.5rem 1.25rem;
    margin-bottom: 1.75rem;
    position: relative;
    overflow: hidden;
  }
  .auth-mobile-header::before {
    content: '';
    position: absolute;
    width: 280px; height: 280px;
    background: radial-gradient(circle, rgba(247,148,29,.18) 0%, transparent 70%);
    top: -80px; right: -60px;
    pointer-events: none;
  }
  .auth-mobile-logo {
    position: relative; z-index: 1;
  }
  .auth-mobile-logo img {
    height: 40px;
    filter: brightness(0) invert(1);
  }
  .auth-mobile-tagline {
    position: relative; z-index: 1;
    font-size: .85rem;
    font-weight: 600;
    color: rgba(255,255,255,.65);
    text-align: center;
    letter-spacing: .01em;
  }
  .auth-mobile-tagline span { color: var(--brand); }
}

.auth-welcome { margin-bottom: 2rem; }
.auth-welcome h2 {
  font-size: 1.6rem; font-weight: 800;
  color: var(--navy); margin-bottom: .3rem;
}
.auth-welcome p { color: var(--slate); font-size: .875rem; }

/* ─── Tabs auth ──────────────────────────────────────── */
.auth-tabs {
  display: flex;
  background: var(--bg);
  border-radius: var(--r-lg);
  padding: 4px;
  gap: 4px;
  margin-bottom: 1.75rem;
}
.auth-tab-btn {
  flex: 1;
  background: none;
  border: none;
  padding: .55rem .75rem;
  border-radius: var(--r);
  font-size: .85rem;
  font-weight: 500;
  color: var(--slate);
  cursor: pointer;
  transition: all .2s;
}
.auth-tab-btn.active {
  background: var(--surface);
  color: var(--navy);
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}

/* ─── Step indicator ─────────────────────────────────── */
.step-track {
  display: flex;
  align-items: center;
  margin-bottom: 1.75rem;
}
.step-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
}
.step-circle {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--border);
  color: var(--muted);
  font-size: .72rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  transition: all .3s;
}
.step-circle.active { background: var(--brand); color: #fff; box-shadow: 0 0 0 4px var(--brand-glow); }
.step-circle.done   { background: var(--success); color: #fff; }
.step-lbl { font-size: .65rem; color: var(--muted); font-weight: 500; white-space: nowrap; }
.step-lbl.active { color: var(--brand); }
.step-lbl.done   { color: var(--success); }
.step-line {
  flex: 1; height: 2px;
  background: var(--border);
  margin: 0 6px; margin-bottom: 16px;
  transition: background .3s;
}
.step-line.done { background: var(--success); }

/* ─── Form elements ──────────────────────────────────── */
.field-group { margin-bottom: 1.1rem; }
.field-label {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  color: var(--navy-soft);
  margin-bottom: .4rem;
  letter-spacing: .01em;
}
.field-input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  padding: .65rem .9rem;
  font-size: .875rem;
  font-family: inherit;
  color: var(--navy-mid);
  background: #fafbfc;
  transition: border-color .2s, box-shadow .2s, background .2s;
  outline: none;
}
.field-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
  background: #fff;
}
.field-input::placeholder { color: #c4cdd6; }
.field-hint { font-size: .72rem; color: var(--muted); margin-top: .3rem; }
.input-with-btn { display: flex; gap: .5rem; }
.input-with-btn .field-input { flex: 1; }
.input-icon-wrap { position: relative; }
.input-icon-wrap .field-input { padding-right: 2.75rem; }
.input-eye {
  position: absolute; right: .75rem; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  color: var(--muted); cursor: pointer; padding: 0;
  font-size: 1rem;
  transition: color .2s;
}
.input-eye:hover { color: var(--navy); }

/* ─── Buttons ────────────────────────────────────────── */
.btn-brand {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  border: none;
  color: #fff;
  font-weight: 600;
  font-size: .875rem;
  border-radius: var(--r);
  padding: .7rem 1.5rem;
  cursor: pointer;
  transition: transform .15s, box-shadow .2s;
  box-shadow: var(--shadow-brand);
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: .5rem;
}
.btn-brand:hover { transform: translateY(-1px); box-shadow: 0 12px 32px rgba(247,148,29,.40); }
.btn-brand:active { transform: translateY(0); }
.btn-brand:disabled { opacity: .55; transform: none; box-shadow: none; cursor: not-allowed; }
.btn-ghost {
  background: none;
  border: 1.5px solid var(--border);
  color: var(--slate);
  font-weight: 500;
  font-size: .875rem;
  border-radius: var(--r);
  padding: .65rem 1.2rem;
  cursor: pointer;
  transition: all .2s;
  display: inline-flex; align-items: center; gap: .4rem;
}
.btn-ghost:hover { border-color: var(--navy-soft); color: var(--navy); background: var(--bg); }
.btn-link { background: none; border: none; color: var(--orange); font-size: .85rem; cursor: pointer; padding: 0; display: inline-flex; align-items: center; gap: .35rem; text-decoration: underline; text-underline-offset: 3px; }
.btn-link:hover { color: var(--navy); }
.btn-icon {
  width: 40px; height: 40px;
  border-radius: var(--r);
  border: 1.5px solid var(--border);
  background: none;
  color: var(--slate);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
  flex-shrink: 0;
}
.btn-icon:hover { border-color: var(--brand); color: var(--brand); }
.btn-icon.brand-fill {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  border-color: transparent;
  color: #fff;
  box-shadow: var(--shadow-brand);
}
.btn-icon.brand-fill:hover { transform: translateY(-1px); }

/* ─── Company list ───────────────────────────────────── */
.company-list { display: flex; flex-direction: column; gap: .5rem; }
.company-card {
  display: flex; align-items: center; gap: .875rem;
  padding: .75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  cursor: pointer;
  transition: all .18s;
  background: #fafbfc;
}
.company-card:hover { border-color: var(--brand); background: #fff; box-shadow: var(--shadow-xs); }
.company-card.selected { border-color: var(--brand); background: rgba(247,148,29,.05); box-shadow: 0 0 0 3px var(--brand-glow); }
.company-ico {
  width: 38px; height: 38px;
  border-radius: var(--r-sm);
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; color: var(--muted); flex-shrink: 0;
  transition: all .18s;
}
.company-card.selected .company-ico { background: var(--brand-glow); color: var(--brand); }
.company-card-name { font-weight: 600; font-size: .875rem; color: var(--navy); }
.company-card-sub  { font-size: .75rem; color: var(--muted); margin-top: 1px; }

/* ─── OTP inputs ─────────────────────────────────────── */
.otp-row { display: flex; gap: .5rem; justify-content: center; }
.otp-box {
  width: 48px; height: 56px;
  text-align: center;
  font-size: 1.4rem; font-weight: 700;
  border: 2px solid var(--border);
  border-radius: var(--r);
  background: #fafbfc;
  color: var(--navy);
  transition: border-color .18s, box-shadow .18s;
  outline: none;
}
.otp-box:focus   { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-glow); background: #fff; }
.otp-box.filled  { border-color: var(--brand); background: #fff; }

/* ─── Alerts ─────────────────────────────────────────── */
.alert-bar {
  border-radius: var(--r);
  padding: .7rem 1rem;
  font-size: .82rem;
  font-weight: 500;
  display: flex; align-items: flex-start; gap: .5rem;
  margin-bottom: .75rem;
}
.alert-bar i { flex-shrink: 0; margin-top: 1px; }
.alert-bar.err     { background: #fef2f2; color: #b91c1c; }
.alert-bar.ok      { background: #f0fdf4; color: #166534; }
.alert-bar.info    { background: #eff6ff; color: #1d4ed8; }
.alert-bar.warn    { background: #fffbeb; color: #92400e; }

/* ─── Spinner ────────────────────────────────────────── */
.spin { animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════════════
   NAVBAR (pages internes)
   ══════════════════════════════════════════════════════ */
.topbar {
  height: 62px;
  background: #111111;
  display: flex; align-items: center;
  padding: 0 1.75rem;
  gap: 1rem;
  box-shadow: 0 1px 0 rgba(255,255,255,.06), 0 4px 20px rgba(0,0,0,.25);
  position: sticky; top: 0; z-index: 200;
}
.topbar-logo img {
  height: 32px;
  filter: brightness(0) invert(1);
}
.topbar-spacer { flex: 1; }
.topbar-user {
  display: flex; align-items: center; gap: .6rem;
  color: rgba(255,255,255,.8);
  font-size: .85rem;
}
.topbar-avatar {
  width: 32px; height: 32px;
  background: var(--brand);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .78rem; color: #fff;
  flex-shrink: 0;
}
.topbar-nav { display: flex; align-items: center; gap: .25rem; }
.topbar-nav a {
  color: rgba(255,255,255,.65);
  font-size: .82rem; font-weight: 500;
  padding: .4rem .75rem;
  border-radius: var(--r-sm);
  text-decoration: none;
  transition: all .18s;
  display: flex; align-items: center; gap: .35rem;
}
.topbar-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.btn-signout {
  background: rgba(247,148,29,.12);
  border: 1px solid rgba(247,148,29,.3);
  color: var(--brand);
  font-size: .8rem; font-weight: 600;
  padding: .38rem .9rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all .2s;
  display: flex; align-items: center; gap: .35rem;
}
.btn-signout:hover { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ══════════════════════════════════════════════════════
   DASHBOARD — Layout général
   ══════════════════════════════════════════════════════ */
.dash-page { background: #f0f4f8; }

/* ── Topbar extras ────────────────────────────────────── */
.topbar-nav-active { background: rgba(255,255,255,.1) !important; color: #fff !important; }
.topbar-user-info { display: flex; flex-direction: column; }
.topbar-user-name { font-size: .82rem; font-weight: 600; color: rgba(255,255,255,.9); line-height: 1.2; }
.topbar-user-role { font-size: .68rem; color: rgba(255,255,255,.4); line-height: 1.2; }

/* ══════════════════════════════════════════════════════
   HERO — Bandeau principal avec KPIs intégrés
   ══════════════════════════════════════════════════════ */
.dash-hero {
  background: linear-gradient(135deg, #0d0d0d 0%, #1a1a1a 60%, #222222 100%);
  position: relative; overflow: hidden;
  padding: 0 0 2.5rem;
}
.dash-hero-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 2.5rem 2rem 0;
  position: relative; z-index: 1;
}
.dash-hero-glow {
  position: absolute; border-radius: 50%;
  pointer-events: none;
}
.dash-hero-glow-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(247,148,29,.13) 0%, transparent 65%);
  top: -200px; right: -100px;
}
.dash-hero-glow-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(59,130,246,.08) 0%, transparent 65%);
  bottom: -150px; left: 5%;
}

.dash-hero-content {
  display: flex; align-items: flex-start;
  justify-content: space-between;
  gap: 2rem; flex-wrap: wrap;
}
.dash-hero-left { flex: 1; min-width: 260px; }

.dash-hero-label {
  display: inline-flex; align-items: center; gap: .5rem;
  background: rgba(247,148,29,.15);
  border: 1px solid rgba(247,148,29,.25);
  color: var(--brand);
  font-size: .72rem; font-weight: 700;
  letter-spacing: .6px; text-transform: uppercase;
  padding: .3rem .8rem; border-radius: 20px;
  margin-bottom: 1rem;
}
.dash-live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--brand);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .5; transform: scale(.7); }
}
.dash-hero-title {
  font-size: 2rem; font-weight: 800; color: #fff;
  line-height: 1.2; margin-bottom: .75rem;
}
.dash-hero-title span { color: var(--brand); }
.dash-hero-sub {
  color: rgba(255,255,255,.45);
  font-size: .875rem; line-height: 1.65;
  max-width: 480px; margin-bottom: 1.75rem;
}

.btn-hero-cta {
  display: inline-flex; align-items: center; gap: .5rem;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff; border: none; border-radius: var(--r);
  padding: .75rem 1.5rem;
  font-size: .875rem; font-weight: 700;
  cursor: pointer; text-decoration: none;
  box-shadow: 0 8px 24px rgba(247,148,29,.35);
  transition: transform .15s, box-shadow .2s;
}
.btn-hero-cta:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(247,148,29,.45); color: #fff; }

/* ── KPIs dans le hero ─────────────────────────────────── */
.dash-hero-kpis {
  display: flex; align-items: center; gap: 0;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--r-xl);
  padding: 1.5rem 2rem;
  backdrop-filter: blur(8px);
  flex-shrink: 0;
  align-self: center;
}
.hero-kpi { text-align: center; padding: 0 1.75rem; }
.hero-kpi-sep {
  width: 1px; height: 40px;
  background: rgba(255,255,255,.12);
  flex-shrink: 0;
}
.hero-kpi-num {
  font-size: 2.25rem; font-weight: 800; color: #fff;
  line-height: 1; margin-bottom: .3rem;
  font-variant-numeric: tabular-nums;
}
.hero-kpi-num.hero-kpi-done { color: #34d399; }
.hero-kpi-lbl {
  font-size: .68rem; color: rgba(255,255,255,.45);
  text-transform: uppercase; letter-spacing: .7px; font-weight: 600;
}

/* ══════════════════════════════════════════════════════
   DASH BODY — Zone ticket list
   ══════════════════════════════════════════════════════ */
.dash-body {
  max-width: 1200px; margin: 0 auto;
  padding: 2rem 2rem 3rem;
}

/* ── Toolbar ──────────────────────────────────────────── */
.tickets-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem;
  margin-bottom: 1.25rem;
}
.tickets-toolbar-left {
  display: flex; align-items: center; gap: .75rem;
}
.tickets-toolbar-title {
  font-size: 1rem; font-weight: 700; color: var(--navy);
}
.tickets-count-badge {
  background: var(--navy);
  color: #fff;
  font-size: .68rem; font-weight: 700;
  padding: .2rem .55rem; border-radius: 20px;
  min-width: 22px; text-align: center;
}

/* ── Filter chips ─────────────────────────────────────── */
.filter-chips { display: flex; gap: .4rem; }
.filter-chip {
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--slate);
  font-size: .78rem; font-weight: 600;
  padding: .38rem .9rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all .18s;
}
.filter-chip:hover { border-color: var(--brand); color: var(--brand); }
.filter-chip.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

/* ── Loader ───────────────────────────────────────────── */
.dash-loader {
  display: flex; align-items: center; justify-content: center; gap: .875rem;
  padding: 4rem 2rem;
  color: var(--slate); font-size: .875rem;
}
.dash-loader-ring {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

/* ── Empty state ──────────────────────────────────────── */
.dash-empty {
  display: flex; flex-direction: column; align-items: center;
  padding: 5rem 2rem; text-align: center;
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
}
.dash-empty-icon {
  width: 80px; height: 80px;
  background: var(--bg);
  border-radius: var(--r-xl);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; color: var(--border);
  margin-bottom: 1.5rem;
}
.dash-empty-title {
  font-size: 1.1rem; font-weight: 700; color: var(--navy);
  margin-bottom: .5rem;
}
.dash-empty-sub { font-size: .875rem; color: var(--muted); max-width: 380px; }

/* ── Alert erreur ─────────────────────────────────────── */
.dash-alert-err {
  display: flex; align-items: center; gap: .6rem;
  background: #fef2f2; color: #b91c1c;
  border: 1px solid #fecaca;
  border-radius: var(--r); padding: .85rem 1.25rem;
  font-size: .85rem; font-weight: 500;
  margin-bottom: 1rem;
}

/* ══════════════════════════════════════════════════════
   TICKET LIST — Style tableau (enterprise)
   ══════════════════════════════════════════════════════ */

/* Grille colonnes identique header + rows */
.tl-header, .ticket-row {
  display: grid;
  grid-template-columns: 110px 1fr 150px 110px 160px 100px 48px;
  align-items: center;
  gap: .5rem;
}

/* En-tête */
.tl-header {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: .7rem 1.25rem;
  font-size: .68rem; font-weight: 700;
  color: var(--muted);
  text-transform: uppercase; letter-spacing: .6px;
}
[class^="tl-col-"] { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Liste */
.ticket-list {
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

/* Ligne ticket */
.ticket-row {
  padding: .9rem 1.25rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .12s;
  position: relative;
}
.ticket-row:last-child { border-bottom: none; }
.ticket-row:hover { background: #f8fafc; }
.ticket-row:hover .tr-open-btn { opacity: 1; color: var(--brand); transform: translateX(2px); }
.ticket-row:active { background: #f1f5f9; }

/* Indicateur priorité (petit point coloré) */
.tr-prio-dot {
  display: inline-block;
  width: 8px; height: 8px; border-radius: 50%;
  margin-right: .4rem; flex-shrink: 0;
}
.tr-prio-dot.p0 { background: #cbd5e1; }
.tr-prio-dot.p1 { background: var(--info); }
.tr-prio-dot.p2 { background: var(--warning); }
.tr-prio-dot.p3 { background: var(--danger); box-shadow: 0 0 0 3px rgba(239,68,68,.15); }

/* Référence */
.tr-ref {
  font-family: 'SF Mono','Fira Code',monospace;
  font-size: .75rem; font-weight: 700; color: var(--brand);
}

/* Sujet */
.tr-subject {
  font-size: .875rem; font-weight: 600; color: var(--navy);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: block;
}

/* Priorité texte */
.tr-prio {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .75rem; font-weight: 600;
}
.tr-prio i { font-size: .75rem; }
.prio-normal  { color: var(--muted); }
.prio-low     { color: var(--info); }
.prio-high    { color: var(--warning); }
.prio-urgent  { color: var(--danger); font-weight: 700; }

/* Agent */
.tr-agent {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .78rem; color: var(--slate);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tr-agent-av {
  width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(135deg, #333333, #555555);
  color: #fff; font-size: .6rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.tr-unassigned {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .75rem; color: var(--muted); font-style: italic;
}

/* Date */
.tr-date { font-size: .75rem; color: var(--slate); }

/* Bouton ouvrir */
.tr-open-btn {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  color: var(--muted);
  font-size: .95rem;
  opacity: 0;
  transition: opacity .15s, color .15s, transform .15s;
}

/* Vide après filtre */
.ticket-empty-filter {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  padding: 3rem; color: var(--muted); font-size: .875rem;
  background: var(--surface);
  border: 1px solid var(--border); border-top: none;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.ticket-empty-filter i { font-size: 1.1rem; }

/* ── Badges statut (pills) ────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .25rem .65rem;
  border-radius: 20px;
  font-size: .68rem; font-weight: 700;
  letter-spacing: .15px; white-space: nowrap;
}
.pill::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%;
  background: currentColor; opacity: .65; flex-shrink: 0;
}
.pill-new     { background: #ede9fe; color: #5b21b6; }
.pill-open    { background: #dbeafe; color: #1d4ed8; }
.pill-pending { background: #fef3c7; color: #b45309; }
.pill-done    { background: #d1fae5; color: #065f46; }
.pill-closed  { background: #f1f5f9; color: #475569; }

/* ── Loader / Empty hérités ───────────────────────────── */
.empty-box { text-align: center; padding: 4rem 2rem; color: var(--muted); }
.empty-box .empty-icon {
  width: 72px; height: 72px; background: var(--bg);
  border-radius: var(--r-xl);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.25rem; font-size: 1.8rem; color: var(--border);
}
.empty-box h6 { font-weight: 700; color: var(--navy-soft); margin-bottom: .4rem; }
.empty-box p  { font-size: .875rem; }
.loader-box {
  display: flex; align-items: center; justify-content: center;
  gap: .75rem; padding: 3rem; color: var(--slate); font-size: .875rem;
}
.ring {
  width: 28px; height: 28px;
  border: 3px solid var(--border); border-top-color: var(--brand);
  border-radius: 50%; animation: spin .7s linear infinite;
}
.btn-new {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff; border: none; border-radius: var(--r);
  padding: .5rem 1.1rem; font-size: .82rem; font-weight: 600;
  cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: .35rem;
  box-shadow: 0 4px 12px rgba(247,148,29,.25);
  transition: transform .15s, box-shadow .2s;
}
.btn-new:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(247,148,29,.35); color: #fff; }

/* ══════════════════════════════════════════════════════
   TICKET NEW — Formulaire premium
   ══════════════════════════════════════════════════════ */
.form-shell { max-width: 700px; margin: 0 auto; padding: 2rem 1.5rem; }
.form-panel {
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.form-panel-header {
  background: linear-gradient(135deg, #111111 0%, #222222 100%);
  padding: 1.75rem 2rem;
  display: flex; align-items: center; gap: 1rem;
}
.form-panel-icon {
  width: 48px; height: 48px;
  background: rgba(247,148,29,.18);
  border-radius: var(--r);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; color: var(--brand);
}
.form-panel-title { color: #fff; font-size: 1.1rem; font-weight: 700; }
.form-panel-sub   { color: rgba(255,255,255,.5); font-size: .8rem; margin-top: 2px; }
.form-body { padding: 2rem; }
.form-section-label {
  font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .7px;
  color: var(--muted);
  margin-bottom: .75rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
}

/* Priority cards */
.prio-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.prio-card {
  border: 2px solid var(--border);
  border-radius: var(--r);
  padding: .6rem .5rem;
  text-align: center;
  cursor: pointer;
  transition: all .18s;
  background: #fafbfc;
}
.prio-card:hover { border-color: var(--brand); background: #fff; }
.prio-card.selected { border-color: var(--brand); background: rgba(247,148,29,.06); }
.prio-card .pico { font-size: 1.25rem; display: block; margin-bottom: .2rem; }
.prio-card .plabel { font-size: .7rem; font-weight: 600; color: var(--slate); }

/* Category chips */
.cat-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.cat-chip {
  display: flex; align-items: center; gap: .4rem;
  padding: .45rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  font-size: .8rem; font-weight: 500;
  color: var(--slate);
  transition: all .18s;
  background: #fafbfc;
}
.cat-chip:hover   { border-color: var(--brand); color: var(--navy); }
.cat-chip.selected { background: var(--brand); border-color: var(--brand); color: #fff; }

/* Textarea */
.field-textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  padding: .8rem 1rem;
  font-size: .875rem;
  font-family: inherit;
  color: var(--navy-mid);
  background: #fafbfc;
  resize: vertical;
  min-height: 140px;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
  line-height: 1.6;
}
.field-textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
  background: #fff;
}
.char-bar { display: flex; justify-content: flex-end; margin-top: .3rem; }
.char-count { font-size: .72rem; color: var(--muted); }
.char-count.warn { color: var(--warning); }
.char-count.over { color: var(--danger); }

/* Form actions */
.form-actions {
  display: flex; gap: .75rem;
  padding: 1.25rem 2rem;
  border-top: 1px solid var(--border);
  background: #fafbfc;
}

/* Success card */
.success-card {
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow);
  padding: 3rem 2rem;
  text-align: center;
  animation: fadeUp .4s cubic-bezier(.22,1,.36,1);
}
.success-icon {
  width: 80px; height: 80px;
  background: #f0fdf4;
  border-radius: 50%;
  margin: 0 auto 1.5rem;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.25rem; color: var(--success);
}
.success-ref {
  display: inline-block;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  padding: .6rem 1.5rem;
  font-family: 'SF Mono','Fira Code',monospace;
  font-size: 1.4rem; font-weight: 700;
  color: var(--brand);
  letter-spacing: 2px;
  margin: .75rem 0 1.25rem;
}

/* ══════════════════════════════════════════════════════
   TICKET DETAIL
   ══════════════════════════════════════════════════════ */
.detail-shell { max-width: 820px; margin: 0 auto; padding: 2rem 1.5rem; }

/* Status bar */
.status-hero {
  background: linear-gradient(135deg, #111111, #2a2a2a);
  border-radius: var(--r-xl);
  padding: 1.75rem;
  color: #fff;
  margin-bottom: 1.25rem;
  position: relative; overflow: hidden;
}
.status-hero::before {
  content: '';
  position: absolute;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(247,148,29,.12) 0%, transparent 70%);
  top: -80px; right: -80px;
}
.hero-ref { color: var(--brand); font-size: .8rem; font-weight: 700; font-family: monospace; margin-bottom: .4rem; opacity: .9; }
.hero-title { font-size: 1.15rem; font-weight: 800; margin-bottom: 1rem; position: relative; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 1rem; }
.hero-meta-item { display: flex; align-items: center; gap: .4rem; font-size: .8rem; color: rgba(255,255,255,.65); }
.hero-meta-item i { color: var(--brand); }

/* Metrics row */
.metrics-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.25rem; }
.metric-tile {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.1rem;
  text-align: center;
  border-top: 3px solid var(--brand);
  transition: transform .2s;
}
.metric-tile:hover { transform: translateY(-2px); }
.metric-icon { font-size: 1.2rem; color: var(--brand); margin-bottom: .35rem; }
.metric-val  { font-size: 1.4rem; font-weight: 800; color: var(--navy); line-height: 1; min-height: 1.6rem; }
.metric-lbl  { font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; font-weight: 600; margin-top: .25rem; }

/* Panel card */
.detail-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
  overflow: hidden;
}
.detail-card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: .5rem;
  font-size: .875rem; font-weight: 700; color: var(--navy);
}
.detail-card-header i { color: var(--brand); }
.detail-card-body { padding: 1.25rem; }

/* Messages */
.msg-thread { display: flex; flex-direction: column; gap: 1rem; }
.msg-row { display: flex; gap: .75rem; align-items: flex-start; }
.msg-row.from-client { flex-direction: row-reverse; }
.msg-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .72rem; flex-shrink: 0;
}
.msg-avatar.agent  { background: linear-gradient(135deg, var(--brand), var(--brand-dark)); color: #fff; }
.msg-avatar.client { background: var(--navy); color: #fff; }
.msg-bubble {
  max-width: 76%;
  background: var(--bg);
  border-radius: 12px 12px 12px 4px;
  padding: .75rem 1rem;
  font-size: .85rem; line-height: 1.55; color: var(--navy-mid);
}
.msg-row.from-client .msg-bubble {
  background: rgba(247,148,29,.09);
  border: 1px solid rgba(247,148,29,.18);
  border-radius: 12px 12px 4px 12px;
}
.msg-meta { font-size: .68rem; color: var(--muted); margin-bottom: .25rem; font-weight: 500; }
.msg-row.from-client .msg-meta { text-align: right; color: rgba(247,148,29,.9); }
.msg-time { font-size: .65rem; color: var(--muted); margin-top: .3rem; opacity: .75; }
.msg-row.from-client .msg-time { text-align: right; }

/* Reply form */
.reply-form { padding: 1.25rem; border-top: 1px solid var(--border); background: #fafbfc; }

/* Satisfaction */
.sat-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 1.25rem;
}
.sat-header {
  background: linear-gradient(135deg, #1e293b, #334155);
  padding: 1.25rem 1.5rem;
  display: flex; align-items: center; gap: 1rem;
}
.sat-header-icon {
  width: 42px; height: 42px;
  background: rgba(247,148,29,.18);
  border-radius: var(--r);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; color: var(--brand);
}
.sat-header-title { color: #fff; font-weight: 700; font-size: .95rem; }
.sat-header-sub   { color: rgba(255,255,255,.5); font-size: .78rem; margin-top: 1px; }
.sat-body { padding: 1.5rem; }
.star-row { display: flex; justify-content: center; gap: .4rem; margin-bottom: .5rem; }
.star-btn {
  background: none; border: none;
  padding: .3rem; cursor: pointer;
  transition: transform .15s; line-height: 1;
}
.star-btn:hover { transform: scale(1.2); }
.star-btn i { font-size: 2.25rem; color: #d1d5db !important; transition: color .1s; }
.star-btn.lit i { color: #f59e0b !important; }
.star-hint { display: flex; justify-content: space-between; font-size: .7rem; color: var(--muted); margin-bottom: 1rem; }
.sat-done-box {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border: 1px solid #fde68a;
  border-radius: var(--r);
  padding: 1.25rem; text-align: center;
}
.sat-stars-display { display: flex; justify-content: center; gap: .25rem; }

/* ══════════════════════════════════════════════════════
   MESSAGES — thread (ticket-detail)
   ══════════════════════════════════════════════════════ */
.messages-timeline {
  display: flex; flex-direction: column; gap: 1rem;
  padding: .5rem 0;
  max-height: 520px; overflow-y: auto;
}
.message-bubble {
  display: flex; gap: .75rem; align-items: flex-start;
}
.message-bubble.client-msg { flex-direction: row-reverse; }

.message-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .72rem;
  flex-shrink: 0; text-transform: uppercase;
}
.message-avatar.agent-avatar  { background: linear-gradient(135deg, var(--brand), var(--brand-dark)); color: #fff; }
.message-avatar.client-avatar { background: var(--navy); color: #fff; }

.message-content {
  max-width: 76%;
  background: var(--bg);
  border-radius: 12px 12px 12px 4px;
  padding: .75rem 1rem;
  font-size: .85rem; line-height: 1.6; color: var(--navy-mid);
}
.message-bubble.client-msg .message-content {
  background: rgba(247,148,29,.09);
  border: 1px solid rgba(247,148,29,.2);
  border-radius: 12px 12px 4px 12px;
}
.message-author {
  font-size: .72rem; font-weight: 600; color: var(--muted);
  margin-bottom: .3rem;
}
.message-bubble.client-msg .message-author { text-align: right; color: var(--brand); }
.message-date {
  font-size: .65rem; color: var(--muted);
  margin-top: .35rem; opacity: .7;
}
.message-bubble.client-msg .message-date { text-align: right; }

/* Indicator nouveaux messages */
.new-msg-badge {
  display: inline-flex; align-items: center; gap: .35rem;
  background: #f0fdf4; border: 1px solid #bbf7d0;
  color: #166534; font-size: .72rem; font-weight: 600;
  padding: .3rem .75rem; border-radius: 20px;
  animation: fadeUp .3s ease;
}

/* ══════════════════════════════════════════════════════
   PIÈCES JOINTES — zone d'upload
   ══════════════════════════════════════════════════════ */
.attach-zone {
  border: 2px dashed var(--border);
  border-radius: var(--r);
  background: #fafbfc;
  transition: border-color .2s, background .2s;
}
.attach-zone.drag-over {
  border-color: var(--brand);
  background: rgba(247,148,29,.04);
}
.attach-placeholder {
  display: flex; flex-direction: column; align-items: center;
  gap: .35rem; padding: 1.25rem 1rem;
  cursor: pointer; user-select: none;
  color: var(--muted); font-size: .82rem; text-align: center;
  transition: color .2s;
}
.attach-placeholder:hover { color: var(--brand); }
.attach-placeholder i { font-size: 1.5rem; }
.attach-placeholder small { font-size: .72rem; color: var(--muted); }
.file-list {
  display: flex; flex-direction: column; gap: .4rem;
  padding: 0 .75rem .75rem;
}
.file-item {
  display: flex; align-items: center; gap: .6rem;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--r-sm); padding: .5rem .75rem;
  font-size: .8rem;
}
.file-item i { color: var(--brand); font-size: 1rem; flex-shrink: 0; }
.file-name { flex: 1; font-weight: 500; color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-size { color: var(--muted); font-size: .72rem; flex-shrink: 0; margin-right: .25rem; }
.file-remove {
  background: none; border: none; cursor: pointer;
  color: var(--muted); padding: .15rem .3rem;
  border-radius: var(--r-sm); transition: all .15s; flex-shrink: 0;
  display: flex; align-items: center;
}
.file-remove:hover { color: var(--danger); background: #fef2f2; }

/* ─── Responsive ─────────────────────────────────────── */
@media (max-width: 1024px) {
  .dash-hero-kpis { padding: 1.25rem 1.5rem; }
  .hero-kpi { padding: 0 1.25rem; }
  .hero-kpi-num { font-size: 1.85rem; }
}
@media (max-width: 900px) {
  .auth-root { grid-template-columns: 1fr; }
  .auth-brand-panel { display: none; }
  /* Sur tablette, le formulaire prend tout l'écran avec padding réduit */
  .auth-form-panel { padding: 2rem 1.5rem; align-items: flex-start; padding-top: 2.5rem; }
  .auth-form-inner { max-width: 100%; }
  .metrics-row { grid-template-columns: repeat(2, 1fr); }
  .prio-cards { grid-template-columns: repeat(2, 1fr); }
  .dash-hero-content { flex-direction: column; }
  .dash-hero-kpis { align-self: stretch; justify-content: center; }
  .dash-hero-title { font-size: 1.5rem; }
  .dash-body { padding: 1.5rem 1rem 2rem; }
}
@media (max-width: 480px) {
  .auth-form-panel { padding: 1.5rem 1rem; padding-top: 1.75rem; }
  .auth-mobile-logo img { height: 34px; }
  .auth-mobile-header { padding: 1.25rem 1.25rem 1rem; margin-bottom: 1.25rem; }
}
@media (max-width: 576px) {
  .form-body { padding: 1.25rem; }
  .form-actions { padding: 1rem 1.25rem; }
  .form-shell, .detail-shell { padding: 1rem; }
  .otp-box { width: 42px; height: 52px; font-size: 1.2rem; }
  .tc-subject { font-size: .85rem; }
  .message-content { max-width: 88%; }
  .dash-hero-kpis { flex-wrap: wrap; gap: .5rem; }
  .hero-kpi-sep { display: none; }
  .hero-kpi { padding: .5rem 1rem; }
  .hero-kpi-num { font-size: 1.5rem; }
  .filter-chips { flex-wrap: wrap; }
  .tickets-toolbar { flex-direction: column; align-items: flex-start; }
  .tc-header { flex-direction: column; align-items: flex-start; gap: .35rem; }
}

/* ══════════════════════════════════════════════════════
   TICKET NEW — Page création de ticket (tn-*)
   ══════════════════════════════════════════════════════ */

body.tn-page { background: var(--bg); }

/* ─── Hero ───────────────────────────────────────────── */
.tn-hero {
  position: relative;
  background: linear-gradient(135deg, #0d0d0d 0%, #1a1a1a 60%, #222222 100%);
  padding: 2.5rem 0 2rem;
  overflow: hidden;
}
.tn-hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 10% 50%, rgba(247,148,29,.14) 0%, transparent 70%),
    radial-gradient(ellipse 40% 60% at 90% 20%, rgba(247,148,29,.06) 0%, transparent 70%);
  pointer-events: none;
}
.tn-hero-inner {
  position: relative;
  max-width: 860px;
  margin: 0 auto;
  padding: 0 2rem;
}
.tn-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  color: rgba(255,255,255,.55);
  font-size: .8rem;
  font-weight: 500;
  text-decoration: none;
  letter-spacing: .02em;
  margin-bottom: 1.1rem;
  transition: color .2s;
}
.tn-breadcrumb:hover { color: rgba(255,255,255,.85); }
.tn-hero-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  margin-bottom: .5rem;
}
.tn-hero-sub {
  color: rgba(255,255,255,.6);
  font-size: .9rem;
  margin-bottom: 1.25rem;
}
.tn-hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}
.tn-hero-badges span {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.7);
  font-size: .75rem;
  font-weight: 500;
  padding: .3rem .75rem;
  border-radius: 20px;
}
.tn-hero-badges span i { color: var(--brand); font-size: .8rem; }

/* ─── Shell ──────────────────────────────────────────── */
.tn-shell {
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem 2rem 4rem;
}

/* ─── Form card ──────────────────────────────────────── */
.tn-form-card {
  background: var(--surface);
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* ─── Section ────────────────────────────────────────── */
.tn-section { padding: 1.75rem 2rem; }
.tn-section-head {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.tn-step-num {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(247,148,29,.35);
}
.tn-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.3;
}
.tn-optional {
  font-weight: 400;
  font-size: .8rem;
  color: var(--muted);
}
.tn-section-sub {
  font-size: .8rem;
  color: var(--muted);
  margin-top: .15rem;
}
.tn-section-body { }
.tn-divider {
  height: 1px;
  background: var(--border);
  margin: 0 2rem;
}

/* ─── Input sujet ────────────────────────────────────── */
.tn-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.tn-input-icon {
  position: absolute;
  left: 1rem;
  color: var(--muted);
  font-size: 1rem;
  pointer-events: none;
}
.tn-input {
  width: 100%;
  padding: .75rem 1rem .75rem 2.75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  font-family: inherit;
  font-size: .95rem;
  color: var(--navy);
  background: var(--surface);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.tn-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}
.tn-input::placeholder { color: var(--muted); }

/* ─── Catégorie ──────────────────────────────────────── */
.tn-cat-grid {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}
.tn-cat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  padding: .9rem 1.1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s, transform .15s;
  min-width: 90px;
  user-select: none;
}
.tn-cat-card:hover {
  border-color: var(--brand);
  box-shadow: 0 4px 16px rgba(247,148,29,.12);
  transform: translateY(-2px);
}
.tn-cat-card.selected {
  border-color: var(--brand);
  background: #fff9f1;
  box-shadow: 0 4px 16px rgba(247,148,29,.18);
}
.tn-cat-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--cat-bg, #f1f5f9);
  color: var(--cat-color, #64748b);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  transition: transform .2s;
}
.tn-cat-card:hover .tn-cat-icon,
.tn-cat-card.selected .tn-cat-icon { transform: scale(1.1); }
.tn-cat-label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--navy-soft);
}
.tn-cat-card.selected .tn-cat-label { color: var(--brand); }

/* ─── Priorité ───────────────────────────────────────── */
.tn-prio-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .75rem;
}
.tn-prio-card {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .9rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s, transform .15s;
  user-select: none;
  position: relative;
}
.tn-prio-card:hover {
  border-color: var(--brand);
  box-shadow: 0 4px 16px rgba(247,148,29,.10);
  transform: translateY(-1px);
}
.tn-prio-card.selected {
  border-color: var(--brand);
  background: #fff9f1;
  box-shadow: 0 4px 16px rgba(247,148,29,.15);
}
.tn-prio-icon {
  flex-shrink: 0;
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--pb, #f1f5f9);
  color: var(--pc, #64748b);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem;
}
.tn-prio-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .1rem;
}
.tn-prio-label {
  font-size: .88rem;
  font-weight: 700;
  color: var(--navy);
}
.tn-prio-desc {
  font-size: .73rem;
  color: var(--muted);
}
.tn-prio-check {
  color: var(--brand);
  font-size: 1rem;
  opacity: 0;
  transition: opacity .2s;
}
.tn-prio-card.selected .tn-prio-check { opacity: 1; }
.tn-prio-card.selected .tn-prio-label { color: var(--brand); }

/* ─── Description ────────────────────────────────────── */
.tn-desc-tips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem .6rem;
  font-size: .75rem;
  color: var(--muted);
  margin-bottom: .75rem;
  padding: .5rem .75rem;
  background: #f8fafc;
  border-radius: var(--r);
  border: 1px solid var(--border);
}
.tn-desc-tips span:first-child { color: var(--brand); font-weight: 600; }
.tn-desc-tips i { color: var(--brand); }
.tn-textarea {
  width: 100%;
  min-height: 140px;
  padding: .85rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  font-family: inherit;
  font-size: .9rem;
  color: var(--navy);
  background: var(--surface);
  resize: vertical;
  outline: none;
  line-height: 1.6;
  transition: border-color .2s, box-shadow .2s;
}
.tn-textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}
.tn-textarea::placeholder { color: var(--muted); font-size: .85rem; }
.tn-char-bar {
  display: flex;
  justify-content: flex-end;
  margin-top: .4rem;
}
.tn-char-count {
  font-size: .73rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.tn-char-count.warn { color: var(--warning); }
.tn-char-count.over { color: var(--danger); }

/* ─── Pièces jointes ─────────────────────────────────── */
.tn-attach-zone {
  border: 2px dashed var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: border-color .2s, background .2s;
}
.tn-attach-zone.drag-over {
  border-color: var(--brand);
  background: #fff9f1;
}
.tn-attach-placeholder {
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .6rem;
  cursor: pointer;
  transition: background .2s;
}
.tn-attach-placeholder:hover { background: #fafbfc; }
.tn-attach-ico {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, #fff9f1, #fef3e2);
  border: 1px solid rgba(247,148,29,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  color: var(--brand);
}
.tn-attach-text {
  font-size: .88rem;
  color: var(--navy-soft);
  text-align: center;
}
.tn-attach-text strong { color: var(--navy); }
.tn-attach-hint {
  font-size: .73rem;
  color: var(--muted);
}
.tn-file-list {
  display: flex;
  flex-direction: column;
}

/* ─── Barre d'actions ────────────────────────────────── */
.tn-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .75rem;
  margin-top: 1.25rem;
}
.tn-submit-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.75rem;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  border: none;
  border-radius: var(--r);
  font-family: inherit;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-brand);
  transition: opacity .2s, transform .15s, box-shadow .2s;
}
.tn-submit-btn:hover { opacity: .92; transform: translateY(-1px); box-shadow: 0 10px 28px rgba(247,148,29,.38); }
.tn-submit-btn:active { transform: translateY(0); }
.tn-submit-btn:disabled { opacity: .65; cursor: not-allowed; transform: none; }
.tn-spin-ring {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .75s linear infinite;
}

/* ─── Succès ─────────────────────────────────────────── */
.tn-success {
  background: var(--surface);
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  padding: 3rem 2.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.tn-success-anim { margin-bottom: .5rem; }
.tn-success-circle {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  border: 3px solid #10b981;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  color: #059669;
  animation: successPop .5s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes successPop {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.tn-success-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--navy);
}
.tn-success-sub {
  font-size: .9rem;
  color: var(--muted);
  max-width: 380px;
}
.tn-success-ref-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: .85rem 2.5rem;
}
.tn-success-ref-lbl {
  font-size: .73rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  font-weight: 600;
}
.tn-success-ref {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--brand);
  letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
}
.tn-success-info {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .8rem;
  color: var(--muted);
  padding: .6rem 1rem;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: var(--r);
  max-width: 460px;
}
.tn-success-info i { color: var(--info); flex-shrink: 0; }
.tn-success-actions {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  max-width: 480px;
  margin-top: .5rem;
}

/* ─── Responsive ticket-new ──────────────────────────── */
@media (max-width: 700px) {
  .tn-hero-title { font-size: 1.3rem; }
  .tn-shell { padding: 1.25rem 1rem 3rem; }
  .tn-section { padding: 1.25rem 1.25rem; }
  .tn-divider { margin: 0 1.25rem; }
  .tn-prio-grid { grid-template-columns: 1fr; }
  .tn-cat-grid { gap: .5rem; }
  .tn-cat-card { min-width: 76px; padding: .7rem .8rem; }
  .tn-success { padding: 2rem 1.25rem; }
  .tn-success-actions { flex-direction: column; }
  .tn-actions { flex-direction: column-reverse; align-items: stretch; }
  .tn-submit-btn { justify-content: center; }
}
