/* ==========================================================================
   법인 대표자 적정 급여 세팅 — 스타일시트
   디자인 시스템: 세무회계 연리 브랜드 아이덴티티 (스펙 2.4절)
   ========================================================================== */

:root {
  /* 브랜드 원색 */
  --yl-primary: #538584;
  --yl-primary-hover: #3e6463;
  --yl-primary-tint: #eef3f3;
  --yl-primary-tint-soft: #f6f9f9;

  --yl-navy: #1d2d44;
  --yl-navy-hover: #172436;
  --yl-navy-tint: #f1f2f4;

  --yl-surface: #ffffff;
  --yl-bg: #f6f9f9;
  --yl-border: #dde0e3;
  --yl-text: #1d2d44;
  --yl-text-secondary: #838c98;

  --yl-warning: #b45309;
  --yl-warning-bg: #fdf3e7;
  --yl-danger: #b91c1c;
  --yl-danger-bg: #fdeeee;

  --radius: 10px;
  --shadow: 0 1px 3px rgba(29, 45, 68, 0.06);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--yl-bg);
  color: var(--yl-text);
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

h1,
h2,
h3,
h4 {
  color: var(--yl-navy);
  font-weight: 700;
  margin: 0 0 8px;
}

h2 {
  font-size: 18px;
}

h3 {
  font-size: 15px;
  font-weight: 600;
}

p {
  margin: 0 0 8px;
}

a {
  color: var(--yl-primary);
}

/* -------------------------------------------------------------------------
   헤더
   ------------------------------------------------------------------------- */
.site-header {
  background: var(--yl-surface);
  border-bottom: 1px solid var(--yl-border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-header .logo {
  height: 34px;
  width: auto;
  display: block;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.coming-soon-badge {
  background: var(--yl-navy-tint);
  color: var(--yl-navy);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.year-badge {
  background: var(--yl-primary-tint);
  color: var(--yl-primary-hover);
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

/* -------------------------------------------------------------------------
   레이아웃
   ------------------------------------------------------------------------- */
.app-shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
}

.input-column,
.result-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.input-column {
  position: sticky;
  top: 78px;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  padding-right: 4px;
}

@media (max-width: 980px) {
  .input-column {
    position: static;
    max-height: none;
  }
}

/* -------------------------------------------------------------------------
   카드
   ------------------------------------------------------------------------- */
.card {
  background: var(--yl-surface);
  border: 1px solid var(--yl-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
}

.card.highlight {
  background: var(--yl-primary-tint);
  border: none;
  border-left: 4px solid var(--yl-primary);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.card-header .caret {
  color: var(--yl-text-secondary);
  transition: transform 0.15s ease;
  font-size: 13px;
}

.card.collapsed .card-body {
  display: none;
}

.card.collapsed .caret {
  transform: rotate(-90deg);
}

.card-body {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-subtitle {
  color: var(--yl-text-secondary);
  font-size: 13px;
  margin-top: -6px;
}

/* -------------------------------------------------------------------------
   폼 요소
   ------------------------------------------------------------------------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--yl-navy);
  display: flex;
  align-items: center;
  gap: 5px;
}

.field .hint {
  font-size: 12px;
  color: var(--yl-text-secondary);
  font-weight: 400;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

input[type='text'],
input[type='number'],
input[type='date'] {
  border: 1px solid var(--yl-border);
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 14px;
  font-family: inherit;
  color: var(--yl-text);
  background: var(--yl-surface);
  width: 100%;
  font-variant-numeric: tabular-nums;
}

input:focus {
  outline: none;
  border-color: var(--yl-primary);
  box-shadow: 0 0 0 3px var(--yl-primary-tint);
}

.btn-calculate {
  position: sticky;
  bottom: 0;
  width: 100%;
  padding: 13px 16px;
  border: none;
  border-radius: 8px;
  background: var(--yl-primary);
  color: #ffffff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.btn-calculate:hover {
  background: var(--yl-primary-hover);
}

.btn-calculate:active {
  transform: translateY(1px);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
}

.checkbox-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--yl-primary);
}

.tooltip-icon {
  position: relative;
  color: var(--yl-text-secondary);
  border: 1px solid var(--yl-border);
  border-radius: 50%;
  width: 15px;
  height: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  cursor: help;
}

.tooltip-icon:hover,
.tooltip-icon:focus {
  outline: none;
  color: var(--yl-primary-hover);
  border-color: var(--yl-primary);
}

.tooltip-icon::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 240px;
  background: var(--yl-navy);
  color: #ffffff;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  white-space: normal;
  padding: 8px 10px;
  border-radius: 6px;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease;
  z-index: 30;
  pointer-events: none;
}

.tooltip-icon:hover::after,
.tooltip-icon:focus::after {
  opacity: 1;
  visibility: visible;
}

/* 3개년 재무정보 미니 테이블 */
.finance-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.finance-table th {
  color: var(--yl-text-secondary);
  font-weight: 600;
  text-align: right;
  padding: 4px 4px;
}

.finance-table th:first-child {
  text-align: left;
}

.finance-table td {
  padding: 3px 3px;
}

.finance-table td:first-child {
  color: var(--yl-text-secondary);
  white-space: nowrap;
  padding-right: 6px;
}

.finance-table input {
  text-align: right;
  padding: 6px 8px;
  font-size: 13px;
}

/* -------------------------------------------------------------------------
   결과 테이블
   ------------------------------------------------------------------------- */
.result-table-wrap {
  overflow-x: auto;
}

table.result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  min-width: 620px;
}

.result-table th,
.result-table td {
  padding: 10px 12px;
  text-align: right;
  border-bottom: 1px solid var(--yl-border);
  white-space: nowrap;
}

.result-table th:first-child,
.result-table td:first-child {
  text-align: left;
  color: var(--yl-text-secondary);
  font-weight: 500;
  position: sticky;
  left: 0;
  background: var(--yl-surface);
}

.result-table thead th {
  color: var(--yl-navy);
  font-weight: 700;
  border-bottom: 2px solid var(--yl-navy);
}

.result-table tbody tr:last-child td {
  border-bottom: none;
}

.result-table td.metric-highlight {
  background: var(--yl-primary-tint);
  font-weight: 700;
  color: var(--yl-primary-hover);
}

.col-best {
  background: rgba(83, 133, 132, 0.06);
}

.detail-group-header td {
  background: var(--yl-navy-tint);
  color: var(--yl-navy);
  font-weight: 700;
  font-size: 12.5px;
  padding: 8px 12px;
}

/* -------------------------------------------------------------------------
   차트
   ------------------------------------------------------------------------- */
.chart-wrap {
  position: relative;
  height: 300px;
}

/* -------------------------------------------------------------------------
   요약 카드
   ------------------------------------------------------------------------- */
.summary-tile {
  background: var(--yl-surface);
  border: 1px solid var(--yl-border);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.summary-tile .label {
  font-size: 12.5px;
  color: var(--yl-text-secondary);
  margin-bottom: 6px;
}

.summary-tile .value {
  font-size: 21px;
  font-weight: 700;
  color: var(--yl-navy);
  font-variant-numeric: tabular-nums;
}

.summary-verdict {
  font-size: 14.5px;
  line-height: 1.7;
  padding: 14px 16px;
  background: var(--yl-navy-tint);
  border-radius: 8px;
}

/* -------------------------------------------------------------------------
   근거 아코디언
   ------------------------------------------------------------------------- */
.references {
  font-size: 13px;
  color: var(--yl-text-secondary);
}

.references ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.references li {
  margin-bottom: 6px;
}

/* -------------------------------------------------------------------------
   푸터
   ------------------------------------------------------------------------- */
.site-footer {
  background: var(--yl-navy);
  color: #cfd6de;
  padding: 28px 24px 24px;
  margin-top: 32px;
}

.site-footer .footer-inner {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.site-footer .logo {
  height: 30px;
  width: auto;
  display: block;
}

.footer-disclaimer {
  font-size: 13px;
  line-height: 1.7;
  color: #cfd6de;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 14px;
}

.footer-meta {
  font-size: 12px;
  color: #8b96a5;
}

/* -------------------------------------------------------------------------
   유틸
   ------------------------------------------------------------------------- */
.muted {
  color: var(--yl-text-secondary);
  font-size: 12.5px;
}

.section-gap {
  height: 4px;
}
