:root {
    --brand-custom: #2c0098;
    --brand-bleu: #3b82f6;
    --brand-noir: #000000;
    --brand-blanc: #ffffff;
    --brand-gris: #6b7280;
    --brand-vert: #00b2a9;
    --brand-rouge: #ef426f;
    --brand-orange: #ff8200;
    --bg-color: #f4f6f8;
    --text-main: var(--brand-noir);
    --text-muted: #8a8d8f;
    --card-bg: var(--brand-blanc);
    --border: #e2e8f0;
    --q1-color: var(--brand-vert);
    --q2-color: var(--brand-custom);
    --q3-color: var(--brand-orange);
    --q4-color: var(--brand-rouge);
    --surface: var(--card-bg);
    --surface-muted: #eef2f6;
    --text: var(--text-main);
    --text-soft: var(--text-muted);
    --brand: var(--brand-custom);
    --brand-strong: #1f006d;
    --brand-contrast: var(--brand-blanc);
    --shadow: 0 20px 45px rgba(0, 0, 0, 0.08);
    --header-offset: 0px;
    --footer-offset: 0px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(44, 0, 152, 0.12), transparent 30%),
        radial-gradient(circle at top right, rgba(0, 178, 169, 0.12), transparent 28%),
        linear-gradient(180deg, #fafbfc 0%, var(--bg-color) 100%);
}

body.dashboard-wheel-snap {
    overflow-y: hidden;
}

body.dashboard-wheel-snap .site-main {
    min-height: calc(100vh - var(--header-offset) - var(--footer-offset));
    padding: 0;
}

.dashboard-snap-section {
    min-height: calc(100vh - var(--header-offset) - var(--footer-offset));
    display: flex;
    flex-direction: column;
    justify-content: center;
    scroll-margin-top: var(--header-offset);
}

body.dashboard-wheel-snap .dashboard-snap-section + .dashboard-snap-section {
    margin-top: 0;
}

body.dashboard-wheel-snap .dashboard-snap-section:first-of-type {
    padding-top: 0;
}

body.dashboard-wheel-snap .dashboard-snap-section:last-of-type {
    padding-bottom: 0;
}

body.dashboard-wheel-snap .dashboard-snap-section .section-title {
    margin-top: 0;
    margin-bottom: 18px;
}

body.drawer-open {
    overflow: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

.site-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: min(1720px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(14px);
    background: rgba(255, 255, 255, 0.88);
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 0;
}

.brand {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    max-width: min(720px, 100%);
    padding: 10px 18px;
    border: 1px solid rgba(44, 0, 152, 0.12);
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(44, 0, 152, 0.1), rgba(0, 178, 169, 0.12));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
    color: var(--brand);
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1.2;
}

.brand::before {
    content: "";
    width: 10px;
    height: 10px;
    flex-shrink: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--brand), var(--brand-vert));
    box-shadow: 0 0 0 4px rgba(44, 0, 152, 0.08);
}

.brand:hover {
    border-color: rgba(44, 0, 152, 0.22);
    background: linear-gradient(135deg, rgba(44, 0, 152, 0.14), rgba(0, 178, 169, 0.16));
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.nav-link {
    padding: 10px 16px;
    border-radius: 999px;
    color: var(--brand-strong);
    background: rgba(44, 0, 152, 0.08);
    border: 1px solid transparent;
    transition: 0.2s ease;
}

.nav-link:hover {
    border-color: rgba(44, 0, 152, 0.18);
    background: rgba(44, 0, 152, 0.14);
}

.nav-link.is-active {
    color: var(--brand-contrast);
    background: linear-gradient(135deg, var(--brand), var(--brand-strong));
    box-shadow: var(--shadow);
}

.site-main {
    flex: 1;
    min-height: 0;
    padding: 24px 0;
}

.hero {
    padding: 24px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: var(--shadow);
}

.hero h1,
.hero h2 {
    margin: 0;
    line-height: 1;
}

.hero-title-coming-soon {
    font-family: "Bitcount Single", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.hero-heading-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.hero-filters {
    margin-top: 28px;
    padding: 24px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 22px;
    background: rgba(248, 250, 252, 0.88);
}

.dashboard-filters-summary {
    margin-left: auto;
    text-align: right;
    color: var(--text-soft);
    font-size: 0.92rem;
    font-weight: 600;
    white-space: nowrap;
}

.updates-page {
    display: grid;
    gap: 24px;
}

.updates-hero-text {
    margin: 16px 0 0;
    max-width: 78ch;
    color: var(--text-soft);
    line-height: 1.6;
}

.updates-sections {
    display: grid;
    gap: 24px;
}

.updates-section {
    display: grid;
    gap: 24px;
    padding: 24px;
}

.updates-section-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(380px, 0.9fr);
    gap: 24px;
    align-items: stretch;
}

.updates-section-main {
    display: grid;
    gap: 16px;
    align-content: start;
    min-width: 0;
}

.updates-section-console {
    min-width: 0;
}

.updates-section-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px 24px;
}

.updates-section-intro {
    display: grid;
    align-content: center;
    align-self: center;
    min-width: 0;
    max-width: 780px;
}

.updates-section-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: nowrap;
    min-width: max-content;
}

.updates-select-shell {
    display: grid;
    gap: 8px;
    min-width: min(320px, 100%);
}

.updates-select-shell-inline {
    width: min(420px, 100%);
    max-width: 420px;
}

.updates-select {
    width: 100%;
    min-height: 48px;
    padding: 0 16px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: rgba(248, 250, 252, 0.96);
    color: var(--text-main);
    font: inherit;
    font-weight: 700;
}

.updates-import-form {
    display: grid;
    gap: 16px;
    align-content: start;
    padding: 20px;
    border: 1px solid rgba(44, 0, 152, 0.12);
    border-radius: 20px;
    background: rgba(248, 250, 252, 0.9);
}

.updates-file-input {
    width: 100%;
    min-height: 48px;
    padding: 12px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.98);
    color: var(--text-main);
    font: inherit;
}

.updates-select:focus {
    outline: none;
    border-color: rgba(44, 0, 152, 0.35);
    box-shadow: 0 0 0 3px rgba(44, 0, 152, 0.12);
}

.updates-section-text {
    margin: 10px 0 0;
    max-width: 78ch;
    color: var(--text-soft);
    line-height: 1.6;
}

.updates-section-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.updates-section-title-row h3 {
    margin: 0;
    color: var(--brand-custom);
}

.updates-section-title-row .detail-nav-info-button {
    cursor: pointer;
}

.updates-info-panel {
    margin-top: 12px;
    max-width: 78ch;
    padding: 14px 16px;
    border: 1px solid rgba(44, 0, 152, 0.14);
    border-radius: 16px;
    background: rgba(44, 0, 152, 0.05);
    color: var(--text-soft);
    line-height: 1.6;
}

.updates-run-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 22px;
    border: 0;
    border-radius: 999px;
    font: inherit;
    font-weight: 800;
    text-align: center;
    text-decoration: none;
    color: var(--brand-contrast);
    background: linear-gradient(135deg, var(--brand), var(--brand-strong));
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.updates-run-button-secondary {
    color: var(--brand-strong);
    background: rgba(44, 0, 152, 0.08);
    box-shadow: none;
}

.updates-run-button:hover:not(:disabled),
.updates-run-button:focus-visible:not(:disabled) {
    transform: translateY(-1px);
}

.updates-run-button:disabled {
    opacity: 0.6;
    cursor: wait;
}

.updates-confirm-dialog {
    width: min(560px, calc(100% - 32px));
    padding: 0;
    border: 1px solid rgba(44, 0, 152, 0.14);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
}

.updates-confirm-dialog::backdrop {
    background: rgba(15, 23, 42, 0.42);
}

.updates-stream-dialog {
    width: min(760px, calc(100% - 32px));
}

.updates-confirm-dialog-body {
    display: grid;
    gap: 18px;
    padding: 24px;
}

.updates-confirm-dialog-body h3 {
    margin: 0;
    color: var(--brand-strong);
}

.updates-dialog-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
}

.updates-confirm-dialog-body p {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.6;
}

.updates-progress-shell {
    display: grid;
    gap: 10px;
}

.updates-progress-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: var(--text-main);
}

.updates-progress-meta strong,
.updates-progress-meta span {
    font-size: 0.95rem;
}

.updates-progress-track {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 14px;
    border-radius: 999px;
    background: rgba(203, 213, 225, 0.6);
}

.updates-progress-bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--brand-orange), var(--brand-vert));
    transition: width 0.25s ease;
}

.updates-source-dialog {
    width: min(860px, calc(100% - 32px));
}

.updates-inline-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.updates-card-button {
    grid-column: 1 / -1;
    justify-self: start;
}

.updates-card-input-shell {
    grid-column: 1 / -1;
    width: 100%;
    max-width: none;
    margin-top: 4px;
}

.updates-source-create-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
}

.updates-script-create-form,
.updates-script-row {
    display: grid;
    gap: 12px;
}

.updates-select-shell-wide {
    width: 100%;
    max-width: none;
}

.updates-textarea-input {
    width: 100%;
    min-height: 120px;
    padding: 12px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.98);
    color: var(--text-main);
    font: inherit;
    resize: vertical;
}

.updates-source-list {
    display: grid;
    gap: 12px;
}

.updates-source-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 16px;
    background: rgba(248, 250, 252, 0.88);
}

.updates-source-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
}

.updates-source-item-script {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
}

.updates-empty-text {
    margin: 0;
    color: var(--text-soft);
}

.updates-confirm-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.updates-section-placeholder {
    border-style: dashed;
    background: rgba(255, 255, 255, 0.62);
}

.updates-summary-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.updates-summary-grid article {
    display: grid;
    grid-template-columns: auto 1fr auto;
    column-gap: 10px;
    row-gap: 6px;
    padding: 20px 18px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 18px;
    background: rgba(248, 250, 252, 0.88);
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.updates-summary-label {
    color: var(--text-soft);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.updates-step-card {
    position: relative;
}

.updates-step-card::before {
    content: "";
    grid-column: 1;
    grid-row: 1;
    align-self: center;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #cbd5e1;
}

.updates-step-card > .updates-summary-label {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    text-align: right;
}

.updates-step-card > strong {
    grid-column: 2;
    grid-row: 1;
    line-height: 1.35;
}

.updates-step-card.is-pending {
    background: rgba(248, 250, 252, 0.88);
    border-color: rgba(226, 232, 240, 0.9);
}

.updates-step-card.is-running {
    background: rgba(255, 130, 0, 0.12);
    border-color: rgba(255, 130, 0, 0.35);
    box-shadow: inset 0 0 0 1px rgba(255, 130, 0, 0.1);
}

.updates-step-card.is-running::before {
    background: var(--brand-orange);
}

.updates-step-card.is-success {
    background: rgba(0, 178, 169, 0.12);
    border-color: rgba(0, 178, 169, 0.35);
    box-shadow: inset 0 0 0 1px rgba(0, 178, 169, 0.08);
}

.updates-step-card.is-success::before {
    background: var(--brand-vert);
}

.updates-step-card.is-error {
    background: rgba(239, 66, 111, 0.12);
    border-color: rgba(239, 66, 111, 0.35);
    box-shadow: inset 0 0 0 1px rgba(239, 66, 111, 0.08);
}

.updates-step-card.is-error::before {
    background: var(--brand-rouge);
}

.updates-step-meta {
    grid-column: 1 / -1;
    grid-row: 2;
    margin: 0;
    color: var(--text-soft);
    font-size: 0.9rem;
}

.updates-status-text {
    margin: 14px 0 0;
    color: var(--text-soft);
    line-height: 1.6;
}

.updates-log-console {
    margin: 0;
    min-height: 100%;
    overflow: auto;
    padding: 20px;
    border-radius: 20px;
    background: #0f172a;
    color: #dbeafe;
    font-family: "Consolas", "Monaco", monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.updates-stream-console {
    min-height: 320px;
}

.dashboard-filters-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: end;
}

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

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

.filter-field span {
    color: var(--brand-strong);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.filter-dropdown-toggle,
.filter-reset {
    min-height: 44px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font: inherit;
}

.filter-actions {
    display: flex;
    align-items: flex-end;
}

.filter-dropdown {
    position: relative;
    max-width: 100%;
}

.filter-dropdown.filter-dropdown-wide {
    width: 100%;
}

.filter-dropdown-toggle {
    appearance: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 0 14px;
    border-radius: 999px;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    background: #f8fafc;
    color: #334155;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.filter-dropdown-toggle:focus,
.filter-reset:focus {
    outline: none;
    border-color: rgba(44, 0, 152, 0.35);
    box-shadow: 0 0 0 3px rgba(44, 0, 152, 0.12);
}

.filter-dropdown-toggle::after {
    content: "";
    flex-shrink: 0;
    width: 9px;
    height: 9px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-1px);
    transition: transform 0.2s ease;
}

.filter-dropdown.is-open .filter-dropdown-toggle::after {
    transform: rotate(-135deg) translateY(-1px);
}

.filter-dropdown-label {
    flex: 1;
    overflow: hidden;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.filter-dropdown-toggle.filter-dropdown-toggle-criticity {
    justify-content: flex-start;
    gap: 10px;
}

.filter-dropdown-toggle-criticity .filter-dropdown-label {
    text-align: left;
}

.filter-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    z-index: 20;
    display: none;
    flex-direction: column;
    gap: 10px;
    max-height: 320px;
    padding: 10px;
    overflow-y: auto;
    border: 1px solid #ddd6fe;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12);
}

.filter-dropdown.is-open .filter-dropdown-menu {
    display: flex;
}

.filter-dropdown-option {
    appearance: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 999px;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    background: #f8fafc;
    color: #334155;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.filter-dropdown-option-criticity {
    justify-content: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-color: #d7dee7;
    background: #ffffff;
    color: #334155;
}

.filter-dropdown-option-criticity.filter-option-all {
    background: #f8fafc;
}

.filter-dropdown-option:hover,
.filter-dropdown-option:focus {
    outline: none;
    filter: brightness(0.98);
}

.filter-dropdown-option.is-selected {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
    font-weight: 800;
}

.filter-dropdown-label.filter-option-all,
.filter-dropdown-label.preco-none,
.filter-dropdown-label.preco-strike,
.filter-dropdown-label.preco-critical,
.filter-dropdown-label.preco-mixed,
.filter-dropdown-label.preco-medium,
.filter-dropdown-label.preco-good,
.filter-dropdown-label.preco-wide,
.filter-dropdown-label.preco-systemic {
    background: inherit;
    color: inherit;
    border-color: inherit;
}

.filter-dropdown-toggle.filter-option-all,
.filter-dropdown-option.filter-option-all {
    background: #f8fafc;
    color: #334155;
    border-color: #d7dee7;
}

.filter-dropdown-toggle.preco-none,
.filter-dropdown-option.preco-none { background: #ecfdf5; color: #047857; border-color: #c2edd7; }

.filter-dropdown-toggle.preco-strike,
.filter-dropdown-option.preco-strike { background: #fff1f2; color: #be123c; border-color: #f9dde2; }

.filter-dropdown-toggle.preco-critical,
.filter-dropdown-option.preco-critical { background: #fff7ed; color: #c2410c; border-color: #f8c996; }

.filter-dropdown-toggle.preco-mixed,
.filter-dropdown-option.preco-mixed { background: #fff7ed; color: #9a3412; border-color: #f6debc; }

.filter-dropdown-toggle.preco-medium,
.filter-dropdown-option.preco-medium { background: #eff6ff; color: #1d4ed8; border-color: #d1e4fb; }

.filter-dropdown-toggle.preco-good,
.filter-dropdown-option.preco-good { background: #eef2ff; color: #4338ca; border-color: #d7def7; }

.filter-dropdown-toggle.preco-wide,
.filter-dropdown-option.preco-wide { background: #f8fafc; color: #334155; border-color: #d7dee7; }

.filter-dropdown-toggle.preco-systemic,
.filter-dropdown-option.preco-systemic { background: #f5f3ff; color: #6d28d9; border-color: #e8e2fb; }

.filter-criticity-copy {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.filter-criticity-title {
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.2;
}

.filter-criticity-subtitle {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    text-transform: none;
}

.filter-criticity-bar {
    display: flex;
    align-items: stretch;
    width: 96px;
    min-width: 96px;
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--border);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.filter-criticity-bar.is-compact {
    width: 74px;
    min-width: 74px;
    height: 9px;
}

.filter-criticity-segment {
    height: 100%;
}

.bg-q1 {
    background-color: var(--brand-vert);
}

.bg-q2 {
    background-color: var(--brand-custom);
}

.bg-q3 {
    background-color: var(--brand-orange);
}

.bg-q4 {
    background-color: var(--brand-rouge);
}

.filter-reset {
    min-width: 148px;
    padding: 0 16px;
    color: var(--brand);
    font-weight: 700;
    cursor: pointer;
    background: #f8fafc;
    transition: all 0.2s ease;
}

.filter-reset:hover {
    background: #eef2ff;
    border-color: #c7d2fe;
}

.suivi-page {
    display: grid;
    gap: 24px;
    width: min(1720px, calc(100% - 32px));
}

.control-admin-page {
    display: grid;
    gap: 24px;
    width: min(1720px, calc(100% - 32px));
}

.control-admin-layout {
    display: grid;
    grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.control-admin-sidebar {
    min-width: 0;
}

.control-admin-sidebar-inner {
    display: grid;
    gap: 20px;
    max-height: calc(100dvh - var(--header-offset) - var(--footer-offset) - 48px);
    overflow-y: auto;
    scrollbar-gutter: stable;
    padding: 24px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.84);
    box-shadow: var(--shadow);
}

.control-admin-main {
    display: grid;
    gap: 24px;
    min-width: 0;
}

.control-admin-hero {
    display: grid;
    gap: 22px;
    padding: 28px;
}

.control-admin-hero-top {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.7fr);
    gap: 20px;
    align-items: stretch;
}

.control-admin-hero-copy {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.control-admin-hero-copy h2 {
    font-size: clamp(1.9rem, 3vw, 2.6rem);
    line-height: 1.05;
}

.control-admin-hero-text {
    max-width: 64ch;
    margin: 0;
}

.control-admin-hero-notes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.control-admin-create-button {
    flex-shrink: 0;
}

.control-admin-create-button.is-current {
    opacity: 0.95;
    pointer-events: none;
}

.control-admin-feedback {
    padding: 18px 22px;
}

.control-admin-feedback h3 {
    margin: 0 0 12px;
    color: var(--brand-strong);
}

.control-admin-feedback p {
    margin: 0;
}

.control-admin-feedback.is-success {
    border-color: rgba(0, 178, 169, 0.35);
    background: rgba(0, 178, 169, 0.1);
}

.control-admin-feedback.is-error {
    border-color: rgba(239, 66, 111, 0.35);
    background: rgba(239, 66, 111, 0.1);
}

.control-admin-error-list {
    margin: 0;
    padding-left: 20px;
    color: var(--text-main);
    line-height: 1.7;
}

.control-admin-empty-sidebar {
    padding: 18px;
}

.control-admin-empty-sidebar p {
    margin: 0;
    line-height: 1.7;
}

.control-admin-nav-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.control-admin-nav-link {
    display: grid;
    gap: 6px;
}

.control-admin-nav-subtitle {
    color: var(--text-soft);
    font-size: 0.82rem;
    line-height: 1.4;
}

.control-admin-form-card {
    padding: 22px;
}

.control-admin-section-head {
    align-items: flex-start;
}

.control-admin-hero-metrics {
    display: grid;
    gap: 8px;
}

.control-admin-hero-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}

.control-admin-hero-stat-card {
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.88);
}

.control-admin-hero-stat-card span {
    margin-bottom: 4px;
    font-size: 0.72rem;
}

.control-admin-hero-stat-card strong {
    font-size: clamp(0.95rem, 1.2vw, 1.05rem);
}

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

.control-admin-meta-card {
    min-width: 0;
    padding: 18px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 20px;
    background: rgba(248, 250, 252, 0.88);
}

.control-admin-meta-card span {
    display: block;
    margin-bottom: 8px;
    color: var(--text-soft);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.control-admin-meta-card strong {
    display: block;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.control-admin-meta-card-wide {
    grid-column: 1 / -1;
}

.control-admin-form {
    display: grid;
    gap: 20px;
}

.control-admin-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.control-admin-view-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    padding: 6px;
    border: 1px solid rgba(44, 0, 152, 0.12);
    border-radius: 999px;
    background: rgba(248, 250, 252, 0.92);
}

.control-admin-view-button {
    min-height: 40px;
    padding: 0 16px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--brand-strong);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.control-admin-view-button:hover,
.control-admin-view-button:focus-visible {
    background: rgba(44, 0, 152, 0.1);
    outline: none;
}

.control-admin-view-button.is-active {
    background: linear-gradient(135deg, var(--brand), var(--brand-strong));
    color: var(--brand-contrast);
    box-shadow: var(--shadow);
}

.control-admin-panel {
    display: none;
}

.control-admin-panel.is-active {
    display: block;
}

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

.control-admin-field {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.control-admin-field-wide {
    grid-column: 1 / -1;
}

.control-admin-field label {
    color: var(--brand-strong);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.control-admin-field input,
.control-admin-field select,
.control-admin-field textarea {
    width: 100%;
    min-height: 48px;
    padding: 12px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    background: rgba(248, 250, 252, 0.96);
    color: var(--text-main);
    font: inherit;
}

.control-admin-field textarea {
    min-height: 110px;
    resize: vertical;
}

.sql-editor {
    position: relative;
    min-height: 420px;
    border: 1px solid #0f172a;
    border-radius: 18px;
    background: #111317;
    overflow: hidden;
}

.sql-editor-highlight,
.sql-editor-input {
    box-sizing: border-box;
    display: block;
    margin: 0;
    width: 100%;
    height: 420px;
    min-height: 420px;
    padding: 18px 20px;
    border: 0;
    border-radius: 0;
    font-family: "Consolas", "Monaco", "Courier New", monospace;
    font-size: 0.97rem;
    line-height: 1.6;
    letter-spacing: 0;
    tab-size: 4;
    white-space: pre;
    overflow: auto;
    scrollbar-gutter: stable;
}

.sql-editor-highlight {
    position: relative;
    z-index: 1;
    pointer-events: none;
    color: #d8dee9;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)),
        #111317;
    word-break: normal;
    overflow-wrap: normal;
}

.sql-editor-input {
    position: absolute;
    inset: 0;
    z-index: 2;
    resize: none;
    background: transparent;
    color: transparent;
    -webkit-text-fill-color: transparent;
    caret-color: #f8fafc;
    white-space: pre;
    overflow-wrap: normal;
}

.sql-editor-input::selection {
    background: rgba(148, 163, 184, 0.35);
}

.sql-editor-input:focus {
    outline: none;
    box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.65);
}

.control-admin-field .sql-editor-input,
.control-admin-field .sql-editor-input:focus,
.control-admin-field.has-error .sql-editor-input,
.control-admin-field.has-error .sql-editor-input:focus {
    background: transparent;
    color: transparent;
    -webkit-text-fill-color: transparent;
    border: 0;
    padding: 18px 20px;
    min-height: 420px;
    height: 420px;
    border-radius: 0;
    font-family: "Consolas", "Monaco", "Courier New", monospace;
    font-size: 0.97rem;
    line-height: 1.6;
}

.control-admin-field .sql-editor-highlight {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)),
        #111317;
    color: #d8dee9;
    border: 0;
    padding: 18px 20px;
    min-height: 420px;
    height: 420px;
    border-radius: 0;
    font-family: "Consolas", "Monaco", "Courier New", monospace;
    font-size: 0.97rem;
    line-height: 1.6;
}

.control-admin-field.has-error .sql-editor {
    border-color: rgba(239, 66, 111, 0.7);
    box-shadow: 0 0 0 3px rgba(239, 66, 111, 0.12);
}

.sql-token-keyword {
    color: #ff7b72;
    font-weight: 700;
}

.sql-token-identifier {
    color: #79c0ff;
}

.sql-token-string {
    color: #f2cc60;
}

.sql-token-number {
    color: #f2cc60;
}

.sql-token-comment {
    color: #8b949e;
}

.sql-token-punctuation {
    color: #c9d1d9;
}

.control-admin-field input:focus,
.control-admin-field select:focus,
.control-admin-field textarea:focus {
    outline: none;
    border-color: rgba(44, 0, 152, 0.35);
    box-shadow: 0 0 0 3px rgba(44, 0, 152, 0.12);
}

.control-admin-field.has-error input,
.control-admin-field.has-error select,
.control-admin-field.has-error textarea {
    border-color: rgba(239, 66, 111, 0.65);
    background: rgba(255, 241, 242, 0.92);
}

.control-admin-field-error {
    margin: 0;
    color: #be123c;
    font-size: 0.85rem;
    line-height: 1.5;
}

.control-admin-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid rgba(44, 0, 152, 0.12);
    border-radius: 16px;
    background: rgba(248, 250, 252, 0.88);
    font-weight: 700;
}

.control-admin-checkbox input {
    width: 18px;
    height: 18px;
    min-height: auto;
    margin: 0;
}

.control-admin-form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.control-admin-form-actions .control-admin-delete-button {
    margin-left: auto;
}

.control-admin-delete-button {
    min-height: 46px;
    padding: 0 22px;
    border: 0;
    border-radius: 999px;
    color: #ffffff;
    background: linear-gradient(135deg, #ef426f, #be123c);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.control-admin-delete-button:hover,
.control-admin-delete-button:focus-visible {
    outline: none;
    filter: brightness(1.02);
    transform: translateY(-1px);
}

.detail-page {
    display: grid;
    gap: 24px;
    width: min(1720px, calc(100% - 32px));
    height: calc(100dvh - var(--header-offset) - var(--footer-offset) - 48px);
    min-height: 0;
}

.detail-hero-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.detail-hero-text,
.detail-card-text {
    margin: 12px 0 0;
    color: var(--text-soft);
    line-height: 1.7;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    gap: 24px;
    align-items: stretch;
    height: 100%;
    max-height: 100%;
    min-height: 0;
    overflow: hidden;
}

.detail-sidebar {
    display: flex;
    min-height: 0;
    max-height: 100%;
}

.detail-sidebar-inner {
    flex: 1;
    min-height: 0;
    max-height: 100%;
    overflow-y: auto;
    scrollbar-gutter: stable;
    padding: 24px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.84);
    box-shadow: var(--shadow);
    font-size: 0.94rem;
}

.detail-sidebar .detail-nav-group-header h3 {
    font-size: 0.98rem;
}

.detail-sidebar .theme-count {
    font-size: 0.82rem;
}

.detail-nav-group + .detail-nav-group {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(226, 232, 240, 0.9);
}

.detail-nav-group-header,
.detail-card-header,
.detail-pagination {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.detail-nav-group-header {
    margin-bottom: 14px;
}

.detail-nav-group-header h3,
.detail-card-header h3 {
    margin: 0;
}

.detail-nav-links {
    display: grid;
    gap: 10px;
}

.detail-nav-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.detail-nav-link {
    display: block;
    padding: 7px 16px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 18px;
    background: rgba(248, 250, 252, 0.88);
    transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.detail-nav-link:hover {
    border-color: rgba(44, 0, 152, 0.18);
    background: rgba(255, 255, 255, 0.98);
    transform: translateY(-1px);
}

.detail-nav-link.is-active {
    border-color: rgba(44, 0, 152, 0.22);
    background: rgba(44, 0, 152, 0.08);
}

.detail-nav-link-title {
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.4;
}

.detail-nav-info-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid rgba(44, 0, 152, 0.16);
    border-radius: 999px;
    background: rgba(44, 0, 152, 0.06);
    color: var(--brand-strong);
    font: inherit;
    font-size: 0.85rem;
    font-weight: 800;
    line-height: 1;
    cursor: help;
    transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.detail-nav-info-button:hover,
.detail-nav-info-button:focus-visible {
    border-color: rgba(44, 0, 152, 0.28);
    background: rgba(44, 0, 152, 0.12);
    transform: translateY(-1px);
    outline: none;
}

.detail-muted-cell {
    color: var(--text-soft);
}

.detail-card-meta,
.detail-hero-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.detail-meta-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    color: var(--brand-strong);
    background: rgba(44, 0, 152, 0.08);
    font-size: 0.84rem;
    font-weight: 700;
}

.detail-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    max-height: 100%;
    overflow-y: auto;
    scrollbar-gutter: stable;
}

.detail-card {
    display: grid;
    align-content: start;
    gap: 18px;
    min-height: 100%;
    overflow: hidden;
}

.detail-filter-bar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    align-items: start;
    padding: 18px 20px;
    border: 1px solid rgba(44, 0, 152, 0.12);
    border-radius: 22px;
    background: rgba(248, 250, 252, 0.92);
}

.detail-filter-summary {
    margin: 6px 0 0;
    color: var(--text-soft);
    font-size: 0.9rem;
    line-height: 1.5;
}

.detail-toolbar-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    padding: 18px 20px;
    border: 1px solid rgba(44, 0, 152, 0.12);
    border-radius: 22px;
    background: rgba(248, 250, 252, 0.92);
}

.detail-toolbar-info {
    display: grid;
    gap: 8px;
    align-content: start;
    min-width: 0;
}

.detail-toolbar-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px 14px;
    padding-left: 5px;
}

.detail-toolbar-title {
    margin: 0;
    color: var(--brand-strong);
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.3;
}

.detail-filter-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px 18px;
    align-items: start;
    min-width: 0;
}

.detail-filter-tools {
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
    align-self: center;
}

.detail-filter-primary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px 16px;
    min-width: 0;
}

.detail-filter-secondary {
    grid-column: 1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
    min-width: 0;
}

.detail-filter-field {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.detail-filter-actions {
    display: flex;
    flex-direction: column;
    gap: 0;
    align-items: stretch;
    justify-content: space-between;
    min-width: 140px;
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: stretch;
}

.detail-filter-actions .pagination-link {
    width: 100%;
    height: 34px;
    min-height: 34px;
    padding: 0 12px;
    line-height: 1;
}

.detail-action-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    width: 46px;
    min-width: 46px;
    padding: 0;
    border: 1px solid rgba(44, 0, 152, 0.16);
    border-radius: 999px;
    background: rgba(44, 0, 152, 0.08);
    color: var(--brand-strong);
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.detail-action-link:hover,
.detail-action-link:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(44, 0, 152, 0.24);
    background: rgba(44, 0, 152, 0.14);
    outline: none;
}

.detail-action-link.is-loading {
    pointer-events: none;
}

.detail-action-link.is-loading .detail-action-icon {
    opacity: 0;
}

.detail-action-icon {
    width: 18px;
    height: 18px;
    display: block;
    transition: opacity 0.2s ease;
}

.detail-action-spinner {
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(44, 0, 152, 0.22);
    border-top-color: currentColor;
    border-radius: 999px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.detail-action-link.is-loading .detail-action-spinner {
    opacity: 1;
    animation: detail-action-spin 0.72s linear infinite;
}

@keyframes detail-action-spin {
    to {
        transform: rotate(360deg);
    }
}

.detail-filter-select {
    position: relative;
    min-width: 0;
}

.detail-filter-label {
    color: var(--brand-strong);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.detail-filter-input {
    width: 100%;
    min-height: 34px;
    padding: 0 44px 0 16px;
    border: 1px solid rgba(44, 0, 152, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.98);
    color: var(--text-main);
    font: inherit;
    font-weight: 600;
    line-height: 1;
}

.detail-filter-select::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 18px;
    width: 10px;
    height: 10px;
    border-right: 2px solid rgba(31, 0, 109, 0.7);
    border-bottom: 2px solid rgba(31, 0, 109, 0.7);
    transform: translateY(-70%) rotate(45deg);
    pointer-events: none;
}

.detail-filter-input:focus {
    outline: none;
    border-color: rgba(44, 0, 152, 0.32);
    box-shadow: 0 0 0 3px rgba(44, 0, 152, 0.1);
}

.detail-filter-suggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 4;
    display: grid;
    gap: 8px;
    max-height: 320px;
    padding: 10px;
    overflow-y: auto;
    border: 1px solid rgba(44, 0, 152, 0.14);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.14);
}

.detail-filter-suggestions[hidden] {
    display: none;
}

.detail-filter-option {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(44, 0, 152, 0.14);
    border-radius: 14px;
    background: rgba(44, 0, 152, 0.06);
    color: var(--brand-strong);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.detail-filter-option:hover,
.detail-filter-option:focus-visible {
    border-color: rgba(44, 0, 152, 0.26);
    background: rgba(44, 0, 152, 0.12);
    transform: translateY(-1px);
    outline: none;
}

.detail-table-shell {
    flex: 1;
    min-height: 0;
    overflow-x: auto;
    overflow-y: auto;
    max-width: 100%;
    border: 1px solid rgba(44, 0, 152, 0.12);
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.94));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.detail-view-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    width: 46px;
    min-width: 46px;
    padding: 0;
    border: 1px solid rgba(44, 0, 152, 0.16);
    border-radius: 999px;
    background: rgba(44, 0, 152, 0.08);
    color: var(--brand-strong);
    font-weight: 700;
    text-decoration: none;
    box-shadow: none;
    transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.detail-view-toggle:hover,
.detail-view-toggle:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(44, 0, 152, 0.24);
    background: rgba(44, 0, 152, 0.14);
    outline: none;
}

.detail-view-toggle-icon {
    width: 18px;
    height: 18px;
    display: block;
}

@media (max-width: 1380px) {
    .detail-filter-actions {
        grid-column: 1 / -1;
        grid-row: auto;
        flex-direction: row;
        justify-content: flex-end;
        min-width: 0;
    }
}

@media (max-width: 1080px) {
    .detail-toolbar-row {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .detail-toolbar-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .detail-filter-tools {
        justify-content: flex-start;
    }

    .detail-filter-controls {
        grid-template-columns: 1fr;
    }

    .detail-filter-primary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .detail-filter-secondary,
    .detail-filter-actions {
        grid-column: auto;
    }

    .detail-filter-actions {
        grid-row: auto;
        justify-content: flex-start;
    }
}

.detail-graph-panel {
    padding: 18px;
}

.detail-graph-layout {
    display: grid;
    gap: 16px;
}

.detail-graph-head {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    padding: 0 0 14px;
    border-bottom: 2px dashed rgba(148, 163, 184, 0.35);
}

.detail-graph-total-head,
.detail-upset-category-head {
    color: var(--brand-strong);
    font-size: 0.95rem;
    font-weight: 800;
    text-align: center;
}

.detail-graph-total-head {
    text-align: left;
}

.detail-graph-categories {
    display: grid;
    grid-template-columns: repeat(var(--detail-upset-columns, 1), minmax(0, 1fr));
    align-items: center;
    gap: 0;
}

.detail-graph-rows {
    display: grid;
    gap: 12px;
}

.detail-graph-row-item {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    min-height: 56px;
}

.detail-upset-total {
    display: grid;
    gap: 4px;
    justify-items: start;
    color: var(--text-main);
    align-content: center;
}

.detail-upset-total em {
    color: var(--text-soft);
    font-size: 0.82rem;
    font-style: normal;
    font-weight: 700;
}

.detail-upset-total-values {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.detail-upset-total strong {
    font-size: 1.1rem;
    font-weight: 800;
}

.detail-upset-total span {
    color: var(--text-soft);
    font-size: 0.88rem;
}

.detail-upset-matrix {
    position: relative;
    display: grid;
    grid-template-columns: repeat(var(--detail-upset-columns, 1), minmax(0, 1fr));
    align-items: center;
    min-height: 56px;
    padding: 0 10px;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.92), rgba(241, 245, 249, 0.92));
}

.detail-upset-matrix::before {
    content: "";
    position: absolute;
    inset: 0 10px;
    background-image: linear-gradient(
        to right,
        transparent calc(50% - 0.5px),
        rgba(203, 213, 225, 0.7) calc(50% - 0.5px),
        rgba(203, 213, 225, 0.7) calc(50% + 0.5px),
        transparent calc(50% + 0.5px)
    );
    background-size: calc(100% / var(--detail-upset-columns, 1)) 100%;
    background-repeat: repeat-x;
    opacity: 0.8;
}

.detail-upset-cell {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.detail-upset-bar {
    position: absolute;
    top: 6px;
    bottom: 6px;
    z-index: 1;
    box-sizing: border-box;
    border: 2px solid var(--brand-noir);
    border-radius: 6px;
    background: var(--brand-rouge);
}

.detail-upset-bar.is-inactive {
    background: var(--brand-vert);
}

.detail-upset-dot {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid var(--brand-vert);
    border-radius: 999px;
    background: var(--brand-vert);
}

.detail-upset-dot.is-active {
    border-color: var(--brand-rouge);
    background: var(--brand-rouge);
}

.detail-upset-connector {
    position: absolute;
    top: 50%;
    z-index: 2;
    height: 0;
    border-top: 2px dashed #94a3b8;
    transform: translateY(-50%);
}

.detail-controls-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
    background: transparent;
}

.detail-controls-table thead {
    background: linear-gradient(135deg, rgba(44, 0, 152, 0.1), rgba(0, 178, 169, 0.08));
}

.detail-controls-table th,
.detail-controls-table td {
    padding: 6px 16px;
    text-align: left;
    white-space: nowrap;
    vertical-align: middle;
}

.detail-controls-table th {
    color: var(--brand-strong);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.detail-controls-table tbody tr + tr td {
    border-top: 1px solid rgba(226, 232, 240, 0.9);
}

.detail-controls-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.72);
}

.detail-controls-table th:nth-child(1),
.detail-controls-table td:nth-child(1) {
    width: 84px;
}

.detail-controls-table th:nth-child(2),
.detail-controls-table td:nth-child(2),
.detail-controls-table th:nth-child(3),
.detail-controls-table td:nth-child(3) {
    min-width: 220px;
    white-space: normal;
}

.detail-controls-table th:nth-child(n + 4),
.detail-controls-table td:nth-child(n + 4) {
    min-width: 140px;
    white-space: normal;
}

.detail-controls-table td[colspan] {
    text-align: center;
    color: var(--text-soft);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 68px;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
}

.status-pill.is-ok {
    color: #047857;
    background: #ecfdf5;
}

.status-pill.is-nok {
    color: #be123c;
    background: #fff1f2;
}

.status-pill.is-neutral {
    color: #475569;
    background: #f8fafc;
}

.detail-pagination {
    align-items: center;
    flex-shrink: 0;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 108px;
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 999px;
    background: #ffffff;
    color: var(--brand-strong);
    font: inherit;
    font-weight: 700;
    text-decoration: none;
}

.pagination-link.is-disabled {
    color: var(--text-soft);
    background: #f8fafc;
}

.pagination-current {
    color: var(--text-soft);
    font-weight: 700;
}

.detail-unavailable {
    padding: 22px;
    margin: 0;
}

.theme-sections {
    display: grid;
    gap: 20px;
}

.theme-card,
.message-card {
    padding: 14px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.84);
    box-shadow: var(--shadow);
}

.theme-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.theme-card-header h3 {
    margin: 0;
}

.section-kicker {
    margin: 0;
    color: var(--brand);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.theme-count {
    flex-shrink: 0;
    padding: 5px 14px;
    border-radius: 999px;
    color: var(--brand-strong);
    background: rgba(44, 0, 152, 0.08);
    font-size: 0.9rem;
    font-weight: 700;
}

.table-shell {
    overflow-x: auto;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 18px;
}

.controls-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.76);
}

.theme-card .controls-table {
    table-layout: fixed;
}

.controls-table th,
.controls-table td {
    padding: 8px 18px;
    text-align: left;
    white-space: nowrap;
}

.theme-card .controls-table th:nth-child(1),
.theme-card .controls-table td:nth-child(1) {
    width: 24%;
    white-space: normal;
}

.theme-card .controls-table th:nth-child(2),
.theme-card .controls-table td:nth-child(2),
.theme-card .controls-table th:nth-child(3),
.theme-card .controls-table td:nth-child(3),
.theme-card .controls-table th:nth-child(4),
.theme-card .controls-table td:nth-child(4) {
    width: 10%;
    text-align: center;
}

.theme-card .controls-table th:nth-child(5),
.theme-card .controls-table td:nth-child(5) {
    width: 16%;
    text-align: center;
    white-space: normal;
}

.theme-card .controls-table th:nth-child(6),
.theme-card .controls-table td:nth-child(6) {
    width: 18%;
}

.theme-card .controls-table th:nth-child(7),
.theme-card .controls-table td:nth-child(7) {
    width: 12%;
    text-align: center;
}

.controls-table thead {
    background: rgba(44, 0, 152, 0.08);
}

.controls-table th {
    color: var(--brand-strong);
    font-size: 0.9rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.controls-table tbody tr + tr td {
    border-top: 1px solid rgba(226, 232, 240, 0.9);
}

.controls-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.9);
}

.table-progress {
    display: flex;
    min-width: 180px;
    width: 100%;
    max-width: 240px;
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(226, 232, 240, 0.9);
}

.table-progress-segment {
    display: block;
    height: 100%;
}

.suivi-trigger,
.drawer-close {
    cursor: pointer;
    border: 0;
}

.suivi-trigger {
    padding: 10px 16px;
    border-radius: 999px;
    color: var(--brand-contrast);
    background: linear-gradient(135deg, var(--brand), var(--brand-strong));
    font-size: 0.9rem;
    font-weight: 700;
}

.suivi-drawer-backdrop {
    position: fixed;
    top: var(--header-offset);
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 9;
    background: rgba(0, 0, 0, 0.32);
}

.suivi-drawer {
    position: fixed;
    top: var(--header-offset);
    right: 0;
    z-index: 9;
    width: min(720px, 100vw);
    height: calc(100vh - var(--header-offset));
    padding: 24px;
    background: #fbfcfe;
    box-shadow: -24px 0 48px rgba(0, 0, 0, 0.14);
    transform: translateX(100%);
    transition: transform 0.24s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

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

.suivi-drawer-header,
.drawer-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.suivi-drawer-header {
    margin-bottom: 20px;
}

.drawer-close {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    color: var(--text);
    background: rgba(44, 0, 152, 0.08);
    font-size: 1.6rem;
    line-height: 1;
}

.suivi-drawer-body {
    display: grid;
    gap: 20px;
}

.drawer-subtitle {
    margin: 10px 0 0;
    color: var(--text-soft);
    line-height: 1.6;
}

.drawer-stats {
    display: grid;
    gap: 10px;
}

.stat-card {
    min-width: 0;
    padding: 16px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 20px;
    background: #ffffff;
}

.stat-card span {
    display: block;
    margin-bottom: 8px;
    color: var(--text-soft);
    font-size: 0.85rem;
}

.stat-card strong {
    display: block;
    min-width: 0;
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    overflow-wrap: anywhere;
}

.analysis-card {
    padding: 18px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 24px;
    background: #ffffff;
}

.analysis-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.analysis-header h3 {
    margin: 8px 0 0;
    font-size: 1.2rem;
}

.analysis-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    white-space: normal;
    text-align: center;
}

.analysis-text {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.7;
}

.analysis-text strong {
    color: var(--text-main);
}

.preco-none {
    color: #006b65;
    background: rgba(0, 178, 169, 0.14);
}

.preco-strike {
    color: #c82a56;
    background: rgba(239, 66, 111, 0.14);
}

.preco-critical { 
    background: #fff7ed; 
    color: #c2410c; 
    border-color: #f8c996; }

.preco-mixed {
    background: #fff7ed;
    color: #9a3412;
    border-color: #fed7aa;
}

.preco-medium {
    color: #1d4ed8;
    background: #eff6ff;
    border-color: #d1e4fb;
}

.preco-good,
.preco-systemic,
.preco-wide {
    color: #2c0098;
    background: rgba(44, 0, 152, 0.1);
}

.drawer-section h3 {
    margin: 0 0 16px;
    font-size: 1.15rem;
}

.mini-chart-card {
    margin-bottom: 18px;
    padding: 16px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 20px;
    background: #ffffff;
}

.mini-chart-head {
    margin-bottom: 14px;
}

.mini-chart-caption {
    margin: 8px 0 0;
    color: var(--text-soft);
}

.mini-chart {
    display: grid;
    gap: 12px;
}

.mini-chart-row {
    display: grid;
    grid-template-columns: minmax(120px, 150px) minmax(80px, 1fr) auto;
    align-items: center;
    gap: 10px;
}

.mini-chart-label-wrap {
    min-width: 0;
}

.mini-chart-track {
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(226, 232, 240, 0.9);
}

.mini-chart-bar {
    display: block;
    height: 100%;
    border-radius: 999px;
}

.mini-chart-value {
    font-weight: 700;
    white-space: normal;
    text-align: right;
}

.mini-chart-empty {
    margin: 0;
    color: var(--text-soft);
}

.vertical-chart {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: end;
    gap: 12px;
}

/* Volume Section Styles */
.volume-section {
    --dashboard-accent: #102a43;
    --dashboard-accent-soft: rgba(44, 0, 152, 0.1);
    --dashboard-accent-glow: rgba(16, 42, 67, 0.14);
    margin-top: 24px;
    margin-bottom: 24px;
    padding-top: 18px;
    padding-bottom: 18px;

    border-radius: 30px;

}

.section-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 22px;
    text-align: center;
}

.dashboard-snap-section .section-title {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    color: var(--dashboard-accent, var(--brand-strong));
}

.dashboard-snap-section .section-title::before,
.dashboard-snap-section .section-title::after {
    content: "";
    width: 56px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        var(--dashboard-accent-soft, rgba(44, 0, 152, 0.16)) 20%,
        var(--dashboard-accent, #102a43) 100%
    );
}

.volume-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}

.volume-card {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    min-height: auto;
}

.volume-card:hover {
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.14);
    transform: translateY(-4px);
}

.volume-card:nth-child(1) {
    border-color: rgba(0, 178, 169, 0.2);
}

.volume-card:nth-child(1) .card-header {
    background: linear-gradient(135deg, #0f766e 0%, var(--brand-vert) 100%);
}

.volume-card:nth-child(1) .progress-fill {
    background: linear-gradient(90deg, #5eead4 0%, var(--brand-vert) 100%);
}

.volume-card:nth-child(2) {
    border-color: rgba(59, 130, 246, 0.22);
}

.volume-card:nth-child(2) .card-header {
    background: linear-gradient(135deg, #1d4ed8 0%, var(--brand-bleu) 100%);
}

.volume-card:nth-child(2) .progress-fill {
    background: linear-gradient(90deg, #93c5fd 0%, var(--brand-bleu) 100%);
}

.volume-card:nth-child(3) {
    border-color: rgba(44, 0, 152, 0.22);
}

.volume-card:nth-child(3) .card-header {
    background: linear-gradient(135deg, var(--brand-custom) 0%, var(--brand-strong) 100%);
}

.volume-card:nth-child(3) .progress-fill {
    background: linear-gradient(90deg, #8b5cf6 0%, var(--brand-custom) 100%);
}

.volume-card.empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    opacity: 0.6;
}

.card-header {
    background: linear-gradient(135deg, var(--brand-custom) 0%, var(--brand-strong) 100%);
    color: var(--brand-blanc);
    padding: 16px 18px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.referential-name {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.badge-primary {
    background: rgba(255, 255, 255, 0.25);
    color: var(--brand-blanc);
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    white-space: nowrap;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.badge-label {
    font-size: 12px;
    font-weight: 600;
    opacity: 0.9;
}

.badge-value {
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
}

.card-body {
    padding: 16px;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 18px;
    margin-bottom: 10px;
}

.metric-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--surface-muted);
}

.metric-item:last-of-type {
    border-bottom: none;
}

.metric-item.completion-rate {
    margin-top: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--surface-muted);
    padding-bottom: 10px;
    font-weight: 600;
    grid-column: 1 / -1;
}

.metric-label {
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 500;
}

.metric-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.metric-success {
    color: var(--brand-vert);
    font-size: 18px;
    font-weight: 700;
}

.metric-danger {
    color: var(--brand-rouge);
    font-size: 18px;
    font-weight: 700;
}

.metric-percentage {
    color: var(--brand-custom);
    font-size: 20px;
    font-weight: 700;
}

.progress-group {
    margin-top: 10px;
}

.progress-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.progress-meter {
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-bar {
    flex: 1;
    height: 10px;
    background: rgba(15, 23, 42, 0.06);
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--brand-custom) 0%, var(--brand-vert) 100%);
    border-radius: 999px;
}

/* Trend Section Styles */
.trend-section {
    --dashboard-accent: #102a43;
    --dashboard-accent-soft: rgba(44, 0, 152, 0.1);
    --dashboard-accent-glow: rgba(16, 42, 67, 0.16);
    margin-top: 32px;
    margin-bottom: 24px;
    padding-top: 18px;
    padding-bottom: 18px;
    border-radius: 30px;
}

.trend-stack {
    display: grid;
    gap: 16px;
}

.trend-card {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

.trend-chart-card {
    align-content: start;
}

.trend-chart-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
}

.trend-card-copy {
    min-width: 0;
}

.trend-card-title {
    margin: 0;
    color: #102a43;
    font-size: 1.05rem;
}

.trend-card-text {
    margin: 6px 0 0;
    max-width: 62ch;
    color: var(--text-soft);
    font-size: 0.92rem;
    line-height: 1.45;
}

.trend-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.trend-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 11px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 999px;
    background: rgba(239, 246, 255, 0.84);
    color: var(--text-main);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.trend-badge:hover,
.trend-badge:focus-visible,
.trend-summary-card:hover,
.trend-summary-card:focus-visible {
    transform: translateY(-1px);
}

.trend-badge:focus-visible,
.trend-summary-card:focus-visible {
    outline: 2px solid rgba(44, 0, 152, 0.22);
    outline-offset: 2px;
}

.trend-badge-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    flex-shrink: 0;
}

.trend-chart-layout {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 12px;
    align-items: stretch;
}

.trend-y-axis {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2px 0 28px;
    color: var(--text-soft);
    font-size: 0.74rem;
    font-weight: 700;
    text-align: right;
}

.trend-chart-shell {
    display: grid;
    gap: 6px;
    min-width: 0;
    position: relative;
}

.trend-chart-svg {
    width: 100%;
    height: auto;
    overflow: visible;
    max-height: 320px;
    padding: 10px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgba(59, 130, 246, 0.06), rgba(44, 0, 152, 0.03)),
        rgba(248, 250, 252, 0.96);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.trend-hover-line {
    cursor: pointer;
}

.trend-hover-tooltip {
    position: absolute;
    z-index: 3;
    max-width: 180px;
    padding: 7px 9px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.94);
    color: #ffffff;
    font-size: 0.76rem;
    line-height: 1.4;
    pointer-events: none;
    transform: translate(-50%, -100%);
    opacity: 0;
    transition: opacity 0.14s ease;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

.trend-hover-tooltip strong {
    display: block;
    margin-bottom: 2px;
    font-size: 0.79rem;
}

.trend-hover-tooltip.is-visible {
    opacity: 1;
}

.trend-grid-line {
    stroke: rgba(100, 116, 139, 0.5);
    stroke-dasharray: 8 8;
    stroke-width: 1;
}

.trend-x-axis {
    display: grid;
    gap: 4px;
    color: var(--text-soft);
    font-size: 0.7rem;
    font-weight: 700;
    text-align: center;
}

.trend-x-axis span {
    display: grid;
    justify-items: center;
    gap: 4px;
    min-height: 1em;
}

.trend-x-axis span em {
    font-style: normal;
}

.trend-x-tick {
    display: block;
    width: 1px;
    height: 8px;
    background: rgba(100, 116, 139, 0.7);
    border-radius: 999px;
}

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

.trend-summary-card {
    display: grid;
    gap: 10px;
    padding: 12px 13px;
    border: 1px solid color-mix(in srgb, var(--trend-accent, var(--brand-custom)) 28%, white);
    border-radius: 14px;
    background: color-mix(in srgb, var(--trend-accent, var(--brand-custom)) 8%, white);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--trend-accent, var(--brand-custom)) 10%, white);
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.trend-badge.is-inactive,
.trend-summary-card.is-inactive {
    opacity: 0.45;
}

.trend-summary-card.is-inactive {
    background: rgba(248, 250, 252, 0.72);
    border-color: rgba(203, 213, 225, 0.9);
    box-shadow: none;
}

.trend-summary-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.trend-summary-name {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    font-size: 0.92rem;
    color: var(--trend-accent, var(--brand-strong));
}

.trend-summary-pill {
    padding: 5px 9px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--trend-accent, var(--brand-custom)) 24%, white);
    background: rgba(255, 255, 255, 0.96);
    font-size: 0.76rem;
    font-weight: 800;
    white-space: nowrap;
}

.trend-summary-values {
    display: grid;
    gap: 4px;
    color: color-mix(in srgb, var(--trend-accent, var(--text-soft)) 52%, #334155);
    font-size: 0.83rem;
}

.trend-summary-values strong {
    color: var(--trend-accent, var(--text-main));
}

/* SRO Section Styles */
.sro-section {
    --dashboard-accent: #102a43;
    --dashboard-accent-soft: rgba(44, 0, 152, 0.1);
    --dashboard-accent-glow: rgba(16, 42, 67, 0.16);
    margin-top: 32px;
    margin-bottom: 24px;
    padding-top: 18px;
    padding-bottom: 18px;
    border-radius: 30px;
}

body.dashboard-wheel-snap .volume-section,
body.dashboard-wheel-snap .trend-section,
body.dashboard-wheel-snap .sro-section {
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 28px;
    padding-bottom: 28px;
    overflow: hidden;
}

.sro-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}

@media (min-width: 1280px) {
    .sro-cards {
        grid-template-columns: minmax(280px, 0.9fr) minmax(520px, 1.45fr) minmax(280px, 0.9fr);
        align-items: stretch;
    }
}

.sro-card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.sro-card-header-compact {
    padding: 10px 14px;
}

.sro-card-title-compact {
    margin: 0;
    font-size: 15px;
    line-height: 1.2;
}

.sro-card:hover {
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.14);
    transform: translateY(-4px);
}

.sro-card:nth-child(1) {
    border-color: rgba(0, 178, 169, 0.2);
}

.sro-card:nth-child(1) .sro-card-header {
    background: linear-gradient(135deg, #0f766e 0%, var(--brand-vert) 100%);
}

.sro-card:nth-child(2) {
    border-color: rgba(59, 130, 246, 0.2);
}

.sro-card:nth-child(2) .sro-card-header {
    background: linear-gradient(135deg, var(--brand-custom) 0%, var(--brand-bleu) 100%);
}

.sro-card:nth-child(3) {
    border-color: rgba(239, 66, 111, 0.22);
}

.sro-card:nth-child(3) .sro-card-header {
    background: linear-gradient(135deg, var(--brand-orange) 0%, var(--brand-rouge) 100%);
}

.sro-card.empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    opacity: 0.6;
}

.sro-card-header {
    background: linear-gradient(135deg, var(--brand-custom) 0%, var(--brand-strong) 100%);
    color: var(--brand-blanc);
    padding: 16px 18px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

.sro-card-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.sro-ranking {
    display: grid;
    gap: 6px;
    padding: 10px;
}

.ranking-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 7px;
    align-items: center;
    padding: 6px 8px;
    background: rgba(248, 250, 252, 0.88);
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.ranking-item:hover {
    background: rgba(255, 255, 255, 0.96);
    border-color: rgba(44, 0, 152, 0.16);
}

.ranking-item.is-active {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(44, 0, 152, 0.34);
    box-shadow: inset 0 0 0 1px rgba(44, 0, 152, 0.08);
}

.ranking-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    width: 24px;
    height: 24px;
    border-radius: 5px;
    background: linear-gradient(135deg, var(--brand-custom) 0%, var(--brand-strong) 100%);
    color: white;
    font-weight: 700;
    font-size: 11px;
}

.sro-card:nth-child(1) .ranking-item.is-active {
    border-color: rgba(0, 178, 169, 0.34);
    box-shadow: inset 0 0 0 1px rgba(0, 178, 169, 0.1);
}

.sro-card:nth-child(1) .ranking-badge {
    background: linear-gradient(135deg, #0f766e 0%, var(--brand-vert) 100%);
}

.sro-card:nth-child(2) .ranking-item.is-active {
    border-color: rgba(59, 130, 246, 0.34);
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.1);
}

.sro-card:nth-child(3) .ranking-item.is-active {
    border-color: rgba(239, 66, 111, 0.34);
    box-shadow: inset 0 0 0 1px rgba(239, 66, 111, 0.1);
}

.ranking-badge.ranking-danger {
    color: var(--brand-blanc);
}

.ranking-content {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.ranking-name {
    font-weight: 600;
    font-size: 11px;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ranking-subname {
    font-size: 10px;
    color: var(--text-soft);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ranking-value {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-soft);
}

.ranking-bar {
    height: 6px;
    border-radius: 6px;
    transition: width 0.3s ease;
}

.ranking-danger {
    color: var(--brand-rouge);
    background: rgba(239, 66, 111, 0.1);
}

.ranking-danger-fill {
    color: var(--brand-rouge);
}

.sro-map-shell {
    position: relative;
    width: 100%;
    height: 100%;
}

.sro-map-legend {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 500;
    display: grid;
    gap: 6px;
    min-width: 132px;
    padding: 10px 12px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(8px);
}

.sro-map-legend-title {
    font-size: 11px;
    font-weight: 800;
    color: var(--brand-strong);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sro-map-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text);
}

.sro-map-legend-swatch {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    flex-shrink: 0;
}

.sro-map-legend-swatch.is-green {
    background: var(--brand-vert);
}

.sro-map-legend-swatch.is-blue {
    background: var(--brand-bleu);
}

.sro-map-legend-swatch.is-orange {
    background: var(--brand-orange);
}

.sro-map-legend-swatch.is-red {
    background: var(--brand-rouge);
}

.progress-value {
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
}

.theme-details {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--surface-muted);
}

.theme-details h4 {
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.theme-row {
    display: grid;
    grid-template-columns: minmax(140px, 1fr) repeat(4, minmax(50px, auto));
    gap: 12px;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
    color: var(--text);
}

.theme-row-header {
    font-weight: 700;
    color: var(--text-soft);
    border-bottom: 1px solid var(--surface-muted);
    padding-bottom: 10px;
}

.theme-row + .theme-row {
    border-top: 1px solid var(--surface-muted);
}

.theme-success {
    color: var(--brand-vert);
    font-weight: 700;
}

.theme-danger {
    color: var(--brand-rouge);
    font-weight: 700;
}

.no-data {
    text-align: center;
    color: var(--text-soft);
    margin: 0;
    font-size: 14px;
}

.vertical-bar-item {
    display: grid;
    justify-items: center;
    grid-template-rows: auto 1fr auto;
    gap: 10px;
    min-width: 0;
    height: 100%;
    padding: 14px 10px 12px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.88);
}

.vertical-bar-values {
    display: grid;
    gap: 4px;
    width: 100%;
}

.vertical-bar-value {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-main);
    text-align: center;
    overflow-wrap: anywhere;
}

.vertical-bar-value.is-controles {
    color: var(--brand-gris);
}

.vertical-bar-value.is-anomalies.b-q1 {
    color: var(--q1-color);
    background: white;
    font-weight:700;
}

.vertical-bar-value.is-anomalies.b-q2 {
    color: var(--q2-color);
    background: white;
    font-weight:700;
}

.vertical-bar-value.is-anomalies.b-q3 {
    color: var(--q3-color);
    background: white;
    font-weight:700;
}

.vertical-bar-value.is-anomalies.b-q4 {
    color: var(--q4-color);
    background: white;
    font-weight:700;
}

.vertical-bar-value.is-anomalies.bar-total {
    color: var(--brand-gris);
}

.vertical-bar-track-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
    gap: 8px;
    width: 100%;
    min-height: 170px;
    height: 100%;
    padding: 0 4px;
}

.vertical-bar-track {
    display: flex;
    align-items: end;
    justify-content: center;
    width: 100%;
    min-height: 170px;
    height: 100%;
    padding: 0 4px;
    background: transparent;
}

.vertical-bar-track.is-controles {
    background: transparent;
}

.vertical-bar {
    display: block;
    width: 100%;
    max-width: 56px;
    min-height: 0;
    border-radius: 14px 14px 8px 8px;
}

.vertical-bar.is-controles.b-q1 {
    background: linear-gradient(180deg, #c4c9d1, var(--brand-gris));
}

.vertical-bar.is-controles.b-q2 {
    background: linear-gradient(180deg, #c4c9d1, var(--brand-gris));
}

.vertical-bar.is-controles.b-q3 {
    background: linear-gradient(180deg, #c4c9d1, var(--brand-gris));
}

.vertical-bar.is-controles.b-q4 {
    background: linear-gradient(180deg, #c4c9d1, var(--brand-gris));
}

.vertical-bar.b-q1 {
    background: linear-gradient(180deg, #36d1c9, var(--q1-color));
}

.vertical-bar.b-q2 {
    background: linear-gradient(180deg, #5f2cff, var(--q2-color));
}

.vertical-bar.b-q3 {
    background: linear-gradient(180deg, #ffad4d, var(--q3-color));
}

.vertical-bar.b-q4 {
    background: linear-gradient(180deg, #ff7f9f, var(--q4-color));
}

.vertical-bar.bar-total {
    background: linear-gradient(180deg, #4b5563, #111827);
}

.vertical-bar.is-controles.bar-total {
    background: linear-gradient(180deg, #c4c9d1, var(--brand-gris));
}

.vertical-bar-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-align: center;
    overflow-wrap: anywhere;
}

.vertical-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
    color: var(--text-soft);
    font-size: 0.82rem;
}

.vertical-chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.legend-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: #111827;
}

.legend-swatch.is-anomalies {
    background: linear-gradient(180deg, #ff7f9f, var(--q4-color));
}

.legend-swatch.is-controles {
    background: linear-gradient(180deg, #c4c9d1, var(--brand-gris));
}

.quartile-badge {
    display: inline-flex;
    align-items: center;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: normal;
}

.b-q1 {
    color: white;
    background: var(--brand-vert);
}

.b-q2 {
    color: white;
    background: var(--brand-custom);
}

.b-q3 {
    color: white;
    background: var(--brand-orange);
}

.b-q4 {
    color: white;
    background: var(--brand-rouge);
}

.mini-chart-bar.b-q1 {
    background: linear-gradient(90deg, #36d1c9, var(--q1-color));
}

.mini-chart-bar.b-q2 {
    background: linear-gradient(90deg, #5f2cff, var(--q2-color));
}

.mini-chart-bar.b-q3 {
    background: linear-gradient(90deg, #ffad4d, var(--q3-color));
}

.mini-chart-bar.b-q4 {
    background: linear-gradient(90deg, #ff7f9f, var(--q4-color));
}

.drawer-table td[colspan] {
    text-align: center;
    color: var(--text-soft);
}

.suivi-drawer .table-shell {
    overflow-x: auto;
}

.suivi-drawer .controls-table {
    table-layout: fixed;
}

.suivi-drawer .controls-table th,
.suivi-drawer .controls-table td {
    padding: 12px 10px;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
    vertical-align: middle;
}

.suivi-drawer .controls-table th:nth-child(1),
.suivi-drawer .controls-table td:nth-child(1) {
    width: 35%;
    text-align: left;
}

.suivi-drawer .controls-table th:nth-child(2),
.suivi-drawer .controls-table td:nth-child(2) {
    width: 25%;
}

.suivi-drawer .controls-table th:nth-child(3),
.suivi-drawer .controls-table td:nth-child(3) {
    width: 20%;
}

.suivi-drawer .controls-table th:nth-child(4),
.suivi-drawer .controls-table td:nth-child(4) {
    width: 20%;
}

.site-footer {
    border-top: 1px solid rgba(226, 232, 240, 0.9);
    background: rgba(255, 255, 255, 0.72);
}

.footer-content {
    color: var(--text-soft);
    font-size: 0.95rem;
}

@media (max-width: 720px) {
    .navbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .hero {
        padding: 28px;
        border-radius: 20px;
    }

    .hero-heading-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-filters {
        padding: 18px;
        border-radius: 18px;
    }

    .dashboard-filters-grid,
    .filter-primary-group,
    .filter-actions {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-filters-summary {
        white-space: normal;
    }

    .updates-section-header {
        flex-direction: column;
        display: flex;
        align-items: stretch;
    }

    .updates-section-layout {
        grid-template-columns: 1fr;
    }

    .updates-section-actions {
        justify-content: flex-start;
        min-width: 0;
        flex-wrap: wrap;
    }

    .updates-section-actions > * {
        flex: 1 1 auto;
    }

    .updates-select-shell {
        min-width: 0;
    }

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

    .theme-card,
    .message-card {
        padding: 22px;
        border-radius: 20px;
    }

    .control-admin-hero,
    .control-admin-hero-top,
    .control-admin-layout,
    .theme-card-header {
        flex-direction: column;
    }

    .theme-count {
        align-self: flex-start;
    }

    .control-admin-layout,
    .detail-hero-row,
    .detail-layout,
    .detail-filter-bar,
    .detail-nav-group-header,
    .detail-card-header,
    .detail-pagination {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: stretch;
    }

    .detail-page {
        height: auto;
        min-height: auto;
    }

    .control-admin-hero-top {
        grid-template-columns: 1fr;
    }

    .control-admin-sidebar-inner {
        max-height: none;
        padding: 22px;
        border-radius: 20px;
    }

    .control-admin-meta-grid,
    .control-admin-form-grid,
    .detail-filter-controls {
        grid-template-columns: 1fr;
    }

    .control-admin-hero-stats {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 5px;
    }

    .control-admin-hero-stats .stat-card {
        padding: 8px 6px;
    }

    .control-admin-hero-stats .stat-card span,
    .control-admin-hero-stats .stat-card strong {
        text-align: center;
    }

    .detail-filter-primary,
    .detail-filter-secondary {
        grid-template-columns: 1fr;
    }

    .detail-layout {
        min-height: auto;
        overflow: visible;
    }

    .detail-sidebar {
        position: static;
        display: block;
    }

    .detail-sidebar-inner {
        min-height: auto;
        overflow: visible;
        padding: 22px;
        border-radius: 20px;
    }

    .detail-main {
        min-height: auto;
        overflow: visible;
    }

    .detail-card-meta,
    .detail-hero-meta {
        justify-content: flex-start;
    }

    .suivi-drawer {
        width: 100vw;
        padding: 22px;
    }

    .drawer-stats {
        grid-template-columns: 1fr;
    }

    .analysis-header {
        flex-direction: column;
    }

    .mini-chart-row {
        grid-template-columns: 1fr;
    }

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

    .trend-chart-card-header {
        flex-direction: column;
    }

    .trend-badges {
        justify-content: flex-start;
    }

    .trend-chart-layout {
        grid-template-columns: 1fr;
    }

    .trend-y-axis {
        display: none;
    }

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

    .suivi-drawer .controls-table {
        table-layout: auto;
    }

    .suivi-drawer .controls-table th,
    .suivi-drawer .controls-table td {
        width: auto;
    }
}
