/* app.css — auth + app shell + screen layouts */

/* ============================================================ AUTH */
.auth-wrap { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; }

.auth-brand { position: relative; overflow: hidden; background: var(--brand-panel); display: flex; }
.auth-brand-inner { position: relative; z-index: 2; display: flex; flex-direction: column; padding: 52px 56px; width: 100%; }
.auth-brand-mid { margin-top: auto; }
.auth-brand-stats { display: flex; gap: 40px; margin-top: 40px; padding-top: 30px; border-top: 1px solid rgba(255,255,255,.14); }
.auth-deco { position: absolute; inset: 0; z-index: 1; opacity: .9; }

.auth-main { display: flex; flex-direction: column; padding: 32px clamp(20px, 6vw, 80px); }
.auth-card { margin: auto; width: 100%; max-width: 412px; }
.auth-mobile-logo { display: none; margin-bottom: 28px; }
.auth-foot { display: flex; justify-content: space-between; align-items: center; padding-top: 20px; }
.auth-foot-link { font-size: 12.5px; color: var(--text-3); text-decoration: none; }
.auth-foot-link:hover { color: var(--text-2); }

.auth-icon-badge { width: 52px; height: 52px; border-radius: 14px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; margin-bottom: 20px; }
.auth-icon-success { background: var(--pass-soft); color: var(--pass); }

.auth-back { display: inline-flex; align-items: center; gap: 6px; background: none; border: none; cursor: pointer; color: var(--text-2); font-family: var(--font-body); font-size: 14px; font-weight: 600; padding: 0; margin-bottom: 22px; white-space: nowrap; }
.auth-back:hover { color: var(--text); }

.code-input { display: flex; gap: 10px; justify-content: space-between; }
.code-box {
  flex: 1; height: 60px; min-width: 0; text-align: center; font-family: var(--font-mono); font-size: 24px; font-weight: 600;
  color: var(--text); background-color: var(--surface); border: 1.5px solid var(--border-strong); border-radius: var(--r-2);
  appearance: none; -webkit-appearance: none;
  transition: border-color .15s, box-shadow .15s;
}
.code-box:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); outline: none; }

.demo-note {
  display: flex; align-items: flex-start; gap: 9px; margin-top: 24px; padding: 11px 13px;
  background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: var(--r-2);
  font-size: 12.5px; color: var(--text-3); line-height: 1.45;
}
.demo-note svg { flex: none; margin-top: 1px; }

@media (max-width: 900px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-mobile-logo { display: block; }
  .auth-main { padding: 28px 22px; min-height: 100vh; }
}

/* ============================================================ APP SHELL */
.shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 20px 16px; gap: 4px; z-index: 40;
}
.side-logo { padding: 8px 8px 18px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: var(--r-2);
  color: var(--text-2); font-weight: 600; font-size: 14.5px; cursor: pointer; border: none; background: none;
  width: 100%; text-align: left; font-family: var(--font-body); transition: background .15s, color .15s; position: relative; white-space: nowrap;
}
.nav-item svg { flex: none; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); }
.nav-item.active::before { content: ''; position: absolute; left: -16px; top: 50%; transform: translateY(-50%); width: 3px; height: 22px; background: var(--primary); border-radius: 3px; }
.nav-item .nav-count { margin-left: auto; font-family: var(--font-mono); font-size: 11px; background: var(--action); color: #fff; padding: 1px 7px; border-radius: 999px; font-weight: 600; }
.nav-section { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); padding: 16px 12px 6px; }

.side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }
.user-chip { display: flex; align-items: center; gap: 11px; padding: 9px 8px; border-radius: var(--r-2); }
.user-chip .col { min-width: 0; }
.user-chip .nm { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .em { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px;
  padding: 16px clamp(20px, 4vw, 44px); background: color-mix(in oklab, var(--bg) 78%, transparent);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--border);
}
.topbar h2 { font-size: 21px; }
.content { padding: clamp(22px, 4vw, 40px); max-width: 1180px; width: 100%; margin: 0 auto; }

.icon-btn { width: 40px; height: 40px; border-radius: var(--r-2); border: 1px solid var(--border); background: var(--surface); color: var(--text-2); display: grid; place-items: center; cursor: pointer; transition: all .15s; flex: none; }
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-2); }

.menu-btn { display: none; }

/* mobile sidebar */
.side-scrim { display: none; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: 280px; transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .side-scrim.show { display: block; position: fixed; inset: 0; background: rgba(0,20,30,.4); z-index: 35; }
  .menu-btn { display: grid; }
}

/* ============================================================ ROLE SWITCH (demo) */
.role-switch { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-pill); padding: 3px; gap: 2px; }
.role-switch button { border: none; background: none; cursor: pointer; font-family: var(--font-body); font-weight: 600; font-size: 12.5px; color: var(--text-3); padding: 6px 13px; border-radius: var(--r-pill); display: inline-flex; align-items: center; gap: 6px; transition: all .15s; }
.role-switch button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.demo-tag { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .12em; color: var(--text-3); text-transform: uppercase; white-space: nowrap; }

/* ============================================================ GENERIC SCREEN PIECES */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 26px; }
.section-title { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.section-title h3 { font-size: 17px; white-space: nowrap; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.metric { display: flex; flex-direction: column; gap: 6px; }
.metric .v { font-family: var(--font-display); font-weight: 800; font-size: 30px; letter-spacing: -.02em; }
.metric .l { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }

.empty {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px;
  padding: 48px 24px; color: var(--text-3);
}
.empty-icon { width: 60px; height: 60px; border-radius: 16px; background: var(--surface-2); display: grid; place-items: center; color: var(--text-3); }

/* phase / journey */
.phase-rail { display: flex; flex-direction: column; gap: 0; }

/* topic bars */
.topic-row { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; align-items: center; padding: 13px 0; }
.topic-row + .topic-row { border-top: 1px solid var(--border); }
.topic-name { font-size: 14.5px; font-weight: 500; }
.topic-score { font-family: var(--font-mono); font-weight: 600; font-size: 14px; }
.topic-bar { grid-column: 1 / -1; }

/* file drop */
.dropzone {
  border: 1.5px dashed var(--border-strong); border-radius: var(--r-3); padding: 32px 24px; text-align: center;
  background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s; color: var(--text-2);
}
.dropzone:hover, .dropzone.drag { border-color: var(--primary); background: var(--primary-soft); }
.file-chip { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-2); }
.file-ico { width: 42px; height: 42px; border-radius: 10px; background: var(--fail-soft); color: var(--fail); display: grid; place-items: center; flex: none; }

/* table */
.dtable { width: 100%; border-collapse: collapse; }
.dtable th { text-align: left; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); font-weight: 500; padding: 0 16px 12px; }
.dtable td { padding: 14px 16px; border-top: 1px solid var(--border); font-size: 14px; vertical-align: middle; }
.dtable tbody tr { cursor: pointer; transition: background .12s; }
.dtable tbody tr:hover { background: var(--surface-2); }
.tcell-name { display: flex; align-items: center; gap: 12px; }

/* segmented */
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-2); padding: 3px; gap: 2px; }
.seg button { border: none; background: none; cursor: pointer; font-family: var(--font-body); font-weight: 600; font-size: 13px; color: var(--text-2); padding: 7px 14px; border-radius: var(--r-1); transition: all .15s; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.seg.seg-pass button.on.pass { color: var(--pass); }
.seg.seg-fail button.on.fail { color: var(--fail); }

/* instruction steps */
.istep { display: flex; gap: 16px; padding: 4px 0; }
.istep-num { width: 30px; height: 30px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-family: var(--font-mono); font-weight: 600; font-size: 13px; display: grid; place-items: center; flex: none; }
.istep-line { width: 2px; flex: 1; background: var(--border); margin: 4px auto; }

@media (max-width: 560px) {
  .page-head { flex-direction: column; }
  .metric .v { font-size: 26px; }
}
