:root {
  --ink: #111827;
  --muted: #64748b;
  --line: #d9e2ee;
  --surface: #ffffff;
  --soft: #f4f7fb;
  --navy: #102033;
  --blue: #2563eb;
  --green: #059669;
  --amber: #d97706;
  --red: #dc2626;
  --cyan: #0891b2;
  --violet: #7c3aed;
  --shadow: 0 14px 30px rgba(15, 23, 42, .09);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--soft);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background: var(--soft);
  font-family: Poppins, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
  letter-spacing: 0;
}

.app-shell,
.login-shell {
  width: min(100%, 448px);
  margin: 0 auto;
}

.app-shell {
  min-height: 100vh;
  padding: max(14px, env(safe-area-inset-top)) 14px calc(92px + env(safe-area-inset-bottom));
}

.login-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 18px;
}

.topbar,
.identity,
.section-head,
.hero-panel,
.hero-metrics,
.exam-title-row,
.exam-meta,
.data-row,
.mini-panel,
.profile-head,
.login-brand {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 2px 0;
}

.identity,
.login-brand {
  min-width: 0;
  gap: 10px;
}

.identity img,
.login-brand img {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: contain;
  background: #fff;
}

.identity div,
.login-brand div {
  min-width: 0;
}

.identity span,
.login-brand span,
.section-head p,
.hero-panel p,
.stat-card span,
.mini-panel span,
.exam-card small,
.data-row small,
.action-tile small,
.field-group > span:first-child,
.profile-item small,
.login-heading p {
  color: var(--muted);
  font-size: .7rem;
  font-weight: 800;
}

.identity strong,
.login-brand strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: .95rem;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  color: var(--ink);
  background: #fff;
}

.top-logout {
  flex: 0 0 auto;
}

.hero-panel {
  align-items: stretch;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  padding: 16px;
  border-radius: 8px;
  color: #fff;
  background: var(--navy);
  box-shadow: var(--shadow);
}

.hero-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.hero-panel p,
.hero-panel span {
  margin: 0;
  color: rgba(255, 255, 255, .74);
}

.hero-panel h1 {
  margin: 0;
  font-size: 1.42rem;
  line-height: 1.15;
}

.hero-panel h1 b {
  color: inherit;
  font: inherit;
}

.hero-metrics {
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.hero-metrics span {
  min-height: 28px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  color: rgba(255, 255, 255, .9);
  background: rgba(255, 255, 255, .08);
  font-size: .68rem;
  font-weight: 800;
  white-space: nowrap;
}

.hero-action,
.primary-button,
.secondary-button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 14px;
  font-weight: 800;
  cursor: pointer;
}

.hero-action {
  flex: 0 0 auto;
  align-self: center;
  color: var(--navy);
  background: #fff;
}

.hero-action span {
  color: inherit;
}

.primary-button {
  color: #fff;
  background: var(--blue);
}

.secondary-button {
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
}

.full-button {
  width: 100%;
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0 0 12px;
  padding: 10px 11px;
  border-radius: 8px;
  font-size: .8rem;
  font-weight: 700;
}

.alert-danger {
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.stat-card,
.section-block,
.exam-card,
.mini-panel,
.data-row,
.profile-item,
.login-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 22px rgba(15, 23, 42, .04);
}

.stat-card {
  min-width: 0;
  min-height: 94px;
  display: grid;
  align-content: space-between;
  gap: 6px;
  padding: 10px;
}

.stat-card i {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: .82rem;
}

.stat-card strong {
  display: block;
  font-size: 1.35rem;
  line-height: 1;
}

.tone-blue i,
.accent-blue span {
  background: var(--blue);
}

.tone-green i,
.accent-green span {
  background: var(--green);
}

.tone-amber i,
.accent-amber span {
  background: var(--amber);
}

.tone-red i,
.accent-red span {
  background: var(--red);
}

.tone-cyan i,
.accent-cyan span {
  background: var(--cyan);
}

.tone-violet i,
.accent-violet span {
  background: var(--violet);
}

.section-block {
  margin-bottom: 12px;
  padding: 14px;
}

.section-head {
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.section-head p {
  margin: 0 0 2px;
  text-transform: uppercase;
}

.section-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
}

.soft-pill,
.status-pill,
.score-chip {
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-weight: 800;
}

.soft-pill {
  min-height: 28px;
  padding: 0 9px;
  color: var(--muted);
  background: #f8fafc;
  border: 1px solid var(--line);
  font-size: .72rem;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.action-tile {
  min-width: 0;
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 10px;
  color: var(--ink);
  background: #fff;
}

.action-tile span {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
}

.action-tile strong {
  display: block;
  font-size: .82rem;
  line-height: 1.15;
}

.exam-list,
.data-list,
.compact-list {
  display: grid;
  gap: 9px;
}

.exam-card {
  overflow: hidden;
}

.exam-main {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.exam-title-row {
  justify-content: space-between;
  gap: 10px;
}

.exam-title-row strong,
.data-row-title {
  min-width: 0;
  margin: 0;
  font-weight: 800;
  line-height: 1.25;
}

.exam-title-row > span {
  flex: 0 0 auto;
}

.exam-card p,
.data-row-sub {
  margin: 0;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 650;
}

.exam-meta {
  flex-wrap: wrap;
  gap: 7px;
}

.exam-meta span {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 800;
}

.progress-line {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: #e5e7eb;
}

.progress-line span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.exam-footer {
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: #f8fafc;
}

.status-pill {
  min-height: 28px;
  padding: 0 9px;
  font-size: .72rem;
}

.status-primary {
  color: #1d4ed8;
  background: #dbeafe;
}

.status-success {
  color: #15803d;
  background: #dcfce7;
}

.status-warning {
  color: #92400e;
  background: #fef3c7;
}

.status-danger {
  color: #b91c1c;
  background: #fee2e2;
}

.status-muted {
  color: #475569;
  background: #e2e8f0;
}

.data-row {
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
}

.data-row > div {
  min-width: 0;
}

.data-row .progress-line {
  margin-top: 8px;
}

.score-chip {
  min-height: 36px;
  padding: 0 11px;
  color: #fff;
  background: var(--navy);
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.mini-panel {
  gap: 10px;
  padding: 12px;
}

.mini-panel i {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--blue);
}

.mini-panel strong {
  display: block;
  font-size: 1.1rem;
  line-height: 1.1;
}

.empty-state {
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 24px 14px;
  color: var(--muted);
  background: #f8fafc;
  text-align: center;
  font-weight: 750;
}

.empty-state i {
  color: #94a3b8;
  font-size: 1.45rem;
}

.profile-head {
  justify-content: space-between;
  gap: 12px;
}

.profile-head .section-head {
  margin-bottom: 0;
}

.profile-head small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 700;
}

.avatar {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--navy);
  font-weight: 900;
  font-size: 1.1rem;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.profile-item {
  padding: 11px;
  background: #fff;
}

.profile-item strong {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 30;
  width: min(100%, 448px);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 3px;
  padding: 7px 8px calc(9px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .98);
  border-top: 1px solid var(--line);
  box-shadow: 0 -10px 24px rgba(15, 23, 42, .06);
}

.bottom-nav a {
  min-width: 0;
  min-height: 50px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  gap: 2px;
  color: var(--muted);
  font-size: .64rem;
  font-weight: 800;
}

.bottom-nav i {
  font-size: 1rem;
}

.bottom-nav a.active {
  color: var(--blue);
  background: #dbeafe;
}

.login-card {
  width: min(100%, 420px);
  padding: 18px;
  box-shadow: var(--shadow);
}

.login-heading {
  margin: 18px 0;
}

.login-heading h1 {
  margin: 0;
  font-size: 1.55rem;
  line-height: 1.15;
}

.login-heading p {
  margin: 6px 0 0;
  font-size: .82rem;
  line-height: 1.45;
}

.form-stack {
  display: grid;
  gap: 12px;
}

.field-group {
  display: grid;
  gap: 6px;
}

.text-control {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

.text-control:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .14);
}

.login-note {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
}

.login-note i {
  color: var(--green);
  margin-top: 2px;
}

@media (max-width: 390px) {
  .stat-grid,
  .action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-panel {
    display: grid;
  }

  .hero-action {
    justify-self: start;
  }
}

@media (max-width: 360px) {
  .profile-grid,
  .mini-grid {
    grid-template-columns: 1fr;
  }

  .data-row {
    align-items: flex-start;
    display: grid;
  }
}
