/* ==========================================================================
   Deployment Manager — components.css
   Cartes, boutons, badges, listes, onglets, filtres, dropdowns, drawer,
   formulaires, assistant, identifiants, états (vide / chargement / erreur).
   ========================================================================== */

/* ===== ICÔNES ===== */
.icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
}

.icon--sm { width: 14px; height: 14px; }
.icon--lg { width: 24px; height: 24px; }
.icon--spin { animation: spin 900ms linear infinite; }

/* ===== BOUTONS (par intention) ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    border: 1px solid transparent;
    border-radius: var(--radius);
    transition: background var(--transition), border-color var(--transition), box-shadow var(--transition), color var(--transition);
}

.btn .icon {
    width: 16px;
    height: 16px;
}

.btn:disabled,
.btn[aria-disabled='true'] {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn--primary {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #FFFFFF;
}

.btn--primary:hover:not(:disabled) {
    background: #292524;
    box-shadow: 0 2px 8px rgba(var(--color-primary-rgb), 0.25);
}

.btn--outline {
    background: var(--color-surface);
    border-color: var(--color-border-strong);
    color: var(--color-text);
}

.btn--outline:hover:not(:disabled) {
    background: var(--color-divider);
    border-color: var(--color-text-muted);
}

.btn--danger {
    background: transparent;
    border-color: #EF4444;
    color: #B91C1C;
}

.btn--danger:hover:not(:disabled) {
    background: #FEF2F2;
}

.btn--danger-solid,
.btn[data-state='confirming'] {
    background: #DC2626;
    border-color: #DC2626;
    color: #FFFFFF;
}

.btn--ghost {
    background: transparent;
    color: var(--color-text);
    padding-left: 10px;
    padding-right: 10px;
}

.btn--ghost:hover:not(:disabled) {
    background: var(--color-divider);
}

.btn--sm {
    min-height: 32px;
    padding: 5px 12px;
    font-size: 13px;
}

.btn--block {
    width: 100%;
}

.btn.is-loading {
    pointer-events: none;
}

.link-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    color: var(--color-accent-text);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.link-btn:hover {
    color: var(--color-primary);
}

/* ===== CARTES ===== */
.card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 24px;
    min-width: 0;
}

.card--flush {
    padding: 0;
}

.card--link {
    display: block;
    transition: box-shadow var(--transition), transform var(--transition);
}

.card--link:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-1px);
}

.card__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--color-divider);
}

.card__title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    min-width: 0;
}

.card__title .icon {
    color: var(--color-text-muted);
}

.card__sub {
    margin-top: 2px;
    font-size: 13px;
    color: var(--color-text-muted);
}

.card__pad {
    padding: 24px;
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.stack--lg { gap: 24px; }
.stack--sm { gap: 8px; }

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

.section-gap {
    margin-bottom: 28px;
}

/* ===== MISE EN PAGE À DEUX COLONNES ===== */
.layout-aside {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 24px;
    align-items: start;
}

.layout-aside__side {
    position: sticky;
    top: calc(var(--topbar-height) + 20px);
}

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

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

/* ===== KPI ===== */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.kpi {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 18px 20px;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    min-width: 0;
}

.kpi__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.kpi__label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.kpi__icon {
    width: 18px;
    height: 18px;
    color: var(--color-text-muted);
}

.kpi__value {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.kpi__note {
    font-size: 12px;
    color: var(--color-text-muted);
}

.kpi--alert {
    border-left: 4px solid var(--color-warning);
}

.kpi--alert .kpi__note {
    color: #92400E;
    font-weight: 600;
}

.kpi--danger {
    border-left: 4px solid var(--color-negative);
}

.kpi--danger .kpi__note {
    color: #991B1B;
    font-weight: 600;
}

.kpi--click {
    cursor: pointer;
    transition: box-shadow var(--transition), transform var(--transition);
}

.kpi--click:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-1px);
}

/* ===== BARRES / JAUGES ===== */
.meter {
    height: 8px;
    border-radius: var(--radius-pill);
    background: var(--color-divider);
    box-shadow: inset 0 0 0 1px var(--color-border);
    overflow: hidden;
}

.meter__fill {
    display: block;
    height: 100%;
    border-radius: var(--radius-pill);
    background: var(--color-accent-strong);
    transition: width 250ms ease;
}

.meter__fill--warn { background: #D97706; }
.meter__fill--danger { background: var(--color-negative); }
.meter__fill--ink { background: var(--color-primary); }

.meter-row {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr) 56px;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}

.meter-row__val {
    text-align: right;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
}

.badge .icon {
    width: 12px;
    height: 12px;
}

.badge--success { background: #D1FAE5; color: #065F46; }
.badge--danger  { background: #FEE2E2; color: #991B1B; }
.badge--warning { background: #FEF3C7; color: #92400E; }
.badge--info    { background: #DBEAFE; color: #1E40AF; }
.badge--neutral { background: #F3F4F6; color: #4B5563; }
.badge--ink     { background: var(--color-primary); color: #FFFFFF; }
.badge--accent  { background: var(--color-accent-soft); color: var(--color-accent-text); }

.badge--shared {
    background: #FFFFFF;
    color: var(--color-text-soft);
    border: 1px dashed var(--color-border-strong);
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
    background: var(--color-text-muted);
}

.dot--ok { background: var(--color-positive); }
.dot--warn { background: var(--color-warning); }
.dot--err { background: var(--color-negative); }
.dot--run { background: var(--color-info); }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text-soft);
    background: var(--color-divider);
    border-radius: var(--radius-pill);
    white-space: nowrap;
}

.chip--mono {
    font-family: var(--font-mono);
    font-size: 11.5px;
}

.stack-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    white-space: nowrap;
}

.stack-tag__mark {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #FFFFFF;
}

.stack-tag__mark--wp { background: #21759B; }
.stack-tag__mark--laravel { background: #B91C1C; }
.stack-tag__mark--php { background: #4F5B93; }

/* ===== AVATARS ===== */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
    background: var(--color-divider);
    color: var(--color-text-soft);
    box-shadow: inset 0 0 0 1px var(--color-border);
}

.avatar--sm {
    width: 28px;
    height: 28px;
    font-size: 11px;
}

.avatar--ink {
    background: var(--color-primary);
    color: #FFFFFF;
    box-shadow: none;
}

.avatar--square {
    border-radius: 8px;
}

/* ===== LISTES (Grid / Flex, jamais de <table>) ===== */
.list {
    display: flex;
    flex-direction: column;
}

.lhead,
.lrow {
    display: grid;
    align-items: center;
    column-gap: 16px;
    padding: 14px 24px;
    min-width: 0;
}

.lhead {
    padding-top: 12px;
    padding-bottom: 12px;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.lrow {
    position: relative;
    border-bottom: 1px solid var(--color-divider);
    transition: background var(--transition);
}

.lrow:last-child {
    border-bottom: 0;
}

.lrow:hover {
    background: #FAFAF9;
}

.lcell {
    min-width: 0;
}

.lcell__title {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lcell__title a:hover {
    text-decoration: underline;
}

.lcell__sub {
    font-size: 12px;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lcell__main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.lcell__label {
    display: none;
}

.lcell--right {
    text-align: right;
    justify-self: end;
}

.lcell--actions {
    justify-self: end;
}

/* Variantes de grille de listes */
.lrow--sites, .lhead--sites { grid-template-columns: minmax(0, 2.1fr) minmax(0, 1.3fr) minmax(0, 1.2fr) minmax(0, 1.75fr) minmax(0, 1.75fr) minmax(0, 1.3fr) 36px; }
.lrow--clients, .lhead--clients { grid-template-columns: minmax(0, 2fr) minmax(0, 1.7fr) minmax(0, 1.2fr) minmax(0, 1.7fr) 110px 36px; }
.lrow--repos, .lhead--repos { grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.1fr) minmax(0, 1.4fr) minmax(0, 1.6fr) minmax(0, 1.3fr) 36px; }
.lrow--deploys, .lhead--deploys { grid-template-columns: minmax(0, 2.4fr) minmax(0, 1.2fr) minmax(0, 1.6fr) 100px minmax(0, 1.3fr) 36px; }
.lrow--zones, .lhead--zones { grid-template-columns: minmax(0, 2fr) minmax(0, 1.5fr) minmax(0, 1.3fr) minmax(0, 1.3fr) minmax(0, 1fr) 36px; }
.lrow--backups, .lhead--backups { grid-template-columns: minmax(0, 2fr) minmax(0, 1.7fr) 110px minmax(0, 1.5fr) minmax(0, 1.1fr) 36px; }
.lrow--bkitems, .lhead--bkitems { grid-template-columns: minmax(0, 1.8fr) minmax(0, 1.1fr) 90px minmax(0, 1.3fr) minmax(0, 1fr) 36px; }
.lrow--conns, .lhead--conns { grid-template-columns: minmax(0, 2fr) minmax(0, 1.6fr) minmax(0, 1.3fr) 90px minmax(0, 1.2fr) 36px; }

.row-link {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.row-link:focus-visible {
    outline-offset: -2px;
}

.lrow .lcell--actions,
.lrow .lcell a:not(.row-link),
.lrow .lcell button {
    position: relative;
    z-index: 2;
}

/* ===== ONGLETS ===== */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 20px;
    padding: 4px;
    background: var(--color-divider);
    border-radius: var(--radius-lg);
    width: fit-content;
    max-width: 100%;
}

.tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 6px 14px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--color-text-muted);
    border-radius: 8px;
    white-space: nowrap;
    transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}

.tab:hover {
    color: var(--color-text);
}

.tab .icon {
    width: 16px;
    height: 16px;
}

.tab[aria-selected='true'] {
    color: var(--color-text);
    background: var(--color-surface);
    box-shadow: var(--shadow-card);
}

.tab__count {
    min-width: 20px;
    padding: 1px 6px;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    border-radius: var(--radius-pill);
    background: rgba(var(--color-primary-rgb), 0.08);
    font-variant-numeric: tabular-nums;
}

.tab[aria-selected='true'] .tab__count {
    background: var(--color-primary);
    color: #FFFFFF;
}

.tab__count--alert {
    background: #FEF3C7;
    color: #92400E;
}

.tabpanel[hidden] {
    display: none;
}

/* Onglets soulignés (fiche détaillée) */
.utabs {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 20px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--color-border);
}

.utab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 2px 12px;
    margin-bottom: -1px;
    font-weight: 500;
    color: var(--color-text-muted);
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}

.utab:hover {
    color: var(--color-text);
}

.utab .icon {
    width: 16px;
    height: 16px;
}

.utab[aria-selected='true'] {
    color: var(--color-text);
    border-bottom-color: var(--color-primary);
    font-weight: 600;
}

/* ===== BARRE DE RECHERCHE + FILTRES ===== */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--color-divider);
}

.search {
    position: relative;
    flex: 1 1 260px;
    min-width: 0;
}

.search .icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--color-text-muted);
    pointer-events: none;
}

.search .input {
    padding-left: 36px;
}

.filters-reset {
    font-size: 13px;
}

/* ===== FORMULAIRES ===== */
.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.field__label {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-soft);
}

.field__label .req {
    color: var(--color-negative);
    margin-left: 2px;
}

.field__hint {
    font-size: 12px;
    color: var(--color-text-muted);
}

.field__error {
    display: none;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #B91C1C;
}

.field.is-invalid .field__error {
    display: flex;
}

.field.is-invalid .input {
    border-color: #DC2626;
}

.field.is-valid .input {
    border-color: var(--color-positive);
}

.input,
.textarea {
    width: 100%;
    min-height: 40px;
    padding: 9px 12px;
    font-size: 14px;
    color: var(--color-text);
    background: var(--color-surface);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.input::placeholder,
.textarea::placeholder {
    color: #5B6472;
}

.input:hover,
.textarea:hover {
    border-color: var(--color-text-muted);
}

.input:focus,
.textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.14);
}

.input[readonly],
.input:disabled {
    background: var(--color-bg);
    color: var(--color-text-soft);
}

.input--mono {
    font-family: var(--font-mono);
    font-size: 13px;
}

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

.input-group {
    display: flex;
    min-width: 0;
}

.input-group .input {
    border-radius: var(--radius) 0 0 var(--radius);
    border-right: 0;
}

.input-group .btn {
    border-radius: 0 var(--radius) var(--radius) 0;
}

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

.form-grid .span-2 {
    grid-column: 1 / -1;
}

/* Case / radio natifs, stylés */
.check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    min-height: 24px;
}

.check input {
    appearance: none;
    -webkit-appearance: none;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    border: 1.5px solid var(--color-border-strong);
    border-radius: 4px;
    background: var(--color-surface);
    display: grid;
    place-content: center;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition);
}

.check input[type='radio'] {
    border-radius: 50%;
}

.check input:checked {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

.check input:checked::after {
    content: '';
    width: 9px;
    height: 5px;
    border-left: 2px solid #FFFFFF;
    border-bottom: 2px solid #FFFFFF;
    transform: rotate(-45deg) translate(1px, -1px);
}

.check input[type='radio']:checked::after {
    width: 7px;
    height: 7px;
    border: 0;
    border-radius: 50%;
    background: #FFFFFF;
    transform: none;
}

.check input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.check input:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.check__text b {
    display: block;
    font-weight: 500;
}

.check__text span {
    display: block;
    font-size: 12px;
    color: var(--color-text-muted);
}

/* Interrupteur */
.switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.switch input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.switch__track {
    position: relative;
    width: 38px;
    height: 22px;
    flex-shrink: 0;
    border-radius: var(--radius-pill);
    background: var(--color-border-strong);
    transition: background var(--transition);
}

.switch__track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #FFFFFF;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    transition: transform var(--transition);
}

.switch input:checked + .switch__track {
    background: var(--color-primary);
}

.switch input:checked + .switch__track::after {
    transform: translateX(16px);
}

.switch input:focus-visible + .switch__track {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.switch input:disabled + .switch__track {
    opacity: 0.55;
    cursor: not-allowed;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--color-divider);
}

.setting-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.setting-row:first-child {
    padding-top: 0;
}

.setting-row__text {
    min-width: 0;
}

.setting-row__text b {
    display: block;
    font-weight: 600;
}

.setting-row__text span {
    display: block;
    font-size: 13px;
    color: var(--color-text-muted);
}

.setting-row__control {
    flex-shrink: 0;
}

/* ===== DROPDOWN PERSONNALISÉ (jamais de <select>) ===== */
.dd {
    position: relative;
    min-width: 0;
}

.dd__trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-height: 40px;
    padding: 8px 12px;
    text-align: left;
    background: var(--color-surface);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.dd__trigger:hover {
    border-color: var(--color-text-muted);
}

.dd__trigger[aria-expanded='true'] {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.14);
}

.dd__value {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dd__prefix {
    color: var(--color-text-muted);
    margin-right: 6px;
}

.dd__chev {
    width: 16px;
    height: 16px;
    color: var(--color-text-muted);
    transition: transform var(--transition);
}

.dd__trigger[aria-expanded='true'] .dd__chev {
    transform: rotate(180deg);
}

.dd--filter .dd__trigger {
    min-height: 40px;
}

.dd--filter.is-set .dd__trigger {
    border-color: var(--color-primary);
    background: var(--color-bg);
}

.dd__menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 100%;
    width: max-content;
    max-width: min(360px, 90vw);
    max-height: 288px;
    overflow-y: auto;
    padding: 4px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-menu);
    z-index: 300;
    animation: fadeIn var(--transition);
}

.dd.is-up .dd__menu {
    top: auto;
    bottom: calc(100% + 4px);
}

.dd.is-right .dd__menu {
    left: auto;
    right: 0;
}

.dd__opt {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 10px;
    text-align: left;
    border-radius: var(--radius);
    cursor: pointer;
}

.dd__opt:hover,
.dd__opt.is-focus {
    background: var(--color-divider);
}

.dd__opt[aria-selected='true'] {
    font-weight: 600;
}

.dd__opt-body {
    flex: 1;
    min-width: 0;
}

.dd__opt-sub {
    display: block;
    font-size: 12px;
    font-weight: 400;
    color: var(--color-text-muted);
}

.dd__check {
    width: 16px;
    height: 16px;
    visibility: hidden;
}

.dd__opt[aria-selected='true'] .dd__check {
    visibility: visible;
}

.dd__sep {
    height: 1px;
    margin: 4px 0;
    background: var(--color-divider);
}

.dd__opt--disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== MENU CONTEXTUEL (⠇) ===== */
.ctx {
    position: relative;
}

.ctx__trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    color: var(--color-text-muted);
    transition: background var(--transition), color var(--transition);
}

.ctx__trigger:hover,
.ctx__trigger[aria-expanded='true'] {
    background: var(--color-divider);
    color: var(--color-text);
}

.ctx__menu {
    position: absolute;
    top: calc(100% + 2px);
    right: 0;
    min-width: 220px;
    padding: 4px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-menu);
    z-index: 300;
    animation: fadeIn var(--transition);
}

.ctx.is-up .ctx__menu {
    top: auto;
    bottom: calc(100% + 2px);
}

.ctx__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 10px;
    font-size: 14px;
    text-align: left;
    border-radius: var(--radius);
    cursor: pointer;
}

.ctx__item .icon {
    width: 16px;
    height: 16px;
    color: var(--color-text-muted);
}

.ctx__item:hover {
    background: var(--color-divider);
}

.ctx__item--danger {
    color: #B91C1C;
}

.ctx__item--danger .icon {
    color: #B91C1C;
}

.ctx__item[data-state='confirming'] {
    background: #DC2626;
    color: #FFFFFF;
}

.ctx__item[data-state='confirming'] .icon {
    color: #FFFFFF;
}

.ctx__sep {
    height: 1px;
    margin: 4px 0;
    background: var(--color-divider);
}

/* ===== ALERTES ===== */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius);
    border-left: 4px solid;
    animation: fadeIn var(--transition);
}

.alert > .icon {
    margin-top: 1px;
}

.alert__body {
    flex: 1;
    min-width: 0;
}

.alert__title {
    font-weight: 600;
}

.alert__text {
    font-size: 13px;
}

.alert__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.alert--success { background: #F0FDF4; border-color: #16A34A; color: #166534; }
.alert--danger  { background: #FFF5F5; border-color: #EF4444; color: #991B1B; }
.alert--warning { background: #FFFBEB; border-color: #F59E0B; color: #92400E; }
.alert--info    { background: #EFF6FF; border-color: #3B82F6; color: #1E40AF; }
.alert--neutral { background: #FAFAF9; border-color: #A8A29E; color: #44403C; }

/* ===== ÉTATS : VIDE / CHARGEMENT / ERREUR ===== */
.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 56px 24px;
    text-align: center;
}

.empty__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--color-divider);
    color: var(--color-text-muted);
}

.empty__icon .icon {
    width: 24px;
    height: 24px;
}

.empty__title {
    font-size: 16px;
    font-weight: 600;
}

.empty__text {
    max-width: 46ch;
    color: var(--color-text-muted);
}

.skeleton {
    display: block;
    height: 14px;
    border-radius: 4px;
    background: var(--color-divider);
}

.skeleton--lg {
    height: 36px;
}

.skeleton-row {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 120px;
    align-items: center;
    gap: 16px;
    padding: 18px 24px;
    border-bottom: 1px solid var(--color-divider);
}

.skeleton-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-divider);
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(var(--color-primary-rgb), 0.18);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 700ms linear infinite;
    display: inline-block;
    flex-shrink: 0;
}

.btn--primary .spinner {
    border-color: rgba(255, 255, 255, 0.35);
    border-top-color: #FFFFFF;
}

/* ===== PAGINATION ===== */
.paginator {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--color-divider);
}

.paginator__info {
    font-size: 13px;
    color: var(--color-text-muted);
}

.paginator__pages {
    display: flex;
    gap: 4px;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius);
    color: var(--color-text-soft);
    transition: background var(--transition);
}

.page-btn:hover:not(:disabled) {
    background: var(--color-divider);
}

.page-btn[aria-current='page'] {
    background: var(--color-primary);
    color: #FFFFFF;
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ===== DRAWER (offcanvas droit) ===== */
.drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: 900;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: opacity 150ms ease, visibility 150ms ease;
}

.drawer-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.drawer {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    width: 460px;
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: var(--color-surface);
    box-shadow: var(--shadow-drawer);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 200ms ease, visibility 200ms ease;
}

.drawer--wide {
    width: 600px;
}

.drawer.is-open {
    transform: translateX(0);
    visibility: visible;
}

.drawer__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}

.drawer__title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.drawer__sub {
    margin-top: 2px;
    font-size: 13px;
    color: var(--color-text-muted);
}

.drawer__back {
    display: none;
}

.drawer__body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 24px;
}

.drawer__footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--color-border);
    background: var(--color-surface);
    flex-shrink: 0;
}

.drawer__footer:empty {
    display: none;
}

.drawer__footer .btn {
    flex: 0 1 auto;
}

/* ===== TOASTS ===== */
.toast-stack {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 380px;
    padding: 12px 16px;
    font-weight: 500;
    color: #FFFFFF;
    background: var(--color-primary);
    border-radius: var(--radius);
    box-shadow: var(--shadow-menu);
    animation: fadeIn var(--transition);
    pointer-events: auto;
}

.toast .icon {
    color: var(--color-accent);
}

.toast--error .icon {
    color: #FCA5A5;
}

/* ===== LISTE CLÉ / VALEUR ===== */
.kv {
    display: flex;
    flex-direction: column;
}

.kv__row {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    padding: 11px 0;
    border-bottom: 1px solid var(--color-divider);
    min-height: 44px;
}

.kv__row:last-child {
    border-bottom: 0;
}

.kv__key {
    font-size: 13px;
    color: var(--color-text-muted);
}

.kv__val {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
    word-break: break-word;
}

.kv__val--end {
    justify-content: flex-start;
}

/* Valeur secrète masquée / copiable */
.secret {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
}

.secret__value {
    padding: 4px 8px;
    font-family: var(--font-mono);
    font-size: 12.5px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    word-break: break-all;
}

.secret__value.is-revealed {
    background: #FFFBEB;
    border-color: #FCD34D;
}

.mini-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 3px 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text-soft);
    border-radius: 4px;
}

.mini-btn:hover {
    background: var(--color-divider);
    color: var(--color-text);
}

.mini-btn .icon {
    width: 14px;
    height: 14px;
}

/* ===== BLOC DE CODE / COMMANDES ===== */
.code {
    padding: 14px 16px;
    font-family: var(--font-mono);
    font-size: 12.5px;
    line-height: 1.7;
    color: #E7E5E4;
    background: var(--color-primary);
    border-radius: var(--radius);
    white-space: pre-wrap;
    word-break: break-all;
}

.code .c-muted { color: #A8A29E; }
.code .c-ok { color: var(--color-accent); }
.code .c-err { color: #FCA5A5; }
.code .c-warn { color: #FCD34D; }

.cmd-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cmd {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.cmd code {
    flex: 1;
    min-width: 0;
    font-family: var(--font-mono);
    font-size: 12.5px;
    word-break: break-all;
}

.cmd--danger {
    background: #FEF2F2;
    border-color: #FCA5A5;
}

.cmd__n {
    width: 20px;
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-muted);
}

/* ===== OPÉRATIONS / PROGRESSION ===== */
.ops {
    display: flex;
    flex-direction: column;
}

.op {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: start;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--color-divider);
}

.op:last-child {
    border-bottom: 0;
}

.op__state {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--color-divider);
    color: var(--color-text-muted);
    box-shadow: inset 0 0 0 1.5px var(--color-border-strong);
}

.op__state .icon {
    width: 14px;
    height: 14px;
}

.op--success .op__state { background: #D1FAE5; color: #065F46; box-shadow: none; }
.op--failed .op__state { background: #FEE2E2; color: #991B1B; box-shadow: none; }
.op--action .op__state { background: #FEF3C7; color: #92400E; box-shadow: none; }
.op--running .op__state { background: #DBEAFE; color: #1E40AF; box-shadow: none; }

.op__title {
    font-weight: 600;
}

.op__detail {
    margin-top: 2px;
    font-size: 13px;
    color: var(--color-text-muted);
}

.op__extra {
    margin-top: 10px;
}

.op--pending .op__title {
    color: var(--color-text-muted);
}

/* ===== TIMELINE / HISTORIQUE ===== */
.timeline {
    display: flex;
    flex-direction: column;
}

.tl-item {
    position: relative;
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    gap: 12px;
    padding: 12px 0;
}

.tl-item:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 13px;
    top: 40px;
    bottom: -4px;
    width: 1px;
    background: var(--color-border);
}

.tl-item__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--color-divider);
    color: var(--color-text-soft);
    box-shadow: inset 0 0 0 1px var(--color-border);
}

.tl-item__icon .icon {
    width: 14px;
    height: 14px;
}

.tl-item__title {
    font-weight: 500;
}

.tl-item__meta {
    font-size: 12px;
    color: var(--color-text-muted);
}

.tl-item__time {
    font-size: 12px;
    color: var(--color-text-muted);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* ===== DIVULGATION PROGRESSIVE ===== */
.disclosure {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
}

.disclosure > summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    border-radius: var(--radius-lg);
}

.disclosure > summary::-webkit-details-marker {
    display: none;
}

.disclosure > summary:hover {
    background: var(--color-bg);
}

.disclosure > summary .chev {
    margin-left: auto;
    transition: transform var(--transition);
    color: var(--color-text-muted);
}

.disclosure[open] > summary .chev {
    transform: rotate(180deg);
}

.disclosure__body {
    padding: 4px 18px 18px;
}

/* ===== CARTES DE CHOIX (radio visuels) ===== */
.choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}

.choice {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px;
    text-align: left;
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.choice:hover {
    border-color: var(--color-text-muted);
}

.choice[aria-checked='true'] {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 1px var(--color-primary);
    background: #FFFFFF;
}

.choice[aria-disabled='true'] {
    opacity: 0.5;
    cursor: not-allowed;
}

.choice__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-right: 28px;
}

.choice__mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--color-divider);
    color: var(--color-text-soft);
}

.choice[aria-checked='true'] .choice__mark {
    background: var(--color-primary);
    color: var(--color-accent);
}

.choice__title {
    font-weight: 600;
    font-size: 15px;
}

.choice__text {
    font-size: 13px;
    color: var(--color-text-muted);
}

.choice__radio {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1.5px solid var(--color-border-strong);
    background: #FFFFFF;
}

.choice[aria-checked='true'] .choice__radio {
    border-color: var(--color-primary);
    box-shadow: inset 0 0 0 4px #FFFFFF;
    background: var(--color-primary);
}

.choice__list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 10px;
    margin-top: 2px;
    border-top: 1px solid var(--color-divider);
    font-size: 12.5px;
    color: var(--color-text-soft);
}

.choice__list li {
    display: flex;
    align-items: center;
    gap: 8px;
}

.choice__list .icon {
    width: 14px;
    height: 14px;
    color: var(--color-accent-strong);
}

/* ===== ASSISTANT : STEPPER ===== */
.wizard {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr) 320px;
    gap: 28px;
    align-items: start;
}

.stepper {
    position: sticky;
    top: calc(var(--topbar-height) + 20px);
    display: flex;
    flex-direction: column;
}

.step {
    position: relative;
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 12px;
    padding: 8px 0 20px;
    text-align: left;
    width: 100%;
}

.step:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 13px;
    top: 36px;
    bottom: 0;
    width: 2px;
    background: var(--color-border);
}

.step.is-done:not(:last-child)::before {
    background: var(--color-primary);
}

.step__node {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    background: var(--color-surface);
    color: var(--color-text-muted);
    box-shadow: inset 0 0 0 2px var(--color-border-strong);
    position: relative;
    z-index: 1;
}

.step.is-done .step__node {
    background: var(--color-primary);
    color: var(--color-accent);
    box-shadow: none;
}

.step.is-current .step__node {
    background: var(--color-primary);
    color: #FFFFFF;
    box-shadow: 0 0 0 4px var(--color-accent);
}

.step__node .icon {
    width: 14px;
    height: 14px;
}

.step__label {
    font-weight: 600;
    color: var(--color-text-muted);
    line-height: 28px;
}

.step.is-current .step__label,
.step.is-done .step__label {
    color: var(--color-text);
}

.step__sub {
    display: block;
    margin-top: -2px;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    color: var(--color-text-muted);
}

.step.is-locked {
    cursor: default;
}

.step.is-skipped .step__label {
    text-decoration: line-through;
    text-decoration-color: var(--color-border-strong);
}

.wizard__panel {
    min-width: 0;
}

.wizard__foot {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 24px;
}

.wizard__step-title {
    margin-bottom: 4px;
}

.wizard__step-sub {
    margin-bottom: 24px;
    color: var(--color-text-muted);
}

.recap-line {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--color-divider);
    font-size: 13px;
}

.recap-line:last-child {
    border-bottom: 0;
}

.recap-line__k {
    color: var(--color-text-muted);
    flex-shrink: 0;
}

.recap-line__v {
    font-weight: 600;
    text-align: right;
    min-width: 0;
    word-break: break-word;
}

.recap-line__v--pending {
    font-weight: 400;
    color: var(--color-text-muted);
}

/* Héritage (alias) */
.inherit {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--color-divider);
}

.inherit:last-child {
    border-bottom: 0;
}

.inherit__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--color-divider);
    color: var(--color-text-soft);
}

.inherit__title {
    font-weight: 600;
}

.inherit__sub {
    font-size: 12.5px;
    color: var(--color-text-muted);
}

/* Enregistrements DNS */
.dns-row {
    display: grid;
    grid-template-columns: 76px minmax(0, 1.1fr) minmax(0, 1.5fr) 120px 36px;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--color-divider);
}

.dns-row:last-child {
    border-bottom: 0;
}

.dns-row--head {
    padding-top: 0;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.dns-type {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 8px;
    font-family: var(--font-mono);
    font-size: 11.5px;
    font-weight: 600;
    background: var(--color-divider);
    border-radius: 4px;
    width: fit-content;
}

.proxy {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
}

/* Vérifications (checklist) */
.checks {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.check-line {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    font-size: 13.5px;
}

.check-line .icon {
    margin-top: 2px;
}

.check-line--ok .icon { color: var(--color-positive); }
.check-line--warn .icon { color: #D97706; }
.check-line--err .icon { color: var(--color-negative); }
.check-line--idle .icon { color: var(--color-text-muted); }

.check-line small {
    display: block;
    font-size: 12px;
    color: var(--color-text-muted);
}

/* Résultat de recherche */
.result-list {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.result {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--color-divider);
    background: var(--color-surface);
    transition: background var(--transition);
}

.result:last-child {
    border-bottom: 0;
}

.result:hover {
    background: var(--color-bg);
}

.result[aria-checked='true'] {
    background: var(--color-accent-soft);
    box-shadow: inset 3px 0 0 var(--color-accent-strong);
}

.result[aria-disabled='true'] {
    opacity: 0.55;
    cursor: not-allowed;
}

.result__body {
    flex: 1;
    min-width: 0;
}

/* Barre d'état de page (bandeau partagé) */
.shared-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 24px;
    border: 1px dashed var(--color-border-strong);
    border-radius: var(--radius-lg);
    background: #FFFFFF;
}

.shared-banner .icon {
    color: var(--color-text-muted);
}

/* ===== CARTES SERVEUR / ZONE ===== */
.svc-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 24px;
}

.svc {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--color-divider);
}

.svc__name {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

/* ===== ACCORDÉON LOG ===== */
.log-line {
    display: grid;
    grid-template-columns: 70px 56px minmax(0, 1fr);
    gap: 12px;
}

/* ===== BOTTOM NAV / SHEET (mobile) ===== */
.bottom-nav {
    display: none;
}

.sheet-overlay {
    position: fixed;
    inset: 0;
    z-index: 950;
    background: rgba(0, 0, 0, 0.4);
}

.sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 960;
    padding: 12px 16px calc(var(--bottomnav-height) + 16px + env(safe-area-inset-bottom));
    background: var(--color-surface);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.12);
    animation: sheetIn 200ms ease;
}

.sheet__grab {
    width: 36px;
    height: 4px;
    margin: 0 auto 12px;
    border-radius: 2px;
    background: var(--color-border-strong);
}

.sheet a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 8px;
    min-height: 56px;
    border-radius: var(--radius);
}

.sheet a:hover,
.sheet a.is-active {
    background: var(--color-divider);
}

.sheet a b {
    display: block;
}

.sheet a span {
    display: block;
    font-size: 12px;
    color: var(--color-text-muted);
}

@keyframes sheetIn {
    from { transform: translateY(24px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

/* ===== LIGNE COMPACTE (widgets) : avatar + texte + fin de ligne ===== */
.mrow {
    position: relative;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--color-divider);
}

.mrow:last-child {
    border-bottom: 0;
}

.mrow--pad {
    padding: 14px 24px;
}

.mrow__end {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.mrow--pad:hover {
    background: #FAFAF9;
}

.op--cta {
    grid-template-columns: 28px minmax(0, 1fr) auto;
}

.lcell--badges {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

/* ===== SECTIONS DE PANNEAU DE STACK ===== */
.psec {
    padding: 20px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
}

.psec--warn {
    background: #FFFBEB;
    border-color: #FCD34D;
}

.psec__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.psec__title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
}

.psec__title .icon {
    color: var(--color-text-muted);
}

.psec__sub {
    margin: -6px 0 14px;
    font-size: 13px;
    color: var(--color-text-muted);
}

.env-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 38px;
    gap: 8px;
    align-items: center;
}

.hero-choice {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

@media (max-width: 767px) {
    .hero-choice {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ===== BARRE DE PHASES (connexion GitHub) ===== */
.phasebar {
    margin-bottom: 20px;
}

.phasebar__label {
    margin-bottom: 8px;
    font-size: 12px;
    color: var(--color-text-muted);
}

.phasebar__label b {
    color: var(--color-text);
}

.phasebar__bars {
    display: flex;
    gap: 4px;
}

.phasebar__bars span {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: var(--color-border);
}

.phasebar__bars .is-done {
    background: var(--color-primary);
}

.phasebar__bars .is-current {
    background: var(--color-accent-strong);
}

/* ===== ASSISTANT : PAIRE DE DOMAINES (alias) ===== */
.alias-pair {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 14px;
}

.alias-pair__box {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    min-width: 0;
    word-break: break-all;
}

.alias-pair__box--new {
    background: var(--color-accent-soft);
    border-color: var(--color-accent-strong);
}

.alias-pair__arrow {
    color: var(--color-text-muted);
}

.aside-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.aside-list li {
    display: flex;
    gap: 10px;
    font-size: 13px;
    color: var(--color-text-soft);
}

.aside-list .icon {
    width: 14px;
    height: 14px;
    margin-top: 3px;
    color: var(--color-accent-strong);
}

.compare-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.compare-2 > div {
    padding: 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
}

@media (max-width: 767px) {
    .alias-pair {
        grid-template-columns: minmax(0, 1fr);
    }

    .alias-pair__arrow {
        transform: rotate(90deg);
        justify-self: center;
    }

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

.wizard--creating {
    grid-template-columns: minmax(0, 1fr) 320px;
}

.wizard--creating .stepper {
    display: none;
}

/* ===== NOTIFICATIONS (matrice événement × canal) ===== */
.notif-head,
.notif-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 90px 130px;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--color-divider);
}

.notif-head {
    padding-top: 0;
}

.notif-row:last-of-type {
    border-bottom: 0;
}

/* ===== DÉPLOIEMENT CONTINU EN DIRECT ===== */
.meter--lg {
    height: 10px;
}

.meter__fill--ok {
    background: var(--color-accent-strong);
}

.live-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    min-width: 0;
}

.live-card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 24px;
    border-bottom: 1px solid var(--color-divider);
}

.live-card__title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.live-card__overall {
    padding: 16px 24px 4px;
}

.live-card__meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 13px;
}

.live-card__sites {
    padding: 8px 24px 4px;
}

.live-card__foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    padding: 8px 24px 18px;
}

.live-card__foot:empty {
    display: none;
}

.live-site {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.2fr) auto;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--color-divider);
}

.live-site:last-child {
    border-bottom: 0;
}

.live-site__name {
    display: block;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-site__name:hover {
    text-decoration: underline;
}

.live-site__step {
    font-size: 12px;
    color: var(--color-text-muted);
}

.live-site__step.is-error {
    color: #991B1B;
    font-weight: 500;
}

.live-site__bar {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.live-site__bar .meter {
    flex: 1;
}

.live-site__pct {
    width: 42px;
    text-align: right;
    font-size: 12px;
    font-weight: 600;
}

.live-site__end {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

/* ===== FRISE DES SAUVEGARDES (14 jours) ===== */
.bk-strip {
    display: flex;
    gap: 3px;
    align-items: center;
}

.bk-dot {
    flex: 1 1 0;
    max-width: 14px;
    height: 22px;
    border-radius: 3px;
}

.bk-dot--ok { background: var(--color-accent-strong); }
.bk-dot--ko { background: var(--color-negative); }
.bk-dot--none { background: transparent; box-shadow: inset 0 0 0 1.5px var(--color-border-strong); }

.bk-strip--lg .bk-dot {
    max-width: 38px;
    height: 36px;
    border-radius: 5px;
}

.bk-legend .bk-dot {
    flex: none;
    width: 14px;
    height: 14px;
    border-radius: 3px;
}

/* ===== ÉTAPES D'IMPORT (PuTTY / WinSCP / OpenSSH) ===== */
.kit-steps {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-left: 20px;
    list-style: decimal;
    font-size: 13.5px;
}

.kit-steps li::marker {
    font-weight: 600;
    color: var(--color-text-muted);
}
