/* TilOqu administration */
:root { font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 14px; color: #303344; background: #fff; --ink: #303344; --muted: #6f7380; --line: #e5e6eb; --accent: #8234d7; --accent-dark: #6925b9; --surface: #fff; }
* { box-sizing: border-box; }
body { margin: 0; }
a { color: #7141b0; text-decoration: none; }
a:hover { color: var(--accent-dark); text-decoration: underline; }
button, input, textarea, select { font: inherit; }
:focus-visible { outline: 3px solid #ba8ee6; outline-offset: 2px; }
.shell { display: flex; min-height: 100vh; }
aside { position: sticky; top: 0; height: 100vh; overflow-y: auto; width: 220px; flex: 0 0 220px; display: flex; flex-direction: column; padding: 0 12px 18px; border-right: 1px solid #ebedf0; background: #fafafa; }
aside > .confirm-open, aside > #logout-fallback { margin-top: auto; }
aside > .confirm-open, aside > #logout-fallback { flex-shrink: 0; }
aside > nav { margin-bottom: 24px; }
aside form { margin-top: auto; padding-top: 24px; }
.brand { display: block; padding: 18px 10px 22px; color: #313443; font-size: 17px; font-weight: 800; letter-spacing: .025em; }
.brand:hover { color: #313443; text-decoration: none; }
.brand span { color: var(--accent); }
.brand small { display: block; margin-top: 4px; color: #838793; font-size: 10px; font-weight: 600; letter-spacing: .04em; }
nav { display: grid; gap: 2px; padding-top: 14px; border-top: 1px solid #ebedf0; }
.nav-heading { padding: 4px 11px 9px; color: #777b86; font-size: 11px; font-weight: 500; }
nav a { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 9px 11px; color: #686d78; border-radius: 4px; font-size: 13px; font-weight: 500; line-height: 1.3; }
.nav-icon { display: block; width: 16px; height: 16px; flex: 0 0 16px; color: #818692; }
nav a:hover, nav a:focus-visible { background: #f0eff3; color: var(--accent-dark); text-decoration: none; }
nav a.active { background: #f0eef5; color: var(--accent); font-weight: 650; }
nav a.active .nav-icon { color: var(--accent); }
main { width: 100%; max-width: 1600px; min-width: 0; padding: 0 36px 48px; }
header { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 64px; margin: 0 -36px 25px; padding: 13px 36px; border-bottom: 1px solid var(--line); }
h1, h2, p { margin-top: 0; }
h1 { margin: 0; font-size: 19px; line-height: 1.3; font-weight: 650; }
h2 { margin-bottom: 9px; font-size: 15px; line-height: 1.35; }
p { margin-bottom: 16px; color: var(--muted); line-height: 1.5; }
header .eyebrow { display: none; }
.eyebrow { color: #828592; font-size: 10px; font-weight: 700; letter-spacing: .07em; }
.badge, .status { display: inline-block; padding: 4px 8px; border-radius: 3px; background: #f0ebf7; color: #7045a0; font-size: 11px; font-weight: 650; white-space: nowrap; }
.badge { background: transparent; color: #858894; border: 1px solid var(--line); }
.intro { display: flex; padding: 18px 20px; border: 1px solid var(--line); border-radius: 4px; background: #fafafd; }
.intro h2 { margin: 5px 0; font-size: 17px; }
.intro p { margin-bottom: 10px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin: 16px 0 24px; border: 1px solid var(--line); background: var(--line); }
.stat { display: flex; flex-direction: column; padding: 14px 16px; color: var(--muted); background: var(--surface); }
.stat:hover { background: #faf9fd; text-decoration: none; }
.stat strong { margin: 5px 0 2px; color: var(--ink); font-size: 23px; line-height: 1.2; }
.stat small { color: var(--muted); font-size: 12px; }
.panel { min-width: 0; margin-bottom: 20px; padding: 19px 20px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); overflow-x: auto; }
.panel h2 + form { margin-top: 18px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.toolbar p { margin-bottom: 0; }
.actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin-top: 14px; border-top: 1px solid var(--line); }
.actions a { padding: 14px 16px 4px 0; font-weight: 650; }
.actions span { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; font-weight: 400; }
button, .button { display: inline-block; padding: 9px 14px; border: 1px solid var(--accent); border-radius: 4px; background: var(--accent); color: #fff; font-weight: 650; line-height: 1.25; cursor: pointer; text-align: center; }
button:hover, .button:hover { border-color: var(--accent-dark); background: var(--accent-dark); color: #fff; text-decoration: none; }
button:disabled, .button:disabled { opacity: .55; cursor: not-allowed; }
.secondary, .light { border-color: #d9d5e2; background: #f8f7fa; color: #674f80; }
.secondary:hover, .light:hover { border-color: #c3b6d1; background: #f0edf5; color: #543774; }
.link { padding: 9px 11px; border-color: transparent; background: transparent; color: #666b79; }
.link:hover { border-color: transparent; background: #eeeef3; color: var(--accent-dark); }
.back { display: inline-block; margin-bottom: 16px; font-weight: 600; }
label { display: block; margin-bottom: 16px; color: #505461; font-size: 12px; font-weight: 650; }
input, textarea, select { display: block; width: 100%; min-width: 0; margin-top: 7px; padding: 9px 10px; border: 1px solid #d9dbe1; border-radius: 4px; background: #fff; color: var(--ink); }
input:focus, textarea:focus, select:focus { border-color: #9a54df; outline: 2px solid #e4cef8; }
input[type="checkbox"] { width: auto; margin: 0; }
input[type="file"] { padding: 8px; }
textarea { min-height: 130px; resize: vertical; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.check { display: flex; align-items: center; gap: 8px; }
.inline { display: flex; align-items: center; gap: 8px; }
.inline input, .inline select { margin-top: 0; }
.inline label { display: flex; align-items: center; gap: 8px; margin: 0; white-space: nowrap; }
.inline button { white-space: nowrap; }
.panel > form + form { margin-top: 14px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { color: #777b87; font-size: 11px; font-weight: 700; letter-spacing: .035em; text-transform: uppercase; }
td, th { padding: 11px 10px; border-bottom: 1px solid #ebecef; vertical-align: top; }
td:first-child, th:first-child { padding-left: 0; }
td:last-child, th:last-child { padding-right: 0; }
td { font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
tr:last-child td { border-bottom: 0; }
td form + form { margin-top: 8px; }
td .inline { min-width: 780px; }
.progress-action { white-space: nowrap; overflow-wrap: normal; }
.empty { padding: 30px 12px; color: var(--muted); text-align: center; }
.notice { color: #215c45; background: #e8f5ed; border: 1px solid #acd5ba; border-radius: 4px; padding: 12px 14px; }
.error { color: #ac303d; }
.login-page { display: flex; min-height: 100vh; background: #fff; }
.login-box { width: 62%; max-width: none; margin: auto; padding: 56px max(32px, calc((62vw - 360px) / 2)); }
.login-box .brand { padding: 0 0 20px; color: var(--ink); }
.login-box h1 { font-size: 22px; }
.login-box form { margin-top: 26px; }
.login-box button { width: 100%; }
.login-art { width: 38%; min-height: 100vh; background: #bd9eb7 url('/login-mountains.png') center / cover no-repeat; }
.login-art > div { display: none; }
.dashboard-stats { margin: 0 0 25px; }
.dashboard-columns { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 24px; align-items: start; }
.dashboard-actions, .dashboard-activity { min-width: 0; }
.dashboard-columns h2 { margin: 0 0 12px; font-size: 14px; }
.dashboard-links { overflow: hidden; border: 1px solid var(--line); border-radius: 4px; }
.dashboard-links a { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 12px; border-bottom: 1px solid var(--line); color: var(--ink); font-size: 13px; }
.dashboard-links a:nth-child(even) { background: #f7f8fa; }
.dashboard-links a:last-child { border-bottom: 0; }
.dashboard-links a:hover { color: var(--accent-dark); background: #f2eef8; text-decoration: none; }
.dashboard-links a span { flex-shrink: 0; color: var(--muted); font-size: 12px; }
.activity-list { display: grid; gap: 8px; max-height: min(480px, 55vh); overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; padding: 10px; background: #f7f8fa; border-radius: 4px; }
.activity-item { min-width: 0; padding: 12px; border: 1px solid #eef0f3; border-radius: 4px; background: #fff; font-size: 13px; overflow-wrap: anywhere; }
.activity-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.activity-empty { margin: 0; padding: 12px; font-size: 13px; }
@media (max-width: 900px) {
  aside { width: 190px; flex-basis: 190px; }
  main { padding: 0 24px 40px; }
  header { margin: 0 -24px 24px; padding: 13px 24px; }
  .toolbar { align-items: flex-start; flex-wrap: wrap; }
  .dashboard-columns { grid-template-columns: 1fr; gap: 0; }
}
@media (max-width: 700px) {
  .shell { display: block; }
  aside { position: static; height: auto; overflow-y: visible; width: 100%; padding: 12px 18px; border-right: 0; border-bottom: 1px solid var(--line); }
  aside > nav { margin-bottom: 12px; }
  aside > .confirm-open, aside > #logout-fallback { margin-top: 0; }
  aside form { margin-top: 8px; padding-top: 0; }
  .brand { padding: 0 0 12px; }
  nav { display: flex; flex-wrap: wrap; gap: 2px; padding-top: 8px; }
  .nav-heading { flex-basis: 100%; padding: 4px 9px 6px; }
  nav a { padding: 8px 9px; }
  main { padding: 0 18px 36px; }
  header { margin: 0 -18px 20px; padding: 12px 18px; }
  .badge { display: none; }
  .stats { grid-template-columns: 1fr; }
  .stat { padding: 13px 16px; }
  .stat strong { font-size: 22px; }
  .actions, .grid { grid-template-columns: 1fr; }
  .actions a { padding: 13px 0; border-bottom: 1px solid var(--line); }
  .actions a:last-child { border-bottom: 0; }
  .panel { padding: 16px; }
  .toolbar, .toolbar .inline { width: 100%; }
  .toolbar .inline input { flex: 1; }
  .login-art { display: none; }
  .login-box { width: 100%; max-width: 440px; padding: 40px 25px; }
}

/* Staff records keep controls readable at all screen widths. */
.staff-list { display: grid; gap: 14px; margin-top: 18px; }
.staff-card { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 4px; }
.staff-header { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.staff-header strong { min-width: 0; overflow-wrap: anywhere; }
.staff-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
.staff-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.staff-actions form { margin: 0; }
.staff-actions button { white-space: nowrap; }
@media (max-width: 900px) { .staff-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .staff-fields { grid-template-columns: 1fr; } }

#logout-fallback summary { cursor: pointer; }
#logout-fallback p { padding: 0 11px; }
#confirm-dialog { max-width: min(420px, calc(100% - 32px)); border: 1px solid var(--line); border-radius: 8px; padding: 24px; color: var(--ink); }
#confirm-dialog::backdrop { background: rgba(0, 0, 0, .45); }
.confirm-actions { display: flex; gap: 10px; justify-content: flex-end; }

.confirm-open[hidden], details[hidden] { display: none; }
#learner-delete-fallback summary { cursor: pointer; display: inline-block; padding: 9px 14px; border: 1px solid #d9d5e2; border-radius: 4px; }

.confirm-fallback summary { cursor: pointer; display: inline-block; padding: 9px 14px; border: 1px solid var(--accent); border-radius: 4px; background: var(--accent); color: #fff; font-weight: 650; }
.confirm-fallback summary.secondary { border-color: #d9d5e2; background: #f8f7fa; color: #674f80; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; }
.sidebar-brand img { display: block; width: 36px; height: 36px; object-fit: contain; flex: 0 0 auto; }
.sidebar-brand .brand-name { color: #313443; }
