/* ===== 디자인 기준 (design/mockup.html 시안) ===== */
:root {
  --bg: #F4F6FA; --surface: #FFFFFF; --sunken: #F8FAFC;
  --ink: #0F172A; --ink-2: #334155; --ink-3: #64748B; --line: #E2E8F0; --line-2: #CBD5E1;
  --brand: #2F5FE3; --brand-ink: #1E3FA8; --brand-soft: #EEF3FF;
  --green: #0F8A5F; --green-soft: #E7F6EF; --amber: #B45309; --amber-soft: #FEF3E2;
  --red: #C2362B; --red-soft: #FDECEA; --violet: #6D4AD8; --violet-soft: #F1ECFE;
  --side: #0F172A;
  --r-lg: 20px; --r-md: 14px; --r-sm: 10px;
  --shadow: 0 1px 2px rgba(15,23,42,.05), 0 4px 16px rgba(15,23,42,.06);
  --tap: 56px; --tabbar: 84px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: 'Pretendard Variable', Pretendard, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif; font-size: 18px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.3; letter-spacing: -0.02em; }
h1 { font-size: 28px; } h2 { font-size: 21px; } h3 { font-size: 19px; }
.boot { padding: 64px 24px; text-align: center; font-size: 20px; color: var(--ink-3); }
svg.i { flex: 0 0 auto; }

/* ===== 화면 틀 ===== */
.app { min-height: 100vh; display: flex; }
.side { position: sticky; top: 0; height: 100vh; width: 264px; flex: 0 0 264px; background: var(--side); color: #CBD5E1; display: flex; flex-direction: column; padding: 24px 16px; gap: 4px; overflow-y: auto; z-index: 30; }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 12px 22px; color: #fff; font-size: 20px; font-weight: 700; background: none; border: 0; cursor: pointer; text-align: left; }
.brand .logo { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, #4C7BFF, #2F5FE3); display: grid; place-items: center; flex: 0 0 40px; }
.nav { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 0 14px; border-radius: 12px; font-size: 18px; font-weight: 500; color: #CBD5E1; background: none; border: 0; width: 100%; cursor: pointer; text-align: left; }
.nav:hover { background: rgba(148,163,184,.12); color: #fff; }
.nav[aria-current="page"] { background: rgba(76,123,255,.2); color: #fff; font-weight: 700; }
.nav .count { margin-left: auto; background: #F59E0B; color: #111827; font-size: 13px; font-weight: 800; border-radius: 999px; padding: 1px 8px; min-width: 24px; text-align: center; }
.nav-sep { height: 1px; background: rgba(148,163,184,.2); margin: 12px 8px; }
.me { margin-top: auto; display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: rgba(148,163,184,.1); }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: #334155; color: #fff; display: grid; place-items: center; font-weight: 700; flex: 0 0 40px; }
.me .who { color: #fff; font-weight: 700; } .me .role { font-size: 14px; }
.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.pagehead { position: sticky; top: 0; z-index: 20; min-height: 76px; display: flex; align-items: center; gap: 12px; padding: 12px 32px; background: rgba(244,246,250,.88); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.pagehead h1 { font-size: 26px; }
.pagehead .sub { color: var(--ink-3); font-size: 17px; }
.pagehead .actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }
.backbtn { width: 46px; height: 46px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow); flex: 0 0 46px; }
.content { padding: 28px 32px 64px; display: flex; flex-direction: column; gap: 20px; width: 100%; max-width: 1400px; }
.tabbar { display: none; }

/* 태블릿: 메뉴를 아이콘으로 접음 */
@media (max-width: 1180px) {
  .side { width: 96px; flex-basis: 96px; padding: 20px 10px; }
  .brand { justify-content: center; padding: 4px 0 18px; } .brand span, .me > div:not(.avatar) { display: none; }
  .nav { flex-direction: column; justify-content: center; gap: 4px; min-height: 68px; padding: 6px 4px; font-size: 13px; text-align: center; position: relative; line-height: 1.2; }
  .nav .count { position: absolute; top: 4px; right: 10px; margin: 0; font-size: 11px; padding: 0 6px; min-width: 0; }
  .me { justify-content: center; padding: 8px 0; background: none; }
  .pagehead { padding: 12px 24px; } .content { padding: 24px; }
}
/* 휴대폰: 아래 탭 */
@media (max-width: 760px) {
  body { font-size: 17px; }
  .side { display: none; }
  .pagehead { padding: 12px 16px; min-height: 68px; } .pagehead h1 { font-size: 23px; }
  .content { padding: 16px 16px calc(var(--tabbar) + 32px); gap: 14px; }
  .app.no-tabbar .content { padding-bottom: 170px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: var(--tabbar); padding: 6px 4px calc(10px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); }
  .app.no-tabbar .tabbar { display: none; }
  .tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 13px; font-weight: 600; color: var(--ink-3); background: none; border: 0; cursor: pointer; position: relative; }
  .tab[aria-current="page"] { color: var(--brand); }
  .tab .count { position: absolute; top: 2px; left: 54%; background: #F59E0B; color: #111827; font-size: 11px; font-weight: 800; border-radius: 999px; padding: 0 6px; }
  h1 { font-size: 24px; }
}

/* ===== 버튼 ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 0 22px; border-radius: var(--r-md); border: 1px solid var(--line-2); background: var(--surface); font-size: 18px; font-weight: 600; cursor: pointer; color: var(--ink); text-align: center; line-height: 1.25; touch-action: manipulation; transition: background .15s, box-shadow .15s; }
.btn:hover { background: var(--sunken); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(47,95,227,.28); }
.btn.primary:hover { background: #2853CC; }
.btn.soft { background: var(--brand-soft); border-color: transparent; color: var(--brand-ink); }
.btn.danger { color: var(--red); border-color: #F3C1BC; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); box-shadow: none; }
.btn.big { min-height: 64px; font-size: 20px; border-radius: 16px; padding: 0 26px; }
.btn.block { width: 100%; }
.btn.small { min-height: 46px; padding: 0 16px; font-size: 16px; border-radius: 12px; }
.btn.icon { padding: 0; width: var(--tap); }
.btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; }
:focus-visible { outline: 3px solid #F59E0B; outline-offset: 2px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; } .row.between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }

/* ===== 카드·알림·칩 ===== */
.card { background: var(--surface); border: 1px solid rgba(226,232,240,.8); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; }
.card.accent { border-color: #C9D7FB; box-shadow: 0 0 0 3px var(--brand-soft), var(--shadow); }
.card.flat { box-shadow: none; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.notice { border-radius: var(--r-md); padding: 14px 18px; font-size: 17px; display: flex; flex-direction: column; gap: 6px; }
.notice.warn { background: var(--amber-soft); color: #7C2D12; border: 1px solid #FBD9A6; }
.notice.info { background: var(--brand-soft); color: var(--brand-ink); border: 1px solid #D5E0FB; }
.notice.ok { background: var(--green-soft); color: #075E40; border: 1px solid #BFE6D3; }
.muted { color: var(--ink-3); }
.small-text { font-size: 15px; color: var(--ink-3); }
.strong { font-weight: 700; }
.money { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; letter-spacing: -0.01em; }
.neg { color: var(--red); }
.badge { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; font-size: 15px; font-weight: 600; white-space: nowrap; background: #EEF1F5; color: #475569; }
.badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.draft, .badge.warn { background: var(--amber-soft); color: var(--amber); }
.badge.done { background: var(--green-soft); color: var(--green); }
.badge.settled { background: var(--brand-soft); color: var(--brand-ink); }
.badge.cancelled, .badge.red { background: var(--red-soft); color: var(--red); }
.badge.violet { background: var(--violet-soft); color: var(--violet); }
.badge.gray { background: #EEF1F5; color: #475569; }

/* ===== 대시보드 ===== */
.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.qa { display: flex; align-items: center; gap: 16px; padding: 20px; background: var(--surface); border: 1px solid rgba(226,232,240,.8); border-radius: var(--r-lg); box-shadow: var(--shadow); cursor: pointer; text-align: left; width: 100%; transition: transform .15s, box-shadow .15s; }
.qa:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(15,23,42,.1); }
.qa .ic { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; flex: 0 0 56px; }
.qa .t { font-size: 19px; font-weight: 700; display: block; }
.qa .d { font-size: 15px; color: var(--ink-3); display: block; margin-top: 2px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi { padding: 20px 22px; gap: 4px; }
.kpi .k { font-size: 16px; color: var(--ink-3); font-weight: 500; }
.kpi .v { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.kpi .s { font-size: 15px; color: var(--ink-3); }
.kpi.alert { background: linear-gradient(180deg, #FFF8EC, #fff); }
.kpi.alert .v { color: var(--amber); }
button.kpi { text-align: left; cursor: pointer; font: inherit; }
.dash2 { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.hero { padding: 20px; border-radius: var(--r-lg); background: linear-gradient(135deg, #2F5FE3, #4C7BFF); color: #fff; border: 0; text-align: left; cursor: pointer; width: 100%; box-shadow: 0 10px 24px rgba(47,95,227,.3); display: none; }
.hero .k { font-size: 15px; opacity: .85; } .hero .v { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.hero .s { display: flex; justify-content: space-between; margin-top: 8px; font-size: 15px; opacity: .92; }
@media (max-width: 1180px) { .quick, .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dash2 { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .hero { display: block; }
  .kpis.desk-only { display: none; }
  .quick { gap: 12px; }
  .qa { flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px; min-height: 124px; }
  .qa .ic { width: 48px; height: 48px; flex-basis: 48px; border-radius: 14px; }
  .qa .d { display: none; }
  .kpis { gap: 12px; } .kpi { padding: 14px 16px; } .kpi .v { font-size: 22px; }
}

/* ===== 탭·세그먼트 ===== */
.tabs, .seg { display: flex; background: #E9EDF3; border-radius: 14px; padding: 4px; gap: 4px; flex-wrap: wrap; }
.tabs .btn, .seg .btn { flex: 1 1 0; min-height: 50px; border: 0; background: transparent; border-radius: 11px; font-weight: 700; color: var(--ink-2); box-shadow: none; font-size: 17px; padding: 0 10px; white-space: nowrap; }
.tabs .btn[aria-pressed="true"], .seg .btn[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(15,23,42,.14); }
.seg .btn { min-height: 54px; font-size: 18px; }
@media (max-width: 760px) {
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs .btn { flex: 1 0 auto; padding: 0 16px; }
}
.choice { display: flex; gap: 8px; flex-wrap: wrap; }
.choice .btn { min-height: 48px; border-radius: 999px; padding: 0 18px; font-size: 17px; }
.choice .btn[aria-pressed="true"] { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-ink); font-weight: 700; }

/* ===== 목록 ===== */
.list { display: flex; flex-direction: column; }
.item { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; background: var(--surface); border: 1px solid rgba(226,232,240,.8); border-radius: var(--r-md); padding: 16px 20px; text-align: left; width: 100%; cursor: pointer; box-shadow: var(--shadow); transition: box-shadow .15s; margin-bottom: 10px; }
.item:hover { box-shadow: 0 6px 20px rgba(15,23,42,.1); }
.item.static { cursor: default; } .item.static:hover { box-shadow: var(--shadow); }
.item .main { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.item .main .name { font-size: 19px; font-weight: 700; }
.rows { display: flex; flex-direction: column; }
.ri { display: flex; align-items: center; gap: 14px; padding: 14px 0; border: 0; border-top: 1px solid var(--line); background: none; width: 100%; text-align: left; cursor: pointer; font-size: 17px; }
.ri:first-child { border-top: 0; }
.ri .txt { min-width: 0; }
.ri .who { font-weight: 700; font-size: 18px; display: block; } .ri .sub { color: var(--ink-3); font-size: 15px; display: block; }
.ri .amt { margin-left: auto; font-weight: 700; font-size: 18px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.empty { text-align: center; padding: 48px 16px; color: var(--ink-3); background: var(--surface); border: 1.5px dashed var(--line-2); border-radius: var(--r-lg); }

/* ===== 입력 ===== */
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.row > .field { flex: 1 1 240px; }
.field > label, .label { font-size: 15px; font-weight: 600; color: var(--ink-2); }
.input, select.input, textarea.input { width: 100%; min-height: var(--tap); padding: 10px 16px; border: 1px solid var(--line-2); border-radius: 12px; background: #fff; font-size: 19px; transition: border-color .15s, box-shadow .15s; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); outline: none; }
textarea.input { min-height: 120px; resize: vertical; line-height: 1.5; }
select.input { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; background-size: 22px; padding-right: 44px; }
.input.big { min-height: 64px; font-size: 24px; font-weight: 700; border: 2px solid var(--brand); }
.input.num { text-align: right; font-variant-numeric: tabular-nums; }
.input[disabled] { background: var(--sunken); color: var(--ink-2); }
.pick { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: var(--tap); padding: 0 16px; border: 1px solid var(--line-2); border-radius: 12px; background: #fff; font-size: 19px; font-weight: 700; cursor: pointer; text-align: left; }
.pick.placeholder { color: var(--brand-ink); font-weight: 600; border-style: dashed; border-color: var(--brand); background: var(--brand-soft); }
.pick[disabled] { background: var(--sunken); cursor: default; }
.hint { font-size: 14px; color: var(--ink-3); }
.check { display: flex; align-items: center; gap: 12px; min-height: var(--tap); font-size: 18px; cursor: pointer; }
.check input { width: 28px; height: 28px; accent-color: var(--brand); flex: 0 0 28px; }
.stepper { display: flex; height: 56px; border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; background: #fff; }
.stepper .btn { width: 52px; min-height: 0; padding: 0; border: 0; border-radius: 0; background: var(--sunken); font-size: 24px; font-weight: 500; color: var(--ink-2); box-shadow: none; }
.stepper input { flex: 1 1 60px; min-width: 50px; border: 0; text-align: center; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; background: #fff; }
.stepper input:focus { outline: none; background: var(--brand-soft); }
.taxsplit { display: grid; grid-template-columns: 1fr 1fr 1.25fr; gap: 8px; }
.taxsplit .tx { background: var(--sunken); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.taxsplit .money { font-size: 18px; } .taxsplit .strong .money { font-size: 20px; }
.taxsplit.big .strong .money { font-size: 24px; }
.notice .taxsplit .tx { background: rgba(255,255,255,.7); }
@media (max-width: 760px) { .taxsplit .money { font-size: 16px; } .taxsplit .strong .money, .taxsplit.big .strong .money { font-size: 18px; } }
.content > .stepper, .card > .stepper { max-width: 420px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ===== 발주서 ===== */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.split > .side-col { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 16px; }
.line { padding: 18px 4px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.line:first-child { border-top: 0; padding-top: 4px; }
.line.deleted { opacity: .6; }
.line.deleted .lname { text-decoration: line-through; }
.line-top { display: flex; align-items: flex-start; gap: 12px; }
.line-top .prod { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ltag { font-size: 14px; color: var(--brand-ink); font-weight: 700; }
.ltag .late { color: var(--violet); }
.lname { font-size: 20px; font-weight: 700; }
.line-grid { display: grid; grid-template-columns: 190px 190px minmax(0, 1fr); gap: 14px; align-items: start; }
.line-grid .amount { text-align: right; }
.line-grid .amount .money { font-size: 22px; line-height: 56px; }
.sumrow { display: flex; justify-content: space-between; font-size: 18px; color: var(--ink-2); }
.sumtotal { display: flex; justify-content: space-between; align-items: baseline; padding-top: 14px; border-top: 1px solid var(--line); font-weight: 700; }
.sumtotal .money { font-size: 32px; letter-spacing: -0.02em; }
.steps { display: flex; gap: 8px; } .steps div { flex: 1; height: 6px; border-radius: 3px; background: var(--line); } .steps div.on { background: var(--brand); }
.history { display: flex; flex-direction: column; gap: 12px; font-size: 15px; color: var(--ink-2); }
.history > div { padding-left: 14px; border-left: 2px solid var(--line); white-space: pre-line; }
.history b { display: block; color: var(--ink); font-size: 16px; white-space: normal; }
.add-line { min-height: 60px; border: 1.5px dashed var(--line-2); border-radius: 14px; display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 18px; font-weight: 600; color: var(--brand-ink); background: var(--sunken); cursor: pointer; width: 100%; }
.add-line:hover { border-color: var(--brand); background: var(--brand-soft); }
.mobile-bar { display: none; }
@media (max-width: 1180px) { .split { grid-template-columns: 1fr; } .split > .side-col { position: static; } }
@media (max-width: 760px) {
  .line-grid { grid-template-columns: 1fr 1fr; }
  .line-grid .amount { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: baseline; padding-top: 4px; border-top: 1px dashed var(--line); }
  .line-grid .amount .money { line-height: 1.4; }
  .side-col .sum-card { display: none; }
  .mobile-bar { display: flex; flex-direction: column; gap: 10px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(15,23,42,.08); }
  .mobile-bar .btns { display: flex; gap: 10px; } .mobile-bar .btns .btn { flex: 1; }
}

/* 합계 상자 */
.totals { display: flex; flex-direction: column; gap: 6px; margin-left: auto; width: min(100%, 360px); font-size: 18px; color: var(--ink-2); }
.totals > div { display: flex; justify-content: space-between; gap: 16px; }
.totals .sum { font-size: 26px; font-weight: 800; color: var(--ink); border-top: 1px solid var(--line); padding-top: 10px; }

/* ===== 양식 편집 ===== */
.tpl-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
textarea.input.code { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 14px; line-height: 1.55; min-height: 70vh; white-space: pre; overflow-wrap: normal; overflow-x: auto; tab-size: 2; background: #FBFCFE; }
.a4-box { position: relative; overflow: hidden; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.a4-box iframe { position: absolute; top: 0; left: 0; width: 820px; height: 1180px; border: 0; transform-origin: 0 0; }
@media (max-width: 1180px) { .tpl-split { grid-template-columns: 1fr; } textarea.input.code { min-height: 50vh; } }

/* ===== 표 ===== */
.table-box { overflow-x: auto; border-radius: var(--r-lg); background: #fff; border: 1px solid rgba(226,232,240,.8); box-shadow: var(--shadow); }
table.t { width: 100%; border-collapse: collapse; font-size: 17px; }
table.t th { text-align: left; padding: 14px 16px; color: var(--ink-3); font-weight: 600; font-size: 15px; border-bottom: 1px solid var(--line); background: var(--sunken); white-space: nowrap; }
table.t td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t .r { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.t tr.click { cursor: pointer; } table.t tr.click:hover td { background: var(--sunken); }

/* ===== 사진 ===== */
.thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.thumb { position: relative; width: 88px; height: 88px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #E2E8F0; padding: 0; cursor: pointer; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .x { position: absolute; top: 4px; right: 4px; width: 34px; height: 34px; border-radius: 17px; border: 0; background: rgba(15,23,42,.75); color: #fff; font-size: 18px; cursor: pointer; }
.photo { width: 132px; height: 132px; border-radius: 16px; border: 1px dashed var(--line-2); background: var(--sunken); display: flex; align-items: center; justify-content: center; text-align: center; color: var(--ink-3); font-size: 15px; overflow: hidden; flex: 0 0 132px; }
.photo img { width: 100%; height: 100%; object-fit: cover; }

/* ===== 모달 (휴대폰은 아래에서 올라오는 시트) ===== */
.modal-wrap { position: fixed; inset: 0; z-index: 60; background: rgba(15,23,42,.45); display: flex; align-items: center; justify-content: center; padding: 24px; animation: fade .15s; }
.modal { background: var(--surface); width: 100%; max-width: 600px; max-height: calc(100vh - 48px); border-radius: 24px; display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(15,23,42,.3); }
.modal.wide { max-width: 880px; }
.modal-head { display: flex; align-items: center; gap: 8px; padding: 20px 20px 12px 24px; }
.modal-head h2 { flex: 1 1 auto; font-size: 22px; }
.modal-body { padding: 4px 24px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.modal-foot { padding: 14px 24px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.modal-foot .btn { flex: 1 1 140px; }
.grab { display: none; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: .6; } }
@media (max-width: 760px) {
  .modal-wrap { align-items: flex-end; padding: 0; }
  .modal { max-width: none; max-height: 92vh; border-radius: 26px 26px 0 0; animation: up .2s ease-out; }
  .modal-foot { padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
  .grab { display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 10px auto 0; }
  .modal-head { padding-top: 10px; }
}

/* ===== 알림·로딩 ===== */
.toast { position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%); z-index: 80; background: #0F172A; color: #fff; padding: 14px 22px; border-radius: 14px; font-size: 18px; font-weight: 500; max-width: calc(100% - 32px); box-shadow: 0 10px 30px rgba(15,23,42,.3); }
.toast.error { background: var(--red); }
@media (max-width: 760px) { .toast { bottom: calc(var(--tabbar) + 16px); } .app.no-tabbar ~ .toast { bottom: 170px; } }
.busy { position: fixed; inset: 0; z-index: 70; background: rgba(244,246,250,.5); display: flex; align-items: center; justify-content: center; }
.busy span { background: #0F172A; color: #fff; padding: 14px 22px; border-radius: 14px; font-size: 18px; display: flex; align-items: center; gap: 12px; }
.busy span::before { content: ''; width: 20px; height: 20px; border-radius: 50%; border: 3px solid rgba(255,255,255,.3); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 인쇄 미리보기 ===== */
.print-wrap { position: fixed; inset: 0; z-index: 65; background: #475569; display: flex; flex-direction: column; }
.print-bar { background: var(--surface); padding: 12px 20px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; box-shadow: var(--shadow); }
.print-wrap iframe { flex: 1 1 auto; border: 0; background: #fff; width: 100%; }

.scanner { width: 100%; min-height: 240px; background: #0F172A; border-radius: 16px; overflow: hidden; }

/* ===== 로그인 ===== */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: radial-gradient(1200px 600px at 50% -10%, #E3EAFE, var(--bg)); }
.login-card { width: 100%; max-width: 440px; background: var(--surface); border-radius: 28px; box-shadow: 0 24px 60px rgba(15,23,42,.12); padding: 40px 32px 32px; display: flex; flex-direction: column; gap: 16px; text-align: center; }
.login-card h1 { font-size: 30px; }
.brand-mark { width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 4px; background: linear-gradient(135deg, #4C7BFF, #2F5FE3); display: grid; place-items: center; }
.login-card .btn { text-decoration: none; justify-content: center; gap: 12px; }
.login-google { background: #fff; border-color: var(--line-2); color: var(--ink); }
.login-naver { background: #03C75A; border-color: #03C75A; color: #fff; }
.login-naver:hover { background: #02B351; }
.login-logo { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-weight: 900; font-size: 18px; }
.login-logo.g { color: #4285F4; border: 1px solid var(--line); }
.login-logo.n { background: #fff; color: #03C75A; }
