/* ============================================================
   COMPLEXE SCOLAIRE BILINGUE GOSHEN — Feuille de style
   Couleurs : Bleu royal #1A56DB · Jaune or #FFD700 · Violet #5E22A0
   Polices   : Poppins (titres) · Nunito (corps)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&family=Poppins:wght@500;600;700&display=swap');

:root {
  /* Couleurs GOSHEN */
  --blue:       #1A56DB;
  --blue-dk:    #0D3875;
  --blue-md:    #1E4FA8;
  --blue-lt:    #EEF4FF;
  --blue-pale:  #F5F8FF;

  --yellow:     #FFD700;
  --yellow-dk:  #D4A800;
  --yellow-lt:  #FFFBDB;
  --yellow-pale:#FFFEF0;

  --purple:     #5E22A0;
  --purple-lt:  #F3EDFB;

  --red:        #C62828;
  --red-lt:     #FDECEA;
  --green:      #1B7A4A;
  --green-lt:   #E8F5EE;
  --amber:      #D97706;
  --amber-lt:   #FFFBEB;

  --bg:         #EEF2FA;
  --surface:    #FFFFFF;
  --border:     #D8E4F2;
  --border-lt:  #EEF2FA;

  --text:       #0D1F3C;
  --text-md:    #354968;
  --muted:      #6B7FA0;

  --sidebar-w:  224px;
  --topbar-h:   56px;
  --radius:     8px;
  --radius-lg:  12px;
  --radius-xl:  16px;

  --font:       'Nunito', sans-serif;
  --font-head:  'Poppins', sans-serif;

  --shadow-sm:  0 1px 3px rgba(26,86,219,.08);
  --shadow-md:  0 4px 16px rgba(26,86,219,.10);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.55; }
a    { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================================
   LAYOUT
   ============================================================ */
.app-layout    { display: flex; min-height: 100vh; }
.main-wrapper  { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.main-content  { flex: 1; padding: 22px 24px; overflow-y: auto; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--blue-dk);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 200;
  transition: transform .25s;
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

.sidebar-logo  { padding: 15px 13px 12px; border-bottom: 1px solid rgba(255,255,255,.07); }
.logo-inner    { display: flex; align-items: center; gap: 9px; }
.logo-name     { font-family: var(--font-head); color: var(--yellow); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.logo-sub      { color: rgba(255,255,255,.38); font-size: 9.5px; margin-top: 1px; letter-spacing: .02em; }

.sidebar-nav   { flex: 1; padding: 8px 8px; }
.nav-section   { font-size: 9px; font-weight: 800; color: rgba(255,255,255,.22); text-transform: uppercase; letter-spacing: .1em; padding: 12px 8px 4px; }
.ni {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: var(--radius);
  color: rgba(255,255,255,.48); font-size: 12px; font-weight: 700;
  text-decoration: none; margin-bottom: 1px; transition: all .13s;
}
.ni:hover { background: rgba(255,255,255,.07); color: rgba(255,255,255,.85); text-decoration: none; }
.ni.active { background: rgba(255,215,0,.14); color: var(--yellow); }
.ni i { font-size: 15px; width: 18px; text-align: center; flex-shrink: 0; }
.ni-badge { margin-left: auto; background: var(--red); color: white; font-size: 9px; font-weight: 800; padding: 1px 6px; border-radius: 10px; }
.ni-badge.badge-warn { background: var(--yellow-dk); color: #1a0d00; }

.sidebar-motto  { padding: 8px 14px 6px; font-size: 9.5px; font-style: italic; color: rgba(255,255,255,.27); text-align: center; line-height: 1.5; border-top: 1px solid rgba(255,255,255,.06); }
.sidebar-footer { padding: 10px 10px 12px; border-top: 1px solid rgba(255,255,255,.06); }
.sf-row    { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--radius); background: rgba(255,255,255,.05); }
.sf-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--yellow); color: var(--blue-dk); font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sf-info   { flex: 1; min-width: 0; }
.sf-name   { color: rgba(255,255,255,.82); font-size: 11px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sf-role   { color: rgba(255,255,255,.32); font-size: 9.5px; }
.sf-logout { color: rgba(255,255,255,.3); font-size: 15px; margin-left: auto; transition: color .15s; }
.sf-logout:hover { color: #FF6B6B; text-decoration: none; }

.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 199; }

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 22px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
  margin-left: var(--sidebar-w);
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.menu-toggle { display: none; background: none; border: none; cursor: pointer; font-size: 20px; color: var(--muted); }
.page-title  { font-family: var(--font-head); font-size: 15px; font-weight: 700; color: var(--blue-dk); }
.breadcrumb  { font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.topbar-btn   { width: 34px; height: 34px; border-radius: var(--radius); border: 1px solid var(--border); background: white; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 16px; position: relative; text-decoration: none; transition: all .13s; }
.topbar-btn:hover { background: var(--blue-lt); color: var(--blue); text-decoration: none; }
.notif-dot { position: absolute; top: -4px; right: -4px; background: var(--red); color: white; font-size: 8px; font-weight: 800; padding: 1px 4px; border-radius: 10px; min-width: 16px; text-align: center; border: 1.5px solid white; }

.topbar-admin-btn { display: flex; align-items: center; gap: 7px; background: none; border: 1px solid var(--border); border-radius: 20px; padding: 5px 12px 5px 6px; cursor: pointer; font-family: var(--font); }
.topbar-avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--blue); color: white; font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.topbar-admin-name { font-size: 12px; font-weight: 700; color: var(--text-md); }
.admin-menu-wrap { position: relative; }
.admin-dropdown { display: none; position: absolute; right: 0; top: calc(100% + 6px); background: white; border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); min-width: 180px; overflow: hidden; z-index: 300; }
.admin-dropdown.show { display: block; }
.admin-dropdown a { display: flex; align-items: center; gap: 9px; padding: 9px 14px; font-size: 12px; font-weight: 600; color: var(--text-md); text-decoration: none; }
.admin-dropdown a:hover { background: var(--blue-lt); color: var(--blue); }
.admin-dropdown hr { border: none; border-top: 1px solid var(--border-lt); margin: 4px 0; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: var(--radius); font-family: var(--font); font-size: 12.5px; font-weight: 700; cursor: pointer; border: none; text-decoration: none; transition: all .13s; white-space: nowrap; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--blue); color: white; }
.btn-primary:hover { background: var(--blue-md); }
.btn-yellow  { background: var(--yellow); color: var(--blue-dk); }
.btn-yellow:hover { background: var(--yellow-dk); }
.btn-outline { background: white; border: 1px solid var(--border); color: var(--text-md); }
.btn-outline:hover { background: var(--blue-lt); }
.btn-danger  { background: var(--red); color: white; }
.btn-danger:hover { background: #9b1e1e; }
.btn-success { background: var(--green); color: white; }
.btn-sm { padding: 5px 10px; font-size: 11px; }
.btn-xs { padding: 3px 8px; font-size: 10.5px; }

/* ============================================================
   STATS CARDS
   ============================================================ */
.stats-grid { display: grid; gap: 12px; margin-bottom: 18px; }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g2 { grid-template-columns: repeat(2, 1fr); }

.stat-card  { background: var(--surface); border-radius: var(--radius-lg); padding: 14px 16px; border: 1px solid var(--border); }
.stat-icon  { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; margin-bottom: 10px; }
.si-blue    { background: var(--blue-lt);   color: var(--blue); }
.si-yellow  { background: var(--yellow-lt); color: #8a6200; }
.si-purple  { background: var(--purple-lt); color: var(--purple); }
.si-red     { background: var(--red-lt);    color: var(--red); }
.si-green   { background: var(--green-lt);  color: var(--green); }
.si-amber   { background: var(--amber-lt);  color: var(--amber); }
.stat-num   { font-family: var(--font-head); font-size: 22px; font-weight: 700; color: var(--blue-dk); line-height: 1; }
.stat-label { font-size: 11px; color: var(--muted); margin-top: 3px; }
.stat-delta { font-size: 10px; font-weight: 700; margin-top: 6px; display: flex; align-items: center; gap: 3px; }
.d-up { color: var(--green); } .d-dn { color: var(--red); }

/* ============================================================
   CARDS
   ============================================================ */
.card { background: var(--surface); border-radius: var(--radius-lg); border: 1px solid var(--border); overflow: hidden; margin-bottom: 16px; }
.card-header { padding: 13px 16px 11px; border-bottom: 1px solid var(--border-lt); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.card-title  { font-family: var(--font-head); font-size: 12.5px; font-weight: 700; color: var(--blue-dk); display: flex; align-items: center; gap: 6px; }
.card-body   { padding: 14px 16px; }

.grid-2col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; margin-bottom: 16px; }

/* ============================================================
   TABLES
   ============================================================ */
table { width: 100%; border-collapse: collapse; }
th { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px 12px; text-align: left; background: #F8FAFD; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 9px 12px; font-size: 12px; color: var(--text); border-bottom: 1px solid var(--border-lt); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #F8FAFD; }
.td-empty { text-align: center; color: var(--muted); padding: 28px !important; font-size: 12px; }
.td-user { display: flex; align-items: center; gap: 8px; }

/* ============================================================
   AVATARS
   ============================================================ */
.av { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; flex-shrink: 0; }
.av-b  { background: #DBEAFE; color: #1E40AF; }
.av-y  { background: #FEF3C7; color: #92400E; }
.av-p  { background: #EDE9FE; color: #5B21B6; }
.av-r  { background: #FCE7F3; color: #9D174D; }
.av-g  { background: #D1FAE5; color: #065F46; }

/* ============================================================
   BADGES
   ============================================================ */
.badge { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 20px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.b-green  { background: #D1FAE5; color: #065F46; }
.b-amber  { background: #FEF3C7; color: #92400E; }
.b-red    { background: #FEE2E2; color: #991B1B; }
.b-blue   { background: #DBEAFE; color: #1E40AF; }
.b-purple { background: #EDE9FE; color: #5B21B6; }
.b-gray   { background: #F3F4F6; color: #374151; }
.b-yellow { background: var(--yellow-lt); color: #7a5800; }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12px; font-weight: 700; color: var(--text-md); margin-bottom: 5px; }
.form-control {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: var(--radius); font-family: var(--font); font-size: 12.5px;
  color: var(--text); background: white; outline: none; transition: border-color .15s, box-shadow .15s;
}
.form-control:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26,86,219,.10); }
textarea.form-control { min-height: 90px; resize: vertical; line-height: 1.5; }
.form-hint { font-size: 10.5px; color: var(--muted); margin-top: 4px; }
.required { color: var(--red); }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 160px; }
.radio-group { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-label { display: flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1.5px solid var(--border); border-radius: var(--radius); font-size: 12px; font-weight: 700; cursor: pointer; transition: all .13s; }
.radio-label:has(input:checked) { border-color: var(--blue); background: var(--blue-lt); color: var(--blue); }
.radio-label input { display: none; }

/* ============================================================
   ALERTS
   ============================================================ */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; display: flex; align-items: center; gap: 9px; font-size: 12.5px; font-weight: 600; }
.alert-success { background: var(--green-lt); color: #065F46; border: 1px solid #A7F3D0; }
.alert-danger  { background: var(--red-lt);   color: var(--red);   border: 1px solid #FECACA; }
.alert-warning { background: var(--amber-lt); color: var(--amber); border: 1px solid #FDE68A; }
.alert-info    { background: var(--blue-lt);  color: var(--blue);  border: 1px solid #BFDBFE; }

/* ============================================================
   FILTERS BAR
   ============================================================ */
.filter-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.search-wrap { position: relative; flex: 1; min-width: 200px; }
.search-wrap i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 15px; color: var(--muted); pointer-events: none; }
.search-wrap input { width: 100%; padding: 8px 10px 8px 32px; }

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.page-header h2 { font-family: var(--font-head); font-size: 18px; font-weight: 700; color: var(--blue-dk); }
.page-header p  { font-size: 11px; color: var(--muted); margin-top: 2px; }
.ph-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ============================================================
   MODALS
   ============================================================ */
.modal-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.42); z-index: 400; align-items: center; justify-content: center; padding: 16px; }
.modal-backdrop.open { display: flex; }
.modal { background: white; border-radius: var(--radius-xl); width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; border: 1px solid var(--border); }
.modal-lg { max-width: 700px; }
.modal-header { padding: 16px 20px; border-bottom: 1px solid var(--border-lt); display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-family: var(--font-head); font-size: 14px; font-weight: 700; color: var(--blue-dk); }
.modal-close { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 18px; padding: 4px; border-radius: 6px; }
.modal-close:hover { background: var(--border-lt); }
.modal-body { padding: 20px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--border-lt); }

/* ============================================================
   FINANCE — Grille tarifaire
   ============================================================ */
.tarif-block { margin-bottom: 16px; }
.tarif-block-header { background: var(--blue); color: white; padding: 8px 14px; border-radius: var(--radius) var(--radius) 0 0; font-family: var(--font-head); font-size: 11.5px; font-weight: 700; }
.tarif-block-header.mat { background: var(--purple); }
.tarif-inner { border: 1px solid var(--border); border-top: none; border-radius: 0 0 var(--radius) var(--radius); overflow: hidden; }
.tarif-inner table th { background: #F8FAFD; }
.tarif-total { font-weight: 800; color: var(--blue-dk); }

/* ============================================================
   PROGRESS
   ============================================================ */
.progress { height: 6px; background: var(--border-lt); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.progress-fill { height: 100%; border-radius: 3px; background: var(--blue); transition: width .4s; }

/* ============================================================
   ACTIVITY FEED
   ============================================================ */
.activity-list { display: flex; flex-direction: column; gap: 8px; }
.activity-item { display: flex; align-items: flex-start; gap: 10px; padding: 9px 11px; border-radius: var(--radius); background: var(--blue-pale); border: 1px solid var(--border-lt); }
.activity-icon { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.ai-blue   { background: var(--blue-lt);   color: var(--blue); }
.ai-yellow { background: var(--yellow-lt); color: #7a5800; }
.ai-red    { background: var(--red-lt);    color: var(--red); }
.ai-green  { background: var(--green-lt);  color: var(--green); }
.activity-text { flex: 1; font-size: 11.5px; color: var(--text-md); line-height: 1.4; }
.activity-time { font-size: 10px; color: var(--muted); flex-shrink: 0; }

/* ============================================================
   TRANSPORT — Routes
   ============================================================ */
.route-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px; margin-bottom: 14px; }
.route-card { background: var(--surface); border-radius: var(--radius-lg); border: 1px solid var(--border); padding: 14px; }
.route-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.route-name { font-weight: 700; font-size: 12px; color: var(--blue-dk); }
.stops-list { display: flex; flex-direction: column; gap: 4px; }
.stop-item  { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); }
.stop-dot   { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.stop-line  { width: 1px; height: 12px; background: var(--border); margin-left: 4px; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--blue-dk) 0%, #1A3A8A 60%, #0a2460 100%); padding: 20px; }
.login-card { background: white; border-radius: var(--radius-xl); padding: 40px; width: 100%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.login-logo { text-align: center; margin-bottom: 28px; }
.login-school { font-family: var(--font-head); font-size: 15px; font-weight: 700; color: var(--blue-dk); margin-top: 10px; }
.login-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; }

/* ============================================================
   MOBILE MONEY
   ============================================================ */
.provider-grid { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.provider-card { flex: 1; min-width: 130px; padding: 14px; border-radius: var(--radius-lg); border: 2px solid var(--border); background: white; cursor: pointer; text-align: center; transition: all .15s; }
.provider-card:hover { border-color: var(--blue); background: var(--blue-lt); }
.provider-card.mtn    { border-color: #FFD700; background: #FFFBDB; }
.provider-card.orange { border-color: #FF6600; background: #FFF3EB; }
.provider-logo { font-size: 26px; margin-bottom: 5px; }
.provider-name { font-size: 12px; font-weight: 800; color: var(--blue-dk); }
.provider-sub  { font-size: 10px; color: var(--muted); }
.payment-status { padding: 12px 14px; border-radius: var(--radius); text-align: center; font-size: 12.5px; font-weight: 600; margin-top: 12px; display: none; }
.ps-loading { background: var(--blue-lt);  color: var(--blue); }
.ps-success { background: var(--green-lt); color: var(--green); }
.ps-error   { background: var(--red-lt);   color: var(--red); }

/* ============================================================
   PARENT PORTAL
   ============================================================ */
.parent-topbar { background: var(--blue-dk); padding: 0 20px; height: 56px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 100; }
.parent-nav    { background: white; border-bottom: 2px solid var(--border); padding: 0 20px; display: flex; gap: 4px; overflow-x: auto; }
.parent-tab    { display: flex; align-items: center; gap: 6px; padding: 14px 14px; font-size: 12px; font-weight: 700; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.parent-tab:hover { color: var(--blue); text-decoration: none; }
.parent-tab.active { color: var(--blue); border-color: var(--blue); }
.parent-content { max-width: 960px; margin: 0 auto; padding: 20px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
.main-wrapper { margin-left: var(--sidebar-w); }

@media (max-width: 1024px) {
  .g4 { grid-template-columns: repeat(2, 1fr); }
  .grid-2col { grid-template-columns: 1fr; }
  .route-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar.open ~ .sidebar-overlay,
  .sidebar-overlay.active { display: block; }
  .main-wrapper { margin-left: 0; }
  .topbar { margin-left: 0; }
  .menu-toggle { display: flex; }
  .g4 { grid-template-columns: 1fr 1fr; }
  .g3 { grid-template-columns: 1fr; }
  .main-content { padding: 14px; }
}

@media (max-width: 480px) {
  .g4, .g3, .g2 { grid-template-columns: 1fr; }
}

/* ============================================================
   UTILITIES
   ============================================================ */
.text-muted   { color: var(--muted); }
.text-danger  { color: var(--red); }
.text-success { color: var(--green); }
.text-blue    { color: var(--blue); }
.fw-bold      { font-weight: 700; }
.fw-800       { font-weight: 800; }
.font-head    { font-family: var(--font-head); }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.text-center  { text-align: center; }
.d-flex       { display: flex; }
.align-center { align-items: center; }
.gap-8        { gap: 8px; }
.gap-12       { gap: 12px; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.3); border-top-color: white; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
