/* public/css/style.css — Module de Gestion des Notes IFRI/UAC */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary:   #1a3a5c;
    --primary-lt:#2563a8;
    --accent:    #e8a020;
    --success:   #1a7a4a;
    --danger:    #c0392b;
    --info:      #1a6f9a;
    --warning:   #d4770a;
    --bg:        #f4f6fa;
    --card:      #ffffff;
    --text:      #1e2a3a;
    --muted:     #6b7a8d;
    --border:    #dde3ec;
    --radius:    10px;
    --shadow:    0 2px 12px rgba(0,0,0,.08);
}

body { font-family: 'Segoe UI', Arial, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }

/* ── NAVBAR ── */
.navbar {
    background: var(--primary);
    color: #fff;
    display: flex; align-items: center; justify-content: space-between;
    padding: .75rem 1.5rem;
    position: sticky; top: 0; z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.nav-brand { display: flex; align-items: center; gap: .5rem; font-size: 1.1rem; font-weight: 700; }
.nav-logo  { font-size: 1.4rem; }
.nav-links { display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; }
.nav-links a {
    color: rgba(255,255,255,.85); text-decoration: none;
    padding: .35rem .7rem; border-radius: 6px; font-size: .875rem; transition: background .15s;
}
.nav-links a:hover { background: rgba(255,255,255,.15); color: #fff; }
.nav-user  { display: flex; align-items: center; gap: .5rem; margin-left: .75rem; }
.btn-logout {
    background: rgba(255,255,255,.15); color: #fff !important;
    border: 1px solid rgba(255,255,255,.3); border-radius: 6px;
    padding: .3rem .7rem; cursor: pointer; font-size: .8rem; text-decoration: none !important;
}
.btn-logout:hover { background: rgba(255,255,255,.28) !important; }

/* ── BADGES ── */
.badge {
    display: inline-block; padding: .15rem .5rem;
    border-radius: 20px; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
}
.badge-admin    { background: #3d1c6b; color: #e9d5ff; }
.badge-enseignant { background: #1a4f3c; color: #a7f3d0; }
.badge-etudiant { background: #1a3a6b; color: #bfdbfe; }
.badge-chefdep  { background: #7c2d12; color: #fed7aa; }
.badge-success  { background: #dcfce7; color: #166534; }
.badge-danger   { background: #fee2e2; color: #991b1b; }
.badge-info     { background: #dbeafe; color: #1e40af; }
.badge-warning  { background: #fef3c7; color: #92400e; }

/* ── LAYOUT ── */
.main-content { max-width: 1200px; margin: 1.5rem auto; padding: 0 1.25rem; }
.page-header  { margin-bottom: 1.5rem; }
.page-title   { font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.page-sub     { color: var(--muted); margin-top: .25rem; font-size: .9rem; }

/* ── CARDS ── */
.card {
    background: var(--card); border-radius: var(--radius);
    box-shadow: var(--shadow); border: 1px solid var(--border);
    padding: 1.5rem; margin-bottom: 1.25rem;
}
.card-title { font-size: 1.1rem; font-weight: 600; color: var(--primary); margin-bottom: 1rem; padding-bottom: .5rem; border-bottom: 2px solid var(--border); }

/* ── GRID ── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
@media (max-width: 768px) { .grid-2,.grid-3,.grid-4 { grid-template-columns: 1fr; } }

/* ── STAT CARDS ── */
.stat-card {
    background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 1.25rem; border-left: 5px solid var(--primary-lt); text-align: center;
}
.stat-card.success { border-left-color: var(--success); }
.stat-card.warning { border-left-color: var(--warning); }
.stat-card.info    { border-left-color: var(--info); }
.stat-card.accent  { border-left-color: var(--accent); }
.stat-number { font-size: 2rem; font-weight: 800; color: var(--primary); }
.stat-label  { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

/* ── ALERTS ── */
.alert {
    padding: .85rem 1rem; border-radius: 8px; margin-bottom: 1rem;
    display: flex; align-items: center; justify-content: space-between; font-size: .9rem;
}
.alert-success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.alert-danger  { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-info    { background: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.alert-close   { background: none; border: none; cursor: pointer; font-size: 1rem; color: inherit; padding: 0 .25rem; }

/* ── FORMS ── */
.form-group  { margin-bottom: 1rem; }
.form-label  { display: block; font-size: .875rem; font-weight: 600; margin-bottom: .35rem; color: var(--text); }
.form-control {
    width: 100%; padding: .55rem .85rem;
    border: 1px solid var(--border); border-radius: 7px;
    font-size: .9rem; background: #fff; color: var(--text);
    transition: border-color .15s, box-shadow .15s;
}
.form-control:focus { outline: none; border-color: var(--primary-lt); box-shadow: 0 0 0 3px rgba(37,99,168,.12); }
.form-row   { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.form-text  { font-size: .78rem; color: var(--muted); margin-top: .25rem; }
.required   { color: var(--danger); margin-left: 2px; }

/* ── BUTTONS ── */
.btn {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .5rem 1.1rem; border-radius: 7px; font-size: .875rem; font-weight: 600;
    border: none; cursor: pointer; text-decoration: none; transition: all .15s;
}
.btn-primary { background: var(--primary-lt); color: #fff; }
.btn-primary:hover { background: var(--primary); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #145f3a; }
.btn-danger  { background: var(--danger); color: #fff; }
.btn-danger:hover  { background: #9b2c2c; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-sm { padding: .28rem .65rem; font-size: .78rem; }
.btn-outline { background: transparent; border: 1.5px solid var(--primary-lt); color: var(--primary-lt); }
.btn-outline:hover { background: var(--primary-lt); color: #fff; }

/* ── TABLES ── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
thead th {
    background: var(--primary); color: #fff;
    padding: .7rem 1rem; text-align: left; font-weight: 600; font-size: .82rem;
    text-transform: uppercase; letter-spacing: .04em;
}
tbody tr { border-bottom: 1px solid var(--border); transition: background .1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #f0f4fb; }
td { padding: .65rem 1rem; }
.td-actions { display: flex; gap: .4rem; }

/* ── NOTE INPUT ── */
.note-input {
    width: 70px; text-align: center; padding: .3rem .4rem;
    border: 1px solid var(--border); border-radius: 5px; font-size: .9rem;
}
.note-input:focus { border-color: var(--primary-lt); outline: none; }
.note-input.invalid { border-color: var(--danger); background: #fff0f0; }

/* ── MOYENNE INDICATOR ── */
.moy-badge {
    display: inline-block; padding: .2rem .6rem; border-radius: 20px;
    font-weight: 700; font-size: .85rem;
}
.moy-badge.excellent { background: #dcfce7; color: #166534; }
.moy-badge.bien      { background: #dbeafe; color: #1e40af; }
.moy-badge.passable  { background: #fef3c7; color: #92400e; }
.moy-badge.echec     { background: #fee2e2; color: #991b1b; }

/* ── LOGIN PAGE ── */
.login-wrapper {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-lt) 100%);
}
.login-card {
    background: #fff; border-radius: 14px; padding: 2.5rem;
    width: 100%; max-width: 420px; box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.login-logo { text-align: center; font-size: 3rem; margin-bottom: .75rem; }
.login-title { text-align: center; font-size: 1.35rem; font-weight: 800; color: var(--primary); margin-bottom: .25rem; }
.login-sub   { text-align: center; color: var(--muted); font-size: .85rem; margin-bottom: 1.75rem; }

/* ── FOOTER ── */
.footer { text-align: center; padding: 1rem; color: var(--muted); font-size: .8rem; border-top: 1px solid var(--border); margin-top: 2rem; }

/* ── BULLETIN PDF PREVIEW ── */
.bulletin-header { text-align: center; padding: 1rem; border-bottom: 3px double var(--primary); margin-bottom: 1rem; }
.bulletin-title  { font-size: 1.2rem; font-weight: 800; color: var(--primary); text-transform: uppercase; }
.mention-success { color: var(--success); font-weight: 700; }
.mention-echec   { color: var(--danger); font-weight: 700; }

/* ── UTILITIES ── */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--muted); }
.fw-bold     { font-weight: 700; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.d-flex { display: flex; }
.gap-1  { gap: .5rem; }
.gap-2  { gap: 1rem; }
.justify-between { justify-content: space-between; }
.align-center    { align-items: center; }
.w-100 { width: 100%; }
