/* VARA SSO — VARA BI 색 체계 (vara-crm theme.ts 와 같은 값). 외부 글꼴·스크립트 없음 */
:root {
  --navy950: #071526; --navy900: #0b1f3a; --navy800: #12345c; --navy700: #1d4877; --navy600: #2b5f94;
  --teal500: #1fa3a3; --teal700: #0f6e6e;
  --tint: #eef3f9; --tint-border: #c9d6e6; --line: #e6eaf0; --bg: #f5f7fa; --ink: #0f172a; --muted: #5b6678;
  --ok: #157347; --ok-bg: #e8f5ee; --err: #b42318; --err-bg: #fdecea; --warn: #8a5a00; --warn-bg: #fff6e0;
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard Variable", Pretendard, "Malgun Gothic", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.55; word-break: keep-all; overflow-wrap: break-word; font-variant-numeric: tabular-nums; }
a { color: var(--navy700); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--navy600); outline-offset: 2px; }
h1, h2, h3 { margin: 0; line-height: 1.3; text-wrap: balance; }
h1 { font-size: 22px; font-weight: 800; }
h2 { font-size: 17px; font-weight: 800; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.hide { display: none !important; }

/* ---------- 로그인 화면 ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; background: linear-gradient(160deg, var(--navy900) 0%, var(--navy800) 55%, var(--navy700) 100%); }
.auth-card { width: 100%; max-width: 420px; background: #fff; border-radius: 16px; padding: 32px 28px 26px; box-shadow: 0 20px 50px rgba(7, 21, 38, .35); }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.auth-brand img { height: 26px; width: auto; }
.auth-brand .product { font-weight: 800; color: var(--navy800); font-size: 15px; letter-spacing: .02em; padding-left: 10px; border-left: 1px solid var(--line); }
.auth-card h1 { margin-bottom: 6px; }
.auth-card .lead { color: var(--muted); margin: 0 0 20px; font-size: 14px; }
.auth-foot { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.target { display: inline-flex; align-items: center; gap: 6px; background: var(--tint); color: var(--navy800); border: 1px solid var(--tint-border); border-radius: 999px; padding: 3px 12px; font-size: 13px; font-weight: 700; margin-bottom: 14px; }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13.5px; font-weight: 700; color: #334155; }
.field .hint { font-size: 12.5px; color: var(--muted); }
input:not([type]), input[type=text], input[type=password], input[type=email], input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1px solid #cbd5e1; border-radius: 10px; padding: 11px 12px; min-height: 44px;
}
textarea { min-height: 90px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13.5px; }
input:hover, select:hover, textarea:hover { border-color: var(--navy600); }
input.code { font-size: 26px; letter-spacing: .4em; text-align: center; font-weight: 700; padding: 10px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 700; border-radius: 10px; padding: 10px 16px; min-height: 42px; border: 1px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn-primary { background: var(--navy700); color: #fff; }
.btn-primary:hover { background: var(--navy800); }
.btn-block { width: 100%; min-height: 48px; font-size: 16px; }
.btn-outline { background: #fff; color: var(--navy700); border-color: #cbd5e1; }
.btn-outline:hover { background: var(--tint); border-color: var(--navy600); }
.btn-danger { background: #fff; color: var(--err); border-color: #f1b8b2; }
.btn-danger:hover { background: var(--err-bg); }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: 13.5px; }
.btn-link { background: none; border: none; color: var(--navy700); padding: 0; min-height: auto; font-weight: 600; text-decoration: underline; cursor: pointer; font: inherit; }

.alert { border-radius: 10px; padding: 11px 14px; margin-bottom: 14px; font-size: 14px; border: 1px solid; }
.alert-error { background: var(--err-bg); color: var(--err); border-color: #f5c2bd; }
.alert-ok { background: var(--ok-bg); color: var(--ok); border-color: #b9e0c9; }
.alert-info { background: var(--tint); color: var(--navy800); border-color: var(--tint-border); }
.alert-warn { background: var(--warn-bg); color: var(--warn); border-color: #f2d58f; }

.steps { display: flex; gap: 6px; margin-bottom: 18px; }
.steps span { flex: 1; height: 4px; border-radius: 4px; background: var(--line); }
.steps span.on { background: var(--teal500); }
.qr { display: grid; justify-items: center; gap: 10px; margin: 6px 0 16px; }
.qr svg { width: 196px; height: 196px; border: 1px solid var(--line); border-radius: 10px; }
.secret { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--tint); border-radius: 8px; padding: 6px 10px; font-size: 14px; letter-spacing: .06em; user-select: all; }
ol.guide { padding-left: 20px; margin: 0 0 14px; color: #334155; font-size: 14px; }
ol.guide li { margin-bottom: 4px; }

/* ---------- 앱 틀 (내 계정·관리) ---------- */
.top { position: sticky; top: 0; z-index: 10; background: var(--navy900); color: #fff; border-bottom: 2px solid var(--teal500); }
.top-in { max-width: 1240px; margin: 0 auto; padding: 0 16px; height: 56px; display: flex; align-items: center; gap: 18px; }
.top .logo { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.top .logo img { height: 22px; }
.top .logo b { font-size: 14px; letter-spacing: .03em; border-left: 1px solid rgba(255,255,255,.3); padding-left: 10px; }
.top nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; }
.top nav a { color: #cfdbea; text-decoration: none; padding: 8px 12px; border-radius: 8px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.top nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.top nav a.on { background: rgba(255,255,255,.14); color: #fff; }
.top .who { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: #cfdbea; white-space: nowrap; }
.top .who form { margin: 0; }
.top .who .btn { min-height: 32px; padding: 4px 12px; font-size: 13px; background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.top .who .btn:hover { background: rgba(255,255,255,.1); }
.page { max-width: 1240px; margin: 0 auto; padding: 24px 16px 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.crumb a { color: var(--muted); }

.card { background: #fff; border: 1px solid #dde3ec; border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.stat { background: #fff; border: 1px solid #dde3ec; border-radius: var(--radius); padding: 16px 18px; }
.stat .label { font-size: 13px; color: var(--muted); font-weight: 700; }
.stat .value { font-size: 28px; font-weight: 800; color: var(--navy800); margin-top: 2px; }
.stat .value.err { color: var(--err); }

.apps { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.app { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid #dde3ec; border-radius: 12px; text-decoration: none; color: var(--ink); background: #fff; }
.app:hover { border-color: var(--navy600); background: var(--tint); }
.app .mark { width: 40px; height: 40px; border-radius: 10px; background: var(--navy700); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 15px; flex: none; }
.app b { display: block; }
.app span { font-size: 12.5px; color: var(--muted); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: #f8fafc; color: #475569; font-size: 12.5px; font-weight: 800; white-space: nowrap; position: sticky; top: 0; }
tbody tr:hover { background: #f8fbff; }
tbody tr:last-child td { border-bottom: none; }
td.num { text-align: right; }
td.nowrap, th.nowrap { white-space: nowrap; }
td.actions { white-space: nowrap; text-align: right; }
td.actions form { display: inline; }
.empty { text-align: center; color: var(--muted); padding: 28px; }

.chip { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--tint); color: var(--navy800); border: 1px solid var(--tint-border); white-space: nowrap; }
.chip-ok { background: var(--ok-bg); color: var(--ok); border-color: #b9e0c9; }
.chip-err { background: var(--err-bg); color: var(--err); border-color: #f5c2bd; }
.chip-warn { background: var(--warn-bg); color: var(--warn); border-color: #f2d58f; }
.chip-off { background: #f1f5f9; color: #64748b; border-color: #e2e8f0; }

.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar input, .toolbar select { width: auto; min-width: 180px; flex: 0 1 260px; }
.form-grid { display: grid; gap: 4px 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.check { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; }
.check input { width: 18px; height: 18px; margin-top: 3px; flex: none; accent-color: var(--navy700); }
.check b { display: block; font-size: 14px; }
.check span { font-size: 12.5px; color: var(--muted); }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 0 16px; }
.actions-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; font-size: 14px; }
dl.kv dt { color: var(--muted); font-weight: 700; }
dl.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.secret-box { border: 2px dashed var(--teal500); background: #f2fbfb; border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.secret-box .secret { display: inline-block; font-size: 18px; margin: 6px 0; }
.setting { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.setting:last-child { border-bottom: none; }
.setting b { display: block; font-size: 14px; }
.setting span { font-size: 12.5px; color: var(--muted); }

@media (max-width: 640px) {
  .top-in { flex-wrap: wrap; height: auto; padding: 8px 16px; gap: 8px; }
  .top nav { order: 3; width: 100%; }
  .setting { grid-template-columns: 1fr; }
  .auth-card { padding: 26px 20px 22px; }
  h1 { font-size: 20px; }
}
.gap { height: 16px; }
dl.kv + p, .actions-row + dl.kv { margin-top: 14px; }
