/* ==========================================================================
   TicketPro — socle graphique
   Console de support B2B : dense, lisible, sans effets superflus.
   ========================================================================== */

:root {
    --tp-navy-900: #0c1626;
    --tp-navy-800: #12203a;
    --tp-navy-700: #1b2e4d;
    --tp-navy-600: #27405f;

    --tp-surface: #f4f6fa;
    --tp-surface-raised: #ffffff;
    --tp-surface-sunken: #eaeef5;

    --tp-border: #dbe2ec;
    --tp-border-strong: #c3cedc;

    --tp-text: #16233a;
    --tp-text-muted: #5c6b83;
    --tp-text-faint: #8695ab;
    --tp-text-inverse: #eef3fb;

    --tp-accent: #1f6feb;
    --tp-accent-dark: #1858c4;
    --tp-accent-soft: #e8f0fe;

    --tp-success: #0f7a54;
    --tp-success-soft: #e2f4ec;
    --tp-warning: #a55a06;
    --tp-warning-soft: #fdf0dd;
    --tp-danger: #b3243c;
    --tp-danger-soft: #fbe6ea;
    --tp-info: #1f6feb;
    --tp-info-soft: #e8f0fe;

    --tp-radius: 10px;
    --tp-radius-sm: 6px;
    --tp-radius-lg: 14px;

    --tp-shadow-sm: 0 1px 2px rgba(16, 32, 58, .08);
    --tp-shadow: 0 2px 10px rgba(16, 32, 58, .09);
    --tp-shadow-lg: 0 18px 40px rgba(12, 22, 38, .18);

    --tp-sidebar-width: 256px;
    --tp-topbar-height: 60px;

    --tp-font: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --tp-font-mono: "Cascadia Mono", Consolas, "SF Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
    height: 100%;
}

body {
    margin: 0;
    font-family: var(--tp-font);
    font-size: 14px;
    line-height: 1.55;
    color: var(--tp-text);
    background: var(--tp-surface);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--tp-accent);
    text-decoration: none;
}

a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
    margin: 0 0 .5rem;
    font-weight: 650;
    letter-spacing: -.01em;
    color: var(--tp-text);
}

h1 { font-size: 1.4rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }

p { margin: 0 0 .75rem; }

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

/* ------------------------------------------------------------- Structure */

.tp-app {
    display: flex;
    min-height: 100vh;
}

.tp-sidebar {
    width: var(--tp-sidebar-width);
    flex: 0 0 var(--tp-sidebar-width);
    background: var(--tp-navy-900);
    color: var(--tp-text-inverse);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 60;
    transition: transform .2s ease;
}

.tp-main {
    flex: 1 1 auto;
    margin-left: var(--tp-sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.tp-content {
    padding: 24px 28px 48px;
    flex: 1 1 auto;
}

.tp-container-narrow {
    max-width: 880px;
}

/* --------------------------------------------------------------- Sidebar */

.tp-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    height: var(--tp-topbar-height);
    padding: 0 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.tp-brand__mark {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--tp-accent);
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 14px;
}

.tp-brand__text {
    font-weight: 650;
    font-size: 15px;
    letter-spacing: .01em;
    color: #fff;
}

/* Bandeau d'espace : rappelle en permanence sur quel client on travaille. */
.tp-space {
    margin: 14px 14px 6px;
    padding: 11px 12px;
    border-radius: var(--tp-radius);
    background: rgba(255, 255, 255, .06);
    border-left: 3px solid var(--tp-accent);
}

.tp-space__label {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: rgba(238, 243, 251, .55);
}

.tp-space__name {
    font-weight: 600;
    color: #fff;
    font-size: 13.5px;
    margin-top: 2px;
    word-break: break-word;
}

.tp-space__action {
    margin-top: 8px;
    display: block;
    width: 100%;
}

.tp-nav {
    padding: 10px 10px 24px;
    overflow-y: auto;
    flex: 1 1 auto;
}

.tp-nav__group {
    margin-top: 16px;
    padding: 0 8px 6px;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: rgba(238, 243, 251, .42);
}

.tp-nav__link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 10px;
    border-radius: var(--tp-radius-sm);
    color: rgba(238, 243, 251, .82);
    font-size: 13.5px;
    margin-bottom: 2px;
}

.tp-nav__link:hover {
    background: rgba(255, 255, 255, .07);
    color: #fff;
    text-decoration: none;
}

.tp-nav__link.is-active {
    background: var(--tp-accent);
    color: #fff;
    font-weight: 600;
}

.tp-nav__link i {
    width: 18px;
    text-align: center;
    font-size: 14px;
}

.tp-sidebar__footer {
    padding: 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    font-size: 11.5px;
    color: rgba(238, 243, 251, .45);
}

/* ---------------------------------------------------------------- Topbar */

.tp-topbar {
    height: var(--tp-topbar-height);
    background: var(--tp-surface-raised);
    border-bottom: 1px solid var(--tp-border);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 40;
}

.tp-topbar__title {
    font-weight: 600;
    font-size: 14.5px;
}

.tp-topbar__spacer { flex: 1 1 auto; }

.tp-burger {
    display: none;
    background: none;
    border: 0;
    font-size: 18px;
    color: var(--tp-text);
    cursor: pointer;
}

/* Menu utilisateur */
.tp-usermenu { position: relative; }

.tp-usermenu__trigger {
    display: flex;
    align-items: center;
    gap: 9px;
    background: none;
    border: 1px solid transparent;
    border-radius: var(--tp-radius);
    padding: 5px 8px;
    cursor: pointer;
    color: var(--tp-text);
    font-family: inherit;
    font-size: 13px;
}

.tp-usermenu__trigger:hover { background: var(--tp-surface-sunken); }

.tp-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--tp-navy-700);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 650;
    letter-spacing: .02em;
    flex: 0 0 auto;
}

.tp-avatar--lg { width: 52px; height: 52px; font-size: 17px; }

.tp-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 240px;
    background: var(--tp-surface-raised);
    border: 1px solid var(--tp-border);
    border-radius: var(--tp-radius);
    box-shadow: var(--tp-shadow-lg);
    padding: 6px;
    display: none;
    z-index: 70;
}

.tp-menu.is-open { display: block; }

.tp-menu__header {
    padding: 10px 10px 8px;
    border-bottom: 1px solid var(--tp-border);
    margin-bottom: 6px;
}

.tp-menu__name { font-weight: 600; }
.tp-menu__meta { color: var(--tp-text-muted); font-size: 12px; }

.tp-menu__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border-radius: var(--tp-radius-sm);
    color: var(--tp-text);
    background: none;
    border: 0;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.tp-menu__item:hover { background: var(--tp-surface-sunken); text-decoration: none; }
.tp-menu__item i { width: 16px; color: var(--tp-text-muted); }
.tp-menu__separator { height: 1px; background: var(--tp-border); margin: 6px 0; }

.tp-menu--scroll { max-height: 340px; overflow-y: auto; }

/* ----------------------------------------------------------- En-tête page */

.tp-page-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tp-page-header__text { flex: 1 1 320px; min-width: 0; }
.tp-page-header__title { font-size: 1.35rem; font-weight: 650; margin: 0; }
.tp-page-header__subtitle { color: var(--tp-text-muted); margin: 4px 0 0; }
.tp-page-header__actions { display: flex; gap: 8px; flex-wrap: wrap; }

.tp-breadcrumb {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0;
    margin: 0 0 6px;
    font-size: 12.5px;
    color: var(--tp-text-faint);
}

.tp-breadcrumb li::after { content: "/"; margin-left: 6px; color: var(--tp-border-strong); }
.tp-breadcrumb li:last-child::after { content: ""; }

/* ----------------------------------------------------------------- Cartes */

.tp-card {
    background: var(--tp-surface-raised);
    border: 1px solid var(--tp-border);
    border-radius: var(--tp-radius);
    box-shadow: var(--tp-shadow-sm);
    margin-bottom: 18px;
}

.tp-card__header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--tp-border);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.tp-card__title { font-weight: 620; font-size: 14.5px; margin: 0; }
.tp-card__subtitle { color: var(--tp-text-muted); font-size: 12.5px; margin: 2px 0 0; }
.tp-card__body { padding: 18px; }
.tp-card__body--tight { padding: 0; }
.tp-card__footer {
    padding: 14px 18px;
    border-top: 1px solid var(--tp-border);
    background: var(--tp-surface-sunken);
    border-radius: 0 0 var(--tp-radius) var(--tp-radius);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tp-card__spacer { flex: 1 1 auto; }

/* ------------------------------------------------------------------- KPI */

.tp-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(196px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.tp-kpi {
    background: var(--tp-surface-raised);
    border: 1px solid var(--tp-border);
    border-radius: var(--tp-radius);
    padding: 16px 18px;
    box-shadow: var(--tp-shadow-sm);
    border-top: 3px solid var(--tp-accent);
}

.tp-kpi--success { border-top-color: var(--tp-success); }
.tp-kpi--warning { border-top-color: var(--tp-warning); }
.tp-kpi--danger { border-top-color: var(--tp-danger); }
.tp-kpi--muted { border-top-color: var(--tp-border-strong); }

.tp-kpi__label {
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--tp-text-muted);
}

.tp-kpi__value { font-size: 1.7rem; font-weight: 660; margin-top: 4px; line-height: 1.2; }
.tp-kpi__hint { font-size: 12px; color: var(--tp-text-faint); margin-top: 2px; }

/* --------------------------------------------------------------- Tableaux */

.tp-table-wrap { overflow-x: auto; }

.tp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.tp-table th {
    text-align: left;
    font-weight: 620;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--tp-text-muted);
    padding: 11px 16px;
    background: var(--tp-surface-sunken);
    border-bottom: 1px solid var(--tp-border);
    white-space: nowrap;
}

.tp-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--tp-border);
    vertical-align: middle;
}

.tp-table tbody tr:last-child td { border-bottom: 0; }
.tp-table tbody tr:hover { background: var(--tp-surface-sunken); }
.tp-table__actions { text-align: right; white-space: nowrap; }
.tp-table__num { text-align: right; font-variant-numeric: tabular-nums; }

.tp-cell-primary { font-weight: 600; }
.tp-cell-meta { color: var(--tp-text-muted); font-size: 12.5px; }

/* --------------------------------------------------------------- Badges */

.tp-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    background: var(--tp-surface-sunken);
    color: var(--tp-text-muted);
    white-space: nowrap;
}

.tp-badge--success { background: var(--tp-success-soft); color: var(--tp-success); }
.tp-badge--warning { background: var(--tp-warning-soft); color: var(--tp-warning); }
.tp-badge--danger { background: var(--tp-danger-soft); color: var(--tp-danger); }
.tp-badge--info { background: var(--tp-info-soft); color: var(--tp-info); }
.tp-badge--outline { background: transparent; border: 1px solid var(--tp-border-strong); }

.tp-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* --------------------------------------------------------------- Boutons */

.tp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 15px;
    border-radius: var(--tp-radius-sm);
    border: 1px solid var(--tp-border-strong);
    background: var(--tp-surface-raised);
    color: var(--tp-text);
    font: inherit;
    font-size: 13.5px;
    font-weight: 550;
    cursor: pointer;
    transition: background .12s ease, border-color .12s ease;
}

.tp-btn:hover { background: var(--tp-surface-sunken); text-decoration: none; }

.tp-btn--primary {
    background: var(--tp-accent);
    border-color: var(--tp-accent);
    color: #fff;
}

.tp-btn--primary:hover { background: var(--tp-accent-dark); border-color: var(--tp-accent-dark); }

.tp-btn--danger { background: var(--tp-danger); border-color: var(--tp-danger); color: #fff; }
.tp-btn--danger:hover { background: #99182f; border-color: #99182f; }

.tp-btn--ghost { background: transparent; border-color: transparent; color: var(--tp-text-muted); }
.tp-btn--ghost:hover { background: var(--tp-surface-sunken); color: var(--tp-text); }

.tp-btn--sm { padding: 5px 10px; font-size: 12.5px; }
.tp-btn--block { width: 100%; }
.tp-btn[disabled] { opacity: .55; cursor: not-allowed; }

.tp-btn-group { display: inline-flex; gap: 6px; }

/* ------------------------------------------------------------ Formulaires */

.tp-form-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 16px;
}

.tp-col-2 { grid-column: span 2; }
.tp-col-3 { grid-column: span 3; }
.tp-col-4 { grid-column: span 4; }
.tp-col-5 { grid-column: span 5; }
.tp-col-6 { grid-column: span 6; }
.tp-col-7 { grid-column: span 7; }
.tp-col-8 { grid-column: span 8; }
.tp-col-9 { grid-column: span 9; }
.tp-col-10 { grid-column: span 10; }
.tp-col-12 { grid-column: span 12; }

.tp-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }

.tp-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--tp-text-muted);
}

.tp-input,
.tp-select,
.tp-textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--tp-border-strong);
    border-radius: var(--tp-radius-sm);
    background: var(--tp-surface-raised);
    color: var(--tp-text);
    font: inherit;
    font-size: 13.5px;
}

.tp-input:focus,
.tp-select:focus,
.tp-textarea:focus {
    border-color: var(--tp-accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(31, 111, 235, .14);
}

.tp-input[readonly], .tp-input[disabled] { background: var(--tp-surface-sunken); color: var(--tp-text-muted); }

.tp-textarea { min-height: 96px; resize: vertical; }

.tp-input--color { padding: 4px; height: 38px; }

.tp-hint { font-size: 12px; color: var(--tp-text-faint); }

.tp-check {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 9px 11px;
    border: 1px solid var(--tp-border);
    border-radius: var(--tp-radius-sm);
    background: var(--tp-surface-raised);
    cursor: pointer;
}

.tp-check:hover { border-color: var(--tp-border-strong); }
.tp-check input { margin-top: 3px; }
.tp-check__label { font-weight: 600; font-size: 13px; }
.tp-check__hint { font-size: 12px; color: var(--tp-text-muted); }

.tp-fieldset {
    border: 1px solid var(--tp-border);
    border-radius: var(--tp-radius);
    padding: 16px;
    margin: 0 0 4px;
}

.tp-fieldset legend {
    font-size: 12px;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--tp-text-muted);
    padding: 0 6px;
}

.field-validation-error { color: var(--tp-danger); font-size: 12px; }
.input-validation-error { border-color: var(--tp-danger) !important; }

.tp-validation {
    background: var(--tp-danger-soft);
    border: 1px solid rgba(179, 36, 60, .28);
    color: var(--tp-danger);
    border-radius: var(--tp-radius-sm);
    padding: 12px 14px;
    margin-bottom: 16px;
}

.tp-validation ul { margin: 0; padding-left: 18px; }
.tp-validation ul:empty { display: none; }

/* ---------------------------------------------------------------- Alertes */

.tp-alert {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 12px 15px;
    border-radius: var(--tp-radius-sm);
    margin-bottom: 16px;
    border: 1px solid transparent;
    font-size: 13.5px;
}

.tp-alert i { margin-top: 2px; }
.tp-alert--success { background: var(--tp-success-soft); color: var(--tp-success); border-color: rgba(15, 122, 84, .22); }
.tp-alert--danger { background: var(--tp-danger-soft); color: var(--tp-danger); border-color: rgba(179, 36, 60, .22); }
.tp-alert--warning { background: var(--tp-warning-soft); color: var(--tp-warning); border-color: rgba(165, 90, 6, .22); }
.tp-alert--info { background: var(--tp-info-soft); color: var(--tp-info); border-color: rgba(31, 111, 235, .22); }

/* ------------------------------------------------------------- Filtres */

.tp-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.tp-filters .tp-field { flex: 1 1 190px; }
.tp-filters__actions { display: flex; gap: 8px; }

/* ------------------------------------------------------- Pagination / vide */

.tp-pager {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border-top: 1px solid var(--tp-border);
    font-size: 13px;
    color: var(--tp-text-muted);
    flex-wrap: wrap;
}

.tp-pager__spacer { flex: 1 1 auto; }

.tp-empty {
    text-align: center;
    padding: 46px 24px;
    color: var(--tp-text-muted);
}

.tp-empty i { font-size: 26px; color: var(--tp-border-strong); margin-bottom: 10px; display: block; }
.tp-empty__title { font-weight: 620; color: var(--tp-text); margin-bottom: 4px; }

/* --------------------------------------------------------- Listes clé/valeur */

.tp-dl {
    display: grid;
    grid-template-columns: minmax(150px, 32%) 1fr;
    gap: 0;
    margin: 0;
    font-size: 13.5px;
}

.tp-dl dt {
    color: var(--tp-text-muted);
    padding: 9px 0;
    border-bottom: 1px solid var(--tp-border);
}

.tp-dl dd {
    margin: 0;
    padding: 9px 0;
    border-bottom: 1px solid var(--tp-border);
    word-break: break-word;
}

.tp-dl dt:last-of-type, .tp-dl dd:last-of-type { border-bottom: 0; }

.tp-stack { display: flex; flex-direction: column; gap: 12px; }
.tp-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tp-split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; align-items: start; }

.tp-mono { font-family: var(--tp-font-mono); font-size: 12.5px; }
.tp-muted { color: var(--tp-text-muted); }
.tp-nowrap { white-space: nowrap; }
.tp-text-right { text-align: right; }
.tp-mb-0 { margin-bottom: 0; }
.tp-mt-16 { margin-top: 16px; }

/* --------------------------------------------------------- Page de connexion */

.tp-auth {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
    background: var(--tp-surface);
}

.tp-auth__aside {
    position: relative;
    background: linear-gradient(160deg, var(--tp-navy-900) 0%, var(--tp-navy-700) 100%);
    color: var(--tp-text-inverse);
    padding: 64px 52px 72px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Bloc d'identité centré : société, nature de l'espace, arguments */
.tp-auth__center {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 460px;
}

.tp-auth__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 62px;
    height: 62px;
    margin-bottom: 26px;
    border: 1px solid rgba(31, 111, 235, .4);
    border-radius: 18px;
    background: rgba(31, 111, 235, .15);
    color: var(--tp-accent);
    font-size: 25px;
}

.tp-auth__company {
    margin: 0;
    color: #fff;
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.tp-auth__rule {
    display: block;
    width: 64px;
    height: 3px;
    margin: 24px 0 22px;
    border-radius: 2px;
    background: var(--tp-accent);
}

.tp-auth__space {
    margin: 0;
    color: #fff;
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: .01em;
}

.tp-auth__tagline {
    margin: 12px 0 0;
    max-width: 400px;
    color: rgba(238, 243, 251, .72);
    font-size: .9375rem;
    line-height: 1.65;
}

.tp-auth__points {
    list-style: none;
    padding: 0;
    margin: 36px 0 0;
    display: grid;
    gap: 13px;
    text-align: left;
}

.tp-auth__points li { display: flex; gap: 11px; align-items: flex-start; color: rgba(238, 243, 251, .82); font-size: 13.5px; }
.tp-auth__points i { color: var(--tp-accent); margin-top: 3px; width: 16px; text-align: center; }

.tp-auth__legal {
    position: absolute;
    left: 52px;
    right: 52px;
    bottom: 26px;
    font-size: 12px;
    color: rgba(238, 243, 251, .4);
}

.tp-auth__panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 28px;
}

.tp-auth__card {
    width: 100%;
    max-width: 400px;
}

.tp-auth__title { font-size: 1.35rem; margin-bottom: 4px; }
.tp-auth__lead { color: var(--tp-text-muted); margin-bottom: 22px; }

.tp-auth__footer { margin-top: 18px; font-size: 13px; color: var(--tp-text-muted); text-align: center; }

.tp-code-input {
    font-size: 1.5rem;
    letter-spacing: .55rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
    padding: 12px;
}

.tp-qr {
    display: block;
    margin: 0 auto 14px;
    width: 190px;
    height: 190px;
    border: 1px solid var(--tp-border);
    border-radius: var(--tp-radius-sm);
    background: #fff;
    padding: 8px;
}

.tp-secret {
    display: block;
    text-align: center;
    font-family: var(--tp-font-mono);
    background: var(--tp-surface-sunken);
    border-radius: var(--tp-radius-sm);
    padding: 10px;
    letter-spacing: .06em;
    word-break: break-all;
}

/* ------------------------------------------------------------- Responsive */

@media (max-width: 1100px) {
    .tp-split { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 980px) {
    .tp-auth { grid-template-columns: minmax(0, 1fr); }
    .tp-auth__aside { display: none; }
}

@media (max-width: 860px) {
    .tp-sidebar { transform: translateX(-100%); }
    .tp-sidebar.is-open { transform: translateX(0); box-shadow: var(--tp-shadow-lg); }
    .tp-main { margin-left: 0; }
    .tp-burger { display: inline-flex; }
    .tp-content { padding: 18px 16px 40px; }
    .tp-col-2, .tp-col-3, .tp-col-4, .tp-col-5, .tp-col-6,
    .tp-col-7, .tp-col-8, .tp-col-9, .tp-col-10 { grid-column: span 12; }
    .tp-dl { grid-template-columns: minmax(0, 1fr); }
    .tp-dl dt { padding-bottom: 0; border-bottom: 0; }
}

.tp-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(12, 22, 38, .45);
    z-index: 50;
}

.tp-backdrop.is-visible { display: block; }

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}

@media print {
    .tp-sidebar, .tp-topbar, .tp-page-header__actions, .tp-card__footer { display: none !important; }
    .tp-main { margin-left: 0; }
    body { background: #fff; }
}

/* ==========================================================================
   Suivi client — catalogue, parc, contrats, contacts et réunions
   ========================================================================== */

/* Onglets de section (catalogue) */
.tp-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0 0 18px;
    padding: 4px;
    background: var(--tp-surface-sunken);
    border: 1px solid var(--tp-border);
    border-radius: var(--tp-radius);
}

.tp-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: var(--tp-radius-sm);
    color: var(--tp-text-muted);
    font-size: .875rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
}

.tp-tab:hover {
    background: rgba(255, 255, 255, .7);
    color: var(--tp-text);
}

.tp-tab.is-active {
    background: var(--tp-surface-raised);
    color: var(--tp-accent);
    box-shadow: 0 1px 2px rgba(12, 22, 38, .08);
}

.tp-tab i { font-size: .8125rem; }

/* Pastille d'information compacte (version, référence courte) */
.tp-chip {
    display: inline-block;
    padding: 1px 8px;
    margin-left: 4px;
    border: 1px solid var(--tp-border-strong);
    border-radius: 999px;
    background: var(--tp-surface-sunken);
    color: var(--tp-text-muted);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: .75rem;
    line-height: 1.5;
    white-space: nowrap;
}

/* Bloc de texte long saisi par l'utilisateur (conditions, comptes rendus) */
.tp-note {
    margin: 0 0 16px;
    padding: 12px 14px;
    border-left: 3px solid var(--tp-border-strong);
    border-radius: 0 var(--tp-radius-sm) var(--tp-radius-sm) 0;
    background: var(--tp-surface-sunken);
    color: var(--tp-text);
    font-size: .9375rem;
    line-height: 1.6;
    white-space: pre-line;
}

/* Tableaux imbriqués dans une fiche : plus denses */
.tp-table--compact th,
.tp-table--compact td {
    padding-top: 8px;
    padding-bottom: 8px;
    font-size: .875rem;
}

/* Sélecteur inline dans une cellule de tableau */
.tp-select--sm {
    height: 30px;
    padding: 2px 26px 2px 8px;
    font-size: .8125rem;
}

.tp-inline-form { display: inline-block; margin: 0; }

@media (max-width: 1180px) {
    .tp-auth__company { font-size: 2.4rem; }
    .tp-auth__aside { padding: 48px 36px 64px; }
    .tp-auth__legal { left: 36px; right: 36px; }
}

/* ==========================================================================
   Ticketing — fil de discussion, pièces jointes, journal
   ========================================================================== */

.tp-thread {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 16px;
}

.tp-thread__item {
    padding: 16px 18px;
    border: 1px solid var(--tp-border);
    border-radius: var(--tp-radius);
    background: var(--tp-surface-raised);
}

/* Message d'un collaborateur de l'éditeur */
.tp-thread__item.is-agent {
    border-color: #cddffb;
    background: var(--tp-accent-soft);
}

/* Note interne : signalée sans ambiguïté pour éviter toute confusion */
.tp-thread__item.is-internal {
    border-color: #e8cfa4;
    background: var(--tp-warning-soft);
    border-left: 3px solid var(--tp-warning);
}

.tp-thread__head { display: flex; align-items: center; gap: 11px; margin-bottom: 10px; }
.tp-thread__author { font-weight: 600; font-size: .9375rem; color: var(--tp-text); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tp-thread__meta { font-size: 12px; color: var(--tp-text-muted); }

.tp-thread__body {
    font-size: .9375rem;
    line-height: 1.65;
    color: var(--tp-text);
    white-space: pre-line;
}

/* Pièces jointes */
.tp-attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.tp-attachment {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 11px;
    border: 1px solid var(--tp-border-strong);
    border-radius: 999px;
    background: var(--tp-surface-raised);
    color: var(--tp-text);
    font-size: 12.5px;
    text-decoration: none;
    max-width: 100%;
}

.tp-attachment:hover { border-color: var(--tp-accent); color: var(--tp-accent); }
.tp-attachment i { color: var(--tp-text-muted); }
.tp-attachment__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.tp-attachment__size { color: var(--tp-text-faint); font-size: 11.5px; }

/* Journal des évènements */
.tp-timeline { list-style: none; margin: 0; padding: 4px 20px 16px; display: grid; gap: 14px; }

.tp-timeline li {
    position: relative;
    padding-left: 18px;
    border-left: 2px solid var(--tp-border);
}

.tp-timeline li::before {
    content: "";
    position: absolute;
    left: -5px;
    top: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--tp-accent);
}

.tp-timeline__label { font-size: .875rem; font-weight: 600; color: var(--tp-text); }
.tp-timeline__detail { font-size: .8125rem; color: var(--tp-text); margin-top: 2px; }
.tp-timeline__meta { font-size: 11.5px; color: var(--tp-text-muted); margin-top: 2px; }

/* Barre d'actions du ticket : reste visible pendant le défilement */
.tp-toolbar {
    position: sticky;
    top: var(--tp-topbar-height);
    z-index: 30;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin: 0 0 18px;
    padding: 11px 16px;
    border: 1px solid var(--tp-border);
    border-radius: var(--tp-radius);
    background: var(--tp-surface-raised);
    box-shadow: 0 2px 8px rgba(12, 22, 38, .07);
}

.tp-toolbar__identity { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tp-toolbar__ref { font-weight: 600; font-size: .9375rem; }
.tp-toolbar__spacer { flex: 1 1 auto; }

.tp-toolbar__form { display: flex; align-items: center; gap: 6px; margin: 0; }

.tp-toolbar__label {
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--tp-text-muted);
    white-space: nowrap;
}

.tp-toolbar .tp-select--sm { min-width: 140px; }

/* Le bloc de requalification se détache visuellement du reste de la barre */
.tp-toolbar__form--group {
    padding: 6px 10px;
    border: 1px solid var(--tp-border);
    border-radius: var(--tp-radius-sm);
    background: var(--tp-surface-sunken);
}

@media (max-width: 980px) {
    .tp-toolbar { position: static; }
    .tp-toolbar__form { width: 100%; }
    .tp-toolbar .tp-select--sm { flex: 1 1 auto; min-width: 0; }
}
