@charset "utf-8";

/* ==========================================================================
   프리미엄 인트라넷 전용 스타일시트 (반응형 지원)
   ========================================================================== */

:root {
    --bg-color: #f0f2f5;
    --sidebar-bg: #ffffff;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    --border-color: #cbd5e1;
    --accent-primary: #1d4ed8;
    --accent-hover: #1e40af;
    --accent-light: #eff6ff;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --radius-md: 12px;
    --radius-lg: 20px;
    
    /* Professional Soft Canvas shadows */
    --shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.03);
    --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.05);
    --shadow-lg: 0 20px 40px rgba(15, 23, 42, 0.08);
    --shadow-glow: none;
}

body {
    margin: 0;
    font-family: 'Pretendard', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    display: flex;
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 글로벌 커스텀 스크롤바 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(15, 23, 42, 0.15); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(15, 23, 42, 0.25); }

/* =========================================
   1. 어드민 레이아웃 (Admin Layout)
   ========================================= */
.admin-wrapper {
    flex: 1;
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    position: relative;
    background: #f4f6f9;
}

/* =========================================
   2. 좌측 다크 사이드바 (Admin Sidebar)
   ========================================= */
.admin-icon-sidebar {
    width: 70px;
    margin: 16px 0 16px 16px;
    background: transparent;
    border: none;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 55;
    flex-shrink: 0;
}

.icon-logo {
    height: 60px;
    display: flex; align-items: center; justify-content: center;
    color: var(--accent-primary); font-size: 1.8rem;
    border-bottom: none; width: 100%; flex-shrink: 0;
}

.icon-menu-list {
    display: flex; flex-direction: column; width: 100%; margin-top: 10px;
}

.icon-menu-item {
    display: flex; align-items: center; justify-content: center; height: 60px;
    color: var(--text-tertiary); font-size: 1.5rem; text-decoration: none; transition: all 0.2s;
    width: 100%; box-sizing: border-box;
}

.icon-menu-item:hover, .icon-menu-item.active {
    color: var(--accent-primary); background: transparent;
}

/* 사이드바 아이콘 호버 서브메뉴 패널 */
.icon-menu-wrapper {
    position: relative;
    width: 100%;
}

/* 마우스 이동 시 틈새에서 호버가 풀리는 것을 방지하는 투명 브릿지 */
.icon-menu-wrapper:hover::after {
    content: '';
    position: absolute;
    left: 100%;
    top: 0;
    width: 20px;
    height: 100%;
    z-index: 1001;
}

.icon-submenu-panel {
    display: none;
    position: absolute;
    left: 100%;
    top: 0;
    margin-left: 12px;
    width: 210px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    padding: 10px 0;
    z-index: 1000;
}

@keyframes fadeInSlide {
    0% { opacity: 0; transform: translateX(-10px); }
    100% { opacity: 1; transform: translateX(0); }
}

.icon-menu-wrapper:hover .icon-submenu-panel {
    display: block;
    animation: fadeInSlide 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.submenu-group-title {
    padding: 8px 18px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-tertiary);
    border-bottom: 1px dashed rgba(0, 0, 0, 0.05);
    margin-bottom: 6px;
}

.submenu-item {
    display: block;
    padding: 10px 18px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.submenu-item:hover {
    background: rgba(13, 110, 253, 0.05);
    color: var(--accent-primary);
    font-weight: 600;
    transform: translateX(4px);
}

.admin-sidebar {
    width: 260px;
    margin: 16px 0 16px 16px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    z-index: 50;
    transition: transform 0.3s ease;
    flex-shrink: 0;
    overflow-y: auto;
}

/* 스크롤바 커스텀 (밝은테마) */
.admin-sidebar::-webkit-scrollbar { width: 6px; }
.admin-sidebar::-webkit-scrollbar-track { background: transparent; }
.admin-sidebar::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

.logo-area {
    height: 60px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
}

.logo-area i {
    color: var(--accent-primary);
    font-size: 1.4rem;
    margin-right: 8px;
}

.sidebar-close-btn {
    display: none;
    margin-left: auto;
    font-size: 1.25rem;
    color: var(--text-tertiary);
    cursor: pointer;
    background: none; border: none;
}

.sidebar-profile {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
}

.profile-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #f1f5f9;
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 800;
}

.profile-info { display: flex; flex-direction: column; align-items: flex-start; }
.profile-name { color: var(--text-primary); font-size: 0.95rem; font-weight: 700; margin-bottom: 6px; }
.profile-edit-btn { 
    background: #f1f5f9; color: var(--text-secondary); font-size: 0.75rem; 
    padding: 3px 10px; border-radius: 12px; text-decoration: none; transition: background 0.2s;
}
.profile-edit-btn:hover { background: #e2e8f0; color: var(--text-primary); }

.sidebar-sysinfo {
    padding: 16px;
    margin: 20px;
    font-size: 0.8rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.sysinfo-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.sysinfo-item > span:first-child { color: var(--text-tertiary); }
.sysinfo-item > span:last-child { font-weight: 600; color: var(--text-secondary); }

.sysinfo-divider {
    border: 0;
    border-top: 1px dashed #cbd5e1;
    margin: 12px 0;
}

.btn-micro {
    background: #f8fafc; border: 1px solid #e2e8f0; color: var(--text-secondary);
    font-size: 0.7rem; padding: 2px 8px; border-radius: 12px; cursor: pointer; transition: background 0.2s;
}
.btn-micro:hover { background: #e2e8f0; color: var(--text-primary); }

.btn-db-tool {
    background: #f1f5f9; color: var(--accent-primary); border: none;
    padding: 8px 0; border-radius: 12px; font-size: 0.85rem; font-weight: 600;
    width: 100%; cursor: pointer; transition: background 0.2s;
}
.btn-db-tool:hover { background: var(--accent-light); }

.sidebar-memo {
    padding: 20px;
    flex: 1;
}

.memo-title {
    color: var(--text-primary); font-size: 0.85rem; font-weight: 700; margin-bottom: 12px;
}

.memo-input {
    width: 100%; background: #f8fafc; border: 1px solid #e2e8f0;
    color: var(--text-primary); padding: 8px 10px; border-radius: 4px; font-size: 0.8rem;
    outline: none; margin-bottom: 16px; box-sizing: border-box; transition: border-color 0.2s;
}
.memo-input:focus { border-color: var(--accent-primary); }
.memo-input::placeholder { color: var(--text-tertiary); }

.memo-list { display: flex; flex-direction: column; gap: 12px; }
.memo-item { position: relative; padding-right: 20px; }
.memo-date { font-size: 0.7rem; color: var(--text-tertiary); margin-bottom: 2px; }
.memo-text { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.4; word-break: break-all; cursor: pointer; transition: color 0.2s; }
.memo-text:hover { color: var(--text-primary); }
.memo-edit-input { width: 100%; background: #ffffff; border: 1px solid var(--accent-primary); color: var(--text-primary); border-radius: 4px; padding: 4px 6px; font-size: 0.8rem; outline: none; font-family: inherit; box-sizing: border-box; margin-top: 2px; }
.memo-del {
    position: absolute; right: 0; top: 0; background: none; border: none;
    color: var(--text-tertiary); cursor: pointer; padding: 0; transition: color 0.2s;
}
.memo-del:hover { color: var(--danger); }


/* =========================================
   3. 메인 콘텐츠 및 상단 헤더 (Admin Main & Header)
   ========================================= */
.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f4f6f9;
}

.admin-header {
    height: 60px;
    margin: 16px 24px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 5;
    flex-shrink: 0;
}

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

.hamburger-btn {
    display: none;
    font-size: 1.4rem;
    color: #495057;
    cursor: pointer;
    background: none; border: none; padding: 0; margin-right: 16px;
}

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

.gnb-item {
    color: #495057;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 100px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
}

.gnb-item:hover {
    background: rgba(0, 0, 0, 0.04);
    color: #212529;
}

.gnb-item.active {
    background: var(--accent-primary);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

.header-search {
    display: flex; align-items: center;
    background: #f1f5f9; border: 1px solid transparent;
    padding: 8px 14px; border-radius: 100px; width: 280px; transition: all 0.2s;
}
.header-search:focus-within { border-color: var(--accent-primary); background: #ffffff; box-shadow: 0 0 0 3px rgba(13,110,253,0.1); }
.header-search i { color: #adb5bd; margin-right: 8px; font-size: 1rem; }
.header-search input { border: none; background: transparent; outline: none; width: 100%; font-size: 0.85rem; color: #212529; }
.header-search input:focus { outline: none !important; box-shadow: none !important; border: none !important; }

.icon-btn {
    position: relative; cursor: pointer; color: #495057;
    background: none; border: none; padding: 0; transition: color 0.2s; display: flex; align-items: center;
}
.icon-btn:hover { color: var(--accent-primary); }
.icon-btn i { font-size: 1.3rem; }

.badge {
    position: absolute; top: -5px; right: -6px; background: #ef4444; color: white;
    font-size: 0.65rem; font-weight: 700; padding: 2px 5px; border-radius: 10px; border: 2px solid white;
}

.header-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 16px;
    border-left: 1px solid #e2e8f0;
    margin-left: 4px;
}
.header-profile .profile-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f1f5f9;
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 800;
}
.header-profile .profile-info { display: flex; flex-direction: column; align-items: flex-start; }
.header-profile .profile-name { font-size: 0.85rem; font-weight: 700; margin-bottom: 2px; color: var(--text-primary); }
.header-profile .profile-edit-btn { 
    padding: 2px 8px; font-size: 0.7rem; border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px; text-decoration: none; transition: background 0.2s; color: #ef4444; background: #f1f5f9;
}
.header-profile .profile-edit-btn:hover { background: #fee2e2; }

@media (max-width: 768px) {
    .header-profile .profile-info { display: none; }
    .header-profile { padding-left: 10px; gap: 0; }
}

/* =========================================
   4. 본문 내용 (Admin Content)
   ========================================= */
.admin-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.page-title {
    margin: 0 0 24px 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

/* KPI 카드 그리드 */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

.kpi-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 2px solid #ffffff;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px dashed #e9ecef;
}

.kpi-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #495057;
    display: flex; align-items: center;
}

.kpi-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: var(--accent-light) !important;
    color: var(--accent-primary) !important;
}

.kpi-value {
    font-size: 2.2rem;
    font-weight: 800;
    color: #212529;
    margin-bottom: 8px;
    letter-spacing: -1px;
}

.kpi-trend {
    font-size: 0.8rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.trend-up { color: var(--success); }
.trend-down { color: var(--danger); }

/* 프로그레스 바 */
.progress-bar {
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 8px;
}
.progress-fill {
    height: 100%;
    border-radius: 3px;
}

/* =========================================
   5. 대시보드 레이아웃 그리드
   ========================================= */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.dashboard-grid .panel:first-child {
    grid-column: span 2;
}

.panel {
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 2px solid #ffffff;
    padding: 24px;
    margin-bottom: 24px;
    transition: box-shadow 0.2s ease;
}

.panel:hover {
    box-shadow: var(--shadow-md);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f1f5f9;
}

.panel-title {
    font-size: 1rem;
    font-weight: 700;
    color: #495057;
    margin: 0;
}

.panel-action {
    color: #868e96;
    font-size: 0.8rem;
    text-decoration: none;
    padding: 4px 10px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    transition: all 0.2s;
}

.panel-action:hover {
    background: #e9ecef; color: #212529;
}

.btn-more {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    background: var(--accent-light);
    color: var(--accent-primary);
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: 100px;
    border: none;
    transition: all 0.2s ease;
}

.btn-more:hover {
    background: #dbeafe;
    color: var(--accent-hover);
}

/* =========================================
   6. 데이터 테이블 & 상태 뱃지
   ========================================= */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.modern-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 600px;
}

.modern-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    background: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
    white-space: nowrap;
}

.modern-table th:first-child { border-top-left-radius: 12px; border-bottom-left-radius: 12px; }
.modern-table th:last-child { border-top-right-radius: 12px; border-bottom-right-radius: 12px; }

.modern-table td {
    padding: 14px 16px;
    font-size: 0.9rem;
    color: var(--text-primary);
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    white-space: nowrap;
    word-break: keep-all;
    transition: background 0.15s ease;
}

.modern-table td.text-wrap {
    white-space: normal;
    word-break: break-all;
    min-width: 250px;
}

.modern-table tr:last-child td { border-bottom: none; }
.modern-table tr:hover td { background-color: #f8fafc; }

.driver-cell { display: flex; align-items: center; gap: 12px; }
.driver-avatar {
    width: 32px; height: 32px; border-radius: 50%; background: #e5e7eb;
    display: flex; align-items: center; justify-content: center; font-size: 1rem; color: #6b7280;
}
.driver-info { display: flex; flex-direction: column; }
.driver-name { font-weight: 600; }
.vehicle-num { font-size: 0.75rem; color: var(--text-tertiary); margin-top: 2px;}

.status-pill {
    display: inline-flex; align-items: center; padding: 4px 10px;
    border-radius: 20px; font-size: 0.75rem; font-weight: 600; white-space: nowrap;
}
.status-transit { background: #dbeafe; color: #1e40af; }
.status-transit::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #3b82f6; margin-right: 6px; }
.status-waiting { background: #fef3c7; color: #b45309; }
.status-waiting::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #f59e0b; margin-right: 6px; }
.status-done { background: #d1fae5; color: #065f46; }
.status-done::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #10b981; margin-right: 6px; }

/* =========================================
   7. 활동 피드 (Activity Feed)
   ========================================= */
.activity-list { list-style: none; padding: 0; margin: 0; }
.activity-item { display: flex; gap: 16px; padding-bottom: 20px; position: relative; }
.activity-item:not(:last-child)::after {
    content: ''; position: absolute; left: 15px; top: 32px; bottom: 0; width: 2px; background: #e5e7eb;
}
.activity-icon {
    width: 32px; height: 32px; border-radius: 50%; background: #f3f4f6;
    display: flex; align-items: center; justify-content: center; color: var(--text-secondary); font-size: 1rem; z-index: 1; flex-shrink: 0;
}
.activity-content { flex: 1; padding-top: 6px; }
.activity-text { font-size: 0.9rem; color: var(--text-primary); line-height: 1.4; }
.activity-text strong { font-weight: 600; }
.activity-time { font-size: 0.75rem; color: var(--text-tertiary); margin-top: 4px; }

/* =========================================
   8. 사이드바 모바일 오버레이
   ========================================= */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 40;
    backdrop-filter: blur(2px);
}

/* =========================================
   9. 반응형 미디어 쿼리 (Media Queries)
   ========================================= */

/* 태블릿 (1024px 이하) */
@media (max-width: 1024px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .header-search { width: 220px; }
}

/* 모바일 (768px 이하) */
@media (max-width: 768px) {
    /* 사이드바 오프캔버스화 (왼쪽으로 완전히 숨김) */
    .admin-icon-sidebar {
        position: fixed;
        left: -70px; top: 0; bottom: 0;
        transition: left 0.3s ease;
        z-index: 1000;
    }
    
    .admin-sidebar {
        position: fixed;
        left: -330px; top: 0; bottom: 0;
        width: 260px;
        transition: left 0.3s ease;
        z-index: 999;
    }
    
    /* 활성화 시 사이드바 표시 */
    .admin-icon-sidebar.active { left: 0; }
    .admin-sidebar.active { left: 70px; box-shadow: 5px 0 15px rgba(0,0,0,0.5); }
    
    .sidebar-overlay { z-index: 900; }
    .sidebar-overlay.active { display: block; }
    .sidebar-close-btn { display: block; }
    
    /* 헤더 및 본문 조정 */
    .hamburger-btn { display: block; margin-right: 12px; }
    .admin-header { padding: 0 16px; justify-content: flex-start; }
    .header-left { flex: 1; min-width: 0; } /* 내부 메뉴 가로 스크롤 허용 */
    .header-search { display: none; }
    
    /* 모바일에서는 세부 메뉴를 가로 스크롤 형태로 제공 */
    .horizontal-nav { 
        display: flex; 
        overflow-x: auto; 
        gap: 16px; 
        padding-bottom: 0;
        -webkit-overflow-scrolling: touch;
    }
    .horizontal-nav::-webkit-scrollbar { display: none; }
    
    .admin-content { padding: 16px; }
    .kpi-grid { grid-template-columns: 1fr; gap: 16px; }
    .dashboard-grid { gap: 16px; }
    .panel { padding: 16px; }
    
    /* 위젯 패널 모바일 너비 조정 */
    .widget-panel { width: 300px; right: -300px; }
}

/* =========================================
   10. To-do List (할일 목록)
   ========================================= */
.todo-input-group { display: flex; gap: 12px; margin-bottom: 24px; }
.todo-input-group input { flex: 1; padding: 14px 16px; border: 1px solid var(--border-color); border-radius: var(--radius-md); font-size: 0.95rem; font-family: inherit; outline: none; transition: border-color 0.2s; }
.todo-input-group input:focus { border-color: var(--accent-primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.todo-input-group .btn-add { background: var(--accent-primary); color: white; border: none; padding: 0 24px; border-radius: var(--radius-md); font-weight: 600; font-size: 0.95rem; cursor: pointer; transition: background 0.2s; white-space: nowrap; }
.todo-input-group .btn-add:hover { background: var(--accent-hover); }

.todo-list { list-style: none; padding: 0; margin: 0; }
.todo-item { display: flex; align-items: center; justify-content: space-between; padding: 16px; border: 1px solid var(--border-color); border-radius: var(--radius-md); margin-bottom: 12px; transition: all 0.2s; background: var(--card-bg); }
.todo-item:hover { border-color: var(--accent-primary); box-shadow: var(--shadow-sm); }
.todo-item.done { opacity: 0.6; background: #f9fafb; border-color: #e5e7eb; }
.todo-item.done .todo-text { text-decoration: line-through; color: var(--text-tertiary); }
.todo-item.done .todo-check { color: var(--success); }

.todo-content { display: flex; align-items: center; gap: 12px; flex: 1; cursor: pointer; overflow: hidden; }
.todo-check { font-size: 1.5rem; color: var(--text-tertiary); flex-shrink: 0; transition: color 0.2s; }
.todo-item:not(.done):hover .todo-check { color: var(--accent-primary); }
.todo-text { font-size: 0.95rem; color: var(--text-primary); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color 0.2s; }
.todo-del { background: none; border: none; color: var(--text-tertiary); font-size: 1.2rem; cursor: pointer; padding: 4px; border-radius: 6px; transition: all 0.2s; display: flex; align-items: center; justify-content: center; }
.todo-del:hover { color: var(--danger); background: #fee2e2; }

.todo-empty { padding: 32px; text-align: center; color: var(--text-tertiary); font-size: 0.95rem; background: #f9fafb; border-radius: var(--radius-md); border: 1px dashed var(--border-color); }

/* =========================================
   11. Widget Panel (위젯 패널)
   ========================================= */
.widget-panel {
    position: fixed; top: 0; right: 0; width: 380px; height: 100vh;
    background: transparent; box-shadow: none;
    z-index: 60; display: flex; flex-direction: column;
    pointer-events: none;
}
.widget-panel.active { pointer-events: auto; }

.widget-overlay {
    visibility: hidden; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.4); z-index: 55; backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px); opacity: 0; transition: all 0.3s ease;
}
.widget-overlay.active { visibility: visible; opacity: 1; }

.widget-header {
    background: #ffffff; border-radius: 20px;
    margin: 16px 16px 0 16px; padding: 20px 24px;
    box-shadow: var(--shadow-sm);
    display: flex; align-items: center; justify-content: space-between;
    transform: translateX(100px); opacity: 0;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s;
}
.widget-panel.active .widget-header { transform: translateX(0); opacity: 1; transition-delay: 0.05s; }

.widget-title { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); margin: 0; display: flex; align-items: center; gap: 8px;}
.widget-title i { color: var(--accent-primary); }
.widget-close { background: none; border: none; font-size: 1.5rem; color: var(--text-tertiary); cursor: pointer; transition: color 0.2s; }
.widget-close:hover { color: var(--danger); }

.widget-content { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.widget-content::-webkit-scrollbar { width: 6px; }
.widget-content::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 10px; }

.widget-section { 
    background: #ffffff; border-radius: 20px; padding: 24px; box-shadow: var(--shadow-sm);
    transform: translateX(100px); opacity: 0; margin-bottom: 0;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s;
}
.widget-panel.active .widget-section:nth-child(1) { transform: translateX(0); opacity: 1; transition-delay: 0.1s; }
.widget-panel.active .widget-section:nth-child(2) { transform: translateX(0); opacity: 1; transition-delay: 0.15s; }
.widget-panel.active .widget-section:nth-child(3) { transform: translateX(0); opacity: 1; transition-delay: 0.2s; }
.widget-panel.active .widget-section:nth-child(4) { transform: translateX(0); opacity: 1; transition-delay: 0.25s; }
.widget-panel.active .widget-section:nth-child(5) { transform: translateX(0); opacity: 1; transition-delay: 0.3s; }

.widget-section-title { font-size: 0.85rem; font-weight: 700; color: var(--text-tertiary); text-transform: uppercase; margin-bottom: 16px; letter-spacing: 0.5px; }

/* 위젯용 미니 투두 */
.mini-todo-list { list-style: none; padding: 0; margin: 0; }
.mini-todo-list .todo-item { padding: 12px; margin-bottom: 8px; border-radius: 8px; }
.mini-todo-list .todo-text { font-size: 0.85rem; }
.mini-todo-list .todo-check { font-size: 1.25rem; }
.mini-todo-list .todo-del { font-size: 1rem; }
.mini-todo-input { display: flex; gap: 8px; margin-bottom: 16px; }
.mini-todo-input input { flex: 1; padding: 10px 12px; border: 1px solid var(--border-color); border-radius: 8px; font-size: 0.85rem; outline: none; }
.mini-todo-input input:focus { border-color: var(--accent-primary); }
.mini-todo-input button { background: var(--accent-primary); color: white; border: none; padding: 0 16px; border-radius: 8px; font-weight: 600; font-size: 0.85rem; cursor: pointer; }

/* 위젯용 미니 스케줄 */
.mini-schedule-list { display: flex; flex-direction: column; gap: 12px; }
.mini-schedule-item { border-left: 3px solid var(--accent-primary); background: #f9fafb; padding: 12px 16px; border-radius: 0 8px 8px 0; }
.mini-schedule-time { font-size: 0.75rem; color: var(--text-tertiary); font-weight: 600; margin-bottom: 4px; }
.mini-schedule-title { font-size: 0.9rem; font-weight: 600; color: var(--text-primary); }
.mini-schedule-empty { font-size: 0.85rem; color: var(--text-tertiary); text-align: center; padding: 20px 0; background: #f9fafb; border-radius: 8px; border: 1px dashed var(--border-color); }

/* =========================================
   12. Utilities (유틸리티)
   ========================================= */
.type-chip {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 3px 8px; background: #f3f4f6; color: var(--text-secondary);
    border-radius: 12px; font-size: 0.7rem; font-weight: 600;
    border: 1px solid #e5e7eb;
}

/* =========================================
   13. Search Suggestions (검색 자동완성)
   ========================================= */
.search-suggestions {
    position: absolute; top: 100%; left: 0; width: 100%; background: var(--card-bg);
    border: 1px solid var(--border-color); border-radius: var(--radius-md);
    box-shadow: var(--shadow-md); margin-top: 8px; z-index: 100;
    max-height: 400px; overflow-y: auto;
}
.sugg-category {
    padding: 10px 16px 6px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-tertiary);
    background: #f8fafc;
    border-bottom: 1px dashed rgba(0,0,0,0.05);
}
.suggestion-item {
    padding: 12px 16px; border-bottom: 1px solid #f3f4f6; cursor: pointer;
    display: flex; flex-direction: column; gap: 4px; transition: background 0.2s;
}
.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:hover { background: #f9fafb; }
.sugg-vh { font-weight: 700; color: var(--accent-primary); font-size: 0.95rem; }
.sugg-info { font-size: 0.8rem; color: var(--text-secondary); display: flex; align-items: center; }
.sugg-info i { margin-right: 4px; color: var(--text-tertiary); }

/* =========================================
   14. Premium Global Component Overrides
   ========================================= */

.btn-primary { 
    background: var(--accent-primary) !important;
    color: #fff !important; 
    padding: 8px 20px !important; 
    border: none !important; 
    border-radius: 100px !important; 
    font-weight: 600 !important; 
    font-size: 0.85rem !important; 
    cursor: pointer !important; 
    transition: background 0.15s ease, transform 0.1s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}
.btn-primary:hover { 
    background: var(--accent-hover) !important;
    transform: translateY(-1px) !important;
}

.btn-secondary { 
    background: #fff !important; 
    color: var(--text-secondary) !important; 
    padding: 8px 20px !important; 
    border: 1px solid var(--border-color) !important; 
    border-radius: 100px !important; 
    font-weight: 600 !important; 
    font-size: 0.85rem !important; 
    cursor: pointer !important; 
    transition: all 0.15s ease, transform 0.1s ease !important; 
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}
.btn-secondary:hover { 
    background: #f8fafc !important; 
    color: var(--text-primary) !important;
    border-color: #cbd5e1 !important;
    transform: translateY(-1px) !important;
}

.form-input, .form-select { 
    width: 100%; padding: 10px 14px !important; 
    border: 1px solid var(--border-color) !important; 
    border-radius: 12px !important; 
    font-size: 0.85rem !important; 
    transition: all 0.15s ease !important; 
    background: #f8fafc !important;
}
.form-input:focus, .form-select:focus { 
    outline: none !important; 
    background: #ffffff !important;
    border-color: var(--accent-primary) !important; 
    box-shadow: 0 0 0 3px var(--accent-light) !important;
}

/* =========================================
   15. Print Styles (인쇄)
   ========================================= */
@media print {
    /* 불필요한 UI 숨기기 */
    .sidebar, .header, .modal-overlay, .widget-panel, .widget-overlay { display: none !important; }
    button, .btn-print, .panel-action, a[href^="javascript:"] { display: none !important; }

    /* 레이아웃 확장 */
    body, .main-wrapper, .content {
        height: auto !important;
        overflow: visible !important;
        position: static !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* 패널 스타일 초기화 */
    .panel {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin-bottom: 30px !important;
        page-break-inside: avoid;
    }
    
    .page-title { font-size: 1.5rem !important; margin-bottom: 10px !important; text-align: center; }
    
    /* 테이블 스타일 정리 */
    .modern-table {
        width: 100% !important;
        border-collapse: collapse !important;
    }
    .modern-table th, .modern-table td {
        border: 1px solid #ccc !important;
        padding: 8px !important;
        font-size: 0.8rem !important;
        color: #000 !important;
        white-space: normal !important;
    }
    .modern-table th { background: #f0f0f0 !important; }
    
    /* 관리 컬럼(수정/삭제) 숨기기 */
    .modern-table th:last-child, .modern-table td:last-child { display: none !important; }
    
    /* 칩 배경색 인쇄 시 강제 표시 */
    .type-chip, .status-pill, .kpi-card {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* =========================================
   16. 실시간 토스트 알림 (Toast Notification)
   ========================================= */
.toast-notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent-primary);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 9999;
    transform: translateY(100px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
}

.toast-notification.show {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.toast-icon {
    font-size: 1.5rem;
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: bellShake 2s infinite ease-in-out;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.toast-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.toast-refresh {
    background: var(--accent-light);
    color: var(--accent-primary);
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.toast-refresh:hover {
    background: #dbeafe;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px;
    display: flex;
}

.toast-close:hover {
    color: var(--danger);
}

@keyframes bellShake {
    0%, 100% { transform: rotate(0); }
    10%, 30%, 50% { transform: rotate(-10deg); }
    20%, 40%, 60% { transform: rotate(10deg); }
    70% { transform: rotate(0); }
}

/* =========================================
   17. Mobile Responsive (모바일 반응형)
   ========================================= */

/* 모바일 오버레이 (기본 숨김) */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

@media (max-width: 992px) {
    /* 햄버거 버튼 보이기 */
    .hamburger-btn { display: block; }
    
    /* GNB 가로 메뉴 가로 스와이프화 */
    .horizontal-nav { 
        display: flex;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
        margin-left: 12px;
        padding-bottom: 2px;
    }
    .horizontal-nav::-webkit-scrollbar { 
        display: none; /* Chrome, Safari, Edge */
    }
    .gnb-item {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    /* 헤더 컴팩트화 */
    .admin-header {
        margin: 10px;
        padding: 0 16px;
        height: 56px;
        border-radius: 12px;
    }
    
    /* 검색창 축소 */
    .header-search {
        width: 160px;
        padding: 6px 12px;
    }
    .header-search input { font-size: 0.8rem; }
    
    /* 아이콘 사이드바 (숨김 처리 -> 오프캔버스) */
    .admin-icon-sidebar {
        position: fixed;
        top: 0; left: 0;
        height: 100vh;
        margin: 0;
        border-radius: 0;
        background: #ffffff; /* 모바일 블러 깨짐 방지용 단색 */
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
        border-right: 1px solid #e2e8f0;
        box-shadow: none;
        backface-visibility: hidden;
    }
    .admin-icon-sidebar.active {
        transform: translateX(0);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.1);
    }
    
    /* 메인 사이드바 (숨김 처리 -> 오프캔버스) */
    .admin-sidebar {
        position: fixed;
        top: 0; left: 70px;
        height: 100vh;
        margin: 0;
        border-radius: 0;
        background: #ffffff; /* 모바일 블러 깨짐 방지용 단색 */
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        transform: translateX(calc(-100% - 70px));
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
        box-shadow: none;
        backface-visibility: hidden;
    }
    .admin-sidebar.active {
        transform: translateX(0);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.1);
    }
    
    /* 사이드바 닫기 버튼 보이기 */
    .sidebar-close-btn { display: block; }
    
    /* 본문 콘텐츠 패딩 조절 */
    .admin-content {
        padding: 16px 12px;
    }
    
    /* KPI 그리드 1열로 풀기 */
    .kpi-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    /* 대시보드 그리드 1열로 풀기 */
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .dashboard-grid .panel:first-child {
        grid-column: span 1;
    }
    
    /* 페이지 타이틀 폰트 조절 */
    .page-title {
        font-size: 1.25rem;
        margin-bottom: 16px;
    }
    
    /* 모달 크기 모바일 대응 */
    .modal-content {
        width: 95vw !important;
        margin: 20px auto;
        border-radius: 12px;
    }
    
    /* 위젯 패널 모바일 대응 */
    .widget-panel {
        width: 85vw !important;
        right: 0;
    }
    
    /* 테이블 스크롤 가능하게 */
    .modern-table {
        white-space: nowrap;
    }
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
        border: 1px solid var(--border-color);
    }
    
    /* 패널 및 패널 헤더 모바일 대응 */
    .panel {
        padding: 16px;
        border-radius: 12px;
    }
    .panel-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .panel-header .btn-primary, .panel-header .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 576px) {
    /* 스마트폰에서 헤더 검색창 숨김 */
    .header-search { display: none; }
    
    /* 토스트 알림 크기 최적화 */
    .toast-notification {
        width: calc(100vw - 32px);
        left: 16px;
        right: 16px;
        bottom: 16px;
        box-sizing: border-box;
    }
}
