/*
 * Layout admin — sidebar fixe + topbar + content-wrapper.
 * Tout est scopé sous `.admin-shell` pour ne pas impacter le reste de l'app.
 */

:root {
    --admin-sidebar-w: 240px;
    --admin-sidebar-w-collapsed: 64px;
    --admin-topbar-h: 60px;
    --admin-bg: #f5f7fa;
    --admin-surface: #ffffff;
    --admin-border: #e4e7eb;
    --admin-text: #1f2933;
    --admin-text-muted: #6b7280;
    --admin-primary: #1e8e3e;
    --admin-primary-dark: #146b30;
    --admin-primary-soft: #e7f5ec;
    --admin-danger: #d93025;
    --admin-warning: #f59e0b;
    --admin-info: #2563eb;
    --admin-radius: 8px;
    --admin-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.04);
}

.admin-shell {
    display: flex;
    min-height: 100vh;
    background: var(--admin-bg);
    color: var(--admin-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

.admin-sidebar {
    width: var(--admin-sidebar-w);
    background: #0f172a;
    color: #e2e8f0;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    transition: width 0.18s ease;
    z-index: 30;
}

.admin-shell.is-collapsed .admin-sidebar {
    width: var(--admin-sidebar-w-collapsed);
}

.admin-sidebar__brand {
    height: var(--admin-topbar-h);
    display: flex;
    align-items: center;
    padding: 0 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: #fff;
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: 0.2px;
    white-space: nowrap;
    overflow: hidden;
}
.admin-sidebar__brand img { height: 28px; margin-right: 10px; }
.admin-shell.is-collapsed .admin-sidebar__brand span { display: none; }

.admin-sidebar__nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}

.admin-sidebar__section-title {
    padding: 14px 18px 6px 18px;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.8px;
    color: #64748b;
}
.admin-shell.is-collapsed .admin-sidebar__section-title { display: none; }

.admin-sidebar__group {
    padding: 0 8px;
}

.admin-sidebar__link,
.admin-sidebar__group-toggle {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    color: #cbd5e1;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.92rem;
    cursor: pointer;
    user-select: none;
}
.admin-sidebar__link i,
.admin-sidebar__group-toggle i {
    width: 22px;
    text-align: center;
    margin-right: 12px;
    font-size: 0.95rem;
    color: #94a3b8;
}
.admin-sidebar__link:hover,
.admin-sidebar__group-toggle:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    text-decoration: none;
}
.admin-sidebar__link.is-active {
    background: rgba(30, 142, 62, 0.18);
    color: #fff;
}
.admin-sidebar__link.is-active i { color: var(--admin-primary); }

.admin-shell.is-collapsed .admin-sidebar__link span,
.admin-shell.is-collapsed .admin-sidebar__group-toggle span,
.admin-shell.is-collapsed .admin-sidebar__group-toggle .caret { display: none; }

.admin-sidebar__group-toggle .caret {
    margin-left: auto;
    transition: transform 0.15s ease;
    font-size: 0.75rem;
}
.admin-sidebar__group.is-open .admin-sidebar__group-toggle .caret {
    transform: rotate(90deg);
}

.admin-sidebar__sublinks {
    margin-left: 22px;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    padding-left: 6px;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.18s ease;
}
.admin-sidebar__group.is-open .admin-sidebar__sublinks { max-height: 400px; }

.admin-sidebar__sublinks .admin-sidebar__link {
    padding: 7px 12px;
    font-size: 0.88rem;
}
.admin-shell.is-collapsed .admin-sidebar__sublinks { display: none; }

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

.admin-main {
    margin-left: var(--admin-sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: margin-left 0.18s ease;
}
.admin-shell.is-collapsed .admin-main { margin-left: var(--admin-sidebar-w-collapsed); }

.admin-topbar {
    height: var(--admin-topbar-h);
    min-height: var(--admin-topbar-h);
    background: var(--admin-surface);
    border-bottom: 1px solid var(--admin-border);
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 12px;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 20;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.admin-topbar__toggle {
    background: transparent;
    border: 0;
    font-size: 1.1rem;
    color: var(--admin-text-muted);
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 6px;
    flex: 0 0 auto;
}
.admin-topbar__toggle:hover { background: var(--admin-bg); color: var(--admin-text); }

.admin-topbar__breadcrumb {
    flex: 1 1 auto;
    min-width: 0;
    color: var(--admin-text-muted);
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.admin-topbar__breadcrumb strong { color: var(--admin-text); font-weight: 600; }

.admin-topbar__user {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
    margin-left: auto;
}
.admin-topbar__user .admin-btn { white-space: nowrap; }
.admin-topbar__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--admin-primary-soft);
    color: var(--admin-primary-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.88rem;
}
.admin-topbar__dropdown { position: relative; }
.admin-topbar__dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: #fff;
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius);
    box-shadow: var(--admin-shadow);
    min-width: 180px;
    padding: 6px;
    z-index: 50;
}
.admin-topbar__dropdown-menu a {
    display: block;
    padding: 8px 12px;
    color: var(--admin-text);
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
}
.admin-topbar__dropdown-menu a:hover { background: var(--admin-bg); }

/* --- Content wrapper ----------------------------------------------------- */

.admin-content {
    flex: 1;
    padding: 24px 28px 40px 28px;
    min-width: 0;
}

.admin-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}
.admin-page-header__title {
    margin: 0 0 4px 0;
    font-size: 1.45rem;
    font-weight: 600;
}
.admin-page-header__subtitle {
    color: var(--admin-text-muted);
    font-size: 0.9rem;
    margin: 0;
}
.admin-page-header__actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* --- Cards / Stats ------------------------------------------------------- */

.admin-card {
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius);
    box-shadow: var(--admin-shadow);
    padding: 20px;
    margin-bottom: 20px;
}
.admin-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.admin-card__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.admin-stats { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 22px; }
.admin-stat {
    flex: 1 1 180px;
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius);
    padding: 16px 18px;
    box-shadow: var(--admin-shadow);
}
.admin-stat__label { color: var(--admin-text-muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.6px; }
.admin-stat__value { font-size: 1.55rem; font-weight: 600; margin-top: 4px; }

/* --- Filters bar --------------------------------------------------------- */

.admin-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 18px;
}
.admin-filters .form-group { margin-bottom: 0; }
.admin-filters label {
    display: block;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--admin-text-muted);
    margin-bottom: 4px;
}
.admin-filters .form-control,
.admin-filters select {
    min-width: 150px;
    height: 36px;
    border-radius: 6px;
    border: 1px solid var(--admin-border);
    padding: 6px 10px;
    font-size: 0.9rem;
}

/* --- Table admin --------------------------------------------------------- */

.admin-table-wrapper {
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius);
    box-shadow: var(--admin-shadow);
    overflow: hidden;
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.admin-table th,
.admin-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--admin-border);
}
.admin-table th {
    background: #fafbfc;
    font-weight: 600;
    color: var(--admin-text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table tbody tr:hover { background: #f8fafc; }
.admin-table .text-right { text-align: right; }
.admin-table .actions a, .admin-table .actions button {
    margin-left: 4px;
}

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

.admin-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.2px;
}
.admin-badge--success { background: var(--admin-primary-soft); color: var(--admin-primary-dark); }
.admin-badge--danger { background: #fde7e9; color: #9b1c20; }
.admin-badge--warning { background: #fff3cd; color: #8a6d00; }
.admin-badge--info { background: #e0ecff; color: #1d4ed8; }
.admin-badge--muted { background: #eef2f6; color: #4b5563; }

/* --- Buttons ------------------------------------------------------------- */

.admin-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 6px;
    border: 1px solid transparent;
    padding: 7px 14px;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.12s ease, border-color 0.12s ease;
    background: #fff;
    color: var(--admin-text);
    border-color: var(--admin-border);
}
.admin-btn:hover { background: var(--admin-bg); text-decoration: none; color: var(--admin-text); }
.admin-btn--primary { background: var(--admin-primary); color: #fff; border-color: var(--admin-primary); }
.admin-btn--primary:hover { background: var(--admin-primary-dark); color: #fff; border-color: var(--admin-primary-dark); }
.admin-btn--danger { background: var(--admin-danger); color: #fff; border-color: var(--admin-danger); }
.admin-btn--danger:hover { background: #a92117; color: #fff; }
.admin-btn--ghost { background: transparent; border-color: transparent; color: var(--admin-text-muted); }
.admin-btn--ghost:hover { color: var(--admin-text); background: var(--admin-bg); }
.admin-btn--xs { padding: 4px 10px; font-size: 0.78rem; }

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

.admin-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-top: 1px solid var(--admin-border);
    background: #fafbfc;
    font-size: 0.85rem;
    color: var(--admin-text-muted);
}
.admin-pagination__nav { display: flex; gap: 6px; }
.admin-pagination__nav button {
    background: #fff;
    border: 1px solid var(--admin-border);
    border-radius: 5px;
    padding: 4px 10px;
    cursor: pointer;
    font-size: 0.82rem;
}
.admin-pagination__nav button:disabled { opacity: 0.5; cursor: not-allowed; }
.admin-pagination__nav button:hover:not(:disabled) { background: var(--admin-bg); }

/* --- Detail key/value ---------------------------------------------------- */

.admin-kv { display: grid; grid-template-columns: 200px 1fr; gap: 6px 16px; font-size: 0.9rem; }
.admin-kv dt { color: var(--admin-text-muted); font-weight: 500; }
.admin-kv dd { margin: 0; word-break: break-word; }
.admin-kv dd code {
    background: #f1f5f9;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.82rem;
}

/* --- Page header (alt — utilisé par les pages refondues) ----------------- */

.admin-page { width: 100%; }
.admin-page-title {
    margin: 0 0 4px 0;
    font-size: 1.45rem;
    font-weight: 600;
}
.admin-page-subtitle {
    color: var(--admin-text-muted);
    font-size: 0.92rem;
    margin: 0 0 22px 0;
}

/* --- Metrics grid (dashboard) ------------------------------------------- */

.admin-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.admin-metric-card {
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius);
    box-shadow: var(--admin-shadow);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.admin-metric-card__icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--admin-primary-soft);
    color: var(--admin-primary-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.admin-metric-card__body { display: flex; flex-direction: column; gap: 2px; }
.admin-metric-card__label {
    color: var(--admin-text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}
.admin-metric-card__value { font-size: 1.45rem; font-weight: 600; }

/* --- Card body (used in dashboard) --------------------------------------- */

.admin-card__body { padding: 0; }
.admin-card__header h3 { margin: 0; font-size: 1rem; font-weight: 600; }

/* --- Shortcuts ----------------------------------------------------------- */

.admin-shortcuts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}
.admin-shortcut {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #fafbfc;
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius);
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--admin-text);
    transition: background 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
}
.admin-shortcut i {
    color: var(--admin-primary);
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
}
.admin-shortcut:hover {
    background: #fff;
    border-color: var(--admin-primary);
    transform: translateY(-1px);
}

/* --- Forms ---------------------------------------------------------------- */

.admin-form-group { margin-bottom: 18px; }
.admin-form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--admin-text);
    margin-bottom: 6px;
}
.admin-form-control,
.admin-form-control:focus {
    width: 100%;
    height: 38px;
    padding: 8px 12px;
    border: 1px solid var(--admin-border);
    border-radius: 6px;
    background: #fff;
    font-size: 0.9rem;
    color: var(--admin-text);
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
    box-shadow: none;
    outline: none;
}
.admin-form-control:focus {
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px rgba(30, 142, 62, 0.12);
}
textarea.admin-form-control { height: auto; min-height: 90px; resize: vertical; }
select.admin-form-control { background-color: #fff; }

.admin-form-errors { margin-top: 6px; }
.admin-form-error {
    font-size: 0.8rem;
    color: var(--admin-danger);
    margin: 2px 0;
}
.admin-form-help {
    font-size: 0.8rem;
    color: var(--admin-text-muted);
    margin-top: 4px;
}

.admin-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--admin-border);
}

.admin-form-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 14px 18px;
    align-items: start;
    margin-bottom: 16px;
}
.admin-form-row__label {
    padding-top: 9px;
    color: var(--admin-text-muted);
    font-size: 0.88rem;
}
@media (max-width: 700px) {
    .admin-form-row { grid-template-columns: 1fr; }
    .admin-form-row__label { padding-top: 0; }
}

/* --- Alerts -------------------------------------------------------------- */

.admin-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 0.88rem;
    border: 1px solid transparent;
}
.admin-alert i { font-size: 1rem; margin-top: 2px; }
.admin-alert--success { background: var(--admin-primary-soft); color: var(--admin-primary-dark); border-color: rgba(30,142,62,0.2); }
.admin-alert--danger { background: #fde7e9; color: #9b1c20; border-color: rgba(217,48,37,0.2); }
.admin-alert--warning { background: #fff3cd; color: #8a6d00; border-color: rgba(245,158,11,0.25); }
.admin-alert--info { background: #e0ecff; color: #1d4ed8; border-color: rgba(37,99,235,0.2); }

/* --- Card variants -------------------------------------------------------- */

.admin-card--narrow {
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}
.admin-card--padded { padding: 28px 32px; }

/* --- Tabs (settings, etc.) ----------------------------------------------- */

.admin-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--admin-border);
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.admin-tabs__tab {
    padding: 10px 16px;
    cursor: pointer;
    border: 0;
    background: transparent;
    font-size: 0.9rem;
    color: var(--admin-text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.12s ease, border-color 0.12s ease;
    text-decoration: none;
}
.admin-tabs__tab:hover { color: var(--admin-text); text-decoration: none; }
.admin-tabs__tab.is-active {
    color: var(--admin-primary);
    border-bottom-color: var(--admin-primary);
    font-weight: 600;
}

/* --- Modal (uib-modal) --------------------------------------------------- */

/* uib-modal injecte le contenu dans un .modal-content. On stylise notre
   propre conteneur `.admin-modal` à l'intérieur. */
.admin-modal {
    background: var(--admin-surface);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--admin-text);
}
.admin-modal__header {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid var(--admin-border);
    gap: 12px;
}
.admin-modal__header i { color: var(--admin-primary); }
.admin-modal__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    flex: 1;
}
.admin-modal__close {
    background: transparent;
    border: 0;
    color: var(--admin-text-muted);
    font-size: 1rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}
.admin-modal__close:hover { background: var(--admin-bg); color: var(--admin-text); }

.admin-modal__body {
    padding: 18px 20px;
    max-height: 70vh;
    overflow-y: auto;
}
.admin-modal__body--compact { padding: 14px 20px; }

.admin-modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid var(--admin-border);
    background: #fafbfc;
}

.admin-modal__danger-icon {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: #fde7e9;
    color: #b71c1c;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 10px;
}

/* uib-modal compat — neutraliser le padding par défaut Bootstrap */
.modal-dialog .admin-modal,
.modal-content .admin-modal { border-radius: var(--admin-radius); }
.modal-content { padding: 0 !important; border: 0; box-shadow: var(--admin-shadow); }

/* Padding sain pour les dialogs qui utilisent les classes Bootstrap natives
   (.modal-header/.modal-body/.modal-footer). Quand un dialog utilise notre
   structure .admin-modal__header/__body/__footer à la place, les .modal-*
   ne sont pas présents donc ces règles ne s'appliquent pas. */
.modal-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--admin-border);
    display: flex;
    align-items: center;
    gap: 12px;
}
.modal-header .modal-title { margin: 0; font-size: 1.05rem; font-weight: 600; flex: 1; }
.modal-header .close {
    background: transparent;
    border: 0;
    font-size: 1.4rem;
    line-height: 1;
    color: var(--admin-text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}
.modal-header .close:hover { background: var(--admin-bg); color: var(--admin-text); }
.modal-body { padding: 18px 20px; }
.modal-footer {
    padding: 12px 18px;
    border-top: 1px solid var(--admin-border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* --- Detail page (key/value cards) --------------------------------------- */

.admin-detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}
@media (max-width: 900px) {
    .admin-detail-grid { grid-template-columns: 1fr; }
}
.admin-detail-section {
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius);
    box-shadow: var(--admin-shadow);
    margin-bottom: 18px;
    overflow: hidden;
}
.admin-detail-section__header {
    padding: 14px 18px;
    background: #fafbfc;
    border-bottom: 1px solid var(--admin-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.admin-detail-section__header h3 { margin: 0; font-size: 1rem; font-weight: 600; }
.admin-detail-section__body { padding: 16px 18px; }

/* --- Avatar -------------------------------------------------------------- */

.admin-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--admin-primary-soft);
    color: var(--admin-primary-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 600;
    overflow: hidden;
    flex-shrink: 0;
}
.admin-avatar img { width: 100%; height: 100%; object-fit: cover; }
.admin-avatar--lg { width: 96px; height: 96px; font-size: 1.7rem; }

/* --- Plan / pricing cards (subscriptions) ------------------------------- */

.admin-plans {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.admin-plan-card {
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius);
    padding: 22px;
    text-align: center;
    transition: border-color 0.12s ease, transform 0.12s ease, box-shadow 0.12s ease;
    cursor: pointer;
    position: relative;
}
.admin-plan-card:hover { border-color: var(--admin-primary); transform: translateY(-2px); box-shadow: var(--admin-shadow); }
.admin-plan-card.is-selected {
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px rgba(30,142,62,0.12), var(--admin-shadow);
}
.admin-plan-card__name { font-size: 1rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 8px; }
.admin-plan-card__price { font-size: 1.8rem; font-weight: 700; color: var(--admin-primary-dark); }
.admin-plan-card__price small { font-size: 0.8rem; color: var(--admin-text-muted); font-weight: 500; }
.admin-plan-card__features { list-style: none; padding: 0; margin: 14px 0 0 0; font-size: 0.85rem; color: var(--admin-text-muted); }
.admin-plan-card__features li { padding: 4px 0; }

/* --- Empty list (api-keys, etc.) ----------------------------------------- */

.admin-list-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius);
    background: #fff;
    margin-bottom: 10px;
}
.admin-list-item__icon {
    width: 40px; height: 40px;
    border-radius: 8px;
    background: var(--admin-primary-soft);
    color: var(--admin-primary-dark);
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.admin-list-item__body { flex: 1; min-width: 0; }
.admin-list-item__title { font-weight: 600; font-size: 0.95rem; }
.admin-list-item__meta { font-size: 0.78rem; color: var(--admin-text-muted); margin-top: 2px; }
.admin-list-item__actions { display: flex; gap: 6px; flex-shrink: 0; }

/* --- Utility classes ----------------------------------------------------- */

.admin-text-muted { color: var(--admin-text-muted); }
.admin-text-right { text-align: right; }
.admin-text-center { text-align: center; }
.admin-clickable { cursor: pointer; }

/* Inline code (used in tables and details) */
.admin-page code {
    background: #f1f5f9;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.82rem;
    font-family: "SF Mono", Menlo, Consolas, monospace;
}

/* --- Empty state --------------------------------------------------------- */

.admin-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--admin-text-muted);
}
.admin-empty i { font-size: 2.5rem; opacity: 0.4; margin-bottom: 10px; display: block; }

/* --- Compat : neutraliser le padding du `.container` Bootstrap quand il ---
   apparait dans une page legacy injectée dans le content admin.
   Les pages legacy utilisent <div class="container">…</div> qui ajoute un
   max-width centré et des marges latérales : dans le shell admin on veut
   plutôt prendre toute la largeur disponible. */

.admin-content > .container,
.admin-content > div > .container,
.admin-content .container-fluid {
    max-width: none !important;
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

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

@media (max-width: 900px) {
    .admin-sidebar { transform: translateX(-100%); width: var(--admin-sidebar-w); }
    .admin-shell.is-mobile-open .admin-sidebar { transform: translateX(0); }
    .admin-main { margin-left: 0; }
    .admin-shell.is-collapsed .admin-main { margin-left: 0; }
}
