:root {
  --navy: #061b45;
  --blue: #0b3a82;
  --red: #ff1748;
  --ink: #101c34;
  --muted: #6f7b91;
  --line: #e3e8f1;
  --surface: #ffffff;
  --canvas: #f4f6fa;
  --success: #00886b;
  --shadow: 0 18px 48px rgba(16, 28, 52, .10);
}
* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; min-width: 320px; min-height: 100vh; color: var(--ink); background: var(--canvas); font-family: Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.ambient { position: fixed; z-index: -1; border-radius: 50%; filter: blur(10px); pointer-events: none; }
.ambient-one { width: 440px; height: 440px; top: -180px; left: -140px; background: rgba(19, 63, 131, .08); }
.ambient-two { width: 380px; height: 380px; right: -130px; bottom: -180px; background: rgba(255, 23, 72, .07); }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: linear-gradient(135deg, #f8faff 0%, #f1f4f9 52%, #fff4f6 100%); }
.login-card { width: min(100%, 520px); padding: 42px; border: 1px solid rgba(255,255,255,.9); border-radius: 28px; background: rgba(255,255,255,.92); box-shadow: 0 32px 80px rgba(6, 27, 69, .14); backdrop-filter: blur(18px); }
.brand-block { display: flex; align-items: center; gap: 14px; }
.brand-logo { width: 128px; height: auto; display: block; }
.brand-tag { padding: 6px 9px; border-radius: 6px; color: #53627c; background: #edf1f7; font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.login-copy { margin: 44px 0 30px; }
.eyebrow { margin: 0 0 10px; color: var(--red); font-size: 11px; font-weight: 850; letter-spacing: .16em; }
.login-copy h1, .page-heading h1 { margin: 0; color: var(--navy); letter-spacing: -.05em; }
.login-copy h1 { font-size: clamp(37px, 7vw, 52px); line-height: 1.08; }
.login-copy > p:last-child { margin: 16px 0 0; color: var(--muted); line-height: 1.7; }
.login-form { display: grid; gap: 10px; }
.login-form label, .search-grid label { color: #526078; font-size: 12px; font-weight: 750; }
input { width: 100%; min-height: 48px; padding: 0 15px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: #fff; outline: none; transition: border-color .18s, box-shadow .18s; }
input:focus { border-color: #2f61a7; box-shadow: 0 0 0 4px rgba(47, 97, 167, .10); }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 62px; }
.text-button { position: absolute; top: 50%; right: 10px; transform: translateY(-50%); border: 0; color: var(--blue); background: transparent; font-size: 12px; font-weight: 800; }
.primary-button { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 18px; border: 0; border-radius: 12px; color: #fff; background: linear-gradient(120deg, var(--navy), #0b438f); font-weight: 800; box-shadow: 0 12px 24px rgba(6, 27, 69, .18); transition: transform .16s, box-shadow .16s, opacity .16s; }
.primary-button:hover { transform: translateY(-1px); box-shadow: 0 15px 28px rgba(6, 27, 69, .24); }
.primary-button:disabled { cursor: wait; opacity: .55; transform: none; }
.login-form .primary-button { margin-top: 10px; }
.form-error { margin: 3px 0 0; padding: 10px 12px; border-radius: 10px; color: #a60028; background: #fff0f3; font-size: 13px; }
.security-note { display: flex; align-items: flex-start; gap: 11px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.55; }
.security-note p { margin: 0; }
.shield { width: 24px; height: 24px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 8px; color: var(--success); background: #e8f7f3; font-weight: 900; }
.topbar { position: sticky; z-index: 20; top: 0; border-bottom: 1px solid rgba(227,232,241,.9); background: rgba(255,255,255,.88); backdrop-filter: blur(16px); }
.topbar-inner { width: min(1280px, calc(100% - 48px)); min-height: 70px; margin: auto; display: flex; align-items: center; justify-content: space-between; }
.app-brand { display: flex; align-items: center; gap: 16px; color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 750; }
.app-brand img { width: 86px; }
.app-brand span { padding-left: 16px; border-left: 1px solid var(--line); }
.account-area, .merchant-identity { display: flex; align-items: center; gap: 10px; }
.merchant-identity { font-size: 13px; font-weight: 700; }
.merchant-copy { display: grid; gap: 2px; line-height: 1.2; }
.merchant-copy strong { color: inherit; font-size: 12px; }
.merchant-copy small { color: var(--muted); font-size: 9px; font-weight: 650; letter-spacing: .01em; }
.merchant-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(0,136,107,.1); }
.ghost-button, .refresh-button { min-height: 38px; padding: 0 13px; border: 1px solid var(--line); border-radius: 10px; color: #4d5b72; background: #fff; font-size: 12px; font-weight: 750; }
.content { width: min(1280px, calc(100% - 48px)); margin: auto; padding: 54px 0 70px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 28px; }
.page-heading h1 { font-size: clamp(32px, 4vw, 46px); }
.subcopy { margin: 10px 0 0; color: var(--muted); font-size: 14px; }
.updated-chip { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 999px; color: #58657a; background: #fff; font-size: 11px; }
.updated-chip > span:first-child { color: var(--success); font-size: 9px; }
.updated-chip.live > span:first-child { animation: live-pulse 1.8s ease-out infinite; }
@keyframes live-pulse { 0%, 45% { opacity: 1; text-shadow: 0 0 0 rgba(0,136,107,.35); } 100% { opacity: .72; text-shadow: 0 0 0 8px rgba(0,136,107,0); } }
.filter-panel, .transactions-panel { border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 10px 26px rgba(16,28,52,.045); }
.filter-panel { padding: 20px; }
.quick-ranges { display: flex; gap: 7px; margin-bottom: 18px; }
.range-button { min-height: 36px; padding: 0 15px; border: 1px solid var(--line); border-radius: 9px; color: #58657a; background: #fff; font-size: 12px; font-weight: 750; }
.range-button.active { border-color: var(--navy); color: #fff; background: var(--navy); }
.search-grid { display: grid; grid-template-columns: 155px 18px 155px minmax(220px, 1fr) 92px; align-items: end; gap: 10px; }
.search-grid label { display: grid; gap: 7px; }
.search-grid input { min-height: 44px; }
.date-separator { align-self: center; margin-top: 20px; color: #9aa4b5; text-align: center; }
.input-with-icon { position: relative; display: block; }
.input-with-icon > span { position: absolute; z-index: 1; top: 50%; left: 14px; transform: translateY(-50%); color: #8190a6; font-size: 20px; }
.input-with-icon input { padding-left: 40px; }
.primary-button.compact { min-height: 44px; justify-content: center; box-shadow: none; }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 18px 0; }
.summary-card { position: relative; min-height: 168px; padding: 23px; overflow: hidden; border: 1px solid var(--line); border-radius: 17px; }
.summary-card.navy { border-color: var(--navy); color: #fff; background: linear-gradient(145deg, #071d47, #0d4285); }
.summary-card.red { border-color: #f03056; color: #fff; background: linear-gradient(145deg, #d80b35, #ff315a); }
.summary-card.white { background: #fff; }
.summary-card.emphasis { border-top: 3px solid var(--navy); }
.summary-card p { margin: 0 0 14px; color: inherit; opacity: .75; font-size: 12px; font-weight: 750; }
.summary-card strong { display: block; font-size: clamp(24px, 2.2vw, 32px); letter-spacing: -.04em; }
.summary-card > span { display: block; margin-top: 11px; color: inherit; opacity: .62; font-size: 11px; }
.summary-icon { position: absolute; top: 18px; right: 18px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; color: inherit; background: rgba(255,255,255,.14); font-weight: 900; }
.white .summary-icon { color: var(--blue); background: #edf4ff; }
.transactions-panel { overflow: hidden; }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.panel-title h2 { margin: 0; font-size: 18px; }
.panel-title p { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.refresh-button { display: flex; align-items: center; gap: 7px; }
.table-wrap { overflow-x: auto; scrollbar-color: #c7cfdb #f1f3f6; }
table { width: 100%; min-width: 1180px; border-collapse: separate; border-spacing: 0; white-space: nowrap; }
th { position: sticky; z-index: 2; top: 0; padding: 11px 10px; border-bottom: 1px solid #dde3ec; color: #647188; background: #f4f6f9; font-size: 10px; text-align: left; }
td { padding: 11px 10px; border-top: 1px solid #edf0f5; color: #36445a; font-size: 11px; }
tbody tr { cursor: pointer; transition: background .15s; }
tbody tr:hover { background: #f2f7ff; }
.transaction-row.cancelled { background: #fff1f4; }
.transaction-row.cancelled:hover { background: #ffe8ed; }
.transaction-row.voided { background: #fff8f9; }
.sequence-cell { width: 44px; color: #8a95a6; text-align: center; font-variant-numeric: tabular-nums; }
.date-cell, .card-cell, .approval-cell { font-variant-numeric: tabular-nums; }
.goods-cell { min-width: 150px; max-width: 210px; overflow: hidden; color: #174f9a; font-weight: 700; text-overflow: ellipsis; }
.amount-cell { text-align: right; font-variant-numeric: tabular-nums; }
td.amount-cell { color: var(--ink); font-size: 12px; font-weight: 800; }
td.amount-cell.negative { color: #c10c35; }
.action-cell { min-width: 114px; text-align: center; }
.row-actions { display: flex; align-items: center; justify-content: center; gap: 5px; }
.row-action { min-height: 27px; padding: 0 9px; border: 1px solid #cad3df; border-radius: 4px; color: #40516a; background: #fff; font-size: 10px; font-weight: 800; }
.row-action:hover { border-color: #8191a8; background: #f7f9fc; }
.row-action.cancel { border-color: #d82a4f; color: #fff; background: #d82a4f; }
.row-action.cancel:hover { background: #b90f36; }
.type-badge, .status-badge { display: inline-flex; align-items: center; min-height: 24px; padding: 0 9px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.type-badge.approval { color: #0750a4; background: #edf5ff; }
.type-badge.cancel { color: #c10c35; background: #fff0f3; }
.status-badge.success { color: #00755d; background: #e9f7f3; }
.status-badge.pending { color: #8a6415; background: #fff7df; }
.state-box { min-height: 260px; display: grid; place-items: center; align-content: center; gap: 12px; padding: 40px; color: var(--muted); text-align: center; }
.state-box p, .state-box h3 { margin: 0; }
.state-box.empty > div { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 18px; color: var(--blue); background: #edf4ff; font-size: 28px; }
.state-box.empty h3 { color: var(--ink); font-size: 16px; }
.spinner { width: 32px; height: 32px; border: 3px solid #dce4f0; border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.mobile-list { display: none; padding: 0 18px 18px; }
.mobile-transaction { width: 100%; padding: 17px 0; border: 0; border-bottom: 1px solid var(--line); color: inherit; background: transparent; text-align: left; }
.mobile-transaction:last-child { border-bottom: 0; }
.mobile-transaction .row { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.mobile-transaction strong { font-size: 17px; }
.mobile-transaction p { margin: 9px 0 0; color: var(--muted); font-size: 11px; }
footer { width: min(1280px, calc(100% - 48px)); margin: auto; padding: 0 0 32px; display: flex; justify-content: space-between; color: #8b95a6; font-size: 10px; }
.detail-dialog { width: min(92vw, 460px); padding: 28px; border: 0; border-radius: 22px; color: var(--ink); box-shadow: var(--shadow); }
.detail-dialog::backdrop { background: rgba(6, 27, 69, .5); backdrop-filter: blur(3px); }
.detail-dialog h2 { margin: 0 0 24px; }
.dialog-close { position: absolute; top: 16px; right: 16px; width: 34px; height: 34px; border: 0; border-radius: 50%; color: #647188; background: #f1f4f8; font-size: 22px; }
.detail-dialog dl { margin: 0 0 24px; display: grid; grid-template-columns: 110px 1fr; }
.detail-dialog dt, .detail-dialog dd { margin: 0; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.detail-dialog dt { color: var(--muted); }
.detail-dialog dd { color: var(--ink); text-align: right; font-weight: 750; overflow-wrap: anywhere; }
.detail-dialog .primary-button { width: 100%; justify-content: center; }
.cancel-action { margin: 0 0 18px; padding: 15px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid #ffd4dc; border-radius: 12px; background: #fff7f8; }
.cancel-action strong { display: block; color: #a60028; font-size: 13px; }
.cancel-action p { margin: 5px 0 0; color: #7a5360; font-size: 11px; }
.cancel-action b { color: #a60028; }
.danger-button { min-height: 42px; padding: 0 15px; flex: 0 0 auto; border: 0; border-radius: 10px; color: #fff; background: #c80e38; font-size: 12px; font-weight: 800; transition: background .16s, opacity .16s; }
.danger-button:hover { background: #a9082c; }
.danger-button:disabled, .dialog-actions .ghost-button:disabled { cursor: wait; opacity: .55; }
.confirm-dialog { width: min(92vw, 430px); }
.confirm-dialog h2 { margin-bottom: 10px; }
.confirm-copy { margin: 0 0 18px; color: var(--ink); font-size: 14px; font-weight: 800; line-height: 1.6; }
.warning-box { margin-bottom: 22px; padding: 13px 14px; border: 1px solid #ffd4dc; border-radius: 10px; color: #8a203a; background: #fff5f7; font-size: 11px; line-height: 1.6; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dialog-actions > button { width: 100%; min-height: 46px; justify-content: center; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 28px; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 12px; color: #fff; background: #17243d; box-shadow: var(--shadow); font-size: 12px; }
@media (max-width: 980px) {
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .search-grid { grid-template-columns: 1fr 18px 1fr 1.4fr 82px; }
}
@media (max-width: 720px) {
  .login-shell { padding: 16px; }
  .login-card { padding: 30px 24px; border-radius: 22px; }
  .login-copy { margin: 34px 0 26px; }
  .topbar-inner, .content, footer { width: min(100% - 28px, 1280px); }
  .topbar-inner { min-height: 62px; }
  .app-brand span, .merchant-identity { display: none; }
  .content { padding: 34px 0 50px; }
  .page-heading { align-items: flex-start; margin-bottom: 20px; }
  .updated-chip { margin-top: 5px; }
  .filter-panel { padding: 15px; }
  .quick-ranges { overflow-x: auto; padding-bottom: 3px; }
  .range-button { flex: 0 0 auto; }
  .search-grid { grid-template-columns: 1fr 12px 1fr; }
  .search-field { grid-column: 1 / 4; }
  .search-grid .compact { grid-column: 1 / 4; }
  .summary-grid { gap: 10px; margin: 12px 0; }
  .summary-card { min-height: 142px; padding: 18px; }
  .panel-title { padding: 18px; }
  .refresh-button span { display: none; }
  .table-wrap { display: none !important; }
  .mobile-list:not([hidden]) { display: block !important; }
  footer { display: grid; gap: 7px; }
}
@media (max-width: 460px) {
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .summary-card { min-height: 134px; }
  .summary-card strong { font-size: 21px; }
  .summary-icon { width: 28px; height: 28px; top: 14px; right: 14px; }
  .page-heading { display: block; }
  .updated-chip { width: max-content; margin-top: 15px; }
  .cancel-action { align-items: stretch; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }
