﻿:root {
    --bg-light: #eef7ff;
    --bg-mid: #d7ebff;
    --bg-blue: #b8ddff;
    --card-bg: rgba(255, 255, 255, 0.88);
    --card-border: rgba(32, 78, 138, 0.16);
    --text-dark: #11345c;
    --text-muted: #4f7098;
    --accent: #1f76d2;
    --accent-hover: #1259a8;
    --error: #b71e38;
    --sidebar-top: #cde7ff;
    --sidebar-bottom: #9ecfff;
    --dashboard-sidebar-width: 252px;
    --dashboard-shell-gap: 24px;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: 'Outfit', sans-serif;
    color: var(--text-dark);
    min-height: 100vh;
    background: #ffffff;
}

body.dashboard-page {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

body.auth-page {
    background:
        radial-gradient(circle at 8% 18%, rgba(190, 227, 255, 0.55), transparent 30%),
        radial-gradient(circle at 91% 12%, rgba(148, 207, 255, 0.65), transparent 35%),
        linear-gradient(122deg, var(--bg-light) 0%, var(--bg-mid) 46%, var(--bg-blue) 100%);
}

.auth-layout {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    position: relative;
}

.auth-admin-badge {
    position: absolute;
    top: 24px;
    right: 24px;
    max-width: min(420px, calc(100vw - 48px));
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(32, 78, 138, 0.16);
    box-shadow: 0 14px 34px rgba(25, 80, 145, 0.15);
    backdrop-filter: blur(8px);
}

.auth-admin-badge strong,
.auth-admin-badge span {
    display: block;
}

.auth-admin-badge span {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.auth-admin-btn {
    margin-top: 0;
    white-space: nowrap;
}

.auth-card {
    width: min(420px, 100%);
    padding: 32px 28px;
    border-radius: 20px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(6px);
    box-shadow: 0 18px 40px rgba(25, 80, 145, 0.16);
    animation: rise-in 550ms ease;
}

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.brand-logo {
    width: 120px;
    display: block;
    margin: 0 auto 14px;
}

h1 {
    margin: 8px 0 8px;
    text-align: center;
    font-size: 1.75rem;
    line-height: 1.2;
}

.subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 18px;
}

.auth-form {
    display: grid;
    gap: 10px;
}

label {
    font-weight: 500;
    font-size: 0.95rem;
}

input {
    width: 100%;
    border: 1px solid #9bc2e8;
    border-radius: 12px;
    padding: 11px 12px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

input:focus {
    border-color: #2f84e2;
    box-shadow: 0 0 0 3px rgba(47, 132, 226, 0.18);
}

button,
.logout-btn {
    margin-top: 8px;
    border: none;
    border-radius: 12px;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    font-size: 0.97rem;
    padding: 12px 16px;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background 140ms ease, transform 140ms ease;
}

button:hover,
.logout-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.error-banner {
    margin-bottom: 12px;
    background: #ffeef1;
    color: var(--error);
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #ffccd7;
    font-size: 0.92rem;
}

.auth-links {
    margin-top: 16px;
    text-align: center;
}

.auth-links a {
    color: #1d5da9;
    text-decoration: none;
    font-weight: 500;
}

.auth-links a:hover {
    text-decoration: underline;
}

.dashboard-shell {
    min-height: 100vh;
    min-height: 100dvh;
    height: 100vh;
    height: 100dvh;
    display: grid;
    grid-template-columns: var(--dashboard-sidebar-width) 1fr;
    overflow: hidden;
    align-items: stretch;
}

.sidebar {
    background: linear-gradient(185deg, var(--sidebar-top), var(--sidebar-bottom));
    color: #15416f;
    padding: 24px 16px;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 18px;
    box-shadow: 6px 0 22px rgba(10, 48, 91, 0.14);
    position: relative;
    top: auto;
    align-self: stretch;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.2rem;
    font-weight: 700;
    color: inherit;
    text-decoration: none;
}

.sidebar-brand img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    padding: 4px;
}

.sidebar-nav {
    display: grid;
    gap: 4px;
    overflow: visible;
}

.sidebar-nav a,
.sidebar-bottom a,
.logout-link {
    color: #18497d;
    text-decoration: none;
    padding: 8px 10px;
    border-radius: 10px;
    font-weight: 500;
    border: 0;
    background: transparent;
    width: 100%;
    text-align: left;
    font-family: inherit;
    font-size: 0.98rem;
    cursor: pointer;
}

.side-link {
    display: flex;
    align-items: center;
    gap: 9px;
}

.nav-icon {
    width: 16px;
    min-width: 16px;
    text-align: center;
    opacity: 0.9;
}

.nav-icon.nav-icon-img {
    width: 24px;
    min-width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.nav-icon.nav-icon-img img {
    width: 22px;
    height: 22px;
    display: block;
}

.sidebar-nav a.active,
.sidebar-nav a:hover,
.sidebar-bottom a.active,
.sidebar-bottom a:hover,
.logout-link:hover {
    background: rgba(255, 255, 255, 0.45);
}

.sidebar-group-title {
    margin-top: 10px;
    margin-bottom: 4px;
    padding: 0 10px;
    text-transform: uppercase;
    font-size: 0.73rem;
    letter-spacing: 0.08em;
    color: #3b6693;
    font-weight: 700;
}

.sidebar-sub {
    padding-left: 24px;
    font-size: 0.9rem;
    color: #2d5b8b;
}

.invest-menu {
    position: relative;
}

.invest-trigger::after {
    content: "▾";
    margin-left: auto;
    font-size: 0.82rem;
    opacity: 0.8;
}

.invest-popup {
    position: absolute;
    left: calc(100% + 8px);
    top: -6px;
    width: 280px;
    max-height: 320px;
    overflow: auto;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid #bad7f1;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(20, 78, 130, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateX(-6px);
    transition: opacity 150ms ease, transform 150ms ease, visibility 150ms ease;
    z-index: 30;
}

.invest-menu:hover .invest-popup,
.invest-menu:focus-within .invest-popup {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.invest-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #174e86;
    text-decoration: none;
    font-size: 1.05rem;
    border-radius: 12px;
    padding: 10px 12px;
}

.invest-item + .invest-item {
    margin-top: 8px;
}

.invest-item:hover {
    background: rgba(255, 255, 255, 0.55);
}

.invest-dot {
    font-size: 1.35rem;
    line-height: 1;
}

.sidebar-bottom {
    display: grid;
    gap: 4px;
}

.dashboard-main {
    padding: 24px;
    background: #ffffff;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    min-height: 0;
    min-width: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
}

.topbar {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 18px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 25;
    flex-shrink: 0;
}

.topbar h1 {
    margin: 0;
    text-align: left;
    font-size: 2rem;
}

.topbar p {
    margin: 4px 0 0;
    color: var(--text-muted);
}

.topbar-user {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, #63b2ff, #267ed6);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-bell {
    width: 42px;
    height: 42px;
    border: 1px solid #d9e8f6;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #2f6faa;
    text-decoration: none;
}

.topbar-bell svg {
    width: 20px;
    height: 20px;
}

.topbar-bell:hover {
    background: #f1f8ff;
}

.topbar-logout {
    margin-top: 0;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.9rem;
}

.hero-card {
    margin-top: 18px;
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.hero-text h2 {
    margin: 0 0 8px;
    font-size: 1.35rem;
}

.hero-text p {
    margin: 0;
    color: var(--text-muted);
    max-width: 620px;
}

.hero-actions {
    margin-top: 14px;
    display: flex;
    gap: 10px;
}

.hero-actions a {
    display: inline-block;
    background: #e7f3ff;
    color: #1c62ad;
    text-decoration: none;
    font-weight: 600;
    border-radius: 12px;
    padding: 12px 16px;
}

.hero-logo {
    width: 92px;
    flex-shrink: 0;
}

.grid-cards {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.panel {
    background: #ffffff;
    border: 1px dashed rgba(23, 95, 167, 0.3);
    border-radius: 16px;
    padding: 16px;
}

.panel h3 {
    margin: 0 0 8px;
}

.panel p {
    margin: 0;
    color: var(--text-muted);
}

.dashboard-section {
    margin-top: 18px;
}

.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.section-heading h3 {
    margin: 0;
    font-size: 1.18rem;
}

.section-heading p {
    margin: 4px 0 0;
    color: var(--text-muted);
}

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

.metric-card {
    background: linear-gradient(180deg, rgba(244, 250, 255, 0.98), rgba(227, 240, 252, 0.98));
    border: 1px solid rgba(31, 118, 210, 0.14);
    border-radius: 16px;
    padding: 16px;
    min-height: 108px;
    display: grid;
    align-content: space-between;
    gap: 10px;
    box-shadow: 0 10px 22px rgba(20, 78, 130, 0.08);
}

.metric-card-positive {
    background: linear-gradient(180deg, #f5fbff, #dff4ea);
}

.metric-card-negative {
    background: linear-gradient(180deg, #fff8f8, #ffe9e9);
}

.metric-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.metric-value {
    font-size: 1.5rem;
    line-height: 1.1;
}

.dashboard-columns {
    margin-top: 18px;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 14px;
}

.panel-news {
    border-style: solid;
}

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

.news-card {
    display: grid;
    gap: 6px;
    text-decoration: none;
    color: inherit;
    background: linear-gradient(180deg, #ffffff, #f4f9ff);
    border: 1px solid #d7e7f7;
    border-radius: 14px;
    padding: 14px;
    transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.news-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(20, 78, 130, 0.1);
    border-color: #9cc5ea;
}

.news-card-empty {
    cursor: default;
}

.news-source,
.news-date {
    color: var(--text-muted);
    font-size: 0.88rem;
}

.mini-table {
    display: grid;
    gap: 8px;
}

.mini-table-head,
.mini-table-row {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr;
    gap: 10px;
    align-items: center;
}

.mini-table-head-wide,
.mini-table-row-wide {
    grid-template-columns: 1.1fr 1fr 1fr 1fr;
}

.mini-table-head {
    color: var(--text-muted);
    font-size: 0.84rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.mini-table-row {
    background: #f7fbff;
    border: 1px solid #d7e7f7;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 0.95rem;
}

.tag-list {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.data-tag {
    display: inline-flex;
    align-items: center;
    padding: 8px 10px;
    border-radius: 999px;
    background: #edf6ff;
    border: 1px solid #d2e7f8;
    color: #1e568f;
    font-size: 0.9rem;
}

.member-main {
    background:
        radial-gradient(circle at 86% 8%, rgba(196, 228, 255, 0.4), transparent 26%),
        linear-gradient(180deg, #f7fbff 0%, #ffffff 32%);
}

.member-topbar {
    border-color: #d8e5f3;
    box-shadow: 0 10px 28px rgba(16, 82, 140, 0.08);
}

.member-layout {
    grid-template-columns: minmax(250px, 320px) minmax(0, 1fr);
}

.member-side-card {
    background: linear-gradient(180deg, #ffffff 0%, #eff7ff 100%);
}

.member-side-stack {
    display: grid;
    gap: 12px;
}

.member-side-pill {
    display: grid;
    gap: 6px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #f7fbff;
    border: 1px solid #d8e7f7;
}

.member-side-pill span {
    color: #5d7ea2;
    font-size: 0.88rem;
}

.member-side-pill strong {
    color: #123f66;
    font-size: 1rem;
}

.member-side-actions {
    margin-top: 14px;
}

.member-note {
    margin: 0;
}

.member-kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.member-kpi-card {
    text-align: left;
    background: linear-gradient(180deg, #ffffff 0%, #f4f9ff 100%);
}

.member-kpi-card small {
    display: block;
    margin-top: 8px;
    color: #6d88a6;
    font-size: 0.82rem;
}

.member-kpi-positive {
    background: linear-gradient(180deg, #ffffff 0%, #eefbf2 100%);
}

.member-kpi-negative {
    background: linear-gradient(180deg, #ffffff 0%, #fff0f0 100%);
}

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

.member-grid-wide {
    grid-template-columns: 1.2fr 0.8fr;
}

.member-news-list {
    display: grid;
    gap: 10px;
}

.member-news-row {
    display: grid;
    gap: 6px;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid #d8e7f7;
    background: linear-gradient(180deg, #ffffff 0%, #f6fbff 100%);
    text-decoration: none;
    color: inherit;
}

.member-news-row:hover {
    box-shadow: 0 10px 22px rgba(16, 82, 140, 0.09);
}

.member-news-source,
.member-news-date {
    color: #6d88a6;
    font-size: 0.85rem;
}

.member-mini-table th,
.member-mini-table td {
    white-space: nowrap;
}

.revision-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.revision-topbar-copy {
    display: grid;
    gap: 4px;
}

.revision-topbar-eyebrow {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 6px 10px;
    border-radius: 999px;
    background: linear-gradient(180deg, #eef7ff 0%, #e3f1ff 100%);
    border: 1px solid #d8e8f7;
    color: #2464a2;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.revision-topbar-actions {
    gap: 14px;
}

.revision-topbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 16px;
    border: 1px solid #d5e6f6;
    background: linear-gradient(180deg, #ffffff 0%, #f3f9ff 100%);
    color: #173f67;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(17, 82, 140, 0.08);
}

.revision-topbar-btn-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, #dff4ff 0%, #cde8ff 100%);
    color: #1b6bb0;
    font-size: 0.9rem;
    font-weight: 800;
}

.revision-topbar-btn-copy {
    display: grid;
    text-align: left;
}

.revision-topbar-btn-copy strong {
    font-size: 0.95rem;
}

.revision-topbar-btn-copy small {
    color: #6985a0;
    font-size: 0.83rem;
}

.revision-col-target {
    min-width: 160px;
}

.revision-col-coherence {
    min-width: 130px;
}

.revision-col-comment {
    min-width: 320px;
}

.revision-comment-input {
    width: 100%;
    border: 1px solid #c9def2;
    border-radius: 10px;
    padding: 10px 12px;
    resize: vertical;
    font-family: inherit;
    font-size: 0.93rem;
    color: #1a456f;
    background: #fcfeff;
}

.revision-actions {
    margin-top: 14px;
    justify-content: flex-end;
}

.fixed-main {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
}

.fixed-topbar {
    margin-bottom: 0;
}

.main-scroll-area {
    min-height: 0;
    height: 100%;
    overflow: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-top: 18px;
    padding-bottom: 24px;
}

@media (min-width: 981px) {
    html,
    body,
    body.dashboard-page,
    .dashboard-shell {
        height: 100vh;
        height: 100dvh;
        min-height: 100vh;
        min-height: 100dvh;
        overflow: hidden;
    }

    .dashboard-shell {
        display: block;
        position: relative;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: var(--dashboard-sidebar-width);
        height: 100vh;
        height: 100dvh;
        max-height: none;
        z-index: 60;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .dashboard-main {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: var(--dashboard-sidebar-width);
        width: auto;
        height: 100vh;
        height: 100dvh;
        max-height: none;
        min-height: 0;
        padding: var(--dashboard-shell-gap);
        overflow: hidden;
    }

    .topbar,
    .fixed-topbar {
        position: relative;
        z-index: 20;
        flex-shrink: 0;
    }

    .main-scroll-area {
        min-height: 0;
        height: 100%;
        overflow-y: auto;
        overflow-x: hidden;
        overscroll-behavior: contain;
    }
}

.revision-inline-check {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
    color: #244f7b;
    font-weight: 600;
}

.revision-inline-check input {
    width: auto;
    margin: 0;
}

.revision-kpis-wide {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.revision-toolbar-card {
    padding: 16px 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.revision-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.revision-tab-strip,
.revision-export-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.revision-tab-link {
    display: inline-flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: 999px;
    background: #eff7ff;
    border: 1px solid #d5e6f7;
    color: #1d5da9;
    text-decoration: none;
    font-weight: 600;
}

.revision-switch {
    margin-top: 0;
    min-width: 102px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 0;
    color: #fff;
    box-shadow: 0 10px 18px rgba(21, 76, 127, 0.12);
    font-size: 0.82rem;
    letter-spacing: 0.02em;
}

.revision-switch-active {
    background: linear-gradient(180deg, #25bb72 0%, #149758 100%);
}

.revision-switch-inactive {
    background: linear-gradient(180deg, #92a8c1 0%, #7189a5 100%);
}

.revision-switch-changed {
    background: #c43b47;
}

.revision-coherence-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 96px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.83rem;
    font-weight: 700;
    border: 1px solid transparent;
}

.revision-coherence-ok {
    background: #edf9f1;
    color: #167246;
    border-color: #c8e7d4;
}

.revision-coherence-ko {
    background: #fff0f2;
    color: #b22a43;
    border-color: #f2c4cd;
}

.revision-coherence-off {
    background: #f3f6fa;
    color: #73879d;
    border-color: #dce5ed;
}

.revision-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 82px;
    padding: 7px 10px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.84rem;
}

.revision-badge-target {
    background: #eefbf2;
    color: #147543;
    border: 1px solid #c5ead4;
}

.revision-badge-muted {
    background: #f1f5fa;
    color: #6f89a4;
    border: 1px solid #dbe6f0;
}

.revision-delta {
    margin-top: 6px;
    color: #b71e38;
    font-size: 0.83rem;
    font-weight: 700;
}

.revision-clickable-row {
    cursor: pointer;
}

.revision-clickable-row:hover td {
    background: #f7fbff;
}

.revision-comment-cell {
    display: grid;
    gap: 10px;
}

.revision-comment-summary {
    display: grid;
    gap: 8px;
    padding: 12px;
    border-radius: 14px;
    background: linear-gradient(180deg, #f8fbff 0%, #f1f7fd 100%);
    border: 1px solid #dce8f3;
}

.revision-comment-counter {
    display: inline-flex;
    width: fit-content;
    padding: 5px 9px;
    border-radius: 999px;
    background: #e8f2ff;
    color: #1f5da4;
    font-size: 0.78rem;
    font-weight: 700;
}

.revision-comment-preview {
    display: grid;
    gap: 3px;
}

.revision-comment-preview strong,
.revision-comment-meta strong {
    color: #183f67;
    font-size: 0.86rem;
}

.revision-comment-preview span,
.revision-comment-meta span {
    color: #6984a0;
    font-size: 0.78rem;
}

.revision-comment-preview p,
.revision-comment-entry p,
.revision-comment-card p {
    margin: 0;
    color: #264b70;
    line-height: 1.45;
    white-space: pre-wrap;
}

.revision-comment-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.revision-line-save-btn {
    border: 0;
    border-radius: 999px;
    padding: 9px 14px;
    background: linear-gradient(180deg, #1f76d2 0%, #165dab 100%);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.revision-comment-open-btn {
    margin-top: 0;
}

.revision-comment-feed {
    display: grid;
    gap: 10px;
}

.revision-comment-entry {
    padding: 12px 14px;
    border-radius: 14px;
    background: #f8fbff;
    border: 1px solid #dde8f2;
}

.revision-comment-entry-own,
.revision-comment-card-own {
    background: #eef7ff;
    border-color: #cfe3f8;
}

.revision-comment-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.revision-comment-empty {
    color: #6d849d;
    font-size: 0.85rem;
}

.revision-comments-dialog {
    width: min(920px, 100%);
}

.revision-comments-header p {
    margin: 6px 0 0;
    color: #70879f;
    font-size: 0.92rem;
}

.revision-comments-body {
    max-height: 72vh;
    overflow: auto;
    padding: 0 16px 16px;
    display: grid;
    gap: 12px;
}

.revision-comment-card {
    padding: 16px;
    border-radius: 16px;
    background: #f9fbfe;
    border: 1px solid #dde8f2;
}

.revision-comment-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 10px;
}

.revision-comment-card-head span,
.revision-comment-card-meta span {
    display: block;
    color: #6d859e;
    font-size: 0.82rem;
}

.revision-comment-card-meta {
    text-align: right;
}

.revision-comment-empty-panel {
    padding: 18px;
    border-radius: 14px;
    background: #f7fafc;
    border: 1px dashed #d3dfeb;
    text-align: center;
}

.revision-history-table td:nth-child(6),
.revision-history-table th:nth-child(6) {
    min-width: 340px;
    white-space: normal;
}

.revision-detail-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(7, 24, 46, 0.46);
    z-index: 2100;
}

.revision-detail-modal.open {
    display: flex;
}

.revision-detail-dialog {
    width: min(980px, 100%);
    max-height: 88vh;
    overflow: auto;
    border-radius: 18px;
    background: #f8fbff;
    border: 1px solid #d7e7f6;
    box-shadow: 0 22px 54px rgba(12, 58, 101, 0.24);
}

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

.revision-detail-card {
    display: grid;
    gap: 6px;
    padding: 14px;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid #d7e7f6;
}

.revision-detail-card span {
    color: #6986a4;
    font-size: 0.86rem;
}

.revision-detail-card strong {
    color: #123f66;
    white-space: pre-wrap;
}

.revision-detail-card-wide {
    grid-column: span 3;
}

.chatbot-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background: rgba(9, 28, 46, 0.34);
    backdrop-filter: blur(10px);
    z-index: 3200;
}

.chatbot-modal.open {
    display: flex;
}

.chatbot-dialog {
    position: relative;
    width: min(860px, 100%);
    height: min(86vh, 760px);
    max-height: min(86vh, 760px);
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    border-radius: 22px;
    overflow: hidden;
    border: 1px solid rgba(186, 206, 226, 0.95);
    background: linear-gradient(180deg, #fefefe 0%, #f6fbff 100%);
    box-shadow: 0 36px 90px rgba(8, 43, 79, 0.28);
}

.chatbot-windowbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px 18px;
    border-bottom: 1px solid #dde8f2;
    background: rgba(255, 255, 255, 0.92);
}

.chatbot-windowbar-menu,
.chatbot-windowbar-btn {
    border: 0;
    background: transparent;
    color: #197a7d;
    cursor: pointer;
}

.chatbot-windowbar-menu {
    width: 36px;
    height: 36px;
    padding: 8px;
    border-radius: 10px;
    display: grid;
    gap: 3px;
    place-content: center;
}

.chatbot-windowbar-menu span {
    display: block;
    width: 16px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.chatbot-windowbar strong {
    flex: 1;
    color: #1f2a37;
    font-size: 1.1rem;
    font-weight: 700;
}

.chatbot-windowbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chatbot-windowbar-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 1.2rem;
    line-height: 1;
}

.chatbot-windowbar-menu:hover,
.chatbot-windowbar-btn:hover {
    background: #eef7f7;
}

.chatbot-dialog-minimized {
    height: auto;
    max-height: none;
    grid-template-rows: auto;
}

.chatbot-dialog-minimized .chatbot-status,
.chatbot-dialog-minimized .chatbot-body,
.chatbot-dialog-minimized .chatbot-form {
    display: none;
}

.chatbot-dialog-expanded {
    width: min(1120px, 100%);
    height: min(92vh, 900px);
    max-height: min(92vh, 900px);
}

.chatbot-status {
    margin: 14px 18px 0;
    padding: 10px 14px;
    border-radius: 999px;
    background: #edf7ff;
    border: 1px solid #d7e8f7;
    color: #5a7794;
    font-size: 0.88rem;
}

.chatbot-body {
    min-height: 0;
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    padding: 0 18px 18px;
}

.chatbot-hero {
    align-self: start;
    margin: 10px 0 0;
    padding: 28px 22px 18px;
    text-align: center;
}

.chatbot-hero-hidden {
    display: none;
}

.chatbot-hero-mark {
    width: 88px;
    height: 88px;
    margin: 0 auto 16px;
    position: relative;
    display: grid;
    place-items: center;
}

.chatbot-hero-core {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #f4d7ff 0%, #8d61ff 38%, #3b81ff 100%);
    box-shadow: 0 14px 32px rgba(80, 109, 233, 0.25);
}

.chatbot-hero-orbit {
    position: absolute;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    opacity: 0.85;
    filter: blur(0.2px);
}

.chatbot-hero-orbit-left {
    left: 12px;
    top: 26px;
    background: rgba(163, 94, 255, 0.5);
}

.chatbot-hero-orbit-right {
    right: 12px;
    top: 26px;
    background: rgba(83, 212, 255, 0.5);
}

.chatbot-hero h2 {
    margin: 0;
    font-size: 2rem;
    color: #18212b;
}

.chatbot-hero p {
    margin: 10px auto 0;
    max-width: 560px;
    color: #748599;
    font-size: 1rem;
}

.chatbot-suggestion-grid {
    margin-top: 28px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.chatbot-suggestion-card {
    display: grid;
    gap: 10px;
    padding: 16px 14px;
    border-radius: 14px;
    border: 1px solid #d9c9ff;
    background: #ffffff;
    text-align: left;
    color: #2b3340;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.chatbot-suggestion-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(114, 96, 191, 0.12);
    border-color: #c1a9ff;
}

.chatbot-suggestion-icon {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #f5efff;
    color: #6d41e3;
    font-size: 0.8rem;
    font-weight: 700;
}

.chatbot-suggestion-card strong {
    font-size: 0.98rem;
}

.chatbot-suggestion-card small {
    color: #606f82;
    font-size: 0.9rem;
    line-height: 1.35;
}

.chatbot-messages {
    min-height: 0;
    overflow: auto;
    padding: 14px 4px 0;
    display: none;
    gap: 12px;
}

.chatbot-messages-visible {
    display: grid;
}

.chatbot-bubble {
    max-width: 82%;
    padding: 14px 16px;
    border-radius: 18px;
    box-shadow: 0 8px 18px rgba(16, 82, 140, 0.08);
}

.chatbot-bubble strong {
    display: block;
    margin-bottom: 6px;
    font-size: 0.88rem;
}

.chatbot-bubble p {
    margin: 0;
    white-space: pre-wrap;
    line-height: 1.45;
}

.chatbot-bubble-bot {
    justify-self: start;
    background: #ffffff;
    border: 1px solid #dae8f7;
    color: #173f67;
}

.chatbot-bubble-user {
    justify-self: end;
    background: linear-gradient(180deg, #1f76d2 0%, #1766bb 100%);
    color: #ffffff;
}

.chatbot-form {
    border-top: 1px solid #dbe9f6;
    padding: 16px 18px 18px;
    display: grid;
    gap: 10px;
    background: rgba(255, 255, 255, 0.96);
}

.chatbot-composer-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
}

.chatbot-form textarea {
    width: 100%;
    min-height: 68px;
    max-height: 150px;
    border: 1px solid #dde5ea;
    border-radius: 14px;
    padding: 16px 18px;
    resize: vertical;
    outline: none;
    font-family: inherit;
    font-size: 0.98rem;
    color: #163f66;
    background: #ffffff;
}

.chatbot-form textarea:focus {
    border-color: #9cc6df;
    box-shadow: 0 0 0 3px rgba(147, 204, 214, 0.2);
}

.chatbot-composer-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 6px;
}

.chatbot-inline-link {
    color: #5f7b95;
    text-decoration: none;
    font-size: 0.92rem;
}

.chatbot-send-btn {
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(180deg, #dff0ee 0%, #c2e5e1 100%);
    color: #2b8b84;
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 1.05rem;
}

.chatbot-send-btn:hover {
    filter: brightness(0.98);
}

.chatbot-send-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

.chatbot-footnote {
    margin: 0;
    color: #6f7f91;
    font-size: 0.88rem;
}

.export-columns {
    grid-template-columns: 1.2fr 0.8fr;
}

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

.export-card {
    display: grid;
    gap: 10px;
    padding: 16px;
    border: 1px solid #d7e7f7;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff, #f4f9ff);
}

.export-card strong {
    font-size: 1.05rem;
}

.export-card p {
    margin: 0;
    color: var(--text-muted);
}

.logout-form {
    margin: 0;
}

.settings-main {
    padding-top: 12px;
}

.settings-topbar {
    border-radius: 12px;
}

.settings-topbar h1 {
    font-size: 2.05rem;
}

.flash-wrap {
    margin-top: 14px;
    display: grid;
    gap: 8px;
}

.flash {
    border-radius: 10px;
    padding: 10px 12px;
    border: 1px solid #d5e4f2;
    background: #f4f9ff;
    color: #1c4f81;
}

.flash-success {
    background: #eafaf0;
    border-color: #c9ecd5;
    color: #11693a;
}

.flash-error {
    background: #fff1f3;
    border-color: #ffd7dd;
    color: #9a2139;
}

.settings-tabs {
    margin-top: 14px;
    display: flex;
    gap: 22px;
    border-bottom: 1px solid #d7e3ee;
    padding: 0 6px;
}

.settings-tabs a {
    text-decoration: none;
    color: #2a4f75;
    padding: 14px 0 12px;
    font-weight: 500;
    border-bottom: 3px solid transparent;
}

.settings-tabs a.active {
    color: #0e5f98;
    border-bottom-color: #2a8fca;
}

.settings-section {
    max-width: 1040px;
    margin: 20px auto 0;
}

.settings-section h2 {
    font-size: 2.05rem;
    margin: 0 0 8px;
}

.settings-section > p {
    margin: 0;
    color: #607d9b;
}

.settings-card {
    margin-top: 28px;
    background: #f8fbfe;
    border: 1px solid #dde8f2;
    border-radius: 12px;
    padding: 18px;
}

.settings-card h3 {
    margin: 0 0 8px;
    font-size: 1.75rem;
}

.settings-card > p {
    margin: 0 0 18px;
    color: #667f99;
}

.settings-subcard {
    background: #ffffff;
    border: 1px solid #d9e6f1;
    border-radius: 12px;
    padding: 16px 18px;
}

.settings-guide-list {
    margin: 0;
    padding-left: 18px;
    color: #294a6d;
    display: grid;
    gap: 8px;
}

.settings-guide-list li {
    line-height: 1.5;
}

.settings-block {
    background: #ffffff;
    border: 1px solid #d8e4ef;
    border-radius: 10px;
    padding: 14px;
    margin-top: 12px;
}

.settings-block h4 {
    margin: 0 0 12px;
    font-size: 1.25rem;
}

.switch-line {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 1.05rem;
}

.switch-line input {
    width: 18px;
    height: 18px;
}

.check-list {
    display: grid;
    gap: 8px;
}

.check-list label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 400;
    color: #173e66;
}

.check-list input {
    width: 16px;
    height: 16px;
}

.user-mgmt {
    margin-top: 28px;
}

.create-user-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.create-user-form button {
    grid-column: 1 / span 1;
    margin-top: 0;
}

.staff-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #244d77;
}

.staff-check input {
    width: 16px;
    height: 16px;
}

.admin-action-stack {
    display: grid;
    gap: 10px;
    min-width: 260px;
}

.admin-inline-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-inline-form input[type="file"] {
    max-width: 220px;
}

.users-table-wrap {
    overflow-x: auto;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border: 1px solid #d8e4ef;
    border-radius: 10px;
    overflow: hidden;
}

.users-table th,
.users-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e6edf5;
    text-align: left;
    font-size: 0.95rem;
}

.users-table th {
    color: #3d6086;
    background: #f2f8ff;
}

.inline-delete-form {
    margin: 0;
}

.delete-btn {
    margin-top: 0;
    background: #e84761;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
}

.delete-btn:hover {
    background: #c12a45;
}

.current-badge {
    font-size: 0.84rem;
    color: #2c629b;
    background: #e9f4ff;
    border-radius: 999px;
    padding: 4px 8px;
    display: inline-block;
}

.dsn-filter-form,
.dsn-default-form,
.add-block-form {
    margin-top: 10px;
}

.dsn-filter-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.dsn-filter-grid label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #264f78;
}

.dsn-filter-grid select,
.dsn-filter-grid input {
    width: 100%;
    border: 1px solid #9bc2e8;
    border-radius: 12px;
    padding: 11px 12px;
    font-size: 0.95rem;
    background: #fff;
}

.dsn-actions {
    margin-top: 10px;
}

.dsn-default-form button {
    margin-top: 10px;
    background: #0f8f57;
}

.dsn-default-form button:hover {
    background: #097143;
}

.preview-table-wrap {
    overflow: auto;
    max-height: 420px;
}

.add-block-form {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 10px;
}

.rubriques-import-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.rubriques-import-form .dsn-filter-grid {
    grid-template-columns: minmax(200px, 260px) minmax(320px, 1fr);
    align-items: end;
}

.rubriques-import-form input[type="file"] {
    min-height: 46px;
    padding: 10px 12px;
}

.rubriques-import-actions {
    display: flex;
    justify-content: flex-end;
}

.rubriques-import-btn {
    min-width: 280px;
    min-height: 52px;
    font-size: 1.05rem;
    font-weight: 700;
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(20, 88, 155, 0.22);
}

.custom-block-list {
    margin-top: 12px;
    display: grid;
    gap: 8px;
}

.custom-block-item {
    border: 1px solid #d9e8f6;
    border-radius: 10px;
    background: #f8fbff;
    padding: 9px 10px;
    color: #1d4f81;
}

.dsn-tables-filter-form {
    margin-top: 10px;
}

.dsn-tables-filter-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.dsn-tables-filter-row select {
    border: 1px solid #9bc2e8;
    border-radius: 12px;
    padding: 11px 12px;
    font-size: 0.95rem;
    background: #fff;
    min-width: 180px;
}

.dsn-tables-filter-row input[type="number"] {
    border: 1px solid #9bc2e8;
    border-radius: 12px;
    padding: 11px 12px;
    font-size: 0.95rem;
    width: 140px;
}

.dsn-tables-filter-row input[type="text"] {
    border: 1px solid #9bc2e8;
    border-radius: 12px;
    padding: 11px 12px;
    font-size: 0.95rem;
    width: 220px;
}

.client-model-section .settings-card h3 {
    margin-bottom: 14px;
}

.client-model-form {
    display: grid;
    gap: 14px;
}

.model-choice-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.model-pill {
    border: 1px solid #cde1f4;
    border-radius: 12px;
    background: #fff;
    padding: 10px 12px;
    cursor: pointer;
}

.model-pill input {
    margin-right: 8px;
    width: auto;
}

.model-pill span {
    font-weight: 600;
    color: #18497d;
}

.custom-model-box {
    border: 1px solid #d7e7f5;
    background: #f8fbff;
    border-radius: 12px;
    padding: 14px;
}

.custom-model-box h4 {
    margin: 0 0 10px;
    color: #1e4f82;
    font-size: 1.1rem;
}

.custom-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 10px;
}

.custom-grid label,
.custom-area label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #264f78;
}

.custom-grid select,
.custom-grid input {
    width: 100%;
    border: 1px solid #9bc2e8;
    border-radius: 12px;
    padding: 11px 12px;
    font-size: 0.95rem;
    background: #fff;
}

.custom-area textarea {
    width: 100%;
    border: 1px solid #9bc2e8;
    border-radius: 12px;
    padding: 11px 12px;
    font-size: 0.95rem;
    resize: vertical;
    font-family: "Outfit", sans-serif;
}

.import-main {
    background:
        radial-gradient(circle at 88% 8%, rgba(196, 228, 255, 0.35), transparent 28%),
        #ffffff;
    padding-left: 28px;
    padding-right: 28px;
}

.import-main > .topbar,
.import-main > .main-scroll-area > .import-grid {
    width: min(1260px, 100%);
    margin-left: auto;
    margin-right: auto;
}

.import-main > .main-scroll-area > .flash-wrap,
.import-main > .main-scroll-area > .import-model-card {
    width: min(1260px, 100%);
    margin-left: auto;
    margin-right: auto;
}

.import-model-card {
    margin-top: 14px;
    background: #ffffff;
    border: 1px solid #d7e7f6;
    border-radius: 16px;
    padding: 18px 20px;
    box-shadow: 0 8px 20px rgba(16, 82, 140, 0.07);
}

.import-model-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.import-model-head h2 {
    margin: 0;
    color: #0f4374;
}

.active-model-badge {
    background: #e8f4ff;
    color: #1761a3;
    border: 1px solid #bcdcf7;
    border-radius: 999px;
    padding: 6px 10px;
    font-weight: 700;
    font-size: 0.88rem;
}

.import-model-card p {
    margin: 10px 0 12px;
    color: #5a7da0;
}

.target-table-line {
    margin-top: 0;
    margin-bottom: 12px;
    color: #2b5f92;
}

.import-model-card p a {
    color: #1e68ad;
    text-decoration: none;
    font-weight: 600;
}

.import-model-card p a:hover {
    text-decoration: underline;
}

.quick-model-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
    gap: 8px;
    align-items: center;
}

.quick-model-form label {
    border: 1px solid #cde1f4;
    background: #fff;
    border-radius: 10px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.quick-model-form label input {
    width: auto;
}

.quick-model-form button {
    margin-top: 0;
    white-space: nowrap;
}

.import-grid {
    margin-top: 18px;
    display: grid;
    gap: 16px;
}

.import-card {
    background: #ffffff;
    border: 1px solid #d7e7f6;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 24px rgba(16, 82, 140, 0.08);
}

.import-card h2 {
    margin: 0;
    font-size: 1.45rem;
    color: #0f4374;
}

.import-card p {
    margin: 8px 0 14px;
    color: #58789a;
}

.dropzone {
    border: 2px dashed #88b5df;
    border-radius: 14px;
    background: linear-gradient(145deg, #f5faff, #edf6ff);
    min-height: 160px;
    display: grid;
    align-content: center;
    justify-items: center;
    text-align: center;
    gap: 8px;
    cursor: pointer;
    transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.dropzone:hover,
.dropzone.dragover {
    border-color: #2d83da;
    background: linear-gradient(145deg, #eaf4ff, #dfedff);
    transform: translateY(-1px);
}

.dropzone input {
    display: none;
}

.dropzone-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #d9ecff;
    color: #155f9f;
    display: grid;
    place-items: center;
    font-size: 1.45rem;
}

.dropzone-title {
    font-weight: 700;
    color: #184f86;
}

.dropzone-sub {
    color: #5d7ea0;
}

.meta-row {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.meta-row label {
    display: block;
    margin-bottom: 6px;
}

.meta-row select {
    width: 100%;
    border: 1px solid #9bc2e8;
    border-radius: 12px;
    padding: 11px 12px;
    font-size: 0.95rem;
    background: #fff;
    color: #17436e;
}

.meta-row input {
    width: 100%;
    border: 1px solid #9bc2e8;
    border-radius: 12px;
    padding: 11px 12px;
    font-size: 0.95rem;
    background: #fff;
    color: #17436e;
}

.meta-row input[disabled] {
    background: #eef4fb;
    color: #6f8aa6;
}

.selected-file {
    margin-top: 12px;
    border-radius: 12px;
    background: #edf7ff;
    border: 1px solid #d3e8fb;
    color: #1e5d98;
    padding: 10px 12px;
    font-weight: 500;
}

.preview-box {
    min-height: 210px;
    max-height: 320px;
    overflow: auto;
    background: #0f2238;
    color: #d2ebff;
    border-radius: 12px;
    border: 1px solid #173b5f;
    padding: 14px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.86rem;
    line-height: 1.4;
    margin: 0;
}

.import-progress-card {
    border-color: #cae2f7;
}

.progress-wrap {
    margin-top: 8px;
}

.progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #285c8e;
    margin-bottom: 8px;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: #e5f2ff;
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid #c7e2fa;
}

#progress-fill {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #43a1ff, #1f79d4);
    transition: width 140ms linear;
}

.integration-steps {
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 8px;
}

.integration-steps li {
    border: 1px solid #d8e9f8;
    border-radius: 11px;
    padding: 10px 12px;
    background: #fbfdff;
    color: #2f5f8e;
}

.integration-steps li.active {
    border-color: #81bdf0;
    background: #eaf5ff;
    color: #0f4f89;
    font-weight: 600;
}

.integration-steps li.done {
    border-color: #a9e0bd;
    background: #edfdf2;
    color: #157a42;
}

.start-btn {
    margin-top: 14px;
}

.import-action-row {
    margin-top: 14px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.import-action-row .start-btn {
    margin-top: 0;
}

.start-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

@media (max-width: 980px) {
    body.dashboard-page {
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        overflow: auto;
    }

    .dashboard-shell {
        min-height: auto;
        height: auto;
        max-height: none;
        grid-template-columns: 1fr;
        overflow: visible;
    }

    .sidebar {
        grid-template-rows: auto;
        gap: 12px;
        height: auto;
        max-height: none;
        overflow: visible;
    }

    .sidebar-nav {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .invest-popup {
        position: static;
        width: 100%;
        max-height: none;
        margin-top: 4px;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        padding: 8px;
    }

    .hero-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .grid-cards {
        grid-template-columns: 1fr;
    }

    .settings-tabs {
        overflow-x: auto;
        white-space: nowrap;
    }

    .create-user-form {
        grid-template-columns: 1fr 1fr;
    }

    .meta-row {
        grid-template-columns: 1fr;
    }

    .model-choice-grid {
        grid-template-columns: 1fr 1fr;
    }

    .custom-grid {
        grid-template-columns: 1fr;
    }

    .quick-model-form {
        grid-template-columns: 1fr 1fr;
    }

    .dsn-filter-grid {
        grid-template-columns: 1fr 1fr;
    }

    .add-block-form {
        grid-template-columns: 1fr 1fr;
    }

    .dsn-tables-filter-row {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 520px) {
    .auth-admin-badge {
        position: static;
        margin-bottom: 14px;
        width: min(420px, 100%);
        flex-direction: column;
        align-items: stretch;
    }

    .auth-card {
        padding: 24px 20px;
    }

    h1 {
        font-size: 1.5rem;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .sidebar-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .topbar-actions {
        width: 100%;
    }

    .create-user-form {
        grid-template-columns: 1fr;
    }

    .model-choice-grid {
        grid-template-columns: 1fr;
    }

    .quick-model-form {
        grid-template-columns: 1fr;
    }

    .dsn-filter-grid {
        grid-template-columns: 1fr;
    }

    .add-block-form {
        grid-template-columns: 1fr;
    }

    .rubriques-import-form .dsn-filter-grid {
        grid-template-columns: 1fr;
    }

    .rubriques-import-actions {
        justify-content: stretch;
    }

    .rubriques-import-btn {
        width: 100%;
        min-width: 0;
    }
}


.ages-main {
    background:
        radial-gradient(circle at 88% 8%, rgba(196, 228, 255, 0.35), transparent 28%),
        #ffffff;
}

.ages-layout {
    margin-top: 18px;
    display: grid;
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.card-soft {
    background: #ffffff;
    border: 1px solid #d7e7f6;
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(16, 82, 140, 0.07);
    padding: 16px;
    min-width: 0;
    overflow: hidden;
}

.ages-filters h3,
.age-chart h3,
.age-table-wrap h3 {
    margin: 0 0 12px;
    color: #0f4374;
}

.ages-filter-form {
    display: grid;
    gap: 10px;
}

.ages-filter-form label {
    margin-bottom: -2px;
    color: #224f7a;
    font-weight: 600;
}

.ages-filter-form select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    border: 1px solid #9bc2e8;
    border-radius: 12px;
    padding: 8px;
    background: #fff;
    font-size: 0.95rem;
}

.ages-filter-form select[multiple] {
    min-height: 120px;
    max-height: 180px;
}

.ages-filter-actions {
    display: flex;
    gap: 8px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.ages-filter-actions button,
.ages-filter-actions .ghost-link {
    flex: 1 1 130px;
}

.ghost-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #c8dcf1;
    text-decoration: none;
    color: #1d5da9;
    font-weight: 600;
    background: #f3f9ff;
}

.ages-content {
    display: grid;
    gap: 14px;
    min-width: 0;
}

.ages-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.kpi-card {
    background: #ffffff;
    border: 1px solid #d7e7f6;
    border-radius: 14px;
    box-shadow: 0 8px 20px rgba(16, 82, 140, 0.07);
    padding: 14px 16px;
    text-align: center;
}

.kpi-card span {
    color: #3d6a94;
    font-weight: 600;
}

.kpi-card strong {
    display: block;
    margin-top: 6px;
    font-size: 2rem;
    color: #0f4374;
}

.age-pie-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 18px;
    align-items: center;
}

.age-pie-visual {
    width: 240px;
    height: 240px;
    border-radius: 50%;
    border: 1px solid #cfe2f5;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.age-pie-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 8px;
    color: #1f4f7a;
    font-weight: 600;
}

.age-pie-list li {
    display: flex;
    align-items: center;
    gap: 8px;
}

.age-pie-total {
    margin-top: 12px;
    font-weight: 700;
    color: #0f4374;
}

.matrix-table .matrix-group td {
    background: #eef6fd;
    font-weight: 700;
}

.matrix-table .matrix-total td {
    background: #fff3d7;
    font-weight: 700;
}

.matrix-table .matrix-diff td {
    background: #eef9ef;
    font-weight: 700;
}

.turnover-bars {
    display: grid;
    gap: 10px;
}

.turnover-row {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
    align-items: center;
}

.turnover-label {
    color: #244f7b;
    font-weight: 700;
    font-size: 0.9rem;
}

.turnover-track {
    width: 100%;
    min-height: 26px;
    background: #f1f7fd;
    border: 1px solid #d4e3f3;
    border-radius: 8px;
    overflow: hidden;
}

.turnover-entry,
.turnover-exit {
    height: 100%;
    min-width: 4px;
    color: #123f66;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
}

.turnover-entry {
    background: linear-gradient(90deg, #87d98f, #b7f0bc);
}

.turnover-exit {
    background: linear-gradient(90deg, #ef9f9f, #f6c4c4);
}

.line-chart-wrap {
    width: 100%;
    overflow-x: auto;
}

.line-chart-svg {
    width: 100%;
    min-width: 720px;
    height: 320px;
    display: block;
}

.line-axis {
    stroke: #c9d9ea;
    stroke-width: 1.5;
}

.line-series {
    fill: none;
    stroke-width: 3;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.line-masse {
    stroke: #4f7de0;
}

.line-net {
    stroke: #ff5f5f;
}


.line-couts {
    stroke: #1c9b6f;
}

.line-grid {
    stroke: #e0ebf5;
    stroke-width: 1;
}

.line-x-label,
.line-y-label,
.line-axis-title {
    fill: #315d88;
    font-size: 10px;
    font-weight: 600;
}

.line-x-label {
    text-anchor: end;
    font-style: italic;
}

.line-y-label {
    text-anchor: end;
}

.age-legend {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 8px;
    color: #315d88;
}

.legend-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 4px;
}

.legend-dot.women {
    background: #d69cff;
}

.legend-dot.men {
    background: #8cbdf0;
}

.age-bars {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.age-row {
    display: grid;
    grid-template-columns: 150px 1px minmax(280px, 1fr) minmax(280px, 1fr);
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.age-label {
    color: #224f7a;
    font-weight: 600;
    font-size: 0.95rem;
}

.age-center-line {
    width: 1px;
    height: 28px;
    background: #c8dcec;
}

.bar-left-wrap,
.bar-right-wrap {
    height: 32px;
    display: flex;
    align-items: center;
    min-width: 0;
}

.bar-left-wrap {
    justify-content: flex-end;
}

.bar-right-wrap {
    justify-content: flex-start;
}

.bar-left,
.bar-right {
    height: 100%;
    border-radius: 8px;
    min-width: 6px;
    display: flex;
    align-items: center;
}

.bar-left {
    justify-content: flex-end;
    padding-right: 8px;
    background: linear-gradient(90deg, #b97fe9, #d6a4ff);
    color: #ffffff;
}

.bar-right {
    justify-content: flex-start;
    padding-left: 8px;
    background: linear-gradient(90deg, #7aaede, #a7ccf0);
    color: #ffffff;
}

.bar-left span,
.bar-right span {
    font-size: 0.88rem;
    font-weight: 700;
}

@media (max-width: 1200px) {
    .age-row {
        grid-template-columns: 130px 1px minmax(200px, 1fr) minmax(200px, 1fr);
    }

    .age-pie-layout {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .turnover-row {
        grid-template-columns: 68px minmax(0, 1fr) minmax(0, 1fr);
    }

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

    .dashboard-columns {
        grid-template-columns: 1fr;
    }

    .export-actions {
        grid-template-columns: 1fr;
    }

    .member-kpis,
    .member-grid,
    .member-grid-wide,
    .revision-kpis,
    .revision-kpis-wide {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 980px) {
    .ages-layout {
        grid-template-columns: 1fr;
    }

    .ages-kpis {
        grid-template-columns: 1fr;
    }

    .age-row {
        grid-template-columns: 110px 1px minmax(120px, 1fr) minmax(120px, 1fr);
        gap: 8px;
    }

    .metric-grid {
        grid-template-columns: 1fr;
    }

    .mini-table-head,
    .mini-table-row,
    .mini-table-head-wide,
    .mini-table-row-wide {
        grid-template-columns: 1fr;
    }

    .member-layout,
    .member-kpis,
    .member-grid,
    .member-grid-wide,
    .revision-kpis,
    .revision-kpis-wide,
    .revision-detail-grid {
        grid-template-columns: 1fr;
    }

    .chatbot-modal {
        padding: 10px;
    }

    .chatbot-dialog {
        width: min(100%, 860px);
        height: min(92vh, 760px);
        max-height: 92vh;
    }

    .chatbot-bubble {
        max-width: 100%;
    }

    .chatbot-suggestion-grid {
        grid-template-columns: 1fr;
    }

    .chatbot-composer-wrap {
        grid-template-columns: 1fr;
    }

    .chatbot-composer-actions {
        justify-content: space-between;
    }
}


.preview-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.preview-expand-btn {
    background: #2f7fd8;
    border: 1px solid #2f7fd8;
    color: #fff;
    border-radius: 10px;
    padding: 8px 12px;
    font-weight: 600;
    cursor: pointer;
}

.preview-expand-btn:hover {
    background: #1f6ec3;
}

.preview-modal {
    position: fixed;
    inset: 0;
    background: rgba(8, 23, 43, 0.52);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.preview-modal.open {
    display: flex;
}

.preview-modal-dialog {
    width: min(96vw, 1600px);
    max-height: 92vh;
    background: #f7fbff;
    border: 1px solid #c5dcf2;
    border-radius: 14px;
    box-shadow: 0 16px 38px rgba(14, 58, 104, 0.25);
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
}

.preview-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #d9e7f6;
    padding: 14px 16px;
}

.preview-modal-header h3 {
    margin: 0;
}

.preview-modal-close {
    border: 1px solid #b8d0e8;
    background: #fff;
    color: #1f4f80;
    border-radius: 8px;
    width: 34px;
    height: 34px;
    cursor: pointer;
    font-size: 1rem;
}

.preview-modal-controls {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid #d9e7f6;
}

.preview-modal-controls select,
.preview-modal-controls input {
    border: 1px solid #9bc2e8;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.95rem;
    background: #fff;
}

.preview-modal-content .users-table {
    min-width: max-content;
    border-collapse: separate;
    border-spacing: 0;
}

.preview-modal-content .users-table thead th {
    position: sticky;
    top: 0;
    z-index: 4;
    background: #e8f1fb;
    box-shadow: inset 0 -1px 0 #c9ddf1;
}

.preview-modal-content .users-table tbody td {
    background: #fff;
}

.preview-modal-content {
    overflow: auto;
    padding: 14px 16px 18px;
    max-height: calc(92vh - 146px);
}

@media (max-width: 1024px) {
    .preview-modal-controls {
        grid-template-columns: 1fr;
    }
}

.poste-budget-dialog {
    width: min(96vw, 1720px);
}

.poste-budget-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    padding: 14px 16px 0;
}

#pb-manage-table td,
#pb-manage-table th {
    white-space: nowrap;
}

#pb-manage-table td:nth-child(6),
#pb-manage-table th:nth-child(6) {
    min-width: 240px;
    white-space: normal;
}

#pb-select-all,
#pb-bulk-delete-form .delete-btn {
    min-height: 36px;
}

@media (max-width: 1100px) {
    .poste-budget-grid {
        grid-template-columns: 1fr;
    }
}

.budget-dialog {
    width: min(96vw, 1780px);
}

.budget-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    padding: 14px 16px 0;
}

#b-manage-table td,
#b-manage-table th {
    white-space: nowrap;
}

#b-select-all,
#b-bulk-delete-form .delete-btn {
    min-height: 36px;
}

@media (max-width: 1100px) {
    .budget-grid {
        grid-template-columns: 1fr;
    }
}

.client-switcher-shell {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.35rem 0.45rem;
    border-radius: 1.15rem;
    background: linear-gradient(180deg, rgba(245, 248, 252, 0.98), rgba(231, 238, 246, 0.95));
    border: 1px solid rgba(170, 188, 209, 0.7);
    box-shadow: 0 14px 28px rgba(24, 61, 97, 0.08);
}

.client-switcher-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
}

.client-switcher-mark {
    width: 2.85rem;
    height: 2.85rem;
    border-radius: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: linear-gradient(135deg, #f8b15e, #f29f46);
    color: #fff;
    font-weight: 800;
    font-size: 1.15rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.client-switcher-mark-logo {
    overflow: hidden;
    background: #fff;
}

.client-switcher-mark-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.client-switcher-copy {
    min-width: 0;
}

.client-switcher-copy small {
    display: block;
    margin-bottom: 0.12rem;
    color: #6e86a1;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.client-switcher-copy strong {
    display: block;
    max-width: 14rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #163b61;
    font-size: 1rem;
}

.client-switcher-form {
    flex-shrink: 0;
}

.client-switcher-select {
    min-width: 12rem;
    max-width: 18rem;
    padding: 0.95rem 2.6rem 0.95rem 1rem;
    border-radius: 0.95rem;
    border: 1px solid rgba(174, 190, 209, 0.95);
    background: #fff;
    color: #163b61;
    font-weight: 700;
    outline: none;
}

.client-switcher-select:focus {
    border-color: #3177d5;
    box-shadow: 0 0 0 3px rgba(49, 119, 213, 0.14);
}

@media (max-width: 1180px) {
    .client-switcher-shell {
        width: 100%;
        justify-content: space-between;
    }

    .client-switcher-select {
        min-width: 10rem;
        max-width: 14rem;
    }
}

@media (max-width: 760px) {
    .client-switcher-shell {
        flex-direction: column;
        align-items: stretch;
    }

    .client-switcher-form,
    .client-switcher-select {
        width: 100%;
        max-width: none;
    }
}

@media (min-width: 981px) {
    html,
    body {
        overflow: hidden !important;
    }

    body.dashboard-page {
        position: fixed !important;
        inset: 0 !important;
        width: 100% !important;
        height: 100vh !important;
        height: 100dvh !important;
        min-height: 100vh !important;
        min-height: 100dvh !important;
        overflow: hidden !important;
    }

    .dashboard-shell {
        position: fixed !important;
        inset: 0 !important;
        display: block !important;
        width: 100% !important;
        height: 100vh !important;
        height: 100dvh !important;
        min-height: 100vh !important;
        min-height: 100dvh !important;
        overflow: hidden !important;
    }

    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        width: var(--dashboard-sidebar-width) !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-height: none !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        z-index: 80 !important;
    }

    .dashboard-main {
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        left: var(--dashboard-sidebar-width) !important;
        width: auto !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-height: none !important;
        min-height: 0 !important;
        min-width: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 0 !important;
        padding: var(--dashboard-shell-gap) !important;
        overflow: hidden !important;
    }

    .dashboard-main > .topbar,
    .dashboard-main > .fixed-topbar,
    .dashboard-main > .settings-topbar,
    .dashboard-main > .member-topbar {
        flex: 0 0 auto !important;
        position: relative !important;
        z-index: 20 !important;
    }

    .dashboard-main > .main-scroll-area {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        height: auto !important;
        max-height: none !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        overscroll-behavior: contain !important;
        -webkit-overflow-scrolling: touch !important;
        padding-top: 18px !important;
        padding-bottom: 24px !important;
    }
}
