/* ============================================================
   Inclusive Education Toolkit (IETK) — Main Stylesheet
   Ministry of Education, Zambia — TESS
   Companion to Bootstrap 5 + self-hosted W3.CSS
   Colours: Navy #1F3864  |  Blue #2E75B6  |  Green #1F7A4B
            Amber #D4860B |  Light Blue #EBF3FB
   Font: Arial throughout
   ============================================================ */

/* ── Base ───────────────────────────────────────────────────── */
:root {
    --navy:  #1F3864;
    --blue:  #2E75B6;
    --green: #1F7A4B;
    --amber: #D4860B;
    --lblue: #EBF3FB;
    --lgray: #F5F7FA;
}
* { font-family: Arial, sans-serif; box-sizing: border-box; }
body { background: var(--lgray); color: #222; font-size: .9rem; }
a { color: var(--blue); }
a:hover { color: var(--navy); }
h1,h2,h3,h4,h5,h6 { font-family: Arial, sans-serif; }

/* ── Topbar ─────────────────────────────────────────────────── */
.ietk-topbar {
    background: var(--navy);
    color: #fff;
    height: 56px;
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1040;
    box-shadow: 0 2px 6px rgba(0,0,0,.3);
}
.ietk-topbar .brand {
    font-size: 1.05rem;
    font-weight: bold;
    color: #fff;
    text-decoration: none;
    letter-spacing: .3px;
}
.ietk-topbar .brand span { color: #90C8F0; }
.ietk-topbar .topbar-right { margin-left: auto; display: flex; align-items: center; gap: .75rem; }
.ietk-topbar .topbar-right a,
.ietk-topbar .topbar-right button { color: #cce4f6; font-size: .82rem; text-decoration: none; background: none; border: none; cursor: pointer; }
.ietk-topbar .topbar-right a:hover { color: #fff; }

/* ── Sidebar ─────────────────────────────────────────────────── */
.ietk-sidebar {
    position: fixed;
    top: 56px; left: 0; bottom: 0;
    width: 230px;
    background: #162D54;
    overflow-y: auto;
    z-index: 1030;
    padding-top: .5rem;
    transition: transform .25s ease;
}
.ietk-sidebar .nav-section {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #6A8BB5;
    padding: .85rem 1rem .25rem;
}
.ietk-sidebar .nav-link {
    color: #b0c9e8;
    padding: .5rem 1rem;
    display: flex;
    align-items: center;
    gap: .6rem;
    font-size: .83rem;
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: background .15s, color .15s;
}
.ietk-sidebar .nav-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.ietk-sidebar .nav-link.active { background: rgba(46,117,182,.25); color: #fff; border-left-color: var(--blue); }
.ietk-sidebar .nav-link i { font-size: 1rem; }

/* ── Main content ────────────────────────────────────────────── */
.ietk-main {
    margin-left: 230px;
    margin-top: 56px;
    padding: 1.5rem;
    min-height: calc(100vh - 56px);
}

/* ── Stat cards ──────────────────────────────────────────────── */
.stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    border-left: 4px solid var(--blue);
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    height: 100%;
}
.stat-card .stat-value { font-size: 1.9rem; font-weight: bold; line-height: 1; }
.stat-card .stat-label { font-size: .74rem; color: #666; margin-top: .2rem; }
.stat-card.green  { border-left-color: var(--green); }
.stat-card.amber  { border-left-color: var(--amber); }
.stat-card.navy   { border-left-color: var(--navy); }
.stat-card.purple { border-left-color: #7B2C9E; }

/* ── Cards ───────────────────────────────────────────────────── */
.ietk-card { background: #fff; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.08); overflow: hidden; }
.ietk-card-header {
    background: var(--navy); color: #fff;
    padding: .6rem 1rem;
    font-size: .85rem;
    font-weight: bold;
    display: flex; align-items: center; gap: .5rem;
    justify-content: space-between;
}
.ietk-card-header.blue  { background: var(--blue); }
.ietk-card-header.green { background: var(--green); }
.ietk-card-body { padding: 1rem; }

/* ── Section progress grid ───────────────────────────────────── */
.section-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(84px,1fr)); gap: .5rem; }
.section-tile {
    border-radius: 6px;
    border: 2px solid #CCC;
    padding: .45rem .3rem;
    text-align: center;
    text-decoration: none;
    font-size: .68rem;
    transition: transform .1s;
    background: #F8F8F8;
    color: #666;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.section-tile:hover { transform: scale(1.04); text-decoration: none; }
.section-tile.complete  { background: #EEF8F1; border-color: var(--green); color: #144D2C; }
.section-tile.inprogress{ background: #FFF8EC; border-color: var(--amber); color: #6B3C00; }
.section-tile .snum  { font-weight: bold; font-size: .78rem; }
.section-tile .stitle{ line-height: 1.2; }
.section-tile .sicon { font-size: .9rem; }

/* ── Progress bar ────────────────────────────────────────────── */
.progress-thin { height: 8px; border-radius: 4px; }

/* ── Alert info box (next action) ────────────────────────────── */
.next-action {
    background: var(--lblue);
    border-left: 4px solid var(--blue);
    border-radius: 6px;
    padding: .85rem 1rem;
    display: flex; gap: .75rem; align-items: flex-start;
}

/* ── Tables ──────────────────────────────────────────────────── */
.ietk-table thead th { background: #E8EFF8; color: var(--navy); font-size: .8rem; }
.ietk-table tbody td { font-size: .82rem; vertical-align: middle; }
.ietk-table tbody tr:hover { background: #f4f8fd; }

/* ── Condition chips (6-condition check) ─────────────────────── */
.condition-chip {
    border-radius: 6px; padding: .4rem .5rem;
    text-align: center; border: 1px solid #CCC;
    font-size: .7rem; line-height: 1.2;
    background: #FAFAFA;
}
.condition-chip.met { background: #EEF8F1; border-color: var(--green); }
.condition-chip i { font-size: 1.1rem; display: block; margin-bottom: 2px; }

/* ── Commitment badge ────────────────────────────────────────── */
.commitment-strip {
    background: var(--lblue); border-left: 3px solid var(--blue);
    border-radius: 4px; padding: .5rem .75rem;
    font-size: .8rem;
}

/* ── Forms ───────────────────────────────────────────────────── */
.form-label { font-weight: bold; font-size: .83rem; color: var(--navy); margin-bottom: .2rem; }
.form-control, .form-select {
    border-color: #C9D8EC;
    font-size: .85rem;
}
.form-control:focus, .form-select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 .2rem rgba(46,117,182,.2);
}
.btn-primary   { background: var(--blue);  border-color: var(--blue);  }
.btn-primary:hover { background: var(--navy); border-color: var(--navy); }
.btn-success   { background: var(--green); border-color: var(--green); }
.btn-navy      { background: var(--navy);  border-color: var(--navy); color:#fff; }

/* ── Login page ──────────────────────────────────────────────── */
.login-wrapper {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--navy) 40%, var(--blue) 100%);
}
.login-card { background: #fff; border-radius: 10px; padding: 2.5rem; width: 100%; max-width: 420px; box-shadow: 0 8px 32px rgba(0,0,0,.25); }
.login-logo { text-align: center; margin-bottom: 1.5rem; }
.login-logo .app-name { font-size: 1.3rem; font-weight: bold; color: var(--navy); }
.login-logo .app-sub  { font-size: .78rem; color: #666; }

/* ── Certificate print ───────────────────────────────────────── */
@media print {
    .ietk-topbar,.ietk-sidebar,.no-print { display:none !important; }
    .ietk-main { margin:0 !important; padding:0 !important; }
    .cert-wrapper { position:fixed; top:0;left:0; width:100%; }
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
    .ietk-sidebar { transform: translateX(-230px); }
    .ietk-sidebar.show { transform: translateX(0); }
    .ietk-main { margin-left: 0; }
    .section-grid { grid-template-columns: repeat(3,1fr); }
}

/* ── Choropleth map ──────────────────────────────────────────── */
#zambiaMap path { cursor: default; transition: opacity .2s; }
#zambiaMap path:hover { opacity: .8; }
