/* AX-Bridge-Diagnosis — 기본 화면 스타일(외부 라이브러리 없음) */
:root {
  --bg: #f3f5f8; --card: #fff; --ink: #1d2733; --muted: #66737f; --line: #dde3ea;
  --navy: #14324f; --accent: #e8731a; --accent-ink: #fff; --ok: #1f7a4d; --warn: #b26b00; --err: #b3261e;
  --chip: #eef2f6; --focus: #2f6fb3;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* .form(grid) 같은 표시 규칙이 hidden을 덮어쓰지 않게 */
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.55 "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif; }
a { color: var(--focus); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.top { background: var(--navy); color: #fff; display: flex; align-items: center; gap: 18px; padding: 0 20px; height: 54px; position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 800; letter-spacing: .3px; color: #fff; white-space: nowrap; }
.brand em { color: var(--accent); font-style: normal; }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.nav a { color: #cfdbe7; padding: 7px 12px; border-radius: 6px; white-space: nowrap; }
.nav a.on, .nav a:hover { background: rgba(255,255,255,.12); color: #fff; text-decoration: none; }
.who { display: flex; align-items: center; gap: 10px; white-space: nowrap; font-size: 14px; }
.who a, .who button { color: #cfdbe7; background: none; border: 0; cursor: pointer; padding: 4px 6px; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: var(--chip); color: var(--ink); }
.badge.admin { background: var(--accent); color: #fff; }

main { max-width: 1180px; margin: 0 auto; padding: 22px 20px 60px; }
h1 { font-size: 22px; margin: 0 0 4px; }
.sub { color: var(--muted); margin: 0 0 16px; font-size: 14px; }
.bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 14px; }
.bar .grow { flex: 1; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 18px; margin-bottom: 16px; }
.card h2 { font-size: 16px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.card h2 .grow { flex: 1; }

.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; padding: 7px 14px; border-radius: 7px; cursor: pointer; white-space: nowrap; }
.btn:hover { background: #f6f8fa; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { filter: brightness(.95); }
.btn.danger { color: var(--err); border-color: #e9c3bf; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

input[type=text], input[type=email], input[type=password], input[type=tel], input[type=search], input[type=date], select, textarea {
  border: 1px solid var(--line); border-radius: 7px; padding: 7px 10px; background: #fff; min-width: 0; width: 100%; }
textarea { min-height: 72px; resize: vertical; }
.bar input[type=search], .bar select, .bar input[type=date] { width: auto; }
.form { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px 16px; }
.form .wide { grid-column: 1 / -1; }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
label.f b { color: var(--ink); font-weight: 600; }
label.f .req { color: var(--err); }
.actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }

table.list { width: 100%; border-collapse: collapse; background: #fff; }
table.list th, table.list td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list th { font-size: 13px; color: var(--muted); font-weight: 600; background: #fafbfc; white-space: nowrap; }
table.list td { word-break: keep-all; overflow-wrap: anywhere; }
table.list.wide { min-width: 760px; }   /* 칸이 많은 표(작업기록)는 폰에서 표 안에서만 옆으로 밀어 봄 */
table.list tr.click { cursor: pointer; }
table.list tr.click:hover td { background: #f7f9fb; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.st { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.st-준비 { background: #eef2f6; color: #475563; }
.st-진단중 { background: #fff1e3; color: #9a4d00; }
.st-제출완료 { background: #e3f4ea; color: var(--ok); }
.st-active { background: #e3f4ea; color: var(--ok); }
.st-suspended { background: #fbe7e5; color: var(--err); }
.muted { color: var(--muted); }
.mono { font-family: Consolas, monospace; font-size: 13px; word-break: break-all; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

dialog { border: 0; border-radius: 12px; padding: 0; width: min(560px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(10,20,30,.45); }
dialog .dh { padding: 16px 18px; border-bottom: 1px solid var(--line); font-weight: 700; display: flex; }
dialog .dh .grow { flex: 1; }
dialog .db { padding: 18px; }
dialog .df { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }

#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 50; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: #fff; border-left: 4px solid var(--ok); box-shadow: 0 6px 24px rgba(0,0,0,.15); padding: 10px 14px; border-radius: 8px; }
.toast.error { border-color: var(--err); }
.toast.info { border-color: var(--focus); }
.copybox { display: flex; gap: 8px; }
.copybox input { font-family: Consolas, monospace; font-size: 13px; }
.notice { background: #fff8ec; border: 1px solid #f1d9b3; color: #6b4300; padding: 10px 12px; border-radius: 8px; font-size: 14px; }

.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth .card { width: min(420px, 100%); padding: 28px; }
.auth h1 { text-align: center; margin-bottom: 4px; }
.auth .sub { text-align: center; }
.auth .btn.primary { width: 100%; justify-content: center; padding: 10px; margin-top: 6px; }
.auth form { display: flex; flex-direction: column; gap: 12px; }
.msg { min-height: 20px; font-size: 14px; color: var(--err); }
.msg.ok { color: var(--ok); }

@media (max-width: 720px) {
  /* 폰: 위 줄 = 이름·로그아웃, 아래 줄 = 메뉴(옆으로 밀어 보기) — 한 줄이면 메뉴가 0폭으로 눌림 */
  .top { flex-wrap: wrap; height: auto; gap: 4px 10px; padding: 8px 12px 6px; }
  .brand { flex: 1; }
  .nav { order: 3; flex: 1 0 100%; }
  .nav a { padding: 6px 10px; }
  .who .nm { display: none; }
  main { padding: 16px 12px 60px; }
  .kv { grid-template-columns: 100px 1fr; }
  table.list .hide-sm { display: none; }
}
