/* LBS design refinement: loaded after main.css and banners.css.
   Direction: a quiet, credible product UI. Restrained radius and depth, lighter type weights, no decorative gradients on working
   screens, information-dense but ordered. Components that exist only for show (icon tiles, stat cards, pill chips) are replaced
   by plainer structures. Colour is kept for meaning: brand for actions, semantic colours for status. */

:root {
  /* shape: small radii everywhere; pills only for true badges */
  --r-sm: 3px; --r: 5px; --r-lg: 7px; --r-xl: 10px;
  /* depth: surfaces are separated by borders; shadows are for floating layers only */
  --shadow-sm: none;
  --shadow: 0 2px 8px rgba(15, 23, 42, .08);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, .16);
  --border: #d3dbe6;
  --border-2: #e4e9f0;
  --bg: #f6f8fb;
  --topbar: 56px;
}

/* ---- type: one calm hierarchy ---- */
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
.page-head { margin-bottom: var(--s-4); align-items: center; }
.page-head h1 { font-size: 1.45rem; font-weight: 600; }
.page-head p { font-size: var(--fs-sm); }
.section { padding: var(--s-6) 0; }
.section-head h2 { font-size: 1.25rem; }
.eyebrow { font-weight: 600; letter-spacing: .06em; font-size: .72rem; }
.hero h1 { font-size: clamp(1.8rem, 4.2vw, 2.55rem); line-height: 1.15; letter-spacing: -.02em; font-weight: 650; }
.hero .lead { font-size: 1.05rem; max-width: 56ch; }

/* ---- controls ---- */
.btn { font-weight: 600; border-radius: var(--r); box-shadow: none; }
.btn-primary, .btn-primary:hover { box-shadow: none; }
.btn-sm { min-height: 36px; padding: .3rem .75rem; }
.btn-lg { min-height: 44px; padding: .6rem 1.25rem; }
@media (pointer: coarse) { .btn-sm { min-height: 44px; } }
.badge, .chip { border-radius: var(--r-sm); font-weight: 600; }
.card { box-shadow: none; border-radius: var(--r-lg); }
.card-hover:hover { box-shadow: none; transform: none; border-color: var(--faint); }
input, select, textarea { border-radius: var(--r); }
.topbar-search input { border-radius: var(--r); }

/* ---- shell ---- */
.topbar { box-shadow: none; border-bottom: 1px solid var(--border); }
.side-link { border-radius: var(--r); }
.side-link.active, .side-link[aria-current="page"] { box-shadow: inset 2px 0 0 var(--brand-ink); background: var(--brand-soft); }
.side-group { margin-bottom: var(--s-4); }
/* in the signed-in shell the sidebar and avatar menu already carry Sign out */
.topbar .signout-inline.in-shell { display: none !important; }

/* ---- key figures: one bordered strip instead of a grid of icon cards ---- */
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r-lg); overflow: hidden; margin-bottom: var(--s-5); }
.kpi { padding: .85rem 1rem; border-right: 1px solid var(--border-2); border-bottom: 1px solid var(--border-2); text-decoration: none; color: inherit; min-width: 0; }
.kpi:hover { background: var(--surface-2); text-decoration: none; color: inherit; }
.kpi-num { display: block; font-size: 1.4rem; font-weight: 650; line-height: 1.2; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi-label { display: block; font-size: var(--fs-xs); color: var(--muted); font-weight: 500; text-transform: none; }
.kpi.attn .kpi-num { color: var(--warn); }
@media (min-width: 720px) { .kpis { grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); } .kpi { border-bottom: 0; } .kpi:last-child { border-right: 0; } }

/* ---- resume: a single compact row ---- */
.resume { display: flex; align-items: center; gap: var(--s-4); padding: .8rem 1rem; background: var(--surface); border: 1px solid var(--border-2); border-left: 3px solid var(--brand); border-radius: var(--r-lg); margin-bottom: var(--s-4); color: inherit; text-decoration: none; }
.resume:hover { text-decoration: none; color: inherit; border-color: var(--faint); border-left-color: var(--brand); }
.resume img { width: 96px; height: 54px; object-fit: cover; border-radius: var(--r); flex: none; display: none; }
.resume-main { flex: 1; min-width: 0; }
.resume-main .eyebrow { color: var(--muted); display: block; margin-bottom: .1rem; }
.resume-main strong { display: block; font-size: 1rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.resume-main .progress { margin-top: .5rem; height: 6px; }
.resume .btn { flex: none; }
@media (min-width: 640px) { .resume img { display: block; } }

/* ---- lists of courses / records: rows, not cards ---- */
.rowlist { background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r-lg); overflow: hidden; }
.rowitem { display: flex; align-items: center; gap: var(--s-3); padding: .7rem 1rem; border-bottom: 1px solid var(--border-2); color: inherit; text-decoration: none; }
.rowitem:last-child { border-bottom: 0; }
a.rowitem:hover { background: var(--surface-2); text-decoration: none; color: inherit; }
.rowitem img { width: 80px; height: 45px; object-fit: cover; border-radius: var(--r-sm); flex: none; }
.rowitem-main { flex: 1; min-width: 0; }
.rowitem-main strong { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rowitem-main span { font-size: var(--fs-sm); color: var(--muted); }
.rowitem .progress { width: 96px; height: 5px; flex: none; display: none; }
.rowitem-pct { font-variant-numeric: tabular-nums; font-size: var(--fs-sm); color: var(--muted); min-width: 3ch; text-align: right; }
@media (min-width: 560px) { .rowitem .progress { display: block; } }

/* ---- tables: denser, header quieter ---- */
.table-wrap { border-radius: var(--r-lg); }
table.data th, table.table th { text-transform: none; letter-spacing: 0; font-size: var(--fs-xs); font-weight: 600; color: var(--muted); background: var(--surface-2); }
table.data th, table.data td, table.table th, table.table td { padding: .55rem .9rem; }

/* ---- home: no decorative backdrop; categories as a plain text list ---- */
.hero { padding: var(--s-6) 0 var(--s-5); }
.hero-bg { display: none; }
.hero-art { display: none !important; }
.cat-chip { border-radius: var(--r); font-weight: 500; }
.cat-chips { gap: .4rem; }
.promo-home-wrap { padding-top: var(--s-3); }
.value-list { list-style: none; margin: var(--s-5) 0 0; padding: 0; display: grid; gap: .5rem; font-size: var(--fs-sm); color: var(--muted); }
.value-list li { display: flex; gap: .5rem; align-items: baseline; }
.value-list i { color: var(--ok); }
@media (min-width: 720px) { .value-list { grid-auto-flow: column; justify-content: start; gap: 1.5rem; } }

.hero-grid { grid-template-columns: 1fr !important; }
.hero-grid > div { max-width: 760px; margin-inline: auto; text-align: center; }
.hero .search-hero { margin-inline: auto; }
.hero .value-list { justify-content: center; }
.hero .lead { margin-inline: auto; }

/* two-column blocks only when there is room (the sidebar takes 264px of the width) */
@media (min-width: 720px) and (max-width: 1139px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---- catalogue / cards: calmer ---- */
.course-card { border-radius: var(--r-lg); box-shadow: none; }
.course-card:hover { box-shadow: none; transform: none; border-color: var(--faint); }
.course-card:hover .cc-thumb img { transform: none; }
.cc-title { font-weight: 600; }

/* ---- course player page ---- */
.course-banner { display: none; }

@media (prefers-reduced-motion: reduce) { * { transition-duration: .01ms !important; animation-duration: .01ms !important; } }

/* ---- cart ---- */
.cart-layout { display: grid; gap: var(--s-4); align-items: start; }
@media (min-width: 900px) { .cart-layout { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); } }
.cart-line { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: var(--s-3); align-items: center; padding: .85rem 1rem; border-bottom: 1px solid var(--border-2); }
.cart-line:last-child { border-bottom: 0; }
.cart-line > img { width: 96px; height: 54px; border-radius: var(--r-sm); object-fit: cover; }
.cart-line > div:nth-child(3) { text-align: right; white-space: nowrap; }
.cart-line > form { grid-column: auto; }
@media (max-width: 599px) {
  .cart-line { grid-template-columns: 72px minmax(0, 1fr); }
  .cart-line > img { width: 72px; height: 40px; }
  .cart-line > div:nth-child(3) { grid-column: 2; text-align: left; }
  .cart-line > form { grid-column: 2; }
}

/* ---- narrow screens: keep the top bar inside the viewport ---- */
@media (max-width: 480px) {
  .topbar { padding-inline: var(--s-3); gap: .25rem; }
  .topbar .icon-btn { min-width: 40px; width: 40px; }
  .brand-name { font-size: 1rem; }
}

/* ---- lesson page ---- */
.lesson-content { max-width: 72ch; line-height: 1.7; }
.lesson-aids { margin-top: var(--s-4); padding-top: var(--s-3); border-top: 1px solid var(--border-2); }
.lesson-aids summary { cursor: pointer; color: var(--muted); font-size: var(--fs-sm); }
.lesson-bar { gap: var(--s-3); }

/* ---- admin tables: compact inline controls ---- */
.inline-form { display: flex; align-items: center; gap: .35rem; margin: 0; }
.price-input { flex: none; width: 84px; min-height: 36px; padding: .3rem .5rem; }
.inline-form input.sr-only:focus-visible + .btn, .inline-form .btn:has(+ input.sr-only:focus-visible) { box-shadow: var(--ring); }

@media (max-width: 1499px) { .hide-md { display: none; } }

/* tables that turn into stacked records on phones (each cell carries its label) */
@media (max-width: 719px) {
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.stack tr { padding: .6rem .9rem; border-bottom: 1px solid var(--border-2); }
  table.stack td { border: 0; padding: .25rem 0; display: flex; gap: .75rem; justify-content: space-between; align-items: flex-start; text-align: right; }
  table.stack td::before { content: attr(data-label); color: var(--muted); font-size: var(--fs-xs); font-weight: 600; text-align: left; flex: none; padding-top: .15rem; }
  table.stack td .row { justify-content: flex-end; }
}
