/* =====================================================
   MBOA TECH FINANCE - Styles principaux
   Thème : Bleu marine, bleu moderne, gris clair
   ===================================================== */

:root {
    --primary: #0a2540;          /* Bleu marine */
    --primary-light: #1a3a5c;
    --accent: #0d6efd;           /* Bleu moderne */
    --accent-hover: #0b5ed7;
    --success: #198754;          /* Vert entrées */
    --danger: #dc3545;           /* Rouge sorties */
    --bg-body: #f0f4f8;          /* Gris clair */
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --sidebar-width: 260px;
    --bottom-nav-height: 64px;
    --radius: 12px;
    --shadow: 0 4px 20px rgba(10, 37, 64, 0.08);
    --shadow-sm: 0 2px 8px rgba(10, 37, 64, 0.06);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    margin: 0;
    min-height: 100vh;
    padding-bottom: var(--bottom-nav-height);
}

/* ========== Sidebar (Desktop) ========== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, var(--primary) 0%, #071a2e 100%);
    color: #fff;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-brand .logo {
    width: 40px;
    height: 40px;
    background: var(--accent);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.sidebar-brand h1 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.sidebar-brand small {
    font-size: 0.7rem;
    opacity: 0.7;
    font-weight: 400;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    overflow-y: auto;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: rgba(255,255,255,0.75);
    border-radius: 10px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    transition: all 0.2s;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

.sidebar-nav .nav-link i {
    width: 22px;
    text-align: center;
    font-size: 1.1rem;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.85rem;
}

/* ========== Main Content ========== */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 1.5rem;
    min-height: 100vh;
}

/* ========== Topbar mobile ========== */
.topbar-mobile {
    display: none;
    background: var(--primary);
    color: #fff;
    padding: 0.75rem 1rem;
    position: sticky;
    top: 0;
    z-index: 1030;
    align-items: center;
    justify-content: space-between;
}

.topbar-mobile .brand {
    font-weight: 700;
    font-size: 1.05rem;
}

/* ========== Bottom Navigation (Mobile) ========== */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: #fff;
    border-top: 1px solid var(--border);
    z-index: 1050;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
}

.bottom-nav .nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 500;
    gap: 0.2rem;
    transition: color 0.2s;
}

.bottom-nav .nav-item i {
    font-size: 1.25rem;
}

.bottom-nav .nav-item.active,
.bottom-nav .nav-item:hover {
    color: var(--accent);
}

/* ========== Cards ========== */
.card {
    background: var(--bg-card);
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s;
}

.card:hover {
    box-shadow: var(--shadow);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.25rem;
    font-weight: 600;
}

.stat-card {
    padding: 1.25rem;
    border-radius: var(--radius);
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
    height: 100%;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

.stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0.5rem 0 0.15rem;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

.stat-card.solde .stat-icon { background: rgba(13, 110, 253, 0.12); color: var(--accent); }
.stat-card.entrees .stat-icon { background: rgba(25, 135, 84, 0.12); color: var(--success); }
.stat-card.sorties .stat-icon { background: rgba(220, 53, 69, 0.12); color: var(--danger); }
.stat-card.ops .stat-icon { background: rgba(108, 117, 125, 0.12); color: #6c757d; }

/* ========== Buttons ========== */
.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.btn-success {
    background: var(--success);
    border-color: var(--success);
}

.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
}

.btn-outline-primary {
    color: var(--accent);
    border-color: var(--accent);
}

/* ========== Tables ========== */
.table {
    margin-bottom: 0;
}

.table thead th {
    background: #f8fafc;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.table td {
    vertical-align: middle;
    font-size: 0.925rem;
}

.badge-entree {
    background: rgba(25, 135, 84, 0.12);
    color: var(--success);
    font-weight: 600;
}

.badge-sortie {
    background: rgba(220, 53, 69, 0.12);
    color: var(--danger);
    font-weight: 600;
}

.amount-entree { color: var(--success); font-weight: 600; }
.amount-sortie { color: var(--danger); font-weight: 600; }

/* ========== Forms ========== */
.form-label {
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
}

.form-control, .form-select {
    border-radius: 8px;
    border-color: var(--border);
    padding: 0.6rem 0.9rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* ========== Login page ========== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, #0a3d6b 50%, #0d6efd 100%);
    padding: 1.5rem;
}

.login-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    width: 100%;
    max-width: 420px;
    padding: 2.5rem 2rem;
}

.login-card .logo-lg {
    width: 64px;
    height: 64px;
    background: var(--primary);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 auto 1.25rem;
}

/* ========== Utilities ========== */
.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.text-entree { color: var(--success) !important; }
.text-sortie { color: var(--danger) !important; }

/* ========== Responsive ========== */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
        padding: 1rem;
        padding-bottom: calc(var(--bottom-nav-height) + 1rem);
    }
    .topbar-mobile {
        display: flex;
    }
    .bottom-nav {
        display: flex;
    }
    body {
        padding-bottom: var(--bottom-nav-height);
    }
}

@media (max-width: 575.98px) {
    .stat-card .stat-value {
        font-size: 1.25rem;
    }
    .page-title {
        font-size: 1.25rem;
    }
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1035;
}
.sidebar-overlay.show {
    display: block;
}
