:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #697386;
  --line: #e4e8ef;
  --paper: #ffffff;
  --canvas: #f3f5f8;
  --navy: #0b1220;
  --navy-2: #1c2537;
  --mint: #ffffff;
  --mint-dark: #174fc7;
  --blue: #2f6df5;
  --violet: #2f6df5;
  --orange: #f5a524;
  --red: #e25263;
  --green: #219f79;
  --shadow: 0 18px 50px rgba(16, 23, 42, 0.08);
  --radius: 18px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--canvas); color: var(--ink); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(330px, 0.92fr) minmax(520px, 1.45fr);
  background: var(--navy);
}

.auth-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(28px, 5vw, 72px);
  color: #fff;
  overflow: hidden;
}

.auth-panel::after {
  content: "";
  position: absolute;
  width: 380px;
  height: 380px;
  border: 1px solid rgba(110, 231, 216, 0.22);
  border-radius: 50%;
  right: -180px;
  bottom: -90px;
  box-shadow: 0 0 0 70px rgba(110, 231, 216, 0.035), 0 0 0 140px rgba(110, 231, 216, 0.025);
}

.brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 750; letter-spacing: -0.02em; }
.brand-mark { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: transparent; border: 1.5px solid currentColor; color: inherit; font-size: 11px; font-weight: 900; letter-spacing: -0.04em; }
.brand-copy { display: grid; gap: 1px; }
.brand-copy strong { font-size: 16px; letter-spacing: .02em; }
.brand-copy small { font-size: 11px; font-weight: 550; opacity: .7; }
.auth-copy { position: relative; z-index: 1; max-width: 520px; }
.auth-copy h1 { margin: 0 0 18px; font-size: clamp(38px, 5vw, 72px); line-height: 0.98; letter-spacing: -0.055em; }
.auth-copy p { margin: 0; max-width: 420px; color: #bdc6d8; font-size: 18px; line-height: 1.6; }
.auth-meta { position: relative; z-index: 1; display: flex; gap: 20px; color: #96a1b8; font-size: 14px; }

.auth-form-wrap { display: grid; place-items: center; padding: 28px; background: #f7f8fb; }
.auth-card { width: min(100%, 480px); background: #fff; border-radius: 28px; padding: clamp(28px, 5vw, 52px); box-shadow: var(--shadow); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--mint-dark); font-size: 13px; font-weight: 750; text-transform: uppercase; letter-spacing: 0.08em; }
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--mint-dark); }
.auth-card h2 { margin: 14px 0 8px; font-size: 30px; letter-spacing: -0.035em; }
.auth-card > p { margin: 0 0 30px; color: var(--muted); line-height: 1.55; }
.field { display: grid; gap: 8px; margin-bottom: 18px; }
.field label { font-size: 14px; font-weight: 650; }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid #d8dee8; border-radius: 12px; padding: 13px 14px; color: var(--ink); background: #fff; outline: none;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(79, 108, 255, 0.12); }
.field small { color: var(--muted); }
.btn { border: 0; border-radius: 12px; padding: 12px 17px; min-height: 44px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .18s, box-shadow .18s, background .18s; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--navy); color: #fff; box-shadow: 0 8px 22px rgba(16, 23, 42, .18); }
.btn-primary:hover { background: #1d2948; }
.btn-accent { background: #fff; color: var(--blue); }
.btn-ghost { background: #f1f3f7; color: var(--ink); }
.btn-outline { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-danger { color: var(--red); background: #fff0f2; }
.btn-block { width: 100%; }
.auth-switch { margin-top: 18px; text-align: center; color: var(--muted); font-size: 14px; }
.link-button { border: 0; background: transparent; padding: 0; color: var(--blue); font-weight: 700; }
.demo-divider { display: flex; align-items: center; gap: 12px; color: #98a0af; font-size: 12px; margin: 24px 0 16px; }
.demo-divider::before, .demo-divider::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.demo-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 254px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 24px 18px; background: var(--navy); color: #d8deea; display: flex; flex-direction: column; z-index: 20; }
.sidebar .brand { padding: 0 10px; color: #fff; margin-bottom: 34px; }
.nav { display: grid; gap: 6px; }
.nav-button { border: 0; border-radius: 12px; background: transparent; color: #aab4c8; padding: 12px 13px; text-align: left; display: flex; align-items: center; gap: 12px; font-weight: 620; }
.nav-button svg { width: 20px; height: 20px; flex: none; }
.nav-button:hover { background: rgba(255,255,255,.055); color: #fff; }
.nav-button.active { background: var(--blue); color: #fff; }
.sidebar-spacer { flex: 1; }
.profile-card { border-top: 1px solid rgba(255,255,255,.1); padding: 18px 8px 0; display: flex; align-items: center; gap: 10px; }
.avatar { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: #293552; color: #fff; font-weight: 800; flex: none; }
.avatar.mint { background: #d8faf6; color: var(--mint-dark); }
.profile-meta { min-width: 0; flex: 1; }
.profile-name { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; font-size: 14px; font-weight: 700; }
.profile-role { display: block; color: #8490a8; font-size: 12px; margin-top: 2px; }
.logout { border: 0; background: transparent; color: #8290aa; padding: 6px; font-size: 18px; }

.main { min-width: 0; }
.topbar { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px clamp(20px, 4vw, 48px); background: rgba(243,245,248,.92); backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 15; border-bottom: 1px solid rgba(217,223,233,.75); }
.page-title h1 { margin: 0; font-size: clamp(24px, 3vw, 32px); letter-spacing: -0.035em; }
.page-title p { margin: 5px 0 0; color: var(--muted); font-size: 14px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.role-switch { border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 10px 12px; color: var(--ink); font-weight: 650; }
.mobile-menu { display: none; border: 0; background: #fff; border-radius: 10px; padding: 9px; }

.content { padding: 28px clamp(20px, 4vw, 48px) 48px; max-width: 1540px; margin: 0 auto; }
.grid { display: grid; gap: 18px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.layout-main { grid-template-columns: minmax(0, 1.65fr) minmax(300px, .75fr); align-items: start; }
.card { background: var(--paper); border: 1px solid rgba(220,225,234,.9); border-radius: var(--radius); box-shadow: 0 7px 24px rgba(16,23,42,.035); }
.card-pad { padding: 22px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.card-head h2, .card-head h3 { margin: 0; letter-spacing: -0.025em; }
.card-head h2 { font-size: 21px; }
.card-head h3 { font-size: 18px; }
.card-head p { margin: 5px 0 0; color: var(--muted); font-size: 14px; }
.metric-card { min-height: 134px; padding: 20px; position: relative; overflow: hidden; }
.metric-card::after { content: ""; position: absolute; width: 80px; height: 80px; border-radius: 50%; right: -28px; top: -30px; background: var(--metric-soft, #edf0ff); }
.metric-label { color: var(--muted); font-size: 14px; }
.metric-value { margin-top: 12px; font-size: 29px; font-weight: 800; letter-spacing: -0.04em; }
.metric-detail { margin-top: 8px; font-size: 13px; color: var(--muted); }
.metric-detail strong { color: var(--green); }

.hero-card { min-height: 280px; padding: clamp(24px, 4vw, 38px); color: #fff; background: linear-gradient(135deg, #174fc7 0%, #2f6df5 68%, #4b78ec 100%); border: 0; position: relative; overflow: hidden; }
.hero-card::after { content: ""; position: absolute; width: 260px; height: 260px; right: -70px; top: -90px; border: 42px solid rgba(110,231,216,.1); border-radius: 50%; }
.hero-card .eyebrow { color: #fff; }
.hero-card .eyebrow::before { background: #fff; }
.hero-card h2 { max-width: 560px; margin: 16px 0 10px; font-size: clamp(28px, 4vw, 43px); line-height: 1.06; letter-spacing: -0.045em; }
.hero-card p { color: #bac5d8; max-width: 590px; margin: 0 0 24px; line-height: 1.55; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-stat { position: absolute; right: 34px; bottom: 32px; width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center; border: 13px solid rgba(255,255,255,.16); border-top-color: #fff; text-align: center; z-index: 1; }
.hero-stat strong { display: block; font-size: 28px; }
.hero-stat span { font-size: 12px; color: #aebbd1; }

.progress { height: 9px; border-radius: 99px; background: #edf0f4; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--mint-dark)); }
.progress-label { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); margin-top: 8px; }
.module-list, .check-list, .feed-list { display: grid; gap: 10px; }
.module-row { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.module-row:hover { border-color: #b9c3d5; }
.module-index { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: #f0f3f8; font-weight: 800; color: var(--blue); }
.module-row.done .module-index { color: var(--mint-dark); background: #ddf8f4; }
.module-title { font-weight: 700; }
.module-meta { margin-top: 4px; color: var(--muted); font-size: 13px; }
.status { display: inline-flex; align-items: center; gap: 6px; border-radius: 99px; padding: 6px 9px; font-size: 12px; font-weight: 750; white-space: nowrap; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.done { color: #167c61; background: #e2f8f1; }
.status.progressing { color: #3d59d9; background: #eaedff; }
.status.pending { color: #7b8496; background: #f0f2f5; }
.status.attention { color: #bd6533; background: #fff0e7; }

.task { display: flex; align-items: flex-start; gap: 11px; padding: 11px 0; border-bottom: 1px solid #edf0f4; }
.task:last-child { border-bottom: 0; }
.task input { width: 19px; height: 19px; accent-color: var(--mint-dark); margin-top: 1px; }
.task label { flex: 1; line-height: 1.45; }
.task small { display: block; color: var(--muted); margin-top: 3px; }
.streak { display: flex; gap: 7px; margin-top: 18px; }
.streak-day { flex: 1; min-width: 30px; text-align: center; }
.streak-dot { width: 100%; aspect-ratio: 1; max-width: 36px; margin: 0 auto 6px; border-radius: 10px; display: grid; place-items: center; background: #edf0f4; color: #8892a4; font-size: 12px; font-weight: 750; }
.streak-dot.active { background: var(--blue); color: #fff; }
.streak-day span { font-size: 11px; color: var(--muted); }

.section-gap { margin-top: 18px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th { padding: 12px 14px; text-align: left; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; background: #f6f7f9; }
td { padding: 15px 14px; border-bottom: 1px solid #edf0f4; vertical-align: middle; font-size: 14px; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbfc; }
.person { display: flex; align-items: center; gap: 10px; }
.person strong { display: block; }
.person small { color: var(--muted); }
.spark { width: 96px; height: 30px; }
.spark polyline { fill: none; stroke: var(--blue); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.money { font-variant-numeric: tabular-nums; font-weight: 740; }

.kpi-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.kpi-form .field { margin: 0; }
.kpi-form .wide { grid-column: 1 / -1; }
.form-section { padding: 22px 0; border-top: 1px solid var(--line); }
.form-section:first-of-type { border-top: 0; padding-top: 0; }
.form-section h3 { margin: 0 0 16px; font-size: 17px; }
.range-line { display: grid; grid-template-columns: minmax(0,1fr) 62px; gap: 12px; align-items: center; }
input[type="range"] { accent-color: var(--blue); }
.score-box { border-radius: 16px; padding: 18px; background: #f5f7fb; }
.score-total { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.score-total strong { font-size: 30px; letter-spacing: -0.04em; }
.bonus-breakdown { display: grid; gap: 10px; margin-top: 18px; }
.bonus-row { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 14px; }
.bonus-row strong { color: var(--ink); }
.bonus-row.total { border-top: 1px solid #dfe4ed; padding-top: 12px; color: var(--ink); font-weight: 750; }
.bonus-row.total strong { font-size: 20px; }

.lesson-layout { grid-template-columns: 320px minmax(0, 1fr); align-items: start; }
.course-outline { padding: 14px; position: sticky; top: 102px; }
.course-item { width: 100%; border: 0; background: transparent; text-align: left; padding: 13px; border-radius: 12px; display: grid; grid-template-columns: 28px 1fr; gap: 10px; color: var(--ink); }
.course-item:hover { background: #f5f7fa; }
.course-item.active { background: var(--navy); color: #fff; }
.course-item.done .course-num { background: #dff8f4; color: var(--mint-dark); }
.course-num { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: #edf0f5; color: var(--muted); font-size: 12px; font-weight: 800; }
.course-item.active .course-num { background: #fff; color: var(--blue); }
.course-item strong { display: block; font-size: 14px; }
.course-item small { display: block; margin-top: 3px; opacity: .65; }
.lesson { padding: clamp(24px, 5vw, 48px); }
.lesson h2 { margin: 12px 0 14px; font-size: clamp(28px, 4vw, 42px); letter-spacing: -0.045em; }
.lesson-lead { color: var(--muted); font-size: 17px; line-height: 1.65; max-width: 780px; }
.lesson-block { margin-top: 30px; }
.lesson-block h3 { font-size: 19px; margin: 0 0 12px; }
.lesson-block p, .lesson-block li { line-height: 1.65; color: #3c475b; }
.lesson-block ul { padding-left: 20px; }
.callout { border-left: 4px solid var(--mint-dark); background: #effbf9; padding: 18px 20px; border-radius: 0 12px 12px 0; color: #245650; line-height: 1.55; }
.script-box { background: var(--navy); color: #dce4f2; padding: 22px; border-radius: 14px; line-height: 1.65; }
.quiz-option { width: 100%; text-align: left; border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 14px; margin-bottom: 9px; }
.quiz-option:hover { border-color: var(--blue); }
.quiz-option.selected { border-color: var(--blue); background: #f0f2ff; }

.integration-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.integration-card { padding: 22px; }
.integration-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: #eff2f7; font-weight: 900; color: var(--blue); margin-bottom: 18px; }
.integration-card h3 { margin: 0 0 8px; }
.integration-card p { color: var(--muted); font-size: 14px; line-height: 1.5; min-height: 63px; }
.roadmap { display: grid; gap: 0; margin-top: 12px; }
.roadmap-step { display: grid; grid-template-columns: 26px 1fr; gap: 12px; position: relative; padding-bottom: 18px; }
.roadmap-step:not(:last-child)::before { content: ""; position: absolute; width: 2px; background: #dfe4eb; left: 12px; top: 25px; bottom: 0; }
.roadmap-dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #e9edf4; color: var(--muted); font-size: 11px; font-weight: 800; z-index: 1; }
.roadmap-step.active .roadmap-dot { background: var(--blue); color: #fff; }

.report-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.report-actions select { border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 11px 13px; min-height: 44px; }
.roadmap-step strong { display: block; }
.roadmap-step small { color: var(--muted); line-height: 1.4; }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.toast-root { position: fixed; right: 22px; bottom: 22px; z-index: 100; display: grid; gap: 10px; }
.toast { max-width: 360px; background: var(--navy); color: #fff; padding: 14px 16px; border-radius: 12px; box-shadow: 0 12px 35px rgba(16,23,42,.25); animation: toast-in .2s ease-out; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

.drawer-backdrop { position: fixed; inset: 0; background: rgba(14,20,34,.35); z-index: 40; display: flex; justify-content: flex-end; }
.drawer { width: min(520px, 100%); height: 100%; background: #fff; padding: 28px; overflow: auto; box-shadow: -20px 0 55px rgba(16,23,42,.18); }
.drawer-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.drawer-head h2 { margin: 0; }
.icon-button { border: 0; background: #f0f2f5; width: 38px; height: 38px; border-radius: 10px; font-size: 18px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 22px; }
.detail-cell { padding: 15px; background: #f6f7fa; border-radius: 12px; }
.detail-cell span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 5px; }
.detail-cell strong { font-size: 18px; }
.note { font-size: 13px; color: var(--muted); line-height: 1.5; }

@media (max-width: 1120px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .layout-main { grid-template-columns: 1fr; }
  .integration-grid { grid-template-columns: 1fr; }
  .hero-stat { display: none; }
}

@media (max-width: 820px) {
  .auth-shell { grid-template-columns: 1fr; background: #f7f8fb; }
  .auth-panel { min-height: 280px; padding: 28px; }
  .auth-copy h1 { font-size: 42px; }
  .auth-meta { display: none; }
  .auth-form-wrap { padding: 18px; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-105%); width: 270px; transition: transform .22s; box-shadow: 10px 0 35px rgba(16,23,42,.18); }
  .sidebar.open { transform: translateX(0); }
  .mobile-menu { display: grid; place-items: center; }
  .topbar { padding: 14px 18px; }
  .top-actions .role-switch { display: none; }
  .content { padding: 20px 16px 36px; }
  .grid-3, .grid-2, .lesson-layout { grid-template-columns: 1fr; }
  .course-outline { position: static; }
  .kpi-form { grid-template-columns: 1fr; }
  .kpi-form .wide { grid-column: auto; }
}

@media (max-width: 520px) {
  .grid-4 { grid-template-columns: 1fr; }
  .demo-buttons { grid-template-columns: 1fr; }
  .auth-card { padding: 26px 20px; border-radius: 20px; }
  .auth-panel { min-height: 240px; }
  .auth-copy p { font-size: 16px; }
  .hero-card { min-height: auto; }
  .hero-actions { display: grid; }
  .hero-actions .btn { width: 100%; }
  .page-title p { display: none; }
  .detail-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
