/* ============================================================
   style.css — Prévisionnel Financier
   Design System — Grimont.net
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;600;700;800&family=Space+Grotesk:wght@700&display=swap');

/* ---- CSS Variables ---- */
:root {
    --bg-body: #f1f5f9;
    --bg-card: #ffffff;
    --bg-card-alt: #f8fafc;
    --bg-input: #f1f5f9;
    --bg-hover: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --text-faint: #94a3b8;
    --border: #e2e8f0;
    --border-focus: #6366f1;
    --accent: #6366f1;
    --accent-light: #818cf8;
    --accent-bg: rgba(99,102,241,0.08);
    --accent-bg-strong: rgba(99,102,241,0.15);
    --success: #10b981;
    --success-bg: rgba(16,185,129,0.08);
    --warning: #f59e0b;
    --warning-bg: rgba(245,158,11,0.08);
    --danger: #ef4444;
    --danger-bg: rgba(239,68,68,0.08);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.10);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.dark-mode {
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --bg-card-alt: #162032;
    --bg-input: #0f172a;
    --bg-hover: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-faint: #64748b;
    --border: #334155;
    --border-focus: #818cf8;
    --accent: #818cf8;
    --accent-light: #a5b4fc;
    --accent-bg: rgba(129,140,248,0.10);
    --accent-bg-strong: rgba(129,140,248,0.18);
    --success: #34d399;
    --success-bg: rgba(52,211,153,0.10);
    --warning: #fbbf24;
    --warning-bg: rgba(251,191,36,0.10);
    --danger: #f87171;
    --danger-bg: rgba(248,113,113,0.10);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.20);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.25);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.30);
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background var(--transition), color var(--transition);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-faint); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ---- Typography ---- */
h1, h2, h3, h4, h5 { font-family: 'Outfit', sans-serif; font-weight: 700; line-height: 1.3; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }

/* ---- Animations ---- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.2); }
    50% { box-shadow: 0 0 0 8px rgba(99,102,241,0); }
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.animate-fade-in-up {
    opacity: 0;
    animation: fadeInUp 0.5s ease-out forwards;
}

/* ============================================================
   GRIMONT GLOBAL HEADER
   ============================================================ */
.grimont-global-header {
    width: 100%;
    z-index: 1000;
    position: sticky;
    top: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 14px 0;
    font-family: 'Outfit', 'Inter', sans-serif;
    color: #e2e8f0;
    box-sizing: border-box;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
}
.grimont-global-header * { box-sizing: border-box; }
.grimont-global-header .ggh-container {
    max-width: 1152px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.ggh-left { display: flex; align-items: center; gap: 1.5rem; }
.ggh-logo-group {
    display: flex; align-items: center; gap: 0.875rem; text-decoration: none; transition: transform 0.2s ease;
}
.ggh-logo-group:hover { transform: scale(1.02); }
.ggh-logo-box {
    width: 40px; height: 40px; background: linear-gradient(135deg, #2563eb, #7c3aed);
    border-radius: 10px; display: flex; align-items: center; justify-content: center;
    color: white; font-weight: bold; font-size: 1.25rem; border: 1px solid rgba(255,255,255,0.15);
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.25); flex-shrink: 0;
}
.ggh-logo-text {
    font-family: 'Space Grotesk', monospace; font-weight: 800; font-size: 1.2rem;
    color: white; letter-spacing: 0.05em; display: none;
}
.ggh-logo-text span { color: #00f2ff; }
@media (min-width: 640px) { .ggh-logo-text { display: block; } }
.ggh-separator { width: 1px; height: 36px; background-color: rgba(255, 255, 255, 0.1); display: none; }
@media (min-width: 768px) { .ggh-separator { display: block; } }
.ggh-app-info { display: flex; flex-direction: column; justify-content: center; }
.ggh-app-title-group { display: flex; align-items: center; gap: 0.6rem; }
.ggh-app-icon-container {
    width: 32px; height: 32px; border-radius: 8px; background: rgba(30, 41, 59, 1);
    border: 1px solid rgba(255, 255, 255, 0.1); display: flex; align-items: center; justify-content: center;
    font-size: 14px; color: #60a5fa; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); flex-shrink: 0;
}
.ggh-app-name { font-weight: 700; color: white; font-size: 1.05rem; margin: 0; padding: 0; letter-spacing: 0.02em; }
.ggh-app-desc {
    font-size: 0.8rem; color: #94a3b8; max-width: 600px;
    display: none; margin: 4px 0 0 0; padding: 0; line-height: 1.4; font-weight: 300;
}
@media (min-width: 1024px) { .ggh-app-desc { display: block; } }
.ggh-right { display: flex; align-items: center; gap: 1rem; }
.ggh-right button {
    background: rgba(30, 41, 59, 0.6) !important; border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #cbd5e1 !important; width: 40px !important; height: 40px !important;
    border-radius: 50% !important; display: flex !important; align-items: center !important; justify-content: center !important;
    cursor: pointer !important; transition: all 0.2s ease !important; padding: 0 !important; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}
.ggh-right button:hover {
    background: rgba(30, 41, 59, 1) !important; color: white !important; border-color: rgba(255, 255, 255, 0.2) !important; transform: translateY(-1px) !important;
}

/* ============================================================
   APP CONTAINER
   ============================================================ */
.app-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

/* ---- Hero ---- */
.hero {
    text-align: center;
    padding: 2rem 0 1.5rem;
}
.hero h1 {
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.75rem;
}
.hero p {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition), border-color var(--transition);
}
.card:hover {
    box-shadow: var(--shadow-md);
}
.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.card-title i {
    color: var(--accent);
    font-size: 1.1rem;
}

/* ============================================================
   TEMPLATES GRID
   ============================================================ */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}
.template-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0.75rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-card);
    cursor: pointer;
    transition: all var(--transition);
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
}
.template-btn:hover {
    border-color: var(--accent);
    background: var(--accent-bg);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.template-btn.active {
    border-color: var(--accent);
    background: var(--accent-bg-strong);
    color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-bg-strong);
}
.template-btn i {
    font-size: 1.5rem;
    margin-bottom: 0.15rem;
}

/* ============================================================
   FORM
   ============================================================ */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}
@media (max-width: 640px) {
    .form-grid { grid-template-columns: 1fr; }
}
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-group.full-width { grid-column: 1 / -1; }

.form-group label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.form-group label i { color: var(--accent); font-size: 0.85rem; }

input[type="number"],
input[type="text"],
select,
textarea {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    transition: all var(--transition);
    outline: none;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-bg);
}
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%2364748b'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.9rem center;
    padding-right: 2.5rem;
    cursor: pointer;
}
select option {
    background: var(--bg-card);
    color: var(--text-primary);
}
textarea { resize: vertical; min-height: 80px; }

/* ---- Duration Toggle ---- */
.duration-toggle {
    display: flex;
    gap: 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    width: fit-content;
}
.duration-btn {
    padding: 0.55rem 1.2rem;
    border: none;
    background: var(--bg-card);
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}
.duration-btn:not(:last-child) {
    border-right: 1px solid var(--border);
}
.duration-btn.active {
    background: var(--accent);
    color: white;
}
.duration-btn:hover:not(.active) {
    background: var(--bg-hover);
}

/* ---- Ventes Grid ---- */
.ventes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
    gap: 0.6rem;
    margin-top: 0.5rem;
}
.vente-cell {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.vente-cell label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-faint);
    text-transform: none;
    letter-spacing: 0;
}
.vente-cell input {
    padding: 0.5rem 0.6rem;
    font-size: 0.85rem;
    text-align: center;
}

/* ---- Costs Table ---- */
.costs-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border);
    margin-top: 0.5rem;
}
.costs-table thead th {
    background: var(--accent-bg);
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.65rem 0.9rem;
    text-align: left;
}
.costs-table tbody tr {
    transition: background var(--transition);
}
.costs-table tbody tr:nth-child(even) { background: var(--bg-card-alt); }
.costs-table tbody tr:hover { background: var(--accent-bg); }
.costs-table td {
    padding: 0.55rem 0.9rem;
    font-size: 0.88rem;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
    vertical-align: middle;
}
.costs-table td:first-child {
    font-weight: 500;
    color: var(--text-primary);
}
.costs-table td input {
    padding: 0.4rem 0.5rem;
    font-size: 0.85rem;
    width: 120px;
    text-align: right;
}
.costs-table tfoot td {
    font-weight: 700;
    color: var(--accent);
    background: var(--accent-bg);
    border-top: 2px solid var(--border);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.4rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    box-shadow: 0 4px 15px rgba(99,102,241,0.3);
}
.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(99,102,241,0.4);
}
.btn-secondary {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--text-faint);
}
.btn-danger {
    background: transparent;
    color: var(--danger);
    border: 1px solid var(--danger);
}
.btn-danger:hover {
    background: var(--danger-bg);
}
.btn-export-png {
    background: var(--bg-card-alt);
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 0.45rem 0.9rem;
    font-size: 0.8rem;
}
.btn-export-png:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-group {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* ============================================================
   LOADING
   ============================================================ */
.loading-overlay {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 3rem;
}
.loading-overlay.active { display: flex; }
.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.95rem;
    animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ============================================================
   RESULTS WRAPPER
   ============================================================ */
.results-wrapper {
    display: none;
}
.results-wrapper.active {
    display: block;
    animation: fadeInUp 0.5s ease-out;
}

.results-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}
.results-actions h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
}
.results-actions-btns {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.edit-hint {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    background: var(--accent-bg);
    border: 1px solid var(--accent-bg-strong);
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 500;
}

/* ============================================================
   DELIVERABLES
   ============================================================ */
.deliverable {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    animation: fadeInUp 0.4s ease-out;
}
.deliverable-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.deliverable-title {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}
.deliverable-title i {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}
.icon-blue { background: rgba(59,130,246,0.12); color: #3b82f6; }
.icon-purple { background: rgba(139,92,246,0.12); color: #8b5cf6; }
.icon-green { background: rgba(16,185,129,0.12); color: #10b981; }
.icon-orange { background: rgba(245,158,11,0.12); color: #f59e0b; }
.icon-red { background: rgba(239,68,68,0.12); color: #ef4444; }
.icon-cyan { background: rgba(6,182,212,0.12); color: #06b6d4; }
.icon-pink { background: rgba(236,72,153,0.12); color: #ec4899; }
.icon-indigo { background: rgba(99,102,241,0.12); color: #6366f1; }

/* ---- Scenario tabs ---- */
.scenario-tabs {
    display: flex;
    gap: 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    margin-bottom: 1.25rem;
    width: fit-content;
}
.scenario-tab {
    padding: 0.5rem 1.2rem;
    border: none;
    background: var(--bg-card);
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}
.scenario-tab:not(:last-child) {
    border-right: 1px solid var(--border);
}
.scenario-tab.active-bas {
    background: var(--danger-bg);
    color: var(--danger);
}
.scenario-tab.active-realiste {
    background: var(--accent-bg);
    color: var(--accent);
}
.scenario-tab.active-haut {
    background: var(--success-bg);
    color: var(--success);
}

/* ---- Data Tables ---- */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border);
    font-size: 0.88rem;
}
.data-table thead th {
    background: var(--bg-card-alt);
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.7rem 1rem;
    text-align: left;
    position: sticky;
    top: 0;
}
.data-table tbody tr {
    transition: background var(--transition);
}
.data-table tbody tr:nth-child(even) { background: var(--bg-card-alt); }
.data-table tbody tr:hover { background: var(--accent-bg); }
.data-table td {
    padding: 0.6rem 1rem;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
}
.data-table td[contenteditable="true"] {
    cursor: text;
    border-radius: 4px;
    transition: background var(--transition);
}
.data-table td[contenteditable="true"]:hover {
    background: var(--accent-bg);
}
.data-table td[contenteditable="true"]:focus {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
    background: var(--accent-bg);
}
.data-table .row-label {
    font-weight: 600;
    color: var(--text-primary);
}
.data-table .row-total {
    font-weight: 700;
    background: var(--accent-bg) !important;
    color: var(--accent);
}
.data-table .positive { color: var(--success); font-weight: 600; }
.data-table .negative { color: var(--danger); font-weight: 600; }

.table-scroll {
    overflow-x: auto;
}

/* ---- KPI Cards Grid ---- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}
.kpi-card {
    background: var(--bg-card-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    text-align: center;
    transition: all var(--transition);
}
.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.kpi-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}
.kpi-value {
    font-family: 'Outfit', sans-serif;
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 0.15rem;
}
.kpi-sub {
    font-size: 0.78rem;
    color: var(--text-faint);
}
.kpi-value.positive { color: var(--success); }
.kpi-value.negative { color: var(--danger); }
.kpi-value.neutral { color: var(--accent); }

/* ---- Charts ---- */
.chart-container {
    position: relative;
    height: 350px;
    width: 100%;
    margin: 1rem 0;
}
.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
@media (max-width: 768px) {
    .charts-grid { grid-template-columns: 1fr; }
    .chart-container { height: 280px; }
}
.chart-title {
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ---- Conseil Box ---- */
.conseil-box {
    background: var(--warning-bg);
    border: 1px solid rgba(245,158,11,0.2);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin-top: 1rem;
}
.conseil-box h4 {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--warning);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.conseil-box ul {
    list-style: none;
    padding: 0;
}
.conseil-box li {
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 0.3rem 0;
    padding-left: 1.2rem;
    position: relative;
}
.conseil-box li::before {
    content: "💡";
    position: absolute;
    left: 0;
    top: 0.3rem;
    font-size: 0.75rem;
}

/* ---- Sources ---- */
.sources-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}
@media (max-width: 640px) {
    .sources-grid { grid-template-columns: 1fr; }
}
.source-card {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-card-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all var(--transition);
    text-decoration: none;
    color: inherit;
}
.source-card:hover {
    border-color: var(--accent);
    background: var(--accent-bg);
    transform: translateY(-1px);
}
.source-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--accent-bg);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}
.source-info h4 {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
    line-height: 1.3;
}
.source-info p {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.4;
}
.source-type {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    background: var(--accent-bg);
    color: var(--accent);
    margin-top: 0.3rem;
}

/* ---- Bilan Visual ---- */
.bilan-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
@media (max-width: 640px) {
    .bilan-container { grid-template-columns: 1fr; }
}
.bilan-side {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.bilan-side-header {
    padding: 0.75rem 1rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.bilan-actif .bilan-side-header {
    background: rgba(59,130,246,0.10);
    color: #3b82f6;
    border-bottom: 2px solid rgba(59,130,246,0.2);
}
.bilan-passif .bilan-side-header {
    background: rgba(139,92,246,0.10);
    color: #8b5cf6;
    border-bottom: 2px solid rgba(139,92,246,0.2);
}
.bilan-row {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem 1rem;
    font-size: 0.88rem;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}
.bilan-row:hover { background: var(--accent-bg); }
.bilan-row:last-child { border-bottom: none; }
.bilan-row-label { color: var(--text-secondary); }
.bilan-row-value { font-weight: 600; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.bilan-row-total {
    font-weight: 700;
    background: var(--bg-card-alt);
    color: var(--accent);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 480px) {
    .app-container { padding: 1rem; }
    .hero h1 { font-size: 1.5rem; }
    .hero p { font-size: 0.9rem; }
    .card { padding: 1.25rem; }
    .deliverable { padding: 1rem; }
    .templates-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
    .btn-group { flex-direction: column; }
    .btn-group .btn { width: 100%; justify-content: center; }
    .results-actions { flex-direction: column; align-items: flex-start; }
    .kpi-grid { grid-template-columns: 1fr 1fr; }
    .kpi-value { font-size: 1.3rem; }
    .bilan-container { grid-template-columns: 1fr; }
}

/* ---- Print ---- */
@media print {
    .grimont-global-header, .ggh-right, .btn, .edit-hint, .results-actions-btns { display: none !important; }
    body { background: white; color: black; }
    .card, .deliverable { break-inside: avoid; box-shadow: none; border: 1px solid #ddd; }
}
