:root {
    --green: #09bb1b;
    --green-dark: #079c17;
    --green-soft: #effcf1;
    --ink: #243342;
    --muted: #6e7b87;
    --line: #e7ebed;
    --surface: #ffffff;
    --canvas: #f6f8f7;
    --danger: #d64545;
    --warning: #b7791f;
    --radius: 16px;
    --shadow: 0 18px 55px rgba(34, 57, 43, .10);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
    margin: 0;
    min-width: 320px;
    background: var(--canvas);
    color: var(--ink);
    font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { color: inherit; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
    height: 78px;
    padding: 0 clamp(22px, 5vw, 76px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(12px);
}
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; letter-spacing: .03em; }
.brand-mark { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 12px; color: #fff; font-size: 20px; font-weight: 800; background: linear-gradient(135deg, var(--green), #06c8bb); box-shadow: 0 8px 18px rgba(9, 187, 27, .22); }
.brand strong, .brand small { display: block; line-height: 1.1; }
.brand strong { font-size: 15px; }
.brand small { margin-top: 4px; color: var(--muted); font-size: 9px; letter-spacing: .23em; }

.main { width: min(1240px, calc(100% - 40px)); margin: 0 auto; flex: 1; }
.hero { min-height: calc(100vh - 132px); display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(360px, .8fr); gap: clamp(50px, 8vw, 110px); align-items: center; padding: 70px 0 90px; }
.hero-copy { position: relative; }
.hero-copy::before { content: ""; position: absolute; width: 310px; height: 310px; left: -160px; top: -140px; border-radius: 50%; background: rgba(9, 187, 27, .08); filter: blur(2px); z-index: -1; }
.eyebrow { display: inline-block; margin-bottom: 14px; color: var(--green-dark); font-size: 12px; font-weight: 800; letter-spacing: .18em; }
.hero h1, .status-view h1, .password-view h1, .dashboard-heading h1 { margin: 0; letter-spacing: -.045em; line-height: 1.17; }
.hero h1 { font-size: clamp(40px, 5vw, 68px); }
.hero-copy > p { max-width: 610px; margin: 25px 0 30px; color: var(--muted); font-size: 18px; }
.trust-list { padding: 0; margin: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 12px 22px; color: #4e5d68; font-size: 14px; }
.trust-list li::before { content: "✓"; margin-right: 8px; color: var(--green); font-weight: 900; }

.auth-card, .panel { background: var(--surface); border: 1px solid rgba(221, 227, 224, .9); border-radius: var(--radius); box-shadow: var(--shadow); }
.auth-card { padding: 10px 34px 34px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); margin-bottom: 27px; }
.tab { border: 0; background: transparent; padding: 17px 5px 14px; color: var(--muted); font-weight: 700; cursor: pointer; border-bottom: 2px solid transparent; }
.tab.active { color: var(--ink); border-bottom-color: var(--green); }
.form { display: grid; gap: 18px; }
.field label { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 7px; font-size: 14px; font-weight: 700; }
.field label span { color: var(--muted); font-size: 11px; font-weight: 500; }
.field input { width: 100%; height: 48px; padding: 0 14px; border: 1px solid #dce2df; border-radius: 9px; background: #fbfcfc; outline: 0; transition: border-color .18s, box-shadow .18s; }
.field input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(9, 187, 27, .12); background: #fff; }
.form-note { margin: -3px 0 0; text-align: center; color: var(--muted); font-size: 12px; }

.button { border: 0; border-radius: 9px; padding: 10px 17px; font-weight: 750; cursor: pointer; transition: transform .14s, background .14s, opacity .14s; }
.button:hover { transform: translateY(-1px); }
.button:focus-visible, .tab:focus-visible, .page-button:focus-visible, .modal-close:focus-visible, .brand:focus-visible {
    outline: 3px solid rgba(9, 156, 23, .42);
    outline-offset: 3px;
}
.button:disabled { cursor: wait; opacity: .55; transform: none; }
.button-primary { color: #fff; background: linear-gradient(97deg, #09cd07 0%, #0bc409 25%, #06c8bb 100%); box-shadow: 0 7px 18px rgba(9, 187, 27, .18); }
.button-quiet { background: #eef2f0; color: #52615b; }
.button-outline { background: #fff; color: var(--green-dark); border: 1px solid #b8ddbd; }
.button-full { width: 100%; margin-top: 3px; min-height: 49px; }
.alert { padding: 11px 13px; margin: 0 0 18px; border-radius: 8px; background: #fff3f3; color: var(--danger); font-size: 13px; }
.alert.success { background: var(--green-soft); color: #087318; }

.status-view, .password-view { min-height: calc(100vh - 132px); display: grid; place-content: center; text-align: center; padding: 70px 0; }
.status-view { justify-items: center; }
.status-icon { width: 78px; height: 78px; margin-bottom: 25px; border-radius: 50%; display: grid; place-items: center; background: #fff7df; color: var(--warning); font-size: 32px; box-shadow: var(--shadow); }
.status-icon::after { content: "…"; transform: translateY(-4px); }
.status-icon.rejected { background: #fff0f0; color: var(--danger); }
.status-icon.rejected::after { content: "×"; transform: none; }
.status-icon.approved { background: var(--green-soft); color: var(--green-dark); }
.status-icon.approved::after { content: "✓"; transform: none; }
.status-view h1, .password-view h1 { font-size: clamp(30px, 4vw, 44px); }
.status-view > p, .password-view .panel > p { max-width: 560px; margin: 15px auto 28px; color: var(--muted); }
.account-summary { width: min(540px, 100%); margin: 0; padding: 22px 26px; display: grid; gap: 11px; background: #fff; border: 1px solid var(--line); border-radius: 12px; text-align: left; }
.account-summary div { display: grid; grid-template-columns: 120px 1fr; gap: 16px; }
.account-summary dt { color: var(--muted); }
.account-summary dd { margin: 0; font-weight: 650; word-break: break-all; }
.compact-panel { width: min(470px, calc(100vw - 40px)); padding: 38px; text-align: left; }
.compact-panel > .eyebrow, .compact-panel > h1, .compact-panel > p { text-align: center; }

.dashboard { padding: 62px 0 100px; }
.dashboard-heading { display: flex; justify-content: space-between; gap: 30px; align-items: flex-end; margin-bottom: 30px; }
.dashboard-heading h1 { font-size: clamp(32px, 4vw, 48px); }
.dashboard-heading p { margin: 9px 0 0; color: var(--muted); }
.permission-chip { padding: 9px 13px; border-radius: 999px; background: var(--green-soft); color: #087318; font-size: 12px; font-weight: 800; white-space: nowrap; }
.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.summary-card { padding: 21px; background: #fff; border: 1px solid var(--line); border-radius: 13px; }
.summary-card span { display: block; color: var(--muted); font-size: 12px; }
.summary-card strong { display: block; margin-top: 7px; font-size: 20px; letter-spacing: -.02em; }
.settlement-panel { overflow: hidden; box-shadow: 0 14px 40px rgba(34, 57, 43, .07); }
.panel-heading { padding: 23px 25px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 0; font-size: 20px; }
.panel-heading p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 15px 20px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; }
th { color: var(--muted); background: #fafbfb; font-size: 12px; }
td.number, th.number { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:hover { background: #fbfefb; }
.revision { display: inline-flex; padding: 3px 8px; border-radius: 999px; background: #f0f3f2; color: #5b6762; font-size: 11px; }
.row-actions { text-align: right; }
.row-actions .button { padding: 7px 12px; font-size: 12px; }
.empty-state { min-height: 220px; display: grid; place-content: center; text-align: center; gap: 6px; color: var(--muted); }
.empty-state strong { color: var(--ink); }
.pagination { display: flex; justify-content: center; gap: 7px; padding: 18px; }
.page-button { min-width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.page-button.active { color: #fff; border-color: var(--green); background: var(--green); }

.modal-backdrop { position: fixed; inset: 0; z-index: 50; padding: 24px; display: grid; place-items: center; background: rgba(19, 31, 25, .52); backdrop-filter: blur(5px); }
.modal { width: min(650px, 100%); max-height: calc(100vh - 48px); overflow-y: auto; position: relative; padding: 34px; background: #fff; border-radius: 17px; box-shadow: 0 28px 90px rgba(0, 0, 0, .22); }
.modal h2 { margin: 0 0 23px; font-size: 28px; }
.modal-close { position: absolute; top: 18px; right: 20px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: #f0f3f2; cursor: pointer; font-size: 23px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: var(--line); }
.detail-item { padding: 15px; background: #fff; }
.detail-item span { display: block; color: var(--muted); font-size: 11px; }
.detail-item strong { display: block; margin-top: 4px; word-break: break-word; }
.detail-item.highlighted { background: var(--green-soft); }
.download-actions { display: flex; gap: 10px; margin-top: 22px; }
.download-actions .button { flex: 1; text-align: center; text-decoration: none; }
footer { padding: 27px 20px; color: #89938e; border-top: 1px solid var(--line); text-align: center; font-size: 11px; background: #fff; }

@media (max-width: 900px) {
    .hero { grid-template-columns: 1fr; padding: 52px 0 70px; }
    .hero-copy { text-align: center; }
    .hero-copy > p { margin-left: auto; margin-right: auto; }
    .trust-list { justify-content: center; }
    .auth-card { width: min(500px, 100%); margin: 0 auto; }
    .summary-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .topbar { height: 68px; padding: 0 17px; }
    .brand-mark { width: 35px; height: 35px; }
    .main { width: min(100% - 28px, 1240px); }
    .hero { min-height: auto; gap: 38px; padding-top: 42px; }
    .hero h1 { font-size: 38px; }
    .hero-copy > p { font-size: 16px; }
    .trust-list { display: grid; justify-content: start; text-align: left; margin-left: auto; margin-right: auto; width: max-content; }
    .auth-card { padding: 8px 22px 26px; }
    .dashboard { padding-top: 40px; }
    .dashboard-heading { display: block; }
    .permission-chip { display: inline-flex; margin-top: 16px; }
    .summary-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
    .summary-card { padding: 16px; }
    .summary-card strong { font-size: 17px; }
    .panel-heading { padding: 20px; }
    .modal { padding: 28px 21px; }
    .detail-grid { grid-template-columns: 1fr; }
    .download-actions { flex-direction: column; }
    .account-summary div { grid-template-columns: 90px 1fr; }
}
