/* mandatum-tokens.css */
/* Mandatum Design System v1.0 — Design Tokens */

:root {
    /* ── Brand ── */
    --bordeaux: #6E2039;
    --bordeaux-clair: #8A2B49;
    --bordeaux-fonce: #2C0E19;
    --sidebar-from: #3D1322;
    --sidebar-to: #2C0E19;

    /* Champagne / accent */
    --champagne: #B89058;
    --champagne-dark: #8C6A3A;
    --champagne-light: #C99A4E;

    /* Neutrals */
    --encre: #241319;
    --fond: #EDE7E0;
    --paper: #F4EFEA;
    --paper-alt: #FBF8F5;
    --carte: #FFFFFF;
    --texte-clair: #EBD9DF;
    --texte-muted: rgba(36, 19, 25, 0.58);
    --border-subtle: rgba(36, 19, 25, 0.09);
    --border-medium: rgba(36, 19, 25, 0.14);

    /* Semantic status */
    --stat-conforme-bg: #E3F0E8;
    --stat-conforme: #2F6B4F;
    --stat-attention-bg: #F8ECD4;
    --stat-attention: #9A6B1E;
    --stat-critique-bg: #F6DEDE;
    --stat-critique: #A23A3A;
    --stat-encours-bg: #E6E0F0;
    --stat-encours: #5A3E8C;
    --stat-echu-bg: #ECE7E4;
    --stat-echu: #6B5B5F;
    --tag-perimetre-bg: #F0E6E0;
    --tag-perimetre: #6E2039;

    /* Data viz */
    --chart-teal: #5A7E8C;
    --chart-sand: #F0E6E0;

    /* Typography */
    --font-display: 'Spectral', Georgia, 'Times New Roman', serif;
    --font-body: 'Instrument Sans', system-ui, -apple-system, sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

    /* Radii (charte §07) */
    --radius-tag: 6px;
    --radius-btn: 10px;
    --radius-card: 14px;
    --radius-badge: 20px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;

    /* Spacing scale */
    --space-xs: 8px;
    --space-sm: 12px;
    --space-md: 16px;
    --space-lg: 18px;
    --space-xl: 22px;
    --space-2xl: 30px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(36 19 25 / 0.04);
    --shadow-md: 0 4px 6px -1px rgb(36 19 25 / 0.06), 0 2px 4px -2px rgb(36 19 25 / 0.04);
    --shadow-lg: 0 10px 15px -3px rgb(36 19 25 / 0.08), 0 4px 6px -4px rgb(36 19 25 / 0.04);

    /* Legacy aliases (compatibilité vues existantes) */
    --primary: 345, 55%, 28%;
    --primary-light: 38, 42%, 53%;
    --primary-dark: 345, 55%, 22%;
    --slate-900: 350, 25%, 12%;
    --slate-800: 350, 20%, 16%;
    --slate-600: 350, 8%, 40%;
    --slate-400: 30, 10%, 68%;
    --slate-200: 30, 15%, 90%;
    --slate-100: 30, 20%, 96%;
    --danger: 0, 55%, 45%;
    --success: 150, 35%, 30%;
    --warning: 38, 68%, 36%;
    --bg-body: 30, 22%, 91%;
    --bg-surface: 0, 0%, 100%;
    --bg-sidebar: 345, 50%, 14%;
    --text-main: 350, 25%, 12%;
    --text-muted: 350, 8%, 40%;
    --text-light: 350, 30%, 92%;
    --border-color: 30, 15%, 90%;
}

/* mandatum-components.css */
/* Mandatum Design System v1.0 — Shell & composants (Phase 2) */

/* ── Language switcher ── */
.lang-switcher {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background: rgba(36, 19, 25, 0.06);
    border-radius: var(--radius-btn);
    padding: 3px;
    margin-right: 1rem;
}

.lang-switcher a {
    display: inline-block;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--texte-muted);
    border-radius: 7px;
    letter-spacing: 0.04em;
    transition: all 0.2s ease;
}

.lang-switcher a:hover {
    color: var(--encre);
}

.lang-switcher a.active {
    background: var(--carte);
    color: var(--bordeaux);
    box-shadow: var(--shadow-sm);
}

.sidebar .lang-switcher {
    background: rgba(255, 255, 255, 0.08);
    margin: 1rem 0 0;
    width: 100%;
    justify-content: center;
}

.sidebar .lang-switcher a {
    color: rgba(235, 217, 223, 0.6);
    flex: 1;
    text-align: center;
}

.sidebar .lang-switcher a:hover {
    color: var(--texte-clair);
}

.sidebar .lang-switcher a.active {
    background: rgba(235, 217, 223, 0.15);
    color: var(--champagne);
    box-shadow: none;
}

/* ── Brand block (sidebar) ── */
.brand-block {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-mark {
    width: 50px;
    height: 50px;
    border-radius: 13px;
    background: linear-gradient(140deg, var(--champagne), var(--champagne-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.625rem;
    color: var(--bordeaux-fonce);
    line-height: 1;
}

.brand-name {
    font-family: var(--font-display);
    font-size: 1.375rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.2;
}

.brand-tagline {
    font-size: 0.625rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--champagne);
    font-weight: 600;
    margin-top: 2px;
}

/* ── App header ── */
.app-header {
    position: sticky;
    top: 0;
    background: rgba(251, 248, 245, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    margin: -2.5rem -2.5rem 2.5rem -2.5rem;
    padding: 1.25rem 2.5rem;
    z-index: 40;
    border-bottom: 1px solid var(--border-subtle);
}

.app-header h1 {
    font-family: var(--font-display);
    font-size: 2.125rem;
    font-weight: 600;
    color: var(--encre);
    margin-bottom: 0.15rem;
    letter-spacing: -0.015em;
}

.app-header .page-subtitle {
    font-size: 0.875rem;
    color: var(--texte-muted);
}

.user-profile-block {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bordeaux);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.9rem;
}

.user-name {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--encre);
}

.user-role {
    font-size: 0.7rem;
    color: var(--texte-muted);
    font-family: var(--font-mono);
}

/* ── Nav section label ── */
.nav-section-label {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.6875rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--champagne);
    font-weight: 600;
    padding-left: 1rem;
    opacity: 0.7;
}

.nav-divider {
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
}

/* ── Login page ── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--fond);
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
    background: var(--carte);
    border-radius: var(--radius-card);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-lg);
}

.login-brand {
    text-align: center;
    margin-bottom: 2rem;
}

.login-error {
    background: var(--stat-critique-bg);
    color: var(--stat-critique);
    padding: 0.75rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    text-align: center;
    border: 1px solid rgba(162, 58, 58, 0.2);
}

.login-footer {
    text-align: center;
    margin-top: 2rem;
    border-top: 1px solid var(--border-subtle);
    padding-top: 1.5rem;
}

.login-lang {
    display: flex;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.login-2fa-code {
    font-size: 1.5rem !important;
    letter-spacing: 0.35em;
    text-align: center;
    font-family: var(--font-mono);
    padding: 0.85rem 1rem !important;
}

.login-account {
    text-align: center;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    color: var(--muted);
}

/* style.css */
/* Mandatum Governance Suite — Main stylesheet */




* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--fond);
    color: var(--encre);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 270px;
    background: linear-gradient(180deg, var(--sidebar-from) 0%, var(--sidebar-to) 100%);
    color: var(--texte-clair);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 50;
}

.main-content {
    flex: 1;
    margin-left: 270px;
    padding: 2.5rem;
    max-width: 1600px;
    width: calc(100% - 270px);
}

.logo {
    margin-bottom: 0;
    display: flex;
    justify-content: center;
    padding-bottom: 0;
    border-bottom: none;
}

/* Navigation */
.nav-link {
    display: flex;
    align-items: center;
    padding: 0.65rem 0.85rem;
    color: rgba(235, 217, 223, 0.75);
    text-decoration: none;
    border-radius: 9px;
    margin-bottom: 0.25rem;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.84rem;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background-color: rgba(235, 217, 223, 0.08);
    color: var(--texte-clair);
}

.nav-link.active {
    background-color: rgba(235, 217, 223, 0.12);
    color: #fff;
    border-left-color: var(--champagne);
}

.nav-icon {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    vertical-align: middle;
    opacity: 0.8;
    flex-shrink: 0;
}

.nav-link:hover .nav-icon,
.nav-link.active .nav-icon {
    opacity: 1;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--encre);
    margin-bottom: 0.6em;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

h1 { font-size: 2.125rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

p { margin-bottom: 1rem; }

.text-muted { color: var(--texte-muted); }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-danger { color: var(--stat-critique); }
.text-mono { font-family: var(--font-mono); }
.label-caps {
    font-size: 0.6875rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--bordeaux-clair);
}

/* Cards */
.card {
    background: var(--carte);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-sm);
    padding: 1.75rem;
    border: 1px solid var(--border-subtle);
    margin-bottom: 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.link-card {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.link-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(110, 32, 57, 0.15);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1rem;
    border-radius: var(--radius-btn);
    font-weight: 600;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    text-decoration: none;
    gap: 0.5rem;
    line-height: 1.2;
    font-family: var(--font-body);
}

.btn-primary {
    background-color: var(--bordeaux);
    color: #fff;
    box-shadow: 0 2px 4px rgba(110, 32, 57, 0.25);
}

.btn-primary:hover {
    background-color: var(--bordeaux-fonce);
    box-shadow: 0 4px 8px rgba(110, 32, 57, 0.3);
    transform: translateY(-1px);
}

.btn-outline {
    background-color: var(--carte);
    border-color: var(--border-medium);
    color: var(--encre);
}

.btn-outline:hover {
    background-color: var(--paper);
    border-color: var(--bordeaux-clair);
    color: var(--bordeaux);
}

.btn-ghost {
    background: transparent;
    color: var(--bordeaux-clair);
    padding: 0.625rem 0.5rem;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
}

/* Forms */
input, select, textarea {
    width: 100%;
    padding: 0.625rem 0.8125rem;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-btn);
    font-family: inherit;
    font-size: 0.875rem;
    color: var(--encre);
    background-color: var(--carte);
    transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--bordeaux-clair);
    box-shadow: 0 0 0 3px rgba(138, 43, 73, 0.1);
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--bordeaux-clair);
}

.form-group {
    margin-bottom: 1.25rem;
}

/* Tables */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-card);
    border: 1px solid var(--border-subtle);
    background: var(--carte);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 0.875rem 1.25rem;
    background-color: var(--paper-alt);
    font-weight: 600;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--bordeaux-clair);
    border-bottom: 1px solid var(--border-subtle);
}

td {
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--encre);
    vertical-align: middle;
    font-size: 0.875rem;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background-color: rgba(110, 32, 57, 0.02); }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.625rem;
    border-radius: var(--radius-badge);
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.4;
    background-color: var(--stat-echu-bg);
    color: var(--stat-echu);
}

.badge-active,
.badge-success {
    background-color: var(--stat-conforme-bg);
    color: var(--stat-conforme);
}

.badge-warning {
    background-color: var(--stat-attention-bg);
    color: var(--stat-attention);
}

.badge-danger {
    background-color: var(--stat-critique-bg);
    color: var(--stat-critique);
}

.badge-tag {
    border-radius: var(--radius-tag);
    background-color: var(--tag-perimetre-bg);
    color: var(--tag-perimetre);
    font-size: 0.625rem;
    padding: 2px 8px;
}

/* Utilities */
.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mb-4 { margin-bottom: 1.5rem; }
.mb-6 { margin-bottom: 2.5rem; }
.mt-6 { margin-top: 2.5rem; }
.w-full { width: 100%; }

.fade-in {
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    border: 1px solid transparent;
}

.alert-info {
    background-color: rgba(90, 126, 140, 0.1);
    border-color: rgba(90, 126, 140, 0.2);
    color: #3E6B7A;
}

.alert-danger {
    background-color: var(--stat-critique-bg);
    border-color: rgba(162, 58, 58, 0.2);
    color: var(--stat-critique);
}

.alert-success {
    background-color: var(--stat-conforme-bg);
    border-color: rgba(47, 107, 79, 0.2);
    color: var(--stat-conforme);
}

.alert-warning {
    background-color: var(--stat-attention-bg);
    border-color: rgba(154, 107, 30, 0.2);
    color: var(--stat-attention);
}

/* Dashboard grid helper */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.dashboard-grid .link-card h4 {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--bordeaux-clair);
}

.dashboard-grid .link-card > div:nth-child(2) {
    font-family: var(--font-display);
    font-size: 2.25rem;
    font-weight: 600;
    color: var(--bordeaux);
}
