:root {
  --topbar-1: #2E9BF0;
  --topbar-2: #6FC3F7;
  --sidebar-bg: #0B3B66;
  --sidebar-active: #2E9BF0;
  --accent: #2E9BF0;
  --accent-dark: #1C7FCB;
  --bg: #F4F7FB;
  --text-dark: #1E2A38;
  --text-muted: #7C8AA0;
  --card-border: #E7ECF3;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text-dark);
  font-size: 14px;
}
a { color: var(--accent-dark); text-decoration: none; }

/* ---------- Topbar ---------- */
.topbar {
  height: 64px;
  background: linear-gradient(90deg, var(--topbar-1), var(--topbar-2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.brand small { display: block; font-size: 10px; font-weight: 400; letter-spacing: 1.5px; opacity: .85; }
.topbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px; border: none;
  font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn-white { background: #fff; color: var(--accent); }
.btn-green { background: #22C55E; color: #fff; position: relative; }
.btn-blue  { background: #0EA5E9; color: #fff; }
.btn-cyan  { background: #38BDF8; color: #fff; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-outline { background: #fff; border: 1px solid #D7E0EC; color: var(--text-dark); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-danger { background: #EF4444; color: #fff; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 7px;
  background: #fff; border: 1px solid #D7E0EC; color: var(--text-dark);
  text-decoration: none; flex-shrink: 0; transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.icon-btn:hover { background: #F1F5F9; border-color: #C7D2E0; }
.icon-btn-danger:hover { background: #FEE2E2; border-color: #F5B5B5; color: #B91C1C; }
.badge-count {
  position: absolute; top: -6px; right: -6px; background: #EF4444; color: #fff;
  font-size: 10px; width: 16px; height: 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.user-chip { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.user-chip .role { display: block; font-weight: 400; font-size: 11px; opacity: .85; }

/* ---------- Layout ---------- */
.layout { display: flex; align-items: flex-start; }
.sidebar { width: 250px; background: var(--sidebar-bg); min-height: calc(100vh - 64px); padding: 14px 0; flex-shrink: 0; position: sticky; top: 64px; overflow-y: auto; max-height: calc(100vh - 64px); }
.side-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 20px;
  color: rgba(255,255,255,.75); font-size: 13.5px; cursor: pointer; border-left: 3px solid transparent;
}
.side-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.side-item.active { background: rgba(255,255,255,.08); color: #fff; border-left: 3px solid var(--sidebar-active); font-weight: 600; }
.side-item .icon { width: 18px; text-align: center; opacity: .9; }
.main { flex: 1; padding: 28px 32px; min-width: 0; }

/* ---------- Sidebar submenu groups (User & Roles, Activity Logs, Transactions) ---------- */
.side-toggle { cursor: pointer; user-select: none; justify-content: flex-start; }
.side-toggle .chev { margin-left: auto; font-size: 13px; transition: transform .18s ease; opacity: .7; }
.side-group.open > .side-toggle .chev { transform: rotate(180deg); }
.side-group.open > .side-toggle { color: #fff; }
.side-sub { max-height: 0; overflow: hidden; transition: max-height .2s ease; }
.side-group.open > .side-sub { max-height: 300px; }
.side-sub-item {
  display: block; padding: 9px 20px 9px 50px; font-size: 13px;
  color: rgba(255,255,255,.62); border-left: 3px solid transparent;
}
.side-sub-item:hover { color: #fff; background: rgba(255,255,255,.05); }
.side-sub-item.active { color: #fff; font-weight: 600; border-left: 3px solid var(--sidebar-active); background: rgba(255,255,255,.06); }

.page-title { font-size: 14px; font-weight: 700; letter-spacing: .5px; color: #4A5A70; margin-bottom: 18px; text-transform: uppercase; display:flex; align-items:center; gap:10px; justify-content: space-between; }
.route-banner {
  font-size: 11.5px; color: #9AA7B8; font-family: 'Consolas', 'Courier New', monospace;
  margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px dashed #E7ECF3;
}
.d-none-toggle { display: none !important; }

/* ---------- Dashboard cards ---------- */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 24px; }
.card { background: #fff; border: 1px solid var(--card-border); border-radius: 12px; padding: 22px; display: flex; align-items: center; gap: 16px; box-shadow: 0 1px 3px rgba(20,40,70,.05); }
.card .icon-wrap { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.card .num { font-size: 26px; font-weight: 700; }
.card .label { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.icon-1 { background: #E3F2FD; color: #2E9BF0; }
.icon-2 { background: #E0F2FE; color: #0EA5E9; }
.icon-3 { background: #ECFDF5; color: #10B981; }
.icon-4 { background: #FFF7ED; color: #F59E0B; }

/* ---------- Panels / filter box / table ---------- */
.panel { background: #fff; border: 1px solid var(--card-border); border-radius: 12px; padding: 20px; margin-bottom: 20px; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; align-items: end; }
.filter-grid label { display: block; font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; margin-bottom: 6px; }
.filter-grid input, .filter-grid select {
  width: 100%; padding: 9px 10px; border: 1px solid #D7E0EC; border-radius: 8px; font-size: 13px; background: #fff;
}
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--card-border); border-radius: 12px; }
table.data-table { width: 100%; border-collapse: collapse; min-width: 900px; }
table.data-table thead th {
  background: var(--sidebar-bg); color: #fff; text-align: left; padding: 12px 14px;
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .3px; white-space: nowrap;
}
table.data-table tbody td { padding: 12px 14px; border-bottom: 1px solid #EEF2F7; vertical-align: top; font-size: 13px; }
table.data-table tbody tr:hover { background: #F8FBFF; }
.flag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border: 1px solid #D7E0EC; border-radius: 6px; font-size: 11px; font-weight: 700; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 600; }
.badge-blue  { background: #E3F2FD; color: #1C7FCB; }
.badge-amber { background: #FEF3C7; color: #B45309; }
.badge-teal  { background: #CCFBF1; color: #0F766E; }
.badge-green { background: #DCFCE7; color: #15803D; }
.badge-red   { background: #FEE2E2; color: #B91C1C; }
.badge-gray  { background: #F1F5F9; color: #64748B; }
.badge-purple { background: #EDE9FE; color: #6D28D9; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-group { margin-bottom: 4px; }
.form-group label { display: block; font-size: 12.5px; font-weight: 700; color: #4A5A70; margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #D7E0EC; border-radius: 8px; font-size: 13.5px;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.form-actions { margin-top: 18px; display: flex; gap: 10px; }
.required:after { content: " *"; color: #EF4444; }

/* ---------- Alerts ---------- */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-size: 13.5px; }
.alert-success { background: #DCFCE7; color: #15803D; border: 1px solid #86EFAC; }
.alert-error   { background: #FEE2E2; color: #B91C1C; border: 1px solid #FCA5A5; }

/* ---------- Login page ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--topbar-1), var(--sidebar-bg)); }
.login-card { background: #fff; width: 380px; padding: 36px 32px; border-radius: 14px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.login-card .brand { color: var(--sidebar-bg); justify-content: center; margin-bottom: 22px; }
.login-card .brand small { color: var(--text-muted); }
.login-hint { margin-top: 16px; font-size: 12px; color: var(--text-muted); background: #F4F7FB; padding: 10px; border-radius: 8px; }

footer.site-footer { text-align: center; padding: 16px; font-size: 12px; color: var(--text-muted); }

.pagination { display: flex; gap: 6px; padding: 14px; justify-content: flex-end; }
.pagination a, .pagination span { padding: 6px 11px; border: 1px solid #D7E0EC; border-radius: 6px; font-size: 12.5px; color: var(--text-dark); }
.pagination .active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- University requirement / commission cards ---------- */
.uni-card { background: #fff; border: 1px solid var(--card-border); border-radius: 12px; margin-bottom: 18px; overflow: hidden; }
.uni-card-head { display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--card-border); }
.uni-logo { width: 56px; height: 56px; border-radius: 10px; background: var(--sidebar-bg); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.uni-card-head .uni-name { font-weight: 700; font-size: 15px; }
.uni-card-head .uni-country { font-size: 12.5px; color: var(--text-muted); }
.uni-level-row { display: grid; grid-template-columns: 110px repeat(9, 1fr); gap: 10px; padding: 12px 20px; font-size: 12px; border-bottom: 1px solid #F3F6FA; align-items: center; }
.uni-level-row:last-child { border-bottom: none; }
.uni-level-row .level-name { font-weight: 700; color: var(--text-dark); }
.uni-level-row .field-label { display: block; color: var(--text-muted); font-size: 10.5px; text-transform: uppercase; margin-bottom: 2px; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; background: #E3F2FD; color: #1C7FCB; }
.pill-outline { background: #fff; border: 1px solid #D7E0EC; color: var(--text-dark); }
.pill-solid { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; background: var(--accent); color: #fff; white-space: nowrap; }
.pill-solid-muted { background: #9FB3C8; }
.req-table-wrap { width: 100%; min-width: 1360px; border-collapse: collapse; }
.req-table-wrap th { background: linear-gradient(90deg, var(--topbar-1), var(--topbar-2)); color: #fff; text-transform: uppercase; font-size: 11px; letter-spacing: .03em; padding: 10px 14px; text-align: left; white-space: nowrap; }
.req-table-wrap > tbody > tr > td { padding: 10px 14px; vertical-align: top; }
.req-table-wrap > tbody > tr.uni-group-end > td { border-bottom: 6px solid #F4F7FB; }
.uni-cell-card { border: 1px solid var(--card-border); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.req-row { display: flex; flex-wrap: nowrap; gap: 8px 18px; align-items: flex-start; padding: 6px 0; white-space: nowrap; }
.req-row .req-field { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; white-space: nowrap; }
.req-row .req-field .field-label { display: block; text-transform: none; font-size: 11.5px; color: var(--text-muted); font-weight: 400; margin: 0; }
.req-row .level-name { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; font-size: 12.5px; min-width: 78px; white-space: nowrap; }
.req-row .level-name .field-label { display: block; text-transform: none; font-size: 11.5px; color: var(--text-muted); font-weight: 400; margin: 0; }
.req-row .level-name .level-value { font-weight: 700; color: var(--text-dark); }

.commission-value { display: inline-block; padding: 4px 12px; border-radius: 8px; background: var(--sidebar-bg); color: #fff; font-weight: 700; font-size: 12.5px; }

.agreement-card { background: #fff; border: 1px solid var(--card-border); border-radius: 12px; padding: 24px; width: 260px; text-align: center; }
.agreement-card .a-logo { width: 56px; height: 56px; margin: 0 auto 10px; border-radius: 10px; background: var(--sidebar-bg); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.agreement-card .a-title { font-weight: 700; margin-bottom: 2px; }
.agreement-card .a-sub { font-size: 11.5px; color: var(--text-muted); margin-bottom: 14px; }
.agreement-grid { display: flex; flex-wrap: wrap; gap: 18px; }

@media (max-width: 900px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .uni-level-row { grid-template-columns: 1fr; }
  .program-grid { grid-template-columns: 1fr; }
  .program-grid > .program-card:last-child:nth-child(odd) { max-width: 100%; }
}

/* ---------- Apply: country selection cards ---------- */
.country-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}
.country-card {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 22px 14px;
  text-align: center;
  text-decoration: none;
  color: var(--text-dark);
  transition: box-shadow .15s ease, transform .15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.country-card:hover { box-shadow: 0 8px 22px rgba(20,40,70,.12); transform: translateY(-2px); }
.country-flag { font-size: 40px; line-height: 1; }
.country-name { font-weight: 700; font-size: 14px; }
.country-count { font-size: 11.5px; color: var(--text-muted); }

/* ---------- Apply: university selection cards (step 2) ---------- */
.university-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.university-card {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 20px 14px;
  text-align: center;
  text-decoration: none;
  color: var(--text-dark);
  transition: box-shadow .15s ease, transform .15s ease;
}
.university-card:hover { box-shadow: 0 8px 22px rgba(20,40,70,.12); transform: translateY(-2px); }
.university-card-name { font-weight: 700; font-size: 13.5px; margin-bottom: 4px; }
.university-card-sub { font-size: 11.5px; color: var(--text-muted); }

/* ---------- Apply: program catalog cards ---------- */
.filter-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: #E3F2FD; color: #1C7FCB; padding: 8px 14px; border-radius: 8px;
  font-size: 13px; font-weight: 600;
}
.filter-chip a { color: #1C7FCB; text-decoration: none; font-weight: 700; }
.program-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-bottom: 20px;
}
.program-grid > .program-card:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  max-width: calc(50% - 9px);
  margin: 0 auto;
}
.program-card {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  overflow: hidden;
}
.program-card-head {
  background: linear-gradient(90deg, #EAF4FF, #DCEBFB);
  color: var(--sidebar-bg);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 13.5px;
  border-bottom: 1px solid #D3E4F5;
}
.program-card-body {
  padding: 16px;
  display: flex;
  gap: 12px;
}
.program-meta {
  font-size: 12px;
  color: var(--text-dark);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.pmeta-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--accent);
}
.fi {
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
}
