/* Tecspectra Academy — additions on top of the main site's app.css */
.brand-text small { font: 500 .72rem/1 var(--font); color: var(--muted); letter-spacing: .02em; margin-left: 2px; }
.narrow { max-width: 760px; }
.center { text-align: center; }
.big-code { font: 700 6rem/1 var(--font-display); color: var(--accent); margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.stack { display: grid; gap: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.flash { padding: 13px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; border: 1px solid var(--line-strong); background: var(--surface); }
.flash-ok { border-color: var(--ok); color: var(--ok); }
.flash-err { border-color: var(--err); color: var(--err); }
.flash-info, .flash-warn { border-color: rgba(245,164,0,.55); background: var(--accent-soft); color: var(--ink); }
.linklike { background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.danger { color: var(--err) !important; }
.btn.danger { border-color: var(--err); }

/* Badges: text + tone, never colour alone */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .76rem; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok { background: rgba(19,138,75,.12); color: var(--ok); }
.badge-warn { background: var(--accent-soft); color: var(--accent-ink); }
.badge-bad { background: rgba(192,54,44,.12); color: var(--err); }
.badge-info { background: rgba(42,120,214,.12); color: #2a6bc0; }
.badge-mute { background: var(--surface-2); color: var(--muted); border-color: var(--line); }
:root[data-theme="dark"] .badge-info { color: #7fb2f0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge-info { color: #7fb2f0; } }

/* ---------- Public pages ---------- */
.programme-card { display: flex; flex-direction: column; gap: 12px; height: 100%; }
.programme-card .card-icon { margin-bottom: 4px; }
.programme-card h3 { margin: 0; }
.programme-card .meta { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: .86rem; color: var(--muted); }
.programme-card .meta span { display: inline-flex; gap: 6px; align-items: center; }
.price { font: 600 1.5rem/1 var(--font-display); letter-spacing: -0.02em; }
.price s { font: 500 .95rem var(--font); color: var(--muted); margin-left: 8px; }
.price-note { font-size: .82rem; color: var(--accent-ink); font-weight: 600; }
.programme-card .card-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: clamp(28px, 5vw, 64px); align-items: start; }
@media (max-width: 960px) { .detail-grid { grid-template-columns: 1fr; } }
.sticky-card { position: sticky; top: calc(var(--header-h) + 20px); }
.cohort-option { display: grid; gap: 4px; padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); cursor: pointer; }
.cohort-option:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cohort-option input { width: auto; min-height: 0; }
.steps-inline { display: flex; gap: 8px; flex-wrap: wrap; list-style: none; padding: 0; margin: 0 0 28px; font-size: .86rem; }
.steps-inline li { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); }
.steps-inline li[aria-current] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pay-option { display: grid; gap: 10px; }
.bank-box { padding: 18px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px dashed var(--line-strong); }
.bank-box dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
.bank-box dt { color: var(--muted); }
.bank-box dd { margin: 0; font-weight: 600; }
.auth-box { max-width: 440px; margin: 0 auto; }
.verify-result { padding: 28px; border-radius: var(--radius); border: 2px solid var(--line-strong); }
.verify-result.valid { border-color: var(--ok); }
.verify-result.revoked, .verify-result.not_found { border-color: var(--err); }

/* ---------- App shell (student + staff) ---------- */
body.area-student, body.area-staff { background: var(--bg-alt); }
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 20px 14px; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 22px; }
.sidebar .brand { padding: 4px 8px; }
.sidebar ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.sidebar a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: .93rem; }
.sidebar a:hover { background: var(--surface-2); color: var(--ink); }
.sidebar a[aria-current] { background: var(--accent-soft); color: var(--ink); font-weight: 600; }
.sidebar a[aria-current] .icon { color: var(--accent-ink); }
.side-label { margin: 10px 12px 4px; font: 600 .7rem/1 var(--font); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.app-main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; height: 64px; padding: 0 clamp(16px, 3vw, 32px); background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.topbar-title { margin: 0; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.topbar-actions form { margin: 0; }
.avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: .85rem; }
.side-toggle { display: none; }
.app-content { padding: clamp(18px, 3vw, 32px); max-width: 1280px; width: 100%; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 272px; z-index: 50; transform: translateX(-100%); transition: transform .3s var(--ease); box-shadow: var(--shadow-lg); }
  .sidebar.is-open { transform: none; }
  .side-toggle { display: inline-grid; }
}

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(18px, 2.5vw, 26px); min-width: 0; }
.panel + .panel, .panel-gap { margin-top: 20px; }
.panel h2 { font-size: 1.15rem; margin: 0 0 14px; }
.panel h3 { font-size: 1rem; margin: 18px 0 8px; }
.cols-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 20px; }
.cols-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 20px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 22px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: grid; gap: 6px; text-decoration: none; }
a.tile:hover { border-color: var(--line-strong); }
.tile span { font-size: .8rem; color: var(--muted); font-weight: 500; }
.tile strong { font: 600 1.7rem/1 var(--font-display); letter-spacing: -0.02em; }
.tile small { font-size: .8rem; color: var(--muted); }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.list a { text-decoration: none; font-weight: 600; }
.list a:hover { color: var(--accent-ink); }
.empty-state { text-align: center; padding: 34px 16px; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); }
.progress-bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress-bar span { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.course-card { display: grid; gap: 12px; }
.course-card h3 { margin: 0; font-size: 1.15rem; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.panel .table-wrap { border-radius: var(--radius-sm); }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th, table.data td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; background: var(--surface-2); white-space: nowrap; }
table.data tr:last-child td { border-bottom: 0; }
table.data a { text-decoration: none; font-weight: 600; }
table.data a:hover { color: var(--accent-ink); }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data .actions { text-align: right; white-space: nowrap; }
table.data td small { color: var(--muted); }

/* Forms */
.form { display: grid; gap: 16px; }
.form .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .form .grid-2 { grid-template-columns: 1fr; } }
.field small.help { color: var(--muted); font-weight: 400; font-size: .82rem; }
.field .err { color: var(--err); font-size: .85rem; }
.check { display: flex; align-items: center; gap: 10px; font-size: .94rem; cursor: pointer; }
.check input { width: 18px; height: 18px; min-height: 0; flex: none; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters input, .filters select { width: auto; min-height: 42px; padding: 8px 12px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a[aria-current] { color: var(--ink); border-color: var(--accent); }
.att-grid { display: grid; gap: 8px; }
.att-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; flex-wrap: wrap; }
.seg-choice { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; overflow: hidden; }
.seg-choice label { position: relative; padding: 6px 12px; font-size: .84rem; cursor: pointer; }
.seg-choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg-choice label:has(input:checked) { background: var(--ink); color: var(--bg); }
.material { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.material:last-child { border-bottom: 0; }
.material .card-icon { width: 38px; height: 38px; margin: 0; border-radius: 10px; flex: none; }
.material .card-icon .icon { width: 18px; height: 18px; }
details.module { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 16px; background: var(--surface); }
details.module + details.module { margin-top: 10px; }
details.module summary { cursor: pointer; padding: 14px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
details.module summary::-webkit-details-marker { display: none; }
.stars { display: inline-flex; gap: 2px; flex-direction: row-reverse; }
.stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.stars label { cursor: pointer; font-size: 1.6rem; color: var(--line-strong); line-height: 1; }
.stars label:hover, .stars label:hover ~ label, .stars input:checked ~ label { color: var(--accent); }
.stars input:focus-visible + label { outline: 2px solid var(--accent); border-radius: 4px; }

/* Certificate (printable) */
.cert-page { background: #e9e6df; min-height: 100vh; padding: 32px 16px; }
.certificate { max-width: 1000px; aspect-ratio: 1.414; margin: 0 auto; background: #fffdf8; color: #111; position: relative; padding: 6% 7%; box-shadow: 0 20px 50px rgba(0,0,0,.2); display: flex; flex-direction: column; justify-content: space-between; font-family: var(--font); border: 14px solid #111; outline: 3px solid #f5a400; outline-offset: -22px; }
.certificate .cert-top { display: flex; justify-content: space-between; align-items: center; }
.certificate h1 { font: 700 clamp(1.4rem, 4vw, 2.6rem)/1.1 var(--font-display); letter-spacing: .02em; text-transform: uppercase; margin: 0; text-align: center; }
.certificate .cert-name { font: 600 clamp(1.6rem, 5vw, 3.2rem)/1.1 var(--font-display); text-align: center; margin: 0; border-bottom: 2px solid #f5a400; padding-bottom: 10px; }
.certificate .cert-body { text-align: center; display: grid; gap: 14px; }
.certificate .cert-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; font-size: .85rem; }
.certificate .qr { width: 110px; height: 110px; }
@media print {
  @page { size: A4 landscape; margin: 0; }
  .cert-page { padding: 0; background: #fff; }
  .cert-actions { display: none !important; }
  .certificate { box-shadow: none; max-width: none; width: 100vw; height: 100vh; aspect-ratio: auto; }
}

/* Inline icons inside text (the base stylesheet makes SVGs block-level) */
p .icon, small .icon, td .icon, li > span .icon, .badge .icon, label .icon, a .icon, h2 .icon, .btn .icon { display: inline-block; vertical-align: -0.16em; }
/* The hidden attribute must win over component display rules (used by data-show-when) */
[hidden] { display: none !important; }
