/* ==========================================================================
   BUMIS – shared styles for the public website and the management portal
   ========================================================================== */
:root {
  --navy: #12325b; --navy-2: #0c2442; --navy-3: #1d4a80;
  --gold: #c9a227; --gold-2: #e5c55a;
  --ink: #1b2430; --ink-2: #4a5566; --muted: #778396;
  --bg: #f4f6fa; --surface: #fff; --line: #e1e6ee;
  --ok: #1f7a4d; --ok-bg: #e5f4ec; --warn: #8a5a00; --warn-bg: #fff3d6;
  --bad: #a42828; --bad-bg: #fde8e8; --info: #1b5d91; --info-bg: #e3f0fb;
  --radius: 10px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.55; }
a { color: var(--navy-3); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3, h4 { line-height: 1.25; color: var(--navy); margin: 0 0 .6em; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 1rem; } .mb { margin-bottom: 1rem; }
.flex { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.25rem 0; }

/* Buttons ---------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .55rem 1rem; border-radius: 8px; border: 1px solid transparent;
  background: var(--navy); color: #fff; font-weight: 600; font-size: .92rem; cursor: pointer; text-decoration: none; line-height: 1.2; font-family: inherit; }
.btn:hover { background: var(--navy-3); text-decoration: none; }
.btn-gold { background: var(--gold); color: var(--navy-2); } .btn-gold:hover { background: var(--gold-2); }
.btn-outline { background: transparent; color: var(--navy); border-color: var(--navy); } .btn-outline:hover { background: var(--navy); color: #fff; }
.btn-light { background: #fff; color: var(--navy); border-color: var(--line); } .btn-light:hover { background: #eef2f8; }
.btn-danger { background: var(--bad); } .btn-danger:hover { background: #7f1d1d; }
.btn-ok { background: var(--ok); } .btn-ok:hover { background: #145c39; }
.btn-sm { padding: .3rem .65rem; font-size: .82rem; }
.btn-lg { padding: .8rem 1.4rem; font-size: 1.05rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Forms ------------------------------------------------------------------ */
label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: .3rem; color: var(--ink-2); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=tel],
input[type=search], input[type=url], input[type=datetime-local], input[type=file], select, textarea {
  width: 100%; padding: .55rem .7rem; border: 1px solid #cfd6e1; border-radius: 8px; font: inherit; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(29,74,128,.25); border-color: var(--navy-3); }
textarea { min-height: 90px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; }
.form-grid .full { grid-column: 1 / -1; }
.field { margin-bottom: 1rem; }
.hint { font-size: .8rem; color: var(--muted); margin-top: .25rem; }
.check { display: flex; gap: .5rem; align-items: center; font-weight: 500; }
.check input { width: auto; }
.req::after { content: " *"; color: var(--bad); }
.inline-form { display: inline; }
.filters { display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end; margin-bottom: 1rem; }
.filters > div { min-width: 150px; }
.filters input, .filters select { padding: .45rem .6rem; }

/* Alerts & badges -------------------------------------------------------- */
.alert { padding: .8rem 1rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid transparent; }
.alert-success { background: var(--ok-bg); color: var(--ok); border-color: #bfe3cf; }
.alert-warning { background: var(--warn-bg); color: var(--warn); border-color: #f1dc9f; }
.alert-danger, .alert-error { background: var(--bad-bg); color: var(--bad); border-color: #f5c2c2; }
.alert-info { background: var(--info-bg); color: var(--info); border-color: #bcd9f1; }
.badge { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .76rem; font-weight: 700; white-space: nowrap; }
.badge-success { background: var(--ok-bg); color: var(--ok); }
.badge-warning { background: var(--warn-bg); color: var(--warn); }
.badge-danger { background: var(--bad-bg); color: var(--bad); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-neutral { background: #eceff4; color: var(--ink-2); }

/* Cards, tables ---------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); margin-bottom: 1.25rem; }
.card h2, .card h3 { margin-top: 0; }
.card-head { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: .6rem .7rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #f7f9fc; font-weight: 700; color: var(--ink-2); font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
tr:hover td { background: #fafcff; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.kv { display: grid; grid-template-columns: 180px 1fr; gap: .35rem 1rem; }
.kv dt { color: var(--muted); font-size: .88rem; }
.kv dd { margin: 0; font-weight: 600; }
@media (max-width: 560px) { .kv { grid-template-columns: 1fr; } .kv dd { margin-bottom: .5rem; } }

/* Stat tiles ------------------------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); }
.stat .label { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.stat .value { font-size: 1.6rem; font-weight: 800; color: var(--navy); margin-top: .2rem; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: .8rem; color: var(--ink-2); }
.stat.accent { border-top: 4px solid var(--gold); }
.stat-xl .value { font-size: 2.3rem; }

/* Charts ----------------------------------------------------------------- */
.bars { display: flex; flex-direction: column; gap: .45rem; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; gap: .6rem; align-items: center; font-size: .85rem; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.bar-track { background: #eef1f6; border-radius: 4px; height: 14px; }
.bar-fill { background: var(--navy-3); height: 100%; border-radius: 0 4px 4px 0; }
.bar-row:hover .bar-fill { background: var(--navy); }
.bar-val { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 60px; text-align: right; }
.colchart { width: 100%; height: auto; }
.colchart .col { fill: var(--navy-3); } .colchart g:hover .col { fill: var(--navy); }
.colchart .axis { stroke: #c7cfdb; stroke-width: 1; }
.colchart .lbl { font-size: 11px; fill: var(--muted); }
.alerts-list { list-style: none; padding: 0; margin: 0; }
.alerts-list li { padding: .6rem .8rem; border-radius: 8px; margin-bottom: .5rem; display: flex; gap: .6rem; align-items: flex-start; }
.alerts-list li.bad { background: var(--bad-bg); color: var(--bad); }
.alerts-list li.warn { background: var(--warn-bg); color: var(--warn); }
.alerts-list li.good { background: var(--ok-bg); color: var(--ok); }
.alerts-list .ic { font-weight: 800; }

/* Steps / timeline ------------------------------------------------------- */
.steps { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1.25rem; padding: 0; list-style: none; }
.steps li { flex: 1 1 120px; padding: .55rem .7rem; background: #eaeef5; border-radius: 8px; font-size: .82rem; font-weight: 600; color: var(--ink-2); }
.steps li.done { background: var(--ok-bg); color: var(--ok); }
.steps li.current { background: var(--navy); color: #fff; }
.steps li a { color: inherit; }
.timeline { list-style: none; padding: 0; margin: 0; border-left: 3px solid var(--line); }
.timeline li { padding: 0 0 1rem 1rem; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -8px; top: 4px; width: 13px; height: 13px; border-radius: 50%; background: var(--gold); }

/* ========================================================================
   PUBLIC WEBSITE
   ======================================================================== */
.topbar { background: var(--navy-2); color: #cfd9e8; font-size: .82rem; }
.topbar .wrap { display: flex; gap: 1.25rem; padding: .4rem 1rem; flex-wrap: wrap; }
.topbar a { color: #fff; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 1rem; }
.site-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.site-header .wrap { display: flex; align-items: center; gap: 1rem; min-height: 74px; }
.brand { display: flex; align-items: center; gap: .7rem; color: var(--navy); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-name { font-family: Georgia, "Times New Roman", serif; font-weight: 700; font-size: 1.2rem; line-height: 1.1; }
.brand-tag { font-size: .72rem; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.nav { display: flex; gap: .15rem; margin-left: auto; align-items: center; flex-wrap: wrap; }
.nav a { color: var(--ink); padding: .5rem .7rem; border-radius: 6px; font-weight: 600; font-size: .92rem; }
.nav a:hover, .nav a.active { background: #eef2f8; color: var(--navy); text-decoration: none; }
.nav .btn { margin-left: .3rem; color: #fff; } .nav .btn-gold { color: var(--navy-2); }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line); border-radius: 8px; padding: .45rem .7rem; font-size: 1.1rem; cursor: pointer; }
@media (max-width: 980px) {
  .nav-toggle { display: block; }
  .nav { display: none; position: absolute; top: 74px; left: 0; right: 0; background: #fff; flex-direction: column; align-items: stretch; padding: .75rem 1rem; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .nav.open { display: flex; }
  .nav .btn { margin: .25rem 0; justify-content: center; }
}
.hero { background: linear-gradient(120deg, rgba(12,36,66,.96), rgba(29,74,128,.9)), repeating-linear-gradient(45deg, #12325b 0 12px, #153a68 12px 24px); color: #fff; padding: 5rem 0 4.5rem; }
.hero h1 { color: #fff; font-size: clamp(1.9rem, 4.5vw, 3.1rem); font-family: Georgia, serif; letter-spacing: .01em; max-width: 780px; }
.hero .tagline { font-size: 1.25rem; color: var(--gold-2); font-weight: 700; letter-spacing: .06em; margin-bottom: 1.8rem; }
.hero p.lead { max-width: 640px; color: #d8e2f0; font-size: 1.05rem; }
.hero .flex { margin-top: 1.5rem; }
.hero .btn-outline { color: #fff; border-color: #fff; } .hero .btn-outline:hover { background: #fff; color: var(--navy); }
.quick { margin-top: -2.2rem; position: relative; }
.quick .grid { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.quick .card { border-top: 4px solid var(--gold); }
.section { padding: 3.2rem 0; }
.section.alt { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-title { text-align: center; margin-bottom: 2rem; }
.section-title h2 { font-size: 1.8rem; font-family: Georgia, serif; }
.section-title p { color: var(--muted); max-width: 640px; margin: 0 auto; }
.prog-card { display: flex; flex-direction: column; height: 100%; }
.prog-card .school { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--gold); font-weight: 700; }
.prog-card h3 { margin: .3rem 0 .6rem; }
.prog-card .meta { font-size: .86rem; color: var(--ink-2); margin-bottom: .8rem; }
.prog-card .meta div { margin-bottom: .15rem; }
.prog-card .actions { margin-top: auto; display: flex; gap: .5rem; }
.page-head { background: var(--navy); color: #fff; padding: 2.4rem 0; }
.page-head h1 { color: #fff; margin: 0; font-family: Georgia, serif; }
.page-head p { color: #cfd9e8; margin: .4rem 0 0; }
.doclist { list-style: none; padding: 0; margin: 0; }
.doclist li { padding: .55rem 0; border-bottom: 1px dashed var(--line); display: flex; gap: .6rem; align-items: flex-start; }
.doclist li:last-child { border-bottom: 0; }
.doclist .tag { flex-shrink: 0; }
.news-card .date { font-size: .8rem; color: var(--gold); font-weight: 700; text-transform: uppercase; }
.site-footer { background: var(--navy-2); color: #b9c6d8; padding: 2.8rem 0 1.2rem; margin-top: 2rem; font-size: .9rem; }
.site-footer h4 { color: #fff; }
.site-footer a { color: #e6edf7; }
.site-footer .grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.site-footer .copy { border-top: 1px solid rgba(255,255,255,.12); margin-top: 2rem; padding-top: 1rem; font-size: .8rem; }
.cta { background: linear-gradient(120deg, var(--gold), var(--gold-2)); border-radius: 14px; padding: 2rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.cta h2 { margin: 0; color: var(--navy-2); }
.value-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .8rem; }
.value-list div { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--gold); padding: .8rem 1rem; border-radius: 8px; font-weight: 600; }

/* Auth pages ------------------------------------------------------------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; background: linear-gradient(135deg, var(--navy-2), var(--navy-3)); }
.auth-card { width: 100%; max-width: 420px; background: #fff; border-radius: 14px; padding: 2rem; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.auth-card .brand { justify-content: center; margin-bottom: 1.2rem; }
.auth-card h1 { font-size: 1.3rem; text-align: center; }

/* ========================================================================
   PORTAL
   ======================================================================== */
.portal { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar { background: var(--navy-2); color: #c5d1e3; padding: 1rem 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .brand { color: #fff; padding: 0 1rem 1rem; border-bottom: 1px solid rgba(255,255,255,.1); margin-bottom: .5rem; }
.sidebar .brand-name { font-size: 1rem; color: #fff; }
.sidebar .brand-tag { color: var(--gold-2); }
.side-group { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: #7f93b0; padding: .9rem 1.1rem .3rem; font-weight: 700; }
.side-link { display: block; padding: .45rem 1.1rem; color: #d6e0ee; font-size: .9rem; border-left: 3px solid transparent; }
.side-link:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.side-link.active { background: rgba(201,162,39,.14); border-left-color: var(--gold); color: #fff; font-weight: 600; }
.main { min-width: 0; }
.topnav { background: #fff; border-bottom: 1px solid var(--line); padding: .6rem 1.25rem; display: flex; gap: 1rem; align-items: center; position: sticky; top: 0; z-index: 20; }
.topnav .title { font-weight: 700; color: var(--navy); font-size: 1.05rem; }
.topnav .user { display: flex; align-items: center; gap: .6rem; font-size: .88rem; }
.topnav .role { font-size: .75rem; color: var(--muted); }
.bell { position: relative; font-size: 1.1rem; padding: .3rem .5rem; border-radius: 6px; }
.bell .count { position: absolute; top: -4px; right: -6px; background: var(--bad); color: #fff; font-size: .68rem; border-radius: 999px; padding: 0 .35rem; font-weight: 700; }
.content { padding: 1.5rem 1.25rem 3rem; max-width: 1400px; }
.menu-btn { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; padding: .35rem .6rem; font-size: 1.1rem; cursor: pointer; }
@media (max-width: 900px) {
  .portal { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -270px; width: 260px; z-index: 60; transition: left .2s; }
  .sidebar.open { left: 0; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .menu-btn { display: inline-block; }
  .topnav .role, .topnav .uname { display: none; }
}
.profile-head { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; }
.avatar { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; background: #dfe6f0; display: grid; place-items: center; font-size: 1.8rem; font-weight: 800; color: var(--navy); border: 3px solid #fff; box-shadow: var(--shadow); }
.avatar-sm { width: 36px; height: 36px; font-size: .9rem; border-width: 2px; }
.quick-buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .75rem; }
.quick-buttons a { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 1rem; text-align: center; font-weight: 700; color: var(--navy); box-shadow: var(--shadow); }
.quick-buttons a:hover { border-color: var(--gold); text-decoration: none; background: #fffcf2; }
.quick-buttons .ico { display: block; font-size: 1.5rem; margin-bottom: .2rem; }
.clear-box { padding: 1.5rem; border-radius: 12px; text-align: center; }
.clear-box.ok { background: var(--ok-bg); color: var(--ok); border: 2px solid #9fd5b7; }
.clear-box.no { background: var(--bad-bg); color: var(--bad); border: 2px solid #f0b4b4; }
.clear-box h2 { color: inherit; }
.perm-matrix th, .perm-matrix td { text-align: center; padding: .35rem; font-size: .78rem; }
.perm-matrix td:first-child, .perm-matrix th:first-child { text-align: left; position: sticky; left: 0; background: #fff; }
.scan-box { border: 2px dashed var(--line); border-radius: 12px; padding: 1rem; text-align: center; }
.scan-box video { width: 100%; max-width: 380px; border-radius: 8px; }
.tabs { display: flex; gap: .3rem; border-bottom: 2px solid var(--line); margin-bottom: 1rem; flex-wrap: wrap; }
.tabs a { padding: .55rem .9rem; font-weight: 600; color: var(--ink-2); border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tabs a.active { color: var(--navy); border-bottom-color: var(--gold); }
.tabs a:hover { text-decoration: none; color: var(--navy); }
.pagination { display: flex; gap: .3rem; margin-top: 1rem; flex-wrap: wrap; }
.pagination a, .pagination span { padding: .3rem .65rem; border: 1px solid var(--line); border-radius: 6px; background: #fff; font-size: .85rem; }
.pagination .cur { background: var(--navy); color: #fff; border-color: var(--navy); }
.empty { text-align: center; padding: 2rem 1rem; color: var(--muted); }

/* Expandable rows */
.expand-col { width: 40px; }
.expand-btn { width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--line); background: #fff; color: var(--navy); font-weight: 800; font-size: 1.05rem; line-height: 1; cursor: pointer; }
.expand-btn:hover { border-color: var(--gold); background: #fffcf2; }
tr.detail-row > td { background: #f9fbfe; border-bottom: 2px solid var(--line); }
tr.detail-row:hover > td { background: #f9fbfe; }
.fee-breakdown { display: flex; flex-wrap: wrap; gap: 1rem 2rem; }
.fee-breakdown > div { flex: 0 1 320px; min-width: 240px; }
tr.detail-row .flex { max-width: 700px; flex-wrap: nowrap; }
.fee-breakdown h4 { margin: 0 0 .4rem; color: var(--navy); }
.fee-breakdown table td, .fee-breakdown table th { padding: .35rem .5rem; }
.fee-chip { display: inline-block; white-space: nowrap; margin: 0 .35rem .2rem 0; font-size: .85rem; }
