/* Soothing Dark Forest Green Enterprise UI Theme */
:root {
    --ep-bg-main: #f4f7f5;
    --ep-bg-surface: #ffffff;
    --ep-bg-subtle: #f0f4f1;
    --ep-bg-sidebar: #0f291e;
    /* Deep Soothing Forest Green */
    --ep-bg-sidebar-brand: #091c14;
    /* Darker Pine Green */
    --ep-bg-sidebar-hover: #1c4435;
    /* Medium Forest Hover */
    --ep-bg-sidebar-active: #1e513f;
    /* Active Emerald Green */
    --ep-bg-header: #ffffff;

    --ep-border: #e2e8f0;
    --ep-border-darker: #cbd5e1;
    --ep-border-subtle: #f1f5f9;

    --ep-text-primary: #0f291e;
    /* Dark Forest Slate */
    --ep-text-secondary: #475569;
    --ep-text-muted: #94a3b8;

    --ep-sidebar-text: #d1fae5;
    /* Soft Pastel Mint */
    --ep-sidebar-text-muted: #6ee7b7;
    /* Light Mint Sage */
    --ep-sidebar-active-accent: #10b981;
    /* Vibrant Emerald Accent */

    /* Distinct Forest & Emerald Accent Palette */
    --ep-primary: #059669;
    /* Deep Emerald Green */
    --ep-primary-hover: #047857;
    /* Dark Emerald Hover */
    --ep-primary-light: #ecfdf5;
    /* Active Soft Mint Tint */
    --ep-primary-border: #10b981;
    /* Emerald Accent Line */

    --ep-secondary: #64748b;
    /* Slate Gray */
    --ep-success: #10b981;
    /* Emerald Green */
    --ep-success-light: #ecfdf5;
    /* Soft Emerald Tint */
    --ep-info: #0284c7;
    /* Sky Blue */
    --ep-info-light: #f0f9ff;
    /* Soft Sky Tint */
    --ep-warning: #d97706;
    /* Amber */
    --ep-warning-light: #fffbeb;
    /* Soft Amber Tint */
    --ep-danger: #dc2626;
    /* Crimson Red */
    --ep-danger-light: #fef2f2;
    /* Soft Crimson Tint */

    --ep-sidebar-width: 250px;
    --ep-sidebar-collapsed-width: 68px;
    --ep-header-height: 56px;
}

/* Reset Body & Page Container */
body {
    background-color: var(--ep-bg-main) !important;
    color: var(--ep-text-primary) !important;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

#bg {
    display: none !important;
}

.page,
.page-wrapper {
    background-color: var(--ep-bg-main) !important;
    min-height: 100vh;
}

/* Layout Architecture */
.ep-app-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
    background-color: var(--ep-bg-main);
}

/* Sidebar Styles - Soothing Dark Forest Green */
.ep-sidebar {
    width: var(--ep-sidebar-width);
    background-color: var(--ep-bg-sidebar);
    border-right: 1px solid rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    flex-shrink: 0;
    height: 100vh;
    position: sticky;
    top: 0;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
}

.ep-sidebar.collapsed {
    width: var(--ep-sidebar-collapsed-width);
}

.ep-sidebar-brand {
    height: var(--ep-header-height);
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background-color: var(--ep-bg-sidebar-brand);
    white-space: nowrap;
    overflow: hidden;
}

.ep-sidebar-brand a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
}

.ep-sidebar-brand-img {
    max-height: 28px;
    width: auto;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.ep-sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    overflow-y: auto;
}

.ep-nav-group-label {
    font-size: 0.675rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ep-sidebar-text-muted);
    padding: 0.85rem 0.75rem 0.35rem 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    opacity: 0.85;
}

.ep-sidebar.collapsed .ep-nav-group-label {
    display: none;
}

.ep-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    color: var(--ep-sidebar-text);
    text-decoration: none !important;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 6px;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
    white-space: nowrap;
    overflow: hidden;
}

.ep-nav-link i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    color: #a7f3d0;
    transition: color 0.15s ease;
}

.ep-nav-link:hover {
    color: #ffffff;
    background-color: var(--ep-bg-sidebar-hover);
}

.ep-nav-link:hover i {
    color: #34d399;
}

.ep-nav-link.active {
    color: #ffffff;
    background-color: var(--ep-bg-sidebar-active);
    border-left-color: var(--ep-sidebar-active-accent);
    font-weight: 600;
}

.ep-nav-link.active i {
    color: #34d399;
}

.ep-sidebar.collapsed .ep-nav-title,
.ep-sidebar.collapsed .ep-nav-chevron {
    display: none;
}

/* Submenu Accordions */
.ep-submenu {
    padding-left: 1.5rem;
    display: none;
}

.ep-submenu.show {
    display: block;
}

.ep-sidebar.collapsed .ep-submenu {
    display: none !important;
}

.ep-submenu .ep-nav-link {
    font-size: 0.825rem;
    padding: 0.45rem 0.75rem;
    border-left: none;
}

/* Main Content Area */
.ep-main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background-color: var(--ep-bg-main);
}

/* Header Bar - Crisp White with Forest Green Accent Line */
.ep-header {
    height: var(--ep-header-height);
    background-color: var(--ep-bg-header);
    border-bottom: 1px solid var(--ep-border);
    position: sticky;
    top: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.03);
    margin-bottom: 15px;
}

.ep-header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #059669 0%, #10b981 50%, #34d399 100%);
}

.ep-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.ep-sidebar-toggle {
    background-color: #f0f4f1;
    border: 1px solid var(--ep-border);
    border-radius: 6px;
    color: var(--ep-text-primary);
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ep-sidebar-toggle:hover {
    color: var(--ep-primary);
    border-color: var(--ep-primary-border);
    background-color: var(--ep-primary-light);
}

.ep-page-title-text {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ep-text-primary);
    margin: 0;
    letter-spacing: -0.01em;
}

.ep-header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Overriding Tabler Card Components to Enterprise Flat Panels */
.card,
.ep-panel {
    background-color: var(--ep-bg-surface) !important;
    border: 1px solid var(--ep-border) !important;
    border-radius: 8px !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.02) !important;
    margin-bottom: 1.25rem;
    transition: border-color 0.15s ease;
}

.card-header,
.ep-panel-header {
    background-color: var(--ep-bg-surface) !important;
    border-bottom: 1px solid var(--ep-border) !important;
    padding: 1rem 1.25rem !important;
}

.card-title,
.ep-panel-title {
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    color: var(--ep-text-primary) !important;
    margin: 0 !important;
    letter-spacing: -0.01em;
}

.card-body,
.ep-panel-body {
    padding: 1.25rem !important;
}

/* Stat Panel Redesign with Emerald Icons */
.ep-stat-card {
    background-color: var(--ep-bg-surface);
    border: 1px solid var(--ep-border);
    border-radius: 8px;
    padding: 1.15rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    height: 100%;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.ep-stat-card:hover {
    border-color: var(--ep-border-darker);
}

.ep-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background-color: var(--ep-primary-light);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--ep-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.ep-stat-value {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--ep-text-primary);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.ep-stat-label {
    font-size: 0.725rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ep-text-secondary);
    margin-top: 0.2rem;
}

/* Table Redesign */
.table,
.ep-table {
    width: 100%;
    margin-bottom: 0 !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    color: var(--ep-text-primary) !important;
}

.table th,
.ep-table th {
    background-color: var(--ep-bg-subtle) !important;
    color: var(--ep-text-primary) !important;
    font-size: 0.725rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.06em !important;
    padding: 0.8rem 1rem !important;
    border-bottom: 1px solid var(--ep-border) !important;
    border-top: none !important;
}

.table td,
.ep-table td {
    padding: 0.85rem 1rem !important;
    border-bottom: 1px solid var(--ep-border-subtle) !important;
    font-size: 0.875rem !important;
    vertical-align: middle !important;
    background-color: var(--ep-bg-surface) !important;
}

.table tr:hover td,
.ep-table tr:hover td {
    background-color: var(--ep-primary-light) !important;
}

/* Progress Bar Redesign */
.progress {
    background-color: var(--ep-bg-subtle) !important;
    border-radius: 9999px !important;
    height: 10px !important;
    box-shadow: none !important;
    overflow: hidden !important;
}

.progress-bar {
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* Distinct Forest Green Button Palette & Form Controls */
.form-control,
.form-select {
    background-color: var(--ep-bg-surface) !important;
    border: 1px solid var(--ep-border-darker) !important;
    border-radius: 6px !important;
    color: var(--ep-text-primary) !important;
    font-size: 0.875rem !important;
    padding: 0.5rem 0.75rem !important;
    box-shadow: none !important;
    transition: all 0.15s ease !important;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--ep-primary) !important;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15) !important;
}

.form-label {
    font-size: 0.775rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.03em !important;
    color: var(--ep-text-secondary) !important;
    margin-bottom: 0.35rem !important;
}

/* Primary Forest Emerald Button */
.btn-primary {
    background-color: var(--ep-primary) !important;
    border-color: var(--ep-primary) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    letter-spacing: 0.01em !important;
    border-radius: 6px !important;
    padding: 0.5rem 1.25rem !important;
    font-size: 0.875rem !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
    transition: all 0.15s ease !important;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--ep-primary-hover) !important;
    border-color: var(--ep-primary-hover) !important;
}

/* Action Button Variants in Tables & Cards */
.btn-outline-info {
    color: var(--ep-info) !important;
    border-color: rgba(2, 132, 199, 0.3) !important;
    background-color: var(--ep-info-light) !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
}

.btn-outline-info:hover {
    background-color: var(--ep-info) !important;
    color: #ffffff !important;
}

.btn-outline-primary {
    color: var(--ep-primary) !important;
    border-color: rgba(5, 150, 105, 0.3) !important;
    background-color: var(--ep-primary-light) !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
}

.btn-outline-primary:hover {
    background-color: var(--ep-primary) !important;
    color: #ffffff !important;
}

.btn-outline-warning {
    color: var(--ep-warning) !important;
    border-color: rgba(217, 119, 6, 0.3) !important;
    background-color: var(--ep-warning-light) !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
}

.btn-outline-warning:hover {
    background-color: var(--ep-warning) !important;
    color: #ffffff !important;
}

.btn-outline-secondary {
    color: var(--ep-text-secondary) !important;
    border-color: var(--ep-border-darker) !important;
    background-color: var(--ep-bg-surface) !important;
    font-weight: 500 !important;
    border-radius: 6px !important;
}

.btn-outline-secondary:hover {
    background-color: var(--ep-bg-subtle) !important;
    color: var(--ep-text-primary) !important;
}

/* Status Indicators */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.bg-green {
    background-color: var(--ep-success) !important;
}

.status-dot.bg-red {
    background-color: var(--ep-danger) !important;
}

/* User Menu & Dropdowns */
.dropdown-menu {
    border: 1px solid var(--ep-border) !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03) !important;
    padding: 0.5rem !important;
    background-color: var(--ep-bg-surface) !important;
}

.dropdown-item {
    font-size: 0.85rem !important;
    color: var(--ep-text-primary) !important;
    border-radius: 6px !important;
    padding: 0.45rem 0.75rem !important;
}

.dropdown-item:hover {
    background-color: var(--ep-primary-light) !important;
    color: var(--ep-primary) !important;
}

/* Footer Styling */
.ep-footer {
    border-top: 1px solid var(--ep-border);
    background-color: var(--ep-bg-surface);
    padding: 0.85rem 1.5rem;
    font-size: 0.775rem;
    color: var(--ep-text-secondary);
    margin-top: auto;
}

.ep-footer a {
    color: var(--ep-text-primary);
    text-decoration: none;
    font-weight: 600;
}

.ep-footer a:hover {
    color: var(--ep-primary);
}

.badge {
    background: #e8ffea !important;
}