/* internal.ai2n.ai — corporate learning portal. White, quiet, brand navy with an orange accent. */
:root {
  --navy: #102A43;
  --navy-2: #243B53;
  --ink: #1F2933;
  --muted: #627D98;
  --line: #E4E7EB;
  --soft: #F5F7FA;
  --orange: #E96224;
  --orange-soft: #FDF0EA;
  --green: #1F7A4D;
  --green-soft: #E8F5EE;
  --red: #B3261E;
  --red-soft: #FDECEA;
  --amber-soft: #FFF8E6;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 42, 67, .06), 0 4px 16px rgba(16, 42, 67, .06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: #fff; color: var(--ink); font: 15px/1.55 var(--font); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--navy); }
h1, h2, h3 { color: var(--navy); line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 28px; font-weight: 700; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 650; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
[hidden] { display: none !important; }

/* Top bar */
.topbar { border-bottom: 1px solid var(--line); background: #fff; position: sticky; top: 0; z-index: 10; }
.topbar-inner { max-width: 1200px; margin: 0 auto; padding: 0 24px; height: 64px; display: flex; align-items: center; gap: 32px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-logo { height: 30px; width: auto; }
.brand-divider { width: 1px; height: 24px; background: var(--line); }
.brand-name { font-weight: 650; color: var(--navy); font-size: 17px; letter-spacing: .01em; }
.mainnav { display: flex; gap: 4px; flex: 1; }
.mainnav a { text-decoration: none; color: var(--muted); padding: 8px 12px; border-radius: 6px; font-weight: 550; }
.mainnav a:hover { color: var(--navy); background: var(--soft); }
.mainnav a.active { color: var(--navy); box-shadow: inset 0 -2px 0 var(--orange); border-radius: 0; }
.usermenu { display: flex; align-items: center; gap: 12px; }
.user-name { color: var(--navy-2); font-weight: 550; }

.app { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 32px 24px 48px; }
.footer { border-top: 1px solid var(--line); }
.footer-inner { max-width: 1200px; margin: 0 auto; padding: 16px 24px; color: var(--muted); font-size: 13px; }

/* Buttons and forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 8px; padding: 10px 18px; font: 600 14px var(--font); cursor: pointer; text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--navy-2); }
.btn-accent { background: var(--orange); color: #fff; }
.btn-accent:hover:not(:disabled) { filter: brightness(.95); }
.btn-ghost { background: #fff; color: var(--navy); border-color: var(--line); }
.btn-ghost:hover:not(:disabled) { background: var(--soft); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-ms { background: #fff; color: #1F2933; border: 1px solid #C9D2DB; }
.btn-ms:hover { background: var(--soft); }
.ms-logo { width: 18px; height: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.ms-logo i { display: block; }
.ms-logo i:nth-child(1) { background: #F25022; } .ms-logo i:nth-child(2) { background: #7FBA00; }
.ms-logo i:nth-child(3) { background: #00A4EF; } .ms-logo i:nth-child(4) { background: #FFB900; }
label { display: block; font-weight: 600; color: var(--navy-2); font-size: 13px; margin: 0 0 6px; }
input[type=text], input[type=password], input[type=email], input[type=url], input[type=date], input[type=search], select {
  width: 100%; padding: 10px 12px; border: 1px solid #C9D2DB; border-radius: 8px; font: 15px var(--font); color: var(--ink); background: #fff;
}
input:focus, select:focus, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--orange); outline-offset: 1px; }
.field { margin-bottom: 16px; }
.error { color: var(--red); background: var(--red-soft); border-radius: 8px; padding: 10px 12px; font-size: 14px; margin-bottom: 12px; }
.notice { background: var(--amber-soft); border: 1px solid #F3D99B; color: #5C4813; border-radius: 8px; padding: 10px 14px; font-size: 14px; }
.success { color: var(--green); background: var(--green-soft); border-radius: 8px; padding: 10px 12px; font-size: 14px; }

/* Sign-in */
.auth-wrap { min-height: calc(100vh - 80px); display: grid; place-items: center; }
.auth-card { width: 100%; max-width: 420px; border: 1px solid var(--line); border-radius: 14px; padding: 36px; box-shadow: var(--shadow); background: #fff; }
.auth-logo { height: 36px; margin-bottom: 20px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 20px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Page header */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.eyebrow { color: var(--orange); font-weight: 700; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 6px; }

/* "Karpom Karpipom" motto */
.motto-line { color: var(--orange); font-weight: 700; margin: -4px 0 6px; font-size: 16px; }
.motto-line span { color: var(--navy-2); font-weight: 600; }
.motto { border-left: 4px solid var(--orange); background: #FFFBF8; border-radius: 0 var(--radius) var(--radius) 0; padding: 18px 22px; margin-bottom: 28px; }
.motto-ta { font-size: 22px; font-weight: 700; color: var(--navy); }
.motto-en { color: var(--orange); font-weight: 700; margin: 2px 0 10px; }
.motto p { color: var(--navy-2); margin: 0; max-width: 900px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 32px; }
.stat { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.stat b { display: block; font-size: 28px; color: var(--navy); }
.stat span { color: var(--muted); font-size: 13px; }

/* Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; background: #fff; display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: inherit; transition: box-shadow .15s, border-color .15s; }
a.card:hover { box-shadow: var(--shadow); border-color: #CBD2D9; }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card h3 { margin: 0; }
.card .meta { color: var(--muted); font-size: 13px; }
.tag { display: inline-block; font-size: 12px; font-weight: 650; color: var(--navy-2); background: var(--soft); border-radius: 999px; padding: 2px 10px; }
.tag-orange { background: var(--orange-soft); color: #9A3F12; }
.tag-green { background: var(--green-soft); color: var(--green); }
.tag-grey { background: #EEF1F4; color: var(--muted); }
.progress { height: 6px; background: #EEF1F4; border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--orange); }
.progress.done > i { background: var(--green); }
.section { margin-bottom: 40px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.empty { border: 1px dashed #CBD2D9; border-radius: var(--radius); padding: 28px; text-align: center; color: var(--muted); }

/* Catalogue filters */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 24px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 14px; font: 600 13px var(--font); color: var(--navy-2); cursor: pointer; }
.chip.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.filters input[type=search] { max-width: 280px; margin-left: auto; }

/* Module page */
.module-layout { display: grid; grid-template-columns: 300px 1fr; gap: 28px; align-items: start; }
.lesson-list { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; position: sticky; top: 84px; }
.lesson-list h3 { padding: 14px 16px; margin: 0; border-bottom: 1px solid var(--line); background: var(--soft); font-size: 14px; }
.lesson { display: flex; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); cursor: pointer; background: #fff; border-left: 3px solid transparent; width: 100%; text-align: left; font: inherit; color: inherit; border-top: 0; border-right: 0; }
.lesson:last-child { border-bottom: 0; }
.lesson:hover { background: var(--soft); }
.lesson.current { border-left-color: var(--orange); background: #FFFBF8; }
.lesson .tick { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #CBD2D9; flex: none; margin-top: 2px; display: grid; place-items: center; font-size: 12px; color: #fff; }
.lesson.done .tick { background: var(--green); border-color: var(--green); }
.lesson .lt { font-weight: 600; font-size: 14px; color: var(--navy); }
.lesson .lm { font-size: 12px; color: var(--muted); }
.player { background: #0B1A2A; border-radius: var(--radius); aspect-ratio: 16 / 9; overflow: hidden; display: grid; place-items: center; color: #D9E2EC; }
.player iframe, .player video { width: 100%; height: 100%; border: 0; display: block; }
.player-empty { text-align: center; padding: 24px; }
.player-empty b { color: #fff; display: block; margin-bottom: 6px; font-size: 17px; }
.player-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 14px 0 24px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tab { background: none; border: 0; padding: 10px 14px; font: 600 14px var(--font); color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.active { color: var(--navy); border-bottom-color: var(--orange); }
.side-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 24px; }
.obj-level { font-weight: 700; color: var(--orange); font-size: 12px; margin-top: 10px; }
ul.clean { margin: 6px 0 0; padding-left: 20px; }
ul.clean li { margin-bottom: 6px; }
.transcript { white-space: pre-wrap; background: var(--soft); border-radius: var(--radius); padding: 18px; max-height: 420px; overflow: auto; font-size: 14px; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; color: var(--muted); font-weight: 650; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--soft); }
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table-wrap { border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; }
.draft-banner { background: var(--amber-soft); border: 1px solid #F3D99B; color: #5C4813; border-radius: 8px; padding: 8px 14px; font-size: 13px; margin-bottom: 18px; }

/* Assessment */
.question { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 14px; }
.question .qh { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.question .qn { color: var(--orange); font-weight: 700; font-size: 13px; }
.question .qt { font-weight: 600; color: var(--navy); margin-bottom: 12px; }
.option { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; cursor: pointer; font-weight: 400; color: var(--ink); font-size: 15px; }
.option:hover { background: var(--soft); }
.option input { margin-top: 4px; }
.option.correct { border-color: var(--green); background: var(--green-soft); }
.option.wrong { border-color: var(--red); background: var(--red-soft); }
.why { font-size: 14px; color: var(--navy-2); background: var(--soft); border-radius: 8px; padding: 10px 12px; margin-top: 8px; }
.result-head { border-radius: 14px; padding: 24px 28px; margin-bottom: 24px; }
.result-head.pass { background: var(--green-soft); }
.result-head.fail { background: var(--red-soft); }
.result-head b { font-size: 34px; color: var(--navy); }
.sticky-submit { position: sticky; bottom: 0; background: rgba(255,255,255,.96); border-top: 1px solid var(--line); padding: 14px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; }

/* Admin */
.admin-tabs { margin-bottom: 24px; }
.toggle { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--navy-2); margin: 0; }
.row-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; align-items: end; }
.checklist { max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.checklist label { font-weight: 400; color: var(--ink); font-size: 14px; display: flex; gap: 8px; align-items: center; margin: 4px 0; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.log { font-family: Consolas, monospace; font-size: 12px; background: var(--soft); border-radius: 8px; padding: 10px; max-height: 220px; overflow: auto; white-space: pre-wrap; }

@media (max-width: 860px) {
  .module-layout, .two-col, .side-cards { grid-template-columns: 1fr; }
  .lesson-list { position: static; }
  /* Navigation drops to its own scrollable row rather than disappearing. */
  .topbar-inner { height: auto; flex-wrap: wrap; gap: 8px 12px; padding: 10px 16px; }
  .mainnav { order: 3; flex: 1 0 100%; overflow-x: auto; }
  .mainnav a { white-space: nowrap; }
  .usermenu { margin-left: auto; }
  .user-name, .brand-name, .brand-divider { display: none; }
  .app { padding: 24px 16px 40px; }
  .filters input[type=search] { max-width: none; margin-left: 0; }
}
