/* =========================================================
   적법도급 자동진단 시스템
   Design language: a2o Entertainment (verified against live screenshots)

   What a2o actually does (NOT what I assumed twice before):
   1. NO content cards. Content sits directly on pure #fff.
      The only structure is a 1px hairline (#d5d5d5).
   2. ENORMOUS whitespace. 180px above the first heading,
      120px+ between blocks. Never 24px.
   3. Display type = extra-extended BLACK (wght 800~900),
      POSITIVE tracking (+0.02~0.03em), leading 1.02~1.1.
   4. Body = Pretendard 700 at 17~19px, leading 1.5.
   5. One full-bleed #000 section as the dramatic moment
      (hero video / ER banner).
   6. Latin & numerals carry the "extended black" voice —
      Korean stays Pretendard 800.
   7. NO shadows. Anywhere.
   ========================================================= */

/* ---------------- 1. Tokens ---------------- */
:root {
  --font-display: 'Archivo', 'Pretendard Variable', Pretendard, sans-serif;
  --font-body: 'Pretendard Variable', Pretendard, -apple-system,
    BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
  --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
  --font: var(--font-body);

  /* a2o normal ramp: normal1 #000 → normal11 #fff */
  --n1: #000000;
  --n2: #141414;
  --n3: #272727;
  --n4: #363636;
  --n5: #626262;
  --n7: #afafaf;
  --n9: #d5d5d5;
  --n10: #ececec;
  --n11: #ffffff;

  /* semantic surface roles (theme-swapped) */
  --bg: var(--n11);
  --ink: var(--n1);
  --ink-2: var(--n3);
  --ink-3: var(--n5);
  --ink-4: var(--n7);
  --line: var(--n9);
  --line-2: var(--n10);
  --inv-bg: var(--n1);
  --inv-ink: var(--n11);

  /* 삼구 그린 — used sparingly, only as a judgement signal */
  --accent: #1f8a4c;
  --accent-ink: #14663a;
  --accent-soft: #e6f6ec;

  --danger: #d92d20;
  --danger-soft: #fdeceb;
  --warn: #b54708;
  --warn-soft: #fdf3e7;
  --pos: #1f8a4c;
  --pos-soft: #e6f6ec;
  --info: #175cd3;
  --info-soft: #eef4ff;

  --radius-lg: 10px;
  --radius-xl: 15px;
  --radius-full: 999px;

  --tracking-headline: 0.022em;
  --tracking-body: -0.012em;
  --tracking-wider: 0.08em;
  --tracking-widest: 0.14em;

  --leading-headline: 1.06;
  --leading-body: 1.55;

  --sp: 4px;
  --hdr: 68px;
  --max: 1480px;
  --main-top: 132px;
  --gut: 64px;
  --ease: cubic-bezier(0.22, 0.61, 0.24, 1);

  --shadow: none;
  --shadow-pop: 0 24px 60px -20px rgba(0, 0, 0, 0.34);
  color-scheme: light;
}

/* ---------------- dark ---------------- */
:root[data-theme='dark'] {
  --bg: #0a0a0a;
  --ink: #ffffff;
  --ink-2: #e4e4e4;
  --ink-3: #9c9c9c;
  --ink-4: #6e6e6e;
  --line: #2b2b2b;
  --line-2: #1d1d1d;
  --inv-bg: #ffffff;
  --inv-ink: #0a0a0a;

  --n1: #ffffff;
  --n2: #f2f2f2;
  --n3: #e4e4e4;
  --n4: #c8c8c8;
  --n5: #9c9c9c;
  --n7: #6e6e6e;
  --n9: #2b2b2b;
  --n10: #1d1d1d;
  --n11: #0a0a0a;

  --accent: #3ddc84;
  --accent-ink: #7ff0ac;
  --accent-soft: #12291c;

  --danger: #ff6b5e;
  --danger-soft: #2e1614;
  --warn: #f5a524;
  --warn-soft: #2c2010;
  --pos: #3ddc84;
  --pos-soft: #12291c;
  --info: #6ba6ff;
  --info-soft: #101d31;
  color-scheme: dark;
}

/* ---------------- 2. Reset ---------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* clip (not hidden) so position:sticky descendants keep working */
  overflow-x: clip;
}
body {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  line-height: var(--leading-body);
  letter-spacing: var(--tracking-body);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  word-break: keep-all;
  overflow-wrap: break-word;
}
img,
svg {
  display: block;
  max-width: 100%;
}
button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
}
button {
  background: none;
  border: 0;
  cursor: pointer;
}
a {
  color: inherit;
  text-decoration: none;
}
h1,
h2,
h3,
h4,
p,
ul,
ol,
figure {
  margin: 0;
}
ul,
ol {
  list-style: none;
  padding: 0;
}
::selection {
  background: var(--ink);
  color: var(--bg);
}

/* ---------------- 3. Typography ---------------- */
/* Latin + numerals: the extra-extended BLACK voice */
.latin,
.eyebrow,
.th,
.panel-eyebrow,
.brand-pop,
.stat-k,
.ph-step,
.hist-k {
  font-family: var(--font-display);
  font-weight: 800;
  font-variation-settings: 'wdth' 122, 'wght' 800;
  text-transform: uppercase;
  letter-spacing: var(--tracking-widest);
  font-size: 11px;
  line-height: 1.2;
  color: var(--ink-3);
}

/* Korean display: same weight, but Pretendard carries Hangul */
.h1,
.page-h,
.auth-h,
.section-title,
.panel-title,
.ph-title,
.er-banner h3,
.sum-big,
.stat-card h3 {
  font-family: var(--font-body);
  font-weight: 800;
  letter-spacing: var(--tracking-headline);
  line-height: var(--leading-headline);
  color: var(--ink);
  word-break: keep-all;
}

.h1,
.page-h {
  font-size: clamp(38px, 5.2vw, 76px);
  font-weight: 900;
  letter-spacing: 0.002em;
  line-height: 0.98;
}

/* numerals always tabular + extended */
.num,
.kpi .val,
.sb-total .n,
.sum-big,
.donut-center b,
.tp-amt,
.stat-card .n {
  font-family: var(--font-display);
  font-variation-settings: 'wdth' 118, 'wght' 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

/* ---------------- 4. Layout ---------------- */
.app {
  padding-top: var(--hdr);
  min-height: 100vh;
}
.main {
  max-width: var(--max);
  margin: 0 auto;
  padding: var(--main-top) var(--gut) 168px;
}
.screen {
  display: none;
}
.screen.active {
  display: block;
}

/* a2o: page opens with a huge air gap, then a headline, then a rule */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  padding-bottom: 36px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--line);
}
.page-head-l {
  min-width: 0;
}
.page-head .eyebrow {
  display: block;
  margin-bottom: 26px;
  color: var(--ink-4);
}
.page-head .h1 em {
  font-style: normal;
  color: var(--accent);
}
.page-sub {
  margin-top: 22px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-3);
  max-width: 62ch;
  line-height: 1.6;
}
.page-head-r {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  padding-bottom: 6px;
}

/* ---------------- 5. Header ---------------- */
.hdr {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--hdr);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  z-index: 100;
  /* no backdrop-filter: it caused the scroll jitter */
}
.hdr-in {
  max-width: var(--max);
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--gut);
  display: flex;
  align-items: center;
  gap: 48px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}
.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  display: grid;
  place-items: center;
}
.brand-mark svg {
  width: 18px;
  height: 18px;
}
.brand-txt {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.brand-name {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.01em;
  line-height: 1;
  color: var(--ink);
  white-space: nowrap;
}
.brand-name em {
  font-style: normal;
  color: var(--accent);
  margin-left: 3px;
}
.brand-sub {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 800;
  font-variation-settings: 'wdth' 118, 'wght' 800;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-4);
  white-space: nowrap;
}

/* nav = small tracked text, active = ink + underline. no pills. */
.nav {
  display: flex;
  align-items: center;
  gap: 34px;
  flex: 1 1 auto;
  min-width: 0;
}
.nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.015em;
  color: var(--ink-3);
  white-space: nowrap;
  transition: color 0.18s var(--ease);
}
.nav a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -22px;
  height: 2px;
  background: transparent;
  transition: background 0.18s var(--ease);
}
.nav a:hover {
  color: var(--ink);
}
.nav a.active {
  color: var(--ink);
  font-weight: 800;
}
.nav a.active::after {
  background: var(--ink);
}
.nav a .count {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 800;
  font-variation-settings: 'wdth' 112, 'wght' 800;
  color: var(--ink-4);
  font-variant-numeric: tabular-nums;
}
.nav a.active .count {
  color: var(--ink-3);
}

.hdr-right {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 0 0 auto;
}
.presence {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  white-space: nowrap;
}
.presence .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent);
  animation: pulse 2.4s infinite;
}
.presence b {
  font-family: var(--font-display);
  font-variation-settings: 'wdth' 112, 'wght' 800;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(31, 138, 76, 0.5);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(31, 138, 76, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(31, 138, 76, 0);
  }
}
.icon-btn {
  position: relative;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-full);
  color: var(--ink-3);
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}
.icon-btn svg {
  width: 17px;
  height: 17px;
}
.icon-btn:hover {
  background: var(--line-2);
  color: var(--ink);
}
.icon-btn .bDot {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--danger);
  border: 1px solid var(--bg);
}

/* nickname ABOVE, theme toggle BELOW — vertical stack */
.user-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  padding-left: 20px;
  margin-left: 4px;
  border-left: 1px solid var(--line);
}
.user-name {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--ink);
  line-height: 1.15;
  white-space: nowrap;
}
.avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 8.5px;
  font-weight: 800;
  font-variation-settings: 'wdth' 112, 'wght' 800;
  letter-spacing: 0.02em;
}
.user-role {
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-4);
  letter-spacing: 0.02em;
}
.theme-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--ink-4);
  transition: color 0.18s var(--ease);
  line-height: 1.2;
}
.theme-btn svg {
  width: 11px;
  height: 11px;
}
.theme-btn:hover {
  color: var(--ink);
}
/* 테마 · 로그아웃 — 닉네임 아래 한 줄, 겹치지 않게 간격 확보 */
.user-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

/* ---------------- 6. Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 26px;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: transform 0.16s var(--ease), background 0.18s var(--ease),
    border-color 0.18s var(--ease), color 0.18s var(--ease), opacity 0.18s;
}
.btn svg {
  width: 15px;
  height: 15px;
}
.btn:active {
  transform: translateY(1px);
}
.btn-primary {
  background: var(--ink);
  color: var(--bg);
}
.btn-primary:hover {
  opacity: 0.84;
}
.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}
.btn-ghost:hover {
  border-color: var(--ink);
}
.btn-sm {
  height: 36px;
  padding: 0 16px;
  font-size: 12px;
  gap: 6px;
}
.btn-sm svg {
  width: 13px;
  height: 13px;
}
.btn-lg {
  height: 54px;
  font-size: 15px;
  padding: 0 32px;
}
.btn-block {
  width: 100%;
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* ---------------- 7. Inputs ---------------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-family: var(--font-display);
  font-variation-settings: 'wdth' 112, 'wght' 800;
}
.label .req {
  color: var(--accent);
  margin-left: 2px;
}
.input,
.select {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
  appearance: none;
}
.input::placeholder {
  color: var(--ink-4);
  font-weight: 500;
}
.input:focus,
.select:focus {
  outline: none;
  border-color: var(--ink);
}
.select {
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 20px) 22px, calc(100% - 14px) 22px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 40px;
}
textarea.input {
  height: auto;
  min-height: 92px;
  padding: 14px 16px;
  line-height: 1.55;
  resize: vertical;
}

/* ---------------- 8. Surfaces — hairlines, not boxes ---------------- */
/* a2o has no shadow and almost no rounded container. A "card" is
   just content fenced by a top and bottom rule. */
.card {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 44px 0;
  background: transparent;
  border-radius: 0;
}
.card-flush {
  border: 0;
  padding: 0;
}
.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
}
.card-title {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.005em;
  color: var(--ink);
}
.card-sub {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-4);
}
.card-link {
  font-size: 12px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.card-link svg {
  width: 13px;
  height: 13px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 32px;
  margin-top: 108px;
}
.section-title {
  font-size: clamp(22px, 2.2vw, 30px);
  font-weight: 900;
  letter-spacing: 0.005em;
}

.row-2,
.row-3,
.kpi-row,
.stat-grid {
  display: grid;
  gap: 0;
}
.row-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.row-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
/* vertical hairline between columns — the a2o 3-column device */
.row-2 > * + *,
.row-3 > * + * {
  border-left: 1px solid var(--line);
  padding-left: 40px;
}
.row-2 > *,
.row-3 > * {
  padding-right: 40px;
  min-width: 0;
}
.row-2 > *:last-child,
.row-3 > *:last-child {
  padding-right: 0;
}

.stack {
  display: flex;
  flex-direction: column;
}

/* ---------------- 9. Chips / pills / segmented ---------------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 11px;
  border-radius: var(--radius-full);
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--ink-3);
  white-space: nowrap;
}
.chip svg {
  width: 11px;
  height: 11px;
}
.tag,
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 23px;
  padding: 0 10px;
  border-radius: var(--radius-full);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: var(--line-2);
  color: var(--ink-3);
  white-space: nowrap;
}
.tag.high {
  background: var(--danger-soft);
  color: var(--danger);
}
.tag.mid {
  background: var(--warn-soft);
  color: var(--warn);
}
.tag.low {
  background: var(--pos-soft);
  color: var(--accent-ink);
}
.tag.danger {
  background: var(--danger-soft);
  color: var(--danger);
}
.tag.warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.tag.info {
  background: var(--info-soft);
  color: var(--info);
}

/* segmented control = outlined track, active inverts to ink */
.seg {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
}
.seg button {
  height: 30px;
  padding: 0 15px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink-3);
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
  white-space: nowrap;
}
.seg button:hover {
  color: var(--ink);
}
.seg button.on {
  background: var(--ink);
  color: var(--bg);
  font-weight: 800;
}

/* ---------------- 10. Tables ---------------- */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
table.data th {
  padding: 0 16px 14px;
  border-bottom: 1px solid var(--ink);
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 800;
  font-variation-settings: 'wdth' 112, 'wght' 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  text-align: left;
  white-space: nowrap;
}
table.data th:first-child,
table.data td:first-child {
  padding-left: 0;
}
table.data th:last-child,
table.data td:last-child {
  padding-right: 0;
}
table.data td {
  padding: 20px 16px;
  border-bottom: 1px solid var(--line-2);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--ink-2);
  vertical-align: middle;
}
table.data tbody tr {
  transition: background 0.14s var(--ease);
}
table.data tbody tr:hover {
  background: var(--line-2);
}
table.data td.strong {
  color: var(--ink);
  font-weight: 800;
}
table.data td.num,
table.data th.num {
  text-align: right;
  font-family: var(--font-display);
  font-variation-settings: 'wdth' 112, 'wght' 700;
}
table.data .mute {
  color: var(--ink-4);
  font-weight: 600;
  font-size: 12.5px;
}
.table-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 22px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-4);
}

/* ---------------- 11. Pager / toast / spinner ---------------- */
.pager {
  display: flex;
  align-items: center;
  gap: 4px;
}
.pager button {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 800;
  font-variation-settings: 'wdth' 108, 'wght' 800;
  color: var(--ink-3);
  display: grid;
  place-items: center;
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
}
.pager button svg {
  width: 13px;
  height: 13px;
}
.pager button:hover {
  background: var(--line-2);
  color: var(--ink);
}
.pager button.on {
  background: var(--ink);
  color: var(--bg);
}

.toast-wrap {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 900;
  pointer-events: none;
}
.toast {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 22px;
  border-radius: var(--radius-full);
  background: var(--ink);
  color: var(--bg);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: var(--shadow-pop);
  animation: toastIn 0.24s var(--ease);
}
.toast svg {
  width: 15px;
  height: 15px;
}
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.spin {
  width: 16px;
  height: 16px;
  border: 2px solid var(--line);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.spark {
  display: inline-block;
  width: 44px;
  height: 16px;
}

/* ---------------- 12. Utilities ---------------- */
.hidden {
  display: none !important;
}
.mute {
  color: var(--ink-4);
}
.dim {
  color: var(--ink-3);
}
.hi {
  color: var(--accent);
}
.danger {
  color: var(--danger);
}
.warn {
  color: var(--warn);
}
.strong {
  font-weight: 800;
  color: var(--ink);
}
.scroll-thin {
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.scroll-thin::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
.scroll-thin::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 99px;
}
.toolbar-spacer {
  flex: 1 1 auto;
}

/* ---------------- 13. Auth ---------------- */
.auth {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 512px;
  min-height: 100vh;
  background: var(--bg);
}
.auth-hero {
  position: relative;
  overflow: hidden;
  background: #000;
  color: #fff;
  padding: 56px 72px 52px;
  display: flex;
  flex-direction: column;
  isolation: isolate;
}
/* one huge soft green field — the only chroma on the page */
.auth-hero::after {
  content: '';
  position: absolute;
  width: 1180px;
  height: 1180px;
  right: -420px;
  bottom: -520px;
  background: radial-gradient(
    circle at center,
    rgba(31, 138, 76, 0.5) 0%,
    rgba(31, 138, 76, 0.18) 42%,
    transparent 68%
  );
  z-index: -1;
  pointer-events: none;
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: auto;
}
.auth-brand .brand-mark {
  width: 34px;
  height: 34px;
  background: #fff;
  color: #000;
  border-radius: 9px;
}
.auth-brand .brand-mark svg {
  width: 20px;
  height: 20px;
}
.auth-brand-txt {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.auth-brand-txt b {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.01em;
  color: #fff;
}
.auth-brand-txt span {
  font-family: var(--font-display);
  font-size: 9.5px;
  font-weight: 800;
  font-variation-settings: 'wdth' 118, 'wght' 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}
.auth-copy {
  padding: 64px 0 0;
}
.auth-eyebrow {
  display: block;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 800;
  font-variation-settings: 'wdth' 122, 'wght' 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 30px;
}
.auth-h {
  font-size: clamp(38px, 4.6vw, 68px);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: 0.005em;
  color: #fff;
}
.auth-h em {
  font-style: normal;
  color: #6ee7a2;
}
.auth-p {
  margin-top: 30px;
  max-width: 47ch;
  font-size: 15.5px;
  font-weight: 500;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.66);
  letter-spacing: -0.005em;
}
.auth-points {
  margin-top: 60px;
  display: grid;
  gap: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}
.auth-point {
  display: flex;
  gap: 16px;
  padding: 22px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}
.auth-point .ico {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  display: grid;
  place-items: center;
  color: #fff;
}
.auth-point .ico svg {
  width: 15px;
  height: 15px;
}
.auth-point b {
  display: block;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.005em;
  color: #fff;
  margin-bottom: 5px;
}
.auth-point span {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.55);
  max-width: 46ch;
}
.auth-legal {
  margin-top: auto;
  padding-top: 56px;
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  font-variation-settings: 'wdth' 112, 'wght' 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.32);
}
.auth-sep {
  display: none;
}
.auth-pane {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 72px;
  background: var(--bg);
}
.auth-pane-inner {
  width: 100%;
  max-width: 368px;
}
.auth-theme {
  position: absolute;
  top: 26px;
  right: 28px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--ink-3);
  transition: border-color 0.18s, color 0.18s;
}
.auth-theme svg {
  width: 15px;
  height: 15px;
}
.auth-theme:hover {
  border-color: var(--ink);
  color: var(--ink);
}
.auth-title {
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -0.01em;
  line-height: 1.1;
  color: var(--ink);
  margin-bottom: 12px;
}
.auth-desc {
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.65;
  color: var(--ink-3);
  margin-bottom: 40px;
  max-width: 34ch;
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.auth-form .btn {
  margin-top: 10px;
}
.auth-switch {
  margin-top: 26px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-3);
  text-align: center;
}
.auth-switch button {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0 2px;
}
.auth-hint {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 9px;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.6;
  color: var(--ink-4);
}
.auth-hint svg {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  margin-top: 2px;
}

/* ---------------- 14. Legacy kill switch ---------------- */
.topbar,
.crumbs,
.side,
.side-foot,
.side-list,
.side-icon,
.nav-label,
.me,
.me-txt,
.me-tools {
  display: none;
}

/* ---------------- 15. Responsive ---------------- */
@media (max-width: 1400px) {
  :root {
    --gut: 40px;
  }
}
@media (max-width: 1180px) {
  .hdr-in {
    gap: 28px;
  }
  .nav {
    gap: 22px;
  }
  .brand-sub {
    display: none;
  }
  .auth {
    grid-template-columns: minmax(0, 1fr) 440px;
  }
  .auth-hero {
    padding: 44px 44px 40px;
  }
  .auth-pane {
    padding: 48px 40px;
  }
}
@media (max-width: 980px) {
  :root {
    --gut: 28px;
    --hdr: 62px;
    --main-top: 60px;
  }
  .nav a::after {
    bottom: -19px;
  }
  .main {
    padding-top: 60px;
    padding-bottom: 90px;
  }
  .auth {
    grid-template-columns: 1fr;
  }
  .auth-hero {
    padding: 36px 32px 52px;
    min-height: auto;
  }
  .auth-copy {
    padding-top: 48px;
  }
  .auth-h {
    font-size: clamp(32px, 8vw, 48px);
  }
  .auth-points {
    margin-top: 44px;
  }
  .auth-legal {
    padding-top: 36px;
  }
  .auth-pane {
    padding: 52px 32px 72px;
    align-items: flex-start;
  }
  .auth-pane-inner {
    max-width: none;
  }
  .row-2,
  .row-3 {
    grid-template-columns: 1fr;
  }
  .row-2 > * + *,
  .row-3 > * + * {
    border-left: 0;
    padding-left: 0;
    border-top: 1px solid var(--line);
    margin-top: 36px;
    padding-top: 36px;
  }
  .row-2 > *,
  .row-3 > * {
    padding-right: 0;
  }
  .page-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 22px;
  }
}
@media (max-width: 780px) {
  .nav {
    display: none;
  }
  .hdr-in {
    justify-content: space-between;
  }
  .presence .lbl {
    display: none;
  }
  .user-role {
    display: none;
  }
  .main {
    padding: var(--main-top) var(--gut) 72px;
  }
  :root {
    --gut: 20px;
    --main-top: 44px;
  }
  table.data th:first-child,
  table.data td:first-child {
    padding-left: 0;
  }
}

/* ---------------- 16. Print ---------------- */
@media print {
  .hdr,
  .panel-foot,
  .result-toolbar,
  .filter-bar,
  .pager,
  .toast-wrap,
  .date-pick,
  .admin-nav,
  .auth-theme,
  .theme-btn {
    display: none !important;
  }
  .app {
    padding-top: 0;
  }
  .main {
    max-width: none;
    padding: 0;
  }
  .screen {
    display: none;
  }
  .screen.active {
    display: block;
  }
  body {
    background: #fff;
    color: #000;
  }
  .card,
  .row-2 > *,
  .row-3 > * {
    break-inside: avoid;
  }
}
