/* Inion VR portal theme: shared by Login, Dashboard, Devices and later pages */
:root {
  --inion-blue: #1da1f2;
  --inion-blue-dark: #1288d4;
  --inion-blue-soft: #dbeafe;
  --inion-bg: #eef7fe;
  --inion-text: #0f172a;
  --inion-muted: #64748b;
  --inion-card: #ffffff;
  --inion-border: #e2e8f0;
  --inion-green: #16a34a;
  --inion-green-soft: #dcfce7;
  --inion-red: #dc2626;
  --inion-red-soft: #fee2e2;
  --inion-purple: #9333ea;
  --inion-purple-soft: #f3e8ff;
  --inion-radius: 16px;
  --inion-shadow: 0 6px 20px rgba(15, 23, 42, .08);
  --inion-font: "Poppins", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

body.inion {
  font-family: var(--inion-font);
  color: var(--inion-text);
  margin: 0;
  min-height: 100vh;
  background-color: var(--inion-bg);
  background-image: linear-gradient(160deg, #e6f3fd 0%, #f7fbff 60%);
  background-attachment: fixed;
}

/* ---------- Login ---------- */
.login-page { display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-shell {
  width: min(1040px, 100%);
  background: rgba(255, 255, 255, .55);
  border-radius: 32px;
  box-shadow: var(--inion-shadow);
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  align-items: center;
  gap: 32px;
  padding: 56px 48px;
  position: relative;
  overflow: hidden;
}
.login-divider { width: 1px; align-self: stretch; background: #1e293b; opacity: .6; }
.login-brand { text-align: center; }
.login-brand img { width: 128px; height: 128px; }
.login-brand h1 { font-size: 1.6rem; font-weight: 700; margin: 12px 0 0; }
.login-brand .brand-name { font-size: 3rem; font-weight: 700; line-height: 1.1; color: var(--inion-blue); }
.login-brand .brand-name span { color: #0b1220; }
.login-brand p { color: var(--inion-muted); margin: 8px 0 0; }
.login-brand p b { color: var(--inion-blue); font-weight: 500; }

.login-card {
  background: #fff;
  border-radius: 24px;
  box-shadow: var(--inion-shadow);
  padding: 28px;
  max-width: 420px;
  width: 100%;
  justify-self: center;
}
.field { margin-bottom: 16px; }
.field-box {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1px solid var(--inion-border); border-radius: 12px;
  box-shadow: 0 4px 10px rgba(15, 23, 42, .08);
  padding: 0 14px; height: 52px;
}
.field-box:focus-within { border-color: var(--inion-blue); box-shadow: 0 0 0 3px rgba(29, 161, 242, .25); }
.field-box svg { flex: none; color: var(--inion-text); }
.field-box input { border: 0; outline: 0; width: 100%; font: inherit; font-size: 1.05rem; background: transparent; }
.field-box input::placeholder { color: #94a3b8; }
.field.invalid .field-box { border-color: var(--inion-red); }
.field-error { color: var(--inion-red); font-size: .85rem; margin: 4px 4px 0; min-height: 0; }
.form-error {
  background: var(--inion-red-soft); color: #991b1b; border-radius: 10px;
  padding: 10px 14px; margin-bottom: 12px; font-size: .9rem;
}
.link-right { text-align: right; margin: -4px 0 12px; }
.link-right a, .login-foot a { color: var(--inion-blue); text-decoration: none; }
.link-right a:hover, .login-foot a:hover { text-decoration: underline; }

.btn-inion {
  display: block; width: 100%; border: 0; cursor: pointer;
  background: var(--inion-blue); color: #fff; font: inherit; font-weight: 600; font-size: 1.1rem;
  height: 48px; border-radius: 10px; box-shadow: 0 6px 14px rgba(29, 161, 242, .35);
}
.btn-inion:hover { background: var(--inion-blue-dark); }
.btn-inion:disabled { opacity: .7; cursor: progress; }
.btn-inion .spinner { display: none; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.5); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -3px; margin-right: 8px; }
.btn-inion.loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.login-foot { text-align: center; margin-top: 14px; }

@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; padding: 32px 20px; gap: 24px; }
  .login-divider { display: none; }
  .login-brand img { width: 96px; height: 96px; }
  .login-brand .brand-name { font-size: 2.2rem; }
}

/* ---------- Institute shell: sidebar + header ---------- */
.shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
/* Dark menu in the colour of the doctor photo (#0a1b29), so the photo blends in with no edge */
.sidebar {
  background: #0a1b29; border-right: 1px solid #0a1b29;
  box-shadow: 4px 0 18px rgba(2, 12, 24, .25);
  display: flex; flex-direction: column; padding: 16px 14px 20px;
  position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.6rem; padding: 0 4px 24px; text-decoration: none; color: #fff; }
.sidebar .brand img { width: 48px; height: 48px; }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.nav-list a {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 12px;
  color: #cbd5e1; text-decoration: none; font-size: 1.05rem;
}
.nav-list a:hover { background: rgba(255, 255, 255, .07); }
/* Active item: holographic cyan glow */
.nav-list a.active {
  background: linear-gradient(90deg, rgba(34, 211, 238, .22), rgba(34, 211, 238, .08)); color: #67e8f9;
  box-shadow: inset 0 0 0 1px rgba(103, 232, 249, .45), 0 0 18px rgba(34, 211, 238, .25);
}
.nav-list a.disabled { color: #475569; pointer-events: none; }
.nav-list svg { flex: none; }
/* Menu background layer: doctor photo at the bottom, its own top edge faded to transparent (no visible line),
   plus the moving dot wave (side-wave.js). Menu items sit above it. */
.side-fx { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.side-photo {
  position: absolute; left: 0; bottom: 0; width: 100%; height: auto;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, rgba(0,0,0,.35) 25%, #000 55%);
  mask-image: linear-gradient(to bottom, transparent 0, rgba(0,0,0,.35) 25%, #000 55%);
}
.side-wave { position: absolute; left: 0; bottom: 0; width: 100%; height: 38%; mix-blend-mode: screen; }
.sidebar .brand, .sidebar nav { position: relative; z-index: 1; }
@media (max-height: 640px) { .side-photo { display: none; } }

/* Collapsible sidebar (wide screens): round button on the edge; collapsed = icons only */
.shell { transition: grid-template-columns .22s ease; }
.side-toggle {
  position: absolute; top: 28px; right: -14px; z-index: 5; width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid #1e3a5f; background: #0f2a40; color: #cbd5e1; display: grid; place-items: center;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .12); cursor: pointer; padding: 0; transition: color .15s ease, transform .22s ease;
}
.side-toggle:hover { color: #67e8f9; border-color: #22d3ee; }
.side-toggle:focus-visible { outline: 2px solid var(--inion-blue); outline-offset: 2px; }
.sidebar .nav-label { white-space: nowrap; }
@media (min-width: 901px) {
  .side-collapsed .shell { grid-template-columns: 84px 1fr; }
  .side-collapsed .side-toggle { transform: rotate(180deg); }
  .side-collapsed .sidebar { padding-left: 12px; padding-right: 12px; }
  .side-collapsed .sidebar .nav-label, .side-collapsed .side-photo { display: none; }
  .side-collapsed .sidebar .brand { justify-content: center; padding: 0 0 24px; gap: 0; }
  .side-collapsed .sidebar .brand img { width: 44px; height: 44px; }
  .side-collapsed .nav-list a { justify-content: center; padding: 14px 0; gap: 0; }
}
@media (max-width: 900px) { .side-toggle { display: none; } }

.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: #fff; border-bottom: 1px solid var(--inion-border);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 32px;
}
.topbar h1 { margin: 0; font-size: 1.6rem; font-weight: 700; }
.topbar .who { display: flex; align-items: center; gap: 12px; }
.content { padding: 24px 32px 48px; }

.menu-toggle { display: none; border: 0; background: transparent; padding: 6px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 40; width: 260px; left: -270px; transition: left .2s; }
  .sidebar.open { left: 0; }
  .menu-toggle { display: inline-block; }
  .topbar { padding: 14px 16px; }
  .content { padding: 16px; }
}

/* ---------- Toolbar ---------- */
.toolbar {
  background: #fff; border-radius: var(--inion-radius); box-shadow: var(--inion-shadow);
  padding: 20px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
}
.toolbar .search { flex: 1 1 260px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--inion-border); border-radius: 10px; padding: 0 12px; height: 44px; box-shadow: 0 3px 8px rgba(15,23,42,.08); }
.toolbar .search input { border: 0; outline: 0; width: 100%; font: inherit; }
.toolbar .select { display: flex; align-items: center; gap: 8px; border: 1px solid var(--inion-border); border-radius: 10px; padding: 0 10px; height: 44px; box-shadow: 0 3px 8px rgba(15,23,42,.08); background: #fff; }
.toolbar select { border: 0; outline: 0; background: transparent; font: inherit; color: var(--inion-muted); }

/* ---------- Summary cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; margin-top: 28px; }
.card-stat { background: #fff; border-radius: 14px; box-shadow: var(--inion-shadow); padding: 16px; }
.card-stat .top { display: flex; align-items: center; gap: 16px; }
.card-stat .icon { width: 84px; height: 72px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.card-stat .count { font-size: 2.6rem; font-weight: 700; line-height: 1; }
.card-stat .label { font-weight: 600; }
/* Button at the bottom of every card, so buttons line up whatever the text height */
.card-stat { display: flex; flex-direction: column; }
.card-stat .top { margin-bottom: 16px; }
.card-stat .product-name { font-size: 1.2rem; font-weight: 700; }
.card-stat .product-desc { color: var(--inion-muted); font-size: .88rem; line-height: 1.35; margin-top: 4px; }
.sim-counts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.sim-tile { display: flex; flex-direction: column; padding: 8px 14px; border-radius: 12px; background: #f3e8ff; color: #6b21a8; font-size: .8rem; font-weight: 500; }
.sim-tile.pa { background: #dbeafe; color: #1e40af; }
.sim-tile b { font-size: 1.6rem; line-height: 1.1; color: inherit; }
.feature-chips { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.feature-chips li { background: #f3e8ff; color: #6b21a8; border-radius: 999px; padding: 4px 10px; font-size: .8rem; font-weight: 500; }

/* Dashboard: welcome banner + three equal cards across the page */
.dash-hero {
  position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 26px 32px; margin-bottom: 20px; border-radius: 20px; color: #fff;
  background: linear-gradient(120deg, #1288d4, #1da1f2 45%, #7c3aed);
  background-size: 200% 200%; animation: heroShift 14s ease-in-out infinite alternate;
  box-shadow: 0 14px 34px rgba(29, 161, 242, .3);
}
.dash-hero::before { content: ""; position: absolute; inset: 0; background: url("/images/hex-pattern.svg"); opacity: .18; pointer-events: none; }
.dash-hero > * { position: relative; }
.hero-date { margin: 0; font-size: .9rem; opacity: .85; }
.dash-hero h2 { margin: 4px 0 2px; font-size: 1.8rem; font-weight: 700; }
.dash-hero p { margin: 0; opacity: .9; }
.hero-art { width: 170px; max-width: 30%; filter: drop-shadow(0 12px 20px rgba(15,23,42,.25)); animation: floatY 5s ease-in-out infinite; }
@keyframes heroShift { to { background-position: 100% 50%; } }
.content > .dash-hero { animation: riseIn .45s ease-out backwards, heroShift 14s ease-in-out infinite alternate; } /* keep the entrance and the colour drift */
.dash-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 20px; }
.dash-cards .card-stat { padding: 20px; border: 1px solid #e3eefb; }
@media (max-width: 1000px) { .dash-cards { grid-template-columns: 1fr; } .hero-art { display: none; } }
.card-stat .more {
  display: inline-flex; align-items: center; gap: 10px; margin-top: auto; align-self: flex-start; padding: 8px 14px;
  background: #fff; border-radius: 8px; box-shadow: 0 3px 8px rgba(15,23,42,.15);
  color: var(--inion-text); text-decoration: none; font-weight: 600;
}
.card-stat .more:hover { background: #f1f7fd; }
.icon-blue { background: #bfdbfe; color: #2563eb; }
.icon-green { background: var(--inion-green-soft); color: var(--inion-green); }
.icon-red { background: var(--inion-red-soft); color: var(--inion-red); }
.icon-purple { background: var(--inion-purple-soft); color: var(--inion-purple); }

/* ---------- Live indicator ---------- */
.live-note { margin: 20px 4px 0; color: var(--inion-muted); font-size: .9rem; }
.live-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--inion-green); margin-right: 4px; box-shadow: 0 0 0 0 rgba(22,163,74,.6); animation: pulse 2s infinite; }
.live-dot.off { background: #f59e0b; animation: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(22,163,74,0); } 100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); } }

/* ---------- Devices table ---------- */
.table-card { margin-top: 24px; background: #fff; border-radius: var(--inion-radius); box-shadow: var(--inion-shadow); overflow: hidden; }
.table-scroll { overflow-x: auto; }
.dev-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.dev-table th {
  background: #f1f2f4; text-align: left; padding: 16px 20px; font-size: .95rem; font-weight: 700;
  text-transform: none; color: var(--inion-text); white-space: nowrap;
}
.dev-table td { padding: 20px; border-top: 1px solid var(--inion-border); vertical-align: middle; }
.dev-table tbody tr:hover { background: #f8fbfe; }
.dev-table .col-action { text-align: right; white-space: nowrap; }
.dev-name { display: inline-flex; align-items: center; gap: 14px; font-weight: 500; }
.dev-table td.empty { text-align: center; color: var(--inion-muted); padding: 40px; }
.badge-status { display: inline-block; min-width: 96px; text-align: center; padding: 6px 14px; border-radius: 6px; border: 1.5px solid; font-weight: 500; background: #fff; }
.badge-status.online { color: var(--inion-green); border-color: #22c55e; }
.badge-status.offline { color: var(--inion-red); border-color: #ef4444; }
.actions { display: inline-flex; gap: 12px; align-items: center; }
.actions .js-cast { display: inline-flex; }
.btn-outline {
  display: inline-block; padding: 7px 14px; border-radius: 6px; border: 1.5px solid; background: #fff;
  font: inherit; font-size: .95rem; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn-outline.blue { color: #1d6fe0; border-color: #3b82f6; }
.btn-outline.purple { color: var(--inion-purple); border-color: #a855f7; }
.btn-outline:hover:not(:disabled) { background: #f5f9ff; }
.btn-outline:disabled { opacity: .45; cursor: not-allowed; filter: grayscale(.6); }

.table-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-top: 1px solid var(--inion-border); }
.foot-info { color: var(--inion-muted); }
.foot-info .sep { margin: 0 8px; }
.pager { display: flex; align-items: center; gap: 10px; }
.pg-btn, .pg-num {
  display: grid; place-items: center; min-width: 40px; height: 40px; padding: 0 8px; border-radius: 6px;
  text-decoration: none; color: var(--inion-text); font-size: 1.1rem;
}
.pg-btn { border: 1.5px solid #1e293b; box-shadow: 0 3px 6px rgba(15,23,42,.25); font-weight: 700; }
.pg-btn.disabled { opacity: .35; pointer-events: none; box-shadow: none; }
.pg-num:hover { background: #eef5fc; }
.pg-num.current { border: 1.5px solid var(--inion-blue); color: var(--inion-blue-dark); box-shadow: 0 3px 8px rgba(29,161,242,.35); font-weight: 600; }

/* ---------- Device data page ---------- */
.back-link { display: inline-block; margin-bottom: 14px; color: var(--inion-blue-dark); text-decoration: none; font-weight: 600; }
.back-link:hover { text-decoration: underline; }
.back-links { display: flex; flex-wrap: wrap; gap: 6px 24px; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.page-sub { margin: 0; font-size: 1.4rem; font-weight: 700; display: flex; align-items: center; gap: 12px; }
.muted { color: var(--inion-muted); margin: 4px 0 0; }
.date-form .select { background: #fff; }
.date-form input[type="date"] { border: 0; outline: 0; background: transparent; font: inherit; color: var(--inion-text); }

/* ---------- Dashboard toolbar date + note ---------- */
.toolbar .tb-form { display: contents; }
.toolbar .date-form .select { background: #fff; }
.toolbar .date-form input[type="date"] { border: 0; outline: 0; background: transparent; font: inherit; color: var(--inion-text); }
.note { margin-top: 16px; background: #fff7e0; border: 1px solid #f5d98a; color: #6b4e00; border-radius: 10px; padding: 10px 14px; }
.note a { margin-left: 8px; color: var(--inion-blue-dark); font-weight: 600; }

/* ---------- Content Calendar ---------- */
.cal-card { background: #fff; border-radius: var(--inion-radius); box-shadow: var(--inion-shadow); padding: 20px; }
.cal-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.cal-nav { display: flex; align-items: center; gap: 12px; }
.cal-title { margin: 0; font-size: 1.3rem; font-weight: 700; min-width: 170px; text-align: center; }
.cal-nav .pg-btn { background: #fff; cursor: pointer; font: inherit; font-size: 1.2rem; }
.cal-nav .pg-btn:disabled { opacity: .35; cursor: not-allowed; box-shadow: none; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.cal-weekdays { margin-bottom: 8px; text-align: center; font-weight: 600; color: var(--inion-muted); font-size: .9rem; }
.cal-day { min-height: 84px; border-radius: 12px; padding: 8px 10px; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid var(--inion-border); text-decoration: none; color: var(--inion-text); background: #fff; }
.cal-day.blank { border: 0; background: transparent; }
.cal-day.off { color: #b6c0cc; background: #f6f8fa; cursor: not-allowed; }
.cal-day.has { background: #eaf6ff; border-color: #9fd3f7; cursor: pointer; }
.cal-day.has:hover { background: #d9eefc; box-shadow: 0 4px 10px rgba(29,161,242,.25); }
.cal-day.today .num { background: var(--inion-blue); color: #fff; }
.cal-day .num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; }
.cal-day .count { font-size: .8rem; color: var(--inion-blue-dark); font-weight: 600; }
.cal-help { margin: 16px 2px 0; color: var(--inion-muted); font-size: .9rem; }
@media (max-width: 700px) { .cal-grid { gap: 4px; } .cal-day { min-height: 64px; padding: 4px 6px; } .cal-day .count { font-size: .68rem; } }

/* ---------- Day page device list ---------- */
.dev-list { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.dev-card { background: #fff; border-radius: var(--inion-radius); box-shadow: var(--inion-shadow); overflow: hidden; }
.dev-row { width: 100%; display: flex; align-items: center; gap: 16px; padding: 18px 20px; border: 0; background: #fff; font: inherit; text-align: left; cursor: pointer; }
.dev-row:hover { background: #f8fbfe; }
.dev-row .muted { margin: 0 0 0 auto; }
.dev-row .chev { transition: transform .15s; color: var(--inion-muted); }
.dev-row.open .chev { transform: rotate(180deg); }
.chip { background: var(--inion-purple-soft); color: var(--inion-purple); border-radius: 999px; padding: 2px 10px; font-size: .8rem; font-weight: 600; }
.dev-panel { border-top: 1px solid var(--inion-border); }
.dev-panel[hidden] { display: none; }
.empty-card { background: #fff; border-radius: var(--inion-radius); box-shadow: var(--inion-shadow); padding: 40px; text-align: center; color: var(--inion-muted); }

/* ---------- PA (performance assessment) view ---------- */
.pa-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 20px; margin-bottom: 20px; }
@media (max-width: 1000px) { .pa-grid { grid-template-columns: 1fr; } }
.pa-card { background: #fff; border-radius: var(--inion-radius); box-shadow: var(--inion-shadow); padding: 20px; margin-bottom: 0; }
.pa-grid + .pa-card { margin-top: 0; }
.pa-h { margin: 0 0 16px; font-size: 1rem; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; color: #334155; }
.rings { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-around; padding: 8px 0 4px; }
.ring { position: relative; width: 104px; text-align: center; }
.ring-svg { width: 104px; height: 104px; display: block; }
.ring-center { position: absolute; top: 0; left: 0; width: 104px; height: 104px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-center b { font-size: 1.25rem; line-height: 1.1; }
.ring-center b.sm { font-size: .85rem; max-width: 70px; }
.ring-label { margin-top: 8px; font-weight: 600; color: var(--inion-muted); }
.criteria { display: flex; flex-direction: column; gap: 14px; }
.crit-top { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.crit-name { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.crit-val { color: var(--inion-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.crit.overall .crit-name, .crit.overall .crit-val { font-weight: 700; color: var(--inion-text); }
.tick { width: 18px; height: 18px; border-radius: 50%; background: var(--inion-green); color: #fff; font-size: .7rem; display: inline-grid; place-items: center; }
.bar { height: 10px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 999px; background: var(--inion-blue); }
.crit.overall .bar span { background: var(--inion-green); }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.tl { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; border: 1.5px solid; }
.tl-num { font-weight: 700; }
.tl-text { flex: 1; }
.tl-tag { display: block; opacity: .7; margin-top: 2px; }
.tl-icon { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; flex: none; }
.tl.faster { background: #ecfdf3; border-color: #86efac; } .tl.faster .tl-icon { background: var(--inion-green); }
.tl.slower { background: #fff7e6; border-color: #fcd34d; } .tl.slower .tl-icon { background: #f59e0b; }
.tl.error { background: #fef2f2; border-color: #fca5a5; } .tl.error .tl-icon { background: var(--inion-red); }
.tl.none { background: #f8fafc; border-color: var(--inion-border); color: var(--inion-muted); }
.attempt-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.attempt-tabs[hidden] { display: none; }
.attempt-tab { border: 1.5px solid var(--inion-border); background: #fff; border-radius: 999px; padding: 6px 14px; font: inherit; cursor: pointer; }
.attempt-tab.on { border-color: var(--inion-blue); color: var(--inion-blue-dark); background: #eaf6ff; font-weight: 600; }

/* ---------- Export dialog ---------- */
.cal-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.btn-export { display: inline-flex; align-items: center; gap: 8px; width: auto; height: 44px; padding: 0 18px; font-size: 1rem; }
.modal-card { border: 0; border-radius: 20px; padding: 24px; width: min(460px, 92vw); box-shadow: 0 20px 50px rgba(15, 23, 42, .3); }
.modal-card::backdrop { background: rgba(15, 23, 42, .45); }
.modal-title { margin: 0 0 4px; font-size: 1.25rem; font-weight: 700; }
.lbl { display: block; font-weight: 600; margin: 14px 0 6px; padding: 0; }
.plain-select { border: 0; outline: 0; width: 100%; font: inherit; background: transparent; }
.field-box:has(.plain-select) { height: 46px; }
.hint { color: var(--inion-muted); font-size: .85rem; margin-top: 6px; min-height: 1em; }
.fmt { border: 0; padding: 0; margin: 0; }
.radio { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--inion-border); border-radius: 10px; margin-bottom: 8px; cursor: pointer; }
.radio:has(input:checked) { border-color: var(--inion-blue); background: #eaf6ff; }
.radio small { display: block; color: var(--inion-muted); }
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 16px; }
.modal-actions .btn-inion { width: auto; padding: 0 22px; }
.modal-actions .btn-outline { height: 48px; }

.fmt legend { font-size: 1rem; float: none; width: auto; }

/* ---------- Month report (print to PDF) ---------- */
.report-page { padding: 28px 32px 60px; max-width: 1000px; margin: 0 auto; background-attachment: scroll; }
.report-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.report-title { margin: 0; font-size: 1.6rem; font-weight: 700; }
.report-actions { display: flex; gap: 12px; align-items: center; }
.report-tip { background: #eaf6ff; border: 1px solid #9fd3f7; border-radius: 10px; padding: 10px 14px; margin: 12px 0 20px; }
.report-sec { background: #fff; border-radius: var(--inion-radius); box-shadow: var(--inion-shadow); padding: 22px; margin-bottom: 20px; }
.report-h { margin: 4px 0 10px; font-size: 1.25rem; font-weight: 700; }
.rtable { width: 100%; border-collapse: collapse; margin-top: 8px; }
.rtable th { background: #f1f2f4; text-align: left; padding: 10px 14px; }
.rtable td { padding: 10px 14px; border-top: 1px solid var(--inion-border); }
.rlink { color: var(--inion-blue-dark); text-decoration: none; font-weight: 600; }
.rlink:hover { text-decoration: underline; }
.rlink.back { display: inline-block; margin: 0 14px 8px 0; font-size: .9rem; }
.pa-card.flat { box-shadow: none; border: 1px solid var(--inion-border); margin-top: 14px; }
@media print {
  @page { margin: 14mm; }
  body.inion { background: #fff !important; }
  .no-print { display: none !important; }
  .report-page { padding: 0; max-width: none; }
  .report-sec { box-shadow: none; border: 0; padding: 0; }
  .page-break { break-before: page; page-break-before: always; }
  .tl, .crit, .ring { break-inside: avoid; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Animated background (all pages) ---------- */
.bg-fx { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.bg-fx canvas { display: block; } /* drawn by js/bg-network.js */
.shell, .login-shell { position: relative; z-index: 1; }

/* ---------- Entrance motion ---------- */
@keyframes riseIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
/* "backwards" (not "both") so hover transforms work after the entrance finishes */
.content > *, .login-shell > section { animation: riseIn .45s ease-out backwards; }
.content > *:nth-child(2) { animation-delay: .06s; }
.content > *:nth-child(3) { animation-delay: .12s; }
.content > *:nth-child(4) { animation-delay: .18s; }
.login-shell > section:last-child { animation-delay: .1s; }
.cards > * { animation: riseIn .45s ease-out backwards; }
.cards > *:nth-child(2) { animation-delay: .05s; } .cards > *:nth-child(3) { animation-delay: .1s; }
.cards > *:nth-child(4) { animation-delay: .15s; } .cards > *:nth-child(5) { animation-delay: .2s; }
.login-brand img { animation: floatY 5s ease-in-out infinite; }
@keyframes floatY { 50% { transform: translateY(-10px); } }

/* ---------- Hover effects ---------- */
.card-stat, .pa-card, .dev-card, .cal-card, .panel, .table-card, .toolbar, .login-card, .empty-card, .report-sec {
  transition: transform .2s ease, box-shadow .2s ease;
}
.card-stat:hover, .dev-card:hover, .panel:hover, .pa-card:hover, .login-card:hover {
  transform: translateY(-4px); box-shadow: 0 14px 30px rgba(15, 23, 42, .14);
}
.card-stat .icon { transition: transform .25s ease; }
.card-stat:hover .icon { transform: scale(1.08) rotate(-4deg); }
/* Spinning 3D model icons (Dashboard): bigger box; the flat svg shows until the model is loaded */
.card-stat .icon-3d { position: relative; width: 150px; height: 150px; border-radius: 16px; overflow: hidden; }
.card-stat:hover .icon-3d { transform: scale(1.04); } /* the model already spins; no extra tilt */
.icon-3d canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .4s ease; }
.icon-3d.ready canvas { opacity: 1; }
.icon-3d.ready svg { display: none; }
@media (max-width: 600px) { .card-stat .icon-3d { width: 110px; height: 110px; } }
.card-stat .more svg { transition: transform .2s ease; }
.card-stat .more:hover svg { transform: translateX(4px); }
.nav-list a { position: relative; transition: background .2s ease, color .2s ease, padding-left .2s ease; }
.nav-list a:not(.active):not(.disabled):hover { padding-left: 22px; color: #fff; }
.nav-list a.active::before { content: ""; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: #22d3ee; box-shadow: 0 0 10px #22d3ee; }
.btn-inion { transition: background .2s ease, transform .15s ease, box-shadow .2s ease; }
.btn-inion:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(29, 161, 242, .4); }
.btn-inion:active:not(:disabled) { transform: translateY(0); }
.btn-outline { transition: background .2s ease, color .2s ease, transform .15s ease, box-shadow .2s ease; }
.btn-outline.blue:hover:not(:disabled) { background: #3b82f6; color: #fff; transform: translateY(-2px); box-shadow: 0 6px 14px rgba(59, 130, 246, .35); }
.btn-outline.purple:hover:not(:disabled) { background: #a855f7; color: #fff; transform: translateY(-2px); box-shadow: 0 6px 14px rgba(168, 85, 247, .35); }
.dev-table tbody tr { transition: background .15s ease, box-shadow .15s ease; }
.dev-table tbody tr:hover { box-shadow: inset 4px 0 0 var(--inion-blue); }
.cal-day { transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.cal-day.has:hover { transform: translateY(-3px) scale(1.03); }
.pg-num, .pg-btn { transition: background .15s ease, transform .15s ease; }
.pg-num:hover, .pg-btn:not(.disabled):hover { transform: translateY(-2px); }
.field-box { transition: border-color .2s ease, box-shadow .2s ease; }
.toolbar .search, .toolbar .select { transition: border-color .2s ease, box-shadow .2s ease; }
.toolbar .search:focus-within, .toolbar .select:hover { border-color: var(--inion-blue); box-shadow: 0 0 0 3px rgba(29, 161, 242, .18); }
.attempt-tab, .radio { transition: border-color .15s ease, background .15s ease; }
.attempt-tab:hover, .radio:hover { border-color: var(--inion-blue); }
.brand img { transition: transform .4s ease; }
.brand:hover img { transform: rotate(-12deg) scale(1.06); }

/* Respect the system "reduce motion" setting */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .bg-fx { display: none !important; }
  /* Portal pages printed as PDF (Users > Download Data): page content only */
  .sidebar, .topbar, .pa-tools, .page-back svg { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; }
  .content > *, .cards > * { animation: none !important; }
  .pa-box, .sum-card, .pa-stat { box-shadow: none !important; break-inside: avoid; }
}

/* ---------- Users page ---------- */
.cards-sm { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-top: 20px; }
.card-stat.mini { padding: 16px 20px; }
.card-stat.mini .label { color: var(--inion-muted); font-weight: 500; }
.card-stat.mini .count { font-size: 2rem; margin-top: 6px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; background: linear-gradient(135deg, #1da1f2, #9333ea); color: #fff; font-size: .85rem; font-weight: 700; }
.score { font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.score.good { background: var(--inion-green-soft); color: #15803d; }
.score.mid { background: #fef3c7; color: #a16207; }
.score.low { background: var(--inion-red-soft); color: #b91c1c; }

/* ---------- Settings page ---------- */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: stretch; }
.settings-logout { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; text-align: center; }
.settings-logout .panel-h { justify-content: center; margin-bottom: 6px; }
.settings-logout .small-note { margin: 0 0 14px; }
@media (max-width: 1000px) { .settings-grid { grid-template-columns: 1fr; } }
.panel { background: #fff; border-radius: var(--inion-radius); box-shadow: var(--inion-shadow); padding: 24px; }
.panel-h { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; font-size: 1.2rem; font-weight: 700; }
.panel-h svg { color: var(--inion-blue); }
.info-list { margin: 0; }
.info-list > div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--inion-border); }
.info-list > div:first-child { border-top: 0; }
.info-list dt { font-weight: 500; color: var(--inion-muted); }
.info-list dd { margin: 0; font-weight: 600; text-align: right; word-break: break-word; }
.small-note { font-size: .85rem; margin-top: 14px; }
.panel .field-box { height: 46px; }
.panel .field-box input { border: 0; outline: 0; width: 100%; font: inherit; background: transparent; }
.panel .lbl { margin-top: 0; }
.form-ok { background: var(--inion-green-soft); color: #166534; border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; font-size: .9rem; }
.pw-meter { height: 6px; border-radius: 999px; background: #e2e8f0; margin-top: 8px; overflow: hidden; }
.pw-meter span { display: block; height: 100%; width: 0; border-radius: 999px; transition: width .25s ease, background .25s ease; }
.pw-meter span.weak { background: var(--inion-red); }
.pw-meter span.fair { background: #f59e0b; }
.pw-meter span.strong { background: var(--inion-green); }

/* ---------- Forgot password / create account ---------- */
.help-icon { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: var(--inion-blue-soft); color: var(--inion-blue-dark); margin-bottom: 14px; }
.help-title { font-size: 1.4rem; font-weight: 700; margin: 0 0 6px; }
.steps { margin: 16px 0 22px; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.btn-link { display: grid; place-items: center; text-decoration: none; }
.btn-link:hover { color: #fff; }

/* =================== Users section: PA dashboard, Student Details, Simulation Performance =================== */
.pa-page { display: flex; flex-direction: column; gap: 20px; }
.pa-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px; }
.pa-title { display: flex; align-items: center; gap: 14px; }
.pa-title h2, .page-back h2 { margin: 0; font-size: 1.4rem; font-weight: 700; }
.pa-title p { margin: 2px 0 0; font-size: .9rem; }
.pa-title-icon { width: 52px; height: 52px; border-radius: 14px; background: var(--inion-blue-soft); color: var(--inion-blue-dark); display: grid; place-items: center; flex: none; }
.pa-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pa-search { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--inion-border); border-radius: 10px; padding: 0 12px; height: 42px; min-width: 240px; }
.pa-search input { border: 0; outline: 0; width: 100%; font: inherit; background: transparent; }
.pa-select { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--inion-border); border-radius: 10px; padding: 0 10px; height: 42px; color: var(--inion-muted); }
.pa-select select { border: 0; outline: 0; background: transparent; font: inherit; color: var(--inion-text); padding-right: 4px; cursor: pointer; }
.pa-select.small { height: 36px; margin-left: auto; }
.icon-btn { width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--inion-border); background: #fff; color: var(--inion-blue-dark); display: inline-grid; place-items: center; cursor: pointer; transition: background .15s ease, transform .15s ease; }
.icon-btn:hover { background: #eaf6ff; transform: translateY(-2px); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn.dl { width: 38px; height: 38px; background: #eaf6ff; border-color: #cfe8fb; }
.btn-dl { display: inline-flex; align-items: center; gap: 8px; width: auto; height: 42px; padding: 0 16px; font-size: .95rem; }
.btn-report { display: inline-flex; align-items: center; gap: 8px; height: 42px; }
.menu-wrap { position: relative; }
.menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; min-width: 220px; background: #fff; border: 1px solid var(--inion-border); border-radius: 12px; box-shadow: 0 16px 40px rgba(15,23,42,.18); padding: 6px; }
.menu[hidden] { display: none; }
.menu-right { left: auto; right: 0; min-width: 300px; }
.menu-h { font-size: .8rem; font-weight: 600; color: var(--inion-muted); padding: 6px 10px; }
.menu-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--inion-text); text-decoration: none; cursor: pointer; font-size: .92rem; }
.menu-item:hover { background: #f1f7fd; }
.menu-item.rich b { display: block; font-size: .92rem; }
.menu-item.rich small { display: block; color: var(--inion-muted); font-size: .78rem; }
.mi-icon { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; flex: none; font-size: .7rem; font-weight: 700; }
.mi-icon.doc { background: #dbeafe; color: #2563eb; }
.mi-icon.csv { background: #dbeafe; color: #1d4ed8; font-size: 1rem; }
.mi-icon.pdf { background: #fee2e2; color: #dc2626; }

.pa-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.pa-stat { display: flex; align-items: center; gap: 18px; padding: 20px; border-radius: 16px; background: linear-gradient(135deg, #fff, #f3f8ff); border: 1px solid #e3eefb; box-shadow: var(--inion-shadow); transition: transform .2s ease, box-shadow .2s ease; }
.pa-stat.green { background: linear-gradient(135deg, #fff, #effcf5); border-color: #d6f3e2; }
.pa-stat.purple { background: linear-gradient(135deg, #fff, #f6f1ff); border-color: #e9ddfd; }
.pa-stat:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(15,23,42,.12); }
.ps-icon, .bh-icon, .sum-icon { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; flex: none; }
.ps-icon svg { width: 30px; height: 30px; }
.ps-label { color: #334155; font-weight: 500; }
.ps-value { font-size: 2rem; font-weight: 700; line-height: 1.2; }
.ps-icon.blue, .bh-icon.blue, .sum-icon.blue { background: #dbeafe; color: #2563eb; }
.ps-icon.green, .bh-icon.green, .sum-icon.green { background: #dcfce7; color: #16a34a; }
.ps-icon.purple, .sum-icon.purple { background: #f3e8ff; color: #9333ea; }
.bh-icon.red { background: #fee2e2; color: #dc2626; }
.bh-icon.amber { background: #fef3c7; color: #b45309; } .sum-icon.grey { background: #eef2f7; color: #64748b; }

.pa-box { background: #fff; border: 1px solid #e3eefb; border-radius: 16px; box-shadow: var(--inion-shadow); padding: 18px 20px; min-width: 0; }
.pa-box.tint-green { background: linear-gradient(135deg, #f2fcf6, #fff); border-color: #d6f3e2; }
.pa-box.tint-red { background: linear-gradient(135deg, #fff3f3, #fff); border-color: #fbdada; }
.box-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.box-head h3, .box-title { margin: 0; font-size: 1.05rem; font-weight: 700; }
.box-head p { margin: 2px 0 0; color: var(--inion-muted); font-size: .84rem; }
.box-head .bh-icon { width: 40px; height: 40px; border-radius: 10px; }
.box-head .bh-icon svg { width: 22px; height: 22px; }
.box-title { margin-bottom: 14px; }
.view-all { margin-left: auto; border: 0; background: none; color: var(--inion-blue-dark); font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; white-space: nowrap; }
.view-all:hover { text-decoration: underline; }
.recent .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #cbd5e1; margin-right: 6px; }
.recent .dot.on { background: #16a34a; }

.pa-row3 { display: grid; grid-template-columns: 1fr 1fr 1.15fr; gap: 18px; }
.people { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.person { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--inion-text); min-width: 0; }
.person .avatar { width: 40px !important; height: 40px !important; font-size: 14px !important; }
.person > span:last-child { min-width: 0; }
.person b { display: block; font-weight: 500; font-size: .88rem; line-height: 1.2; overflow-wrap: anywhere; }
.pa-box .people + p, .people > p { grid-column: 1 / -1; }
.person:hover b { color: var(--inion-blue-dark); }
.pct { display: block; font-weight: 700; font-size: 1.05rem; }
.pct.good { color: #16a34a; } .pct.mid { color: #b45309; } .pct.low { color: #dc2626; }
.trend-box { display: flex; gap: 16px; }
.trend-chart { flex: 1; min-width: 0; }
.trend-chart h3 { margin: 0 0 6px; font-size: 1.05rem; font-weight: 700; }
.trend-side { display: flex; flex-direction: column; justify-content: center; gap: 18px; border-left: 1px solid var(--inion-border); padding-left: 16px; min-width: 110px; }
.trend-side small { display: block; color: var(--inion-muted); }
.trend-side b { font-size: 1.5rem; }
.trend-side b.up { color: #16a34a; } .trend-side b.down { color: #dc2626; }
.tiny { display: block; font-size: .78rem; color: var(--inion-muted); }

.chart { width: 100%; height: auto; display: block; overflow: visible; }
.ch-grid { stroke: #e8eef6; stroke-width: 1; }
.ch-axis { fill: #64748b; font-size: 11px; font-family: var(--inion-font); }
.ch-line { fill: none; stroke: #2563eb; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.ch-dot { fill: #2563eb; stroke: #fff; stroke-width: 2; }
.ch-peak rect { fill: #e0edff; stroke: #bfd6fb; }
.ch-peak text { fill: #1e3a8a; font-size: 11px; font-weight: 600; font-family: var(--inion-font); }
.chart-empty { color: var(--inion-muted); text-align: center; padding: 50px 0; margin: 0; }

.st-table th { white-space: nowrap; }
.sort { border: 0; background: none; font: inherit; font-weight: 700; color: var(--inion-text); cursor: pointer; padding: 0; display: inline-flex; align-items: center; gap: 4px; }
.sort::after { content: "\21C5"; color: #94a3b8; font-size: .85rem; }
.sort.on { color: var(--inion-blue-dark); }
.sort.on[aria-sort="ascending"]::after { content: "\2191"; color: var(--inion-blue-dark); }
.sort.on[aria-sort="descending"]::after { content: "\2193"; color: var(--inion-blue-dark); }
.st-name { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--inion-text); }
.st-name b { display: block; font-weight: 600; white-space: nowrap; }
.st-name small, .recent small { display: block; color: var(--inion-muted); font-size: .82rem; }
.st-name:hover b { color: var(--inion-blue-dark); text-decoration: underline; }
.comp { min-width: 220px; }
.comp-pct { font-weight: 600; font-size: .9rem; }
.comp-row { display: flex; align-items: center; gap: 12px; }
.comp-bar { flex: 1; height: 8px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
.comp-bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #10b981, #34d399); }
.comp-row small { color: var(--inion-muted); white-space: nowrap; }
.with-icon { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font-weight: 500; }
.with-icon svg { width: 18px; height: 18px; color: var(--inion-muted); }
.chip-count { display: inline-flex; align-items: center; gap: 6px; background: #eaf2ff; color: #1d4ed8; border-radius: 999px; padding: 4px 12px; font-weight: 600; }
.chip-count svg { width: 16px; height: 16px; }
.recent { display: inline-flex; align-items: flex-start; gap: 4px; }
.recent .dot { margin-top: 6px; }
.recent b { font-weight: 500; }

/* Student Details */
.page-back { display: inline-flex; align-items: center; gap: 12px; color: var(--inion-text); text-decoration: none; }
.page-back:hover h2 { color: var(--inion-blue-dark); }
.who-block { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.who-name { display: block; font-size: 1.25rem; }
.who-sub { color: var(--inion-muted); font-size: .9rem; }
.usage-box { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: stretch; }
.usage-chart { min-width: 0; }
.sum-cards { display: grid; grid-template-columns: repeat(3, 124px); gap: 12px; border-left: 1px solid var(--inion-border); padding-left: 20px; }
.sum-card { border: 1px solid var(--inion-border); border-radius: 12px; padding: 14px 12px; display: flex; flex-direction: column; gap: 4px; background: linear-gradient(180deg, #fff, #f8fbff); }
.sum-card .sum-icon { width: 38px; height: 38px; border-radius: 50%; margin-bottom: 4px; }
.sum-card .sum-icon svg { width: 20px; height: 20px; }
.sum-card small { color: #334155; font-weight: 500; font-size: .85rem; }
.sum-card b { font-size: 1.35rem; line-height: 1.2; white-space: nowrap; }
.sum-card #sumTime { font-size: 1.05rem; }
.sum-card b.green, .tiny.green { color: #16a34a; }
.pa-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.bl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.bl-list { border-radius: 12px; border: 1px solid; overflow: hidden; }
.bl-list.best { border-color: #ccefd9; background: #f6fdf9; }
.bl-list.worst { border-color: #fbd5d5; background: #fff7f7; }
.bl-h { padding: 10px 14px; font-weight: 600; font-size: .92rem; }
.best .bl-h { background: #e6f8ee; color: #15803d; }
.worst .bl-h { background: #fde8e8; color: #b91c1c; }
.bl-item { display: flex; align-items: center; gap: 10px; padding: 9px 14px; text-decoration: none; color: var(--inion-text); border-top: 1px solid rgba(15,23,42,.05); transition: background .15s ease; }
.bl-item:hover { background: rgba(255,255,255,.8); }
.bl-icon { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex: none; }
.best .bl-icon { background: #0ea5e9; } .worst .bl-icon { background: #a855f7; }
.bl-icon svg { width: 16px; height: 16px; }
.bl-icon.sim-ico { background: #0ea5e9; }
.bl-name { flex: 1; font-size: .92rem; }
.bl-list .pct { font-size: .95rem; }
.best .pct { color: #16a34a; } .worst .pct { color: #dc2626; }
.muted.pad { padding: 12px 14px; margin: 0; font-size: .88rem; }
.mini-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.mini-table th { background: #f4f7fb; text-align: left; padding: 10px 12px; font-weight: 600; color: #334155; white-space: nowrap; }
.mini-table td { padding: 10px 12px; border-top: 1px solid var(--inion-border); vertical-align: top; }
.mini-table td.empty { text-align: center; color: var(--inion-muted); padding: 24px; }
.mini-table td.num { width: 32px; color: var(--inion-muted); }
.muted-cell { color: #475569; font-size: .85rem; }
.mk { display: flex; align-items: flex-start; gap: 10px; }
.mk-icon { color: #dc2626; flex: none; }
.mk-icon svg { width: 20px; height: 20px; }

/* Simulation Performance */
.crumb { color: var(--inion-muted); font-size: .9rem; margin: 4px 0 0 34px; }
.crumb span { margin: 0 4px; }
.crumb #spCrumb { margin: 0; color: #334155; }
.sp-ident { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 48px; }
.sp-ident .who-block { margin-top: 0; }
.sim-ident { display: flex; align-items: center; gap: 14px; }
.sim-ident b { font-size: 1.1rem; color: #1e3a8a; }
.sim-thumb { width: 64px; height: 48px; border-radius: 10px; background: linear-gradient(135deg, #dbeafe, #ede9fe); display: inline-block; flex: none; }
.sp-empty { color: var(--inion-muted); text-align: center; padding: 30px; }
.pa-row-overall { display: grid; grid-template-columns: minmax(400px, 1fr) 1.7fr; gap: 18px; margin-bottom: 18px; }
/* Performance Trend is hidden with a single attempt: the overall box then takes the whole row */
.pa-row-overall:has(> [hidden]) { grid-template-columns: 1fr; }
.overall-box { display: flex; align-items: center; gap: 18px; }
.big-ring { width: 150px; flex: none; }
.ring-big { width: 150px; height: 150px; display: block; }
.overall-facts b { white-space: nowrap; }
.overall-facts > li > div { min-width: 0; }
.rb-track { fill: none; stroke: #e2f5ea; stroke-width: 16; }
.rb-fill { fill: none; stroke: #16a34a; stroke-width: 16; stroke-linecap: round; transition: stroke-dashoffset .6s ease; }
.rb-fill.mid { stroke: #f59e0b; } .rb-fill.low { stroke: #dc2626; }
.rb-val { font-size: 34px; font-weight: 700; fill: var(--inion-text); font-family: var(--inion-font); }
.rb-label { font-size: 13px; fill: #64748b; font-family: var(--inion-font); }
.overall-facts { list-style: none; margin: 0; padding: 0 0 0 20px; border-left: 1px solid var(--inion-border); display: flex; flex-direction: column; gap: 14px; flex: 1; }
.overall-facts li { display: flex; align-items: center; gap: 12px; }
.overall-facts li + li { border-top: 1px solid var(--inion-border); padding-top: 14px; }
.overall-facts small { display: block; color: var(--inion-muted); font-size: .85rem; }
.overall-facts b { font-size: 1.2rem; }
.of-icon { width: 38px; height: 38px; border-radius: 10px; background: #eaf2ff; color: #2563eb; display: grid; place-items: center; flex: none; }
.of-icon svg { width: 20px; height: 20px; }
.crit-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.pa-row2 .crit-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } /* half-width box: 2 x 2 */
.crit-card { border-radius: 14px; padding: 16px; border: 1px solid; display: flex; flex-direction: column; gap: 4px; transition: transform .2s ease; }
.crit-card:hover { transform: translateY(-3px); }
.cc-h { font-weight: 600; font-size: .9rem; color: #334155; margin-bottom: 8px; }
.crit-card b { font-size: 1.7rem; line-height: 1.1; }
.crit-card small { color: #475569; }
.cc-bar { height: 8px; border-radius: 999px; background: rgba(15,23,42,.08); overflow: hidden; margin-top: 10px; }
.cc-bar span { display: block; height: 100%; border-radius: 999px; }
.c-green { background: #f0fbf4; border-color: #cdeedb; } .c-green .cc-bar span { background: #16a34a; }
.c-blue { background: #f1f6ff; border-color: #d3e3fb; } .c-blue .cc-bar span { background: #2563eb; }
.c-purple { background: #f7f2ff; border-color: #e5d8fb; } .c-purple .cc-bar span { background: #9333ea; }
.c-amber { background: #fff8ee; border-color: #fbe3bf; } .c-amber .cc-bar span { background: #f59e0b; }
.trend-compare { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; align-items: center; }
.tb-chart { height: 220px; display: flex; align-items: flex-end; justify-content: space-around; gap: 20px; border-bottom: 1px solid var(--inion-border); padding: 26px 10px 0; }
.tb-col { flex: 1; max-width: 120px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.tb-bar { width: 100%; border-radius: 6px 6px 0 0; display: block; transition: height .6s ease; }
.tb-bar.first { background: #93c5fd; } .tb-bar.latest { background: #4ade80; }
.tb-val { font-weight: 700; margin-bottom: 4px; }
.tb-val.first { color: #1d4ed8; } .tb-val.latest { color: #16a34a; }
.tb-col b { position: absolute; bottom: -42px; font-size: .88rem; white-space: nowrap; }
.tb-col small { position: absolute; bottom: -60px; color: var(--inion-muted); font-size: .8rem; white-space: nowrap; }
#spBars { padding-bottom: 64px; }
.improve { border-radius: 14px; padding: 18px; }
.improve.up { background: #effaf3; border: 1px solid #cdeedb; color: #15803d; }
.improve.down { background: #fff4f4; border: 1px solid #fbd5d5; color: #b91c1c; }
.improve.none { background: #f8fafc; border: 1px solid #e2e8f0; color: #475569; }
.improve.none .imp-icon { background: #94a3b8; }
.improve > div { display: flex; flex-direction: column; }
.improve b { font-size: 1.8rem; }
.improve span:not(.imp-icon) { font-weight: 600; }
.imp-icon { width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 1.3rem; font-weight: 700; color: #fff; margin-bottom: 8px; }
.improve.up .imp-icon { background: #22c55e; } .improve.down .imp-icon { background: #ef4444; }
.improve p { color: #334155; margin: 10px 0 0; font-size: .88rem; }

/* PA / Guided switch above the Users table */
.mode-bar { display: flex; justify-content: flex-end; padding: 12px 16px 0; }
.seg { display: inline-flex; background: #eef2f7; border-radius: 10px; padding: 3px; }
.seg label { margin: 0; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 6px 18px; border-radius: 8px; font-weight: 600; font-size: .9rem; color: var(--inion-muted); transition: background .15s ease, color .15s ease; }
.seg input:checked + span { background: #fff; color: var(--inion-blue-dark); box-shadow: 0 2px 6px rgba(15,23,42,.12); }
.seg input:focus-visible + span { outline: 2px solid var(--inion-blue); outline-offset: 1px; }

/* Simulation Attempt History */
.hist-count { margin-left: auto; font-size: .88rem; }
.hist-table td { vertical-align: middle; }
.hist-table tr.is-latest td { background: #f6faff; }
.hist-table .sub { display: block; color: var(--inion-muted); font-size: .78rem; }
.sub-inline { color: var(--inion-muted); font-size: .8rem; }
.pct.inline { display: inline; }
.tag { display: inline-block; border-radius: 999px; padding: 1px 8px; font-size: .72rem; font-weight: 600; margin-left: 4px; vertical-align: 1px; }
.tag.best { background: #dcfce7; color: #15803d; }
.tag.latest { background: #dbeafe; color: #1d4ed8; }
.mistake-count { display: inline-grid; place-items: center; min-width: 28px; height: 24px; padding: 0 8px; border-radius: 999px; background: #fee2e2; color: #b91c1c; font-weight: 700; font-size: .85rem; }
.mistake-count.zero { background: #dcfce7; color: #15803d; }
.delta { font-size: .78rem; font-weight: 700; margin-left: 4px; }
.delta.up { color: #16a34a; } .delta.down { color: #dc2626; } .delta.same { color: var(--inion-muted); }
.hist-table .btn-outline { padding: 5px 12px; font-size: .88rem; }

/* Individual reports (print) */
.report-sub { font-size: 1rem; font-weight: 700; margin: 18px 0 4px; }
.student-report ~ .student-report { break-before: page; page-break-before: always; }

@media (max-width: 1300px) {
  .pa-row3 { grid-template-columns: 1fr 1fr; }
  .trend-box { grid-column: 1 / -1; }
  .usage-box { grid-template-columns: 1fr; }
  .sum-cards { border-left: 0; padding-left: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .crit-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .pa-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pa-row3, .pa-row2, .pa-row-overall, .trend-compare { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .pa-cards, .sum-cards, .bl-grid, .crit-cards { grid-template-columns: 1fr; }
  .pa-search { min-width: 0; flex: 1 1 100%; }
  .overall-box { flex-direction: column; }
  .overall-facts { border-left: 0; padding-left: 0; }
  .trend-box { flex-direction: column; }
  .trend-side { border-left: 0; padding-left: 0; flex-direction: row; }
}

/* ---------- Student Details: one open sheet, sections divided by lines (no boxes inside boxes) ---------- */
.sd { display: flex; flex-direction: column; gap: 12px; }
.sd-back { display: inline-flex; align-items: center; gap: 6px; color: var(--inion-muted); text-decoration: none; font-weight: 600; align-self: flex-start; }
.sd-back:hover { color: var(--inion-blue-dark); }
.sd-sheet { background: #fff; border-radius: 20px; box-shadow: var(--inion-shadow); padding: 8px 32px 16px; }
.sd-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 0; }
.sd-who { display: flex; align-items: center; gap: 16px; }
.sd-who .who-name { font-size: 1.5rem; font-weight: 700; }

/* Stats: two soft tinted panels (PA blue, Guided green), three numbers each */
.sd-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 4px 0 22px; border-bottom: 1px solid var(--inion-border); }
.sd-group { position: relative; overflow: hidden; border-radius: 16px; padding: 18px 22px 20px; }
.sd-group.pa { background: linear-gradient(135deg, #eff6ff 0%, #f8fbff 100%); --accent: #2563eb; --accent-soft: #dbeafe; }
.sd-group.guided { background: linear-gradient(135deg, #ecfdf3 0%, #f7fdf9 100%); --accent: #16a34a; --accent-soft: #d1fae5; }
.sd-group::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent); }
.sd-mode { display: flex; align-items: center; gap: 10px; font-size: .95rem; font-weight: 700; color: var(--accent); }
.sd-mode-ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: #fff; color: var(--accent); box-shadow: 0 2px 6px rgba(15, 23, 42, .08); }
.sd-mode-ico svg { width: 18px; height: 18px; }
.sd-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.sd-num { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sd-num + .sd-num { border-left: 1px solid rgba(15, 23, 42, .07); padding-left: 16px; }
.sd-num small { color: #475569; font-size: .84rem; font-weight: 500; }
.sd-num b { display: block; font-size: 1.85rem; font-weight: 700; line-height: 1.1; white-space: nowrap; color: var(--inion-text); }
.sd-num b.pct.good { color: #16a34a; } .sd-num b.pct.mid { color: #b45309; } .sd-num b.pct.low { color: #dc2626; }
.sd-of { font-size: 1.1rem; font-weight: 600; color: #94a3b8; }
.sd-meter { display: block; height: 6px; margin-top: 4px; border-radius: 3px; background: rgba(15, 23, 42, .07); overflow: hidden; max-width: 140px; }
.sd-meter span { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--accent); transition: width .6s ease; }
.sd-meter span.good { background: #16a34a; } .sd-meter span.mid { background: #d97706; } .sd-meter span.low { background: #dc2626; }
.sd-note { color: var(--inion-muted); font-size: .8rem; margin-top: 2px; }
/* Phones: smaller numbers so the three stats fit side by side */
@media (max-width: 600px) {
  .sd-group { padding: 14px 14px 16px 18px; }
  .sd-nums { gap: 8px; }
  .sd-num + .sd-num { padding-left: 8px; }
  .sd-num b, .sd-num b.pct { font-size: 1.25rem; }
  .sd-of { font-size: .85rem; }
  .sd-num small, .sd-note { font-size: .74rem; }
}

.sd-section { padding: 22px 0 6px; }
.sd-section + .sd-section { border-top: 1px solid var(--inion-border); }
.sd-h { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.sd-h h3 { margin: 0; font-size: 1.1rem; font-weight: 700; }
.sd-h h3 small { margin-left: 8px; font-size: .84rem; font-weight: 400; color: var(--inion-muted); }
.sd-legend { display: inline-flex; align-items: center; gap: 8px; color: var(--inion-muted); font-size: .88rem; }
.sd-legend i { display: inline-block; width: 18px; height: 3px; border-radius: 2px; margin-left: 8px; }
.sd-legend .lg-pa { background: #2563eb; }
.sd-legend .lg-guided { background: repeating-linear-gradient(90deg, #16a34a 0 5px, transparent 5px 8px); }
.ch-line2 { fill: none; stroke: #16a34a; stroke-width: 2.5; stroke-dasharray: 6 4; stroke-linejoin: round; stroke-linecap: round; }
.ch-dot2 { fill: #16a34a; stroke: #fff; stroke-width: 2; }

.seg button { border: 0; background: transparent; padding: 6px 18px; border-radius: 8px; font: inherit; font-weight: 600; font-size: .9rem; color: var(--inion-muted); cursor: pointer; }
.seg button.active { background: #fff; color: var(--inion-blue-dark); box-shadow: 0 2px 6px rgba(15,23,42,.12); }
.seg button:focus-visible { outline: 2px solid var(--inion-blue); outline-offset: 1px; }

/* Simulations: PA / Guided tabs with counts, search, compact cards (4 per row), "Show all" */
.seg button { white-space: nowrap; }
.seg button .seg-n { display: inline-block; transition: none; min-width: 22px; margin-left: 6px; padding: 0 7px; border-radius: 999px; background: #e2e8f0; color: #475569; font-size: .78rem; line-height: 20px; text-align: center; }
.seg button.active .seg-n { box-shadow: none; background: var(--inion-blue-soft); color: var(--inion-blue-dark); }
.sd-search { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border: 1px solid var(--inion-border); border-radius: 10px; color: var(--inion-muted); min-width: 240px; }
.sd-search:focus-within { border-color: var(--inion-blue); box-shadow: 0 0 0 3px rgba(29, 161, 242, .2); }
.sd-search input { border: 0; outline: 0; font: inherit; font-size: .92rem; color: var(--inion-text); background: transparent; width: 100%; }
.sd-more { display: block; margin: 4px auto 10px; border: 0; background: transparent; color: var(--inion-blue-dark); font: inherit; font-weight: 600; font-size: .92rem; padding: 6px 14px; border-radius: 8px; cursor: pointer; }
.sd-more:hover { background: #eff6ff; }
/* Fixed-height area that scrolls on its own: the page stays the same length with 10 or 50 simulations */
.sd-scroll { max-height: 300px; overflow-y: auto; padding: 2px 6px 2px 2px; margin-bottom: 16px; scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
.sd-scroll:focus-visible { outline: 2px solid var(--inion-blue); outline-offset: 2px; border-radius: 8px; }
.sim-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
/* Guided: one simulation per row; the header row stays at the top of the scroll area */
/* PA tab: same fixed box with its own scroll as Guided; tall enough for all 10 PA cards on a computer,
   on a phone the cards scroll inside the box so the page stays short */
.sd-scroll:has(.sim-grid) { max-height: 390px; border: 1px solid var(--inion-border); border-radius: 12px; padding: 12px; background: #fbfdff; }
.sd-scroll:has(.g-table) { padding-top: 0; border: 1px solid var(--inion-border); border-radius: 12px; padding: 0; }
@media (max-width: 600px) { .sd-scroll:has(.sim-grid), .sd-scroll:has(.g-table) { max-height: 360px; } }
.g-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .95rem; }
.g-table th { position: sticky; top: 0; z-index: 1; background: #f8fafc; text-align: left; font-size: .84rem; font-weight: 600; color: #475569; padding: 10px 14px; border-bottom: 1px solid var(--inion-border); }
.g-table td { padding: 10px 14px; border-bottom: 1px solid #f1f5f9; }
.g-table .num { text-align: right; width: 170px; white-space: nowrap; }
.g-table td.num b { color: #15803d; }
.g-table tbody tr:hover { background: #f7fcf9; }
.g-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #16a34a; margin-right: 10px; vertical-align: middle; }
.sim-card { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border: 1px solid var(--inion-border); border-radius: 14px; background: #fff; color: var(--inion-text); text-decoration: none; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.sim-card.link:hover { border-color: #93c5fd; box-shadow: 0 6px 16px rgba(37, 99, 235, .12); transform: translateY(-2px); color: var(--inion-text); }
.sc-head { display: flex; align-items: center; gap: 10px; min-height: 32px; }
.sc-name { flex: 1; min-width: 0; font-weight: 600; line-height: 1.3; font-size: .95rem; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sc-score { flex: none; font-size: 1.05rem; }
.sd-sim-ico.green { background: #dcfce7; color: #16a34a; }
.sd-sim-ico { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: #e0f2fe; color: #0284c7; flex: none; }
.sd-sim-ico svg { width: 16px; height: 16px; }
.sd-bar { display: block; width: 100%; height: 6px; border-radius: 3px; background: #eef2f7; overflow: hidden; }
.sd-bar span { display: block; height: 100%; border-radius: 3px; background: #2563eb; }
.sd-bar.good span { background: #16a34a; } .sd-bar.mid span { background: #d97706; } .sd-bar.low span { background: #dc2626; }
.sc-meta { color: var(--inion-muted); font-size: .88rem; }
.sc-meta.none { color: #a8b3c2; font-style: italic; }
.sd-empty { grid-column: 1 / -1; text-align: center; color: var(--inion-muted); padding: 30px 0; margin: 0; }

.sd-mistakes { list-style: none; margin: 0; padding: 0; }
.sd-mistakes li { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid #f1f5f9; }
.sd-mistakes li:last-child { border-bottom: 0; }
.sd-mistakes li > div { flex: 1; min-width: 0; }
.sd-mistakes b { display: block; font-weight: 600; }
.sd-mistakes small { color: var(--inion-muted); }
.sd-count { flex: none; font-size: .85rem; font-weight: 600; color: #b91c1c; background: #fef2f2; border-radius: 999px; padding: 3px 12px; }
.sd-mistakes .sd-empty { color: var(--inion-muted); justify-content: center; }

@media (max-width: 1000px) {
  .sd-sheet { padding: 4px 18px 12px; }
  .sd-stats { grid-template-columns: 1fr; }
}
@media print {
  .sd-back, .sd-search, .sd-more { display: none !important; }
  .sd-sheet { box-shadow: none; padding: 0; }
  .sd-scroll { max-height: none; overflow: visible; }
  .sd-section { break-inside: avoid; }
}

/* ---------- Users > Student List (students.js) ---------- */
.stl-grid { display: grid; grid-template-columns: minmax(280px, 360px) 1fr; gap: 24px; align-items: start; margin-top: 20px; }
.stl-grid .table-card { margin-top: 0; }
.stl-table .dev-table { min-width: 520px; }
.stl-add textarea, .stl-input {
  width: 100%; border: 1.5px solid var(--inion-border); border-radius: 10px; padding: 10px 12px; font: inherit; resize: vertical;
}
.stl-add textarea:focus, .stl-input:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, .15); }
.stl-add .btn-inion { width: 100%; margin-top: 8px; }
.stl-add .small-note { margin: 6px 0 12px; }
/* Edit mode: Save / Cancel / Delete side by side, all the same height */
.stl-actions { display: inline-flex; gap: 8px; align-items: center; }
.stl-actions button { height: 36px; padding: 0 14px; width: auto; font-size: .9rem; line-height: 1; box-shadow: none; transform: none; border-radius: 8px; }
.btn-outline.red { color: #dc2626; border-color: #f87171; }
.btn-outline.red:hover:not(:disabled) { background: #fef2f2; }
.roll-chip { display: inline-block; font-weight: 700; font-variant-numeric: tabular-nums; background: var(--inion-blue-soft); color: #1d4ed8; border-radius: 6px; padding: 3px 10px; }
.stl-head-btn { white-space: nowrap; }
/* Users table: headset data whose roll number and first name match nobody on the student list */
.tag-unlisted { display: inline-block; margin-left: 8px; font-size: .72rem; font-weight: 600; color: #b45309; background: #fef3c7; border-radius: 999px; padding: 2px 8px; vertical-align: 1px; }
@media (max-width: 900px) { .stl-grid { grid-template-columns: 1fr; } }
.stl-table td:nth-child(3) { white-space: nowrap; }
/* ---- Admin: Institutes page and Admin calendar ---- */
.admin-stats, .stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-row { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 8px 0 0; }
.admin-stats.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mini-stat { background: #fff; border-radius: 14px; box-shadow: var(--inion-shadow); padding: 16px 20px; display: flex; flex-direction: column; gap: 2px; border-left: 4px solid var(--inion-blue); }
.mini-stat:nth-child(2) { border-left-color: #6366f1; }
.mini-stat:nth-child(3) { border-left-color: var(--inion-purple); }
.mini-stat:nth-child(4) { border-left-color: #14b8a6; }
.mini-stat .v { font-size: 1.9rem; font-weight: 700; line-height: 1.1; }
.mini-stat .l { color: var(--inion-muted); font-weight: 600; font-size: .9rem; }
@media (max-width: 700px) { .admin-stats, .admin-stats.cols-3, .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.toolbar .btn-create { width: auto; height: 44px; padding: 0 18px; display: inline-flex; align-items: center; gap: 8px; margin-left: auto; white-space: nowrap; }
.note-ok { background: var(--inion-green-soft); color: #166534; border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; font-size: .9rem; }
.chip.blue { background: #e0f2fe; color: var(--inion-blue-dark); }
.chip.warn { background: #fef3c7; color: #b45309; }
.inst-name { font-weight: 600; }
.inst-cell { display: flex; align-items: center; gap: 12px; }
.inst-avatar { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--inion-blue), #6366f1); }
.admin-table td { padding: 14px 20px; }
.admin-table .col-caret { width: 44px; padding-right: 0; }
.caret-btn { width: 32px; height: 32px; border-radius: 8px; border: 0; background: #eaf6ff; color: var(--inion-blue-dark); display: grid; place-items: center; cursor: pointer; }
.caret-btn svg { transition: transform .15s; }
.caret-btn[aria-expanded="true"] svg { transform: rotate(90deg); }
.admin-table .icon-btn { width: 36px; height: 36px; }
.admin-table .icon-btn svg { width: 18px; height: 18px; }
.icon-btn.danger { color: var(--inion-red); }
.icon-btn.danger:hover { background: var(--inion-red-soft); }
.admin-table tr.child-row > td { padding: 0; border-top: 0; }
.admin-table tr.child-row:hover { background: transparent; }
.child-panel { margin: 0 20px 16px 64px; border: 1px solid var(--inion-border); border-radius: 12px; overflow: hidden; background: #fbfdff; }
.child-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: #f1f7fd; }
.child-table { min-width: 640px; }
.child-table th { background: transparent; }
.child-table td { padding: 10px 16px; }
.per-page { display: flex; align-items: center; gap: 8px; margin: 0; }
.per-page select { border: 1px solid var(--inion-border); border-radius: 8px; padding: 4px 8px; background: #fff; font: inherit; }
.date-pick { display: flex; align-items: center; gap: 8px; border: 1px solid var(--inion-border); border-radius: 10px; padding: 0 12px; height: 44px; background: #fff; box-shadow: 0 3px 8px rgba(15,23,42,.08); color: var(--inion-muted); }
.date-pick input { border: 0; outline: 0; background: transparent; font: inherit; color: var(--inion-text); }
#adminDayApp .table-card { margin-top: 20px; }
.admin-table .chip { white-space: nowrap; }
/* ---- Admin forms: centred dialogs (Create / Edit Institute and Device) ---- */
.admin-modal { font-family: var(--inion-font); color: var(--inion-text); }
.admin-modal .modal-dialog { max-width: 760px; }
.admin-modal .modal-content { border: 0; border-radius: 20px; box-shadow: 0 24px 60px rgba(15, 23, 42, .25); overflow: hidden; }
.admin-modal .am-form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow: hidden; } /* the form sits between .modal-content and .modal-body, so it passes the height on for scrolling */
.admin-modal .am-head { display: flex; align-items: flex-start; gap: 14px; padding: 22px 24px 18px; background: linear-gradient(135deg, #eaf6ff, #f5f3ff); border-bottom: 1px solid var(--inion-border); }
.admin-modal .am-head .btn-close { margin-left: auto; }
.admin-modal .am-icon { width: 44px; height: 44px; border-radius: 12px; flex: none; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--inion-blue), #6366f1); }
.admin-modal .am-title { margin: 0; font-size: 1.25rem; font-weight: 700; }
.admin-modal .am-sub { margin: 2px 0 0; color: var(--inion-muted); font-size: .9rem; }
.admin-modal .modal-body { padding: 22px 24px; }
.admin-modal .photo-pick { display: flex; align-items: center; gap: 18px; padding: 14px 16px; border: 1px dashed #bcdcf5; border-radius: 14px; background: #f8fbff; margin-bottom: 20px; }
.admin-modal .photo-pick .photo { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; flex: none; border: 3px solid #fff; box-shadow: 0 4px 12px rgba(15, 23, 42, .12); background: #fff; }
.admin-modal .photo-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.admin-modal .photo-actions .btn-outline { padding: 6px 14px; font-size: .88rem; cursor: pointer; margin: 0; }
.btn-outline.red { color: var(--inion-red); border-color: #f87171; }
.btn-outline.red:hover { background: var(--inion-red-soft); }
.admin-modal .am-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.admin-modal .am-wide { grid-column: 1 / -1; }
.admin-modal .form-label { font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.admin-modal .form-control, .admin-modal .form-select { height: 44px; border-radius: 10px; border-color: var(--inion-border); font: inherit; }
.admin-modal .form-control:focus, .admin-modal .form-select:focus { border-color: var(--inion-blue); box-shadow: 0 0 0 3px rgba(29, 161, 242, .18); }
.admin-modal .form-control[readonly] { background: #f1f5f9; }
.admin-modal .am-hint { margin: 14px 0 0; color: var(--inion-muted); font-size: .85rem; }
.admin-modal .am-for { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.admin-modal .am-for-name { border: 0; background: #e0f2fe; color: var(--inion-blue-dark); font-weight: 600; border-radius: 999px; padding: 4px 14px; outline: 0; min-width: 0; flex: 1; max-width: 100%; }
.admin-modal .am-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--inion-border); background: #fbfdff; }
.admin-modal .am-foot .btn-inion { width: auto; padding: 0 22px; height: 42px; }
.admin-modal .am-foot .btn-outline { height: 42px; padding: 0 20px; }
@media (max-width: 640px) { .admin-modal .am-grid { grid-template-columns: 1fr; } .admin-modal .photo-pick { flex-direction: column; text-align: center; } .admin-modal .photo-actions { justify-content: center; } }
/* ---- Admin: Institutes page (period filter, score bars) ---- */
.custom-range { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.custom-range[hidden] { display: none; }
.toolbar .btn-apply { width: auto; height: 44px; padding: 0 20px; font-size: 1rem; }
.period-label { margin: 14px 2px 12px; font-weight: 600; }
.score-cell { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.score-bar { flex: 1; max-width: 120px; height: 8px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
.score-bar > span { display: block; height: 100%; border-radius: inherit; background: var(--inion-blue); }
.score-cell.good .score-bar > span { background: #22c55e; }
.score-cell.mid .score-bar > span { background: #f59e0b; }
.score-cell.low .score-bar > span { background: #ef4444; }
.score-num { font-weight: 700; min-width: 42px; }
.inst-table tr.marked { background: #eaf6ff; box-shadow: inset 4px 0 0 var(--inion-blue); }
.admin-table .btn-view { display: inline-flex; align-items: center; gap: 6px; }
.sim-dialog { width: min(640px, 94vw); }
.sim-dialog .table-scroll { max-height: 60vh; overflow: auto; border: 1px solid #e2e8f0; border-radius: 12px; }
.sim-dialog .sim-table { margin: 0; min-width: 0; }
.sim-dialog .sim-table th, .sim-dialog .sim-table td { padding: 12px 16px; }
/* ---- Admin Export PDF ---- */
.ex-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.ex-dates[hidden] { display: none; }
#instApp .toolbar .btn-export { margin-left: auto; }
