﻿:root {
    --background: #f4f6f8;
    --surface: #ffffff;
    --surface-soft: #f8fafb;
    --text: #18202a;
    --muted: #68727e;
    --border: #dde2e7;
    --primary: #8f1728;
    --primary-dark: #6f1020;
    --sidebar: #161c24;
    --sidebar-soft: #232c37;
    --success: #276749;
    --danger: #a61b1b;
    --radius: 14px;
    --shadow: 0 8px 30px rgba(18, 28, 45, .07);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    color: var(--text);
    background: var(--background);
}

a {
    color: inherit;
}

.layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 250px 1fr;
}

.sidebar {
    min-height: 100vh;
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 26px 18px;
    background: var(--sidebar);
    color: white;
    display: flex;
    flex-direction: column;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px 24px;
    border-bottom: 1px solid rgba(255,255,255,.1);
}

.brand strong,
.brand small {
    display: block;
}

.brand small {
    margin-top: 3px;
    color: #adb7c3;
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-weight: 800;
    letter-spacing: .04em;
    color: white;
    background: var(--primary);
}

.brand-mark.large {
    width: 58px;
    height: 58px;
    font-size: 18px;
}

.navigation {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.navigation a {
    text-decoration: none;
    padding: 11px 12px;
    border-radius: 9px;
    color: #d8dfe6;
    font-size: 14px;
}

.navigation a:hover {
    background: var(--sidebar-soft);
    color: white;
}

.nav-section {
    margin: 18px 12px 5px;
    color: #808c99;
    text-transform: uppercase;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .1em;
}

.sidebar-user {
    margin-top: auto;
    padding: 18px 8px 0;
    border-top: 1px solid rgba(255,255,255,.1);
}

.sidebar-user strong,
.sidebar-user small {
    display: block;
}

.sidebar-user small {
    color: #adb7c3;
    margin-top: 3px;
    text-transform: capitalize;
}

.logout-button {
    width: 100%;
    margin-top: 14px;
    border: 1px solid rgba(255,255,255,.18);
    background: transparent;
    color: white;
    padding: 9px 12px;
    border-radius: 8px;
    cursor: pointer;
}

.logout-button:hover {
    background: var(--sidebar-soft);
}

.content {
    padding: 38px;
    min-width: 0;
}

.page-header {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 28px;
}

.page-header h1 {
    margin: 3px 0 7px;
    font-size: 30px;
}

.eyebrow {
    margin: 0;
    color: var(--primary);
    font-weight: 750;
    font-size: 11px;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.muted {
    color: var(--muted);
}

.snapshot-badge,
.counter-badge {
    background: white;
    border: 1px solid var(--border);
    padding: 9px 13px;
    border-radius: 999px;
    font-size: 13px;
    white-space: nowrap;
}

.metric-grid {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.metric-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 21px;
    text-decoration: none;
}

.metric-card span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 9px;
}

.metric-card strong {
    font-size: 29px;
    line-height: 1;
}

a.metric-card:hover {
    border-color: #c2c9d0;
    transform: translateY(-1px);
}

.dashboard-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 23px;
    box-shadow: var(--shadow);
}

.panel h2 {
    margin: 5px 0 14px;
    font-size: 19px;
}

.quality-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 18px 0;
}

.quality-grid > div {
    background: var(--surface-soft);
    padding: 14px;
    border-radius: 10px;
}

.quality-grid span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 5px;
}

.quality-grid strong {
    font-size: 19px;
}

.details-list {
    margin: 12px 0 18px;
}

.details-list > div {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.details-list dt {
    color: var(--muted);
}

.details-list dd {
    margin: 0;
    font-weight: 600;
    text-align: right;
}

.text-link {
    color: var(--primary);
    font-weight: 650;
    text-decoration: none;
    font-size: 13px;
}

.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}

.search-bar input {
    flex: 1;
    min-width: 180px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 11px 13px;
    font: inherit;
}

.primary-button,
.secondary-button {
    border-radius: 9px;
    padding: 10px 15px;
    font-weight: 650;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
}

.primary-button {
    border: 1px solid var(--primary);
    background: var(--primary);
    color: white;
}

.primary-button:hover {
    background: var(--primary-dark);
}

.secondary-button {
    border: 1px solid var(--border);
    background: white;
    color: var(--text);
}

.inline-button {
    display: inline-block;
}

.table-panel {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.table-scroll {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

thead {
    background: var(--surface-soft);
}

th {
    text-align: left;
    color: #505a65;
    font-weight: 700;
    white-space: nowrap;
}

th,
td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

tbody tr:hover {
    background: #fbfcfd;
}

.empty-cell,
.empty-state {
    text-align: center;
    padding: 36px;
    color: var(--muted);
}

.pagination {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.pagination-actions {
    display: flex;
    gap: 8px;
}

.status-pill {
    display: inline-block;
    padding: 7px 11px;
    border-radius: 999px;
    background: #edf7f1;
    color: var(--success);
    font-size: 12px;
    font-weight: 700;
}

.role-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.role-list span {
    padding: 10px 12px;
    background: var(--surface-soft);
    border-radius: 8px;
    font-size: 13px;
}

.login-layout {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(
            circle at top left,
            rgba(143,23,40,.08),
            transparent 40%
        ),
        var(--background);
}

.login-card {
    width: min(430px, 100%);
    background: white;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 32px;
    box-shadow: var(--shadow);
}

.login-brand {
    display: flex;
    gap: 14px;
    align-items: center;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.login-brand h1 {
    font-size: 20px;
    margin: 0;
}

.login-brand p {
    margin: 5px 0 0;
    color: var(--muted);
}

.login-card h2 {
    margin: 26px 0 6px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin-top: 22px;
}

.login-form label {
    font-size: 13px;
    font-weight: 650;
}

.login-form input {
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 12px;
    font: inherit;
    margin-bottom: 7px;
}

.login-form button {
    margin-top: 6px;
    padding: 12px;
}

.login-footer {
    color: var(--muted);
    font-size: 11px;
    margin-top: 22px;
    text-align: center;
}

.alert {
    border-radius: 9px;
    padding: 11px 13px;
    margin-top: 16px;
    font-size: 13px;
}

.alert-error {
    background: #fff2f2;
    color: var(--danger);
    border: 1px solid #f4c8c8;
}

.error-page {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.error-code {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #fff0f0;
    color: var(--danger);
    font-weight: 800;
    font-size: 24px;
}

@media (max-width: 960px) {

    .layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        min-height: auto;
        height: auto;
    }

    .navigation {
        display: grid;
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .sidebar-user {
        margin-top: 20px;
    }

    .metric-grid,
    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 650px) {

    .content {
        padding: 22px 16px;
    }

    .page-header {
        flex-direction: column;
    }

    .metric-grid,
    .dashboard-grid,
    .quality-grid {
        grid-template-columns: 1fr;
    }

    .navigation {
        grid-template-columns: 1fr;
    }

    .search-bar {
        flex-direction: column;
    }
}

/* Permet d'accéder aux actions utilisateur sur les petits écrans */
.sidebar {
    overflow-y: auto;
}

.sidebar-user {
    flex-shrink: 0;
}


/* ==========================================================
   PORTAL V1.1 - ARCHITECTURE / OPERATIONS
   ========================================================== */

.ops-section {
    margin-top: 30px;
}

.ops-section-header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 16px;
}

.ops-section-header h2 {
    margin: 5px 0 5px;
    font-size: 22px;
}

.ops-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.ops-card-wide {
    grid-column: 1 / -1;
}

.ops-card h3 {
    margin: 5px 0 12px;
    font-size: 19px;
}

.ops-kicker {
    margin: 0;
    color: var(--primary);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.ops-note {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.pipeline-flow {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.pipeline-node {
    padding: 8px 11px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface-soft);
    font-size: 12px;
    font-weight: 700;
}

.pipeline-node-success {
    background: #edf7f1;
    border-color: #c7e5d3;
    color: var(--success);
}

.pipeline-node-rejected {
    background: #fff5f5;
    border-color: #f0d0d0;
    color: var(--danger);
}

.pipeline-arrow {
    color: var(--muted);
    font-weight: 800;
}

.ops-mini-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
}

.ops-mini-list span {
    padding: 10px 12px;
    background: var(--surface-soft);
    border-radius: 8px;
    font-size: 13px;
}

.status-pill-neutral {
    background: #f0f2f5;
    color: #5b6570;
}

@media (max-width: 960px) {

    .ops-grid {
        grid-template-columns: 1fr;
    }

    .ops-card-wide {
        grid-column: auto;
    }
}


.pipeline-rejected-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.pipeline-rejected-line + p {
    margin: 0;
}


.status-pill-danger {
    background: #fdf0f0;
    color: #9d2424;
    border: 1px solid #efcaca;
}

.operations-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.operations-summary > div {
    padding: 18px;
    border-radius: 12px;
    background: #f6f8fa;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.operations-summary strong {
    font-size: 1.65rem;
}

.operations-summary span {
    color: var(--muted);
    font-size: 0.9rem;
}

@media (max-width: 760px) {
    .operations-summary {
        grid-template-columns: 1fr;
    }
}
