
:root {
    color-scheme: light;
    --bg: #f5f7fa;
    --panel: #ffffff;
    --text: #18202c;
    --muted: #667085;
    --line: #d8dee8;
    --brand: #165dff;
    --brand-dark: #0b45c6;
    --green: #047857;
    --red: #b42318;
    --amber: #b54708;
    --shadow: 0 14px 36px rgba(24, 32, 44, 0.08);
    font-family: Inter, "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
}

a {
    color: inherit;
    text-decoration: none;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 24px;
    min-height: 68px;
    padding: 0 32px;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(10px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    letter-spacing: 0;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 7px;
    background: var(--brand);
    color: #fff;
    font-weight: 900;
}

.top-nav {
    display: inline-flex;
    gap: 8px;
}

.nav-link {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    padding: 0 14px;
    color: var(--muted);
    border-radius: 6px;
    font-weight: 700;
    font-size: 14px;
}

.nav-link.active,
.nav-link:hover {
    background: #edf3ff;
    color: var(--brand-dark);
}

.user-box {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-width: 0;
}

.user-name {
    font-weight: 800;
}

.user-level {
    color: var(--muted);
    font-size: 13px;
}

.page-shell {
    width: min(1180px, calc(100vw - 40px));
    margin: 30px auto 60px;
}

.auth-layout {
    min-height: calc(100vh - 128px);
    display: grid;
    place-items: center;
}

.auth-layout.wide {
    align-items: start;
    padding-top: 36px;
}

.auth-panel {
    width: min(430px, 100%);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 32px;
}

.wide .auth-panel {
    width: min(760px, 100%);
}

h1 {
    margin: 0 0 22px;
    font-size: 28px;
    line-height: 1.2;
    letter-spacing: 0;
}

.form-grid {
    display: grid;
    gap: 18px;
}

.form-grid.two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.full-row {
    grid-column: 1 / -1;
}

label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

input,
select {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--text);
    padding: 0 12px;
    font: inherit;
    letter-spacing: 0;
}

input:focus,
select:focus {
    outline: 3px solid #cfe0ff;
    border-color: var(--brand);
}

.check-row,
.level-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

button,
.primary-button,
.secondary-button,
.ghost-button {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid transparent;
    padding: 0 16px;
    font: inherit;
    font-weight: 800;
    letter-spacing: 0;
    cursor: pointer;
    white-space: nowrap;
}

.primary-button {
    background: var(--brand);
    color: #fff;
}

.primary-button:hover {
    background: var(--brand-dark);
}

.primary-button.inline {
    width: fit-content;
}

.secondary-button {
    background: #f0f4f8;
    border-color: var(--line);
    color: var(--text);
}

.secondary-button:hover {
    background: #e5ecf5;
}

.secondary-button.compact {
    min-height: 38px;
    padding-inline: 12px;
}

.ghost-button {
    min-height: 36px;
    background: #fff;
    border-color: var(--line);
    color: var(--muted);
}

.ghost-button:hover {
    color: var(--text);
    background: #f8fafc;
}

.auth-alt {
    margin: 18px 0 0;
    text-align: center;
    color: var(--brand-dark);
    font-weight: 800;
}

.alert {
    margin: 0 0 18px;
    padding: 13px 14px;
    border-radius: 6px;
    font-weight: 800;
}

.alert.error {
    color: var(--red);
    background: #fff0ed;
    border: 1px solid #ffd1ca;
}

.alert.success {
    color: var(--green);
    background: #ecfdf3;
    border: 1px solid #abefc6;
}

.field-note {
    min-height: 18px;
    font-size: 13px;
    font-weight: 800;
}

.field-note.good {
    color: var(--green);
}

.field-note.bad {
    color: var(--red);
}

.hero-band,
.section-title {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.hero-band {
    min-height: 150px;
    padding: 26px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--amber);
    font-size: 13px;
    font-weight: 900;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.metric-card {
    min-height: 118px;
    display: grid;
    align-content: space-between;
    padding: 22px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.metric-card span {
    color: var(--muted);
    font-weight: 800;
}

.metric-card strong {
    font-size: 34px;
    letter-spacing: 0;
}

.table-wrap {
    overflow-x: auto;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

table {
    width: 100%;
    min-width: 980px;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
    font-size: 14px;
}

th {
    color: var(--muted);
    background: #f8fafc;
    font-size: 13px;
    font-weight: 900;
}

tr:last-child td {
    border-bottom: 0;
}

@media (max-width: 760px) {
    .app-header {
        grid-template-columns: 1fr;
        align-items: start;
        padding: 16px 20px;
        gap: 12px;
    }

    .top-nav,
    .user-box {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .page-shell {
        width: min(100vw - 24px, 1180px);
        margin-top: 18px;
    }

    .auth-panel {
        padding: 24px;
    }

    .form-grid.two-col,
    .metric-grid {
        grid-template-columns: 1fr;
    }

    .hero-band,
    .section-title {
        align-items: start;
        flex-direction: column;
    }
}
