/* ===== 기본 리셋 & 변수 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --sidebar-width: 240px;
    --sidebar-bg: #1a1f2e;
    --sidebar-hover: #2d3548;
    --sidebar-active: #3b5bdb;
    --accent: #3b5bdb;
    --accent-light: #4c6ef5;
    --text-primary: #f1f3f9;
    --text-muted: #8892a4;
    --bg-main: #f4f6fb;
    --bg-card: #ffffff;
    --border: #e2e8f0;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --radius: 10px;
    --font: 'Noto Sans KR', -apple-system, sans-serif;
}

body {
    font-family: var(--font);
    background: var(--bg-main);
    color: #2d3748;
    min-height: 100vh;
}

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

/* ===== 레이아웃 ===== */
.layout {
    display: flex;
    min-height: 100vh;
}

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ===== 사이드바 ===== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-logo {
    padding: 24px 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.logo-icon { font-size: 22px; }
.logo-text {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* ===== 네비게이션 ===== */
.sidebar-nav {
    flex: 1;
    padding: 12px 0;
}

.nav-group { border-bottom: 1px solid rgba(255,255,255,0.05); }

.nav-group-title {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 20px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
    user-select: none;
}

.nav-group-title:hover { background: var(--sidebar-hover); }

.nav-group-title .nav-icon { font-size: 16px; width: 20px; text-align: center; }

.nav-group-title .arrow {
    margin-left: auto;
    font-size: 10px;
    transition: transform 0.2s;
    color: var(--text-muted);
}

.nav-group.open .arrow { transform: rotate(90deg); }

.nav-sub {
    list-style: none;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease;
}

.nav-group.open .nav-sub { max-height: 500px; }

.nav-sub li a {
    display: block;
    padding: 9px 20px 9px 50px;
    color: var(--text-muted);
    font-size: 13px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-sub li a:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.04);
}

.nav-sub li a.active {
    color: var(--accent-light);
    background: rgba(59,91,219,0.12);
    border-left-color: var(--accent-light);
}

/* ===== 사이드바 하단 ===== */
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 13px;
}

.user-avatar { font-size: 18px; }

.logout-btn {
    font-size: 12px;
    color: var(--text-muted);
    padding: 5px 10px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    transition: all 0.2s;
}

.logout-btn:hover {
    color: #ff6b6b;
    border-color: #ff6b6b;
}

/* ===== 상단 헤더 ===== */
.top-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a202c;
}

.breadcrumb {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ===== 콘텐츠 영역 ===== */
.content-area {
    padding: 32px;
    flex: 1;
}

/* ===== 카드 ===== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    border: 1px solid var(--border);
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #1a202c;
}

/* ===== 대시보드 그리드 ===== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.menu-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px 20px;
    border: 1px solid var(--border);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.menu-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(59,91,219,0.15);
    border-color: var(--accent);
}

.menu-card .menu-icon { font-size: 36px; margin-bottom: 12px; }
.menu-card .menu-name { font-size: 14px; font-weight: 600; color: #1a202c; }
.menu-card .menu-desc { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

/* ===== 공사중 배지 ===== */
.badge-wip {
    display: inline-block;
    font-size: 11px;
    background: #fff3cd;
    color: #856404;
    padding: 3px 8px;
    border-radius: 20px;
    margin-top: 8px;
    font-weight: 500;
}

.badge-done {
    display: inline-block;
    font-size: 11px;
    background: #d1fae5;
    color: #065f46;
    padding: 3px 8px;
    border-radius: 20px;
    margin-top: 8px;
    font-weight: 500;
}

/* ===== 폼 공통 ===== */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; color: #374151; }
.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: var(--font);
    transition: border-color 0.2s;
    outline: none;
}
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,91,219,0.1); }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-family: var(--font);
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-light); }
.btn-secondary { background: #f1f5f9; color: #374151; border: 1px solid var(--border); }
.btn-secondary:hover { background: #e2e8f0; }

/* ===== 로그인 페이지 ===== */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1f2e 0%, #2d3548 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 48px 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo .logo-big { font-size: 40px; }
.login-logo h1 { font-size: 24px; font-weight: 700; margin-top: 8px; color: #1a202c; }
.login-logo p { font-size: 14px; color: var(--text-muted); margin-top: 4px; }

.login-box .form-group { margin-bottom: 16px; }
.login-box .btn { width: 100%; justify-content: center; padding: 13px; font-size: 16px; margin-top: 8px; }

.login-error {
    background: #fee2e2;
    color: #991b1b;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
}

/* ===== 반응형 ===== */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); transition: transform 0.3s; }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .content-area { padding: 20px; }
    .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
}
