:root {
  color-scheme: light;
  --ink: #11130f;
  --ink-soft: #5e6258;
  --paper: #f3f2eb;
  --panel: #ffffff;
  --line: #dedfd7;
  --line-dark: #c8cabf;
  --acid: #d8ff45;
  --acid-dark: #a8d000;
  --forest: #1f3429;
  --teal: #3a9d82;
  --orange: #f3a852;
  --lavender: #8176d8;
  --red: #d45f54;
  --shadow: 0 20px 50px rgba(30, 35, 26, 0.08);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
button { color: inherit; }
.is-hidden { display: none !important; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 850;
  letter-spacing: 0.04em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--acid);
  color: #12130f;
  font-size: 12px;
  letter-spacing: -0.03em;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.12);
}

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 1.06fr) minmax(460px, 0.94fr);
  background: #f8f8f3;
}

.login-story {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 56px;
  color: white;
  background:
    radial-gradient(circle at 82% 18%, rgba(216, 255, 69, 0.19), transparent 32%),
    linear-gradient(145deg, #15251d 0%, #263d31 55%, #132018 100%);
}

.login-story::before,
.login-story::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(216, 255, 69, 0.22);
  border-radius: 999px;
  transform: rotate(-18deg);
}

.login-story::before { width: 650px; height: 230px; left: -140px; bottom: 70px; }
.login-story::after { width: 760px; height: 330px; left: -40px; bottom: -75px; }
.brand-large { position: relative; z-index: 1; }

.story-copy { position: relative; z-index: 1; max-width: 680px; }
.story-copy h1 {
  margin: 14px 0 22px;
  font-size: clamp(48px, 5.5vw, 82px);
  line-height: 0.95;
  letter-spacing: -0.068em;
  font-weight: 720;
}
.story-copy > p:last-child { max-width: 520px; color: rgba(255,255,255,.66); font-size: 17px; line-height: 1.65; }
.eyebrow, .panel-kicker, .breadcrumb { margin: 0; font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.story-copy .eyebrow { color: var(--acid); }
.story-metric { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; font-size: 12px; color: rgba(255,255,255,.72); }
.pulse-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--acid); box-shadow: 0 0 0 5px rgba(216,255,69,.12); }

.login-panel { display: grid; place-items: center; padding: 44px; }
.login-card { width: min(100%, 430px); }
.login-card h2 { margin: 10px 0 8px; font-size: 40px; letter-spacing: -.045em; }
.muted { color: var(--ink-soft); line-height: 1.6; }
.login-card > label { display: block; margin: 34px 0 9px; font-size: 12px; font-weight: 700; }
.password-field { display: flex; border: 1px solid var(--line-dark); border-radius: 12px; background: white; overflow: hidden; transition: .18s ease; }
.password-field:focus-within { border-color: var(--forest); box-shadow: 0 0 0 4px rgba(31,52,41,.08); }
.password-field input { min-width: 0; flex: 1; border: 0; outline: 0; padding: 15px 16px; background: transparent; }
.show-password { border: 0; background: transparent; padding: 0 16px; color: var(--ink-soft); cursor: pointer; font-size: 12px; font-weight: 700; }
.primary-button, .secondary-button, .icon-button { border: 0; border-radius: 10px; cursor: pointer; font-weight: 750; transition: transform .16s ease, background .16s ease, opacity .16s ease; }
.primary-button { background: var(--ink); color: white; }
.primary-button:hover { background: #252821; transform: translateY(-1px); }
.login-button { width: 100%; margin-top: 14px; padding: 16px 18px; display: flex; justify-content: space-between; }
.login-button:disabled, button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.form-message { min-height: 20px; margin: 12px 0 0; color: var(--red); font-size: 12px; }
.secure-note { margin-top: 30px; display: flex; justify-content: center; gap: 8px; color: #81847c; font-size: 11px; }
.secure-note span:first-child { color: var(--teal); }
.mobile-brand { display: none; margin-bottom: 48px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 236px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 28px 18px 20px; color: white; background: #141812; }
.sidebar-brand { padding: 0 10px; }
.workspace-label { margin: 24px 10px 18px; padding-top: 18px; color: #71766d; border-top: 1px solid #2c3129; font-size: 10px; letter-spacing: .13em; text-transform: uppercase; }
.nav-list { display: grid; gap: 5px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border: 0; border-radius: 9px; color: #aeb2aa; background: transparent; cursor: pointer; text-align: left; font-size: 13px; }
.nav-item:hover { color: white; background: #21271e; }
.nav-item.is-active { color: #10130e; background: var(--acid); font-weight: 750; }
.nav-glyph { width: 22px; font-size: 9px; font-weight: 800; opacity: .6; letter-spacing: .06em; }
.sidebar-foot { margin-top: auto; }
.data-status { display: flex; align-items: center; gap: 12px; margin: 0 9px 18px; }
.data-status div { display: grid; gap: 3px; }
.data-status strong { font-size: 11px; }
.data-status span:last-child { color: #777d73; font-size: 10px; }
.text-button { padding: 10px; border: 0; color: #8e9389; background: transparent; cursor: pointer; font-size: 11px; }
.text-button:hover { color: white; }

.main-content { min-width: 0; padding: 0 34px 56px; }
.topbar { min-height: 96px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.breadcrumb { margin-bottom: 7px; color: #9a9e94; font-size: 9px; }
.topbar h1 { margin: 0; font-size: 24px; letter-spacing: -.035em; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.range-control { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px 0 13px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.58); }
.range-control span { color: var(--ink-soft); font-size: 10px; }
.range-control select { border: 0; outline: 0; background: transparent; font-weight: 700; font-size: 11px; }
.secondary-button { padding: 10px 13px; border: 1px solid var(--line); background: white; font-size: 11px; }
.secondary-button:hover { border-color: var(--line-dark); background: #fafaf7; }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--line); background: white; font-size: 17px; }
.icon-button:hover { transform: rotate(20deg); }
.loading-banner { position: fixed; z-index: 20; top: 14px; left: calc(50% + 118px); transform: translateX(-50%); display: flex; align-items: center; gap: 9px; padding: 9px 14px; border-radius: 99px; background: var(--ink); color: white; box-shadow: var(--shadow); font-size: 11px; }
.loading-banner span:first-child { width: 7px; height: 7px; border-radius: 50%; background: var(--acid); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.view { display: none; animation: reveal .22s ease; }
.view.is-active { display: block; }
@keyframes reveal { from { opacity: 0; transform: translateY(4px); } }
.section-intro { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding: 36px 0 22px; }
.section-intro .eyebrow { margin-bottom: 9px; color: #767b71; }
.section-intro h2 { margin: 0; font-size: 30px; letter-spacing: -.045em; }
.section-note { margin: 0; color: var(--ink-soft); font-size: 11px; }

.kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.kpi-card { min-height: 126px; display: flex; flex-direction: column; padding: 17px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.78); }
.kpi-card.featured { color: white; background: var(--forest); border-color: var(--forest); }
.kpi-label { display: flex; justify-content: space-between; gap: 8px; color: var(--ink-soft); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.featured .kpi-label { color: rgba(255,255,255,.6); }
.kpi-value { margin: auto 0 7px; font-size: 31px; font-weight: 730; letter-spacing: -.055em; }
.kpi-foot { display: flex; align-items: center; gap: 7px; color: #858981; font-size: 10px; }
.change { display: inline-flex; padding: 3px 6px; border-radius: 5px; background: #edf4e9; color: #39703e; font-weight: 800; }
.change.down { color: #a34840; background: #f8e8e5; }
.featured .change { color: var(--acid); background: rgba(216,255,69,.11); }

.dashboard-grid { display: grid; gap: 10px; }
.dashboard-grid-main { grid-template-columns: minmax(0, 1.55fr) minmax(260px, .65fr); }
.panel { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.panel-head { display: flex; justify-content: space-between; align-items: start; gap: 18px; margin-bottom: 18px; }
.panel-kicker { margin-bottom: 7px; color: #8b8f86; font-size: 9px; }
.panel h3 { margin: 0; font-size: 16px; letter-spacing: -.025em; }
.panel-meta { color: #969a92; font-size: 9px; }
.trend-panel { min-height: 430px; }
.segmented-control { display: flex; gap: 2px; padding: 3px; border-radius: 8px; background: #f1f1ec; }
.segmented-control button { border: 0; border-radius: 6px; padding: 6px 9px; color: #777b72; background: transparent; cursor: pointer; font-size: 9px; font-weight: 750; }
.segmented-control button.is-active { color: var(--ink); background: white; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.chart-statline { min-height: 48px; display: flex; align-items: baseline; gap: 10px; }
.chart-statline strong { font-size: 34px; letter-spacing: -.055em; }
.chart-statline span { color: var(--ink-soft); font-size: 10px; }
.canvas-wrap { position: relative; width: 100%; }
.line-canvas-wrap { height: 235px; }
.line-canvas-wrap canvas { width: 100%; height: 100%; }
.chart-tooltip { position: absolute; pointer-events: none; z-index: 4; transform: translate(-50%, -110%); padding: 7px 9px; border-radius: 7px; background: #11150f; color: white; font-size: 9px; white-space: nowrap; box-shadow: 0 6px 16px rgba(0,0,0,.2); }
.chart-axis { display: flex; justify-content: space-between; margin-top: 6px; color: #979b92; font-size: 9px; }
.quality-metrics { display: grid; gap: 2px; }
.quality-row { padding: 15px 0; border-bottom: 1px solid #ecece7; }
.quality-row:last-child { border-bottom: 0; }
.quality-row > div:first-child { display: flex; justify-content: space-between; align-items: baseline; }
.quality-row strong { font-size: 22px; letter-spacing: -.04em; }
.quality-row span { color: var(--ink-soft); font-size: 10px; }
.mini-track { height: 4px; margin-top: 11px; border-radius: 99px; background: #edeee8; overflow: hidden; }
.mini-track i { display: block; height: 100%; border-radius: inherit; background: var(--acid-dark); }
.funnel-panel, .heatmap-panel { min-height: 330px; }
.funnel { display: grid; gap: 9px; }
.funnel-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 48px; align-items: center; gap: 10px; }
.funnel-row span { font-size: 10px; color: var(--ink-soft); }
.funnel-track { height: 26px; border-radius: 6px; background: #f0f1eb; overflow: hidden; }
.funnel-fill { height: 100%; min-width: 2px; background: var(--forest); border-radius: inherit; opacity: calc(.58 + var(--row) * .085); transition: width .5s ease; }
.funnel-row strong { font-size: 10px; text-align: right; }
.heatmap { overflow-x: auto; }
.heatmap-grid { min-width: 510px; display: grid; grid-template-columns: 34px repeat(6, 1fr); gap: 5px; align-items: center; }
.heat-label { color: #8c9087; font-size: 8px; text-align: center; }
.heat-day { color: #6f746a; font-size: 9px; }
.heat-cell { height: 22px; border-radius: 5px; background: color-mix(in srgb, var(--acid-dark) calc(var(--level) * 18%), #eff0ea); }
.heat-legend { margin-top: 14px; display: flex; align-items: center; justify-content: end; gap: 5px; color: #969a91; font-size: 8px; }
.heat-legend i { width: 14px; height: 8px; border-radius: 2px; background: #eff0ea; }
.heat-legend i:nth-of-type(2) { background: #dce8ae; }
.heat-legend i:nth-of-type(3) { background: #b9d34d; }
.heat-legend i:nth-of-type(4) { background: #829d19; }

.training-layout { display: grid; grid-template-columns: minmax(360px, 1.18fr) repeat(2, minmax(250px, .82fr)); gap: 10px; }
.panel-tall { grid-row: span 2; }
.ranking-list { display: grid; }
.ranking-item { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 11px; align-items: center; padding: 12px 0; border-bottom: 1px solid #eeeeea; }
.ranking-item:last-child { border: 0; }
.ranking-index { color: #9b9f96; font-size: 9px; font-weight: 800; }
.ranking-name { min-width: 0; }
.ranking-name strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.ranking-name span { display: block; margin-top: 4px; color: #969a91; font-size: 9px; }
.ranking-value { text-align: right; }
.ranking-value strong { display: block; font-size: 13px; }
.ranking-value span { color: #999d94; font-size: 8px; }
.donut-layout { display: flex; align-items: center; gap: 20px; min-height: 210px; }
.donut-canvas { width: 150px; height: 150px; flex: none; }
.legend-list { min-width: 0; display: grid; gap: 8px; flex: 1; }
.legend-row { display: grid; grid-template-columns: 8px minmax(0,1fr) auto; gap: 7px; align-items: center; font-size: 9px; }
.legend-swatch { width: 8px; height: 8px; border-radius: 2px; }
.legend-row span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #666b62; }
.bar-list { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 74px minmax(0, 1fr) 38px; gap: 9px; align-items: center; }
.bar-row span { overflow: hidden; color: #70756b; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.bar-row strong { font-size: 9px; text-align: right; }
.bar-track { height: 7px; border-radius: 99px; background: #eff0eb; overflow: hidden; }
.bar-fill { height: 100%; border-radius: inherit; background: var(--teal); }
.compact-ranking { display: grid; gap: 8px; }
.compact-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid #eee; font-size: 10px; }
.compact-row:last-child { border: 0; }
.compact-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compact-row strong { font-size: 10px; }

.three-column-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-two { grid-column: span 2; }
.milestone-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.milestone-card { padding: 14px; border-radius: 10px; background: #f5f5ef; }
.milestone-card span { color: #8c9187; font-size: 8px; text-transform: uppercase; letter-spacing: .1em; }
.milestone-card strong { display: block; margin: 7px 0 4px; font-size: 11px; }
.milestone-card b { font-size: 20px; letter-spacing: -.04em; }
.wide-bars .bar-row { grid-template-columns: 130px minmax(0,1fr) 50px; }

.compact-kpi-grid { grid-template-columns: repeat(6, minmax(0,1fr)); }
.table-panel { padding-bottom: 10px; }
.table-scroll { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 10px 12px; color: #8d9189; border-bottom: 1px solid var(--line); text-align: left; font-size: 8px; text-transform: uppercase; letter-spacing: .1em; white-space: nowrap; }
td { padding: 14px 12px; border-bottom: 1px solid #efefe9; font-size: 10px; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafaf6; }
.visibility-badge, .status-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 99px; background: #eef4e9; color: #37623d; font-size: 8px; font-weight: 750; }
.visibility-badge.private, .status-badge.unverified { color: #966b2b; background: #f7efe1; }
.top-user-panel { margin-bottom: 10px; }
.top-user-cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.top-user-card { position: relative; padding: 14px; border: 1px solid #e5e6df; border-radius: 11px; overflow: hidden; }
.top-user-card::after { content: ""; position: absolute; width: 64px; height: 64px; border-radius: 50%; right: -32px; bottom: -32px; background: var(--acid); opacity: .7; }
.user-avatar { display: grid; place-items: center; width: 30px; height: 30px; margin-bottom: 12px; border-radius: 9px; background: var(--forest); color: white; font-size: 10px; font-weight: 800; }
.top-user-card strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.top-user-card span { display: block; margin-top: 5px; color: #8b9086; font-size: 8px; }
.top-user-card b { display: block; margin-top: 15px; font-size: 19px; letter-spacing: -.04em; }
.directory-head { align-items: center; }
.search-field { width: 260px; display: flex; align-items: center; gap: 7px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; }
.search-field span { color: #9ca098; }
.search-field input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; font-size: 10px; }
.member-cell { display: flex; align-items: center; gap: 9px; }
.member-cell .user-avatar { width: 26px; height: 26px; margin: 0; border-radius: 7px; font-size: 8px; }
.member-cell div { display: grid; gap: 2px; }
.member-cell span { color: #999d95; font-size: 8px; }
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 12px; border-top: 1px solid var(--line); color: #858a80; font-size: 9px; }
.pagination div { display: flex; gap: 6px; }
.pagination .secondary-button { padding: 7px 9px; }
.empty-state { padding: 28px; color: #92978e; text-align: center; font-size: 10px; }
.toast { position: fixed; z-index: 50; right: 24px; bottom: 24px; padding: 12px 15px; border-radius: 10px; color: white; background: var(--ink); box-shadow: var(--shadow); font-size: 10px; }

@media (max-width: 1280px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .training-layout { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .panel-tall { grid-row: span 3; }
  .top-user-cards { grid-template-columns: repeat(3, minmax(0,1fr)); }
}

@media (max-width: 960px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-story { display: none; }
  .mobile-brand { display: flex; }
  .app-shell { grid-template-columns: 74px minmax(0,1fr); }
  .sidebar { padding-inline: 10px; }
  .sidebar-brand span:last-child, .workspace-label, .nav-item span:last-child, .data-status div, .text-button { display: none; }
  .sidebar-brand { padding: 0 10px; }
  .nav-item { justify-content: center; padding: 13px; }
  .nav-glyph { width: auto; }
  .data-status { justify-content: center; }
  .main-content { padding-inline: 22px; }
  .dashboard-grid-main, .three-column-grid { grid-template-columns: 1fr; }
  .span-two { grid-column: auto; }
  .compact-kpi-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
}

@media (max-width: 680px) {
  .login-panel { padding: 28px; }
  .app-shell { display: block; }
  .sidebar { position: fixed; z-index: 30; top: auto; bottom: 0; width: 100%; height: 64px; flex-direction: row; align-items: center; padding: 7px; }
  .sidebar-brand, .workspace-label, .sidebar-foot { display: none; }
  .nav-list { width: 100%; display: grid; grid-template-columns: repeat(5, 1fr); }
  .nav-item { padding: 11px 4px; }
  .main-content { padding: 0 14px 84px; }
  .topbar { align-items: start; padding: 18px 0; }
  .topbar-actions { flex-wrap: wrap; justify-content: end; }
  .secondary-button#export-button { display: none; }
  .range-control span { display: none; }
  .section-intro { align-items: start; }
  .section-intro h2 { font-size: 25px; }
  .section-note { display: none; }
  .kpi-grid, .compact-kpi-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .training-layout { grid-template-columns: 1fr; }
  .panel-tall { grid-row: auto; }
  .milestone-grid { grid-template-columns: 1fr; }
  .top-user-cards { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .directory-head { align-items: stretch; flex-direction: column; }
  .search-field { width: 100%; }
  .loading-banner { left: 50%; }
}
