/* Akaisha's Journey — monochrome "Education OS" theme (self-contained, offline). */
:root {
    --bg: #f5f6f8;
    --ink: #20242a;
    --dark: #202329;
    --sidebar: #17191d;
    --sidebar-ink: #aeb4bd;
    --sidebar-muted: #6f7680;
    --panel: #ffffff;
    --line: #e5e7eb;
    --line-soft: #eef0f2;
    --muted: #737983;
    --muted-2: #858b94;
    --pill: #f0f1f3;
    --pill-ink: #686e77;
    --ok-bg: #eaf5ed; --ok: #28623a;
    --warn-bg: #fbf1dd; --warn: #8a6d1f;
    --bad-bg: #f7eaea; --bad: #9c3030;
    --radius: 15px;
    font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
h1 { margin: 0; font-size: 28px; letter-spacing: -.03em; }
h2 { margin: 0; font-size: 16px; letter-spacing: -.02em; }
h3 { margin: 0; font-size: 14px; }
code { background: #eef0f2; padding: 1px 6px; border-radius: 6px; font-size: .85em; }

.app { min-height: 100vh; display: flex; }

/* Sidebar */
.sidebar { width: 250px; flex-shrink: 0; background: var(--sidebar); color: #fff; padding: 26px 16px; display: flex; flex-direction: column; }
.brand { display: flex; gap: 12px; align-items: center; padding: 0 10px 26px; }
.brand-icon { width: 38px; height: 38px; border-radius: 11px; background: #fff; color: var(--sidebar); display: grid; place-items: center; font-weight: 800; font-size: 18px; }
.brand-title { font-size: 16px; font-weight: 700; }
.brand-subtitle { color: #8e949d; font-size: 11px; margin-top: 3px; }
.nav { display: flex; flex-direction: column; overflow-y: auto; }
.nav-section { margin: 18px 10px 8px; color: var(--sidebar-muted); text-transform: uppercase; letter-spacing: .08em; font-size: 10px; font-weight: 700; }
.nav-item { display: flex; align-items: flex-start; gap: 11px; padding: 9px 12px; border-radius: 9px; color: var(--sidebar-ink); font-size: 13px; margin-bottom: 2px; }
.nav-item:hover, .nav-item.active { background: #292d33; color: #fff; }
.nav-icon { width: 20px; text-align: center; flex-shrink: 0; line-height: 1.3; }
.nav-text { display: flex; flex-direction: column; min-width: 0; }
.nav-label { line-height: 1.3; }
.nav-desc { font-size: 10.5px; color: var(--sidebar-muted); margin-top: 2px; line-height: 1.35; }
.nav-item.active .nav-desc { color: #9ba1aa; }
.sidebar-foot { margin-top: auto; font-size: 11px; color: var(--sidebar-muted); padding: 18px 10px 0; line-height: 1.5; }

/* Main */
.main, .content { flex: 1; min-width: 0; padding: 30px 34px; }
.topbar, .page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.eyebrow { color: #737983; font-size: 11px; font-weight: 700; letter-spacing: .08em; margin-bottom: 6px; }
.subtitle, .lead { color: var(--muted); margin-top: 6px; font-size: 14px; max-width: 640px; }
.lead { margin: 0 0 22px; }
.profile-pill { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 9px 14px; font-size: 13px; white-space: nowrap; }

/* Grid + cards */
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; min-width: 0; margin-bottom: 0; }
.span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; } .span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }

.stat-label { color: #777d86; font-size: 12px; margin-bottom: 9px; }
.stat-value { font-size: 27px; font-weight: 750; letter-spacing: -.04em; }
.stat-foot { color: #9298a0; font-size: 11px; margin-top: 5px; }
a.card:hover { border-color: #cfd3d9; }

.section-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.section-link { color: var(--muted); font-size: 12px; }

/* Dark phase card */
.phase-card { background: var(--dark); color: #fff; border: none; }
.phase-label { color: #9da3ad; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.phase-name { font-size: 25px; font-weight: 750; margin-top: 7px; }
.phase-description { color: #aeb4bd; font-size: 12px; margin-top: 5px; }

/* Progress */
.progress-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; }
.progress-value { font-weight: 700; font-size: 14px; }
.progress-track { height: 8px; background: #eceef1; border-radius: 20px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--dark); border-radius: 20px; }

/* Milestones / list rows */
.rowline { display: flex; align-items: flex-start; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line-soft); }
.rowline:last-child { border-bottom: 0; }
.row-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--dark); margin-top: 5px; flex-shrink: 0; }
.row-title { font-size: 13px; font-weight: 600; }
.row-meta { margin-top: 4px; font-size: 11px; color: var(--muted-2); }

/* Timeline */
.timeline { display: grid; gap: 0; margin-top: 6px; }
.timeline-item { position: relative; text-align: center; padding-top: 15px; }
.timeline-item:not(:last-child)::after { content: ""; position: absolute; top: 20px; left: 50%; width: 100%; height: 2px; background: var(--line); z-index: 0; }
.timeline-dot { position: relative; z-index: 1; margin: 0 auto 9px; width: 12px; height: 12px; border-radius: 50%; background: #d5d8dc; border: 3px solid #fff; box-shadow: 0 0 0 1px #d5d8dc; }
.timeline-item.current .timeline-dot { background: var(--dark); box-shadow: 0 0 0 1px var(--dark); }
.timeline-item.done .timeline-dot { background: #8a9199; box-shadow: 0 0 0 1px #8a9199; }
.timeline-age { font-size: 11px; color: #7b8189; }
.timeline-name { font-size: 12px; font-weight: 650; margin-top: 3px; }

/* Skills */
.skill { margin-bottom: 15px; }
.skill:last-child { margin-bottom: 0; }
.skill-header { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 7px; }
.skill-level { color: var(--muted-2); }

/* Status pills / badges */
.status, .badge { display: inline-block; font-size: 10px; font-weight: 600; padding: 5px 9px; border-radius: 20px; background: var(--pill); color: var(--pill-ink); white-space: nowrap; }
.badge { font-size: 11px; }
.status.ok, .badge.ok { background: var(--ok-bg); color: var(--ok); }
.status.warn, .badge.warn { background: var(--warn-bg); color: var(--warn); }
.status.bad, .badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.prio-high { background: var(--bad-bg); color: var(--bad); }
.badge.prio-medium { background: var(--warn-bg); color: var(--warn); }
.badge.prio-low { background: var(--pill); color: var(--pill-ink); }
.badge.level { background: #eceef1; color: #4a4f57; }
.chip { display: inline-block; font-size: 11px; background: #eceef1; color: #4a4f57; padding: 2px 9px; border-radius: 20px; margin: 0 5px 5px 0; }

/* Quick actions */
.actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.action { border: 1px solid var(--line); border-radius: 11px; padding: 14px; text-align: left; background: #fff; cursor: pointer; display: block; }
.action:hover { background: #f7f8f9; }
.action-icon { font-size: 18px; margin-bottom: 8px; }
.action-title { font-size: 12px; font-weight: 650; }
.action-description { font-size: 10px; color: #8a9098; margin-top: 3px; }

/* Buttons */
.btn, .button { display: inline-block; border: 0; border-radius: 9px; padding: 10px 15px; cursor: pointer; font-size: 12px; font-weight: 650; background: var(--dark); color: #fff; }
.btn:hover { background: #000; }
.btn.ghost, .button.secondary { background: #eef0f2; color: #454a51; }
.btn.ghost:hover { background: #e4e7ea; }
.btn.danger { background: var(--bad-bg); color: var(--bad); }
.mini { font-size: 12px; padding: 4px 9px; border-radius: 7px; color: var(--muted); }
.mini:hover { background: #eef0f2; }
.mini.danger { color: var(--bad); }

/* Tables */
.table-wrap { padding: 0; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 18px; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
th { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
tbody tr:hover { background: #fafbfc; }
td.primary { font-weight: 600; }
.actions-col { text-align: right; white-space: nowrap; width: 1%; }
.detail-row td { border-bottom: 2px solid var(--line); padding-top: 0; }
.journal-body { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.paperclip { color: var(--muted-2); font-size: 11px; }

/* Filter bar */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.filter-bar input, .filter-bar select { width: auto; border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; background: #fff; }
.filter-bar input[type=search] { min-width: 240px; }

/* Forms */
.form-card { max-width: 760px; }
.field { margin-bottom: 15px; display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 12px; font-weight: 650; }
.field input, .field textarea, .field select { width: 100%; border: 1px solid #dfe2e6; border-radius: 9px; padding: 10px 12px; background: #fff; color: var(--ink); outline: none; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: #969ca5; }
.field textarea { resize: vertical; }
.field .check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
.field .check input { width: auto; }
.form-actions { display: flex; gap: 8px; margin-top: 22px; }
.current-file, .attach-list { display: flex; flex-wrap: wrap; gap: 10px; padding: 4px 0; }
.attach { border: 1px solid var(--line); border-radius: 10px; padding: 8px; width: 120px; text-align: center; font-size: 11px; }
.attach img { width: 100%; height: 70px; object-fit: cover; border-radius: 6px; display: block; margin-bottom: 6px; }
.attach .fileicon { font-size: 30px; margin: 8px 0; }
.attach a { color: var(--muted); }
.attach .rm { color: var(--bad); display: block; margin-top: 4px; }

.alert, .flash { padding: 12px 15px; border-radius: 10px; margin-bottom: 18px; font-size: 12px; }
.alert-success, .flash { background: var(--ok-bg); color: var(--ok); }
.empty { text-align: center; padding: 44px; color: var(--muted); }

/* Roadmap page */
.roadmap { position: relative; }
.phase { display: flex; gap: 16px; }
.phase-marker { font-size: 1.1rem; display: flex; flex-direction: column; align-items: center; }
.phase-marker::after { content: ""; flex: 1; width: 2px; background: var(--line); margin-top: 4px; }
.phase:last-child .phase-marker::after { display: none; }
.phase-body { flex: 1; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; }
.phase.current .phase-body { border-color: var(--dark); }
.phase-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.phase-age { font-size: 12px; color: var(--muted); }
.phase-body p { color: var(--muted); margin: 6px 0 8px; font-size: 13px; }
.phase-actions { display: flex; gap: 6px; }

/* Age view */
.age-picker { display: flex; gap: 10px; align-items: center; margin-bottom: 20px; }
.age-picker select { width: auto; border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; }
.guide-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.guide-col h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 10px; }
.guide-col ul { margin: 0; padding-left: 18px; }
.guide-col li { font-size: 13px; margin-bottom: 8px; }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: var(--sidebar); }
.login-box { background: #fff; border-radius: 16px; padding: 34px; width: 320px; text-align: center; }
.login-box .brand-icon { margin: 0 auto 16px; }
.login-box h1 { font-size: 20px; margin-bottom: 6px; }
.login-box p { color: var(--muted); font-size: 13px; margin: 0 0 20px; }
.login-box input { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 11px 12px; margin-bottom: 12px; }
.login-box .btn { width: 100%; }
.login-error { color: var(--bad); font-size: 12px; margin-bottom: 12px; }

/* Tasks buckets */
.bucket h3 { margin-bottom: 10px; font-size: 13px; }
.bucket ul { list-style: none; margin: 0; padding: 0; }
.bucket li { padding: 7px 0; display: flex; align-items: center; gap: 9px; font-size: 13px; border-bottom: 1px solid var(--line-soft); }
.bucket li:last-child { border-bottom: 0; }
.tick { color: var(--muted-2); text-decoration: none; font-size: 15px; }
.tick:hover { color: var(--dark); }
.due { margin-left: auto; font-size: 11px; color: var(--muted-2); }
.due.overdue { color: var(--bad); font-weight: 600; }

/* Today / Schedule day rows */
.daylist { display: flex; flex-direction: column; }
.dayrow { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.dayrow:last-child { border-bottom: 0; }
.daytime { width: 52px; flex-shrink: 0; font-weight: 700; font-size: 13px; color: var(--dark); font-variant-numeric: tabular-nums; }
.daymain { flex: 1; min-width: 0; }
.daymain .row-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.daybtns { display: flex; gap: 6px; flex-shrink: 0; }
.day-btn { font-size: 11px; font-weight: 650; padding: 5px 9px; border-radius: 8px; border: 1px solid var(--line); color: var(--muted); background: #fff; white-space: nowrap; }
.day-btn:hover { border-color: #c3c8cf; }
.day-btn.done.on { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-bg); }
.day-btn.missed.on { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-bg); }
.day-btn.skipped.on { background: var(--pill); color: var(--pill-ink); border-color: var(--pill); }
.dayrow.done { opacity: .72; }
.dayrow.done .row-title { text-decoration: line-through; text-decoration-color: #b9bec5; }

/* Responsive */
@media (max-width: 1100px) {
    .sidebar { width: 210px; }
    .span-3 { grid-column: span 6; }
    .span-2, .span-4, .span-5, .span-7, .span-8 { grid-column: span 12; }
    .span-6 { grid-column: span 12; }
    .guide-cols { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
    .app { display: block; }
    .sidebar { width: 100%; padding: 14px; }
    .nav { flex-flow: row wrap; gap: 5px; }
    .nav-section, .sidebar-foot { display: none; }
    .nav-item { white-space: nowrap; }
    .main, .content { padding: 20px 15px; }
    .topbar { display: block; }
    .profile-pill { display: inline-block; margin-top: 14px; }
    .span-2, .span-3, .span-4, .span-5, .span-6, .span-7, .span-8, .span-12 { grid-column: span 12; }
    .actions { grid-template-columns: repeat(2, 1fr); }
}

/* ── Auth: wide box, TOTP enrolment, invites ── */
.login-box.wide { width: 420px; }
.login-box .login-foot { margin: 16px 0 0; font-size: 12px; color: var(--muted); }
.flash.bad { background: var(--bad-bg); color: var(--bad); }
.totp-enrol { display: flex; gap: 16px; align-items: center; text-align: left; margin-bottom: 16px; }
.totp-enrol .qr { border-radius: 10px; border: 1px solid var(--line); flex-shrink: 0; image-rendering: pixelated; background: #fff; }
.totp-manual { min-width: 0; }
.secret, .otp-big { display: inline-block; font-family: ui-monospace, Menlo, monospace; background: var(--pill); color: var(--pill-ink); border-radius: 8px; padding: 6px 9px; word-break: break-all; font-size: 13px; letter-spacing: 1px; }
.otp-big { font-size: 22px; font-weight: 700; letter-spacing: 3px; margin-top: 4px; }

/* Admin student switcher in the sidebar */
.switcher { border-top: 1px solid var(--line-soft); margin-top: 10px; padding-top: 12px; display: flex; flex-direction: column; gap: 4px; }
.switcher-label { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted-2); margin-bottom: 2px; }
.switcher-item { font-size: 13px; padding: 6px 10px; border-radius: 8px; color: var(--muted); }
.switcher-item:hover { background: rgba(255,255,255,.06); }
.switcher-item.active { background: rgba(255,255,255,.12); color: #fff; font-weight: 650; }
.switcher-item.add { color: var(--muted-2); font-size: 12px; }

/* Invite card */
.invite-grid { display: grid; grid-template-columns: 1fr auto; gap: 22px; align-items: start; }
.ilabel { display: block; font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 6px; }
.copyfield { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 10px 11px; font-size: 12px; font-family: ui-monospace, Menlo, monospace; }
.invite-qr { text-align: center; }
.invite-qr img { border: 1px solid var(--line); border-radius: 10px; image-rendering: pixelated; }
@media (max-width: 700px) { .invite-grid { grid-template-columns: 1fr; } .login-box.wide { width: 92vw; } .totp-enrol { flex-direction: column; } }

/* Invite message box + actions */
.msgbox { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 10px 11px; font-size: 12px; line-height: 1.5; font-family: ui-monospace, Menlo, monospace; resize: vertical; background: #fbfbfc; }
.invite-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.copyfield { cursor: pointer; }
.contact-lines { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.contact-lines span { color: var(--muted); }
