
/* =========================================================
   CHN TIVAOUANE
   PLATEFORME DE GESTION DES EXPRESSIONS DE BESOINS
   DESIGN PROFESSIONNEL - VERSION 2.0
========================================================= */

/* =========================================================
   1. VARIABLES ET CONFIGURATION
========================================================= */

:root {
    --navy: #12304a;
    --navy-dark: #0b2236;
    --blue: #176b87;
    --blue-light: #eaf5fa;
    --blue-soft: #f2f8fb;
    --orange: #e87524;

    --green: #198754;
    --red: #dc3545;
    --yellow: #f4a340;

    --background: #f3f6f9;
    --text: #243746;
    --muted: #7b8b9a;
    --border: #e6edf2;
    --white: #ffffff;

    --radius: 13px;
    --shadow: 0 5px 20px rgba(23, 51, 74, .07);
    --shadow-hover: 0 10px 28px rgba(23, 51, 74, .12);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--background);
    color: var(--text);
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
}

.app-page {
    background: var(--background);
}

a {
    text-decoration: none;
}

/* =========================================================
   2. HEADER ET NAVIGATION
========================================================= */

.topbar {
    position: relative;
    z-index: 1000;
    min-height: 76px;
    padding: 10px 0;
    background: linear-gradient(110deg, #102c43, #176b87);
    box-shadow: 0 4px 18px rgba(16, 44, 67, .16);
}

.hospital-brand {
    display: flex;
    align-items: center;
    padding: 0;
}

.brand-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.22);
    color: white;
    font-size: 25px;
}

.brand-title {
    display: block;
    color: white;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: .6px;
    line-height: 1.3;
}

.brand-subtitle {
    color: rgba(255,255,255,.75);
    font-size: 11px;
    margin-top: 3px;
}

/* Navigation */

.main-menu {
    gap: 5px;
}

.topbar .nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 13px !important;
    border-radius: 9px;
    color: rgba(255,255,255,.85);
    font-size: 13px;
    font-weight: 600;
    transition: all .25s ease;
}

.topbar .nav-link i {
    font-size: 16px;
}

.topbar .nav-link:hover,
.topbar .nav-link:focus {
    color: white;
    background: rgba(255,255,255,.13);
}

.topbar .nav-link.active {
    color: white;
    background: rgba(255,255,255,.18);
    box-shadow: inset 0 -2px 0 var(--orange);
}

/* Bouton menu mobile */

.topbar .navbar-toggler {
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 8px;
    padding: 7px 10px;
}

/* =========================================================
   3. PROFIL UTILISATEUR
========================================================= */

.header-user-area {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: 15px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
}

.user-avatar {
    width: 41px;
    height: 41px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,.17);
    border: 1px solid rgba(255,255,255,.22);
    color: white;
    font-size: 19px;
}

.user-name {
    color: white;
    font-size: 12px;
    font-weight: 700;
}

.user-role {
    display: block;
    color: rgba(255,255,255,.72);
    font-size: 10px;
    margin-top: 2px;
}

.header-divider {
    width: 1px;
    height: 35px;
    background: rgba(255,255,255,.22);
}

/* Déconnexion */

.btn-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 13px;
    border: 1px solid rgba(255,255,255,.3);
    border-radius: 8px;
    background: rgba(255,255,255,.08);
    color: white;
    font-size: 12px;
    font-weight: 600;
    transition: all .25s ease;
}

.btn-logout:hover {
    background: var(--orange);
    border-color: var(--orange);
    color: white;
}

/* =========================================================
   4. BARRE D'INFORMATION DU SYSTEME
========================================================= */

.system-bar {
    padding: 9px 0;
    background: white;
    border-bottom: 1px solid var(--border);
    color: var(--muted);
    font-size: 11px;
}

.system-bar-left {
    font-weight: 600;
}

.system-bar-left i {
    color: var(--blue);
}

.system-bar-right {
    display: flex;
    align-items: center;
}

.status-indicator {
    color: #16a36a;
    font-size: 8px;
    margin-right: 6px;
}

/* =========================================================
   5. CONTENU PRINCIPAL
========================================================= */

.app-page main {
    min-height: calc(100vh - 160px);
}

.container-fluid {
    max-width: 100%;
}

.section-title {
    color: var(--navy);
    font-size: 21px;
    font-weight: 800;
    margin-bottom: 5px;
}

.section-subtitle {
    color: var(--muted);
    font-size: 12px;
}

/* =========================================================
   6. CARTES
========================================================= */

.card {
    overflow: hidden;
    border: 1px solid rgba(230,237,242,.8);
    border-radius: var(--radius);
    background: white;
    box-shadow: var(--shadow);
    transition: box-shadow .25s ease, transform .25s ease;
}

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

.card-header {
    padding: 16px 20px;
    background: white;
    border-bottom: 1px solid #edf1f4;
    color: var(--navy);
    font-size: 14px;
    font-weight: 700;
}

.card-body {
    padding: 20px;
}

.card-footer {
    background: #fafcfd;
    border-top: 1px solid var(--border);
}

/* Cartes statistiques */

.stat-card {
    position: relative;
    overflow: hidden;
    padding: 20px;
    border-radius: 14px;
    background: white;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.stat-card::after {
    content: "";
    position: absolute;
    right: -20px;
    top: -25px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(23,107,135,.05);
}

.stat {
    color: var(--navy);
    font-size: 28px;
    font-weight: 800;
    line-height: 1.2;
}

.stat-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.stat-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--blue-light);
    color: var(--blue);
    font-size: 23px;
}

/* =========================================================
   7. BOUTONS
========================================================= */

.btn {
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    transition: all .25s ease;
}

.btn-primary {
    background: var(--blue);
    border-color: var(--blue);
    color: white;
}

.btn-primary:hover {
    background: var(--navy);
    border-color: var(--navy);
    color: white;
    transform: translateY(-1px);
}

.btn-warning {
    background: #f4a340;
    border-color: #f4a340;
    color: #263746;
}

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

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

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

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

/* =========================================================
   8. FORMULAIRES
========================================================= */

.form-label {
    margin-bottom: 6px;
    color: #385164;
    font-size: 12px;
    font-weight: 700;
}

.form-control,
.form-select {
    min-height: 43px;
    border: 1px solid #dce5eb;
    border-radius: 9px;
    background-color: white;
    color: var(--text);
    font-size: 13px;
}

textarea.form-control {
    min-height: 100px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(23,107,135,.12);
}

.form-text {
    color: var(--muted);
    font-size: 11px;
}

.input-group-text {
    background: #f4f8fa;
    border-color: #dce5eb;
    color: var(--blue);
}

/* =========================================================
   9. TABLEAUX
========================================================= */

.table-responsive {
    border-radius: 10px;
}

.table {
    margin-bottom: 0;
    vertical-align: middle;
}

.table thead th {
    padding: 13px;
    background: #eaf1f5;
    border-bottom: 1px solid #dce6ed;
    color: #1d3d52;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    white-space: nowrap;
}

.table tbody td {
    padding: 12px 13px;
    border-color: #edf1f4;
    color: #405466;
    font-size: 12px;
}

.table tbody tr:hover {
    background: #f5fafe;
}

.table tbody tr:last-child td {
    border-bottom: 0;
}

/* =========================================================
   10. BADGES ET STATUTS
========================================================= */

.badge {
    padding: 6px 9px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
}

.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    border-radius: 30px;
    font-size: 10px;
    font-weight: 700;
}

.status-pending {
    background: #fff5df;
    color: #a76b00;
}

.status-approved {
    background: #e5f7ed;
    color: #16834b;
}

.status-rejected {
    background: #fdebec;
    color: #c52d3a;
}

/* =========================================================
   11. PROCESSUS DE VALIDATION
========================================================= */

.workflow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.workflow span {
    padding: 9px 13px;
    border: 1px solid #e2ebf0;
    border-radius: 8px;
    background: #eaf1f5;
    color: #294b61;
    font-size: 11px;
    font-weight: 600;
}

/* =========================================================
   12. ALERTES ET NOTIFICATIONS
========================================================= */

.alert {
    border: 0;
    border-radius: 10px;
    font-size: 13px;
}

.alert-success {
    background: #e8f7ee;
    color: #176b40;
}

.alert-danger {
    background: #fdebec;
    color: #a82b37;
}

.alert-warning {
    background: #fff5df;
    color: #8a5b00;
}

.alert-info {
    background: #eaf5fa;
    color: #176b87;
}

/* =========================================================
   13. FOOTER
========================================================= */

.app-footer {
    padding: 20px 15px;
    background: white;
    border-top: 1px solid var(--border);
    color: #7b8b9a;
    font-size: 12px;
}

/* =========================================================
   14. PAGE DE CONNEXION
========================================================= */

body.login-page {
    min-height: 100vh;
    margin: 0;
    background:
        linear-gradient(
            135deg,
            rgba(10,35,57,.88),
            rgba(23,107,135,.65)
        ),
        url("images/hospital-bg.jpg");
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

.login-page .login-main {
    min-height: 100vh;
    width: 100%;
    padding: 0;
}

/* Conteneur de connexion */

.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 15px;
}

/* Carte de connexion */

.login-card {
    width: 100%;
    max-width: 450px;
    padding: 38px;
    border: 1px solid rgba(255,255,255,.5);
    border-radius: 22px;
    background: rgba(255,255,255,.97);
    box-shadow: 0 25px 70px rgba(0,0,0,.25);
    backdrop-filter: blur(15px);
    animation: loginAppear .7s ease;
}

@keyframes loginAppear {
    from {
        opacity: 0;
        transform: translateY(25px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Logo */

.logo-circle {
    width: 85px;
    height: 85px;
    margin: 0 auto 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 24px;
    background: linear-gradient(135deg,#e4f3ff,#c8e6ff);
    color: var(--blue);
    font-size: 43px;
}

/* Titres */

.hospital-name {
    margin-bottom: 6px;
    color: var(--navy);
    font-size: 21px;
    font-weight: 800;
}

.hospital-description {
    color: #728397;
    font-size: 13px;
    line-height: 1.6;
}

.login-divider {
    width: 65px;
    height: 4px;
    margin: 22px auto;
    border-radius: 10px;
    background: linear-gradient(90deg,var(--blue),#20b9dc);
}

.login-title {
    color: #193b57;
    font-size: 21px;
    font-weight: 750;
}

.login-subtitle {
    color: #8997a6;
    font-size: 13px;
}

/* Champs de connexion */

.login-input-group {
    position: relative;
}

.login-input-group > i {
    position: absolute;
    z-index: 5;
    top: 50%;
    left: 16px;
    color: #8a9aaa;
    transform: translateY(-50%);
}

.login-input {
    height: 53px;
    padding-right: 45px;
    padding-left: 45px;
    border: 1px solid #e1e9f0;
    border-radius: 12px;
    background: #f8fafc;
    font-size: 14px;
}

.login-input:focus {
    background: white;
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(23,107,135,.10);
}

.toggle-password {
    position: absolute;
    z-index: 6;
    top: 50%;
    right: 15px;
    border: none;
    background: transparent;
    color: #8090a0;
    cursor: pointer;
    transform: translateY(-50%);
}

/* Bouton de connexion */

.btn-login {
    height: 54px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg,#176b87,#12304a);
    box-shadow: 0 8px 20px rgba(23,107,135,.25);
    color: white;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .3px;
    transition: all .3s ease;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(23,107,135,.35);
    color: white;
}

/* Pied de page connexion */

.login-footer {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid #edf1f5;
    text-align: center;
}

.login-footer p {
    margin-bottom: 5px;
    color: #8795a3;
    font-size: 12px;
}

.security-info {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 30px;
    background: #eaf7ef;
    color: #25834c;
    font-size: 11px;
    font-weight: 600;
}

.login-error {
    border-radius: 12px;
    font-size: 13px;
}

/* =========================================================
   15. DOCUMENTS ET IMPRESSION
========================================================= */

.print-head {
    text-align: center;
}

.request-paper {
    max-width: 1100px;
    margin: auto;
    padding: 25px;
    background: white;
}

.document-title {
    color: var(--navy);
    font-size: 20px;
    font-weight: 800;
    text-align: center;
}

/* =========================================================
   16. RESPONSIVE
========================================================= */

@media (max-width: 1199.98px) {

    .main-menu {
        padding-top: 15px;
    }

    .header-user-area {
        margin-left: 0;
        padding: 15px 0;
        border-top: 1px solid rgba(255,255,255,.15);
    }

    .topbar .navbar-collapse {
        padding-bottom: 10px;
    }
}

@media (max-width: 991.98px) {

    .user-profile {
        margin-bottom: 8px;
    }

    .main-menu .nav-link {
        padding: 11px 10px !important;
    }

    .header-user-area {
        flex-wrap: wrap;
    }
}

@media (max-width: 576px) {

    body.login-page {
        background-attachment: scroll;
    }

    .brand-icon {
        width: 41px;
        height: 41px;
        font-size: 21px;
    }

    .brand-title {
        font-size: 14px;
    }

    .brand-subtitle {
        font-size: 9px;
    }

    .login-card {
        padding: 28px 22px;
        border-radius: 18px;
    }

    .hospital-name {
        font-size: 18px;
    }

    .stat {
        font-size: 23px;
    }

    .request-paper {
        padding: 12px;
    }

    .system-bar {
        font-size: 10px;
    }
}

/* =========================================================
   17. IMPRESSION
========================================================= */

@media print {

    .topbar,
    .system-bar,
    footer,
    .no-print,
    .alert,
    .btn {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
    }

    .request-paper {
        max-width: 100%;
        padding: 0;
        box-shadow: none;
    }

    .container-fluid {
        padding: 0 !important;
    }

    .card {
        border: 0;
        box-shadow: none;
    }

    .table thead th {
        background: #eaf1f5 !important;
        print-color-adjust: exact;
    }
}
