:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #eef3f7;
  --ink: #17202a;
  --muted: #667085;
  --line: #d7dee7;
  --brand: #1666a8;
  --brand-2: #0f8b8d;
  --accent: #d99824;
  --success: #237a57;
  --danger: #b42318;
  --shadow: 0 10px 28px rgba(16, 24, 40, 0.08);
  --radius: 8px;
  --sidebar: 284px;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(115deg, rgba(22, 102, 168, 0.08) 0 18%, transparent 18% 100%),
    linear-gradient(180deg, #f7fafc 0%, #eef4f8 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

a {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
}

.sidebar {
  background: #102a43;
  color: #fff;
  min-height: 100vh;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 0;
}

.brand-lockup {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 4px 0 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #ffffff, #d9eef7);
  color: var(--brand);
  font-weight: 800;
}

.brand-lockup h1 {
  font-size: 18px;
  line-height: 1.12;
  margin: 0;
}

.brand-lockup p {
  margin: 2px 0 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.76);
}

.profile-chip {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #d99824;
  color: #111827;
  font-weight: 800;
}

.profile-chip strong,
.profile-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}

.profile-chip span {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
  margin-top: 2px;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav button {
  min-height: 42px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.82);
  background: transparent;
  text-align: left;
  padding: 8px 10px;
}

.nav button:hover,
.nav button.active {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.sidebar-media {
  margin-top: auto;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-media img {
  width: 100%;
  height: 116px;
  object-fit: cover;
  display: block;
}

.logout-btn {
  min-height: 40px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-radius: 6px;
}

.content {
  min-width: 0;
  padding: 22px;
}

.topbar {
  min-height: 64px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

.topbar h2 {
  font-size: 24px;
  line-height: 1.2;
  margin: 0;
}

.topbar p {
  margin: 4px 0 0;
  color: var(--muted);
}

.button-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.btn {
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.btn.secondary {
  background: #e8eef5;
  color: #162436;
}

.btn.ghost {
  background: transparent;
  color: var(--brand);
  border: 1px solid var(--line);
}

.btn.warn {
  background: var(--accent);
  color: #111827;
}

.btn.danger {
  background: var(--danger);
}

.btn.success {
  background: var(--success);
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: #e8eef5;
  color: #162436;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel-pad {
  padding: 16px;
}

.panel-header {
  min-height: 58px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.panel-header h3 {
  margin: 0;
  font-size: 17px;
}

.panel-header span {
  color: var(--muted);
  font-size: 13px;
}

.metric {
  min-height: 112px;
  padding: 16px;
  border-left: 4px solid var(--brand);
}

.metric:nth-child(2) {
  border-left-color: var(--brand-2);
}

.metric:nth-child(3) {
  border-left-color: var(--accent);
}

.metric:nth-child(4) {
  border-left-color: var(--success);
}

.metric span {
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  font-size: 30px;
  margin-top: 8px;
}

.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 58%) minmax(360px, 42%);
  background:
    linear-gradient(115deg, rgba(22, 102, 168, 0.08) 0 18%, transparent 18% 100%),
    linear-gradient(180deg, #f7fafc 0%, #eef4f8 100%);
}

.auth-panel {
  grid-column: 2;
  width: min(450px, calc(100% - 44px));
  align-self: center;
  justify-self: center;
  background: rgba(255, 255, 255, 0.95);
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  border: 1px solid rgba(16, 42, 67, 0.08);
  border-radius: 8px;
  box-shadow: 0 26px 70px rgba(16, 24, 40, 0.14);
  overflow: hidden;
}

.auth-panel .brand-lockup {
  color: var(--ink);
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 14px;
  border-bottom: 1px solid #e6edf3;
  padding: 28px 30px 18px;
}

.auth-panel .brand-lockup p {
  color: var(--brand-2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: normal;
}

.auth-title {
  margin: 0;
  padding: 6px 30px 0;
  font-size: 26px;
  line-height: 1.15;
  font-weight: 800;
  color: #102a43;
}

.auth-media {
  grid-column: 1;
  grid-row: 1;
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(135deg, #102a43 0%, #133b5c 46%, #0f676b 100%);
  background-size: 46px 46px, 46px 46px, auto;
}

.auth-media::before {
  content: "MEETRA Digital Classroom";
  position: absolute;
  left: clamp(34px, 5vw, 72px);
  top: 31%;
  max-width: 720px;
  color: #fff;
  font-size: clamp(44px, 5.4vw, 72px);
  line-height: 0.98;
  font-weight: 800;
}

.auth-media::after {
  content: "Secure training operations for virtual classes, participant progress and institutional reporting.";
  position: absolute;
  left: clamp(34px, 5vw, 72px);
  top: calc(31% + 160px);
  max-width: 660px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 18px;
  line-height: 1.6;
}

.tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  background: #e8eef5;
  border-radius: 8px;
  margin: 18px 30px 16px;
}

.tabs button {
  flex: 1;
  min-height: 38px;
  border-radius: 6px;
  background: transparent;
  color: #344054;
}

.tabs button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
}

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

.auth-panel > .form-grid {
  padding: 0 30px 26px;
}

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.field label {
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  min-height: 40px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 8px 10px;
  color: var(--ink);
}

.field textarea {
  min-height: 92px;
  resize: vertical;
}

.help-row {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.program-list {
  display: grid;
  gap: 12px;
}

.program-card {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 14px;
  padding: 12px;
}

.program-card img {
  width: 150px;
  height: 112px;
  object-fit: cover;
  border-radius: 6px;
}

.program-card h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.program-card p {
  color: var(--muted);
  margin: 0 0 10px;
  line-height: 1.4;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e8eef5;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
}

.tag.green {
  background: #dff3ea;
  color: #145c40;
}

.tag.gold {
  background: #fff2d4;
  color: #764d00;
}

.tag.red {
  background: #fee4e2;
  color: #912018;
}

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

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-2), var(--success));
}

.session-grid {
  display: grid;
  gap: 10px;
}

.session-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.session-index {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e8eef5;
  font-weight: 800;
}

.session-row.locked {
  background: #f6f7f9;
  color: #697586;
}

.session-row.done .session-index {
  background: #dff3ea;
  color: #145c40;
}

.viewer {
  display: grid;
  gap: 14px;
}

.video-frame {
  min-height: 260px;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(16, 42, 67, 0.88), rgba(15, 139, 141, 0.78)),
    url("./assets/meetra-campus.jpg") center / cover;
  display: grid;
  place-items: center;
  color: #fff;
  text-align: center;
  padding: 22px;
}

.video-frame strong {
  display: block;
  font-size: 24px;
  margin-bottom: 8px;
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.resource-tile {
  min-height: 94px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  display: grid;
  align-content: space-between;
  background: #fff;
}

.resource-tile strong {
  display: block;
  margin-bottom: 6px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #eef3f7;
  font-size: 13px;
}

td.num,
th.num {
  text-align: right;
  white-space: nowrap;
}

.split {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  gap: 16px;
}

.empty-state {
  min-height: 180px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  padding: 20px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  max-width: min(420px, calc(100vw - 36px));
  min-height: 42px;
  display: none;
  align-items: center;
  padding: 10px 14px;
  border-radius: 8px;
  color: #fff;
  background: #102a43;
  box-shadow: var(--shadow);
}

.toast.show {
  display: flex;
}

.hidden {
  display: none !important;
}

.report-cover {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 14px;
  align-items: center;
}

.report-cover img {
  width: 180px;
  height: 118px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.certificate {
  border: 2px solid #102a43;
  padding: 24px;
  text-align: center;
  background: #fffdf8;
}

.certificate h3 {
  margin: 0 0 10px;
  font-size: 24px;
}

.certificate strong {
  color: var(--brand);
}

@media (max-width: 1040px) {
  .grid.cols-4,
  .grid.cols-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .split,
  .grid.cols-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    min-height: auto;
  }

  .sidebar-media {
    display: none;
  }

  .content {
    padding: 16px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .auth-wrap {
    grid-template-columns: 1fr;
  }

  .auth-panel {
    grid-column: 1;
    width: min(450px, calc(100% - 32px));
    margin: 24px auto;
  }

  .auth-media {
    display: none;
  }

  .program-card {
    grid-template-columns: 1fr;
  }

  .program-card img {
    width: 100%;
    height: 170px;
  }

  .resource-grid,
  .form-grid.two,
  .grid.cols-4,
  .grid.cols-3 {
    grid-template-columns: 1fr;
  }

  .session-row {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .session-row .button-row {
    grid-column: 1 / -1;
  }

  .report-cover {
    grid-template-columns: 1fr;
  }

  .report-cover img {
    width: 100%;
    height: 160px;
  }
}

@media print {
  body {
    background: #fff;
  }

  .sidebar,
  .topbar,
  .button-row,
  .toast,
  .no-print {
    display: none !important;
  }

  .app-shell {
    display: block;
  }

  .content {
    padding: 0;
  }

  .panel {
    box-shadow: none;
    border: 0;
  }
}
