:root {
    /* Base Colors - Default KEREA Green */
    --p-primary: #0C1730;
    --p-primary-light: #162a56;
    --p-primary-dark: #070d1c;
    --p-accent: #39DE4F;
    --p-accent-light: #5df070;
    --p-accent-dark: #2cb53f;
    --p-emerald: #39DE4F;
    --p-white: #ffffff;
    --p-bg: #fdfdfd;
    --p-sidebar-bg: #0C1730;
    --p-sidebar-text: #ffffff;
    --p-card-bg: #ffffff;
    --p-text-main: #000000;
    --p-text-muted: #4b5563;
    --p-border: #e5e7eb;
    
    /* Transitions & Effects */
    --p-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --p-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --p-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --p-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --p-radius: 0.75rem;
    --p-radius-lg: 1.25rem;
}

/* Theme: Executive Dark */
[data-theme="executive-dark"] {
    --p-primary: #0f172a;
    --p-primary-light: #1e293b;
    --p-primary-dark: #020617;
    --p-accent: #38bdf8;
    --p-bg: #020617;
    --p-sidebar-bg: #0f172a;
    --p-sidebar-text: #94a3b8;
    --p-card-bg: #0f172a;
    --p-text-main: #f1f5f9;
    --p-text-muted: #94a3b8;
    --p-border: #1e293b;
}

/* Theme: Carbon */
[data-theme="carbon"] {
    --p-primary: #171717;
    --p-primary-light: #262626;
    --p-primary-dark: #0a0a0a;
    --p-accent: #f59e0b;
    --p-bg: #0a0a0a;
    --p-sidebar-bg: #171717;
    --p-sidebar-text: #a3a3a3;
    --p-card-bg: #171717;
    --p-text-main: #f5f5f5;
    --p-text-muted: #a3a3a3;
    --p-border: #262626;
}

/* Theme: Forest */
[data-theme="forest"] {
    --p-primary: #064e3b;
    --p-primary-light: #065f46;
    --p-accent: #fcd34d;
    --p-bg: #022c22;
    --p-sidebar-bg: #064e3b;
    --p-card-bg: #064e3b;
    --p-text-main: #ecfdf5;
    --p-text-muted: #6ee7b7;
    --p-border: #065f46;
}

/* Global Resets */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--p-bg);
    color: #000000 !important;
    overflow-x: hidden;
    transition: background-color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--p-primary) !important;
}

/* Layout Wrapper */
.portal-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background-color: #0C1730 !important;
    color: #ffffff !important;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: width 0.3s ease, background-color 0.3s ease;
    border-right: 1px solid var(--p-border);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar::-webkit-scrollbar {
    width: 5px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(202, 162, 80, 0.3);
    border-radius: 10px;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2.5rem;
    padding: 1.2rem;
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 2px solid var(--p-accent);
}

.sidebar-logo img {
    max-width: 100%;
    height: auto;
    filter: none !important;
}

.nav-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 2rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--p-radius);
    text-decoration: none;
    color: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--p-transition);
}

.nav-item i {
    font-size: 1.1rem;
    width: 20px;
    display: flex;
    justify-content: center;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--p-white);
}

.nav-item.active {
    background-color: var(--p-accent);
    color: var(--p-primary);
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: 280px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Topbar */
.topbar {
    height: 80px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--p-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2.5rem;
    position: sticky;
    top: 0;
    z-index: 90;
}

[data-theme="executive-dark"] .topbar,
[data-theme="carbon"] .topbar,
[data-theme="forest"] .topbar {
    background: rgba(15, 23, 42, 0.8);
}

.search-bar {
    display: flex;
    align-items: center;
    background: var(--p-bg);
    border: 1px solid var(--p-border);
    padding: 0.6rem 1.2rem;
    border-radius: 99px;
    width: 350px;
    gap: 0.75rem;
}

.search-bar i { color: var(--p-text-muted); }
.search-bar input {
    background: none;
    border: none;
    outline: none;
    color: var(--p-text-main);
    width: 100%;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.notification-bell {
    position: relative;
    cursor: pointer;
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background-color: #ef4444;
    border-radius: 50%;
    border: 2px solid var(--p-white);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 99px;
    transition: var(--p-transition);
}

.user-profile:hover {
    background: var(--p-bg);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--p-accent);
}

.user-info .name {
    font-size: 0.9rem;
    font-weight: 700;
    display: block;
}

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

/* Dashboard Content */
.dashboard-page {
    padding: 2.5rem;
}

.page-header {
    margin-bottom: 2.5rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 850;
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: var(--p-text-muted);
}

/* Grid Layouts */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--p-card-bg);
    padding: 1.5rem;
    border-radius: var(--p-radius-lg);
    border: 1px solid var(--p-border);
    transition: var(--p-transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--p-shadow-lg);
}

.stat-icon {
    width: 48px;
    height: 48px;
    background: rgba(202, 162, 80, 0.1);
    color: var(--p-accent);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--p-text-muted);
    font-weight: 600;
}

/* Main Cards Grid */
.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.card {
    background: var(--p-card-bg);
    border-radius: var(--p-radius-lg);
    border: 1px solid var(--p-border);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--p-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
}

.card-body {
    padding: 1.5rem;
}

/* Buttons */
.p-btn {
    padding: 0.6rem 1.2rem;
    border-radius: var(--p-radius);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: var(--p-transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.p-btn-primary { background: var(--p-primary); color: var(--p-white); }
.p-btn-accent { background: var(--p-accent); color: var(--p-primary); }
.p-btn-outline { background: transparent; border: 1px solid var(--p-border); color: var(--p-text-main); }

/* Responsive */
@media (max-width: 1024px) {
    .sidebar { width: 80px; padding: 2rem 0.75rem; }
    .sidebar-logo span, .nav-item span { display: none; }
    .main-content { margin-left: 80px; }
    .nav-item { justify-content: center; }
}

@media (max-width: 768px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .content-grid { grid-template-columns: 1fr; }
    .search-bar { display: none; }
}
