/* Simrah organizations v2.16: the learner programme page, the organization workspace and the admin module.
   Mobile first. Uses the app's own colour variables, so light and dark themes both work. */
.og { max-width: 1120px; margin: 0 auto; padding: 0 0 96px; display: grid; gap: 18px; }
.og * { min-width: 0; }
.og h1, .og h2, .og h3, .og p { margin: 0; }
.og .og-muted { color: var(--muted); }
.og .og-small { font-size: .88rem; }
.og .eyebrow { margin: 0 0 4px; font-size: .74rem; letter-spacing: .1em; color: var(--teal); }

/* hero */
.og-hero { position: relative; overflow: hidden; display: grid; gap: 16px; padding: clamp(18px, 4vw, 30px); border-radius: 26px; color: #fff;
  background: radial-gradient(520px 260px at 90% -10%, color-mix(in srgb, var(--og-accent, #2dd4bf) 55%, transparent), transparent 70%), linear-gradient(135deg, #062a4a, #0b4a6b 60%, #0a6a73); box-shadow: var(--shadow-lg); }
.og-hero::after { content: ""; position: absolute; inset: auto -40px -60px auto; width: 220px; height: 220px; border-radius: 50%; border: 36px solid rgba(255,255,255,.06); pointer-events: none; }
.og-hero-top { display: flex; gap: 14px; align-items: center; }
.og-logo { width: clamp(64px, 16vw, 96px); height: clamp(64px, 16vw, 96px); flex: none; border-radius: 22px; background: #fff; padding: 8px; object-fit: contain; box-shadow: 0 8px 24px rgba(0,0,0,.25); display: grid; place-items: center; color: #062a4a; }
.og-logo svg { width: 55%; height: 55%; }
.og-hero h1 { font-size: clamp(1.45rem, 5.4vw, 2.3rem); line-height: 1.1; letter-spacing: -.02em; overflow-wrap: anywhere; }
.og-hero .og-sub { color: rgba(255,255,255,.82); margin-top: 4px; }
.og-hero .eyebrow { color: #7fe3de; }
.og-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.og-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; background: rgba(255,255,255,.14); font-size: .85rem; font-weight: 600; }
.og-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.og-hero .btn { min-height: 46px; }

/* ring + stats */
.og-ring { --p: 0; width: 76px; height: 76px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 1.05rem;
  background: conic-gradient(#ffc857 calc(var(--p) * 1%), rgba(255,255,255,.18) 0); position: relative; }
.og-ring::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: #0a3f5f; }
.og-ring span { position: relative; }
.og-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.og-stat { padding: 14px 12px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); display: grid; gap: 2px; }
.og-stat b { font-size: clamp(1.3rem, 5vw, 1.8rem); letter-spacing: -.02em; line-height: 1.1; }
.og-stat span { color: var(--muted); font-size: .82rem; }
@media (min-width: 760px) { .og-stats.four { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 520px) { .og-stats.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* sections */
.og-section { display: grid; gap: 12px; }
.og-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.og-head h2 { font-size: 1.25rem; letter-spacing: -.01em; }
.og-count { padding: 4px 12px; border-radius: 99px; background: var(--surface-2); font-size: .82rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.og-card { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: clamp(16px, 3.5vw, 22px); box-shadow: var(--shadow); display: grid; gap: 12px; align-content: start; }
.og-card.flat { box-shadow: none; }

/* resume */
.og-resume { display: grid; gap: 10px; padding: clamp(16px, 4vw, 24px); border-radius: 24px; background: linear-gradient(135deg, #fff7e6, #ffe9c2); color: #3a2a05; border: 1px solid #f3d08a; }
:root[data-theme="dark"] .og-resume { background: linear-gradient(135deg, #3a2a18, #2c2010); color: #ffe7bf; border-color: #5d4520; }
.og-resume .eyebrow { color: #a8670a; }
.og-resume h2 { font-size: clamp(1.2rem, 4.6vw, 1.7rem); letter-spacing: -.02em; }
.og-resume .btn { justify-self: start; min-height: 48px; }

/* subjects */
.og-subjects { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.og-course { display: grid; gap: 12px; align-content: start; padding: 16px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.og-course.done { border-color: color-mix(in srgb, var(--good) 50%, var(--border)); }
.og-course-top { display: flex; gap: 12px; align-items: flex-start; }
.og-ico { width: 42px; height: 42px; flex: none; border-radius: 14px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.og-course.done .og-ico { background: var(--good-soft); color: var(--good); }
.og-course h3 { font-size: 1.05rem; line-height: 1.25; overflow-wrap: anywhere; }
.og-tag { font-size: .76rem; font-weight: 700; color: var(--muted); }
.og-bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.og-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--teal), var(--primary)); transition: width .4s; }
.og-course.done .og-bar i { background: var(--good); }
.og-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.og-actions .btn { min-height: 44px; flex: 1 1 auto; justify-content: center; }
.og-actions .btn:first-child { flex-basis: 100%; }

/* tools */
.og-tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 10px; }
.og-tool { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none; min-height: 56px; }
.og-tool:hover { border-color: var(--primary); text-decoration: none; }
.og-tool .og-ico { width: 34px; height: 34px; border-radius: 11px; }
.og-tool b { font-size: .95rem; line-height: 1.2; }
.og-tool small { display: block; color: var(--muted); font-size: .76rem; }
.og-tool.locked { opacity: .65; }

/* strips */
.og-strip { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); flex-wrap: wrap; }
.og-strip > div { flex: 1 1 200px; display: grid; }
.og-strip small { color: var(--muted); }
.og-cert { grid-template-columns: 1fr; }
.og-cert-top { display: flex; align-items: center; gap: 12px; }
.og-pct { margin-left: auto; font-size: 1.5rem; font-weight: 800; color: var(--primary); }
.og-details { border: 1px dashed var(--border); border-radius: 16px; padding: 12px 14px; }
.og-details summary { cursor: pointer; font-weight: 700; }
.og-details p { margin-top: 8px; color: var(--muted); }

/* portal */
.og-two { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .og-two { grid-template-columns: 1fr 1fr; } }
.og-form { display: grid; gap: 10px; }
.og-form label { display: grid; gap: 4px; font-weight: 600; font-size: .9rem; }
.og-form .input { min-height: 46px; }
.og-notice { padding: 12px 14px; border-radius: 14px; background: var(--primary-soft); color: var(--text); display: grid; gap: 4px; font-size: .92rem; overflow-wrap: anywhere; }
.og-roster { display: grid; gap: 10px; }
.og-person { display: grid; gap: 10px; padding: 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); }
.og-person-top { display: flex; gap: 12px; align-items: center; }
.og-av { width: 42px; height: 42px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--teal), var(--primary)); }
.og-person b { display: block; overflow-wrap: anywhere; }
.og-person small { color: var(--muted); overflow-wrap: anywhere; }
.og-pill { padding: 3px 10px; border-radius: 99px; font-size: .74rem; font-weight: 700; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.og-pill.good { background: var(--good-soft); color: var(--good); }
.og-pill.warn { background: var(--accent-soft); color: #9a5b12; }
.og-empty { padding: 28px 16px; text-align: center; border: 1px dashed var(--border); border-radius: 20px; color: var(--muted); display: grid; gap: 8px; justify-items: center; }
.og-search { min-height: 46px; width: 100%; }

/* admin */
.og-adminhead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; }
.og-adminhead h1 { font-size: clamp(1.5rem, 5vw, 2.1rem); letter-spacing: -.02em; }
.og-orgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 14px; align-items: start; }
.og-org { display: grid; gap: 12px; padding: 18px; border-radius: 22px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.og-org-top { display: flex; gap: 12px; align-items: center; }
.og-org-logo { width: 54px; height: 54px; border-radius: 16px; object-fit: contain; background: #fff; border: 1px solid var(--border); padding: 4px; flex: none; display: grid; place-items: center; color: var(--primary); }
.og-org h3 { font-size: 1.05rem; line-height: 1.25; overflow-wrap: anywhere; }
.og-org-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.og-org-meta div { padding: 8px 10px; border-radius: 12px; background: var(--surface-2); display: grid; }
.og-org-meta b { font-size: 1.1rem; }
.og-org-meta small { color: var(--muted); font-size: .72rem; }
.og-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.og-btns .btn { min-height: 42px; }
.og-more { border-top: 1px solid var(--border); padding-top: 10px; }
.og-more summary { cursor: pointer; font-weight: 700; color: var(--primary); list-style: none; }
.og-more summary::-webkit-details-marker { display: none; }
.og-more .og-btns { margin-top: 10px; }
.og-steps { display: grid; gap: 14px; }
.og-step { border: 1px solid var(--border); border-radius: 20px; padding: 16px; margin: 0; display: grid; gap: 12px; background: var(--surface); }
.og-step > legend { padding: 0 8px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.og-step > legend i { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--primary); color: var(--primary-ink); font-style: normal; font-size: .82rem; }
.og-formwrap { display: grid; gap: 14px; }
.og-formwrap[hidden] { display: none; }

@media (max-width: 520px) {
  .og-stats { gap: 8px; } .og-stat { padding: 12px 10px; }
  .og-ring { width: 64px; height: 64px; }
  .og-hero { border-radius: 22px; }
}
@media (prefers-reduced-motion: reduce) { .og-bar i { transition: none; } }
.og .stack-s { display: grid; gap: 6px; }
.og-chips-dark { line-height: 1.5; }
.og-formwrap .field { display: grid; gap: 6px; font-weight: 600; }
.og-formwrap .input, .og-formwrap select { min-height: 46px; width: 100%; }
.og-features { grid-template-columns: 1fr !important; margin-top: 10px; }
@media (min-width: 900px) { .og-features { grid-template-columns: 1fr 1fr !important; } }
.og-features h4 { grid-column: 1 / -1; margin: 10px 0 0; font-size: .82rem; color: var(--muted); }
.og-features .check-row > span { display: grid; gap: 2px; min-width: 0; }
.og-features .check-row small { display: block; font-weight: 400; line-height: 1.4; max-height: 6.2em; overflow: hidden; }

/* ===== v2.17 Organization workspace (administrator app) ===== */
.oa-main { padding: 0 !important; max-width: none !important; min-height: 100dvh; background: var(--bg); }
.oa { min-height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; max-width: 760px; margin: 0 auto; }
.oa * { min-width: 0; }
.oa h1, .oa h2, .oa h3, .oa p, .oa dl, .oa dd { margin: 0; }
.oa-bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: linear-gradient(135deg, #062a4a, #0a4a6b); color: #fff; }
.oa-bar b { display: block; font-size: 1rem; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oa-bar small { color: rgba(255,255,255,.72); font-size: .76rem; }
.oa-bar .icon-btn { color: #fff; background: rgba(255,255,255,.12); }
.oa-bar-logo { width: 40px; height: 40px; flex: none; border-radius: 12px; background: #fff; padding: 4px; object-fit: contain; display: grid; place-items: center; color: #0a4a6b; }
.oa-bar-logo svg { width: 22px; height: 22px; }
.oa-body { padding: 16px 16px calc(104px + env(safe-area-inset-bottom)); }
.oa-stack { display: grid; gap: 14px; align-content: start; }
.oa-title { font-size: 1.5rem; letter-spacing: -.02em; line-height: 1.15; }
.oa-h { font-size: 1.05rem; letter-spacing: -.01em; }
.oa-hero { padding: 18px; border-radius: 24px; }
.oa-hero .og-logo { width: 56px; height: 56px; border-radius: 16px; }
.oa-hero h1 { font-size: 1.35rem; }
.oa-more { border: 0; background: none; color: var(--primary); font-weight: 700; font: inherit; font-weight: 700; padding: 6px 2px; }
.oa-quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.oa-q { display: grid; justify-items: center; gap: 6px; padding: 12px 4px; border-radius: 18px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: .76rem; font-weight: 700; text-align: center; min-height: 84px; }
.oa-q span { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 14px; background: var(--primary-soft); color: var(--primary); }
.oa-q:active { transform: scale(.97); }
.oa-todo { display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 14px; border-radius: 18px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; width: 100%; min-height: 64px; }
.oa-todo > span:nth-child(2) { flex: 1; display: grid; gap: 2px; }
.oa-todo small { color: var(--muted); }
.oa-todo.warn { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); background: color-mix(in srgb, var(--accent) 9%, var(--surface)); }
.oa-list { gap: 0; padding: 4px 14px; }
.oa-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.oa-row:last-child { border: 0; }
.oa-row b { display: block; font-size: .92rem; margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oa-pct { font-weight: 800; font-size: .85rem; color: var(--muted); }
.oa-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.oa-ul { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.oa-pre { margin: 0; white-space: pre-wrap; word-break: break-all; font: .85rem/1.5 ui-monospace, monospace; }
.oa-code { font: 800 1.2rem ui-monospace, monospace; letter-spacing: .04em; word-break: break-all; }
.oa-id { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px; border-radius: 14px; background: var(--surface-2); }
.oa-id small { color: var(--muted); width: 100%; }
.oa-id b { font: 800 1.1rem ui-monospace, monospace; letter-spacing: .06em; flex: 1; word-break: break-all; }
.oa-dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; }
.oa-dl dt { color: var(--muted); font-size: .85rem; }
.oa-dl dd { font-weight: 650; overflow-wrap: anywhere; text-align: right; }
.oa-me { grid-template-columns: auto 1fr; align-items: center; }
.oa-me small { display: block; color: var(--muted); overflow-wrap: anywhere; }
.og-av.big { width: 56px; height: 56px; font-size: 1.1rem; }
.oa-foot { text-align: center; padding-top: 6px; }
.oa-gate { min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.oa-gate .og-card { max-width: 420px; text-align: center; justify-items: center; }
.oa-link { display: grid; gap: 12px; padding: 16px; border-radius: 22px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.oa-link-head { display: flex; gap: 12px; align-items: center; }
.oa-link-head small { display: block; color: var(--muted); }
.og-url { font-size: .84rem; text-overflow: ellipsis; min-height: 46px; }
.oa-link-acts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.oa-link-acts .btn { padding-left: 8px; padding-right: 8px; justify-content: center; min-height: 46px; }
.oa-nav { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(14px); border-top: 1px solid var(--border); max-width: 760px; margin: 0 auto; }
.oa-nav button { display: grid; justify-items: center; gap: 3px; padding: 6px 2px; border: 0; border-radius: 14px; background: none; color: var(--muted); font: inherit; font-size: .72rem; font-weight: 700; min-height: 52px; }
.oa-nav button.on { color: var(--primary); }
.oa-nav button.on .oa-nav-ic { background: var(--primary-soft); }
.oa-nav-ic { position: relative; display: grid; place-items: center; width: 52px; height: 30px; border-radius: 99px; transition: background .2s; }
.oa-nav-ic svg { width: 22px; height: 22px; }
.oa-nav .badge-dot { position: absolute; top: -4px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: .68rem; display: grid; place-items: center; }
@media (min-width: 900px) { .oa-body { padding-bottom: 40px; } .oa-nav { position: sticky; max-width: none; } }
.oa-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-2); }
.oa-seg button { border: 0; background: none; padding: 10px; border-radius: 10px; font: inherit; font-weight: 700; color: var(--muted); min-height: 42px; }
.oa-seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(5,42,74,.14); }

/* learner services */
.os-list { display: grid; gap: 10px; }
.os-card { display: grid; gap: 8px; padding: 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); }
.os-card.open { border-color: color-mix(in srgb, var(--good) 40%, var(--border)); }
.os-top { display: flex; align-items: center; gap: 12px; }
.os-top small { display: block; color: var(--muted); font-size: .78rem; }
.os-act { display: flex; justify-content: flex-end; }
.btn.gold { background: linear-gradient(135deg, #f7b733, #e48a0c); color: #2a1d00; border: 0; }
.og-strip-link { color: var(--text); text-decoration: none; }
.organization-tabbar .tab-label { white-space: nowrap; }

/* ===== v2.17 Home hero: the next step reads clearly on any hero colour ===== */
.db-hero .db-next { background: var(--surface); backdrop-filter: none; border: 0; color: var(--text); box-shadow: 0 12px 28px rgba(3, 18, 40, .32); flex-wrap: wrap; }
.db-hero .db-next:hover { background: var(--surface); }
.db-hero .db-next-text small { color: var(--primary); }
.db-hero .db-next-text b { color: var(--text); font-size: 1.02rem; }
.db-hero .db-next-text span { color: var(--muted); white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.db-hero .db-next-go { color: #fff; background: var(--grad); padding: 10px 14px 10px 16px; }
@media (max-width: 460px) {
  .db-hero .db-next-text { flex: 1 1 calc(100% - 64px); }
  .db-hero .db-next-go { flex: 1 1 100%; justify-content: center; min-height: 44px; font-size: .95rem; }
}

/* ===== v2.17 Certificates fit any screen ===== */
.cert { container-type: inline-size; }
@container (max-width: 480px) {
  .cert-border { padding: 22px 14px 14px; outline-offset: 3px; }
  .cert-mark { width: 44px; height: 44px; }
  .cert-kicker { font-size: 11px; letter-spacing: .14em; }
  .cert-presented, .cert-for { font-size: 13.5px; }
  .cert-name { font-size: clamp(22px, 9cqw, 32px); padding: 0 4px 4px; overflow-wrap: anywhere; line-height: 1.15; }
  .cert-title { font-size: 19px; line-height: 1.2; }
  .cert-detail, .cert-note { font-size: 12.5px; }
  .cert-program-logo { max-width: 120px; max-height: 70px; }
  .cert-foot { grid-template-columns: 1fr 1fr; gap: 12px 10px; }
  .cert-seal { grid-column: 1 / -1; grid-row: 1; justify-self: center; width: 52px; height: 52px; }
  .cert-foot > div:not(.cert-seal) { font-size: 13px; }
}
@media (max-width: 480px) { .cert-main { padding-left: 8px; padding-right: 8px; } }
