/* IICA Institute Portal (new online system) */
:root{
  --brand:#173f8a; --brand-deep:#0f2f6b; --accent:#1f5fd1; --accent-soft:#eaf1fd;
  --red:#d7262e; --amber:#f59e0b; --amber-soft:#fef3c7; --amber-ink:#92400e;
  --green:#067647; --green-soft:#ecfdf3; --bad:#b42318; --bad-soft:#fef3f2;
  --ink:#0f172a; --body:#334155; --muted:#64748b; --line:#e3e9f3; --bg:#eef2f8; --card:#fff;
  --radius:14px; --side:256px;
}
*{box-sizing:border-box;margin:0;padding:0}
body{font-family:"Inter Tight",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;background:var(--bg);color:var(--ink);-webkit-font-smoothing:antialiased;font-size:15px}
a{color:inherit;text-decoration:none}
svg.i{width:20px;height:20px;flex:none;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
[hidden]{display:none!important}

/* sidebar */
.side{position:fixed;inset:0 auto 0 0;width:var(--side);background:linear-gradient(180deg,var(--brand) 0%,var(--brand-deep) 100%);color:#dbe6fb;display:flex;flex-direction:column;z-index:30;transition:transform .2s}
.side .logo{display:flex;align-items:center;gap:12px;padding:22px 22px 20px;border-bottom:1px solid rgba(255,255,255,.1)}
.side .logo img{height:38px;width:38px;object-fit:contain;background:#fff;border-radius:10px;padding:3px}
.side .logo b{display:block;color:#fff;font-size:20px;font-weight:800}
.side .logo small{font-size:11.5px;color:rgba(219,230,251,.7)}
.side nav{flex:1;overflow-y:auto;padding:14px 12px}
.side .sec{font-size:11px;font-weight:700;letter-spacing:.12em;text-transform:uppercase;color:rgba(219,230,251,.5);padding:14px 12px 8px}
.side nav a{display:flex;align-items:center;gap:12px;padding:10px 12px;border-radius:10px;font-size:15px;font-weight:500;color:#dbe6fb;transition:background .15s}
.side nav a:hover{background:rgba(255,255,255,.08);color:#fff}
.side nav a.on{background:#fff;color:var(--brand);font-weight:600}
.side .out{padding:16px 12px 20px;border-top:1px solid rgba(255,255,255,.1)}
.side .out button{width:100%;display:flex;align-items:center;justify-content:center;gap:10px;padding:11px;border:1px solid rgba(255,255,255,.25);border-radius:10px;background:transparent;color:#fff;font:inherit;font-weight:600;cursor:pointer}
.side .out button:hover{background:rgba(255,255,255,.1)}
.scrim{display:none}

/* top bar */
.main{margin-left:var(--side);min-height:100vh;display:flex;flex-direction:column}
.top{position:sticky;top:0;z-index:20;height:68px;display:flex;align-items:center;gap:14px;padding:0 32px;background:rgba(238,242,248,.9);backdrop-filter:blur(10px);border-bottom:1px solid var(--line)}
.top h1{font-size:20px;font-weight:700;flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.menu-btn{display:none;width:40px;height:40px;border:1px solid var(--line);border-radius:10px;background:#fff;cursor:pointer;place-items:center;color:var(--ink)}
.vpill{display:inline-flex;align-items:center;gap:7px;padding:7px 12px;border-radius:999px;background:var(--amber-soft);color:var(--amber-ink);font-weight:700;font-size:13.5px;border:1px solid #f5d37d;white-space:nowrap}
.vpill svg{width:16px;height:16px}
.me{display:flex;align-items:center;gap:10px;padding:4px 14px 4px 4px;border:1px solid var(--line);border-radius:999px;background:#fff;min-width:0}
.av{width:34px;height:34px;border-radius:50%;background:var(--accent);color:#fff;display:grid;place-items:center;font-weight:700;font-size:13px;flex:none}
.me span{display:flex;flex-direction:column;min-width:0}
.me b{font-size:13.5px;max-width:200px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.me small{font-size:11.5px;color:var(--muted)}

/* content */
.wrap{padding:28px 32px 40px;max-width:1280px;width:100%}
.ptitle{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-bottom:20px}
.ptitle h2{font-size:26px;font-weight:800;letter-spacing:-.02em}
.ptitle p{color:var(--muted);margin-top:4px}
.crumbs{font-size:14px;color:var(--muted);margin-bottom:10px}
.crumbs a:hover{color:var(--accent)}
.card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:22px;box-shadow:0 1px 2px rgba(15,23,42,.04),0 12px 28px -18px rgba(23,63,138,.28)}
.card h3{font-size:17px;font-weight:700;margin-bottom:14px;display:flex;align-items:center;gap:10px}
.grid{display:grid;gap:20px}
.g2{grid-template-columns:1fr 1fr}.g3{grid-template-columns:repeat(3,1fr)}.g4{grid-template-columns:repeat(4,1fr)}
.mt{margin-top:22px}
.muted{color:var(--muted)}
.hero{border-radius:18px;color:#fff;padding:28px 32px;background:repeating-linear-gradient(180deg,transparent 0 38px,rgba(255,255,255,.07) 38px 39px),linear-gradient(135deg,var(--brand) 0%,var(--accent) 100%);display:flex;align-items:center;justify-content:space-between;gap:20px;flex-wrap:wrap}
.hero small{font-size:13px;font-weight:600;letter-spacing:.1em;text-transform:uppercase;color:rgba(255,255,255,.75)}
.hero h2{font-size:clamp(22px,3vw,30px);font-weight:800;margin-top:4px;line-height:1.2}
.hero .btn{background:#fff;color:var(--brand);box-shadow:none}

/* stat tiles */
.stat{position:relative;overflow:hidden;border-radius:var(--radius);padding:20px;color:#fff;display:flex;gap:14px;align-items:flex-start}
.stat::after{content:"";position:absolute;right:-40px;top:-40px;width:140px;height:140px;border-radius:50%;background:rgba(255,255,255,.12)}
.stat .ic{width:44px;height:44px;border-radius:12px;display:grid;place-items:center;background:rgba(255,255,255,.2);flex:none}
.stat .lbl{font-size:13.5px;color:rgba(255,255,255,.85)}
.stat .val{font-size:30px;font-weight:800;letter-spacing:-.02em}
.stat .lbl,.stat .val{position:relative;z-index:1}
.s-blue{background:linear-gradient(135deg,#1e4fb8,#3b7bf6)}.s-green{background:linear-gradient(135deg,#0b7a6e,#16b39a)}
.s-amber{background:linear-gradient(135deg,#e07b0a,#f6b13c)}.s-violet{background:linear-gradient(135deg,#5b3fd1,#8b6cf6)}

/* bars */
.hbar{display:grid;grid-template-columns:120px 1fr 44px;gap:12px;align-items:center;padding:7px 0;font-size:14px}
.hbar .tr{height:10px;border-radius:99px;background:#eef2f8;overflow:hidden}
.hbar .tr i{display:block;height:100%;border-radius:99px;background:linear-gradient(90deg,#1e4fb8,#3b7bf6)}
.hbar b{text-align:right}

/* tables */
.tbl{width:100%;border-collapse:collapse;font-size:14.5px}
.tbl th{text-align:left;font-size:12px;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);font-weight:700;padding:10px 12px;border-bottom:1px solid var(--line);white-space:nowrap}
.tbl td{padding:12px;border-bottom:1px solid #eef2f7;vertical-align:middle}
.tbl tr:last-child td{border-bottom:0}
.tbl tr.link:hover td{background:#f7f9fd;cursor:pointer}
.tbl .r{text-align:right}
.tscroll{overflow-x:auto}
.who{display:flex;align-items:center;gap:10px}
.who img,.who .av{width:38px;height:38px;border-radius:10px;object-fit:cover;flex:none}
.who b{display:block;font-weight:600}
.who small{color:var(--muted);font-size:12.5px}
.badge{display:inline-flex;align-items:center;padding:4px 10px;border-radius:999px;font-size:12.5px;font-weight:700;white-space:nowrap}
.b-ok{background:var(--green-soft);color:var(--green)}.b-bad{background:var(--bad-soft);color:var(--bad)}
.b-blue{background:var(--accent-soft);color:var(--accent)}.b-wait{background:var(--amber-soft);color:var(--amber-ink)}
.b-gray{background:#f1f4f9;color:var(--muted)}.b-teal{background:#e6faf6;color:#0b7a6e}
.empty{padding:40px 10px;text-align:center;color:var(--muted)}

/* filters */
.filters{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:16px}
.filters .fi{width:auto;flex:1;min-width:200px}
.chips{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:16px}
.chips a{padding:7px 13px;border-radius:999px;background:#fff;border:1px solid var(--line);font-size:13.5px;font-weight:600;color:var(--body)}
.chips a.on{background:var(--brand);border-color:var(--brand);color:#fff}
.chips a span{opacity:.7;margin-left:4px}

/* forms */
.fl{display:block;font-size:14px;font-weight:600;margin-bottom:7px}
.fl em{font-style:normal;color:var(--bad)}
.fi{width:100%;height:46px;padding:0 14px;font:inherit;font-size:15px;color:var(--ink);background:#f6f8fc;border:1.5px solid var(--line);border-radius:10px;outline:none;transition:border-color .15s,box-shadow .15s}
.fi:focus{background:#fff;border-color:var(--accent);box-shadow:0 0 0 4px rgba(31,95,209,.13)}
.fi.bad{border-color:var(--bad);background:#fff8f7}
select.fi{appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 12px center;padding-right:40px}
.fgrid{display:grid;grid-template-columns:1fr 1fr;gap:18px 20px}
.fgrid .full{grid-column:1/-1}
.ferr{font-size:13px;color:var(--bad);font-weight:600;margin-top:6px}
.hint{font-size:12.5px;color:var(--muted);margin-top:6px}
.phone{display:grid;grid-template-columns:110px 1fr;gap:8px}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:44px;padding:0 18px;border-radius:10px;border:0;background:linear-gradient(135deg,#1e4fb8,#3b7bf6);color:#fff;font:inherit;font-weight:600;font-size:14.5px;cursor:pointer;white-space:nowrap;box-shadow:0 10px 20px -12px rgba(30,79,184,.7)}
.btn:hover{filter:brightness(1.07)}
.btn.ghost{background:#fff;color:var(--ink);border:1px solid var(--line);box-shadow:none}
.btn.sm{height:36px;padding:0 12px;font-size:13.5px}
.btn.wide{width:100%}
.btn[disabled]{opacity:.6;cursor:not-allowed}
.btns{display:flex;gap:8px;flex-wrap:wrap}
.flash{display:flex;align-items:center;gap:10px;padding:12px 16px;border-radius:12px;margin-bottom:18px;font-weight:600;font-size:14.5px;background:var(--green-soft);color:var(--green);border:1px solid #abefc6}
.flash.bad{background:var(--bad-soft);color:var(--bad);border-color:#fecdca}
.flash.warn{background:var(--amber-soft);color:var(--amber-ink);border-color:#f5d37d}
.kv{list-style:none;display:grid;grid-template-columns:1fr 1fr;gap:0 28px}
.kv li{padding:12px 0;border-bottom:1px dashed var(--line)}
.kv small{display:block;font-size:12px;color:var(--muted);font-weight:600;text-transform:uppercase;letter-spacing:.06em}
.kv p{font-weight:600;margin-top:3px;word-break:break-word}

/* photo */
.reg{display:grid;grid-template-columns:240px 1fr;padding:0;overflow:hidden}
.reg .left{padding:26px 20px;background:linear-gradient(180deg,#f3f7ff,#e8f0ff);border-right:1px solid var(--line);display:flex;flex-direction:column;align-items:center;text-align:center;gap:12px}
.reg .right{padding:26px 28px}
.ph{width:165px;height:220px;border-radius:14px;border:2px dashed #9fb8e6;background:#fff;display:grid;place-items:center;overflow:hidden;cursor:pointer}
.ph:hover{border-color:var(--accent)}
.ph img{width:100%;height:100%;object-fit:cover}
.ph.bad{border-color:var(--bad)}
.ph .em{display:flex;flex-direction:column;align-items:center;gap:6px;color:var(--muted);font-size:13px;padding:10px}
.sphoto{width:120px;height:160px;border-radius:12px;object-fit:cover;border:1px solid var(--line);background:#f3f6fc}

/* certificate */
.cert-prev{width:100%;border-radius:10px;border:1px solid var(--line);display:block;background:#f3f6fc;aspect-ratio:3/2}

/* dialog */
dialog{margin:auto;border:0;border-radius:16px;padding:0;width:min(440px,92vw);box-shadow:0 30px 60px -20px rgba(15,23,42,.4)}
dialog::backdrop{background:rgba(15,23,42,.45)}
dialog .dh{display:flex;justify-content:space-between;align-items:center;padding:16px 20px;border-bottom:1px solid var(--line);font-weight:700}
dialog .db{padding:20px}

/* login / password pages */
body.plain{min-height:100vh;display:grid;place-items:center;padding:24px 16px;background:repeating-linear-gradient(180deg,transparent 0 50px,rgba(255,255,255,.06) 50px 51px),linear-gradient(160deg,var(--brand) 0%,var(--brand-deep) 100%)}
.authwrap{width:min(440px,100%)}
.authbrand{display:flex;align-items:center;gap:12px;color:#fff;margin-bottom:18px}
.authbrand img{width:46px;height:46px;background:#fff;border-radius:12px;padding:4px}
.authbrand b{display:block;font-size:19px}
.authbrand small{font-size:12.5px;opacity:.75}
.auth{padding:28px}
.auth h1{font-size:24px;font-weight:800;margin-bottom:4px}
.auth .sub{color:var(--muted);margin-bottom:18px}
.auth label{margin-top:14px}
.auth .links{display:flex;justify-content:space-between;margin-top:16px;font-size:14px}
.auth .links a,.auth .links button{color:var(--accent);font-weight:600;background:none;border:0;font:inherit;cursor:pointer}

footer{margin-top:auto;border-top:1px solid var(--line);background:#fff}
footer .in{max-width:1280px;padding:20px 32px;display:flex;flex-wrap:wrap;gap:10px 40px;justify-content:space-between;font-size:13.5px;color:var(--muted)}
footer b{color:var(--ink)}

@media (max-width:1100px){.g4{grid-template-columns:repeat(2,1fr)}.g3{grid-template-columns:1fr 1fr}}
@media (max-width:900px){
  .side{transform:translateX(-100%)}
  body.nav-open .side{transform:none}
  body.nav-open .scrim{display:block;position:fixed;inset:0;background:rgba(15,23,42,.4);z-index:25}
  .main{margin-left:0}
  .menu-btn{display:grid}
  .top{padding:0 16px}
  .me span{display:none}.me{padding:4px}
  .wrap{padding:20px 16px 32px}
  .g2,.g3{grid-template-columns:1fr}
  .reg{grid-template-columns:1fr}.reg .left{border-right:0;border-bottom:1px solid var(--line)}.reg .right{padding:20px 16px}
  .fgrid{grid-template-columns:1fr}
  .kv{grid-template-columns:1fr}
  footer .in{padding:18px 16px}
}
@media (max-width:560px){.g4{grid-template-columns:1fr 1fr;gap:12px}.stat{flex-direction:column;padding:14px}.stat .val{font-size:24px}.top h1{font-size:17px}.hide-sm{display:none}}
.tbl td .btns{flex-wrap:nowrap}
.tbl td .badge{white-space:normal}
@media (max-width:1200px){.tbl td .btns{flex-wrap:wrap;justify-content:flex-end}}

/* student page: profile + result side by side */
.toprow{display:grid;grid-template-columns:1fr 1fr;gap:20px;align-items:stretch}
.prof h2{font-size:22px;font-weight:800;margin:0}
.prof .pid{font-size:14px;color:var(--accent);font-weight:700;letter-spacing:.03em;margin:2px 0 14px}
.prof .pbody{display:flex;gap:18px;align-items:flex-start}
.prof .pbody img,.prof .pbody .pav{width:100px;height:130px;border-radius:10px;object-fit:cover;border:1px solid var(--line);flex:none;background:#f3f6fc}
.prof .pbody .pav{display:grid;place-items:center;font-size:28px;font-weight:800;color:var(--brand)}
.prof .pinfo{min-width:0;flex:1;display:grid;gap:8px}
.prof .pinst{font-weight:700;font-size:15.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.prof .pdates{display:flex;gap:24px;flex-wrap:wrap}
.prof .pdates span,.prof .pline span{display:block;font-size:11px;color:var(--muted);text-transform:uppercase;letter-spacing:.05em;font-weight:600}
.prof .pdates b{font-size:14.5px;font-weight:600;white-space:nowrap}
.prof .pline{font-size:14.5px;font-weight:600;word-break:break-word}
.res2{display:flex;align-items:center;gap:24px}
.res2 img{width:170px;height:auto;flex:none}
.rsc{font-size:52px;font-weight:800;color:var(--brand);line-height:1}.rsc small{font-size:20px;color:var(--muted)}
.rlv{font-size:24px;font-weight:800;margin:8px 0 4px}
.rwait{display:grid;gap:6px;justify-items:start}
@media (max-width:1000px){.toprow{grid-template-columns:1fr}}
@media (max-width:560px){.res2{flex-direction:column;text-align:center}.res2 img{width:140px}.prof .pinst{white-space:normal}}

.btn.teal{background:linear-gradient(135deg,#0b7a6e,#16a394);box-shadow:0 10px 20px -12px rgba(11,122,110,.7)}
.btn.amber{background:linear-gradient(135deg,#d97706,#f59e0b);box-shadow:0 10px 20px -12px rgba(217,119,6,.7)}
