/* 평가수당 모듈 UI — 모든 클래스는 alw- 접두사. 호스트 Tailwind 재빌드 불필요.
   색은 변수로 덮어쓸 수 있음: :root { --alw-accent: #...; } */
:root {
  --alw-ink: #1f2933;
  --alw-muted: #5f6b7a;
  --alw-line: #d5dbe3;
  --alw-soft: #f3f5f8;
  --alw-accent: #1e3a5f;
  --alw-accent-ink: #ffffff;
  --alw-warn: #b54708;
  --alw-warn-soft: #fff4e5;
  --alw-ok: #18794e;
  --alw-ok-soft: #e9f7ef;
  --alw-danger: #b42318;
  --alw-font: "Pretendard", "Pretendard Variable", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}
.alw, .alw * { box-sizing: border-box; }
.alw { font-family: var(--alw-font); color: var(--alw-ink); font-size: 14px; line-height: 1.55; word-break: keep-all; }
.alw h3 { font-size: 15px; font-weight: 700; margin: 0 0 10px; }
.alw .alw-help { color: var(--alw-muted); font-size: 12.5px; margin: 4px 0 0; }

/* form grid */
.alw-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px 16px; }
.alw-field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--alw-muted); margin-bottom: 4px; }
.alw-field input, .alw-field select {
  width: 100%; height: 38px; padding: 0 10px; border: 1px solid var(--alw-line); border-radius: 6px;
  font: inherit; color: inherit; background: #fff;
}
.alw-field input[readonly] { background: var(--alw-soft); }
.alw-field input:focus, .alw-field select:focus { outline: 2px solid var(--alw-accent); outline-offset: 0; border-color: transparent; }
.alw-unit { display: flex; align-items: center; gap: 6px; }
.alw-unit span { color: var(--alw-muted); font-size: 13px; white-space: nowrap; }
.alw-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* buttons */
.alw-btn {
  height: 36px; padding: 0 14px; border-radius: 6px; border: 1px solid var(--alw-line); background: #fff;
  font: inherit; font-weight: 600; color: var(--alw-ink); cursor: pointer; white-space: nowrap;
}
.alw-btn:hover { background: var(--alw-soft); }
.alw-btn:focus-visible { outline: 2px solid var(--alw-accent); outline-offset: 2px; }
.alw-btn[disabled] { opacity: .45; cursor: not-allowed; }
.alw-btn-primary { background: var(--alw-accent); border-color: var(--alw-accent); color: var(--alw-accent-ink); }
.alw-btn-primary:hover { background: var(--alw-accent); filter: brightness(1.12); }
.alw-btn-danger { color: var(--alw-danger); }
.alw-btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }

/* status chips */
.alw-chip { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--alw-soft); color: var(--alw-muted); white-space: nowrap; }
.alw-chip[data-s="submitted"] { background: var(--alw-ok-soft); color: var(--alw-ok); }
.alw-chip[data-s="reconfirm"] { background: var(--alw-warn-soft); color: var(--alw-warn); }

/* table */
.alw-table-wrap { overflow-x: auto; border: 1px solid var(--alw-line); border-radius: 8px; }
.alw-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.alw-table th, .alw-table td { padding: 8px 10px; border-bottom: 1px solid var(--alw-line); text-align: left; vertical-align: middle; }
.alw-table th { background: var(--alw-soft); font-size: 12.5px; color: var(--alw-muted); font-weight: 600; }
.alw-table tr:last-child td { border-bottom: 0; }
.alw-table .alw-num { text-align: right; font-variant-numeric: tabular-nums; }
.alw-table input[type=number] { width: 110px; height: 32px; padding: 0 8px; border: 1px solid var(--alw-line); border-radius: 6px; font: inherit; text-align: right; }
.alw-table select { height: 32px; border: 1px solid var(--alw-line); border-radius: 6px; font: inherit; padding: 0 6px; }

/* bulk bar */
.alw-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--alw-line); border-radius: 8px; background: #fff; }
.alw-bar strong { font-variant-numeric: tabular-nums; }

/* matrix button */
.alw-mbtn { position: relative; }
.alw-mbtn[data-s="reconfirm"]::after { content: ""; position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--alw-warn); }

/* dialog & sheet */
.alw-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 32, .45); z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 16px; }
.alw-dialog { background: #fff; border-radius: 10px; width: min(420px, 100%); padding: 20px; box-shadow: 0 12px 32px rgba(15, 23, 32, .25); }
.alw-dialog-msg { white-space: pre-line; margin: 0 0 16px; }
.alw-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.alw-code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 20px; letter-spacing: .06em; background: var(--alw-soft); border-radius: 6px; padding: 10px 12px; text-align: center; margin: 0 0 12px; user-select: all; }

.alw-sheet { background: #fff; border-radius: 12px; width: min(680px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 16px 40px rgba(15, 23, 32, .3); }
.alw-sheet-head { padding: 18px 22px 12px; border-bottom: 1px solid var(--alw-line); }
.alw-sheet-head h2 { font-size: 18px; margin: 0; }
.alw-sheet-head p { margin: 2px 0 0; color: var(--alw-muted); font-size: 13px; }
.alw-sheet-body { padding: 18px 22px; overflow-y: auto; }
.alw-sheet-foot { padding: 12px 22px; border-top: 1px solid var(--alw-line); display: flex; justify-content: flex-end; gap: 8px; }
@media (max-width: 560px) {
  .alw-backdrop { padding: 0; align-items: stretch; }
  .alw-sheet { border-radius: 0; max-height: none; height: 100%; }
}

.alw-amount { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--alw-line); border-radius: 8px; overflow: hidden; margin-bottom: 18px; }
.alw-amount div { padding: 10px 12px; }
.alw-amount div + div { border-left: 1px solid var(--alw-line); }
.alw-amount span { display: block; font-size: 12px; color: var(--alw-muted); }
.alw-amount b { font-size: 17px; font-variant-numeric: tabular-nums; }
.alw-amount .alw-net { background: var(--alw-soft); }
.alw-amount small { display: block; font-size: 11.5px; color: var(--alw-muted); }

.alw-section { margin-top: 20px; }
.alw-section-title { font-weight: 700; margin: 0 0 8px; }
.alw-consent { border: 1px solid var(--alw-line); border-radius: 8px; padding: 12px 14px; font-size: 13px; }
.alw-consent ol { margin: 8px 0 0; padding-left: 18px; }
.alw-consent li { margin: 2px 0; }
.alw-consent u { text-underline-offset: 3px; }
.alw-choice { display: flex; gap: 18px; margin-top: 10px; font-weight: 600; }
.alw-choice label, .alw-check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.alw-check { font-size: 13px; margin-top: 8px; }

.alw-sig { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.alw-sig img { height: 64px; border: 1px solid var(--alw-line); border-radius: 6px; padding: 4px 10px; background: #fff; }
.alw-pad { width: 100%; max-width: 420px; height: 150px; border: 1px dashed var(--alw-muted); border-radius: 8px; touch-action: none; background: #fff; }
.alw-notice { padding: 10px 12px; border-radius: 8px; background: var(--alw-soft); margin-bottom: 16px; font-size: 13.5px; }
.alw-notice[data-tone="warn"] { background: var(--alw-warn-soft); color: var(--alw-warn); }
.alw-notice[data-tone="ok"] { background: var(--alw-ok-soft); color: var(--alw-ok); }
.alw-error { color: var(--alw-danger); font-size: 13px; margin-right: auto; align-self: center; }
@media (prefers-reduced-motion: no-preference) { .alw-sheet { animation: alw-in .16s ease-out; } }
@keyframes alw-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* hidden 속성 우선 (호스트 연동 시 display 규칙에 가려지지 않도록) */
.alw[hidden], [data-alw-bar][hidden], [data-alw-matrix][hidden] { display: none !important; }
