:root {
    --page-bg-top: #08142d;
    --page-bg-bottom: #030919;
    --page-radial-a: rgba(86, 153, 255, 0.28);
    --page-radial-b: rgba(30, 64, 175, 0.35);
    --page-radial-c: rgba(9, 12, 44, 0.85);
    --glass-bg: rgba(9, 18, 44, 0.65);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-primary: #e8f0ff;
    --text-muted: rgba(232, 240, 255, 0.65);
    --pill-bg: rgba(255, 255, 255, 0.08);
    --pill-border: rgba(255, 255, 255, 0.12);
    --accent: #7cc5ff;
    --accent-strong: #6b7bff;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: transparent;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Inter', 'Pretendard', system-ui, sans-serif;
    color: var(--text-primary);
    background: transparent;
    position: relative;
}

body.bg-slate-50 {
    background-color: transparent;
}

body:not(.login-page)::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    background-image:
        radial-gradient(circle at 16% 20%, var(--page-radial-a), transparent 55%),
        radial-gradient(circle at 80% 0%, var(--page-radial-b), transparent 60%),
        linear-gradient(180deg, var(--page-bg-top) 0%, var(--page-bg-bottom) 90%);
    background-repeat: no-repeat;
    background-size: cover;
}

main {
    flex: 1 0 auto;
    width: 100%;
    padding: clamp(28px, 5vw, 60px) clamp(20px, 5vw, 88px) clamp(12px, 4vw, 32px);
    background: transparent;
}

.app-footer {
    text-align: center;
    padding: 8px 20px 12px;
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.6rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    background: transparent;
}

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

.app-header {
    position: sticky;
    top: 0;
    width: 100%;
    padding: 10px clamp(16px, 5vw, 48px);
    z-index: 50;
    background: transparent !important;
    border-bottom: none;
    box-shadow: none;
}

.glass-header {
    background: transparent;
    border-bottom: none;
    box-shadow: none;
    backdrop-filter: blur(14px);
}


.header-shell {
    display: flex;
    align-items: center;
    gap: 24px;
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
}

.header-nav-group {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-left: 24px;
}

.header-nav-panel {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-mobile-toggle {
    display: none;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    width: 52px;
    height: 52px;
    font-size: 0;
    background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.08));
    color: #f6fbff;
    cursor: pointer;
    gap: 0;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(16px);
    margin-left: 16px;
}

.header-mobile-toggle.is-active {
    background: linear-gradient(135deg, #ff7a18, #ff4d00);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 18px 34px rgba(255, 77, 0, 0.4);
}

.header-mobile-toggle .material-icons {
    font-size: 1.4rem;
}

.header-mobile-toggle__label {
    display: none;
}

.header-brand {
    display: inline-flex;
    align-items: center;
}

.brand-title {
    font-size: clamp(1.2rem, 1.1vw, 1.4rem);
    font-weight: 520;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #cfe4ff;
    font-family: 'Inter', 'Pretendard', system-ui, sans-serif;
}

.header-center {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: nowrap;
}

.header-actions-desktop {
    margin-left: auto;
}

.header-actions.header-actions-mobile {
    display: none;
    width: 100%;
}

.nav-item {
    position: relative;
}

.nav-dropdown {
}

.mobile-ai-tool {
    display: none;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-primary);
    padding: 8px 16px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    white-space: nowrap;
}

.nav-pill {
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    white-space: nowrap;
}

.nav-link:hover,
.nav-link:focus-visible {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.15);
}

.nav-caret {
    font-size: 0.8rem;
    opacity: 0.75;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    transform: translateY(-1px);
    transition: transform 0.2s ease;
    color: currentColor;
}

.nav-dropdown.is-open .nav-caret {
    transform: rotate(180deg);
}

.nav-dropdown__menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    min-width: 220px;
    background: rgba(6, 15, 38, 0.9);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
    padding: 12px;
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 40;
}

.nav-dropdown__menu a {
    padding: 10px 12px;
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.9rem;
    letter-spacing: 0.02em;
}

.nav-dropdown__menu a:hover {
    background: rgba(255, 255, 255, 0.08);
}

.nav-dropdown:hover .nav-dropdown__menu,
.nav-dropdown:focus-within .nav-dropdown__menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.nav-dropdown.is-open .nav-dropdown__menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.header-actions {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 200px;
    justify-content: flex-end;
}

.header-greeting {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.header-action-form {
    margin: 0;
}

.header-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    cursor: pointer;
    color: #0a1127;
    background: #fff;
    box-shadow: 0 8px 24px rgba(6, 12, 28, 0.18);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.header-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(6, 12, 28, 0.24);
}

body.header-overlay-open {
    overflow: hidden;
}

@media (max-width: 960px) {
    .header-brand {
        margin-top: 2px;
    }

    .nav-dropdown__menu a.mobile-hidden,
    .mobile-ai-tool__menu a.mobile-hidden {
        display: none !important;
    }

    .brand-title {
        font-size: 1.4rem;
        letter-spacing: 0.08em;
        line-height: 1.05;
    }

    .header-shell {
        justify-content: space-between;
        gap: 12px;
        padding-top: 4px;
    }

    .header-mobile-toggle {
        display: inline-flex;
        margin-left: auto;
        position: fixed;
        top: 10px;
        right: 18px;
        z-index: 220;
        width: auto;
        height: auto;
        border-radius: 16px;
        padding: 6px 8px;
        border: 1px solid transparent;
        background: transparent;
        box-shadow: none;
        color: #ffffff;
    }

    .header-mobile-toggle.is-active {
        border-color: rgba(255, 255, 255, 0.85);
        background: linear-gradient(135deg, #ffa24a, #ff5c00);
        box-shadow: 0 20px 35px rgba(255, 92, 0, 0.45);
    }

    .header-nav-group {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        justify-content: center;
        align-items: stretch;
        padding: 0;
        background: transparent;
        z-index: 200;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
        margin-left: 0;
        overflow: hidden;
    }

    .header-nav-group::before {
        content: "";
        position: absolute;
        inset: 0;
        background: rgba(7, 10, 23, 0.82);
        transform: scale(0);
        transform-origin: top right;
        transition: transform 0.35s ease;
        box-shadow: 0 30px 70px rgba(2, 2, 8, 0.7);
    }

    .header-nav-group.is-open {
        opacity: 1;
        pointer-events: auto;
    }

    .header-nav-group.is-open::before {
        transform: scale(1);
    }

    .header-nav-panel {
        width: 100%;
        height: 100%;
        background: rgba(17, 21, 35, 0.96);
        border-radius: 0;
        border: none;
        box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
        padding: 118px 26px 48px;
        display: flex;
        flex-direction: column;
        gap: 18px;
        overflow-y: auto;
        color: #f7f9ff;
        position: relative;
        z-index: 2;
        opacity: 0;
        transform: translateY(-10px);
        transition: opacity 0.25s ease, transform 0.25s ease;
        backdrop-filter: blur(4px);
    }

    .header-nav-group.is-open .header-nav-panel {
        opacity: 1;
        transform: translateY(0);
    }


    .header-center {
        flex-direction: column;
        width: 100%;
        gap: 12px;
    }

    .header-center > * {
        width: 100%;
    }

    .nav-dropdown {
        display: none;
    }

    .mobile-ai-tool {
        display: block;
        width: 100%;
    }

    .mobile-ai-tool summary {
        list-style: none;
        cursor: pointer;
    }

    .mobile-ai-tool summary::-webkit-details-marker {
        display: none;
    }

    .mobile-ai-tool[open] summary span:last-child {
        transform: rotate(180deg);
    }

    .mobile-ai-tool__toggle {
        font-size: 1rem;
        letter-spacing: 0.08em;
        color: #f7f9ff;
        text-transform: uppercase;
        font-weight: 700;
        padding: 12px 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .mobile-ai-tool__menu {
        margin-top: 12px;
        padding: 14px 0;
        border-radius: 14px;
        background: #ffffff;
        box-shadow: 0 22px 50px rgba(0, 0, 0, 0.35);
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .mobile-ai-tool__menu a {
        color: #101828;
        font-weight: 600;
        text-transform: none;
        padding: 6px 20px;
    }

    .header-nav-panel .nav-pill {
        width: 100%;
        border-radius: 0;
        border: none;
        background: transparent;
        color: #fefefe;
        padding: 12px 0;
        box-shadow: none;
        position: relative;
    }

    .nav-pill:focus,
    .nav-pill:focus-visible,
    .nav-link:focus,
    .nav-link:focus-visible {
        outline: none;
        box-shadow: none;
    }

    .nav-dropdown__toggle {
        position: relative;
        padding-right: 36px;
    }

    .nav-dropdown__toggle .nav-caret {
        display: none;
    }

    .header-nav-panel .nav-link {
        justify-content: space-between;
        width: 100%;
        font-size: 1rem;
        letter-spacing: 0.08em;
        color: #f7f9ff;
        text-transform: uppercase;
        font-weight: 700;
        padding: 6px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .header-nav-panel .mobile-plain-link {
        background: transparent !important;
        border: none !important;
        border-bottom: none !important;
        padding: 10px 0;
        box-shadow: none !important;
    }

    .nav-dropdown__toggle::after {
        content: "⌄";
        font-size: 1rem;
        position: absolute;
        right: 6px;
        top: 50%;
        transform: translateY(-50%);
        opacity: 0.85;
        transition: transform 0.2s ease;
    }

    .nav-dropdown.is-open .nav-dropdown__toggle::after {
        transform: translateY(-50%) rotate(180deg);
    }

    .header-nav-panel .nav-dropdown {
        width: 100%;
    }

    .header-nav-panel .nav-dropdown__menu {
        position: static;
        transform: none;
        width: 100%;
        border-radius: 12px;
        border: 1px solid rgba(12, 14, 26, 0.08);
        background: #ffffff;
        padding: 12px 18px;
        margin-top: 10px;
        display: none;
        box-shadow: 0 22px 45px rgba(9, 12, 23, 0.45);
        color: #111827;
        list-style: none;
        z-index: 10;
    }

    .header-nav-panel .nav-dropdown.is-open .nav-dropdown__menu {
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding-left: 0;
    }

    .header-nav-panel .nav-dropdown__menu a {
        display: block;
        padding: 2px 0;
        border-radius: 4px;
        color: inherit;
        font-weight: 600;
        text-transform: none;
        letter-spacing: 0.02em;
        font-size: 1rem;
    }

    .header-nav-panel .nav-dropdown__menu a:hover {
        color: #ff7a1b;
    }

    .header-actions-desktop {
        display: none;
    }

    .header-actions.header-actions-mobile {
        display: flex;
        flex-direction: column;
        gap: 12px;
        color: #f7f9ff;
    }

    .header-actions-mobile .header-button {
        width: 100%;
        border-radius: 16px;
        box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
        color: #111827;
        border: none;
        background: linear-gradient(135deg, #ffd699, #ff9330);
    }

    .header-actions {
        width: 100%;
        justify-content: center;
        flex-direction: column;
        gap: 12px;
        color: #ffe7cf;
    }
}

@keyframes header-panel-fade {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 640px) {
    .header-nav-panel {
        padding: 70px 12px 24px;
        gap: 14px;
    }

    .nav-link {
        font-size: 0.9rem;
    }

    .header-actions-mobile .header-button {
        font-size: 0.78rem;
    }
}

/* Legacy layout helpers retained for existing pages */
.container {
    width: 80%;
    margin: auto;
    overflow: hidden;
    padding: 20px;
}

h1, h2 {
    color: #fff;
}

form {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

select,
input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.section {
    flex: 1 1 45%;
    background: rgba(3, 6, 24, 0.7);
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

table {
    width: 100%;
    border-collapse: collapse;
    color: #fff;
}

th, td {
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 8px;
    text-align: left;
}

th {
    background-color: rgba(255, 255, 255, 0.08);
}

hr {
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    margin: 10px 0;
}

@media (max-width: 960px) {
    .nav-dropdown__menu a {
        color: #000000;
    }
}
