/* ================================================================
   Compta SaaS — URILCO 67
   Thème bleu ardoise (Tailwind Slate/Blue)
   ================================================================ */

/* ── Variables partagees ── */
:root {
    --color-text: #1e293b;
    --color-muted: #6b7280;
    --color-border: #e5e7eb;
    --color-border-light: #f3f4f6;
    --color-bg: #f8fafc;
    --color-white: #fff;
    --color-success: #059669;
    --color-success-bg: #d1fae5;
    --color-danger: #dc2626;
    --color-danger-bg: #fee2e2;
    --color-info: #1d4ed8;
    --color-info-bg: #dbeafe;
    --color-warning: #d97706;
    --color-warning-bg: #fef3c7;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
    --shadow-md: 0 4px 20px rgba(0,0,0,.12);
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: "Segoe UI", "Arial", sans-serif;
    font-size: 14px;
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.5;
}

/* ── Classes utilitaires partagees ── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead th {
    background: #f9fafb; padding: 8px 10px; font-size: 11px;
    font-weight: 600; color: var(--color-muted); text-transform: uppercase;
    letter-spacing: 0.5px; border-bottom: 1px solid var(--color-border);
    text-align: left;
}
.data-table tbody td {
    padding: 8px 10px; border-bottom: 1px solid var(--color-border-light);
    vertical-align: middle;
}

a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout principal (sidebar + contenu) ── */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar (Style F — Slate moyen + pill active) ── */
.sidebar {
    width: 220px;
    min-width: 220px;
    background: #334155;
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    padding: 0;
}

.sidebar-title {
    color: #a5b4fc;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    padding: 18px 16px 14px;
    border-bottom: 1px solid #475569;
    letter-spacing: 0.5px;
}

.sidebar-section {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px 18px 4px;
    color: #94a3b8;
    font-weight: 600;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    margin: 1px 10px;
    color: #cbd5e1;
    font-size: 13px;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.15s;
}

.nav-link:hover {
    background: #475569;
    text-decoration: none;
}

.nav-link.active {
    background: #6366f1;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}

.nav-icon {
    display: inline-block;
    width: 20px;
    text-align: center;
    font-size: 14px;
    flex-shrink: 0;
}

.sidebar-sep {
    border-top: 1px solid #475569;
    margin: 6px 14px;
}

.sidebar-spacer { flex: 1; }

.sidebar-user {
    border-top: 1px solid #475569;
    padding: 12px 18px 8px;
}

.user-name {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #e2e8f0;
}

.user-asso {
    display: block;
    font-size: 11px;
    color: #94a3b8;
    margin-bottom: 6px;
}

.logout-link {
    font-size: 12px;
    padding: 6px 0 !important;
    color: #94a3b8 !important;
}

.logout-link:hover {
    color: #f87171 !important;
    background: transparent !important;
}

/* ── Zone principale ── */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* ── Header ── */
.top-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
    padding: 0 20px;
    background: #e2e8f0;
    border-bottom: 1px solid #cbd5e1;
}

.page-title {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.exercice-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.exercice-selector label {
    color: #475569;
    font-weight: 600;
}

.exercice-selector select {
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 13px;
    background: #fff;
    color: #1e293b;
}

/* ── Bandeau clôturé ── */
.banner-cloture {
    background: #f0c040;
    color: #1e293b;
    text-align: center;
    padding: 6px 12px;
    font-weight: 700;
    font-size: 13px;
}

/* ── Contenu page ── */
.page-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

/* ── Cartes (Dashboard) ── */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}

.card {
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 16px 18px;
}

.card-wide {
    grid-column: span 2;
}

.card-label {
    color: #64748b;
    font-size: 12px;
    margin-bottom: 4px;
}

.card-value {
    font-family: "Consolas", "Courier New", monospace;
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
}

.card-sub {
    color: #64748b;
    font-size: 11px;
    margin-top: 4px;
}

/* ── Graphiques barres (Dashboard) ── */
.charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.chart-box {
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 16px 18px;
}

.chart-title {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 12px;
}

.bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.bar-label {
    width: 200px;
    min-width: 200px;
    font-size: 11px;
    color: #334155;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bar-track {
    flex: 1;
    height: 18px;
    background: #f1f5f9;
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 4px;
    min-width: 3px;
    transition: width 0.3s ease;
}

.bar-red { background: #dc2626; }
.bar-green { background: #3a7d44; }

.bar-value {
    width: 80px;
    min-width: 80px;
    font-family: "Consolas", monospace;
    font-size: 11px;
    color: #1e293b;
    text-align: right;
}

/* ── Dashboard AE ── */
/* ── Widgets dashboard AE ── */
.ae-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.widget {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    border-left: 4px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    transition: box-shadow 0.2s ease;
}
.widget:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.04);
}
.widget-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}
.widget-icon {
    font-size: 20px;
    line-height: 1;
}
.widget-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
}
.widget-value {
    font-size: 26px;
    font-weight: 700;
    color: #1e293b;
    font-family: "Consolas", "Courier New", monospace;
    margin-bottom: 12px;
}
.widget-value small {
    font-size: 14px;
    font-weight: 500;
    color: #94a3b8;
}
.widget-details {
    border-top: 1px solid #f1f5f9;
    padding-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.widget-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #94a3b8;
}
.widget-detail-val {
    font-weight: 600;
    color: #475569;
    font-family: "Consolas", "Courier New", monospace;
}
/* Couleurs des bordures */
.widget-ca { border-left-color: #10b981; }
.widget-dep { border-left-color: #ef4444; }
.widget-resultat { border-left-color: #3b82f6; }
.widget-urssaf { border-left-color: #f59e0b; }
.widget-vfl { border-left-color: #8b5cf6; }

.ae-seuil-container {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 20px;
}
.ae-seuil-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.ae-seuil-title {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}
.ae-seuil-detail {
    font-size: 12px;
    color: #64748b;
    font-family: "Consolas", monospace;
}
.ae-seuil-bar {
    width: 100%;
    height: 10px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}
.ae-seuil-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #0891b2, #06b6d4);
    transition: width 0.6s ease;
}
.ae-seuil-fill.warning {
    background: linear-gradient(90deg, #f59e0b, #ef4444);
}
.ae-seuil-alert {
    margin-top: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #dc2626;
}

.ae-recent {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px 20px;
}
.ae-recent-title {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 12px;
}

/* ── Filtres ── */
.filters-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-group label {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
}

.filter-group select {
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 13px;
    background: #fff;
    min-width: 130px;
}

/* ── Tableaux ── */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: #fff;
    border: 1px solid #cbd5e1;
}

.data-table th {
    background: #e2e8f0;
    color: #1e293b;
    font-weight: 700;
    padding: 8px 10px;
    text-align: left;
    border-bottom: 2px solid #cbd5e1;
    font-size: 12px;
    white-space: nowrap;
}

.data-table td {
    padding: 6px 10px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}

.data-table tbody tr:nth-child(even) {
    background: #f1f5f9;
}

.data-table tbody tr:hover {
    background: #e0ecff;
}

/* Colonnes typées */
.col-date { width: 90px; }
.col-journal { width: 50px; }
.col-compte { width: 90px; }
.col-libelle { }
.col-ana { width: 80px; }
.col-money { width: 110px; text-align: right; }

.money {
    text-align: right;
    font-family: "Consolas", "Courier New", monospace;
    font-size: 12px;
    white-space: nowrap;
}

.mono {
    font-family: "Consolas", "Courier New", monospace;
}

/* Lignes spéciales */
.row-subtotal {
    background: #e2e8f0 !important;
}

.row-subtotal td {
    border-bottom: 1px solid #cbd5e1;
}

.row-total {
    background: #1e293b !important;
    color: #fff;
}

.row-total td {
    padding: 8px 10px;
    font-weight: 700;
    border: none;
}

.row-total .money {
    color: #fff;
}

/* ── Bilan (2 panneaux côte à côte) ── */
.bilan-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 16px;
}

.bilan-heading {
    font-size: 15px;
    font-weight: 700;
    color: #2563eb;
    text-align: center;
    margin-bottom: 10px;
}

.bilan-panel .data-table {
    font-size: 12px;
}

/* ── Barre de contrôle (équilibre) ── */
.control-bar {
    text-align: center;
    padding: 10px 16px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 13px;
    font-family: "Consolas", monospace;
    margin-top: 12px;
}

.control-ok {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.control-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* ── Couleurs sémantiques ── */
.text-red { color: #dc2626; }
.text-green { color: #3a7d44; }
.text-muted { color: #64748b; }
.text-center { text-align: center; }

/* ── Boutons (Style B — arrondi doux + ombres) ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 24px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

.btn-primary {
    background: #6366f1;
    color: #fff;
    box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}

.btn-primary:hover {
    background: #4f46e5;
    box-shadow: 0 4px 12px rgba(99,102,241,0.4);
    text-decoration: none;
    color: #fff;
}

.btn-secondary {
    background: #fff;
    color: #6366f1;
    border: 2px solid #6366f1;
}

.btn-secondary:hover {
    background: #eef2ff;
    text-decoration: none;
    color: #6366f1;
}

.btn-danger {
    background: #f43f5e;
    color: #fff;
    box-shadow: 0 2px 8px rgba(244,63,94,0.3);
}

.btn-danger:hover {
    background: #e11d48;
    box-shadow: 0 4px 12px rgba(244,63,94,0.4);
    text-decoration: none;
    color: #fff;
}

.btn-success {
    background: #10b981;
    color: #fff;
    box-shadow: 0 2px 8px rgba(16,185,129,0.3);
}

.btn-success:hover {
    background: #059669;
    box-shadow: 0 4px 12px rgba(16,185,129,0.4);
    text-decoration: none;
    color: #fff;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
    border-radius: 8px;
}

.btn-full {
    width: 100%;
    padding: 12px;
    font-size: 14px;
}

.btn:disabled {
    background: #94a3b8;
    box-shadow: none;
    cursor: not-allowed;
}

/* ── Formulaires ── */
.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 4px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 14px;
    background: #fff;
    color: #1e293b;
    transition: border-color 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* ── Alertes ── */
.alert {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 14px;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

/* ── Pages d'authentification (login / inscription) ── */
.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

.auth-card {
    background: #fff;
    border-radius: 10px;
    padding: 36px 32px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.auth-title {
    text-align: center;
    color: #2563eb;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 2px;
}

.auth-subtitle {
    text-align: center;
    color: #64748b;
    font-size: 14px;
    margin-bottom: 24px;
}

.auth-footer {
    text-align: center;
    color: #64748b;
    font-size: 13px;
    margin-top: 18px;
}

.auth-footer a {
    font-weight: 600;
}

/* ── Upload card ── */
.upload-card {
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 28px 32px;
    max-width: 520px;
}

.upload-title {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 6px;
}

.upload-desc {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 18px;
    line-height: 1.5;
}

/* ── Import table (inline inputs) ── */
.import-table .input-inline,
.import-table .select-inline,
.input-inline,
.select-inline {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 3px;
    padding: 4px 6px;
    font-size: 12px;
    background: #fff;
    color: #1e293b;
}

.input-inline:focus,
.select-inline:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.10);
}

.input-money {
    text-align: right;
    font-family: "Consolas", monospace;
    width: 100px;
}

/* ── Import row colors ── */
.row-matched {
    background: #dcfce7 !important;
}

.row-unmatched {
    background: #fff7ed !important;
}

.row-doublon {
    background: #fef9c3 !important;
}

/* ── Badges ── */
.badge-ok {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    background: #dcfce7;
    color: #166534;
}

.badge-warn {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    background: #fee2e2;
    color: #991b1b;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .card-wide {
        grid-column: span 1;
    }
    .bilan-grid {
        grid-template-columns: 1fr;
    }
    .charts-row {
        grid-template-columns: 1fr;
    }
    .bar-label {
        width: 140px;
        min-width: 140px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 60px;
        min-width: 60px;
    }
    .sidebar-title { font-size: 12px; padding: 10px 4px; }
    .sidebar-section { display: none; }
    .nav-link { padding: 10px 8px; margin: 1px 4px; font-size: 0; justify-content: center; }
    .nav-icon { font-size: 16px; }
    .sidebar-user { display: none; }
    .cards-grid { grid-template-columns: 1fr; }
    .card-wide { grid-column: span 1; }
    .filters-bar { flex-direction: column; align-items: stretch; }
}

/* ── Portail ── */
.portail-body {
    background: linear-gradient(160deg, #1a1a2e 0%, #2d1f4e 40%, #1e293b 100%);
    min-height: 100vh;
    margin: 0;
    font-family: 'Poppins', "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}
.portail-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 48px 24px;
}

/* ── Header ── */
.portail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4px 24px;
    margin-bottom: 52px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.portail-header-left { display: flex; align-items: center; }
.portail-header-right { display: flex; align-items: center; gap: 10px; }
.portail-asso-name {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, #c084fc, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

/* ── Badges header (plan + logout, meme taille) ── */
.portail-badge {
    display: inline-block;
    color: #fff;
    font-size: 12px;
    padding: 6px 18px;
    border-radius: 20px;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    transition: all 0.25s;
}
.badge-trial {
    background: rgba(124,58,237,0.15);
    border: 1px solid rgba(124,58,237,0.5);
    color: #c084fc;
}
.badge-standard {
    background: #7c3aed;
    border: 1px solid #7c3aed;
    color: #fff;
    box-shadow: 0 2px 10px rgba(124,58,237,0.3);
}
.badge-premium {
    background: linear-gradient(135deg, #d4a017, #f5c842, #d4a017);
    border: 1px solid #f5c842;
    color: #1a1a2e;
    font-weight: 700;
    box-shadow: 0 0 14px rgba(245,200,66,0.5), 0 0 32px rgba(245,200,66,0.2);
    animation: gold-pulse 2.5s ease-in-out infinite;
    text-shadow: 0 1px 2px rgba(255,255,255,0.3);
}
@keyframes gold-pulse {
    0%, 100% { box-shadow: 0 0 14px rgba(245,200,66,0.5), 0 0 32px rgba(245,200,66,0.2); }
    50% { box-shadow: 0 0 20px rgba(245,200,66,0.7), 0 0 48px rgba(245,200,66,0.3); }
}
.badge-contact {
    background: rgba(16,185,129,0.15);
    border: 1px solid rgba(16,185,129,0.5);
    color: #34d399;
}
.badge-contact:hover {
    background: #10b981;
    color: #fff;
    border-color: #10b981;
    box-shadow: 0 0 16px rgba(16,185,129,0.4);
}
.badge-logout {
    background: transparent;
    border: 1px solid rgba(239,68,68,0.5);
    color: #f87171;
}
.badge-logout:hover {
    background: #ef4444;
    color: #fff;
    border-color: #ef4444;
    box-shadow: 0 0 16px rgba(239,68,68,0.4);
}

/* ── Bienvenue ── */
.portail-welcome {
    text-align: center;
    margin-bottom: 48px;
}
.portail-welcome h2 {
    font-size: 34px;
    color: #e2e8f0;
    margin: 0 0 8px;
    font-weight: 300;
}
.portail-welcome p {
    color: #64748b;
    font-size: 16px;
    margin: 0;
}

/* ── Grille de tuiles ── */
.portail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 26px;
}

/* ── Wrapper tuile (halo tournant) ── */
.portail-tile-wrapper {
    position: relative;
    border-radius: 22px;
    display: flex;
    flex-direction: column;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.portail-tile-wrapper:hover { transform: translateY(-8px); }
.portail-tile-wrapper::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 22px;
    background: conic-gradient(from 0deg, #7c3aed, #a855f7, #06b6d4, #3b82f6, #7c3aed);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 0;
}
.portail-tile-wrapper:hover::before {
    opacity: 1;
    animation: portail-spin-glow 3s linear infinite;
}
@keyframes portail-spin-glow {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

/* ── Tuile interieure ── */
.portail-tile,
.portail-tile:hover {
    background: #fff;
    border-radius: 20px;
    padding: 40px 26px 34px;
    text-align: center;
    text-decoration: none;
    color: #1e293b;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    z-index: 1;
}
.portail-tile::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 4px;
    background: linear-gradient(90deg, #4f46e5, #a855f7, #06b6d4);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}
.portail-tile-wrapper:hover .portail-tile {
    background: #1e1b3a;
    color: #e2e8f0;
    box-shadow: 0 0 60px rgba(124,58,237,0.15);
}
.portail-tile-wrapper:hover .portail-tile::before { transform: scaleX(1); }

/* ── Icone ── */
.tile-icon {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    background: var(--tile-color);
    color: #fff;
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    transition: all 0.4s ease;
}
.portail-tile-wrapper:hover .tile-icon {
    transform: scale(1.1);
    box-shadow: 0 8px 28px rgba(124,58,237,0.5);
}

/* ── Texte tuile ── */
.portail-tile h3 {
    font-size: 21px;
    font-weight: 700;
    margin: 0 0 10px;
    transition: all 0.3s;
}
.portail-tile-wrapper:hover .portail-tile h3 {
    background: linear-gradient(135deg, #c084fc, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.portail-tile p {
    font-size: 14px;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
    transition: color 0.3s;
}
.portail-tile-wrapper:hover .portail-tile p { color: #ffffff; }

/* ── Badge tuile ── */
.tile-badge {
    display: inline-block;
    margin-top: 14px;
    font-size: 11px;
    padding: 4px 14px;
    border-radius: 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    font-weight: 600;
}

/* ── Tuile inactive ── */
.tile-inactive {
    opacity: 0.4;
    pointer-events: none;
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .portail-grid { grid-template-columns: 1fr; max-width: 400px; margin: 0 auto; }
    .portail-container { padding: 24px 16px; }
    .portail-header { flex-direction: column; gap: 16px; text-align: center; }
    .portail-header-left { justify-content: center; }
    .portail-header-right { justify-content: center; }
}
