/* ============================================================
   XalisCash — Feuille de style principale
   Police : Poppins — Base : 17px — Mobile-first
   ============================================================ */

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

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

body {
    font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI",
                 Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 17px;
    line-height: 1.65;
    font-weight: 400;
    color: #2c3e50;
    background: #f4f6f8;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, video {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: #1b8a5a;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ===================== VARIABLES ===================== */
:root {
    --green: #1b8a5a;
    --green-dark: #146b46;
    --green-light: #e8f5ee;
    --grey: #f4f6f8;
    --grey-border: #e1e5ea;
    --text: #2c3e50;
    --text-muted: #6b7c8f;
    --warning: #f0ad4e;
    --info: #4a90d9;
    --success: #1b8a5a;
    --danger: #c0392b;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, .08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, .10);
    --transition: .15s ease;
}

/* ===================== TYPOGRAPHIE ===================== */
h1, h2, h3, h4 {
    font-family: "Poppins", sans-serif;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }

p {
    line-height: 1.7;
}

strong, b {
    font-weight: 600;
}

/* ===================== CONTAINER ===================== */
.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ===================== NAVBAR ===================== */
.navbar {
    background: var(--green);
    color: #fff;
    padding: 14px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .05);
    position: relative;
    z-index: 10;
}

.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.navbar-brand {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: .5px;
    transition: opacity var(--transition);
}

.navbar-brand:hover {
    text-decoration: none;
    opacity: .9;
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    list-style: none;
}

.navbar-links a {
    color: #fff;
    text-decoration: none;
    font-size: .95rem;
    font-weight: 500;
    padding: 7px 12px;
    border-radius: var(--radius);
    transition: background var(--transition);
}

.navbar-links a:hover {
    background: rgba(255, 255, 255, .15);
    text-decoration: none;
}

.navbar-user {
    color: #fff;
    font-size: .9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.badge-role {
    background: rgba(255, 255, 255, .2);
    color: #fff;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: .72rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: .3px;
}

/* ===================== MAIN ===================== */
main {
    flex: 1;
    padding: 28px 0 48px;
}

/* ===================== CARDS ===================== */
.card {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 22px;
    margin-bottom: 22px;
}

.card-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===================== FORMS ===================== */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: .95rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 6px;
}

.form-control,
.form-select {
    width: 100%;
    padding: 12px 14px;
    font-size: 1rem;
    font-family: inherit;
    border: 1px solid var(--grey-border);
    border-radius: var(--radius);
    background: #fff;
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(27, 138, 90, .12);
}

.form-control::placeholder {
    color: #a8b5c2;
}

.form-hint {
    font-size: .85rem;
    color: var(--text-muted);
    margin-top: 5px;
}

/* ===================== BUTTONS ===================== */
.btn {
    display: inline-block;
    padding: 12px 22px;
    font-size: 1rem;
    font-weight: 600;
    font-family: "Poppins", sans-serif;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    line-height: 1.2;
    transition: background var(--transition), transform .05s;
}

.btn:hover {
    text-decoration: none;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: var(--green);
    color: #fff;
}

.btn-primary:hover {
    background: var(--green-dark);
    color: #fff;
}

.btn-outline {
    background: #fff;
    color: var(--green);
    border: 1px solid var(--green);
}

.btn-outline:hover {
    background: var(--green-light);
    color: var(--green);
}

.btn-block {
    width: 100%;
    display: block;
}

.btn-sm {
    padding: 7px 12px;
    font-size: .85rem;
}

.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #d9942f; color: #fff; }
.btn-info    { background: var(--info);    color: #fff; }
.btn-info:hover { background: #3a7cbd; color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: var(--green-dark); color: #fff; }
.btn-danger  { background: var(--danger);  color: #fff; }
.btn-danger:hover { background: #a03024; color: #fff; }

/* ===================== ALERTS ===================== */
.alert {
    padding: 14px 16px;
    border-radius: var(--radius);
    font-size: .95rem;
    margin-bottom: 16px;
    line-height: 1.5;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

/* ===================== BADGES ===================== */
.badge {
    display: inline-block;
    padding: 4px 11px;
    font-size: .78rem;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: .4px;
    white-space: nowrap;
}

.badge-warning { background: #fff3cd; color: #856404; }
.badge-info    { background: #d1ecf1; color: #0c5460; }
.badge-success { background: #d4edda; color: #155724; }
.badge-danger  { background: #f8d7da; color: #721c24; }
.badge-grey    { background: #e9ecef; color: #495057; }

/* ===================== GRID ===================== */
.row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.col-12 { flex: 0 0 100%; }
.col-6  { flex: 0 0 calc(50% - 6px); }
.col-4  { flex: 0 0 calc(33.333% - 8px); }
.col-3  { flex: 0 0 calc(25% - 9px); }

/* ===================== STATS ===================== */
.stat-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 18px 14px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-label {
    font-size: .8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-value {
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--green);
    line-height: 1.1;
}

.stat-value.warning { color: var(--warning); }
.stat-value.info    { color: var(--info); }
.stat-value.danger  { color: var(--danger); }

/* ===================== TABLES ===================== */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table.xc {
    width: 100%;
    border-collapse: collapse;
    font-size: .95rem;
}

table.xc th {
    background: var(--grey);
    color: var(--text-muted);
    font-weight: 600;
    text-align: left;
    padding: 12px 10px;
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .4px;
    border-bottom: 1px solid var(--grey-border);
    white-space: nowrap;
}

table.xc td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--grey-border);
    vertical-align: middle;
}

table.xc tr:last-child td {
    border-bottom: none;
}

table.xc tbody tr:hover {
    background: #f9fbfc;
}

/* ===================== DEMANDE CARD (mobile) ===================== */
.demande-card {
    background: #fff;
    border: 1px solid var(--grey-border);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    margin-bottom: 12px;
    transition: box-shadow var(--transition);
}

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

.demande-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.demande-card-op {
    font-weight: 600;
    color: var(--text);
    font-size: 1rem;
}

.demande-card-row {
    display: flex;
    justify-content: space-between;
    font-size: .92rem;
    margin-top: 8px;
}

.demande-card-date {
    font-size: .82rem;
    color: var(--text-muted);
    margin-top: 10px;
}

/* ===================== FILTER TABS ===================== */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.tab {
    padding: 8px 16px;
    border-radius: 22px;
    font-size: .88rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--green);
    background: #fff;
    border: 1px solid var(--grey-border);
    transition: all var(--transition);
}

.tab:hover {
    background: var(--green-light);
    text-decoration: none;
}

.tab.active {
    background: var(--green);
    color: #fff;
    border-color: var(--green);
}

/* ===================== HERO ===================== */
.hero {
    text-align: center;
    padding: 24px 0 36px;
}

.hero h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--green);
}

.hero p {
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 620px;
    margin: 0 auto 28px;
    line-height: 1.7;
}

/* ===================== VIDEO ===================== */
.video-wrapper {
    max-width: 720px;
    margin: 0 auto 32px;
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.video-wrapper video {
    width: 100%;
    height: auto;
    display: block;
}

/* ===================== SECTION TITLE ===================== */
.section-title {
    font-size: 1.4rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 20px;
    color: var(--text);
}

/* ===================== FEATURE CARD ===================== */
.feature-icon {
    font-size: 2rem;
    margin-bottom: 10px;
    line-height: 1;
}

.feature-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.feature-desc {
    font-size: .92rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ===================== FOOTER ===================== */
.footer {
    text-align: center;
    padding: 22px 16px;
    font-size: .88rem;
    color: var(--text-muted);
    background: #fff;
    border-top: 1px solid var(--grey-border);
}

/* ===================== AUTH WRAPPER ===================== */
.auth-wrapper {
    max-width: 460px;
    margin: 0 auto;
}

.auth-wrapper.wide {
    max-width: 580px;
}

/* ===================== UTILITAIRES ===================== */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-left   { text-align: left; }
.text-muted  { color: var(--text-muted); }
.text-green  { color: var(--green); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-info   { color: var(--info); }

.mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 18px; }
.mt-4 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 18px; }
.mb-4 { margin-bottom: 24px; }

.flex         { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center  { display: flex; justify-content: center; align-items: center; }
.flex-wrap    { flex-wrap: wrap; }
.flex-column  { flex-direction: column; }
.gap-1 { gap: 6px; }
.gap-2 { gap: 12px; }
.gap-3 { gap: 18px; }
.w-100 { width: 100%; }
.hide  { display: none; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 640px) {
    body {
        font-size: 16px;
    }

    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.25rem; }

    .col-6, .col-4, .col-3 {
        flex: 0 0 100%;
    }

    .col-6-sm {
        flex: 0 0 calc(50% - 6px);
    }

    .navbar-links {
        width: 100%;
        justify-content: flex-start;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .hero p {
        font-size: .98rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .card {
        padding: 18px;
    }

    .hide-desktop {
        display: none !important;
    }
}

@media (min-width: 641px) {
    .hide-desktop {
        display: none !important;
    }
}

@media (max-width: 640px) {
    .hide-mobile {
        display: none !important;
    }
}

/* ===================== PRINT ===================== */
@media print {
    .navbar, .footer, .btn, .tabs {
        display: none !important;
    }
    body {
        background: #fff;
        font-size: 12px;
    }
    .card {
        box-shadow: none;
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }
    table.xc {
        font-size: 11px;
    }
    a {
        color: #000;
        text-decoration: none;
    }
}