:root {
  --theme: #1F3A5F;          /* Wealthforce navy - same as the fax app */
  --theme-dark: #162B47;
  --theme-light: #E8EEF6;
  --text: #242424;
  --text-2: #616161;
  --line: #E0E0E0;
  --bg: #FAF9F8;
  --red: #C50F1F;
  --red-bg: #FDE7E9;
  --green: #107C10;
  --green-bg: #DFF6DD;
  --amber: #8A5A00;
  --amber-bg: #FFF4CE;
  --radius: 4px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif;
       font-size: 14px; color: var(--text); background: var(--bg); }
[hidden] { display: none !important; }
h1 { font-size: 24px; font-weight: 600; margin: 0; }
h2 { font-size: 16px; font-weight: 600; margin: 0 0 12px; }
h3 { font-size: 14px; font-weight: 600; margin: 0 0 8px; }
a { color: var(--theme); }
.muted { color: var(--text-2); }
.small { font-size: 12px; }

/* App bar (same as the fax app) */
.appbar { height: 64px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center;
          gap: 16px; padding: 0 32px; }
.logo { height: 24px; width: auto; display: block; }
.appbar-divider { width: 1px; height: 26px; background: #C8C6C4; }
.appbar-product { font-size: 18px; font-weight: 600; color: var(--theme); }
.appbar-spacer { flex: 1; }
.hub-link { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-weight: 600; padding: 6px 10px;
            border-radius: var(--radius); }
.hub-link:hover { background: var(--theme-light); }
.hub-link svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.appbar-user { display: flex; align-items: center; gap: 12px; }
.appbar-user .who { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
.appbar-user .who span { font-size: 12px; color: var(--text-2); }
.persona { width: 32px; height: 32px; border-radius: 50%; background: var(--theme-light); color: var(--theme);
           display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; }
@media (max-width: 700px) { .appbar { padding: 0 14px; gap: 10px; } .appbar-user .who { display: none; } .appbar-divider { display: none; } }
body.embedded .appbar { display: none; }

.page { max-width: 1280px; margin: 0 auto; padding: 20px 32px 48px; }
@media (max-width: 560px) { .page { padding: 14px 12px 40px; } }

/* Pivot (tabs) */
.pivot { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.pivot a { text-decoration: none; padding: 10px 12px; color: var(--text-2); position: relative; }
.pivot a.active { color: var(--text); font-weight: 600; }
.pivot a.active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 3px; background: var(--theme); border-radius: 2px; }
.pivot .sep { width: 1px; background: var(--line); margin: 8px 6px; }
.subnav { display: flex; gap: 6px; margin: -4px 0 16px; flex-wrap: wrap; }
.subnav a { text-decoration: none; padding: 5px 12px; border-radius: 14px; color: var(--text); background: #fff; border: 1px solid var(--line); }
.subnav a.active { background: var(--theme); color: #fff; border-color: var(--theme); }

/* Buttons and inputs */
.btn { font: inherit; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 16px; min-height: 32px;
       border-radius: var(--radius); border: 1px solid #D1D1D1; background: #fff; cursor: pointer; font-weight: 600;
       color: var(--text); text-decoration: none; white-space: nowrap; }
.btn:hover { background: #F5F5F5; }
.btn.primary { background: var(--theme); border-color: var(--theme); color: #fff; }
.btn.primary:hover { background: var(--theme-dark); }
.btn.danger { color: var(--red); }
.btn.subtle { font-weight: 400; min-height: 28px; padding: 3px 12px; }
.btn.small { min-height: 26px; padding: 2px 10px; font-size: 13px; font-weight: 400; }
.btn:disabled { opacity: .5; cursor: default; }
.link { background: none; border: none; padding: 0; font: inherit; color: var(--theme); text-decoration: underline; cursor: pointer; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.field small { display: block; margin-top: 4px; color: var(--text-2); font-size: 12px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search],
input:not([type]), select, textarea {
  width: 100%; font: inherit; padding: 6px 8px; border: 1px solid #D1D1D1; border-bottom-color: #616161;
  border-radius: var(--radius); background: #fff; color: var(--text); }
input:focus, textarea:focus, select:focus { outline: none; border-bottom: 2px solid var(--theme); }
textarea { resize: vertical; min-height: 64px; line-height: 1.4; }
.check { display: flex; align-items: flex-start; gap: 8px; margin: 4px 0 12px; cursor: pointer; }
.check input { width: 16px; height: 16px; margin-top: 1px; accent-color: var(--theme); flex: none; }
.check small { display: block; color: var(--text-2); }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 160px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 700px) { .grid2 { grid-template-columns: 1fr; } }

/* Cards */
.card { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 18px 20px; margin-bottom: 16px; }
.card.flush { padding: 0; overflow-x: auto; }
.signin { max-width: 440px; margin: 40px auto; }
.signin h1 { margin-bottom: 8px; }
.signin .btn { margin-top: 8px; }
.title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.title-row h1 { flex: 1; min-width: 200px; }
.lead { margin: 4px 0 18px; color: var(--text-2); }
.badge { background: var(--amber-bg); color: var(--amber); font-size: 12px; padding: 3px 8px; border-radius: 10px; }

/* Message bar */
.msgbar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--radius); margin-bottom: 12px; background: #F3F2F1; }
.msgbar.error { background: var(--red-bg); color: #8A0E19; }
.msgbar.success { background: var(--green-bg); color: #0E5C0E; }
.msgbar span { flex: 1; }
.msgbar-x { background: none; border: none; font-size: 20px; line-height: 1; cursor: pointer; color: inherit; }
.note { background: #F7F9FC; border: 1px solid var(--line); border-radius: 6px; padding: 10px 14px; margin: 0 0 14px; }
.note.warn { background: var(--amber-bg); border-color: #F1D79A; color: #5C4300; }

/* Pills */
.pill { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.ok { background: var(--green-bg); color: var(--green); }
.pill.bad { background: var(--red-bg); color: var(--red); }
.pill.warn { background: var(--amber-bg); color: var(--amber); }
.pill.wait { background: var(--theme-light); color: var(--theme); }
.pill.muted { background: #F0F0F0; color: var(--text-2); }

/* My training */
.section-title { display: flex; align-items: baseline; gap: 10px; margin: 22px 0 10px; }
.section-title h2 { margin: 0; }
.tasks { display: grid; gap: 10px; }
.task { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--theme); border-radius: 6px;
        padding: 14px 16px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: center; }
.task.overdue { border-left-color: var(--red); }
.task.due_soon { border-left-color: #C19C00; }
.task.done { border-left-color: var(--green); }
.task.locked { border-left-color: #C8C6C4; background: #FBFBFB; }
.task .t-title { font-weight: 600; font-size: 15px; }
.task .t-meta { display: flex; gap: 8px 14px; flex-wrap: wrap; align-items: center; color: var(--text-2); font-size: 13px; margin-top: 4px; }
.task .series { font-size: 12px; color: var(--theme); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.steps-mini { display: inline-flex; gap: 4px; align-items: center; }
.steps-mini i { width: 22px; height: 6px; border-radius: 3px; background: #E1DFDD; display: inline-block; }
.steps-mini i.on { background: var(--green); }
.empty { text-align: center; color: var(--text-2); padding: 26px 0; }
@media (max-width: 600px) { .task { grid-template-columns: 1fr; } }

/* Course player */
.back { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; margin-bottom: 10px; font-size: 13px; }
.stepper { display: flex; gap: 0; margin: 14px 0 16px; background: #fff; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.stepper button { flex: 1; font: inherit; border: none; background: none; padding: 12px 10px; cursor: pointer; display: flex;
                  align-items: center; gap: 8px; justify-content: center; color: var(--text-2); border-right: 1px solid var(--line); }
.stepper button:last-child { border-right: none; }
.stepper button:disabled { cursor: default; opacity: .55; }
.stepper button.active { background: var(--theme-light); color: var(--theme); font-weight: 600; }
.stepper .num { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid currentColor; display: inline-flex;
                align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex: none; }
.stepper .done .num { background: var(--green); border-color: var(--green); color: #fff; }
.player-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .player-layout { grid-template-columns: 1fr; } }
.lesson-list { list-style: none; margin: 0; padding: 0; }
.lesson-list li { border-bottom: 1px solid #F0F0F0; }
.lesson-list li:last-child { border-bottom: none; }
.lesson-list button { width: 100%; text-align: left; font: inherit; background: none; border: none; padding: 10px 6px; cursor: pointer;
                      display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: start; border-radius: 4px; }
.lesson-list button:hover { background: #F5F5F5; }
.lesson-list button.active { background: var(--theme-light); }
.lesson-list .ic { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid #8A8886; display: inline-flex; align-items: center;
                   justify-content: center; font-size: 11px; color: #fff; margin-top: 1px; }
.lesson-list .ic.done { background: var(--green); border-color: var(--green); }
.lesson-list small { display: block; color: var(--text-2); }
video.lesson-video { width: 100%; max-height: 70vh; background: #000; border-radius: 6px; display: block; }
iframe.doc-frame { width: 100%; height: 72vh; border: 1px solid var(--line); border-radius: 6px; background: #F3F2F1; }
.watchbar { height: 8px; background: #E1DFDD; border-radius: 4px; overflow: hidden; margin: 10px 0 6px; }
.watchbar i { display: block; height: 100%; background: var(--green); width: 0; transition: width .4s; }
.lesson-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.lesson-foot .grow { flex: 1; }

/* Quiz */
.q { border-top: 1px solid var(--line); padding: 14px 0 6px; }
.q:first-of-type { border-top: none; }
.q .qt { font-weight: 600; margin-bottom: 8px; display: flex; gap: 8px; }
.q .qn { color: var(--text-2); flex: none; }
.q label.opt { display: flex; gap: 10px; align-items: flex-start; padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px;
               margin: 0 0 6px; cursor: pointer; background: #fff; }
.q label.opt:hover { border-color: #A19F9D; }
.q label.opt input { margin-top: 2px; accent-color: var(--theme); flex: none; }
.q.wrong { background: #FFF8F8; margin: 0 -20px; padding-left: 20px; padding-right: 20px; }
.q .why { margin: 6px 0 8px; padding: 8px 12px; background: var(--red-bg); color: #6B0A14; border-radius: 6px; font-size: 13px; }
.q .why b { display: block; }
.score { font-size: 32px; font-weight: 700; }
.score.pass { color: var(--green); }
.score.fail { color: var(--red); }

/* Attestation */
.attest-text { background: #F7F9FC; border: 1px solid var(--line); border-left: 4px solid var(--theme); border-radius: 6px;
               padding: 14px 16px; line-height: 1.55; white-space: pre-wrap; margin-bottom: 16px; }
.done-box { text-align: center; padding: 26px 10px; }
.done-box .tick { width: 56px; height: 56px; border-radius: 50%; background: var(--green); color: #fff; font-size: 30px;
                  display: inline-flex; align-items: center; justify-content: center; margin-bottom: 10px; }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 600; font-size: 13px; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 14px; border-bottom: 1px solid #F0F0F0; vertical-align: top; }
tr:last-child td { border-bottom: none; }
td .sub { display: block; font-size: 12px; color: var(--text-2); }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #FAFAFA; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }

/* Dashboard */
.tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
@media (max-width: 900px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } } @media (max-width: 560px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tile { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; cursor: pointer; text-align: left; font: inherit; }
.tile:hover { border-color: #A19F9D; }
.tile.active { outline: 2px solid var(--theme); }
.tile b { display: block; font-size: 26px; font-weight: 700; line-height: 1.2; }
.tile span { color: var(--text-2); font-size: 13px; }
.tile.red b { color: var(--red); }
.tile.amber b { color: #8A6D00; }
.tile.green b { color: var(--green); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; background: #fff; border: 1px solid var(--line);
           border-radius: 6px; padding: 8px 10px; margin-bottom: 12px; }
.filters input[type=search] { width: 240px; }
.filters select { width: auto; max-width: 280px; }
.filters .grow { flex: 1; }

/* Course editor */
.ed-section { margin-bottom: 16px; }
.ed-lesson, .ed-q { border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; margin-bottom: 10px; background: #FCFCFC; }
.ed-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ed-head .grow { flex: 1; font-weight: 600; }
.icon-btn { width: 30px; height: 30px; border: none; background: none; border-radius: var(--radius); cursor: pointer; color: var(--text); font-size: 15px; }
.icon-btn:hover:not(:disabled) { background: #F3F2F1; }
.icon-btn:disabled { opacity: .3; cursor: default; }
.opt-row { display: grid; grid-template-columns: 28px 1fr 30px; gap: 6px; align-items: center; margin-bottom: 6px; }
.opt-row input[type=radio] { accent-color: var(--green); width: 18px; height: 18px; }
.upload-bar { height: 6px; background: #E1DFDD; border-radius: 3px; overflow: hidden; margin-top: 6px; }
.upload-bar i { display: block; height: 100%; background: var(--theme); width: 0; }
.radio-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
@media (max-width: 700px) { .radio-cards { grid-template-columns: 1fr; } }
.radio-cards label { border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; cursor: pointer; display: flex; gap: 8px; background: #fff; }
.radio-cards label.on { border-color: var(--theme); background: var(--theme-light); }
.radio-cards input { accent-color: var(--theme); margin-top: 2px; }
.radio-cards small { display: block; color: var(--text-2); font-weight: 400; }
.save-bar { position: sticky; bottom: 0; background: rgba(250,249,248,.96); border-top: 1px solid var(--line); padding: 10px 0;
            display: flex; gap: 8px; align-items: center; z-index: 4; }
.save-bar .grow { flex: 1; }

/* Dialogs */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; z-index: 10; }
.dialog { background: #fff; border-radius: 8px; padding: 22px 24px; width: 520px; max-width: calc(100% - 24px); max-height: 90vh; overflow-y: auto;
          box-shadow: 0 8px 32px rgba(0,0,0,.25); }
.dialog.wide { width: 760px; }
.dialog h2 { margin-bottom: 14px; }
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.pick-list { max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px; }
.pick-list .check { margin: 6px 0; }
pre.csv { background: #F7F7F7; padding: 8px 10px; border-radius: 4px; font-size: 12px; overflow-x: auto; }

@media print {
  .appbar, .pivot, .subnav, .filters, .btn, .row-actions, .save-bar { display: none !important; }
  body { background: #fff; }
  .card { border: none; }
}

/* Folders (a series of modules) */
.task.folder { grid-template-columns: 1fr; }
.task .series svg { vertical-align: -3px; }
.modules { list-style: none; margin: 4px 0 0; padding: 0; border-top: 1px solid #F0F0F0; }
.modules li.module { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 0;
                     border-bottom: 1px solid #F5F5F5; }
.modules li.module:last-child { border-bottom: none; }
.modules li.locked { opacity: .6; }
.modules .ic { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid #8A8886; display: inline-flex; align-items: center;
               justify-content: center; font-size: 11px; font-weight: 700; color: var(--text-2); }
.modules .ic.done { background: var(--green); border-color: var(--green); color: #fff; }
.modules .m-title small { display: block; color: var(--text-2); font-size: 12px; }
.folder-card { margin-bottom: 16px; }
.folder-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.folder-head .grow { flex: 1; min-width: 220px; }
.folder-ic { width: 34px; height: 34px; border-radius: 6px; background: var(--theme-light); color: var(--theme); display: inline-flex;
             align-items: center; justify-content: center; }
.folder-ic svg { width: 20px !important; height: 20px !important; }
tr.group-row td { background: #FBFCFE; }
tr.child-row td:nth-child(2) { padding-left: 32px; }
tr.child-row td { background: #FDFDFD; font-size: 13px; }

/* CE credits */
.ce-lines { display: grid; gap: 10px; margin-top: 14px; }
.ce-line { display: grid; grid-template-columns: 220px minmax(0, 1fr) 90px; gap: 12px; align-items: center; }
.ce-line .watchbar { margin: 0; }
.ce-line .num { text-align: right; font-weight: 600; }
.ce-line.sub .lbl { padding-left: 16px; color: var(--text-2); }
@media (max-width: 600px) { .ce-line { grid-template-columns: 1fr 70px; } .ce-line .watchbar { grid-column: 1 / -1; grid-row: 2; } }
.tiles.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.eo-status { display: grid; gap: 6px; border-left: 4px solid var(--green, #107C10); }
.eo-status.warn { border-left-color: #C19C00; }
.eo-status.bad { border-left-color: var(--red); }
.eo-status p { margin: 0; }
.bad-text { color: var(--red); font-weight: 600; }
.eo-status .pill { justify-self: start; }
/* counts on tabs */
.count { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 6px; border-radius: 9px; background: var(--red); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; vertical-align: 1px; }
.subnav a.active .count { background: #fff; color: var(--red); }
/* bulletins */
.task.bulletin { border-left-color: #8764B8; }
.bulletin-body { white-space: pre-wrap; line-height: 1.55; font-size: 15px; }
.ok-note { background: var(--green-bg, #DFF6DD); color: var(--green, #107C10); }
/* documents */
.doc-card { display: grid; gap: 6px; border-left: 4px solid var(--green, #107C10); margin-bottom: 12px; }
.doc-card.warn { border-left-color: #C19C00; }
.doc-card.bad { border-left-color: var(--red); }
.doc-card p { margin: 0; }
.doc-head { display: flex; align-items: center; gap: 10px; }
.doc-head h2 { margin: 0; font-size: 16px; flex: 1; }
.doc-items { width: 100%; margin-top: 6px; font-size: 13px; }
.doc-items th { text-align: left; color: var(--text-2); font-weight: 600; padding: 4px 8px 4px 0; }
.doc-items td { padding: 6px 8px 6px 0; border-top: 1px solid var(--line); vertical-align: top; }
.doc-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
a.doc-type { text-decoration: none; color: inherit; display: grid; gap: 6px; }
a.doc-type:hover { border-color: var(--theme); }
.doc-counts { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; }
.pill.ce { background: #EFE6FA; color: #5C2E91; }
.ce-card { display: grid; gap: 6px; border-left: 4px solid var(--line); margin-bottom: 12px; }
.ce-card.ok { border-left-color: var(--green, #107C10); }
.ce-card.warn { border-left-color: #C19C00; }
.ce-card.bad { border-left-color: var(--red); }
.ce-card p { margin: 0; }
