:root {
  --bg: #071021;
  --bg-soft: #0e1a33;
  --card: #101c36;
  --card-2: #142544;
  --text: #e7eefb;
  --muted: #9cb0d1;
  --line: #253b63;
  --primary: #4f8cff;
  --primary-2: #6da0ff;
  --ok: #27b87b;
  --warn: #ef9b28;
  --danger: #ff5d73;
  --chip: #1a2f56;
  --shadow: 0 20px 44px rgba(2, 8, 22, 0.45);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  background:
    radial-gradient(1200px 700px at 5% -10%, #1e3f7a 0%, transparent 45%),
    radial-gradient(1100px 650px at 95% -15%, #0f5a6e 0%, transparent 40%),
    linear-gradient(180deg, var(--bg) 0%, #050b18 100%);
  color: var(--text);
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  backdrop-filter: blur(10px);
  background: rgba(7, 16, 33, 0.8);
  border-bottom: 1px solid rgba(63, 97, 152, 0.3);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), #75a9ff);
  box-shadow: 0 6px 18px rgba(79, 140, 255, 0.5);
}
.topbar h1 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0.3px;
}
.topbar p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}
#app {
  max-width: 1380px;
  margin: 16px auto;
  padding: 0 16px 36px;
}
.portal-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 14px;
}
.sidebar {
  background: linear-gradient(180deg, rgba(20, 37, 68, 0.95), rgba(13, 25, 47, 0.95));
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 12px;
  height: fit-content;
  position: sticky;
  top: 84px;
}
.side-title {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin: 2px 8px 10px;
}
.menu {
  display: grid;
  gap: 6px;
}
.menu button {
  text-align: left;
  border: 1px solid transparent;
  color: #dce8ff;
  background: transparent;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
}
.menu button:hover { background: rgba(66, 99, 154, 0.2); }
.menu button.active {
  background: rgba(79, 140, 255, 0.2);
  border-color: rgba(109, 160, 255, 0.5);
}
.workspace {
  display: grid;
  gap: 12px;
}
.grid { display: grid; gap: 12px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.card {
  background: linear-gradient(180deg, rgba(18, 33, 61, 0.95), rgba(14, 27, 49, 0.95));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--shadow);
}
.card h2, .card h3 { margin: 0 0 10px; }
.card h3 { font-size: 16px; }
.muted { color: var(--muted); }
.kpi {
  border: 1px solid rgba(84, 119, 178, 0.45);
  border-radius: 12px;
  padding: 12px;
  background: rgba(19, 37, 67, 0.65);
}
.kpi span { color: var(--muted); font-size: 12px; }
.kpi b { display: block; margin-top: 6px; font-size: 22px; }
.row { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
label { display: grid; gap: 6px; font-size: 12px; color: var(--muted); }
input, select, textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #2e4672;
  background: #0d1831;
  color: var(--text);
  padding: 10px;
}
textarea { min-height: 85px; resize: vertical; }
button {
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(180deg, var(--primary), var(--primary-2));
}
button:hover { filter: brightness(1.05); }
button.ghost {
  color: #dce8ff;
  background: #1b2d50;
  border: 1px solid #304b79;
}
button.ok { background: linear-gradient(180deg, #1ea96f, #2dc588); }
button.warn { background: linear-gradient(180deg, #f0a336, #da8620); }
button.danger { background: linear-gradient(180deg, #ff6d81, #de4e63); }
button.flat {
  background: transparent;
  border: 1px solid #2c4672;
  color: #d8e6ff;
}
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid #2b446e;
  border-radius: 12px;
}
table { width: 100%; border-collapse: collapse; min-width: 860px; }
th, td {
  border-bottom: 1px solid #22385d;
  text-align: left;
  padding: 9px;
  font-size: 13px;
  vertical-align: top;
}
th { color: #a9bde1; font-weight: 600; background: rgba(19, 35, 63, 0.8); }
.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  background: var(--chip);
  color: #bfd6ff;
  border: 1px solid #355688;
}
.pill.ok { background: rgba(24, 110, 73, 0.4); border-color: #2d8f63; color: #9ce7c7; }
.pill.warn { background: rgba(134, 84, 18, 0.4); border-color: #b67b2f; color: #f9d49f; }
.pill.danger { background: rgba(120, 33, 49, 0.4); border-color: #be566b; color: #ffc0cb; }
.login-wrap {
  max-width: 440px;
  margin: 40px auto;
}
.login-brand {
  text-align: center;
  margin-bottom: 14px;
}
.login-brand h2 { margin: 8px 0 4px; }
.hidden { display: none !important; }
.footnote {
  max-width: 1380px;
  margin: 0 auto 24px;
  padding: 0 16px;
  color: #8aa0c8;
  font-size: 12px;
}
.institution-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.institution-card {
  border: 1px solid #2f4b79;
  border-radius: 12px;
  padding: 10px;
  background: rgba(16, 32, 59, 0.7);
}
.badge {
  display: inline-block;
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 10px;
  background: #223a62;
  color: #b8cff8;
  border: 1px solid #35578b;
}
.note {
  border-left: 4px solid #4f8cff;
  background: rgba(34, 57, 94, 0.5);
  padding: 10px;
  border-radius: 10px;
  color: #dbe9ff;
  font-size: 13px;
}
@media (max-width: 1060px) {
  .portal-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
}