/* ==========================================================================
   EasyChat — composants partagés, grammaire « WhatsApp Web ».

   Une seule feuille pour le dashboard tenant et le back-office : coquille
   (volet de gauche en liste de discussions, bandeau de conversation), cartes
   posées comme des bulles sur le fond de conversation, listes, boutons en
   gélule, puces de filtre, coches de statut. Chaque application n'ajoute dans
   son `site.css` que ses écrans propres.

   Les icônes sont des SVG maison (`../img/*.svg`) appliqués en masque : leur
   couleur suit `background-color`, donc le thème.
   ========================================================================== */

/* --- Base ------------------------------------------------------------- */

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

body {
    margin: 0;
    font-family: var(--ec-font);
    font-size: .9375rem;
    line-height: 1.45;
    color: var(--ec-ink);
    background: var(--ec-panel-header);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

::selection {
    background: color-mix(in srgb, var(--ec-accent-bright) 28%, transparent);
    color: inherit;
}

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

a {
    color: var(--ec-accent);
    text-underline-offset: 3px;
}

a:hover {
    color: var(--ec-accent-hover);
}

code,
pre,
kbd {
    font-family: var(--ec-mono);
    font-size: .8125rem;
}

code {
    color: var(--ec-ink-muted);
    word-break: break-word;
}

h1, h2, h3, h4 {
    color: var(--ec-ink);
    text-wrap: balance;
}

* {
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--ec-ink) 20%, transparent) transparent;
}

*::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

*::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--ec-ink) 20%, transparent);
    border-radius: 3px;
}

.ec-hidden {
    display: none !important;
}

.ec-skip-link {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2000;
    padding: 10px 16px;
    border-radius: var(--ec-radius-pill);
    background: var(--ec-accent);
    color: var(--ec-ink-on-accent);
    font-weight: 500;
    transform: translateY(-160%);
    transition: transform .2s var(--ec-ease);
}

.ec-skip-link:focus {
    transform: none;
    color: var(--ec-ink-on-accent);
}

/* --- Icônes en masque -------------------------------------------------- */

.ec-i {
    display: inline-block;
    flex: none;
    width: 24px;
    height: 24px;
    background-color: currentColor;
    -webkit-mask: var(--ec-i) center / contain no-repeat;
    mask: var(--ec-i) center / contain no-repeat;
}

.ec-i-grid, .ec-nav-icon-grid, .ec-figma-nav-overview { --ec-i: url("../img/grid.svg"); }
.ec-i-phone, .ec-nav-icon-phone, .ec-figma-nav-sessions { --ec-i: url("../img/phone.svg"); }
.ec-i-contacts, .ec-nav-icon-contacts { --ec-i: url("../img/contacts.svg"); }
.ec-i-tags, .ec-nav-icon-tags { --ec-i: url("../img/tags.svg"); }
.ec-i-template, .ec-nav-icon-template { --ec-i: url("../img/template.svg"); }
.ec-i-campaigns, .ec-nav-icon-campaigns { --ec-i: url("../img/campaigns.svg"); }
.ec-i-messages, .ec-nav-icon-messages { --ec-i: url("../img/messages.svg"); }
.ec-i-settings, .ec-nav-icon-settings { --ec-i: url("../img/settings.svg"); }
.ec-i-chart, .ec-figma-nav-alerts { --ec-i: url("../img/chart.svg"); }
.ec-i-building, .ec-figma-nav-tenants { --ec-i: url("../img/building.svg"); }
.ec-i-billing, .ec-figma-nav-billing { --ec-i: url("../img/billing.svg"); }
.ec-i-logs, .ec-figma-nav-logs { --ec-i: url("../img/logs.svg"); }
.ec-i-search { --ec-i: url("../img/search.svg"); }
.ec-i-logout { --ec-i: url("../img/logout.svg"); }
.ec-i-lock { --ec-i: url("../img/lock.svg"); }
.ec-i-shield, .ec-figma-nav-security { --ec-i: url("../img/shield.svg"); }
.ec-i-alert, .ec-figma-nav-logs { --ec-i: url("../img/alert.svg"); }
.ec-i-bell { --ec-i: url("../img/bell.svg"); }
.ec-i-qr { --ec-i: url("../img/qr.svg"); }
.ec-i-key { --ec-i: url("../img/key.svg"); }
.ec-i-clock { --ec-i: url("../img/clock.svg"); }
.ec-i-tick { --ec-i: url("../img/tick.svg"); }
.ec-i-ticks { --ec-i: url("../img/ticks.svg"); }
.ec-i-brand { --ec-i: url("../img/brand.svg"); }
.ec-figma-icon-tenants { --ec-i: url("../img/building.svg"); }
.ec-figma-icon-alerts { --ec-i: url("../img/bell.svg"); }
.ec-figma-alert-icon { --ec-alert-i: url("../img/alert.svg"); }

/* ==========================================================================
   Coquille applicative : volet de gauche + zone de conversation.
   ========================================================================== */

.ec-app-shell,
.ec-admin-shell {
    display: grid;
    grid-template-columns: var(--ec-sidebar-w) minmax(0, 1fr);
    min-height: 100vh;
    background: var(--ec-app);
}

.ec-app-shell #footer,
.ec-admin-shell #footer {
    display: none;
}

.ec-chrome,
.ec-figma-chrome {
    grid-column: 1;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 20;
}

.ec-sidebar,
.ec-figma-sidebar {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--ec-panel);
    border-right: 1px solid var(--ec-divider);
}

/* Bandeau du volet : marque, compte, actions. */
.ec-sidebar-head {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: var(--ec-header-h);
    padding: 8px 10px 8px 16px;
    background: var(--ec-panel-header);
}

.ec-brand-mark {
    display: grid;
    place-items: center;
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--ec-accent-bright);
    color: #fff;
}

.ec-brand-mark .ec-i {
    width: 24px;
    height: 24px;
}

.ec-sidebar-brand {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
    color: var(--ec-ink);
    text-decoration: none;
    line-height: 1.25;
}

.ec-sidebar-brand:hover {
    color: var(--ec-ink);
}

.ec-sidebar-brand strong {
    overflow: hidden;
    font-size: 1rem;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ec-sidebar-brand small {
    overflow: hidden;
    font-size: .8125rem;
    color: var(--ec-ink-muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ec-icon-button {
    display: grid;
    place-items: center;
    flex: none;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--ec-icon);
    cursor: pointer;
    text-decoration: none;
    transition: background-color .15s;
}

.ec-icon-button:hover {
    background: color-mix(in srgb, var(--ec-ink) 8%, transparent);
    color: var(--ec-ink);
}

.ec-icon-button .ec-i {
    width: 22px;
    height: 22px;
}

.ec-theme-glyph {
    display: block;
    width: 22px;
    height: 22px;
    background-color: currentColor;
    -webkit-mask: url("../img/moon.svg") center / contain no-repeat;
    mask: url("../img/moon.svg") center / contain no-repeat;
}

[data-theme-icon="light"] .ec-theme-glyph {
    -webkit-mask-image: url("../img/sun.svg");
    mask-image: url("../img/sun.svg");
}

/* Recherche du volet, comme celle des discussions. */
.ec-sidebar-search {
    position: relative;
    padding: 7px 12px;
    border-bottom: 1px solid var(--ec-divider);
}

.ec-sidebar-search .ec-i {
    position: absolute;
    top: 50%;
    left: 26px;
    width: 18px;
    height: 18px;
    color: var(--ec-icon);
    transform: translateY(-50%);
    pointer-events: none;
}

.ec-sidebar-search input {
    width: 100%;
    height: 36px;
    padding: 0 14px 0 50px;
    border: 0;
    border-radius: var(--ec-radius);
    background: var(--ec-input);
    color: var(--ec-ink);
    font: inherit;
    font-size: .875rem;
}

.ec-sidebar-search input::placeholder {
    color: var(--ec-ink-faint);
}

.ec-sidebar-search input:focus {
    outline: none;
    box-shadow: inset 0 0 0 1.5px var(--ec-focus);
}

/* Navigation : chaque entrée est une ligne de discussion. */
.ec-nav,
.ec-figma-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.ec-nav-link,
.ec-figma-nav-link {
    display: grid;
    grid-template-columns: 49px minmax(0, 1fr);
    align-items: center;
    column-gap: 15px;
    min-height: 72px;
    padding-left: 13px;
    color: var(--ec-ink);
    text-decoration: none;
    transition: background-color .12s;
}

.ec-nav-link:hover,
.ec-figma-nav-link:hover {
    background: var(--ec-hover);
    color: var(--ec-ink);
}

.ec-nav-link.active,
.ec-figma-nav-link.active {
    background: var(--ec-selected);
}

.ec-nav-icon,
.ec-figma-nav-icon {
    display: grid;
    place-items: center;
    width: 49px;
    height: 49px;
    border-radius: 50%;
    background: var(--ec-avatar);
    color: var(--ec-avatar-ink);
    transition: background-color .2s, color .2s;
}

.ec-nav-icon::before,
.ec-figma-nav-icon::before {
    content: "";
    width: 24px;
    height: 24px;
    background-color: currentColor;
    -webkit-mask: var(--ec-i) center / contain no-repeat;
    mask: var(--ec-i) center / contain no-repeat;
}

.ec-nav-link.active .ec-nav-icon,
.ec-figma-nav-link.active .ec-figma-nav-icon {
    background: var(--ec-accent-bright);
    color: #fff;
}

.ec-nav-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-self: stretch;
    min-width: 0;
    padding-right: 15px;
    border-top: 1px solid var(--ec-divider);
}

.ec-nav-link:first-child .ec-nav-text,
.ec-figma-nav-link:first-child .ec-nav-text,
.ec-nav-link.active .ec-nav-text,
.ec-nav-link:hover .ec-nav-text,
.ec-nav-link.active + .ec-nav-link .ec-nav-text,
.ec-nav-link:hover + .ec-nav-link .ec-nav-text,
.ec-figma-nav-link.active .ec-nav-text,
.ec-figma-nav-link:hover .ec-nav-text,
.ec-figma-nav-link.active + .ec-figma-nav-link .ec-nav-text,
.ec-figma-nav-link:hover + .ec-figma-nav-link .ec-nav-text {
    border-top-color: transparent;
}

.ec-nav-title {
    overflow: hidden;
    font-size: 1.0625rem;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ec-nav-sub {
    overflow: hidden;
    margin-top: 2px;
    font-size: .875rem;
    line-height: 1.3;
    color: var(--ec-ink-faint);
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Pied du volet : mention de confiance, comme le chiffrement de bout en bout. */
.ec-sidebar-foot {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 16px 16px;
    border-top: 1px solid var(--ec-divider);
    font-size: .8125rem;
    color: var(--ec-ink-faint);
    text-align: center;
}

.ec-sidebar-foot .ec-i {
    width: 13px;
    height: 13px;
}

/* --- Zone principale : fond de conversation --------------------------- */

.ec-main {
    grid-column: 2;
    min-width: 0;
    min-height: 100vh;
    background-color: var(--ec-wall);
    background-image: var(--ec-wall-image);
    background-size: 260px;
    background-attachment: fixed;
}

.ec-main-container {
    min-height: 100vh;
}

.ec-main-container > .breadcrumb,
.ec-main-container > nav[aria-label="breadcrumb"] {
    display: none;
}

/* Les messages flash deviennent des toasts posés au bas de la conversation. */
.ec-toasts {
    position: fixed;
    right: var(--ec-gutter);
    bottom: 22px;
    left: calc(var(--ec-sidebar-w) + var(--ec-gutter));
    z-index: 1080;
    display: grid;
    justify-items: center;
    gap: 8px;
    pointer-events: none;
}

.ec-toasts:empty {
    display: none;
}

.ec-toasts .alert {
    width: min(100%, 560px);
    margin: 0;
    box-shadow: var(--ec-shadow-pop);
    pointer-events: auto;
    animation: ec-toast-in .45s var(--ec-ease) both;
}

@keyframes ec-toast-in {
    from {
        opacity: 0;
        transform: translateY(14px) scale(.98);
    }
}

/* ==========================================================================
   Page : bandeau de conversation + contenu posé sur le fond.
   ========================================================================== */

.ec-page,
.ec-figma-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 56px;
}

.ec-page > :not(.ec-page-header),
.ec-figma-page > :not(.ec-figma-page-header) {
    width: min(100% - 2 * var(--ec-gutter), var(--ec-content-max));
    margin-inline: auto;
}

.ec-page > :first-child:not(.ec-page-header),
.ec-figma-page > :first-child:not(.ec-figma-page-header) {
    margin-top: var(--ec-gutter);
}

.ec-page > .ec-page-header + *,
.ec-figma-page > .ec-figma-page-header + * {
    margin-top: 8px;
}

.ec-page-header,
.ec-figma-page-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    min-height: var(--ec-header-h);
    padding: 9px var(--ec-gutter);
    background: var(--ec-panel-header);
    box-shadow: 0 1px 0 var(--ec-divider);
}

.ec-page-header > div:first-child,
.ec-figma-page-header > div:first-child {
    min-width: 0;
    flex: 1 1 320px;
}

.ec-page-header h1,
.ec-figma-page-header h1 {
    margin: 0;
    font-size: 1.0625rem;
    font-weight: 500;
    line-height: 1.3;
}

.ec-page-header p,
.ec-figma-page-header p {
    margin: 2px 0 0;
    font-size: .8125rem;
    line-height: 1.35;
    color: var(--ec-ink-muted);
}

.ec-page-header form {
    margin: 0;
}

.ec-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.ec-actions form {
    margin: 0;
}

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

.ec-card {
    position: relative;
    padding: 18px 20px;
    border: 0;
    border-radius: var(--ec-radius);
    background: var(--ec-panel);
    box-shadow: var(--ec-shadow-bubble);
    color: var(--ec-ink);
}

.ec-card > :last-child {
    margin-bottom: 0;
}

.ec-card-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    font-size: .9375rem;
    font-weight: 500;
    line-height: 1.35;
    color: var(--ec-accent-ink);
}

.ec-card-title small {
    font-size: .8125rem;
    font-weight: 400;
    color: var(--ec-ink-faint);
}

.ec-card h2:not(.ec-card-title),
.ec-card h3 {
    font-size: 1.0625rem;
    font-weight: 500;
}

.ec-card p {
    color: var(--ec-ink-muted);
}

.ec-card small {
    color: var(--ec-ink-faint);
}

.ec-two-cols {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 18px;
}

.ec-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
    align-items: start;
    gap: 16px;
}

.ec-form-grid > form {
    display: contents;
}

.ec-form-card {
    padding: 22px 24px;
}

/* Bulle système jaune : aide, avertissement doux, mentions. */
.ec-helper-card {
    padding: 14px 16px;
    border-radius: var(--ec-radius-bubble);
    background: var(--ec-notice);
    color: var(--ec-notice-ink);
    font-size: .875rem;
}

.ec-helper-card p,
.ec-helper-card li,
.ec-helper-card small {
    color: var(--ec-notice-ink);
}

.ec-helper-card strong,
.ec-helper-card h2,
.ec-helper-card h3 {
    color: var(--ec-ink);
}

.ec-helper-card h2,
.ec-helper-card h3 {
    margin: 0 0 6px;
    font-size: .9375rem;
    font-weight: 500;
}

.ec-helper-card ul,
.ec-helper-card ol {
    margin: 6px 0 0;
    padding-left: 18px;
}

.ec-helper-card:has(.ec-template-preview) {
    background-color: var(--ec-wall);
    background-image: var(--ec-wall-image);
    background-size: 260px;
    color: var(--ec-ink);
}

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

.ec-primary-button,
.ec-secondary-button,
.ec-figma-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: var(--ec-radius-pill);
    font: inherit;
    font-size: .875rem;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .15s, box-shadow .15s, color .15s, border-color .15s;
}

.ec-primary-button,
.ec-figma-btn-primary {
    background: var(--ec-accent);
    color: var(--ec-ink-on-accent);
}

.ec-primary-button .ec-i,
.ec-secondary-button .ec-i {
    width: 18px;
    height: 18px;
}

.ec-primary-button:hover,
.ec-figma-btn-primary:hover {
    background: var(--ec-accent-hover);
    color: var(--ec-ink-on-accent);
    box-shadow: var(--ec-shadow-bubble);
}

.ec-secondary-button,
.ec-figma-btn-ghost {
    border-color: var(--ec-border);
    background: var(--ec-panel);
    color: var(--ec-accent-ink);
}

.ec-secondary-button:hover,
.ec-figma-btn-ghost:hover {
    border-color: var(--ec-border-strong);
    color: var(--ec-accent-hover);
    box-shadow: var(--ec-shadow-bubble);
}

.ec-table-action,
.ec-figma-row-action,
.ec-danger-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 0;
    border-radius: var(--ec-radius-pill);
    background: transparent;
    color: var(--ec-accent-ink);
    font: inherit;
    font-size: .875rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .15s, color .15s;
}

.ec-table-action:hover,
.ec-figma-row-action:hover {
    background: var(--ec-accent-wash);
    color: var(--ec-accent-ink);
}

.ec-danger-link {
    color: var(--ec-danger-ink);
}

.ec-danger-link:hover {
    background: var(--ec-danger-wash);
    color: var(--ec-danger-ink);
}

.ec-primary-button:disabled,
.ec-secondary-button:disabled,
.ec-table-action:disabled,
[disabled].ec-primary-button,
[disabled].ec-secondary-button {
    opacity: .45;
    cursor: not-allowed;
    box-shadow: none;
}

.ec-row-actions {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 2px;
}

.ec-row-actions form {
    display: inline;
    margin: 0;
}

/* --- Puces de filtre et onglets de réglages --------------------------- */

.ec-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

nav.ec-filter-bar > a,
.ec-segment {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 14px;
    border: 0;
    border-radius: var(--ec-radius-pill);
    background: var(--ec-panel);
    box-shadow: var(--ec-shadow-bubble);
    color: var(--ec-ink-muted);
    font-size: .875rem;
    font-weight: 500;
    text-decoration: none;
    transition: background-color .15s, color .15s;
}

nav.ec-filter-bar > a:hover,
.ec-segment:hover {
    background: var(--ec-hover);
    color: var(--ec-ink);
    box-shadow: var(--ec-shadow-bubble);
}

nav.ec-filter-bar > a[aria-current="page"],
.ec-segment.active {
    background: var(--ec-accent-wash);
    color: var(--ec-accent-ink);
}

/* Barre de recherche d'un écran. */
form.ec-filter-bar {
    position: relative;
    flex-wrap: nowrap;
}

form.ec-filter-bar[role="search"] > label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

form.ec-filter-bar[role="search"]::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 16px;
    z-index: 1;
    width: 18px;
    height: 18px;
    background-color: var(--ec-icon);
    -webkit-mask: url("../img/search.svg") center / contain no-repeat;
    mask: url("../img/search.svg") center / contain no-repeat;
    transform: translateY(-50%);
    pointer-events: none;
}

.ec-search-input,
form.ec-filter-bar > input,
form.ec-filter-bar > select {
    flex: 1;
    min-width: 0;
    height: 40px;
    padding: 0 16px 0 46px;
    border: 0;
    border-radius: var(--ec-radius-pill);
    background: var(--ec-panel);
    box-shadow: var(--ec-shadow-bubble);
    color: var(--ec-ink);
    font: inherit;
    font-size: .9375rem;
}

form.ec-filter-bar:not([role="search"]) > label {
    color: var(--ec-accent-ink);
    font-size: .8125rem;
    font-weight: 500;
    white-space: nowrap;
}

form.ec-filter-bar:not([role="search"]) > .ec-search-input {
    padding-left: 16px;
}

.ec-card .ec-search-input,
.ec-card form.ec-filter-bar > input {
    height: 38px;
    max-width: 360px;
    background: var(--ec-input);
    box-shadow: none;
}

.ec-table .ec-search-input {
    height: 34px;
    max-width: 260px;
    background: transparent;
}

.ec-table .ec-search-input:hover {
    background: var(--ec-input);
}

form.ec-filter-bar > input ~ input,
form.ec-filter-bar > input ~ select,
form.ec-filter-bar > select ~ select {
    flex: 0 1 220px;
    padding-left: 16px;
}

.ec-search-input::placeholder {
    color: var(--ec-ink-faint);
}

.ec-search-input:focus,
form.ec-filter-bar > input:focus,
form.ec-filter-bar > select:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--ec-focus);
}

/* --- Badges et statuts ------------------------------------------------ */

.ec-badge {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 9px;
    border-radius: var(--ec-radius-pill);
    background: var(--ec-neutral-wash);
    color: var(--ec-ink-muted);
    font-size: .75rem;
    font-weight: 500;
    letter-spacing: .01em;
    white-space: nowrap;
}

.ec-badge + .ec-badge {
    margin-left: 4px;
}

.ec-status,
.ec-figma-state {
    --ec-status-ink: var(--ec-neutral-ink);
    --ec-status-wash: var(--ec-neutral-wash);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 24px;
    padding: 0 10px 0 8px;
    border-radius: var(--ec-radius-pill);
    background: var(--ec-status-wash);
    color: var(--ec-status-ink);
    font-size: .8125rem;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
}

.ec-status::before {
    content: "";
    flex: none;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.ec-status-ok,
.ec-status-active,
.ec-status-connected,
.ec-figma-state.connected {
    --ec-status-ink: var(--ec-ok-ink);
    --ec-status-wash: var(--ec-ok-wash);
}

.ec-status-warn,
.ec-status-warning,
.ec-status-trial,
.ec-status-reconnecting,
.ec-status-pending_scan,
.ec-figma-state.syncing {
    --ec-status-ink: var(--ec-warn-ink);
    --ec-status-wash: var(--ec-warn-wash);
}

.ec-status-danger,
.ec-status-error,
.ec-status-disconnected,
.ec-figma-state.disconnected {
    --ec-status-ink: var(--ec-danger-ink);
    --ec-status-wash: var(--ec-danger-wash);
}

.ec-status-info {
    --ec-status-ink: var(--ec-info-ink);
    --ec-status-wash: var(--ec-info-wash);
}

/* Statuts de message : les coches de WhatsApp, pas des pastilles. */
.ec-status-pending,
.ec-status-sent,
.ec-status-delivered,
.ec-status-read,
.ec-status-failed {
    --ec-status-wash: transparent;
    padding-left: 2px;
}

.ec-status-pending::before,
.ec-status-sent::before,
.ec-status-delivered::before,
.ec-status-read::before,
.ec-status-failed::before {
    width: 17px;
    height: 17px;
    border-radius: 0;
    -webkit-mask: var(--ec-i) center / contain no-repeat;
    mask: var(--ec-i) center / contain no-repeat;
}

.ec-status-pending { --ec-status-ink: var(--ec-ink-faint); --ec-i: url("../img/clock.svg"); }
.ec-status-sent { --ec-status-ink: var(--ec-ink-muted); --ec-i: url("../img/tick.svg"); }
.ec-status-delivered { --ec-status-ink: var(--ec-ink-muted); --ec-i: url("../img/ticks.svg"); }
.ec-status-read { --ec-status-ink: var(--ec-ink-muted); --ec-i: url("../img/ticks.svg"); }
.ec-status-failed { --ec-status-ink: var(--ec-danger-ink); --ec-i: url("../img/alert.svg"); }
.ec-status-read::before { background: var(--ec-tick-read); }

/* Point d'état de session : vert vivant, gris éteint. */
.ec-dot {
    position: relative;
    display: inline-block;
    flex: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--ec-ink-faint);
}

.ec-dot-live {
    background: var(--ec-badge);
}

.ec-dot-live::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--ec-badge);
    animation: ec-pulse 2.4s var(--ec-ease) infinite;
}

@keyframes ec-pulse {
    from {
        opacity: .6;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(3);
    }
}

/* --- Avatars ---------------------------------------------------------- */

.ec-avatar,
.ec-figma-tenant-badge {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--ec-avatar);
    color: var(--ec-avatar-ink);
    font-size: .9375rem;
    font-weight: 500;
    vertical-align: middle;
}

.ec-avatar-sm {
    width: 34px;
    height: 34px;
    font-size: .8125rem;
}

/* --- Listes (tableaux) ------------------------------------------------ */

.ec-table-card {
    padding: 0;
    overflow: hidden;
}

.ec-table-card > .ec-card-title {
    padding: 16px 20px 0;
    margin-bottom: 8px;
}

.ec-table-card > .ec-empty-state,
.ec-table-card > .ec-block-unavailable,
.ec-table-card > p,
.ec-table-card > .alert {
    margin: 16px 20px;
}

.ec-table-card > .ec-empty-state {
    margin: 0;
}

.ec-table-card > form,
.ec-table-card > dl {
    padding: 0 20px 18px;
}

.ec-table-card > .table-responsive,
.ec-table-card > .ec-figma-table-wrap {
    margin: 0;
}

.table.ec-table,
.ec-table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--ec-ink);
    --bs-table-border-color: var(--ec-divider);
    --bs-table-hover-bg: var(--ec-hover);
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    color: var(--ec-ink);
    font-variant-numeric: tabular-nums;
}

.ec-table > :not(caption) > * > * {
    padding: 13px 14px;
    border-bottom: 1px solid var(--ec-divider);
    background: transparent;
    box-shadow: none;
    color: inherit;
}

.ec-table > thead > tr > th {
    padding-block: 11px;
    border-bottom-color: var(--ec-divider);
    color: var(--ec-ink-faint);
    font-size: .8125rem;
    font-weight: 500;
    white-space: nowrap;
}

.ec-table > :not(caption) > tr > :first-child {
    padding-left: 20px;
}

.ec-table > :not(caption) > tr > :last-child {
    padding-right: 20px;
}

.ec-table > tbody > tr:last-child > * {
    border-bottom: 0;
}

.ec-table > tbody > tr {
    transition: background-color .12s;
}

.ec-table > tbody > tr:hover {
    background: var(--ec-hover);
}

.ec-table > tbody th[scope="row"] {
    font-weight: 400;
}

.ec-table th[scope="row"] > .ec-avatar {
    margin-right: 12px;
}

.ec-table strong {
    font-weight: 500;
}

.ec-table small {
    display: block;
    margin-top: 2px;
    font-size: .8125rem;
    color: var(--ec-ink-faint);
}

.ec-table code {
    font-size: .8125rem;
    color: var(--ec-ink-muted);
}

.ec-table td,
.ec-table th {
    vertical-align: middle;
}

.ec-table tr.is-danger,
.ec-table tr[data-stale="1"] {
    background: color-mix(in srgb, var(--ec-danger-wash) 55%, transparent);
}

.ec-pagination-note,
.ec-table-footnote {
    margin: 0;
    padding: 12px 20px;
    border-top: 1px solid var(--ec-divider);
    font-size: .8125rem;
    color: var(--ec-ink-faint);
}

/* --- Listes de définitions ------------------------------------------- */

.ec-meta-list,
.ec-card dl.row {
    margin: 0;
}

.ec-meta-list > div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 11px 0;
    border-top: 1px solid var(--ec-divider);
}

.ec-meta-list > div:first-child {
    border-top: 0;
}

.ec-meta-list dt,
.ec-card dl.row > dt {
    font-weight: 400;
    color: var(--ec-ink-muted);
}

.ec-meta-list dd {
    margin: 0;
    color: var(--ec-ink);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.ec-card dl.row {
    --bs-gutter-x: 16px;
}

.ec-card dl.row > dt,
.ec-card dl.row > dd {
    margin: 0;
    padding-block: 10px;
    border-top: 1px solid var(--ec-divider);
}

.ec-card dl.row > dt:first-of-type,
.ec-card dl.row > dt:first-of-type + dd {
    border-top: 0;
}

/* --- États vides et indisponibles ------------------------------------ */

.ec-empty-state,
.ec-figma-unavailable-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 44px 24px 40px;
    text-align: center;
}

.ec-empty-state::before {
    content: "";
    display: block;
    width: 68px;
    height: 68px;
    margin-bottom: 18px;
    border-radius: 50%;
    background:
        var(--ec-accent-bright) center / 30px no-repeat;
    -webkit-mask:
        url("../img/messages.svg") center / 30px no-repeat,
        linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask:
        url("../img/messages.svg") center / 30px no-repeat exclude,
        linear-gradient(#000 0 0);
    opacity: .9;
}

.ec-empty-state strong,
.ec-figma-unavailable-block strong {
    font-size: 1.375rem;
    font-weight: 300;
    line-height: 1.3;
    color: var(--ec-ink);
}

.ec-empty-state p,
.ec-figma-unavailable-block p {
    max-width: 46ch;
    margin: 8px 0 0;
    font-size: .875rem;
    color: var(--ec-ink-faint);
}

.ec-qr-card .ec-empty-state::before {
    width: 56px;
    height: 56px;
    margin-bottom: 12px;
    -webkit-mask-image: url("../img/qr.svg"), linear-gradient(#000 0 0);
    mask-image: url("../img/qr.svg"), linear-gradient(#000 0 0);
    -webkit-mask-size: 26px, auto;
    mask-size: 26px, auto;
}

.ec-empty-state .ec-primary-button,
.ec-empty-state .ec-secondary-button {
    margin-top: 20px;
}

.ec-block-unavailable {
    padding: 10px 14px;
    border-radius: var(--ec-radius-bubble);
    background: var(--ec-notice);
    color: var(--ec-notice-ink);
    font-size: .875rem;
}

.ec-block-unavailable strong {
    display: block;
    color: var(--ec-ink);
    font-weight: 500;
}

.ec-block-unavailable p {
    margin: 2px 0 0;
    color: var(--ec-notice-ink);
}

.ec-figma-unavailable {
    color: var(--ec-ink-faint);
}

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

.alert {
    --bs-alert-border-color: transparent;
    position: relative;
    display: block;
    margin: 0;
    padding: 13px 44px 13px 48px;
    border: 0;
    border-radius: var(--ec-radius-bubble);
    background: var(--ec-neutral-wash);
    box-shadow: var(--ec-shadow-bubble);
    color: var(--ec-ink);
    font-size: .875rem;
}

.alert::before {
    content: "";
    position: absolute;
    top: 13px;
    left: 16px;
    width: 20px;
    height: 20px;
    background-color: currentColor;
    -webkit-mask: url("../img/alert.svg") center / contain no-repeat;
    mask: url("../img/alert.svg") center / contain no-repeat;
}

.alert a {
    color: inherit;
    font-weight: 500;
    text-decoration: underline;
}

.alert-success {
    background: var(--ec-ok-wash);
    color: var(--ec-ok-ink);
}

.alert-success::before {
    -webkit-mask-image: url("../img/ticks.svg");
    mask-image: url("../img/ticks.svg");
}

.alert-warning {
    background: var(--ec-warn-wash);
    color: var(--ec-warn-ink);
}

.alert-danger {
    background: var(--ec-danger-wash);
    color: var(--ec-danger-ink);
}

.alert-info {
    background: var(--ec-info-wash);
    color: var(--ec-info-ink);
}

.alert-secondary {
    background: var(--ec-notice);
    color: var(--ec-notice-ink);
}

.alert .btn-close {
    position: absolute;
    top: 9px;
    right: 9px;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 50%;
    background: transparent;
    opacity: 1;
}

.alert .btn-close::before {
    content: "";
    display: block;
    width: 14px;
    height: 14px;
    margin: auto;
    background-color: currentColor;
    -webkit-mask: url("../img/close.svg") center / contain no-repeat;
    mask: url("../img/close.svg") center / contain no-repeat;
}

.alert .btn-close {
    color: inherit;
    filter: none;
    --bs-btn-close-bg: none;
}

.alert .btn-close:hover {
    background-color: color-mix(in srgb, currentColor 12%, transparent);
}

/* Bandeau d'état (session déconnectée) : pastille ronde + texte. */
.ec-alert {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    align-items: center;
    column-gap: 16px;
    padding: 14px 18px;
    border-radius: var(--ec-radius);
    background: var(--ec-panel);
    box-shadow: var(--ec-shadow-bubble);
}

.ec-alert::before {
    content: "";
    grid-row: span 2;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background:
        var(--ec-warn-signal);
    -webkit-mask:
        url("../img/alert.svg") center / 24px no-repeat exclude,
        linear-gradient(#000 0 0);
    mask:
        url("../img/alert.svg") center / 24px no-repeat exclude,
        linear-gradient(#000 0 0);
}

.ec-alert-danger::before {
    background: var(--ec-danger-signal);
}

.ec-alert strong {
    font-weight: 500;
}

.ec-alert span {
    font-size: .875rem;
    color: var(--ec-ink-muted);
}

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

.form-label,
.ec-form-card label:not(.form-check-label):not(.custom-control-label) {
    margin-bottom: 6px;
    color: var(--ec-accent-ink);
    font-size: .8125rem;
    font-weight: 500;
}

.ec-form-card > label,
.ec-form-card > .ec-two-cols > label {
    display: grid;
    gap: 6px;
    margin-bottom: 16px;
}

.form-control,
.form-select {
    min-height: 42px;
    padding: 9px 13px;
    border: 1px solid var(--ec-border);
    border-radius: var(--ec-radius);
    background-color: var(--ec-field);
    color: var(--ec-ink);
    font: inherit;
    font-size: .9375rem;
    transition: border-color .15s, box-shadow .15s;
}

.form-control::placeholder {
    color: var(--ec-ink-faint);
    opacity: 1;
}

.form-control:hover,
.form-select:hover {
    border-color: var(--ec-border-strong);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--ec-focus);
    background-color: var(--ec-field);
    box-shadow: 0 0 0 1px var(--ec-focus);
    color: var(--ec-ink);
}

.form-control:disabled,
.form-control[readonly] {
    background-color: var(--ec-input);
    color: var(--ec-ink-muted);
}

.form-control::file-selector-button {
    margin: -9px 14px -9px -13px;
    padding: 9px 16px;
    border: 0;
    border-right: 1px solid var(--ec-border);
    border-radius: 0;
    background: var(--ec-panel-header);
    color: var(--ec-accent-ink);
    font-weight: 500;
}

.form-control:hover:not(:disabled):not([readonly])::file-selector-button {
    background: var(--ec-accent-wash);
}

textarea.form-control {
    min-height: 140px;
    line-height: 1.5;
    resize: vertical;
}

.form-control.is-invalid,
.was-validated .form-control:invalid {
    border-color: var(--ec-danger-signal);
    background-image: none;
    padding-right: 13px;
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 1px var(--ec-danger-signal);
}

.invalid-feedback,
.help-block-error {
    margin-top: 6px;
    color: var(--ec-danger-ink);
    font-size: .8125rem;
}

.form-text,
.hint-block {
    margin-top: 6px;
    color: var(--ec-ink-faint);
    font-size: .8125rem;
}

.form-check-input {
    border-color: var(--ec-border-strong);
    background-color: var(--ec-field);
}

.form-check-input:checked {
    border-color: var(--ec-accent-bright);
    background-color: var(--ec-accent-bright);
}

.form-check-input:focus {
    border-color: var(--ec-focus);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ec-focus) 25%, transparent);
}

.form-check-label {
    color: var(--ec-ink);
}

.ec-form-card .ec-actions {
    justify-content: flex-end;
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--ec-divider);
}

/* --- Indicateurs : quota, progression, compteurs ---------------------- */

.ec-quota-number {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 8px;
    font-variant-numeric: tabular-nums;
}

.ec-quota-number strong {
    font-size: 2rem;
    font-weight: 300;
    line-height: 1.1;
    letter-spacing: -.01em;
}

.ec-quota-number span {
    color: var(--ec-ink-muted);
    font-size: .875rem;
}

.ec-quota-number b {
    margin-left: auto;
    color: var(--ec-accent-ink);
    font-size: .9375rem;
    font-weight: 500;
}

.ec-progress {
    position: relative;
    height: 6px;
    margin-top: 12px;
    overflow: hidden;
    border-radius: var(--ec-radius-pill);
    background: var(--ec-divider);
}

.ec-progress > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--ec-accent-bright);
}

.ec-progress-alert > span {
    background: var(--ec-danger-signal);
}

.ec-quota-card:has(.ec-progress-alert) .ec-quota-number b {
    color: var(--ec-danger-ink);
}

.ec-quota-note {
    margin: 10px 0 0;
    color: var(--ec-ink-faint) !important;
    font-size: .8125rem;
}

.ec-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.ec-overview-grid > .ec-stat-row,
.ec-overview-grid > .ec-table-card,
.ec-overview-grid > .ec-form-card,
.ec-overview-grid > .ec-chat-card {
    grid-column: 1 / -1;
}

.ec-stat-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.ec-stat-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 4px 10px;
    padding: 16px 18px;
}

.ec-stat-card small {
    color: var(--ec-ink-muted) !important;
    font-size: .875rem;
}

.ec-stat-card strong {
    grid-column: 1 / -1;
    font-size: 1.75rem;
    font-weight: 300;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
}

.ec-stat-icon {
    width: 20px;
    height: 20px;
    background-color: var(--ec-tick);
    -webkit-mask: var(--ec-i, url("../img/tick.svg")) center / contain no-repeat;
    mask: var(--ec-i, url("../img/tick.svg")) center / contain no-repeat;
}

.ec-stat-pending .ec-stat-icon { --ec-i: url("../img/clock.svg"); }
.ec-stat-sent .ec-stat-icon { --ec-i: url("../img/tick.svg"); }
.ec-stat-delivered .ec-stat-icon { --ec-i: url("../img/ticks.svg"); }
.ec-stat-read .ec-stat-icon { --ec-i: url("../img/ticks.svg"); background-color: var(--ec-tick-read); }
.ec-stat-failed .ec-stat-icon { --ec-i: url("../img/alert.svg"); background-color: var(--ec-danger-signal); }
.ec-stat-failed strong { color: var(--ec-ink); }

.ec-stat-span {
    grid-column: 1 / -1;
}

.ec-metric-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ec-metric-card small {
    color: var(--ec-ink-muted) !important;
    font-size: .875rem;
}

.ec-metric-card strong {
    font-size: 1.5rem;
    font-weight: 300;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.ec-metric-card span {
    color: var(--ec-ink-faint);
    font-size: .8125rem;
}

.ec-metric-card span.ok {
    color: var(--ec-ok-ink);
}

.ec-metric-card span.danger {
    color: var(--ec-danger-ink);
}

/* ==========================================================================
   Bulles de message.
   ========================================================================== */

.ec-chat-wall {
    padding: 16px;
    border-radius: var(--ec-radius);
    background-color: var(--ec-wall);
    background-image: var(--ec-wall-image);
    background-size: 260px;
}

.ec-template-preview,
.ec-rendered-preview,
.ec-bubble {
    position: relative;
    width: fit-content;
    max-width: min(100%, 560px);
    margin: 0 0 0 auto;
    padding: 7px 10px 8px;
    border-radius: var(--ec-radius-bubble) 0 var(--ec-radius-bubble) var(--ec-radius-bubble);
    background: var(--ec-bubble-out);
    box-shadow: var(--ec-shadow-bubble);
    color: var(--ec-ink);
    font-family: var(--ec-font);
    font-size: .890625rem;
    line-height: 1.36;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.ec-template-preview::after,
.ec-rendered-preview::after,
.ec-bubble::after {
    content: "";
    position: absolute;
    top: 0;
    right: -8px;
    width: 8px;
    height: 13px;
    background: var(--ec-bubble-out);
    clip-path: polygon(0 0, 100% 0, 0 100%);
}

/* `pre.ec-template-preview` porte du code (clé d'API, curl, codes de secours),
   pas un message : bloc de code, sans bulle. */
pre.ec-template-preview {
    width: auto;
    max-width: none;
    margin: 0 0 14px;
    padding: 14px 16px;
    overflow-x: auto;
    border-radius: var(--ec-radius);
    background: var(--ec-panel-header);
    box-shadow: inset 0 0 0 1px var(--ec-divider);
    font-family: var(--ec-mono);
    font-size: .8125rem;
    line-height: 1.6;
    white-space: pre;
    overflow-wrap: normal;
}

pre.ec-template-preview::after {
    content: none;
}

pre.ec-template-preview code {
    color: var(--ec-ink);
    font-size: inherit;
}

.ec-bubble-in {
    margin: 0 auto 0 0;
    border-radius: 0 var(--ec-radius-bubble) var(--ec-radius-bubble) var(--ec-radius-bubble);
    background: var(--ec-bubble-in);
}

.ec-bubble-in::after {
    right: auto;
    left: -8px;
    background: var(--ec-bubble-in);
    clip-path: polygon(0 0, 100% 0, 100% 100%);
}

.ec-bubble-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 3px;
    margin: 2px -2px -3px 12px;
    float: right;
    position: relative;
    top: 6px;
    color: var(--ec-bubble-meta);
    font-size: .6875rem;
    line-height: 15px;
    white-space: nowrap;
}

.ec-bubble-meta .ec-tick {
    width: 16px;
    height: 15px;
    background-color: var(--ec-tick);
    -webkit-mask: url("../img/ticks.svg") center / contain no-repeat;
    mask: url("../img/ticks.svg") center / contain no-repeat;
}

.ec-tick.is-sent {
    -webkit-mask-image: url("../img/tick.svg");
    mask-image: url("../img/tick.svg");
}

.ec-tick.is-pending {
    -webkit-mask-image: url("../img/clock.svg");
    mask-image: url("../img/clock.svg");
    width: 13px;
}

.ec-tick.is-read {
    background-color: var(--ec-tick-read) !important;
}

.ec-tick.is-failed {
    -webkit-mask-image: url("../img/alert.svg");
    mask-image: url("../img/alert.svg");
    width: 14px;
    background-color: var(--ec-danger-signal) !important;
}

.ec-card > .ec-chat-wall {
    margin-block: 4px 16px;
}

.ec-table-card > .ec-chat-wall {
    margin: 0;
    border-radius: 0;
}

/* Puce de date / message système centrée. */
.ec-chat-chip {
    display: table;
    margin: 0 auto 12px;
    padding: 5px 12px 6px;
    border-radius: var(--ec-radius-bubble);
    background: var(--ec-panel);
    box-shadow: var(--ec-shadow-bubble);
    color: var(--ec-ink-muted);
    font-size: .75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .02em;
}

.ec-chat-chip.is-notice {
    background: var(--ec-notice);
    color: var(--ec-notice-ink);
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
}

/* ==========================================================================
   Écrans d'entrée : connexion, mot de passe, double authentification.
   ========================================================================== */

.ec-auth-shell {
    min-height: 100vh;
    background: var(--ec-auth-bg, #fcf5eb);
    color: var(--ec-ink);
}

[data-bs-theme="dark"] .ec-auth-shell {
    --ec-auth-bg: var(--ec-app);
}

.ec-auth-shell #header {
    display: none;
}

.ec-auth-shell #footer {
    background: transparent !important;
    color: var(--ec-ink-faint);
    font-size: .8125rem;
}

.ec-auth-shell #footer p {
    color: var(--ec-ink-faint) !important;
}

.ec-auth-shell .ec-main {
    min-height: auto;
    background: transparent;
}

.ec-auth-shell .ec-main-container,
.ec-auth-container {
    min-height: auto;
}

.ec-auth-shell .ec-toasts {
    left: var(--ec-gutter);
    top: 20px;
    bottom: auto;
}

.ec-login-screen {
    display: grid;
    justify-items: center;
    gap: 28px;
    width: min(100% - 32px, 460px);
    margin: 0 auto;
    padding: clamp(32px, 9vh, 96px) 0 40px;
}

.ec-login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-self: start;
    color: var(--ec-accent-bright);
}

.ec-login-logo {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--ec-accent-bright);
    color: transparent;
    font-size: 0;
}

.ec-login-logo::before {
    content: "";
    width: 26px;
    height: 26px;
    background: #fff;
    -webkit-mask: url("../img/brand.svg") center / contain no-repeat;
    mask: url("../img/brand.svg") center / contain no-repeat;
}

.ec-login-brand h1 {
    margin: 0;
    color: var(--ec-accent-bright);
    font-size: 1.125rem;
    font-weight: 500;
    letter-spacing: .01em;
    text-transform: uppercase;
}

.ec-login-brand p {
    margin: 0;
    padding-left: 12px;
    border-left: 1px solid var(--ec-border);
    color: var(--ec-ink-muted);
    font-size: .875rem;
}

.ec-login-card {
    width: 100%;
    padding: clamp(28px, 5vw, 44px);
    border: 1px solid var(--ec-divider);
    border-radius: 24px;
    background: var(--ec-panel);
    box-shadow: 0 1px 2px rgba(11, 20, 26, .06);
}

.ec-login-card h2 {
    margin: 0 0 6px;
    font-size: 1.75rem;
    font-weight: 300;
    line-height: 1.2;
}

.ec-auth-intro {
    margin: 0 0 24px;
    color: var(--ec-ink-muted);
    font-size: .9375rem;
}

.ec-auth-input {
    position: relative;
}

.ec-auth-input .form-control {
    min-height: 48px;
    padding-left: 46px;
    border-radius: var(--ec-radius);
}

.ec-field-icon {
    position: absolute;
    top: 50%;
    left: 15px;
    z-index: 2;
    width: 20px;
    height: 20px;
    background-color: var(--ec-icon);
    -webkit-mask: var(--ec-i, url("../img/user.svg")) center / contain no-repeat;
    mask: var(--ec-i, url("../img/user.svg")) center / contain no-repeat;
    transform: translateY(-50%);
    pointer-events: none;
}

.ec-field-icon-mail { --ec-i: url("../img/mail.svg"); }
.ec-field-icon-lock { --ec-i: url("../img/lock.svg"); }

.ec-auth-input:focus-within .ec-field-icon {
    background-color: var(--ec-accent-bright);
}

.ec-login-card .form-label,
.ec-login-card label.form-label {
    font-size: .875rem;
}

.ec-auth-link {
    color: var(--ec-accent);
    font-size: .875rem;
    font-weight: 500;
    text-decoration: none;
}

.ec-auth-link:hover {
    text-decoration: underline;
}

.ec-auth-check .form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 0;
}

.ec-auth-check .form-check-input {
    width: 18px;
    height: 18px;
    margin: 0;
    border-radius: 4px;
}

.ec-auth-check .form-check-label,
.ec-auth-check label {
    color: var(--ec-ink-muted);
    font-size: .875rem;
    font-weight: 400;
}

.ec-auth-submit {
    min-height: 46px;
    font-size: .9375rem;
}

.ec-secure-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 24px 0 0;
    color: var(--ec-ink-faint);
    font-size: .8125rem;
    text-align: center;
}

.ec-secure-note::before {
    content: "";
    width: 13px;
    height: 13px;
    background-color: currentColor;
    -webkit-mask: url("../img/lock.svg") center / contain no-repeat;
    mask: url("../img/lock.svg") center / contain no-repeat;
}

.ec-login-card .ec-quota-note {
    text-align: center;
}

/* ==========================================================================
   Petits écrans : le volet passe en tête, la navigation défile en ligne.
   ========================================================================== */

@media (max-width: 1100px) {
    :root {
        --ec-sidebar-w: 300px;
    }

    .ec-form-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .ec-stat-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .ec-app-shell,
    .ec-admin-shell {
        display: block;
    }

    .ec-chrome,
    .ec-figma-chrome {
        position: static;
        height: auto;
    }

    .ec-sidebar,
    .ec-figma-sidebar {
        height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--ec-divider);
    }

    .ec-sidebar-search,
    .ec-sidebar-foot,
    .ec-nav-sub {
        display: none;
    }

    .ec-nav,
    .ec-figma-nav {
        display: flex;
        gap: 4px;
        overflow-x: auto;
        padding: 6px 8px 8px;
        scroll-snap-type: x proximity;
    }

    .ec-nav-link,
    .ec-figma-nav-link {
        grid-template-columns: 1fr;
        justify-items: center;
        row-gap: 4px;
        min-width: 84px;
        min-height: 0;
        padding: 6px 8px;
        border-radius: var(--ec-radius);
        scroll-snap-align: start;
    }

    .ec-nav-icon,
    .ec-figma-nav-icon {
        width: 40px;
        height: 40px;
    }

    .ec-nav-text {
        padding: 0;
        border: 0 !important;
        text-align: center;
    }

    .ec-nav-title {
        font-size: .75rem;
        white-space: normal;
    }

    .ec-page-header,
    .ec-figma-page-header {
        position: static;
    }

    .ec-main {
        min-height: auto;
        background-attachment: scroll;
    }

    .ec-toasts {
        left: 16px;
        right: 16px;
    }

    .ec-two-cols {
        grid-template-columns: minmax(0, 1fr);
    }

    .ec-table > :not(caption) > * > * {
        white-space: nowrap;
    }
}

@media (max-width: 520px) {
    .ec-stat-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .ec-page-header .ec-actions,
    .ec-page-header > a,
    .ec-page-header > form {
        width: 100%;
    }

    .ec-page-header .ec-actions > * {
        flex: 1 1 auto;
    }

    form.ec-filter-bar {
        flex-wrap: wrap;
    }
}

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