/* Role-oriented workspace layer: pilotage, ledgers, studios and control rooms. */
:root {
    --workspace-bg: #edf3f1;
    --workspace-paper: #ffffff;
    --workspace-paper-soft: #f7faf9;
    --workspace-ink: #12353d;
    --workspace-muted: #667c81;
    --workspace-line: #d8e3df;
    --workspace-teal: #176b66;
    --workspace-teal-dark: #103f46;
    --workspace-orange: #ea8b2d;
    --workspace-shadow: 0 8px 24px rgba(17, 55, 61, 0.055);
    --workspace-radius: 16px;
}

html {
    background: var(--workspace-bg);
}

body {
    color: var(--workspace-ink);
    background:
        radial-gradient(circle at 90% 2%, rgba(235, 139, 45, 0.08), transparent 24rem),
        linear-gradient(145deg, #f4f8f6 0%, var(--workspace-bg) 58%, #eef4f2 100%);
}

.main-content {
    min-width: 0;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 80;
    min-height: 68px;
    padding-block: 10px;
    border-bottom: 1px solid rgba(16, 63, 70, 0.1);
    background: rgba(249, 251, 250, 0.94);
    box-shadow: 0 8px 24px rgba(13, 51, 61, 0.045);
    backdrop-filter: blur(16px);
}

.topbar .eyebrow {
    margin-bottom: 2px;
    font-size: 0.72rem;
    letter-spacing: 0.15em;
}

.topbar h1 {
    font-size: clamp(1.28rem, 1.8vw, 1.65rem);
}

.topbar-actions {
    gap: 8px;
}

.topbar-search-trigger,
.topbar-icon-link,
.school-chip,
.topbar-logout-link {
    min-height: 40px;
    border-color: var(--workspace-line);
    box-shadow: 0 4px 12px rgba(18, 53, 61, 0.035);
}

.main-content > .messages,
.main-content > section,
.main-content > div,
.main-content > nav {
    scroll-margin-top: 86px;
}

.section-card,
.hero,
.photographer-page-brief,
.quote-hub-panel,
.quote-ledger-shell {
    border-color: var(--workspace-line);
    border-radius: var(--workspace-radius);
    box-shadow: var(--workspace-shadow);
}

.section-card {
    padding: 18px;
}

.section-head {
    gap: 12px;
    margin-bottom: 13px;
}

.section-head h2,
.section-head h3,
.section-head h4 {
    line-height: 1.15;
}

.photographer-page-brief,
.hero.compact,
.quote-hub-panel,
.production-hero-compact {
    min-height: 0;
    padding: 18px 20px;
}

.photographer-page-brief h2,
.hero.compact h2,
.quote-hub-head h2,
.production-hero h2 {
    font-size: clamp(1.45rem, 2.1vw, 2rem);
    line-height: 1.08;
}

.stat-grid,
.quote-state-strip,
.production-kpis,
.account-v2-metrics {
    gap: 10px;
}

.stat-card,
.quote-state-pill,
.production-kpis article,
.account-v2-metrics article {
    min-height: 92px;
    padding: 14px 16px;
    border-radius: 14px;
    box-shadow: none;
}

.stat-card strong,
.quote-state-pill strong,
.production-kpis strong,
.account-v2-metrics strong {
    line-height: 1;
}

.page-anchor-nav,
.account-v2-tabs,
.campaign-tab-row,
.production-page-nav {
    position: sticky;
    top: 76px;
    z-index: 35;
    border-color: var(--workspace-line);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 7px 20px rgba(17, 55, 61, 0.055);
    backdrop-filter: blur(14px);
}

.page-anchor-nav a,
.account-v2-tabs a,
.campaign-tab-row a,
.production-page-nav a {
    min-height: 40px;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 850;
}

/* Dense ledger pages. */
body:is(
    [data-page="history"],
    [data-page="active_campaign"],
    [data-page="orders"],
    [data-page="shipments"],
    [data-page="quotes"],
    [data-page="schools"],
    [data-page="billing"],
    [data-page="education_nationale_api"],
    [data-page="product_templates"],
    [data-page="pouch_templates"]
) .main-content {
    --radius: 14px;
}

body:is(
    [data-page="history"],
    [data-page="active_campaign"],
    [data-page="orders"],
    [data-page="shipments"],
    [data-page="quotes"],
    [data-page="schools"],
    [data-page="billing"],
    [data-page="education_nationale_api"]
) .quote-ledger-shell,
body:is(
    [data-page="history"],
    [data-page="active_campaign"],
    [data-page="orders"],
    [data-page="shipments"],
    [data-page="quotes"],
    [data-page="schools"],
    [data-page="billing"],
    [data-page="education_nationale_api"]
) .section-card {
    padding: 15px 17px;
}

.quote-ledger-filters,
.orders-ledger-filters,
.billing-inline-filters,
.billing-filter-grid,
.education-api-filter-form,
.campaign-register-filter-form,
.schools-filter-form {
    gap: 8px !important;
    padding: 11px !important;
    border: 1px solid var(--workspace-line);
    border-radius: 13px;
    background: var(--workspace-paper-soft);
}

.quote-ledger-filters .form-field > span,
.orders-ledger-filters .form-field > span,
.billing-inline-filters .form-field > span,
.billing-filter-grid .form-field > span,
.education-api-filter-form .form-field > span {
    margin-bottom: 4px;
    font-size: 0.72rem;
}

.quote-ledger-filters input,
.quote-ledger-filters select,
.orders-ledger-filters input,
.orders-ledger-filters select,
.billing-inline-filters input,
.billing-inline-filters select,
.billing-filter-grid input,
.billing-filter-grid select,
.education-api-filter-form input,
.education-api-filter-form select {
    min-height: 39px;
}

.table-wrap,
.quote-ledger-table-wrap,
.stats-cockpit-table-wrap {
    border: 1px solid var(--workspace-line);
    border-radius: 13px;
    background: #fff;
}

.data-table,
.quote-ledger-table,
.stats-cockpit-table {
    border-collapse: separate;
    border-spacing: 0;
}

.data-table thead th,
.quote-ledger-table thead th,
.stats-cockpit-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 10px 11px;
    color: #5e7479;
    background: #f3f7f5;
    font-size: 0.72rem;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

.data-table tbody td,
.quote-ledger-table tbody td,
.stats-cockpit-table tbody td {
    padding: 10px 11px;
    border-bottom-color: #e2eae7;
    vertical-align: middle;
}

.data-table tbody tr,
.quote-ledger-table tbody tr {
    transition: background 120ms ease, box-shadow 120ms ease;
}

.data-table tbody tr:hover,
.quote-ledger-table tbody tr:hover,
.interactive-row:hover {
    background: #f0f7f5;
    box-shadow: inset 3px 0 var(--workspace-teal);
}

.table-subtext {
    margin-top: 2px;
    font-size: 0.72rem;
    line-height: 1.3;
}

.quote-row-action-compact,
.quote-ledger-actions-tight .button-link,
.shipments-ledger-actions .button-link {
    min-height: 32px;
    padding: 6px 9px;
    font-size: 0.71rem;
}

/* Campaign and school records: context first, details second. */
body:is([data-page="campaign_detail"], [data-page="school_account"]) .hero,
body:is([data-page="campaign_detail"], [data-page="school_account"]) .school-account-hero {
    padding: 20px 22px;
}

body[data-page="campaign_detail"] .campaign-tab-row,
body[data-page="school_account"] .account-v2-tabs {
    overflow-x: auto;
    scrollbar-width: thin;
}

body[data-page="campaign_detail"] .campaign-tab-row a {
    flex: 0 0 auto;
    padding-inline: 14px;
}

/* Statistics become a real cockpit rather than a very long report. */
body[data-page="stats"] {
    background: #eaf0ee;
}

body[data-page="stats"] .stats-cockpit {
    gap: 13px;
}

body[data-page="stats"] .stats-cockpit-hero {
    min-height: 0;
    padding: 20px 22px;
    border-radius: 18px;
    box-shadow: 0 14px 34px rgba(10, 61, 64, 0.12);
}

body[data-page="stats"] .stats-cockpit-hero h2 {
    max-width: 720px;
    font-size: clamp(1.8rem, 3vw, 2.65rem);
}

body[data-page="stats"] .stats-cockpit-filter {
    align-self: stretch;
    padding: 14px;
    border-radius: 14px;
}

body[data-page="stats"] .page-anchor-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    padding: 5px;
}

body[data-page="stats"] .page-anchor-nav a {
    display: grid;
    place-items: center;
    padding: 8px 10px;
    color: #536c72;
    text-align: center;
}

body[data-page="stats"] .page-anchor-nav a.is-active {
    color: #fff;
    background: var(--workspace-teal-dark);
}

.stats-view-group[hidden] {
    display: none !important;
}

body[data-page="stats"] .stats-cockpit-section,
body[data-page="stats"] .stats-cockpit-decision-grid,
body[data-page="stats"] .stats-cockpit-flow-grid,
body[data-page="stats"] .stats-cockpit-ranking-grid {
    margin-top: 0;
}

body[data-page="stats"] .stats-cockpit-section {
    padding: 16px;
    border-radius: 15px;
}

body[data-page="stats"] .stats-cockpit-kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

body[data-page="stats"] .stats-cockpit-kpi {
    min-height: 124px;
    padding: 14px;
}

/* Production control room. */
body:is(
    [data-page="production"],
    [data-page="production_publication"],
    [data-page="production_publication_assisted"],
    [data-page="production_order_exports"],
    [data-page="production_photo_generation"],
    [data-page="production_documents"],
    [data-page="production_lab_orders"],
    [data-page="production_batches"]
) {
    --workspace-line: #ccd9d5;
    background:
        linear-gradient(rgba(16, 63, 70, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(16, 63, 70, 0.035) 1px, transparent 1px),
        #e8efed;
    background-size: 28px 28px;
}

.production-hero-compact {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(270px, 340px);
    gap: 18px;
    color: #fff;
    background:
        linear-gradient(120deg, rgba(255, 255, 255, 0.07), transparent 55%),
        #103f46;
    border: 1px solid #174f54;
    box-shadow: 0 15px 36px rgba(12, 51, 58, 0.17);
}

.production-hero-compact .eyebrow,
.production-hero-compact p {
    color: rgba(255, 255, 255, 0.76) !important;
}

.production-hero-compact h2,
.production-hero-compact .production-night-card strong,
.production-hero-compact .production-night-card b {
    color: #fff !important;
}

.production-hero-compact .production-night-card small,
.production-hero-compact .production-night-card span {
    color: rgba(255, 255, 255, 0.76) !important;
}

.production-hero-compact .production-night-card {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.09);
    box-shadow: none;
}

.production-page-nav {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 5px;
    padding: 5px;
}

.production-page-nav a {
    justify-content: center;
    min-width: 0;
    padding: 7px 8px;
}

.production-page-nav a > span {
    width: 27px;
    height: 27px;
}

.production-kpis article {
    position: relative;
    overflow: hidden;
    border-top: 3px solid var(--workspace-teal);
}

.production-kpis article:nth-child(2) { border-top-color: var(--workspace-orange); }
.production-kpis article:nth-child(3) { border-top-color: #397fa0; }
.production-kpis article:nth-child(4) { border-top-color: #8b65a7; }

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

.production-action-card {
    min-height: 136px;
    padding: 16px;
    border-radius: 15px;
}

.production-action-card.is-primary {
    background:
        linear-gradient(145deg, rgba(255,255,255,0.08), transparent 65%),
        var(--workspace-teal-dark);
}

.production-control-board {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 11px;
}

.production-control-queue {
    min-width: 0;
}

.production-control-list {
    display: grid;
    overflow: hidden;
    border: 1px solid var(--workspace-line);
    border-radius: 12px;
}

.production-control-line {
    display: grid;
    grid-template-columns: 10px minmax(180px, 1.5fr) minmax(90px, 0.6fr) minmax(130px, 0.8fr) minmax(95px, 0.55fr);
    align-items: center;
    gap: 10px;
    min-height: 55px;
    padding: 8px 11px;
    border-bottom: 1px solid #e1e9e6;
    color: var(--workspace-ink);
    background: #fff;
}

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

.production-control-line:hover {
    background: #f0f7f5;
}

.production-control-state {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #8ca09f;
    box-shadow: 0 0 0 4px rgba(140, 160, 159, 0.12);
}

.production-control-line.is-running .production-control-state {
    background: #2d8bb3;
    box-shadow: 0 0 0 4px rgba(45, 139, 179, 0.13);
}

.production-control-line.is-completed .production-control-state {
    background: #26936e;
    box-shadow: 0 0 0 4px rgba(38, 147, 110, 0.13);
}

.production-control-line:is(.is-failed, .is-partial) .production-control-state {
    background: #c05247;
    box-shadow: 0 0 0 4px rgba(192, 82, 71, 0.13);
}

.production-control-main,
.production-control-progress {
    min-width: 0;
}

.production-control-main strong,
.production-control-main small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.production-control-main small,
.production-control-mode,
.production-control-status,
.production-control-progress small {
    color: var(--workspace-muted);
    font-size: 0.7rem;
}

.production-control-mode,
.production-control-status {
    font-weight: 800;
}

.production-control-progress {
    display: grid;
    grid-template-columns: minmax(60px, 1fr) auto;
    align-items: center;
    gap: 7px;
}

.production-control-progress i {
    height: 5px;
    overflow: hidden;
    border-radius: 999px;
    background: #dce6e2;
}

.production-control-progress b {
    display: block;
    width: var(--production-progress, 0%);
    height: 100%;
    border-radius: inherit;
    background: #2d8bb3;
}

.production-control-empty {
    padding: 22px;
    text-align: center;
}

.production-control-empty p {
    margin: 5px 0 0;
    color: var(--workspace-muted);
}

.production-control-side {
    display: grid;
    align-content: start;
    gap: 9px;
}

.production-control-side article,
.production-control-side-action {
    display: grid;
    gap: 5px;
    padding: 15px;
    border: 1px solid var(--workspace-line);
    border-radius: 13px;
    color: var(--workspace-ink);
    background: #fff;
    box-shadow: var(--workspace-shadow);
}

.production-control-side span {
    color: var(--workspace-muted);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.production-control-side small {
    color: var(--workspace-muted);
}

.production-control-side-action {
    color: #fff;
    background: var(--workspace-teal-dark);
}

.production-control-side-action span {
    color: rgba(255,255,255,0.66);
}

.production-split {
    grid-template-columns: minmax(0, 1fr) 250px;
    gap: 12px;
}

.production-builder {
    padding: 17px;
}

.production-guidance {
    gap: 8px;
}

.production-guidance article {
    padding: 13px;
    border-radius: 13px;
}

.production-form-grid {
    gap: 10px;
}

.production-submit-bar {
    position: sticky;
    bottom: 10px;
    z-index: 20;
    margin-top: 14px;
    padding: 10px;
    border: 1px solid var(--workspace-line);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 12px 30px rgba(17, 55, 61, 0.12);
    backdrop-filter: blur(12px);
}

.production-batch-row {
    border-radius: 12px;
}

/* Creative studios use the largest possible canvas. */
body:is(
    [data-page="product_template_create"],
    [data-page="product_template_edit"],
    [data-page="pouch_template_create"],
    [data-page="pouch_template_edit"]
) .main-content {
    padding-right: 12px;
    padding-left: 12px;
}

body:is(
    [data-page="product_template_create"],
    [data-page="product_template_edit"],
    [data-page="pouch_template_create"],
    [data-page="pouch_template_edit"]
) .topbar {
    min-height: 60px;
}

.dynamic-template-builder-page,
.pouch-template-builder-page {
    max-width: none !important;
}

.dynamic-template-builder-page .dynamic-product-builder,
.pouch-template-builder-page form {
    overflow: visible;
    border: 0;
    border-radius: 15px;
    background: transparent;
    box-shadow: none;
}

.dynamic-template-builder-page .dynamic-builder-fields,
.pouch-template-builder-page form > .dynamic-builder-step {
    min-width: 0;
}

.dynamic-template-builder-page .dynamic-builder-step,
.pouch-template-builder-page .dynamic-builder-step {
    border-color: var(--workspace-line);
    box-shadow: 0 5px 18px rgba(17, 55, 61, 0.035);
}

.main-content :is(small, .hint, .meta, .table-subtext, .eyebrow) {
    font-size: max(0.72rem, 11.5px);
}

.dynamic-template-builder-page .modal-head,
.pouch-template-builder-page .modal-head {
    position: sticky;
    top: 68px;
    z-index: 42;
    padding: 13px 16px;
    border: 1px solid var(--workspace-line);
    border-radius: 14px;
    background: rgba(255,255,255,0.96);
    box-shadow: 0 8px 24px rgba(17,55,61,0.07);
    backdrop-filter: blur(14px);
}

.dynamic-builder-grid {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
    align-items: start;
    gap: 12px;
}

.dynamic-builder-fields {
    gap: 10px;
}

.dynamic-builder-step {
    padding: 14px;
    border-radius: 14px;
}

.dynamic-builder-preview {
    top: 132px;
    max-height: calc(100vh - 150px);
    overflow: auto;
    border-radius: 15px;
}

.custom-template-builder:not([hidden]) {
    position: relative;
    z-index: 5;
    width: calc(100vw - var(--sidebar-current-width, 248px) - 58px);
    max-width: none;
    margin-right: calc(-1 * min(360px, 28vw));
}

.template-editor-toolbar {
    top: 72px;
    border-radius: 11px 11px 0 0;
    background: #122e34;
    box-shadow: 0 8px 22px rgba(8, 37, 43, 0.16);
}

.template-editor-toolbar button,
.template-editor-toolbar select,
.template-editor-toolbar label {
    color: #eaf4f1;
}

.template-editor-toolbar button {
    border-color: #426268;
    background: #1c4148;
}

.template-editor-toolbar button:hover {
    background: #285860;
}

.template-editor-shell {
    min-height: calc(100vh - 170px);
    border-radius: 0 0 13px 13px;
    background: #dfe7e4;
}

.template-editor-stage {
    background:
        linear-gradient(45deg, #d2dcda 25%, transparent 25%),
        linear-gradient(-45deg, #d2dcda 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #d2dcda 75%),
        linear-gradient(-45deg, transparent 75%, #d2dcda 75%),
        #e8eeec;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
    background-size: 16px 16px;
}

.template-editor-rulers span {
    font-size: 0.72rem !important;
}

/* Long account and administration forms are navigable workspaces. */
body[data-page="company_account"] .account-company-v2,
body[data-page="administration"] .administration-root {
    gap: 13px;
}

body[data-page="company_account"] .account-v2-hero,
body[data-page="administration"] .administration-v2-hero {
    min-height: 0;
    padding: 19px 21px;
}

body[data-page="company_account"] .account-company-contract,
body[data-page="company_account"] .account-company-system-grid {
    gap: 10px;
}

body[data-page="company_account"] .account-company-contract article {
    min-height: 105px;
}

body[data-page="company_account"] .account-form-section {
    padding: 15px;
    border-radius: 13px;
}

body[data-page="company_account"] .account-form-actions {
    position: sticky;
    bottom: 10px;
    z-index: 20;
    border: 1px solid var(--workspace-line);
    border-radius: 13px;
    background: rgba(255,255,255,0.95);
    box-shadow: 0 10px 28px rgba(17,55,61,0.12);
}

.administration-v2-shell {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 12px;
}

.administration-v2-nav {
    top: 84px;
    gap: 8px;
    padding: 10px;
    border-radius: 15px;
}

.administration-v2-nav > * {
    width: 100%;
    min-width: 0;
}

.administration-v2-nav nav {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    overflow: visible;
}

.administration-v2-nav-item {
    width: auto;
    min-width: 0;
    min-height: 52px;
    padding: 8px;
    border-radius: 11px;
}

.administration-v2-nav-item i {
    width: 31px;
    height: 31px;
    border-radius: 9px;
}

.administration-v2-content {
    gap: 12px;
}

.administration-v2-content .section-card {
    padding: 15px;
}

.admin-team-directory,
.admin-email-list {
    gap: 7px;
}

.admin-team-row,
.admin-email-item {
    min-height: 0;
    padding: 11px 12px;
}

@media (min-width: 1500px) {
    .main-content {
        padding-right: 24px;
        padding-left: 24px;
    }

    .production-action-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .production-action-card {
        grid-template-columns: 42px minmax(0, 1fr);
        min-height: 158px;
    }

    .production-action-card > b {
        grid-column: 2;
    }
}

@media (max-width: 1180px) {
    .production-page-nav {
        display: flex;
        overflow-x: auto;
    }

    .production-page-nav a {
        flex: 0 0 auto;
        min-width: 130px;
    }

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

    .production-split,
    .production-control-board,
    .administration-v2-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .production-control-side {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .administration-v2-nav {
        position: static;
    }

    .administration-v2-nav nav {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

    .dynamic-builder-preview {
        position: relative;
        top: auto;
        max-height: none;
    }

    .custom-template-builder:not([hidden]) {
        width: auto;
        margin-right: 0;
    }
}

@media (max-width: 760px) {
    .topbar {
        min-height: 62px;
    }

    .section-card,
    .photographer-page-brief,
    .hero.compact,
    .quote-hub-panel {
        padding: 14px;
    }

    .page-anchor-nav,
    .account-v2-tabs,
    .campaign-tab-row,
    .production-page-nav {
        top: 64px;
    }

    body[data-page="stats"] .page-anchor-nav {
        display: flex;
        overflow-x: auto;
    }

    body[data-page="stats"] .page-anchor-nav a {
        flex: 0 0 132px;
    }

    body[data-page="stats"] .stats-cockpit-kpis,
    .production-action-grid,
    .administration-v2-nav nav {
        grid-template-columns: minmax(0, 1fr);
    }

    .production-hero-compact {
        grid-template-columns: minmax(0, 1fr);
    }

    .production-night-card {
        width: 100%;
    }

    .production-control-side {
        grid-template-columns: minmax(0, 1fr);
    }

    .production-control-line {
        grid-template-columns: 10px minmax(0, 1fr) auto;
    }

    .production-control-mode,
    .production-control-progress {
        grid-column: 2 / -1;
    }

    .production-submit-bar {
        position: static;
    }

    .dynamic-template-builder-page .modal-head,
    .pouch-template-builder-page .modal-head,
    .template-editor-toolbar {
        position: static;
    }

    .template-editor-shell {
        min-height: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .data-table tbody tr,
    .quote-ledger-table tbody tr {
        transition: none;
    }
}

/* Final usability pass: prevent persistent controls from covering working data. */
body[data-page="billing"] .billing-sidebar {
    position: static;
}

body[data-page="billing"] .billing-shell {
    grid-template-columns: minmax(285px, 320px) minmax(0, 1fr);
}

.parent-offers-footer {
    position: static !important;
    margin-top: 2px;
}

.ledger-filter-actions {
    display: flex;
    align-items: end;
    gap: 7px;
    min-width: max-content;
}

.ledger-filter-actions .button-link {
    width: auto !important;
    min-height: 39px;
}

.mail-mobile-back {
    display: none;
}

.compact-filter-toggle {
    display: none;
}

.progressive-table-button {
    display: none;
}

.education-api-method {
    overflow: hidden;
    border: 1px solid var(--workspace-line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--workspace-shadow);
}

.education-api-method > summary {
    display: flex;
    min-height: 58px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 16px;
    cursor: pointer;
    list-style: none;
}

.education-api-method > summary::-webkit-details-marker {
    display: none;
}

.education-api-method > summary span,
.education-api-method > summary strong,
.education-api-method > summary small {
    display: block;
}

.education-api-method > summary small {
    margin-top: 3px;
    color: var(--workspace-muted);
}

.education-api-method > summary b {
    color: var(--workspace-teal);
    font-size: 0.78rem;
}

.education-api-method[open] > summary {
    border-bottom: 1px solid var(--workspace-line);
    background: var(--workspace-paper-soft);
}

.education-api-method[open] > summary b::before {
    content: "Masquer";
    font-size: 0;
}

.education-api-method .education-api-overview-grid {
    margin: 0;
    padding: 12px;
}

.admin-role-guide-card > summary {
    display: flex;
    min-height: 46px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    list-style: none;
}

.admin-role-guide-card > summary::-webkit-details-marker {
    display: none;
}

.admin-role-guide-card > summary span,
.admin-role-guide-card > summary strong,
.admin-role-guide-card > summary small {
    display: block;
}

.admin-role-guide-card > summary small {
    margin-top: 3px;
    color: var(--workspace-muted);
}

.admin-role-guide-card > summary b {
    color: var(--workspace-teal);
    font-size: 0.75rem;
}

.admin-role-guide-card .admin-role-compact-list {
    margin-top: 12px;
}

body[data-page^="production_"] .production-hero-compact {
    grid-template-columns: minmax(0, 1fr) minmax(230px, 300px);
    padding-block: 14px;
}

body[data-page^="production_"] .production-hero-compact h2 {
    font-size: clamp(1.35rem, 1.8vw, 1.75rem);
}

body[data-page^="production_"] .production-hero-compact > div:first-child > p:last-child {
    max-width: 760px;
    margin-bottom: 0;
}

.dashboard-operations-grid {
    align-items: start;
}

.dashboard-next-shoots-card,
.dashboard-activity-card {
    align-self: start;
}

.planning-agenda-day-detail-kpis article > span,
.planning-agenda-activity-label {
    font-size: max(0.75rem, 12px) !important;
}

@media (max-width: 1180px) {
    body[data-page="billing"] .billing-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .ledger-filter-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }
}

@media (max-width: 880px) {
    .mail-workspace {
        min-height: min(680px, calc(100dvh - 170px));
    }

    .mail-workspace .mail-reading-pane {
        display: none;
        min-height: min(680px, calc(100dvh - 170px));
    }

    .mail-workspace.is-mobile-reading .mail-list-pane {
        display: none;
    }

    .mail-workspace.is-mobile-reading .mail-reading-pane {
        display: flex;
    }

    .mail-mobile-back {
        display: inline-flex;
        min-height: 38px;
        align-items: center;
        padding: 7px 10px;
        border: 1px solid var(--workspace-line);
        border-radius: 10px;
        color: var(--workspace-teal-dark);
        background: var(--workspace-paper-soft);
        font: inherit;
        font-size: 0.78rem;
        font-weight: 850;
        cursor: pointer;
    }
}

@media (max-width: 760px) {
    table[data-responsive-table] {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        table-layout: fixed;
    }

    table[data-responsive-table] tbody,
    table[data-responsive-table] tbody tr,
    table[data-responsive-table] tbody td {
        width: auto !important;
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }

    table[data-responsive-table] tbody tr {
        width: 100% !important;
    }

    table[data-responsive-table] tbody td > * {
        min-width: 0;
        max-width: 100%;
    }

    table[data-responsive-table] tbody td :is(strong, span, small, p, a) {
        overflow-wrap: anywhere;
    }

    .compact-filter-toggle {
        display: flex;
        width: 100%;
        min-height: 46px;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 8px;
        padding: 10px 13px;
        border: 1px solid var(--workspace-line);
        border-radius: 12px;
        color: var(--workspace-ink);
        background: var(--workspace-paper-soft);
        font: inherit;
        font-weight: 850;
        cursor: pointer;
    }

    .compact-filter-toggle b {
        color: var(--workspace-teal);
        font-size: 0.75rem;
    }

    form[data-compact-filter-ready="true"]:not(.is-expanded) {
        display: none !important;
    }

    table[data-responsive-table] tbody tr.is-progressive-hidden {
        display: none !important;
    }

    .progressive-table-button {
        display: flex;
        width: 100%;
        min-height: 44px;
        align-items: center;
        justify-content: center;
        margin-top: 10px;
        padding: 9px 13px;
        border: 1px solid var(--workspace-line);
        border-radius: 12px;
        color: var(--workspace-teal-dark);
        background: #fff;
        font: inherit;
        font-size: 0.82rem;
        font-weight: 850;
        cursor: pointer;
    }

    .progressive-table-button:disabled {
        color: var(--workspace-muted);
        background: var(--workspace-paper-soft);
        cursor: default;
    }

    .orders-ledger-filters,
    .quote-ledger-filters {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .ledger-filter-actions {
        display: grid;
        grid-column: auto;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        min-width: 0;
    }

    .ledger-filter-actions .button-link {
        width: 100% !important;
    }

    .parent-offers-hero {
        gap: 16px;
        padding: 18px !important;
    }

    .parent-offers-hero h2 {
        font-size: 1.7rem;
    }

    .parent-offers-hero-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    .parent-offers-hero-metrics article {
        min-height: 72px;
        padding: 10px;
    }

    .parent-offers-hero-metrics strong {
        font-size: 1.25rem;
    }

    .parent-offers-hero-metrics span {
        font-size: 0.7rem;
    }

    .education-api-method .education-api-overview-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .education-api-state-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    body[data-page^="production_"] .production-hero-compact {
        grid-template-columns: minmax(0, 1fr);
    }
}
/* Official Erraïlium identity replaces temporary interface monograms. */
.sidebar .brand-mark.brand-mark-logo {
    overflow: hidden;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.34);
    background: #ffffff;
    box-shadow: 0 9px 20px rgba(5, 31, 35, 0.2);
}

.sidebar .brand-mark.brand-mark-logo img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.administration-v2-content .catalog-checkbox-field > .catalog-checkbox-row {
    display: flex;
    min-height: 50px;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--workspace-line);
    border-radius: 13px;
    color: var(--workspace-ink);
    background: var(--workspace-paper-soft);
    cursor: pointer;
}

.administration-v2-content .catalog-checkbox-field > .catalog-checkbox-row input[type="checkbox"] {
    width: 20px;
    min-width: 20px;
    height: 20px;
    min-height: 20px;
    margin: 0;
    accent-color: var(--workspace-mint);
}

.administration-v2-content .catalog-checkbox-field > .catalog-checkbox-row strong {
    font-size: 0.84rem;
    line-height: 1.35;
}

/* Keep campaign indicators readable after the desktop five-card layout kicks in. */
@media (max-width: 860px) {
    body[data-page="campaign_detail"] .stat-grid,
    body[data-page="campaign_detail"] .stat-grid:has(> :nth-child(5):last-child) {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    body[data-page="campaign_detail"] .stat-grid > .stat-card {
        grid-column: auto !important;
    }
}

@media (max-width: 560px) {
    body[data-page="campaign_detail"] .stat-grid,
    body[data-page="campaign_detail"] .stat-grid:has(> :nth-child(5):last-child) {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}
