:root {
    /* Light Mode - Classic Depth Restoration */
    --bg-main: #f8fafc;
    /* Slate 50 */
    --bg-panel: #ffffff;
    --border-subtle: rgba(0, 0, 0, 0.05);
    --text-primary: #0f172a;
    /* Slate 900 */
    --text-secondary: #475569;
    /* Slate 600 */
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow-main: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

html.dark {
    /* Dark Mode - Symmetrical Contrast */
    --bg-main: #09090b;
    /* Zinc 950 */
    --bg-panel: #18181b;
    /* Zinc 900 */
    --border-subtle: rgba(255, 255, 255, 0.05);
    --text-primary: #f4f4f5;
    /* Zinc 100 */
    --text-secondary: #a1a1aa;
    /* Zinc 400 */
    --glass-border: rgba(255, 255, 255, 0.08);
    --shadow-main: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    transition: background-color 0.3s, color 0.3s;
}

.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-main);
}

.glass-panel-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.12), 0 10px 10px -5px rgba(0, 0, 0, 0.06);
}

/* Component Overrides - Use sparingly to avoid theme glitches */

html.dark .bg-slate-50,
html.dark .bg-indigo-50 {
    background-color: var(--bg-panel);
}

/* Badges & Accents - Using opacity for safe layering in Dark Mode */
html.dark .bg-indigo-100,
html.dark .bg-indigo-50 {
    background-color: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
}

html.dark .bg-rose-100,
html.dark .bg-rose-50 {
    background-color: rgba(244, 63, 94, 0.15);
    border: 1px solid rgba(244, 63, 94, 0.3);
    color: #fda4af;
}

html.dark .bg-amber-100,
html.dark .bg-amber-50 {
    background-color: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fcd34d;
}

/* Text & Border Stabilization */
html.dark .text-slate-900,
html.dark .text-gray-900 {
    color: #ffffff;
    
}

html.dark .text-slate-500,
html.dark .text-gray-500 {
    color: #94a3b8;
}

html.dark .border-slate-100,
html.dark .border-slate-200 {
    border-color: #27272a;
}

/* Inputs & Form Elements */
html.dark input,
html.dark select,
html.dark textarea {
    background-color: #1a1a1e;
    border-color: #3f3f46;
    color: #fafafa;
}

html.dark input::placeholder {
    color: #71717a;
}

/* Tables */
html.dark thead.bg-slate-50 {
    background-color: #1a1a1e;
}

html.dark tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Mobile Responsive Adjustments */
@media (max-width: 640px) {
    .max-w-7xl, .max-w-6xl {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    h1 {
        font-size: 1.875rem !important; /* text-3xl */
        line-height: 2.25rem !important;
    }

    .glass-panel {
        padding: 1.5rem !important;
        border-radius: 1.5rem !important;
    }

    /* Stack flex-row elements on mobile */
    .md-flex-row {
        flex-direction: column !important;
    }
}

/* Date Picker Icon Styling */
input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    width: 20px;
    height: 20px;
    padding: 4px;
    border-radius: 4px;
    opacity: 0.8;
    transition: 0.2s;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    background-color: rgba(0, 0, 0, 0.05);
    opacity: 1;
}

/* Dark Mode Date Picker */
html.dark input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(100%);
}

html.dark input[type="date"]::-webkit-calendar-picker-indicator:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Alpine.js x-cloak: Prevent flickering on load */
[x-cloak] {
    display: none !important;
}