body.am-standalone-page {
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.14), transparent 24rem),
        radial-gradient(circle at bottom right, rgba(13, 148, 136, 0.12), transparent 26rem),
        linear-gradient(180deg, #f7faff 0%, #eef3fb 100%);
    color: #0f172a;
    font-family: "Aptos", "Segoe UI", "Helvetica Neue", sans-serif;
    margin: 0;
}

body.am-standalone-page,
body.am-standalone-page button,
body.am-standalone-page input,
body.am-standalone-page select,
body.am-standalone-page textarea {
    font-family: "Aptos", "Segoe UI", "Helvetica Neue", sans-serif;
}

body.am-standalone-page .am-standalone-main {
    min-height: 100vh;
    padding: 2rem;
}

.am-app-shell,
.am-admin-wrap {
    --am-bg: #eff5ff;
    --am-bg-strong: #ffffff;
    --am-panel: rgba(255, 255, 255, 0.94);
    --am-panel-border: rgba(148, 163, 184, 0.22);
    --am-panel-shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
    --am-text: #0f172a;
    --am-muted: #5b6b83;
    --am-subtle: #8a97ab;
    --am-accent: #2563eb;
    --am-accent-strong: #1d4ed8;
    --am-accent-soft: rgba(37, 99, 235, 0.1);
    --am-sidebar: #0f172a;
    --am-sidebar-line: rgba(148, 163, 184, 0.16);
    --am-sidebar-text: #e2e8f0;
    --am-danger: #dc2626;
    --am-danger-soft: rgba(220, 38, 38, 0.08);
    --am-success: #0f766e;
    --am-success-soft: rgba(15, 118, 110, 0.1);
    --am-warning: #c2410c;
    --am-warning-soft: rgba(194, 65, 12, 0.1);
    color: var(--am-text);
}

.am-app-shell *,
.am-admin-wrap * {
    box-sizing: border-box;
}

.am-app-shell a,
.am-admin-wrap a {
    color: inherit;
}

.am-kicker {
    color: var(--am-accent);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    margin: 0 0 0.65rem;
    text-transform: uppercase;
}

.am-section-title,
.am-page-title,
.am-display-title,
.am-card-title,
.am-sidebar-brand-title {
    color: var(--am-text);
    line-height: 1.06;
    margin: 0;
}

.am-display-title {
    font-size: clamp(2.35rem, 4vw, 3.6rem);
}

.am-page-title {
    font-size: clamp(2rem, 3vw, 2.8rem);
    margin-bottom: 0.65rem;
    max-width: 15ch;
}

.am-section-title {
    font-size: clamp(1.35rem, 2vw, 1.8rem);
}

.am-card-title {
    font-size: 1.08rem;
}

.am-section-lead,
.am-form-hint,
.am-empty-state {
    color: var(--am-muted);
}

.am-section-lead {
    font-size: 0.98rem;
    line-height: 1.65;
    margin: 0;
    max-width: 64ch;
}

.am-form-hint,
.am-empty-state {
    font-size: 0.92rem;
    line-height: 1.55;
    margin: 0;
}

.am-button,
.am-admin-wrap .button,
.am-admin-wrap button.button {
    align-items: center;
    appearance: none;
    background: linear-gradient(135deg, var(--am-accent), var(--am-accent-strong));
    border: 1px solid transparent;
    border-radius: 14px;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.18);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font-size: 0.94rem;
    font-weight: 700;
    gap: 0.5rem;
    justify-content: center;
    min-height: 2.9rem;
    padding: 0.75rem 1.1rem;
    text-decoration: none;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease;
}

.am-button:hover,
.am-admin-wrap .button:hover,
.am-admin-wrap button.button:hover {
    box-shadow: 0 16px 28px rgba(37, 99, 235, 0.22);
    transform: translateY(-1px);
}

.am-button-secondary,
.am-admin-wrap .button.button-secondary {
    background: var(--am-accent-soft);
    border-color: rgba(37, 99, 235, 0.16);
    box-shadow: none;
    color: var(--am-accent-strong);
}

.am-button-danger {
    background: var(--am-danger-soft);
    border-color: rgba(220, 38, 38, 0.14);
    box-shadow: none;
    color: var(--am-danger);
}

.am-auth-layout {
    align-items: stretch;
    display: grid;
    gap: 1.5rem;
    grid-template-columns: minmax(0, 1.2fr) minmax(340px, 420px);
    margin: 0 auto;
    max-width: 1320px;
}

.am-auth-stage,
.am-auth-card,
.am-section-card,
.am-metric-card,
.am-reminder-card,
.am-notice,
.am-admin-card {
    background: var(--am-panel);
    backdrop-filter: blur(14px);
    border: 1px solid var(--am-panel-border);
    border-radius: 24px;
    box-shadow: var(--am-panel-shadow);
}

.am-auth-stage,
.am-auth-card {
    padding: 2rem;
}

.am-brand-lockup {
    align-items: center;
    display: flex;
    gap: 1rem;
    margin-bottom: 1.6rem;
}

.am-language-switcher {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

.am-language-switcher-admin {
    margin-bottom: 1.25rem;
}

.am-language-switcher-label {
    color: var(--am-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.am-language-switcher-links {
    display: inline-flex;
    gap: 0.45rem;
}

.am-language-switcher-link {
    align-items: center;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 999px;
    color: var(--am-text);
    display: inline-flex;
    font-size: 0.8rem;
    font-weight: 700;
    justify-content: center;
    min-width: 2.6rem;
    padding: 0.4rem 0.75rem;
    text-decoration: none;
    transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
}

.am-language-switcher-link:hover,
.am-language-switcher-link.is-active {
    background: rgba(37, 99, 235, 0.12);
    border-color: rgba(37, 99, 235, 0.25);
    color: var(--am-accent-strong);
}

.am-brand-mark {
    align-items: center;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    border-radius: 18px;
    color: #fff;
    display: inline-flex;
    font-size: 1rem;
    font-weight: 800;
    height: 3.25rem;
    justify-content: center;
    letter-spacing: 0.06em;
    width: 3.25rem;
}

.am-feature-grid,
.am-metric-grid,
.am-card-grid {
    display: grid;
    gap: 1rem;
}

.am-feature-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 2rem;
}

.am-feature-card {
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 20px;
    display: grid;
    gap: 0.65rem;
    padding: 1.15rem;
}

.am-feature-card strong {
    font-size: 1rem;
    line-height: 1.4;
}

.am-feature-card p {
    color: var(--am-muted);
    line-height: 1.55;
    margin: 0;
}

.am-feature-label {
    color: var(--am-accent);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.am-auth-card {
    align-self: center;
    display: grid;
    gap: 1.25rem;
}

.am-auth-card-copy {
    display: grid;
    gap: 0.75rem;
}

.am-form-stack,
.am-form-grid {
    display: grid;
    gap: 0.95rem;
}

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

.am-field {
    display: grid;
    gap: 0.45rem;
}

.am-field label {
    color: var(--am-text);
    font-size: 0.93rem;
    font-weight: 700;
}

.am-field-full {
    grid-column: 1 / -1;
}

.am-form-stack input,
.am-form-grid input,
.am-form-grid textarea,
.am-form-grid select {
    background: #fff;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 16px;
    color: var(--am-text);
    font-size: 0.95rem;
    min-height: 3rem;
    outline: none;
    padding: 0.82rem 0.95rem;
    transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
    width: 100%;
}

.am-form-stack textarea,
.am-form-grid textarea {
    min-height: 8rem;
    resize: vertical;
}

.am-form-stack input:focus,
.am-form-grid input:focus,
.am-form-grid textarea:focus,
.am-form-grid select:focus {
    border-color: rgba(37, 99, 235, 0.5);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.am-empty-panel {
    background: rgba(255, 255, 255, 0.72);
    border: 1px dashed rgba(148, 163, 184, 0.3);
    border-radius: 18px;
    display: grid;
    gap: 1rem;
    padding: 1.2rem;
}

.am-dashboard-shell {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 280px minmax(0, 1fr);
    margin: 0 auto;
    max-width: 1480px;
}

.am-sidebar {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.92));
    border: 1px solid var(--am-sidebar-line);
    border-radius: 30px;
    box-shadow: 0 28px 60px rgba(15, 23, 42, 0.22);
    color: var(--am-sidebar-text);
    display: grid;
    gap: 1.4rem;
    padding: 1.5rem;
    position: sticky;
    top: 1.5rem;
}

.am-brand-lockup-sidebar {
    margin-bottom: 0;
}

.am-kicker-sidebar,
.am-sidebar-label,
.am-sidebar-hint {
    color: rgba(226, 232, 240, 0.72);
}

.am-sidebar-brand-title {
    color: #fff;
    font-size: 1.08rem;
}

.am-sidebar-session,
.am-sidebar-meta {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 22px;
    display: grid;
    gap: 0.5rem;
    padding: 1rem;
}

.am-sidebar-session strong {
    color: #fff;
    font-size: 1.05rem;
}

.am-side-nav {
    display: grid;
    gap: 0.55rem;
}

.am-tab-button {
    align-items: center;
    appearance: none;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 18px;
    color: inherit;
    cursor: pointer;
    display: inline-flex;
    font-size: 0.95rem;
    font-weight: 700;
    gap: 0.8rem;
    justify-content: flex-start;
    min-height: 3rem;
    padding: 0.8rem 0.95rem;
    transition: background 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.am-side-nav .am-tab-button {
    color: rgba(226, 232, 240, 0.88);
    width: 100%;
}

.am-side-nav .am-tab-button:hover,
.am-side-nav .am-tab-button.is-active {
    background: rgba(37, 99, 235, 0.18);
    border-color: rgba(96, 165, 250, 0.2);
    color: #fff;
    transform: translateX(2px);
}

.am-tab-badge {
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: rgba(226, 232, 240, 0.85);
    display: inline-flex;
    font-size: 0.74rem;
    font-weight: 800;
    height: 1.95rem;
    justify-content: center;
    letter-spacing: 0.08em;
    min-width: 1.95rem;
    padding: 0 0.45rem;
}

.am-sidebar-meta-row {
    align-items: center;
    display: flex;
    font-size: 0.92rem;
    justify-content: space-between;
}

.am-sidebar-meta-row strong {
    color: #fff;
}

.am-main {
    display: grid;
    gap: 1.2rem;
}

.am-topbar {
    align-items: end;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.am-topbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-end;
}

.am-topbar-actions .am-language-switcher {
    margin-bottom: 0;
}

.am-topbar-actions form {
    margin: 0;
}

.am-notices {
    display: grid;
    gap: 0.75rem;
}

.am-notice {
    padding: 0.95rem 1.1rem;
}

.am-notice-success {
    background: rgba(15, 118, 110, 0.08);
    border-color: rgba(15, 118, 110, 0.18);
    color: #115e59;
}

.am-notice-error {
    background: rgba(220, 38, 38, 0.08);
    border-color: rgba(220, 38, 38, 0.16);
    color: #991b1b;
}

.am-tab-panel {
    display: none;
}

.am-tab-panel.is-active {
    display: block;
}

.am-panel-header,
.am-card-header {
    align-items: start;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.am-panel-header {
    margin-bottom: 1rem;
}

.am-section-toolbar {
    display: grid;
    gap: 0.9rem;
    margin-bottom: 1rem;
}

.am-filter-bar {
    align-items: end;
    display: grid;
    gap: 0.85rem;
    grid-template-columns: minmax(0, 1.5fr) minmax(180px, 0.75fr) auto;
}

.am-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    justify-content: flex-end;
}

.am-panel-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-end;
}

.am-tab-shortcut {
    background: var(--am-accent-soft);
    border-color: rgba(37, 99, 235, 0.16);
    color: var(--am-accent-strong);
    justify-content: center;
}

.am-metric-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    margin-bottom: 1rem;
}

.am-metric-card {
    display: grid;
    gap: 0.45rem;
    padding: 1.15rem;
}

.am-metric-card span {
    color: var(--am-muted);
    font-size: 0.88rem;
}

.am-metric-card strong {
    color: var(--am-text);
    font-size: clamp(1.6rem, 2vw, 2.2rem);
    line-height: 1;
}

.am-content-grid,
.am-split-grid {
    display: grid;
    gap: 1rem;
}

.am-content-grid {
    align-items: start;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.85fr);
}

.am-split-grid {
    align-items: start;
    grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
}

.am-column-stack {
    display: grid;
    gap: 1rem;
}

.am-section-card {
    display: grid;
    gap: 1rem;
    padding: 1.25rem;
}

.am-flow-list {
    color: var(--am-text);
    display: grid;
    gap: 0.8rem;
    margin: 0;
    padding-left: 1.2rem;
}

.am-flow-list li {
    line-height: 1.6;
}

.am-activity-list {
    display: grid;
    gap: 0.85rem;
}

.am-activity-item {
    background: rgba(248, 250, 252, 0.78);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 18px;
    display: grid;
    gap: 0.45rem;
    padding: 0.95rem 1rem;
}

.am-activity-head {
    align-items: center;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
}

.am-activity-badge {
    background: rgba(37, 99, 235, 0.12);
    border-radius: 999px;
    color: var(--am-accent-strong);
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    padding: 0.32rem 0.65rem;
    text-transform: uppercase;
}

.am-activity-entity {
    color: var(--am-text);
    font-size: 0.95rem;
}

.am-activity-message {
    color: var(--am-muted);
    line-height: 1.5;
    margin: 0;
}

.am-delivery-preview {
    background: rgba(248, 250, 252, 0.88);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 20px;
    display: grid;
    gap: 0.95rem;
    padding: 1rem;
}

.am-table-wrap {
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 20px;
    overflow-x: auto;
}

.am-table {
    border-collapse: separate;
    border-spacing: 0;
    min-width: 100%;
    width: 100%;
}

.am-table thead th {
    background: rgba(248, 250, 252, 0.92);
    color: var(--am-muted);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    padding: 0.95rem 0.8rem;
    position: sticky;
    text-align: left;
    top: 0;
    z-index: 1;
}

.am-table thead th:first-child {
    border-top-left-radius: 16px;
}

.am-table thead th:last-child {
    border-top-right-radius: 16px;
}

.am-table td {
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
    color: var(--am-text);
    padding: 0.95rem 0.8rem;
    text-align: left;
    vertical-align: top;
}

.am-table tbody tr:hover {
    background: rgba(248, 250, 252, 0.7);
}

.am-table-editor-row:hover {
    background: transparent;
}

.am-table-editor-row td {
    background: rgba(248, 250, 252, 0.48);
    padding-top: 0.3rem;
}

.am-table code {
    background: rgba(15, 23, 42, 0.05);
    border-radius: 10px;
    color: #0f172a;
    display: inline-block;
    font-family: Consolas, "Courier New", monospace;
    padding: 0.22rem 0.5rem;
}

.am-status-pill {
    align-items: center;
    background: rgba(15, 23, 42, 0.06);
    border-radius: 999px;
    color: var(--am-text);
    display: inline-flex;
    font-size: 0.82rem;
    font-weight: 700;
    gap: 0.35rem;
    padding: 0.3rem 0.65rem;
}

.am-status-pill.is-active,
.am-status-pill.is-actif,
.am-status-pill.is-sent,
.am-status-pill.is-libre {
    background: rgba(15, 118, 110, 0.12);
    color: #0f766e;
}

.am-status-pill.is-programme,
.am-status-pill.is-pending,
.am-status-pill.is-configuration_required,
.am-status-pill.is-occupe {
    background: rgba(194, 65, 12, 0.12);
    color: #c2410c;
}

.am-status-pill.is-expire,
.am-status-pill.is-failed,
.am-status-pill.is-suspended,
.am-status-pill.is-suspendu {
    background: rgba(220, 38, 38, 0.12);
    color: #b91c1c;
}

.am-status-pill.is-inactive,
.am-status-pill.is-disabled,
.am-status-pill.is-cancelled,
.am-status-pill.is-termine {
    background: rgba(15, 23, 42, 0.08);
    color: #475569;
}

.am-inline-form,
.am-inline-stack {
    margin: 0;
}

.am-inline-stack {
    display: grid;
    gap: 0.55rem;
}

.am-inline-stack input {
    min-width: 11rem;
}

.am-secret-stack {
    display: grid;
    gap: 0.55rem;
}

.am-record-editor {
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 18px;
    overflow: hidden;
}

.am-record-editor-summary {
    color: var(--am-text);
    cursor: pointer;
    font-size: 0.94rem;
    font-weight: 700;
    list-style: none;
    padding: 0.95rem 1rem;
}

.am-record-editor-summary::-webkit-details-marker {
    display: none;
}

.am-record-editor[open] .am-record-editor-summary {
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.am-record-editor-body {
    padding: 1rem;
}

.am-reminder-list {
    display: grid;
    gap: 1rem;
}

.am-reminder-card {
    overflow: hidden;
}

.am-reminder-card.is-expired {
    border-color: rgba(220, 38, 38, 0.18);
}

.am-reminder-card.is-upcoming {
    border-color: rgba(245, 158, 11, 0.18);
}

.am-reminder-summary {
    align-items: center;
    cursor: pointer;
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1fr) auto;
    list-style: none;
    padding: 1.05rem 1.2rem;
}

.am-reminder-summary::-webkit-details-marker {
    display: none;
}

.am-reminder-title {
    color: var(--am-text);
    font-weight: 700;
    line-height: 1.45;
}

.am-reminder-badge {
    background: var(--am-warning-soft);
    border-radius: 999px;
    color: var(--am-warning);
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 800;
    padding: 0.38rem 0.75rem;
}

.am-reminder-card.is-expired .am-reminder-badge {
    background: var(--am-danger-soft);
    color: var(--am-danger);
}

.am-reminder-body {
    border-top: 1px solid rgba(148, 163, 184, 0.16);
    display: grid;
    gap: 0.9rem;
    padding: 1rem 1.2rem 1.2rem;
}

.am-reminder-message {
    background: #fff;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 16px;
    min-height: 7.5rem;
    padding: 0.9rem 1rem;
    resize: vertical;
    width: 100%;
}

.am-reminder-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.am-log-context {
    margin: 0;
    max-width: 30rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.am-admin-wrap {
    margin: 1.5rem 1.5rem 0 0;
}

.am-admin-wrap .am-card-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.am-admin-wrap .am-card,
.am-admin-wrap .am-admin-card {
    background: #fff;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 22px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
    padding: 1.2rem;
}

.am-admin-wrap .am-form-grid input,
.am-admin-wrap .am-form-grid textarea,
.am-admin-wrap .am-form-grid select {
    min-height: 2.75rem;
}

@media (max-width: 1200px) {
    .am-auth-layout,
    .am-dashboard-shell,
    .am-content-grid,
    .am-split-grid {
        grid-template-columns: 1fr;
    }

    .am-sidebar {
        position: static;
    }
}

@media (max-width: 900px) {
    body.am-standalone-page .am-standalone-main {
        padding: 1rem;
    }

    .am-feature-grid,
    .am-form-grid,
    .am-filter-bar {
        grid-template-columns: 1fr;
    }

    .am-topbar,
    .am-panel-header,
    .am-card-header {
        align-items: start;
        flex-direction: column;
    }

    .am-topbar-actions,
    .am-panel-actions,
    .am-filter-actions {
        justify-content: flex-start;
    }

    .am-page-title {
        max-width: none;
    }
}

@media (max-width: 782px) {
    .am-sidebar {
        border-radius: 24px;
        padding: 1rem;
    }

    .am-auth-stage,
    .am-auth-card,
    .am-section-card {
        padding: 1rem;
    }

    .am-reminder-summary {
        grid-template-columns: 1fr;
    }
}
