/* =========================================
   1. RESET & VARIABLES
   ========================================= */
:root {
    --primary-color: #0d6efd; /* Bootstrap primary blue */
    --primary-hover: #0a58ca; /* A slightly darker blue for hover effects */
    /* Optional: Additional shades for backgrounds and borders */
    --primary-bg-subtle: #cfe2ff;
    --primary-border-subtle: #9ec5fe;
    
    /* Layout Colors */
    --sidebar-bg: #1e293b;          /* Slate 800 */
    --sidebar-text: #e2e8f0;        /* Slate 200 */
    --sidebar-hover: #334155;       /* Slate 700 */
    --sidebar-active: #0f172a;      /* Slate 900 */
    
    --header-height: 64px;
    --sidebar-width: 260px;
    --transition-speed: 0.3s;

    --text-dark: #1e293b;
    --text-gray: #64748b;

    --es-text-main: #1e293b;
    --es-text-sub: #64748b;
    --es-bg: #f8fafc;

}

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    background-color: #dbdbdb;
    color: #1f2937;
    overflow-x: hidden;
    margin: 0;
}

a { text-decoration: none; }

/* =========================================
   2. TOP HEADER (White & Clean)
   ========================================= */
.top-header {
    height: var(--header-height);
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1050; /* Topmost layer */
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

/* Brand Section - FIXED: Now White to match Header */
.brand-section {
    width: var(--sidebar-width);
    height: 100%;
    background-color: #ffffff; /* White background */
    color: #1e293b; /* Dark text */
    display: flex;
    align-items: center;
    padding: 0 24px;
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    transition: width var(--transition-speed) ease;
    border-right: 1px solid #e5e7eb; /* Subtle separator */
}

.brand-section i {
    color: var(--primary-color);
    margin-right: 10px;
    font-size: 1.5rem;
}

/* Header Right Content */
.header-content {
    flex-grow: 1;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Toggle Button */
#menu-toggle {
    color: #6b7280;
    font-size: 1.2rem;
    padding: 5px 10px;
    border-radius: 6px;
    transition: all 0.2s;
}
#menu-toggle:hover {
    background-color: #f1f5f9;
    color: var(--primary-color);
}

/* =========================================
   3. SIDEBAR (Fixed Single Column)
   ========================================= */
#sidebar-wrapper {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background-color: var(--sidebar-bg);
    transition: transform var(--transition-speed) ease;
    z-index: 1040;
    overflow-y: auto;
    padding-bottom: 20px;
    
    /* Scrollbar */
    scrollbar-width: thin;
    scrollbar-color: var(--sidebar-hover) var(--sidebar-bg);

    /* FORCE SINGLE COLUMN LAYOUT */
    display: flex;
    flex-direction: column; 
}

#sidebar-wrapper::-webkit-scrollbar { width: 4px; }
#sidebar-wrapper::-webkit-scrollbar-track { background: var(--sidebar-bg); }
#sidebar-wrapper::-webkit-scrollbar-thumb { background: var(--sidebar-hover); border-radius: 4px; }

/* Menu Items Container */
.sidebar-menu {
    display: flex;
    flex-direction: column !important;
    width: 100%;
    flex-grow: 1;
    padding-top: 10px; /* Slight top padding */
}

/* Section Labels (Compact) */
.sidebar-menu .menu-label {
    font-size: 0.75rem; /* Slightly larger than 0.7 for readability */
    text-transform: uppercase;
    color: #64748b;
    padding: 16px 20px 8px; /* Reduced top padding */
    font-weight: 700;
    letter-spacing: 0.05em;
    line-height: 1;
}

/* Main Links (Compact & Professional) */
.sidebar-menu .nav-link {
    color: var(--sidebar-text);
    padding: 9px 20px; /* Reduced vertical padding (was 11px) */
    font-weight: 400;
    font-size: 0.9rem; /* Increased from 0.8rem for clarity */
    display: flex;
    align-items: center;
    width: 100%;
    white-space: nowrap;
    border-left: 3px solid transparent;
    transition: all 0.15s ease-in-out;
}

/* Hover State */
.sidebar-menu .nav-link:hover {
    background-color: var(--sidebar-hover);
    color: #fff;
}

/* Active State */
.sidebar-menu .nav-link.active {
    background-color: var(--primary-color);
    color: white;
    border-left-color: rgba(255,255,255,0.4); /* Subtle lighter border */
    font-weight: 500;
}

/* Icons */
.sidebar-menu .nav-link i {
    width: 24px;
    text-align: center;
    color: rgba(255,255,255,0.7) !important; /* Softer white by default */
    margin-right: 12px;
    font-size: 1rem;
    transition: color 0.2s;
}

.sidebar-menu .nav-link:hover i,
.sidebar-menu .nav-link.active i {
    color: #fff !important; /* Bright white on hover/active */
    opacity: 1;
}

/* Submenu Styles (Tighter) */
.sidebar-submenu {
    background-color: #0f172a;
    display: flex;
    flex-direction: column;
    padding: 4px 0; /* Slight padding container */
}

.sidebar-submenu .nav-link {
    padding: 7px 20px 7px 58px; /* Indented, compact vertical padding */
    font-size: 0.85rem; /* Slightly smaller than main links */
    color: #94a3b8;
}

.sidebar-submenu .nav-link:hover {
    color: #fff;
    background-color: transparent; /* No bg change for submenu, just text color */
}

.sidebar-submenu .nav-link.active {
    color: var(--primary-color);
    background-color: transparent;
    border-left-color: transparent;
}
/* =========================================
   4. CONTENT & FOOTER
   ========================================= */
#page-content-wrapper {
    margin-top: var(--header-height);
    margin-left: var(--sidebar-width);
    padding: 25px;
    transition: margin-left var(--transition-speed) ease;
    min-height: calc(100vh - var(--header-height));
    display: flex;
    flex-direction: column;
}

.footer {
    background: #fff;
    margin-top: auto;
    border-top: 1px solid #e5e7eb;
    width: 100%;
    font-size: 0.85rem;
}

.footer .hover-teal:hover {
    color: var(--primary-color) !important;
    text-decoration: underline !important;
}

/* =========================================
   5. RESPONSIVE & TOGGLE LOGIC
   ========================================= */

/* Desktop Closed: Content expands, Sidebar slides left */
body.sidebar-closed #sidebar-wrapper { transform: translateX(-100%); }
body.sidebar-closed #page-content-wrapper { margin-left: 0; }

/* Mobile Devices (Max Width 768px) */
@media (max-width: 768px) {
    /* Header Adjustments */
    .brand-section {
        width: auto;
        padding-right: 15px;
        border-right: none;
        background: transparent;
    }
    
    /* Sidebar Hidden by Default */
    #sidebar-wrapper {
        transform: translateX(-100%);
        box-shadow: 4px 0 15px rgba(0,0,0,0.1);
    }
    
    /* Content Full Width */
    #page-content-wrapper {
        margin-left: 0;
        padding: 15px;
    }
    
    /* Open State */
    body.sidebar-open { overflow: hidden; }
    body.sidebar-open #sidebar-wrapper { transform: translateX(0); }
    
    /* Backdrop Overlay */
    body.sidebar-open::before {
        content: '';
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1035;
    }
}

/* Utilities */
.text-teal { color: var(--primary-color) !important; }
.bg-teal { background-color: var(--primary-color) !important; }
.card-hover-effect { transition: transform 0.2s, box-shadow 0.2s; }
.card-hover-effect:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.08) !important; }

/* Students details edit, add css */
.erp-es-wrapper {
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

/* Header */
.erp-es-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.erp-es-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--es-text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}
.erp-es-title i { color: var(--primary-color); }

.erp-es-btn-back {
    text-decoration: none;
    color: var(--es-text-sub);
    border: 1px solid #cbd5e1;
    padding: 8px 16px;
    border-radius: 8px;
    background: white;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.erp-es-btn-back:hover { border-color: var(--primary-color); color: var(--primary-color); }

/* Forms */
.erp-es-card {
    background: white;
    border: 1px solid #e2e8f0; /* Card border remains subtle */
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    padding: 24px;
    margin-bottom: 24px;
}

.erp-es-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Inputs */
.erp-es-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--es-text-main);
}
.erp-es-label span { color: #ef4444; }

/* INPUT BORDER COLOR BLACK AS REQUESTED */
.erp-es-control {
    width: 100%;
    padding: 10px 12px;
    font-size: 0.95rem;
    border: 1px solid #000000 !important; /* Forces Black Border */
    border-radius: 6px;
    transition: all 0.2s;
    background-color: #fff;
    color: #000; /* Darker text */
}
.erp-es-control:focus {
    outline: none;
    border-color: var(--primary-color) !important; /* Highlight on focus */
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

/* Input Groups (Dynamic Fields) */
.erp-es-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}
.erp-es-btn-add, .erp-es-btn-remove {
    padding: 0 16px;
    border: none;
    border-radius: 6px;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.erp-es-btn-add { background-color: #10b981; }
.erp-es-btn-add:hover { background-color: #059669; }
.erp-es-btn-remove { background-color: #ef4444; }
.erp-es-btn-remove:hover { background-color: #dc2626; }

/* Photo Preview */
.erp-es-photo-preview {
    width: 150px;
    height: 150px;
    border: 2px dashed #000;
    border-radius: 8px;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f1f5f9;
}
.erp-es-photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Radio Buttons */
.erp-es-radio-group {
    display: flex;
    gap: 20px;
    margin-top: 5px;
}
.erp-es-radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.95rem;
    cursor: pointer;
}
.erp-es-radio {
    accent-color: var(--primary-color);
    width: 16px; height: 16px;
}

/* Submit Button */
.erp-es-btn-submit {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(13, 148, 136, 0.3);
}
.erp-es-btn-submit:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

/* Inputs (Black Border) */
.erp-es-label { display: block; margin-bottom: 6px; font-weight: 500; font-size: 0.9rem; color: var(--es-text-main); }
.erp-es-control {
    width: 100%; padding: 10px 12px; font-size: 0.95rem;
    border: 1px solid #000000 !important; /* Force Black Border */
    border-radius: 6px; transition: all 0.2s; background-color: #fff; color: #000;
}
.erp-es-control:focus { outline: none; border-color: var(--primary-color) !important; box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1); }

/* Buttons */
.erp-es-btn-submit {
    background-color: var(--primary-color); color: white; border: none; padding: 10px 24px;
    font-size: 0.95rem; border-radius: 6px; font-weight: 600; cursor: pointer; transition: all 0.2s;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.erp-es-btn-submit:hover { background-color: var(--primary-hover); transform: translateY(-1px); }

.erp-es-btn-outline {
    background-color: white; color: var(--es-text-main); border: 1px solid #cbd5e1;
    padding: 6px 16px; font-size: 0.9rem; border-radius: 6px; font-weight: 500; cursor: pointer; transition: all 0.2s;
}
.erp-es-btn-outline:hover { border-color: var(--primary-color); color: var(--primary-color); background: #f0fdfa; }
.erp-es-btn-outline.active { background-color: var(--primary-color); color: white; border-color: var(--primary-color); }

/* --- DESIGN SELECTION GRID --- */
.design-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 20px; }
.design-option { position: relative; cursor: pointer; }
.design-input { position: absolute; opacity: 0; width: 0; height: 0; }

.design-card {
    border: 2px solid #e2e8f0; border-radius: 8px; overflow: hidden;
    transition: all 0.2s ease; position: relative;
}
.design-card img { width: 100%; height: auto; display: block; transition: transform 0.3s; }
.design-name {
    text-align: center; padding: 8px; background: #f8fafc; font-weight: 600;
    font-size: 0.9rem; border-top: 1px solid #e2e8f0; color: var(--es-text-main);
}

/* Selected State */
.design-input:checked + .design-label .design-card {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.1);
}
.design-input:checked + .design-label .design-name {
    background-color: var(--primary-color); color: white;
}
/* Checkmark Badge */
.check-badge {
    position: absolute; top: 10px; right: 10px; background: var(--primary-color); color: white;
    width: 24px; height: 24px; border-radius: 50%; display: none; align-items: center; justify-content: center; font-size: 0.8rem;
}
.design-input:checked + .design-label .check-badge { display: flex; }

.form-check-input { cursor: pointer; width: 18px; height: 18px; accent-color: var(--primary-color); }

/* Table Styling */
    .erp-es-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
    .erp-es-table th {
        background-color: #f1f5f9;
        color: var(--es-text-main);
        font-weight: 600;
        padding: 12px 16px;
        text-align: left;
        border-bottom: 2px solid #e2e8f0;
        font-size: 0.9rem;
    }
    .erp-es-table td {
        padding: 12px 16px;
        border-bottom: 1px solid #e2e8f0;
        color: var(--es-text-main);
        vertical-align: middle;
        font-size: 0.95rem;
    }
    .erp-es-table tr:hover { background-color: #f8fafc; }
    
    .btn-delete-sm {
        padding: 6px 12px; font-size: 0.85rem; border-radius: 4px;
        background-color: #fee2e2; color: #ef4444; border: 1px solid #fecaca;
        transition: 0.2s;
    }
    .btn-delete-sm:hover { background-color: #ef4444; color: white; }
