/* =============================================================
   ACCREDIT'ACTION - Styles principaux
   Plateforme nationale ANAQSUP
   ============================================================= */

:root {
    --anaqsup-blue:    #003366;
    --anaqsup-gold:    #D4AF37;
    --anaqsup-green:   #28a745;
    --anaqsup-red:     #dc3545;
    --anaqsup-orange:  #fd7e14;
    --sidebar-width:   260px;
    --topbar-height:   64px;
    --sidebar-bg:      #0d1b2a;
    --sidebar-hover:   rgba(255,255,255,0.07);
    --sidebar-active:  rgba(212,175,55,0.15);
    --sidebar-text:    rgba(255,255,255,0.75);
    --sidebar-sub:     rgba(255,255,255,0.4);
    --font-main:       'Inter', -apple-system, sans-serif;
    --radius:          12px;
    --shadow-sm:       0 2px 8px rgba(0,0,0,0.08);
    --shadow:          0 4px 20px rgba(0,0,0,0.12);
    --shadow-lg:       0 8px 40px rgba(0,0,0,0.16);
}

* { box-sizing: border-box; }
body { font-family: var(--font-main); color: #1a2332; }

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f1f3f5; }
::-webkit-scrollbar-thumb { background: #c1ccd6; border-radius: 3px; }

/* =============================================================
   LAYOUT PUBLIC
   ============================================================= */
.public-layout { padding-top: 76px; }

/* Navbar */
#mainNav {
    background: var(--anaqsup-blue);
    backdrop-filter: blur(10px);
    transition: all 0.3s;
    padding: 12px 0;
    box-shadow: 0 2px 20px rgba(0,51,102,0.3);
}
#mainNav.scrolled {
    background: rgba(0,33,66,0.97) !important;
    padding: 8px 0;
}
.brand-icon {
    width: 38px; height: 38px;
    background: var(--anaqsup-gold);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; color: var(--anaqsup-blue);
}
.brand-name {
    font-family: 'Poppins', sans-serif;
    font-weight: 700; font-size: 17px;
    color: #fff; display: block; line-height: 1;
}
.brand-sub { font-size: 10px; color: rgba(255,255,255,0.5); }

/* Hero */
.hero-section {
    min-height: 90vh;
    background: linear-gradient(135deg, var(--anaqsup-blue) 0%, #0a4080 50%, #1a6aa0 100%);
    position: relative; overflow: hidden;
    display: flex; align-items: center;
}
.hero-section::before {
    content: '';
    position: absolute; inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(212,175,55,0.15);
    border: 1px solid rgba(212,175,55,0.3);
    color: var(--anaqsup-gold);
    padding: 6px 16px; border-radius: 50px;
    font-size: 13px; font-weight: 500;
    margin-bottom: 1.5rem;
}
.hero-title {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 800; color: #fff; line-height: 1.15;
}
.hero-title .highlight { color: var(--anaqsup-gold); }
.hero-subtitle { font-size: 1.1rem; color: rgba(255,255,255,0.75); line-height: 1.7; }

/* Stats hero */
.hero-stat {
    text-align: center;
    padding: 20px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius);
}
.hero-stat-number {
    font-family: 'Poppins', sans-serif;
    font-size: 2.5rem; font-weight: 800;
    color: var(--anaqsup-gold);
}

/* Features */
.feature-card {
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid #e9ecef;
    transition: all 0.3s;
    height: 100%;
    background: #fff;
}
.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: var(--anaqsup-blue);
}
.feature-icon {
    width: 56px; height: 56px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    margin-bottom: 1rem;
}
.feature-icon.blue    { background: rgba(0,51,102,0.1); color: var(--anaqsup-blue); }
.feature-icon.gold    { background: rgba(212,175,55,0.1); color: var(--anaqsup-gold); }
.feature-icon.green   { background: rgba(40,167,69,0.1); color: var(--anaqsup-green); }
.feature-icon.orange  { background: rgba(253,126,20,0.1); color: var(--anaqsup-orange); }
.feature-icon.purple  { background: rgba(111,66,193,0.1); color: #6f42c1; }
.feature-icon.teal    { background: rgba(32,201,151,0.1); color: #20c997; }

/* Steps */
.steps-section { background: #f8f9fa; }
.step-item { display: flex; gap: 1.5rem; align-items: flex-start; }
.step-number {
    width: 48px; height: 48px; flex-shrink: 0;
    background: var(--anaqsup-blue);
    color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1.1rem;
    font-family: 'Poppins', sans-serif;
}

/* Announcement cards */
.announcement-card {
    border: 1px solid #e9ecef;
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: all 0.2s;
    background: #fff;
}
.announcement-card:hover { box-shadow: var(--shadow-sm); border-color: #c1ccd6; }

/* Footer */
.footer-main { background: #0d1b2a; }

/* =============================================================
   AUTH LAYOUT
   ============================================================= */
.auth-layout { margin: 0; background: #f0f4f8; min-height: 100vh; }
.auth-wrapper { display: flex; min-height: 100vh; }

.auth-left {
    width: 45%;
    background: linear-gradient(160deg, var(--anaqsup-blue) 0%, #0a4080 60%, #0d5a9a 100%);
    padding: 3rem;
    flex-direction: column;
    justify-content: center;
    position: sticky; top: 0; height: 100vh;
}
.auth-logo-icon {
    width: 52px; height: 52px;
    background: var(--anaqsup-gold);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; color: var(--anaqsup-blue);
}
.auth-feature-item {
    display: flex; align-items: center; gap: 1rem;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}
.auth-feature-icon {
    width: 40px; height: 40px; flex-shrink: 0;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; color: var(--anaqsup-gold);
}
.auth-right {
    flex: 1;
    display: flex; align-items: center; justify-content: center;
    padding: 2rem;
    overflow-y: auto;
}
.auth-form-container { width: 100%; max-width: 460px; }
.auth-card {
    background: #fff;
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: var(--shadow);
}
.auth-title { font-family: 'Poppins', sans-serif; font-size: 1.75rem; font-weight: 700; color: var(--anaqsup-blue); }

/* =============================================================
   DASHBOARD LAYOUT
   ============================================================= */
.dashboard-layout { display: flex; min-height: 100vh; background: #f0f4f8; }

/* SIDEBAR */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    height: 100vh;
    position: fixed; top: 0; left: 0;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1040;
    transition: transform 0.3s;
    display: flex; flex-direction: column;
}
.sidebar-anaqsup { background: #0a1628; }

.sidebar-header {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex; align-items: center; justify-content: space-between;
    flex-shrink: 0;
}
.sidebar-logo {
    width: 36px; height: 36px;
    background: var(--anaqsup-gold);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; color: var(--anaqsup-blue);
    flex-shrink: 0;
}
.anaqsup-logo { background: #1e3a5f; color: var(--anaqsup-gold); }
.sidebar-brand {
    font-family: 'Poppins', sans-serif;
    font-size: 13px; font-weight: 700; color: #fff; line-height: 1;
}
.sidebar-sub { font-size: 10px; color: var(--sidebar-sub); }

.sidebar-institution {
    margin: 0.75rem;
    padding: 0.75rem;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    display: flex; align-items: center; gap: 0.75rem;
}
.institution-avatar {
    width: 36px; height: 36px;
    background: var(--anaqsup-gold);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700;
    color: var(--anaqsup-blue); flex-shrink: 0;
}
.institution-name { font-size: 12px; font-weight: 600; color: #fff; line-height: 1.3; }
.institution-status { font-size: 10px; margin-top: 2px; }
.status-active    { color: #4ade80; }
.status-pending   { color: #fbbf24; }
.status-rejected  { color: #f87171; }
.status-suspended { color: #94a3b8; }
.status-complement_required { color: #fb923c; }

.sidebar-nav { padding: 0.5rem; flex: 1; }
.nav-section-label {
    font-size: 10px; font-weight: 600; letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--sidebar-sub);
    padding: 1rem 0.75rem 0.4rem;
}
.nav-item {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 13.5px; font-weight: 450;
    margin-bottom: 2px;
    transition: all 0.2s;
    position: relative;
}
.nav-item i { font-size: 16px; flex-shrink: 0; width: 20px; text-align: center; }
.nav-item:hover {
    background: var(--sidebar-hover);
    color: #fff;
}
.nav-item.active {
    background: var(--sidebar-active);
    color: var(--anaqsup-gold);
    font-weight: 600;
}
.nav-item.active i { color: var(--anaqsup-gold); }
.nav-badge {
    margin-left: auto;
    background: var(--anaqsup-red);
    color: #fff;
    font-size: 10px; font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    min-width: 18px; text-align: center;
}

/* MAIN WRAPPER */
.main-wrapper {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex; flex-direction: column;
    min-height: 100vh;
    transition: margin 0.3s;
}

/* TOPBAR */
.topbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    display: flex; align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky; top: 0; z-index: 100;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.topbar-anaqsup {
    background: var(--anaqsup-blue);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.topbar-left, .topbar-right { display: flex; align-items: center; }
.breadcrumb { margin: 0; background: none; }
.breadcrumb-item a { color: var(--anaqsup-blue); text-decoration: none; }
.breadcrumb-item.active { color: #6c757d; }

.user-avatar-sm {
    width: 32px; height: 32px;
    background: var(--anaqsup-blue);
    color: #fff; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.anaqsup-avatar { background: var(--anaqsup-gold); color: var(--anaqsup-blue); }

/* PAGE CONTENT */
.page-content {
    flex: 1;
    padding: 1.75rem;
}

/* =============================================================
   COMPOSANTS COMMUNS
   ============================================================= */

/* Cards */
.stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid #e9ecef;
    transition: box-shadow 0.2s;
    height: 100%;
}
.stat-card:hover { box-shadow: var(--shadow); }
.stat-card .stat-icon {
    width: 52px; height: 52px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
}
.stat-value {
    font-family: 'Poppins', sans-serif;
    font-size: 2.2rem; font-weight: 700;
    color: var(--anaqsup-blue); line-height: 1;
}
.stat-label { font-size: 13px; color: #6c757d; margin-top: 4px; }
.stat-trend { font-size: 12px; }

/* Page header */
.page-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    flex-wrap: wrap; gap: 1rem;
    margin-bottom: 1.75rem;
}
.page-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem; font-weight: 700;
    color: var(--anaqsup-blue); margin: 0;
}
.page-subtitle { color: #6c757d; font-size: 14px; margin-top: 4px; }

/* Progress bars */
.progress-lg { height: 12px; border-radius: 6px; }
.progress-xl { height: 20px; border-radius: 10px; }

/* Conformity badges */
.badge-compliant { background: rgba(40,167,69,0.1); color: #28a745; border: 1px solid rgba(40,167,69,0.3); }
.badge-good      { background: rgba(23,162,184,0.1); color: #17a2b8; border: 1px solid rgba(23,162,184,0.3); }
.badge-moderate  { background: rgba(255,193,7,0.1);  color: #d4a000; border: 1px solid rgba(255,193,7,0.3); }
.badge-weak      { background: rgba(253,126,20,0.1); color: #fd7e14; border: 1px solid rgba(253,126,20,0.3); }
.badge-critical  { background: rgba(220,53,69,0.1);  color: #dc3545; border: 1px solid rgba(220,53,69,0.3); }
.badge-level     { padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }

/* Section cards */
.section-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid #e9ecef;
    margin-bottom: 1.5rem;
}
.section-card-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f0f2f5;
}
.section-card-title {
    font-size: 1rem; font-weight: 600;
    color: var(--anaqsup-blue);
    display: flex; align-items: center; gap: 0.5rem;
}

/* Progression steps */
.progress-stepper {
    display: flex; gap: 0.5rem;
    overflow-x: auto; padding-bottom: 0.5rem;
}
.step-pill {
    display: flex; flex-direction: column; align-items: center;
    min-width: 80px; cursor: default;
}
.step-pill-icon {
    width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; border: 2px solid #dee2e6;
    background: #fff; color: #adb5bd; transition: all 0.2s;
    margin-bottom: 4px;
}
.step-pill.completed .step-pill-icon { background: var(--anaqsup-green); border-color: var(--anaqsup-green); color: #fff; }
.step-pill.in-progress .step-pill-icon { background: var(--anaqsup-blue); border-color: var(--anaqsup-blue); color: #fff; }
.step-pill.blocked .step-pill-icon { background: var(--anaqsup-red); border-color: var(--anaqsup-red); color: #fff; }
.step-pill-label { font-size: 10px; color: #6c757d; text-align: center; line-height: 1.2; }
.step-connector { width: 30px; height: 2px; background: #dee2e6; margin-top: 19px; flex-shrink: 0; }
.step-connector.done { background: var(--anaqsup-green); }

/* Radar / Score display */
.score-circle {
    width: 120px; height: 120px;
    border-radius: 50%;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    border: 6px solid #e9ecef;
    font-family: 'Poppins', sans-serif;
}
.score-circle .score-val { font-size: 2rem; font-weight: 800; line-height: 1; }
.score-circle .score-lbl { font-size: 11px; color: #6c757d; }

/* Badge display */
.badge-display {
    display: flex; flex-direction: column; align-items: center;
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px solid #e9ecef;
    text-align: center;
    background: #fff;
    transition: all 0.2s;
}
.badge-display:hover { box-shadow: var(--shadow-sm); }
.badge-display .badge-icon {
    width: 56px; height: 56px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; margin-bottom: 0.5rem;
}
.badge-bronze { background: rgba(205,127,50,0.15); color: #cd7f32; }
.badge-silver { background: rgba(192,192,192,0.15); color: #a0a0a0; }
.badge-gold   { background: rgba(212,175,55,0.15);  color: var(--anaqsup-gold); }
.badge-platinum { background: rgba(229,228,226,0.2); color: #6c757d; }

/* Tables */
.table-card {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid #e9ecef;
}
.table-card table { margin: 0; }
.table-card .table thead th {
    background: #f8fafc;
    font-size: 12px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.5px;
    color: #6c757d; border-bottom: 1px solid #e9ecef;
    padding: 12px 16px;
}
.table-card .table tbody td { padding: 12px 16px; vertical-align: middle; }
.table-card .table tbody tr:hover { background: #f8fafc; }

/* File upload area */
.upload-zone {
    border: 2px dashed #c1ccd6;
    border-radius: var(--radius);
    padding: 3rem 2rem;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.2s;
}
.upload-zone:hover, .upload-zone.drag-over {
    border-color: var(--anaqsup-blue);
    background: rgba(0,51,102,0.04);
}
.upload-zone i { font-size: 3rem; color: #c1ccd6; margin-bottom: 1rem; }

/* Notifications */
.notif-item {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border-left: 3px solid transparent;
    background: #fff;
    margin-bottom: 8px;
    transition: all 0.2s;
}
.notif-item:hover { box-shadow: var(--shadow-sm); }
.notif-item.unread { background: #f0f7ff; border-left-color: var(--anaqsup-blue); }
.notif-item.type-success { border-left-color: var(--anaqsup-green); }
.notif-item.type-warning { border-left-color: var(--anaqsup-orange); }
.notif-item.type-danger  { border-left-color: var(--anaqsup-red); }

/* Sidebar overlay mobile */
.sidebar-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1039;
    display: none;
}
.sidebar-overlay.show { display: block; }

/* Document status badge */
.doc-status { padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.doc-status.pending   { background: #fff3cd; color: #856404; }
.doc-status.approved  { background: #d1e7dd; color: #0f5132; }
.doc-status.rejected  { background: #f8d7da; color: #842029; }
.doc-status.complement_required { background: #fde8d0; color: #984c0c; }

/* Responsive */
@media (max-width: 992px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-wrapper { margin-left: 0; }
    .auth-left { display: none !important; }
    .auth-right { width: 100%; }
}

@media (max-width: 576px) {
    .page-content { padding: 1rem; }
    .section-card { padding: 1rem; }
    .stat-card { padding: 1rem; }
}

/* Utility */
.text-anaqsup { color: var(--anaqsup-blue) !important; }
.bg-anaqsup   { background: var(--anaqsup-blue) !important; }
.text-gold    { color: var(--anaqsup-gold) !important; }
.bg-gold      { background: var(--anaqsup-gold) !important; }
.border-anaqsup { border-color: var(--anaqsup-blue) !important; }
.rounded-xl   { border-radius: var(--radius) !important; }
.shadow-card  { box-shadow: var(--shadow-sm) !important; }
