/* ==========================================================================
   OMD FINANCE — Thème unique "Pro Max"
   Un seul fichier pour toutes les pages : plus de CSS dupliqué par page.
   ========================================================================== */

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

:root{
    --ink:#0f172a;
    --ink-soft:#334155;
    --muted:#64748b;
    --bg:#eef1f8;
    --card:#ffffff;
    --border:#e6eaf2;

    --primary:#4f46e5;
    --primary-dark:#4338ca;
    --accent:#22d3ee;

    --blue:#2563eb;   --blue-dark:#1d4ed8;
    --green:#10b981;  --green-dark:#059669;
    --red:#ef4444;    --red-dark:#dc2626;
    --orange:#f59e0b; --orange-dark:#d97706;
    --purple:#8b5cf6; --purple-dark:#6d28d9;
    --dark:#111827;   --dark-2:#1f2937;

    --radius-lg:22px;
    --radius-md:14px;
    --radius-sm:10px;
    --shadow-card:0 10px 30px rgba(15,23,42,.06);
    --shadow-pop:0 15px 35px rgba(15,23,42,.14);
    --sidebar-w:270px;
}

*{ box-sizing:border-box; }

html,body{
    margin:0;
    padding:0;
}

body{
    font-family:'Plus Jakarta Sans','Segoe UI',Arial,sans-serif;
    background:var(--bg);
    color:var(--ink);
    overflow-x:hidden;
}

a{ color:inherit; }

/* ================= BACKGROUND WATERMARK ================= */

body::before{
    content:'';
    position:fixed;
    inset:0;
    background:url('../img/logobu.png') center center no-repeat;
    background-size:340px;
    opacity:.025;
    z-index:-1;
    pointer-events:none;
}

/* ================= LAYOUT ================= */

.app-sidebar{
    width:var(--sidebar-w);
    height:100vh;
    position:fixed;
    top:0; left:0;
    display:flex;
    flex-direction:column;
    background:linear-gradient(180deg,#0f172a 0%,#161f36 60%,#1e2947 100%);
    box-shadow:0 0 30px rgba(0,0,0,.35);
    z-index:1000;
    padding:22px 0;
}

.app-main{
    margin-left:var(--sidebar-w);
    padding:26px 30px 50px;
    min-height:100vh;
}

@media(max-width:991px){
    .app-sidebar{ width:100%; height:auto; position:relative; box-shadow:none; }
    .app-main{ margin-left:0; padding:18px; }
}

/* ================= SIDEBAR ================= */

.app-logo{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:10px;
    color:#fff;
    font-size:20px;
    font-weight:800;
    letter-spacing:.3px;
    padding:0 20px 22px;
    margin-bottom:10px;
    border-bottom:1px solid rgba(255,255,255,.08);
}

.app-logo .badge-live{
    width:8px; height:8px;
    border-radius:50%;
    background:var(--accent);
    box-shadow:0 0 10px var(--accent);
}

.app-nav{ flex:1; padding:6px 14px; }

.app-nav a{
    display:flex;
    align-items:center;
    gap:12px;
    color:#94a3b8;
    padding:13px 16px;
    margin-bottom:4px;
    border-radius:12px;
    text-decoration:none;
    font-size:14.5px;
    font-weight:500;
    transition:.2s;
}

.app-nav a i{ font-size:17px; width:20px; text-align:center; }

.app-nav a:hover{
    background:rgba(255,255,255,.06);
    color:#fff;
}

.app-nav a.active{
    background:linear-gradient(135deg,var(--primary),#6366f1);
    color:#fff;
    box-shadow:0 8px 20px rgba(79,70,229,.35);
}

.app-nav .nav-section{
    color:#475569;
    font-size:11px;
    text-transform:uppercase;
    letter-spacing:1px;
    font-weight:700;
    padding:16px 16px 6px;
}

.app-sidebar-foot{
    padding:14px 16px 4px;
    border-top:1px solid rgba(255,255,255,.08);
}

.app-sidebar-foot a{
    display:flex;
    align-items:center;
    gap:10px;
    color:#f87171;
    text-decoration:none;
    padding:12px 16px;
    border-radius:12px;
    font-weight:600;
    font-size:14px;
    transition:.2s;
}

.app-sidebar-foot a:hover{ background:rgba(248,113,113,.12); }

/* ================= TOPBAR ================= */

.topbar{
    background:var(--card);
    padding:20px 26px;
    border-radius:var(--radius-lg);
    box-shadow:var(--shadow-card);
    margin-bottom:26px;
    display:flex;
    justify-content:space-between;
    align-items:center;
    flex-wrap:wrap;
    gap:12px;
}

.topbar h1,.topbar h3{
    margin:0;
    font-weight:800;
    color:var(--ink);
    font-size:22px;
}

.topbar small{ color:var(--muted); }

.topbar .date-pill{
    background:var(--bg);
    color:var(--ink-soft);
    font-weight:700;
    padding:10px 18px;
    border-radius:30px;
    font-size:13.5px;
}

/* ================= STAT CARDS ================= */

.stats-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(230px,1fr));
    gap:20px;
    margin-bottom:26px;
}

.stat-card{
    position:relative;
    overflow:hidden;
    border-radius:var(--radius-lg);
    padding:24px;
    color:#fff;
    min-height:140px;
    box-shadow:var(--shadow-pop);
    transition:.25s;
    isolation:isolate;
}

.stat-card::after{
    content:'';
    position:absolute;
    inset:0;
    background:linear-gradient(160deg,rgba(255,255,255,.16),rgba(255,255,255,0) 55%);
    pointer-events:none;
}

.stat-card:hover{ transform:translateY(-6px); }

.stat-card p{ margin:0; opacity:.9; font-size:14px; font-weight:600; }
.stat-card h2{ font-size:32px; font-weight:800; margin:8px 0 2px; }
.stat-card small{ opacity:.85; font-size:13px; }

.stat-icon{
    position:absolute;
    right:18px; bottom:14px;
    font-size:52px;
    opacity:.22;
}

.stat-card.clickable{ cursor:pointer; }

.bg-blue{ background:linear-gradient(135deg,var(--blue),var(--blue-dark)); }
.bg-green{ background:linear-gradient(135deg,var(--green),var(--green-dark)); }
.bg-red{ background:linear-gradient(135deg,var(--red),var(--red-dark)); }
.bg-orange{ background:linear-gradient(135deg,var(--orange),var(--orange-dark)); }
.bg-purple{ background:linear-gradient(135deg,var(--purple),var(--purple-dark)); }
.bg-dark{ background:linear-gradient(135deg,var(--dark),var(--dark-2)); }
.bg-indigo{ background:linear-gradient(135deg,var(--primary),#6366f1); }
.bg-teal{ background:linear-gradient(135deg,#0ea5e9,#22c55e); }

/* ================= CARDS / PANELS ================= */

.pro-card{
    background:var(--card);
    border-radius:var(--radius-lg);
    padding:26px;
    margin-bottom:26px;
    box-shadow:var(--shadow-card);
}

.pro-card h4,.pro-card h5{ font-weight:800; color:var(--ink); }

/* ================= BADGES ================= */

.badge-pro{
    padding:7px 14px;
    border-radius:30px;
    font-size:12px;
    font-weight:700;
    letter-spacing:.2px;
}

/* ================= TABLE ================= */

.table{ margin-top:14px; }

.table thead th{
    background:var(--ink);
    color:#fff;
    border:none;
    padding:14px 16px;
    font-weight:600;
    font-size:13px;
    text-transform:uppercase;
    letter-spacing:.4px;
}

.table thead tr:first-child th:first-child{ border-top-left-radius:12px; }
.table thead tr:first-child th:last-child{ border-top-right-radius:12px; }

.table tbody tr{ transition:.2s; }
.table tbody tr:hover{ background:#f8fafc; }
.table td{ vertical-align:middle; padding:12px 16px; }

/* ================= BUTTONS ================= */

.btn-pro{
    display:inline-flex;
    align-items:center;
    gap:6px;
    border:none;
    padding:10px 18px;
    border-radius:12px;
    color:#fff !important;
    font-weight:600;
    font-size:13.5px;
    text-decoration:none;
    transition:.2s;
    cursor:pointer;
}

.btn-pro:hover{ transform:translateY(-2px); filter:brightness(1.05); color:#fff; }
.btn-pro:active{ transform:translateY(0); }

.btn-blue,.btn-pro.blue{ background:linear-gradient(135deg,var(--blue),var(--blue-dark)); }
.btn-save,.btn-green,.btn-pro.green{ background:linear-gradient(135deg,var(--green),var(--green-dark)); }
.btn-edit{ background:linear-gradient(135deg,#3b82f6,var(--blue-dark)); }
.btn-delete,.btn-red,.btn-pro.red{ background:linear-gradient(135deg,var(--red),var(--red-dark)); }
.btn-purple,.btn-pro.purple{ background:linear-gradient(135deg,var(--purple),var(--purple-dark)); }
.btn-dark{ background:linear-gradient(135deg,var(--dark),var(--dark-2)); }

/* ================= FORM ================= */

.form-control,.form-select,input:not([type=radio]):not([type=checkbox]),select{
    border-radius:var(--radius-sm);
    padding:12px 14px;
    border:1px solid var(--border);
    box-shadow:none;
    font-family:inherit;
}

.form-control:focus,.form-select:focus,input:focus,select:focus{
    border-color:var(--primary);
    box-shadow:0 0 0 4px rgba(79,70,229,.12);
    outline:none;
}

label{ font-weight:600; color:var(--ink-soft); font-size:13.5px; }

/* ================= ALERTS ================= */

.alert-pro{
    border:none;
    border-radius:16px;
    padding:16px 18px;
    font-weight:600;
}

/* ================= SEARCH ================= */

.search-box{ position:relative; }
.search-box i{ position:absolute; left:16px; top:50%; transform:translateY(-50%); color:#94a3b8; }
.search-box input{ padding-left:46px !important; }

/* ================= CHART BOX ================= */

.chart-box{
    background:var(--card);
    border-radius:var(--radius-lg);
    padding:22px;
    box-shadow:var(--shadow-card);
    height:100%;
}

/* ================= PHOTO ================= */

.photo-client{
    width:60px; height:60px;
    border-radius:50%;
    object-fit:cover;
    border:3px solid var(--green);
    box-shadow:0 5px 15px rgba(0,0,0,.1);
}

/* ================= MISC BADGES TYPE PRET ================= */

.type-journalier{ background:#e0f2fe; color:#0369a1; padding:4px 10px; border-radius:8px; font-size:12px; font-weight:700; }
.type-mensuel{ background:#fef3c7; color:#b45309; padding:4px 10px; border-radius:8px; font-size:12px; font-weight:700; }

.conv-form{
    display:inline-block;
    background:#f8f5ff;
    border:1px solid #ddd6fe;
    border-radius:10px;
    padding:8px;
    vertical-align:top;
}

.conv-form select,.conv-form input{
    width:auto;
    padding:6px;
    font-size:12px;
    display:inline-block;
}

/* ================= SCROLLBAR (subtle) ================= */

::-webkit-scrollbar{ width:9px; height:9px; }
::-webkit-scrollbar-thumb{ background:#cbd5e1; border-radius:20px; }
::-webkit-scrollbar-thumb:hover{ background:#94a3b8; }

/* ================= LOGIN PAGE ================= */

.auth-wrap{
    min-height:100vh;
    display:flex;
    align-items:center;
    justify-content:center;
    background:
        radial-gradient(circle at 15% 20%, rgba(99,102,241,.35), transparent 45%),
        radial-gradient(circle at 85% 80%, rgba(34,211,238,.25), transparent 45%),
        linear-gradient(135deg,#0f172a,#1e293b);
    padding:20px;
}

.auth-card{
    background:var(--card);
    padding:44px 36px;
    border-radius:26px;
    box-shadow:0 25px 60px rgba(0,0,0,.35);
    width:380px;
    max-width:100%;
    text-align:center;
}

.auth-card .logo{ width:78px; margin-bottom:16px; }
.auth-card h2{ margin-bottom:6px; color:var(--ink); font-weight:800; }
.auth-card p.subtitle{ color:var(--muted); margin-bottom:26px; font-size:13.5px; }

.auth-card form input{
    width:100%;
    margin-bottom:14px;
    text-align:left;
}

.auth-card button{
    width:100%;
    padding:13px;
    border:none;
    border-radius:12px;
    background:linear-gradient(135deg,var(--primary),#6366f1);
    color:#fff;
    font-weight:700;
    cursor:pointer;
    transition:.2s;
}

.auth-card button:hover{ transform:translateY(-2px); filter:brightness(1.05); }

.auth-message{
    margin-bottom:16px;
    padding:11px;
    border-radius:10px;
    background:#fee2e2;
    color:#991b1b;
    font-size:13.5px;
    font-weight:600;
}
