/* ============================================================
   DSA MBANK - Charte graphique CLAIRE
   Vert électrique #2FB81F · Bleu royal #2A4CF4 · Fond clair
   ============================================================ */

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

:root {
    --green:        #1faa12;   /* vert lisible sur fond clair */
    --green-bright: #2fb81f;
    --green-dim:    #168a0d;
    --blue:         #2a4cf4;
    --blue-dim:     #1e3ae6;

    --bg:           #f4f7fb;   /* fond général clair */
    --bg-2:         #eef3f9;
    --panel:        #ffffff;   /* cartes blanches */
    --panel-2:      #ffffff;

    --border:       #e2e8f0;
    --border-blue:  #d4ddec;

    --text:         #14202e;   /* texte foncé */
    --text-dim:     #687786;   /* texte secondaire */
    --danger:       #e4344b;

    --radius:       16px;
    --shadow:       0 4px 24px rgba(20, 40, 80, 0.06);
    --shadow-lg:    0 12px 40px rgba(20, 40, 80, 0.12);
    --font:         'Sora', sans-serif;
    --mono:         'Space Mono', monospace;
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Halos d'ambiance doux et clairs */
body::before, body::after {
    content: '';
    position: fixed;
    width: 48vw; height: 48vw;
    border-radius: 50%;
    filter: blur(150px);
    opacity: 0.14;
    z-index: 0;
    pointer-events: none;
}
body::before { background: var(--green-bright); top: -18%; left: -12%; }
body::after  { background: var(--blue);         bottom: -18%; right: -12%; }

.app-wrap { position: relative; z-index: 1; }

/* ---------- Marque / Logo ---------- */
.brand {
    display: flex; align-items: center; gap: .7rem;
    font-weight: 800; letter-spacing: .5px;
    color: var(--text);
}
.brand .logo-mark {
    width: 42px; height: 42px; border-radius: 11px;
    background: linear-gradient(135deg, var(--green-bright), var(--blue));
    display: grid; place-items: center;
    font-family: var(--mono); font-weight: 700; font-size: 1.3rem;
    color: #fff;
    box-shadow: 0 6px 18px rgba(42,76,244,.28);
}
.brand .logo-text { font-size: 1.15rem; }
.brand .logo-text span { color: var(--green); }
.brand .logo-text small { color: var(--blue); }

/* ---------- Cartes / Panneaux ---------- */
.glass {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* ---------- Auth (login / reset) ---------- */
.auth-screen {
    min-height: 100vh;
    display: grid; place-items: center;
    padding: 1.2rem;
}
.auth-card {
    width: 100%; max-width: 430px;
    padding: 2.4rem 2.1rem;
    box-shadow: var(--shadow-lg);
    animation: rise .6s cubic-bezier(.2,.8,.2,1);
}
.auth-card .brand { justify-content: center; margin-bottom: .4rem; }
.auth-title { text-align: center; font-size: 1.5rem; font-weight: 700; margin: 1rem 0 .2rem; }
.auth-sub   { text-align: center; color: var(--text-dim); font-size: .9rem; margin-bottom: 1.8rem; }

@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

/* ---------- Formulaires ---------- */
.field { margin-bottom: 1.15rem; }
.field label {
    display: block; font-size: .8rem; font-weight: 600;
    color: var(--text-dim); margin-bottom: .45rem;
    text-transform: uppercase; letter-spacing: .6px;
}
.field input, .field select, .field textarea {
    width: 100%;
    background: #fbfdff;
    border: 1px solid var(--border-blue);
    border-radius: 11px;
    padding: .85rem 1rem;
    color: var(--text);
    font-family: var(--font); font-size: .95rem;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none;
    background: #fff;
    border-color: var(--green-bright);
    box-shadow: 0 0 0 3px rgba(47,184,31,.13);
}
.field input::placeholder { color: #9aa7b5; }

/* ---------- Boutons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    border: none; cursor: pointer;
    font-family: var(--font); font-weight: 600; font-size: .95rem;
    padding: .85rem 1.4rem; border-radius: 11px;
    transition: transform .15s, box-shadow .25s, opacity .2s, filter .2s;
    text-decoration: none;
}
.btn:active { transform: scale(.98); }
.btn-primary {
    width: 100%;
    background: linear-gradient(100deg, var(--green-bright), var(--green-dim));
    color: #fff;
    box-shadow: 0 8px 22px rgba(47,184,31,.28);
}
.btn-primary:hover { box-shadow: 0 10px 28px rgba(47,184,31,.4); filter: brightness(1.04); }
.btn-blue {
    background: linear-gradient(100deg, var(--blue), var(--blue-dim));
    color: #fff;
    box-shadow: 0 8px 22px rgba(42,76,244,.28);
}
.btn-blue:hover { filter: brightness(1.05); }
.btn-ghost {
    background: #fff; color: var(--text-dim);
    border: 1px solid var(--border-blue);
}
.btn-ghost:hover { color: var(--text); border-color: var(--green-bright); }
.btn-danger { background: #fdecee; color: var(--danger); border: 1px solid #f6c9cf; }
.btn-danger:hover { background: #fbdfe2; }
.btn-sm { padding: .5rem .85rem; font-size: .82rem; }

.link { color: var(--green); text-decoration: none; font-weight: 600; }
.link:hover { text-decoration: underline; }
.text-center { text-align: center; }
.mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }

/* ---------- Alertes ---------- */
.alert {
    border-radius: 11px; padding: .85rem 1.1rem; font-size: .88rem;
    margin-bottom: 1.2rem; display: none; border: 1px solid transparent;
}
.alert.show { display: block; animation: rise .3s ease; }
.alert-success { background: #e9f9e6; border-color: #b6e9ad; color: var(--green-dim); }
.alert-error   { background: #fdecee; border-color: #f6c9cf; color: var(--danger); }

/* ---------- Layout dashboard ---------- */
.topbar {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.6rem;
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}
.topbar .user-chip {
    display: flex; align-items: center; gap: .7rem;
}
.user-chip .avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: linear-gradient(135deg, var(--blue), var(--green-bright));
    display: grid; place-items: center; font-weight: 700; color: #fff;
}
.user-chip .meta { line-height: 1.2; }
.user-chip .meta strong { font-size: .9rem; }
.user-chip .meta small { color: var(--text-dim); font-size: .75rem; }

.container { max-width: 1180px; margin: 0 auto; padding: 1.8rem 1.6rem 3rem; }

.page-head { margin-bottom: 1.8rem; }
.page-head h1 { font-size: 1.7rem; font-weight: 700; }
.page-head p  { color: var(--text-dim); margin-top: .3rem; }

/* ---------- Stat cards ---------- */
.stat-grid {
    display: grid; gap: 1.1rem;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    margin-bottom: 1.8rem;
}
.stat {
    padding: 1.4rem 1.5rem; position: relative; overflow: hidden;
}
.stat .stat-label { color: var(--text-dim); font-size: .8rem; text-transform: uppercase; letter-spacing: .6px; }
.stat .stat-value { font-size: 1.9rem; font-weight: 800; margin-top: .5rem; font-family: var(--mono); }
.stat .stat-value.green { color: var(--green); }
.stat .stat-value.blue  { color: var(--blue); }
.stat .stat-glow {
    position: absolute; right: -20px; top: -20px;
    width: 90px; height: 90px; border-radius: 50%; filter: blur(38px); opacity: .25;
}
.stat .glow-g { background: var(--green-bright); } .stat .glow-b { background: var(--blue); }

/* ---------- Tableaux ---------- */
.panel-title {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1.1rem;
}
.panel-title h2 { font-size: 1.15rem; font-weight: 700; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th {
    text-align: left; padding: .9rem 1rem;
    color: var(--text-dim); font-size: .76rem; text-transform: uppercase; letter-spacing: .6px;
    border-bottom: 2px solid var(--border);
}
table.data td { padding: .95rem 1rem; border-bottom: 1px solid var(--bg-2); }
table.data tr:hover td { background: #f6fbf5; }
.tag { padding: .25rem .65rem; border-radius: 20px; font-size: .74rem; font-weight: 700; }
.tag-credit { background: #e9f9e6; color: var(--green-dim); }
.tag-debit  { background: #fdecee; color: var(--danger); }
.tag-active { background: #e9f9e6; color: var(--green-dim); }
.tag-susp   { background: #fdecee; color: var(--danger); }
.tag-pending  { background: #fdf3e0; color: #97600a; }
.tag-approved { background: #e9f9e6; color: var(--green-dim); }
.tag-rejected { background: #fdecee; color: var(--danger); }
.tag-transfer { background: #e9eeff; color: var(--blue-dim); }
.amount-credit { color: var(--green); font-weight: 700; font-family: var(--mono); }
.amount-debit  { color: var(--danger); font-weight: 700; font-family: var(--mono); }
.muted { color: var(--text-dim); }
.mono { font-family: var(--mono); }

/* ---------- Modale ---------- */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(20,32,46,.45);
    backdrop-filter: blur(4px); z-index: 100;
    display: none; place-items: center; padding: 1.2rem;
}
.modal-overlay.show { display: grid; animation: rise .25s ease; }
.modal {
    width: 100%; max-width: 480px; padding: 2rem;
    max-height: 90vh; overflow-y: auto;
    box-shadow: var(--shadow-lg);
}
.modal h3 { font-size: 1.3rem; margin-bottom: .3rem; }
.modal .modal-sub { color: var(--text-dim); font-size: .88rem; margin-bottom: 1.5rem; }
.modal-close { background: none; border: none; color: var(--text-dim); font-size: 1.5rem; cursor: pointer; line-height: 1; }
.modal-close:hover { color: var(--text); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.btn-row { display: flex; gap: .8rem; margin-top: 1.5rem; }

.empty { text-align: center; padding: 3rem 1rem; color: var(--text-dim); }
.empty .big { font-size: 2.4rem; margin-bottom: .6rem; }

/* ---------- Toggle password ---------- */
.pw-wrap { position: relative; }
.pw-wrap .toggle {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: .8rem;
}
.pw-wrap .toggle:hover { color: var(--green); }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
    .row-2 { grid-template-columns: 1fr; }
    .topbar { padding: .85rem 1rem; }
    .container { padding: 1.2rem 1rem 2.5rem; }
    .page-head h1 { font-size: 1.4rem; }
    .user-chip .meta { display: none; }
    .btn-row { flex-direction: column; }
}

.spinner {
    width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.45);
    border-top-color: #fff; border-radius: 50%;
    animation: spin .6s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
