/* ============================================
   Swifto ERP — Design System
   Base: style.css (étendu)
   ============================================ */

/* --- Import Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* --- Reset & Base --- */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #E6EAF2;
    color: #323C4A;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* --- Scrollbar personnalisée (style Swifto) --- */
::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* --- Sélection --- */
::selection {
    background: #BFDBFE;
    color: #1E40AF;
}

/* --- Container principal --- */
#container {
    height: 100%;
    width: 95%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 0;
}

@media (max-width: 767px) {
    #container {
        min-height: 800px;
        width: 95%;
        margin: 0 auto;
        padding: 0.5rem 0;
    }
}

/* --- Typographie --- */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    color: #5E6163;
    font-weight: 700;
    margin-top: 0;
    line-height: 1.3;
}

code, kbd, pre, .font-mono {
    font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
}

a {
    color: #2563EB;
    text-decoration: none;
    transition: color 0.2s ease;
}
a:hover {
    color: #1D4ED8;
    text-decoration: underline;
}

/* --- Composants utilitaires Swifto --- */

/* Badge circulaire de section */
.sec-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #EFF6FF;
    color: #1A3C5E;
    font-weight: 700;
    font-size: 0.8rem;
    border: 1px solid #BFDBFE;
    flex-shrink: 0;
}

/* Badges d'état (pill) */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 999px;
}
.badge-brouillon   { background: #F1F5F9; color: #475569; border: 1px solid #E2E8F0; }
.badge-opportunite { background: #EFF6FF; color: #1D4ED8; border: 1px solid #BFDBFE; }
.badge-approuve    { background: #D1FAE5; color: #065F46; border: 1px solid #A7F3D0; }
.badge-rejete      { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }
.badge-modifie     { background: #FEF3C7; color: #92400E; border: 1px solid #FDE68A; }
.badge-cloture     { background: #E5E7EB; color: #374151; border: 1px solid #D1D5DB; }
.badge-purple      { background: #F5F3FF; color: #5B21B6; border: 1px solid #C4B5FD; }

/* Alertes */
.alert {
    border-left: 4px solid;
    border-radius: 12px;
    padding: 14px 18px;
}
.alert-info    { background: #EFF6FF; border-color: #3B82F6; }
.alert-warning { background: #FEF3C7; border-color: #F59E0B; }
.alert-danger  { background: #FEE2E2; border-color: #EF4444; }
.alert-success { background: #D1FAE5; border-color: #10B981; }
.alert-tip     { background: #F5F3FF; border-color: #8B5CF6; }

/* Boutons pill */
.btn-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid;
    cursor: pointer;
    transition: all 0.18s ease;
}
.btn-primary  { background: #EFF6FF; color: #1D4ED8; border-color: #BFDBFE; }
.btn-primary:hover { background: #DBEAFE; }
.btn-danger   { background: #FEE2E2; color: #B91C1C; border-color: #FECACA; }
.btn-danger:hover  { background: #FECACA; }
.btn-success  { background: #D1FAE5; color: #065F46; border-color: #A7F3D0; }
.btn-success:hover { background: #A7F3D0; }
.btn-warning  { background: #FEF3C7; color: #92400E; border-color: #FDE68A; }
.btn-warning:hover { background: #FDE68A; }
.btn-neutral  { background: #F1F5F9; color: #475569; border-color: #E2E8F0; }
.btn-neutral:hover { background: #E2E8F0; }
.btn-purple   { background: #F5F3FF; color: #5B21B6; border-color: #C4B5FD; }
.btn-purple:hover  { background: #EDE9FE; }

/* Tables style Swifto */
.doc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.doc-table th {
    background: #F1F5F9;
    color: #334155;
    font-weight: 600;
    padding: 10px 14px;
    text-align: left;
    border-bottom: 2px solid #E2E8F0;
}
.doc-table td {
    padding: 9px 14px;
    border-bottom: 1px solid #F1F5F9;
    vertical-align: top;
    color: #475569;
}
.doc-table tr:last-child td { border-bottom: none; }
.doc-table tr:hover td { background: #F8FAFC; }

/* State chips */
.state-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid;
}

/* Progress bar Swifto */
.progress-track {
    background: #E2E8F0;
    border-radius: 20px;
    height: 8px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    border-radius: 20px;
    background: linear-gradient(90deg, #2563EB, #10B981);
}

/* Gradient text */
.gradient-text {
    background: linear-gradient(135deg, #1A3C5E 0%, #2563EB 50%, #7C3AED 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Ombres Swifto */
.shadow-soft { box-shadow: 0 4px 20px -2px rgba(26, 60, 94, 0.06); }
.shadow-card { box-shadow: 0 10px 30px -5px rgba(26, 60, 94, 0.08); }
.shadow-pill { box-shadow: 0 2px 8px rgba(37, 99, 235, 0.18); }
