:root {
    /* Color Palette - Dark Theme */
    --bg-main: #0B1120;
    --bg-surface: rgba(30, 41, 59, 0.7);
    --bg-sidebar: #0F172A;
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --border-color: rgba(255, 255, 255, 0.1);
    
    /* Accents */
    --accent-blue: #3B82F6;
    --accent-indigo: #6366F1;
    --accent-orange: #F59E0B;
    --accent-red: #EF4444;
    --accent-green: #10B981;

    /* Spacing & Utilities */
    --sidebar-width: 260px;
    --header-height: 80px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme Variables */
body.light-theme {
    --bg-main: #F3F4F6;
    --bg-surface: rgba(255, 255, 255, 0.85);
    --bg-sidebar: #FFFFFF;
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --border-color: rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    overflow-x: hidden;
    transition: var(--transition);
}

/* Custom Scrollbar for Premium UI */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main); 
}
::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.3); 
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.6); 
}

/* Fade In Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.dashboard-container, .main-content > header {
    animation: fadeIn 0.5s ease-out forwards;
}

/* Glassmorphism Utilities */
.glassmorphism {
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Global Select Options Styling */
select option {
    background-color: var(--bg-sidebar);
    color: var(--text-primary);
}

/* ---------------- Sidebar ---------------- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 50;
    transition: var(--transition);
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-blue);
}

.toggle-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
}

.nav-menu {
    flex: 1;
    padding: 24px 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-section {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 16px 0 8px 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.nav-item i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.nav-item:hover, .nav-item.active {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
}

.badge-container {
    justify-content: space-between;
}
.nav-item .badge {
    background: var(--accent-red);
    color: white;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 9999px;
    font-weight: bold;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.user-info .details {
    display: flex;
    flex-direction: column;
}

.user-info .name {
    font-size: 0.875rem;
    font-weight: 600;
}

.user-info .role {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.logout-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
    transition: var(--transition);
}
.logout-btn:hover {
    color: var(--accent-red);
}

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

.top-header {
    min-height: var(--header-height);
    padding: 16px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 12px;
}

.header-title h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.header-title p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

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

.hr-stats-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.05);
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 0.875rem;
    border: 1px solid var(--border-color);
}
.hr-stats-pill .stat.normal { color: var(--accent-green); font-weight: 600;}
.hr-stats-pill .stat.vacation { color: var(--accent-orange); font-weight: 600;}
.hr-stats-pill .stat.absent { color: var(--accent-red); font-weight: 600;}

.theme-toggle, .notification-bell {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    position: relative;
}

.notification-bell .indicator {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: var(--accent-red);
    border-radius: 50%;
}

.dashboard-container {
    padding: 32px 40px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ---------------- Alert Banner ---------------- */
.alert-banner {
    display: flex;
    align-items: center;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 16px 20px;
    border-radius: var(--radius-md);
    gap: 16px;
    animation: slideDown 0.4s ease-out forwards;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-icon {
    color: var(--accent-red);
    font-size: 1.5rem;
}

.alert-content {
    flex: 1;
    font-size: 0.95rem;
    color: #ff9999;
}

.alert-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
}

/* ---------------- KPI Grid ---------------- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}

.kpi-card {
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 20px;
    transition: transform 0.2s;
}
.kpi-card:hover {
    transform: translateY(-4px);
}

.kpi-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}
.kpi-icon.blue { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }
.kpi-icon.indigo { background: rgba(99, 102, 241, 0.15); color: var(--accent-indigo); }
.kpi-icon.orange { background: rgba(245, 158, 11, 0.15); color: var(--accent-orange); }
.kpi-icon.red { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); }

.kpi-details {
    flex: 1;
}

.kpi-details h3 {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.kpi-details .amount {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 8px 0;
}

.kpi-details .trend {
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
}
.trend.positive { color: var(--accent-green); }
.trend.negative { color: var(--accent-red); }
.trend.neutral { color: var(--text-secondary); }

.progress-bar-bg {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    margin-bottom: 8px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background: var(--accent-red);
    border-radius: 4px;
}

/* ---------------- Action Bar (Global) ---------------- */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    margin-top: 16px;
    margin-bottom: 24px;
}

.search-box {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: var(--radius-lg);
    width: 450px; /* Increased from 300px for better visibility */
    transition: all 0.3s ease;
}

.search-box:focus-within {
    border-color: var(--accent-blue);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.search-box i {
    color: var(--text-secondary);
    margin-right: 12px;
    font-size: 1.1rem;
    transition: color 0.3s;
}

.search-box:focus-within i {
    color: var(--accent-blue);
}

.search-box input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    width: 100%;
    outline: none;
    font-family: inherit;
    font-size: 0.95rem;
}

.search-box input::placeholder {
    color: #64748B;
}

.filter-box {
    display: flex;
    gap: 12px;
}


.charts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.col-span-1 { grid-column: span 1; }
.col-span-2 { grid-column: span 2; }
.col-span-3 { grid-column: span 3; }

.chart-container {
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.chart-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.more-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
}

.styled-select {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 6px;
    outline: none;
    font-family: inherit;
}

.chart-body {
    flex: 1;
    position: relative;
    width: 100%;
}


/* ---------------- Tables Grid ---------------- */
.tables-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.table-container {
    padding: 24px;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.btn-text {
    background: none;
    border: none;
    color: var(--accent-blue);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
}

.table-responsive {
    overflow-x: auto;
}

.erp-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.erp-table th {
    color: var(--text-secondary);
    font-weight: 500;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.erp-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.erp-table tbody tr:last-child td {
    border-bottom: none;
}

.text-right { text-align: right; }
.highlight { font-weight: 600; color: var(--accent-blue); }

.tag {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
}
.tag-income { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.tag-expense { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); }

.status {
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
}
.status::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}
.st-pending::before { background: var(--accent-orange); }
.st-approved::before { background: var(--accent-green); }


/* ---------------- Notice List ---------------- */
.notice-container {
    padding: 24px;
}

.notice-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.notice-item {
    padding-bottom: 16px;
    border-bottom: 1px dashed var(--border-color);
}
.notice-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.notice-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.8rem;
}

.tag-important { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); }
.tag-general { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }
.tag-hr { background: rgba(99, 102, 241, 0.15); color: var(--accent-indigo); }

.date {
    color: var(--text-secondary);
}

.notice-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.4;
}

.notice-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------------- Responsive ---------------- */
@media (max-width: 1200px) {
    .charts-grid, .tables-grid {
        grid-template-columns: 1fr;
    }
    .col-span-2, .col-span-3 {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .main-content {
        margin-left: 0;
    }
    .top-header {
        padding: 0 20px;
    }
    .dashboard-container {
        padding: 24px 20px;
    }
    .hr-stats-pill {
        display: none;
    }
}

/* ============================================
 * Dual-Site KPI Section (통합 대시보드)
 * ============================================ */
.dual-kpi-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
@media (max-width: 1200px) {
    .dual-kpi-section { grid-template-columns: 1fr; }
}

.site-kpi-block {
    padding: 20px 24px;
}

.site-kpi-header {
    margin-bottom: 16px;
}

.site-kpi-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}
.site-kpi-badge.spa {
    background: rgba(139, 92, 246, 0.15);
    color: #A78BFA;
    border: 1px solid rgba(139, 92, 246, 0.3);
}
.site-kpi-badge.hotel {
    background: rgba(59, 130, 246, 0.15);
    color: #60A5FA;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.site-kpi-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.kpi-card.mini {
    padding: 16px;
    background: rgba(0,0,0,0.15);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255,255,255,0.04);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transition: transform 0.2s;
}
.kpi-card.mini:hover {
    transform: translateY(-2px);
    border-color: rgba(255,255,255,0.1);
}
.kpi-card.mini .kpi-icon {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.kpi-card.mini .kpi-details h3 {
    font-size: 0.75rem;
}
.kpi-card.mini .kpi-details .amount {
    font-size: 1.25rem;
    margin: 4px 0;
}
.kpi-card.mini .kpi-details .trend {
    font-size: 0.72rem;
}

.kpi-icon.purple { background: rgba(139, 92, 246, 0.15); color: #8B5CF6; }
.kpi-icon.green { background: rgba(16, 185, 129, 0.15); color: #10B981; }

/* Integrated Summary Bar */
.integrated-summary {
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 18px 28px;
    gap: 0;
}

.summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.summary-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.summary-value {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}
.summary-value.accent { color: #3B82F6; }
.summary-value.negative { color: #EF4444; }
.summary-value.profit { color: #10B981; }

.summary-divider {
    width: 1px;
    height: 36px;
    background: var(--border-color);
}

@media (max-width: 768px) {
    .integrated-summary {
        flex-wrap: wrap;
        gap: 16px;
        padding: 16px 20px;
    }
    .summary-divider { display: none; }
    .site-kpi-grid { grid-template-columns: 1fr; }
}

/* Light Theme Adjustments for Dual KPI */
.light-theme .kpi-card.mini {
    background: rgba(0,0,0,0.03);
    border-color: rgba(0,0,0,0.06);
}
.light-theme .kpi-card.mini:hover {
    border-color: rgba(0,0,0,0.12);
}
