/* public/css/app.css — Web-GAR */

:root {
    --gar-primary:   #1a4a2e;   /* Vert foncé pharmacie */
    --gar-secondary: #2d7a4f;   /* Vert moyen */
    --gar-light-green: #a8e6c1; /* Vert clair (textes sur fond foncé) */
    --gar-bg-green:  #eaf3de;   /* Fond vert très clair */
    --gar-accent:    #e8a020;   /* Or/ambre pour les actions */
    --gar-success:   #198754;
    --gar-danger:    #dc3545;
    --gar-light-bg:  #f4f7f1;
    --gar-card-bg:   #ffffff;
    --gar-border:    #dee2e6;
    --gar-text:      #212529;
    --gar-muted:     #6c757d;
}

/* ── Base ─────────────────────────────────────────── */
body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background-color: var(--gar-light-bg);
    color: var(--gar-text);
    font-size: 0.9rem;
}

/* ── Navbar ───────────────────────────────────────── */
.gar-navbar {
    background: var(--gar-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    padding: 0.5rem 1rem;
}
.gar-logo-box {
    background: var(--gar-secondary);
    border-radius: 8px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gar-light-green);
    font-size: 1rem;
}
.gar-nav-link { color: rgba(255,255,255,0.85) !important; transition: color .2s; font-size: .85rem; }
.gar-nav-link:hover { color: var(--gar-light-green) !important; }
.gar-dropdown {
    border: none;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    border-radius: 8px;
    padding: .4rem;
}
.gar-dropdown .dropdown-item { font-size: .85rem; border-radius: 6px; padding: .45rem .75rem; }
.gar-dropdown .dropdown-item:hover { background: var(--gar-bg-green); }
.gar-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gar-secondary);
    color: var(--gar-light-green);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .72rem;
    font-weight: 600;
}
.gar-btn-logout {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.25);
    color: #fff;
    font-size: .78rem;
}
.gar-btn-logout:hover { background: var(--gar-accent); border-color: var(--gar-accent); color: #fff; }

/* ── Cartes ───────────────────────────────────────── */
.card {
    border: 1px solid var(--gar-border);
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.card-header {
    background: var(--gar-primary);
    color: #fff;
    border-radius: 8px 8px 0 0 !important;
    font-weight: 600;
    padding: .75rem 1.25rem;
}
.card-header .bi { margin-right: .4rem; }

/* ── Stat cards (dashboard) ───────────────────────── */
.stat-card {
    border-left: 4px solid var(--gar-accent);
    transition: transform .15s, box-shadow .15s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.stat-card .stat-value { font-size: 1.8rem; font-weight: 700; color: var(--gar-primary); }
.stat-card .stat-label { font-size: .78rem; color: var(--gar-muted); text-transform: uppercase; letter-spacing: .5px; }

/* ── Boutons ──────────────────────────────────────── */
.btn-primary   { background: var(--gar-primary); border-color: var(--gar-primary); }
.btn-primary:hover { background: #0d2340; border-color: #0d2340; }
.btn-warning   { background: var(--gar-accent); border-color: var(--gar-accent); color: #fff; }
.btn-warning:hover { background: #c8861a; color: #fff; }

/* ── Tableaux ─────────────────────────────────────── */
.table thead th {
    background: var(--gar-primary);
    color: #fff;
    font-weight: 500;
    font-size: .82rem;
    border: none;
    white-space: nowrap;
}
.table tbody tr:hover { background-color: rgba(26,58,92,0.04); }
.table td { vertical-align: middle; }

/* ── Badges statut facture ────────────────────────── */
.badge.bg-warning { font-size: .75rem; }
.badge.bg-info    { font-size: .75rem; }
.badge.bg-success { font-size: .75rem; }

/* ── Formulaires ──────────────────────────────────── */
.form-label { font-weight: 500; margin-bottom: .25rem; }
.form-control:focus, .form-select:focus {
    border-color: var(--gar-primary);
    box-shadow: 0 0 0 3px rgba(26,58,92,0.15);
}
.required-star { color: var(--gar-danger); margin-left: 2px; }

/* ── Page login ───────────────────────────────────── */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--gar-primary) 0%, #0d2340 60%, #1a3a5c 100%);
}
.login-card {
    width: 100%;
    max-width: 420px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.35);
}
.login-logo {
    font-size: 3rem;
    color: var(--gar-accent);
}
.login-title { color: var(--gar-primary); font-weight: 700; }
.login-subtitle { color: var(--gar-muted); font-size: .88rem; }

/* ── Dashboard boutons de menu ────────────────────── */
.menu-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 90px;
    border: 2px solid var(--gar-border);
    border-radius: 10px;
    background: #fff;
    color: var(--gar-primary);
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none;
    transition: all .2s;
    padding: 1rem .75rem;
    text-align: center;
}
.menu-btn:hover {
    border-color: var(--gar-accent);
    background: #fffbf2;
    color: var(--gar-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(232,160,32,0.2);
}
.menu-btn .bi { font-size: 1.6rem; margin-bottom: .4rem; color: var(--gar-accent); }
.menu-btn.disabled { opacity: .45; pointer-events: none; }

/* ── Section titres ───────────────────────────────── */
.section-title {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gar-muted);
    margin-bottom: .75rem;
    padding-bottom: .4rem;
    border-bottom: 2px solid var(--gar-accent);
    display: inline-block;
}

/* ── Pagination ───────────────────────────────────── */
.pagination .page-link { color: var(--gar-primary); }
.pagination .page-item.active .page-link {
    background: var(--gar-primary);
    border-color: var(--gar-primary);
}

/* ── Alertes inline ───────────────────────────────── */
.alert-success { border-left: 4px solid var(--gar-success); }
.alert-danger  { border-left: 4px solid var(--gar-danger); }

/* ── Calcul part assurance (formulaire bons) ─────── */
#part-assur-display {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gar-primary);
}
#part-assur-display.positive { color: var(--gar-success); }

/* ── Footer ───────────────────────────────────────── */
.gar-footer {
    background: #fff;
    border-top: 1px solid var(--gar-border);
    font-size: .78rem;
}

/* ══════════════════════════════════════════════════
   DASHBOARD VERT — Nouveaux composants
═══════════════════════════════════════════════════ */

/* Bande titre */
.gar-dash-topbar {
    background: var(--gar-bg-green);
    border-left: 4px solid var(--gar-secondary);
    border-radius: 8px;
    padding: .65rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;
}
.gar-dash-title { color: var(--gar-primary); font-weight: 700; font-size: 1.05rem; }
.gar-dash-date  { color: var(--gar-secondary); font-size: .85rem; }

/* KPI cards */
.gar-kpi-card {
    background: #fff;
    border: 1px solid var(--gar-border);
    border-left: 4px solid var(--gar-secondary);
    border-radius: 10px;
    padding: .9rem 1rem;
    height: 100%;
    transition: transform .15s, box-shadow .15s;
}
.gar-kpi-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.gar-kpi-val   { font-size: 1.5rem; font-weight: 700; margin-top: .3rem; }
.gar-kpi-label { font-size: .72rem; color: var(--gar-muted); text-transform: uppercase; letter-spacing: .4px; margin-top: .15rem; }

/* Panels (remplace card pour le dashboard) */
.gar-panel {
    background: #fff;
    border: 1px solid var(--gar-border);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.gar-panel-header {
    background: var(--gar-secondary);
    color: #fff;
    padding: .6rem 1rem;
    font-weight: 600;
    font-size: .88rem;
}
.gar-panel-body { padding: 1rem; }
.gar-panel-link { color: rgba(255,255,255,0.85); font-size: .72rem; text-decoration: underline; }
.gar-panel-link:hover { color: #fff; }

/* Saisie rapide */
.gar-bon-ref {
    background: var(--gar-bg-green);
    border-radius: 6px;
    padding: .5rem .75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.gar-bon-num { font-weight: 700; color: var(--gar-primary); font-family: monospace; font-size: .88rem; }
.gar-form-label { font-size: .75rem; color: var(--gar-muted); margin-bottom: .2rem; display: block; }
.gar-btn-search { background: var(--gar-secondary); border-color: var(--gar-secondary); color: #fff; }
.gar-btn-search:hover { background: var(--gar-primary); border-color: var(--gar-primary); color: #fff; }

.gar-benef-info {
    background: var(--gar-bg-green);
    border: 1px solid #97c459;
    border-radius: 6px;
    padding: .6rem .75rem;
    font-size: .78rem;
    line-height: 1.7;
    color: #27500a;
}
.gar-info-key { font-weight: 600; }

.gar-part-calc {
    background: var(--gar-primary);
    border-radius: 8px;
    padding: .6rem .85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gar-btn-enregistrer {
    background: var(--gar-secondary);
    border: none;
    color: #fff;
    font-weight: 600;
    padding: .55rem;
    border-radius: 6px;
}
.gar-btn-enregistrer:hover { background: var(--gar-primary); color: #fff; }

/* Raccourcis modules */
.gar-shortcut {
    background: #fff;
    border: 1px solid var(--gar-border);
    border-radius: 10px;
    padding: .75rem .5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .3rem;
    text-decoration: none;
    color: var(--gar-text);
    transition: all .15s;
    height: 100%;
}
.gar-shortcut i { font-size: 1.4rem; color: var(--gar-secondary); }
.gar-shortcut span { font-size: .72rem; text-align: center; font-weight: 500; }
.gar-shortcut:hover {
    border-color: var(--gar-secondary);
    background: var(--gar-bg-green);
    color: var(--gar-primary);
    transform: translateY(-2px);
}
.gar-shortcut.disabled { opacity: .4; pointer-events: none; }

/* Liste items (derniers bons / audit) */
.gar-list-item {
    padding: .55rem 1rem;
    border-bottom: 1px solid #f1f1f1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.gar-list-item:last-child { border-bottom: none; }
.gar-list-main { font-size: .82rem; font-weight: 600; color: var(--gar-text); }
.gar-list-sub  { font-size: .72rem; color: var(--gar-muted); }
.gar-list-amount { font-size: .82rem; font-weight: 700; color: var(--gar-secondary); }

.gar-badge-success {
    background: var(--gar-bg-green); color: #27500a;
    font-size: .68rem; padding: .15rem .5rem; border-radius: 4px;
}
.gar-badge-danger {
    background: #fcebeb; color: #791f1f;
    font-size: .68rem; padding: .15rem .5rem; border-radius: 4px;
}


@media (max-width: 768px) {
    .stat-card .stat-value { font-size: 1.4rem; }
    .menu-btn { min-height: 70px; font-size: .75rem; }
    .table-responsive { font-size: .8rem; }
}
