:root {
    --bg: #f6f8fc;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --text: #0f172a;
    --muted: #64748b;
    --line: rgba(15, 23, 42, 0.10);
    --line-strong: rgba(15, 23, 42, 0.16);

    --brand: #2563eb;
    --brand-2: #3b82f6;
    --brand-soft: rgba(37, 99, 235, 0.10);

    --success: #16a34a;
    --danger: #dc2626;
    --warning: #d97706;
    --dark: #0f172a;

    --shadow-sm: 0 6px 18px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 14px 36px rgba(15, 23, 42, 0.08);
    --radius: 18px;
    --radius-sm: 12px;

    --sidebar-width: 250px;
    --header-height: 68px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: 'Pretendard', 'Noto Sans KR', sans-serif;
    background: linear-gradient(180deg, #f8fbff 0%, #f4f7fb 100%);
    color: var(--text);
    overflow-x: hidden;
}

a {
    text-decoration: none;
}

.admin-header {
    height: var(--header-height);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1100;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 18px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-wrap {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.brand-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.1;
}

.brand-sub {
    font-size: 11px;
    color: var(--muted);
    line-height: 1.1;
}

.hamburger-btn {
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 23px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all .18s ease;
}

.hamburger-btn:hover {
    border-color: var(--line-strong);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.header-logout-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 84px;
    height: 40px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    transition: all .18s ease;
}

.header-logout-btn:hover {
    border-color: var(--line-strong);
    color: var(--text);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.admin-layout {
    display: block;
}

.sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    z-index: 1050;

    padding: 16px 14px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    border-right: 1px solid var(--line);
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform .24s ease;
}

.sidebar-inner {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-section-label {
    padding: 0 10px;
    font-size: 11px;
    font-weight: 800;
    color: #94a3b8;
    letter-spacing: .08em;
}

.sidebar-nav-list {
    margin: 0;
    padding: 0;
}

.sidebar-link,
.sidebar-sub-link {
    min-height: 46px;
    padding: 11px 12px;
    border-radius: 14px;
    color: #334155;
    transition: all .18s ease;
}

.sidebar-link:hover,
.sidebar-sub-link:hover {
    background: #f1f5f9;
    color: var(--text);
}

.sidebar-link.active,
.sidebar-sub-link.active,
.sidebar-link:focus,
.sidebar-sub-link:focus {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
    color: #fff;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.22);
}

.sidebar .nav-link .menu-icon {
    display: inline-flex;
    width: 20px;
    justify-content: center;
    align-items: center;
    font-size: 15px;
}

.sidebar .menu-text {
    white-space: nowrap;
    font-size: 14px;
    font-weight: 600;
}

#landingPageMenu.notransition {
    transition: none !important;
}

.toggle-icon {
    transition: transform .2s ease;
}

.toggle-icon.rotate {
    transform: rotate(180deg);
}

.main-content {
    margin-top: var(--header-height);
    margin-left: var(--sidebar-width);
    min-height: calc(100vh - var(--header-height));
    padding: 24px;
    transition: margin-left .24s ease, padding .24s ease;
}

body.sidebar-collapsed .sidebar {
    transform: translateX(calc(var(--sidebar-width) * -1));
}

body.sidebar-collapsed .main-content {
    margin-left: 0;
    padding-left: 18px;
    padding-right: 18px;
}

.sidebar-backdrop {
    display: none;
}

.card,
.panel-card,
.ui-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.table {
    --bs-table-bg: transparent;
    margin-bottom: 0;
}

.table > :not(caption) > * > * {
    padding: 10px 10px;
    border-bottom-color: rgba(15, 23, 42, 0.08);
    vertical-align: middle;
}

.table thead th {
    background: #f8fafc;
    color: #111827;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.table tbody tr:hover {
    background: #fbfdff;
}

.form-control,
.form-select {
    min-height: 40px;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    font-size: 14px;
    color: var(--text);
    background-color: #fff;
    box-shadow: none;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(37, 99, 235, 0.45);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.10);
}

.form-control-sm,
.form-select-sm {
    min-height: 36px;
    border-radius: 10px;
    font-size: 13px;
}

.btn {
    border-radius: 12px;
    font-weight: 700;
    min-height: 40px;
    padding: 0 14px;
    border-width: 1px;
    transition: all .18s ease;
}

.btn-sm {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 10px;
    font-size: 13px;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
    border-color: transparent;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.20);
}

.btn-success {
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
    border-color: transparent;
}

.btn-dark {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-color: transparent;
}

.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-danger,
.btn-outline-light {
    background: #fff;
}

.badge {
    font-weight: 700;
    letter-spacing: 0;
}

.pagination .page-link {
    border: 1px solid var(--line);
    color: var(--text);
    border-radius: 10px !important;
    margin: 0 3px;
    min-width: 36px;
    text-align: center;
    background: #fff;
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.18);
}

.closed-row {
    background-color: #f8fafc !important;
    color: #94a3b8 !important;
}

.closed-row td {
    text-decoration: line-through;
}

.memo-save-btn,
.memo-view-btn {
    min-width: 52px;
    height: auto !important;
    line-height: normal !important;
    padding: 3px 8px;
    white-space: nowrap;
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(calc(var(--sidebar-width) * -1));
        box-shadow: 18px 0 40px rgba(15, 23, 42, 0.12);
    }

    .main-content {
        margin-left: 0;
        padding: 14px;
    }

    body.sidebar-mobile-open .sidebar {
        transform: translateX(0);
    }

    body.sidebar-mobile-open .sidebar-backdrop {
        display: block;
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(15, 23, 42, 0.24);
        z-index: 1040;
        backdrop-filter: blur(2px);
    }
}