* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #4f46e5;
  --primary-light: #eef2ff;
  --ink: #1e293b;
  --muted: #64748b;
  --bg: #f1f5f9;
  --card: #ffffff;
  --border: #e2e8f0;
  --green-light: #dcfce7;
}
body { font-family: -apple-system, 'Segoe UI', Roboto, Arial, sans-serif; background: var(--bg); color: var(--ink); min-height: 100vh; }

.topbar {
  height: 64px; background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 32px; gap: 40px;
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 18px; white-space: nowrap; }
.brand .logo {
  height: 40px; width: auto; max-width: 200px;
  object-fit: contain; flex-shrink: 0; display: block;
}
.brand .tag { font-size: 11px; font-weight: 600; background: var(--primary-light); color: var(--primary); padding: 3px 8px; border-radius: 20px; margin-left: 4px; }
.nav { display: flex; gap: 6px; flex: 1; }
.nav a { text-decoration: none; color: var(--muted); font-size: 14px; font-weight: 600; padding: 9px 16px; border-radius: 8px; }
.nav a.active { color: var(--primary); background: var(--primary-light); }
.user { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; }
.user a { color: var(--muted); font-size: 13px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #f59e0b, #ef4444); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }

.page { padding: 28px 40px; max-width: 1240px; margin: 0 auto; }
h1.pagetitle { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
p.pagesub { font-size: 14px; color: var(--muted); margin-bottom: 24px; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 24px; box-shadow: 0 1px 3px rgba(15,23,42,.05); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.step { font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--primary); text-transform: uppercase; margin-bottom: 8px; }
.card h3 { font-size: 17px; margin-bottom: 14px; }

.dropzone {
  border: 2px dashed #c7d2fe; border-radius: 10px; background: #f8faff;
  padding: 22px; text-align: center; margin-bottom: 14px; cursor: pointer;
}
.dropzone .icon { font-size: 30px; margin-bottom: 6px; }
.dropzone .fname { font-size: 14px; font-weight: 700; }
.dropzone .fmeta { font-size: 12px; color: var(--muted); margin-top: 2px; }

.btn {
  display: inline-block; background: var(--primary); color: #fff; border: none; border-radius: 8px;
  padding: 11px 22px; font-size: 14px; font-weight: 700; cursor: pointer; width: 100%; text-align: center;
}
.btn:disabled { opacity: .5; cursor: default; }
.btn.secondary { background: #fff; color: var(--primary); border: 1.5px solid var(--primary); width: auto; }
.btn.inline { width: auto; }
.btn.danger {
  background: #fff; color: #b91c1c; border: 1.5px solid #fecaca; width: auto;
}
.btn.danger:hover { background: #fef2f2; }

.card-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin-bottom: 18px; flex-wrap: wrap;
}
.card-head h3 { margin-bottom: 0; }

.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(15, 23, 42, .45);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.modal {
  background: #fff; border-radius: 14px; padding: 28px 28px 24px;
  max-width: 460px; width: 100%;
  box-shadow: 0 16px 44px rgba(15, 23, 42, .18);
}
.modal.modal-wide { max-width: 640px; }
.modal h2 { font-size: 18px; font-weight: 800; margin-bottom: 10px; }
.modal-body p { font-size: 14px; color: var(--muted); line-height: 1.55; margin: 0 0 12px; }
.modal-body p:last-child { margin-bottom: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.modal-table-wrap {
  max-height: 320px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; margin-top: 8px;
}
.modal-table-wrap table { margin: 0; }
.success a.import-link { color: #166534; text-decoration: underline; font-weight: 700; }
.add-learner-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin-bottom: 12px;
}
@media (max-width: 720px) {
  .add-learner-grid { grid-template-columns: 1fr; }
}
.success {
  margin-top: 14px; background: var(--green-light); color: #166534; font-size: 13px; font-weight: 600;
  border-radius: 8px; padding: 11px 14px; line-height: 1.45;
}
.error-box {
  margin-top: 14px; background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c;
  border-radius: 8px; padding: 11px 14px; font-size: 13px; font-weight: 600;
}

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--border); }
td { padding: 12px 14px; border-bottom: 1px solid #f1f5f9; font-weight: 500; }
tr:last-child td { border-bottom: none; }
.pill { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 20px; }
.pill.done { background: var(--green-light); color: #166534; }
.pill.progress { background: #fef3c7; color: #92400e; }
.pill.notstarted { background: #f1f5f9; color: var(--muted); }
.pill.you { background: var(--primary); color: #fff; margin-left: 8px; }
.pill.inactive { background: #fee2e2; color: #991b1b; }
tr.inactive-row td { color: var(--muted); }

.pbar { width: 170px; height: 9px; background: #e2e8f0; border-radius: 6px; overflow: hidden; display: inline-block; vertical-align: middle; }
.pbar > div { height: 100%; background: linear-gradient(90deg, #6366f1, #8b5cf6); border-radius: 6px; }
.pct { font-size: 13px; font-weight: 700; margin-left: 10px; }
.rank { font-size: 17px; }
tr.you-row { background: var(--primary-light); }
tr.clickable-row { cursor: pointer; }
tr.clickable-row:hover td { background: #f8fafc; }
tr.clickable-row td a { color: inherit; text-decoration: none; }
tr.clickable-row td a:hover { color: var(--primary); }

.pager {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 16px 14px 2px;
}
.pager-meta { font-size: 13px; color: var(--muted); }
.pager-controls { display: flex; align-items: center; gap: 10px; }
.pager-controls b { font-size: 13px; }

.learner-back { display: inline-block; margin-bottom: 16px; color: var(--muted); font-size: 14px; font-weight: 600; text-decoration: none; }
.learner-back:hover { color: var(--primary); }
.learner-profile { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 32px; }
.learner-profile dt { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.learner-profile dd { font-size: 15px; font-weight: 600; margin: 0 0 8px; }
.learner-progress-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; margin-bottom: 20px; }
.learner-stat { background: var(--bg); border-radius: 10px; padding: 14px 16px; }
.learner-stat .label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.learner-stat .value { font-size: 22px; font-weight: 800; }
.info-tip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%;
  font-size: 12px; font-weight: 700; letter-spacing: 0; text-transform: none;
  color: var(--primary); background: var(--primary-light); cursor: pointer;
  flex-shrink: 0; line-height: 1;
}
.info-tip:hover { background: #e0e7ff; }
.info-tip:focus { outline: 2px solid var(--primary); outline-offset: 2px; }
.info-list { margin: 0 0 12px 18px; padding: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.info-list li { margin-bottom: 4px; }
.info-list li:last-child { margin-bottom: 0; }

.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 55%, #ecfeff 100%);
  flex-direction: column; gap: 22px; padding: 24px;
}
.login-card { width: 100%; max-width: 480px; background: #fff; border-radius: 18px; padding: 40px 38px; box-shadow: 0 16px 44px rgba(79,70,229,.13); }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 26px; }
.login-brand .logo {
  width: min(320px, 100%); height: auto; max-height: 88px;
  object-fit: contain; display: block;
}
.login-brand h1 { font-size: 21px; margin-top: 4px; }
.login-brand p { font-size: 13.5px; color: var(--muted); text-align: center; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.field input { width: 100%; border: 1.5px solid var(--border); border-radius: 9px; padding: 12px 14px; font-size: 14px; }
.field input:focus { outline: none; border-color: var(--primary); }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 44px; }
.password-toggle {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; cursor: pointer; font-size: 16px;
  line-height: 1; padding: 6px; color: var(--muted); border-radius: 6px;
}
.password-toggle:hover { background: var(--bg); color: var(--ink); }
.password-toggle:focus { outline: 2px solid var(--primary-light); }
.footnote { font-size: 12.5px; color: var(--muted); text-align: center; }
.footnote a { color: var(--muted); }

.coursecard { display: flex; gap: 28px; align-items: center; max-width: 860px; padding: 28px; }
.thumb {
  width: 220px; flex-shrink: 0;
  border-radius: 12px; overflow: hidden;
  background: #fff; border: 1px solid var(--border);
}
.thumb img {
  width: 100%; height: auto; display: block;
}

/* Full-viewport SCORM player — courses (Storyline etc.) expect near-100vh */
body.playing { overflow: hidden; height: 100vh; height: 100dvh; background: #0f172a; }
.player-layout {
  display: flex; flex-direction: column;
  height: 100vh; height: 100dvh; overflow: hidden;
}
.player-layout .topbar {
  height: 48px; flex-shrink: 0; padding: 0 16px; gap: 16px;
}
.player-shell {
  flex: 1; min-height: 0; padding: 0;
  display: flex; flex-direction: column;
}
.player-frame {
  flex: 1; min-height: 0;
  background: #0f172a; border-radius: 0;
  box-shadow: none; overflow: hidden;
  position: relative;
}
.player-frame iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%; border: 0; background: #fff;
}
.player-fs-btn {
  border: 1px solid var(--border); background: #fff; color: var(--ink);
  border-radius: 8px; padding: 6px 12px; font-size: 13px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
}
.player-layout .topbar .brand .logo { height: 32px; max-width: 160px; }
.player-fs-btn:hover { background: var(--primary-light); color: var(--primary); }
.banner { margin-top: 18px; background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; border-radius: 12px; padding: 14px 20px; font-size: 14px; font-weight: 600; text-align: center; }
