:root {
    --bg: #f3f6fb;
    --surface: #ffffff;
    --surface-soft: #f7f9fc;
    --line: #e4eaf2;
    --line-strong: #d7deea;
    --text: #223044;
    --muted: #6a778b;
    --brand: #1f5da8;
    --brand-strong: #174883;
    --brand-soft: #eaf2fe;
    --danger: #d93b3b;
    --success: #1f9f67;
    --warning: #eb9c2d;
    --shadow-soft: 0 8px 24px rgba(20, 44, 86, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-height: 100%;
}

body {
    font-family: "Pretendard Variable", "Noto Sans KR", "Segoe UI", "Malgun Gothic", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 0% -10%, #dae8ff 0%, transparent 36%),
        radial-gradient(circle at 100% 0%, #edf3ff 0%, transparent 30%),
        var(--bg);
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
    border-right: none;
    background: linear-gradient(180deg, #f8fbff 0%, #f3f7fe 100%);
    padding: 0.9rem 0.7rem 0.9rem 0.55rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sidebar-brand-wrap {
    padding: 0.35rem 0.08rem 0.8rem;
    border-bottom: 1px solid var(--line);
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: inherit;
}

.brand-link:focus-visible {
    outline: 2px solid #7ea7dd;
    outline-offset: 3px;
    border-radius: 10px;
}

.brand-mark img {
    height: 24px;
    width: auto;
    max-width: 152px;
    display: block;
    object-fit: contain;
}

.brand-text-group {
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 0.34rem;
    white-space: nowrap;
}

.sidebar h1 {
    margin-top: 0;
    font-size: 1.12rem;
    font-weight: 800;
    line-height: 1;
}

.brand-partner {
    color: #1f5da8;
}

.brand-data {
    color: #2f3540;
}

.brand-dot {
    margin-left: 1px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
}

.sidebar-nav a {
    display: block;
    text-decoration: none;
    color: #35506f;
    padding: 0.62rem 0.75rem;
    border-radius: 10px;
    border: 1px solid transparent;
    font-size: 0.92rem;
    font-weight: 600;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.sidebar-nav a:hover {
    background: #eef4fd;
    border-color: #d5e3f6;
    color: var(--brand);
}

.sidebar-nav a.active {
    background: #e5efff;
    border-color: #bdd3f2;
    color: #174883;
}

.sidebar-footer {
    margin-top: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.65rem 0.7rem;
    background: #ffffff;
}

.sidebar-footer p {
    font-size: 0.68rem;
    color: var(--muted);
    letter-spacing: 0.07em;
}

.sidebar-footer strong {
    display: inline-block;
    margin-top: 0.2rem;
    font-size: 0.81rem;
    color: #345a8d;
}

.workspace {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: 58px;
    background: #ffffff;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0 1rem 0 1.25rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.header-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.34rem 0.58rem;
    border-radius: 999px;
    border: 1px solid #d5e2f3;
    color: #4f6788;
    background: #f7fbff;
    font-size: 0.78rem;
    font-weight: 700;
}

.container {
    width: 100%;
    margin: 0;
    padding: 0.45rem 1rem 1rem;
}

.content {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-soft);
    padding: 0.65rem 1rem 1rem;
}

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.7rem;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--line);
    margin: -0.2rem -0.2rem 0.7rem;
    padding: 0.2rem 0.2rem 0.65rem;
}

.page-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: #1d3557;
    margin-bottom: 0.18rem;
}

.page-subtitle {
    color: var(--muted);
    font-size: 0.92rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.8rem;
}

.metric-card {
    background: linear-gradient(180deg, #f4f9ff 0%, #ffffff 100%);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.85rem 0.9rem;
}

.metric-card .value {
    font-size: 1.3rem;
    font-weight: 800;
    color: #1f4b7e;
    margin-bottom: 0.15rem;
}

.metric-card .label {
    color: var(--muted);
    font-size: 0.88rem;
}

.panel {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-soft);
    padding: 0.9rem;
}

.btn {
    display: inline-block;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 8px;
    background: var(--brand);
    color: #ffffff;
    padding: 0.52rem 0.82rem;
    margin: 0.25rem 0.25rem 0.25rem 0;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
    background: var(--brand-strong);
}

.btn-success {
    background: var(--success);
}

.btn-success:hover {
    background: #198c5a;
}

.btn-secondary {
    background: #ffffff;
    color: #34506e;
    border-color: #d6e0ed;
}

.btn-secondary:hover {
    background: #eef3fa;
}

.btn-danger {
    background: var(--danger);
}

.btn-danger:hover {
    background: #c12d2d;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="file"],
select,
textarea {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: #ffffff;
    color: var(--text);
    font: inherit;
    font-size: 0.9rem;
    padding: 0.56rem 0.66rem;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #8fb3dd;
    box-shadow: 0 0 0 3px rgba(31, 93, 168, 0.14);
}

label {
    display: inline-block;
    margin-bottom: 0.3rem;
    font-size: 0.84rem;
    font-weight: 700;
    color: #314966;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.8rem;
    background: #ffffff;
    border: 1px solid #dfe7f3;
    border-radius: 10px;
    overflow: hidden;
}

table th {
    background: #f2f6fc;
    color: #365170;
    font-size: 0.83rem;
    font-weight: 800;
    text-transform: none;
    padding: 0.72rem 0.72rem;
    border-bottom: 1px solid #dfe7f3;
}

table td {
    padding: 0.7rem 0.72rem;
    border-bottom: 1px solid #ebf0f7;
    font-size: 0.9rem;
    vertical-align: top;
}

table tr:hover {
    background: #f8fbff;
}

.chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: var(--brand-soft);
    color: #24528c;
    border: 1px solid #d4e4fb;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.28rem 0.56rem;
}

.muted {
    color: var(--muted);
}

@media (max-width: 1100px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        border-right: none;
        border-bottom: 1px solid var(--line);
        padding-bottom: 0.8rem;
    }

    .sidebar-nav {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.35rem;
    }

    .sidebar-footer {
        display: none;
    }
}

@media (max-width: 800px) {
    .topbar {
        height: auto;
        padding: 0.7rem 0.85rem;
        align-items: flex-start;
        flex-direction: column;
        gap: 0.45rem;
    }

    .container {
        padding: 0.75rem;
    }

    .content {
        padding: 0.75rem;
    }

    .sidebar-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .sidebar-nav {
        grid-template-columns: 1fr;
    }
}
