@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;600;700;800&display=swap');

:root {
    font-family: "Noto Sans KR", "Malgun Gothic", sans-serif;
    color: #173028;
    background: #f5f1e8;
    font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: #f5f1e8; }
button, input { font: inherit; }
a { color: inherit; }

.page-shell { width: min(1280px, calc(100% - 48px)); margin: 0 auto; padding: 28px 0 72px; }
.page-header { display: flex; align-items: center; justify-content: space-between; min-height: 58px; margin-bottom: 64px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50% 50% 50% 10px; color: #fff; background: #12372a; font: 800 20px/1 Georgia, serif; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 17px; letter-spacing: -.02em; }
.brand small { margin-top: 2px; color: #66776f; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 20px; border: 1px solid transparent; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 700; text-decoration: none; }
.button-primary { color: #fff; background: #12372a; box-shadow: 0 7px 18px rgba(18, 55, 42, .16); }
.button-primary:hover { background: #205740; }
.button-quiet { border-color: #c9c5ba; color: #31443c; background: transparent; }
.button-quiet:hover { background: #ece7dc; }

.section-label { margin: 0 0 9px; color: #b14c2e; font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1, h2 { margin: 0; color: #12372a; letter-spacing: -.045em; }
h1 { font-size: clamp(35px, 5.2vw, 66px); line-height: 1.12; }
h2 { font-size: 25px; }

.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 250px; align-items: end; gap: 56px; padding: 20px 0 70px; }
.hero-copy { max-width: 780px; }
.hero-copy p:last-child { max-width: 670px; margin: 24px 0 0; color: #5b6b64; font-size: 16px; line-height: 1.85; }
.metric-card { display: grid; grid-template-columns: 1fr auto; align-items: baseline; min-height: 150px; padding: 25px; border-top: 1px solid #a9a497; border-bottom: 1px solid #a9a497; }
.metric-card span { grid-column: 1 / -1; color: #65746d; font-size: 13px; }
.metric-card strong { font: 700 64px/1 Georgia, serif; letter-spacing: -.04em; }
.metric-card small { color: #64736c; }

.upload-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(330px, .8fr); gap: 60px; margin: 16px 0 62px; padding: 38px; border: 1px solid #d2c8b8; border-radius: 16px; background: #fffdf8; box-shadow: 0 20px 60px rgba(77, 63, 43, .07); }
.upload-card p:last-child { max-width: 560px; margin: 13px 0 0; color: #69766f; line-height: 1.7; }
.upload-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-content: center; }
.upload-form input[type="file"] { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.file-picker { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 13px; min-height: 112px; padding: 18px 20px; border: 1px dashed #8d9e95; border-radius: 11px; cursor: pointer; background: #f8f6ef; transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease; }
.file-picker:hover, .file-picker.is-dragging { border-color: #1c6148; background: #edf5ef; box-shadow: 0 0 0 4px rgba(28,97,72,.1); }
.file-picker.is-dragging { transform: translateY(-2px); }
.file-picker.has-file { border-style: solid; border-color: #3b765e; background: #eff6f1; }
.drop-icon { grid-row: 1 / 4; display: grid; place-items: center; width: 43px; height: 43px; border-radius: 50%; color: #fff; background: #215a43; font-size: 23px; font-weight: 500; }
.drop-title { align-self: end; font-size: 14px; font-weight: 800; }
.file-picker small { align-self: start; color: #7b8781; font-size: 11px; }
.file-picker em { max-width: 300px; margin-top: 7px; overflow: hidden; color: #426052; font-size: 12px; font-style: normal; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.file-feedback { grid-column: 1 / -1; min-height: 18px; margin: -3px 0 0; color: #32634e; font-size: 12px; }
.file-feedback.is-error { color: #9b382b; }

.notice { margin: 0 0 22px; padding: 15px 18px; border-radius: 9px; font-size: 14px; line-height: 1.55; }
.notice-warning { border: 1px solid #e1c594; color: #765018; background: #fff7df; }
.notice-error { border: 1px solid #e1aaa0; color: #852f23; background: #fff0ed; }
.notice[hidden] { display: none; }

.content-section { margin-top: 54px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.count-pill { padding: 6px 11px; border: 1px solid #cdc7ba; border-radius: 999px; color: #64736c; font-size: 12px; }
.table-wrap { overflow-x: auto; border-top: 2px solid #12372a; background: rgba(255,255,255,.42); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 14px 15px; border-bottom: 1px solid #dcd6ca; text-align: left; vertical-align: middle; white-space: nowrap; }
th { color: #617068; background: rgba(236,232,221,.72); font-size: 11px; font-weight: 700; letter-spacing: .03em; }
td a { color: #17563f; font-weight: 700; text-underline-offset: 3px; }
.book-table .book-title { min-width: 220px; white-space: normal; font-weight: 700; }
.book-table .book-credits { min-width: 190px; white-space: normal; line-height: 1.55; }
.isbn { font-family: Consolas, monospace; letter-spacing: .02em; }
.search-model { color: #426052; font-size: 11px; font-weight: 700; }
.error-cell { max-width: 300px; overflow: hidden; color: #8d382b; text-overflow: ellipsis; }
tbody tr { transition: background-color .25s ease; }
tbody tr.is-updated { background: #e3f3e9; }
.empty-state { padding: 44px 24px; border-top: 2px solid #12372a; border-bottom: 1px solid #cfc9bd; color: #758078; text-align: center; }

.status { display: inline-flex; align-items: center; min-height: 25px; padding: 2px 9px; border-radius: 99px; color: #4d6258; background: #e5e9e4; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.status-complete { color: #16633f; background: #dcefe4; }
.status-processing { color: #315c75; background: #deedf3; }
.status-partial, .status-failed { color: #953b2e; background: #f6dfda; }
.status-queued { color: #755a1d; background: #f2e8ca; }

.login-card { width: min(720px, 100%); margin: 9vh auto 0; padding: 54px; border: 1px solid #d0c7b8; border-radius: 18px; background: #fffdf8; box-shadow: 0 25px 80px rgba(63, 49, 31, .1); }
.login-card h1 { font-size: clamp(30px, 4vw, 44px); }
.login-card > p:not(.section-label) { margin: 21px 0 30px; color: #68776f; line-height: 1.75; }
.login-form { margin-top: 26px; }
.login-form label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 700; }
.input-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.input-row input { min-width: 0; height: 48px; padding: 0 14px; border: 1px solid #aeb7b1; border-radius: 8px; background: #fff; outline: none; }
.input-row input:focus { border-color: #28664f; box-shadow: 0 0 0 3px rgba(40,102,79,.12); }

.import-summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.import-summary h1 { max-width: 900px; overflow-wrap: anywhere; font-size: clamp(30px, 4vw, 48px); }
.import-summary p:last-child { margin: 13px 0 0; color: #6e7a74; }
.progress-track { height: 8px; margin: 30px 0 24px; overflow: hidden; border-radius: 10px; background: #ded9ce; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: #b14c2e; transition: width .3s ease; }

.error-page { width: min(680px, calc(100% - 40px)); margin: 15vh auto; }
.error-page a { color: #17563f; font-weight: 700; }

@media (max-width: 800px) {
    .page-shell { width: min(100% - 28px, 1280px); padding-top: 18px; }
    .page-header { margin-bottom: 40px; }
    .hero-grid { grid-template-columns: 1fr; gap: 30px; padding-bottom: 46px; }
    .metric-card { grid-template-columns: 1fr auto; min-height: 110px; }
    .metric-card strong { font-size: 50px; }
    .upload-card { grid-template-columns: 1fr; gap: 28px; padding: 25px; }
}

@media (max-width: 520px) {
    .brand small { display: none; }
    .page-header { margin-bottom: 32px; }
    h1 { font-size: 36px; }
    .upload-form, .input-row { grid-template-columns: 1fr; }
    .login-card { margin-top: 4vh; padding: 30px 22px; }
    .import-summary { align-items: flex-start; flex-direction: column; }
    th, td { padding: 12px; }
}
