/* Base */

/* SCOPED VARIABLES FOR PANEL ONLY */
body.academypanel-app-mode {
    /* Default (Light Mode) - Matches original hardcoded values */
    --panel-bg-main: #f8fafc;
    --panel-bg-card: #ffffff;
    --panel-text-main: #1e293b;
    --panel-text-muted: #64748b;
    --panel-border: #e2e8f0;
    --panel-primary-light: #818cf8;
    --panel-bg-active: #eff6ff;
    /* Fallback if var not exists */
}

/* Dark Mode Overrides - Only active if HTML has dark-mode AND body has app-mode */
html.dark-mode body.academypanel-app-mode {
    --panel-bg-main: #0f172a;
    /* Slate 900 */
    --panel-bg-card: #1e293b;
    /* Slate 800 */
    --panel-text-main: #f1f5f9;
    /* Slate 100 - High Contrast */
    --panel-text-muted: #94a3b8;
    /* Slate 400 */
    --panel-border: #334155;
    /* Slate 700 */
    --panel-bg-active: rgba(59, 130, 246, 0.15);

    /* Mappings for components using --ep-* vars */
    --ep-bg-card: var(--panel-bg-card);
    --ep-text-primary: var(--panel-text-main);
    --ep-text-secondary: var(--panel-text-muted);
    --ep-text-muted: var(--panel-text-muted);
    --ep-bg-secondary: var(--panel-bg-main);
    --ep-border: var(--panel-border);
    --ep-primary: #3b82f6;
}

.academypanel-container {
    min-height: 100vh;
    background: var(--panel-bg-main, #f8fafc);
    color: var(--panel-text-main, #1e293b) !important;
    font-family: system-ui, -apple-system, sans-serif;
    max-width: 100vw;
    overflow-x: hidden;
    cursor: default;
}

/* Panel wrapper from WP page template */
.academypanel-panel-wrapper {
    max-width: 100vw;
    overflow-x: hidden;
    width: 100%;
}

/* Remove body padding-top when in app mode (header is hidden) */
body.academypanel-app-mode {
    padding-top: 0 !important;
    overflow-x: hidden;
}

/* ... headers ... */

.ep-dashboard-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--panel-text-main, #1e293b) !important;
    margin: 0;
}

.ep-dashboard-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--panel-text-main, #1e293b);
    margin: 0;
}

.ep-dashboard-subtitle {
    color: var(--panel-text-muted, #64748b);
    margin-top: 0.5rem;
}

/* ... stats ... */

.ep-stat-card {
    background: var(--panel-bg-card, #ffffff);
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
    border: 1px solid var(--panel-border, #e2e8f0);
}

.ep-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--panel-text-main, #0f172a) !important;
}

.ep-stat-label {
    color: var(--panel-text-muted, #64748b) !important;
    font-size: 0.875rem;
    font-weight: 500;
}

/* ... widgets ... */

.ep-widget {
    background: var(--panel-bg-card, #ffffff);
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    grid-column: span 12;
    overflow: hidden;
    border: 1px solid var(--panel-border, #e2e8f0);
}

.ep-widget-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--panel-border, #e2e8f0);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ep-widget-title {
    font-weight: 600;
    color: var(--panel-text-main, #0f172a) !important;
    margin: 0;
    font-size: 1rem;
}

/* Visibility helpers - Desktop default */
.ep-show-mobile-only {
    display: none;
}

/* Utilities */
.bg-blue-100 {
    background-color: #dbeafe;
}

.text-blue-600 {
    color: #2563eb;
}

.bg-green-100 {
    background-color: #dcfce7;
}

.text-green-600 {
    color: #16a34a;
}

.bg-purple-100 {
    background-color: #f3e8ff;
}

.text-purple-600 {
    color: #9333ea;
}

.bg-orange-100 {
    background-color: #ffedd5;
}

.text-orange-600 {
    color: #ea580c;
}

.bg-teal-100 {
    background-color: #ccfbf1;
}

.text-teal {
    color: #0d9488;
}

.border-teal {
    border-left: 4px solid #0d9488;
}

.bg-cyan-100 {
    background-color: #cffafe;
}

.text-cyan {
    color: #0891b2;
}

.border-cyan {
    border-left: 4px solid #0891b2;
}

/* Dashboard Layout */
.ep-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    box-sizing: border-box;
    overflow-x: hidden;
}

.ep-dashboard *,
.ep-dashboard *::before,
.ep-dashboard *::after {
    box-sizing: border-box;
}

.ep-main {
    overflow-x: hidden;
    box-sizing: border-box;
    width: 100%;
}

.ep-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.ep-dashboard-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--panel-text-main) !important;
    margin: 0;
}

.ep-dashboard-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--panel-text-main);
    margin: 0;
}

.ep-dashboard-subtitle {
    color: var(--panel-text-muted);
    margin-top: 0.5rem;
}

/* Stats Grid */
.ep-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.ep-stat-card {
    background: var(--panel-bg-card);
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
    border: 1px solid var(--panel-border);
}

.ep-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Widget inline filter dropdown */
.ep-stat-card {
    position: relative;
}

.ep-widget-filter {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    border: 1px solid var(--panel-border);
    border-radius: 0.375rem;
    background: var(--panel-bg-main);
    color: var(--panel-text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.ep-widget-filter:hover {
    border-color: #cbd5e1;
    background: #f1f5f9;
}

.ep-widget-filter:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.ep-stat-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

/* Contrast Fixes */
.ep-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--panel-text-main, #0f172a) !important;
}

.ep-stat-label {
    color: var(--panel-text-muted, #64748b) !important;
    font-size: 0.875rem;
    font-weight: 500;
}

/* ... existing code ... */

.ep-widget-title {
    font-weight: 600;
    color: var(--panel-text-main, #0f172a) !important;
    margin: 0;
    font-size: 1rem;
}

/* ... existing code ... */

.ep-nav-item.active {
    background: var(--panel-bg-active);
    color: var(--panel-primary-light) !important;
    /* Lighter blue/purple for dark mode visibility */
    font-weight: 500;
}

/* Widgets Grid */
.ep-widgets-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.5rem;
}

.ep-widget,
.ep-widget-card {
    background: var(--panel-bg-card, #ffffff);
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    grid-column: span 12;
    overflow: hidden;
    border: 1px solid var(--panel-border, #e2e8f0);
}

@media (min-width: 1024px) {

    .ep-widget,
    .ep-widget-card {
        grid-column: span 6;
    }

    .ep-widget[data-widget-id="stats"],
    .ep-widget-card[data-widget-id="stats"] {
        grid-column: span 12;
    }
}

.ep-widget-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--panel-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ep-widget-title {
    font-weight: 600;
    color: var(--panel-text-main) !important;
    margin: 0;
    font-size: 1rem;
}

/* ... existing code ... */

.ep-nav-item.active {
    background: var(--panel-bg-active);
    color: var(--panel-primary-light) !important;
    font-weight: 500;
}

.ep-widget-content {
    padding: 1.5rem;
}

/* Lists */
/* Lists */
.ep-session-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--panel-border);
}

.ep-session-item:last-child {
    border-bottom: none;
}

.ep-session-time {
    font-weight: 600;
    color: var(--panel-text-muted);
    width: 60px;
    font-size: 0.875rem;
}

.ep-session-info {
    flex: 1;
    padding: 0 1rem;
}

.ep-session-title {
    font-weight: 500;
    color: var(--panel-text-main);
}

.ep-session-student {
    font-size: 0.875rem;
    color: var(--panel-text-muted);
}

/* Sidebar */
.ep-app {
    display: flex;
    min-height: 100vh;
}

.ep-sidebar {
    width: 260px;
    background: var(--panel-bg-card);
    border-right: 1px solid var(--panel-border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.ep-sidebar-brand {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--panel-text-main);
    border-bottom: 1px solid var(--panel-border);
}

.ep-sidebar-nav {
    flex: 1;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.ep-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    color: var(--panel-text-muted);
    text-decoration: none;
    border: none;
    background: none;
    width: 100%;
    cursor: pointer;
    text-align: left;
    font-size: 0.95rem;
}

.ep-nav-item:hover {
    background: var(--panel-bg-main, #f8fafc);
    color: var(--panel-text-main, #0f172a);
}

.ep-nav-item .label,
.ep-nav-item .icon {
    color: inherit;
    transition: color 0.2s;
}

.ep-nav-item.active {
    background: var(--panel-bg-active, #eff6ff);
    color: var(--panel-primary-light, #2563eb) !important;
    font-weight: 500;
}

.ep-sidebar-user {
    padding: 1rem;
    border-top: 1px solid var(--panel-border, #e2e8f0);
    background: var(--panel-bg-main, #f8fafc);
}

.ep-user-info {
    font-size: 0.875rem;
}

.ep-user-name {
    font-weight: 600;
    color: var(--panel-text-main, #1e293b) !important;
}

.ep-user-role {
    color: var(--panel-text-muted, #64748b) !important;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.ep-main {
    flex: 1;
    background: var(--panel-bg-main, #f8fafc);
}

.ep-empty {
    text-align: center;
    color: #94a3b8;
    padding: 2rem;
}

/* --- NEW STYLES: Buttons, Tables, Tabs --- */

/* Main Header Bar */
.ep-header-bar {
    background: var(--panel-bg-card);
    border-bottom: 1px solid var(--panel-border);
    transition: background-color 0.2s, border-color 0.2s;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1.5;
}

.btn-primary {
    background: #2563eb;
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-secondary {
    background: #64748b;
    color: white;
}

.btn-secondary:hover {
    background: #475569;
}

.btn-outline {
    background: transparent;
    border: 1px solid #cbd5e1;
    color: #475569;
}

.btn-outline:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #0f172a;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* Forms */
.ep-form-group {
    margin-bottom: 1rem;
}

.ep-form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #334155;
    font-size: 0.9rem;
}

.ep-form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    color: #0f172a;
    transition: all 0.2s;
}

.ep-form-control:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.ep-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* Table */
/* Table */
/* Table Structure Fix */
.ep-table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--panel-bg-card, #ffffff);
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--panel-border, #e2e8f0);
    margin-bottom: 1rem;
}

.ep-table {
    width: 100%;
    border-collapse: collapse;
}

.ep-table th {
    background: var(--panel-bg-main, #f8fafc);
    color: var(--panel-text-muted, #64748b);
    font-weight: 600;
    text-align: left;
    padding: 1rem 1.5rem;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--panel-border, #e2e8f0);
}

.ep-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--panel-border, #f1f5f9);
    color: var(--panel-text-main, #334155) !important;
    vertical-align: middle;
}

.ep-table tr:last-child td {
    border-bottom: none;
}

.ep-table tr:hover td {
    background: var(--panel-bg-main, #f8fafc);
}

/* Badges */
.ep-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
}

.ep-badge.paid,
.ep-badge.completed {
    background: #dcfce7;
    color: #16a34a;
}

.ep-badge.pending,
.ep-badge.scheduled {
    background: #ffedd5;
    color: #c2410c;
}

.ep-badge.partial {
    background: #dbeafe;
    color: #2563eb;
}

/* Tabs */
.ep-tabs {
    display: flex;
    gap: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 1.5rem;
}

.ep-tab {
    padding: 0.75rem 0;
    color: #64748b;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    background: none;
    border-left: none;
    border-right: none;
    border-top: none;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    margin-bottom: -1px;
}

.ep-tab:hover {
    color: #0f172a;
}

.ep-tab.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

/* Filter Buttons */
.ep-filter-btn {
    padding: 0.5rem 1rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    color: #64748b;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.ep-filter-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.ep-filter-btn.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

/* Modal */
.ep-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999 !important;
    backdrop-filter: blur(4px);
    padding: 1rem;
    /* Added padding to ensure spacing on small screens */
}

.ep-modal {
    background: white;
    border-radius: 1rem;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: modalSlide 0.3s ease-out;
    max-height: 90vh;
    /* Prevent modal from exceeding viewport height */
    overflow-y: auto;
    /* Enable scrolling for tall content */
    display: flex;
    flex-direction: column;
}

.ep-modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    /* Keep header at top when scrolling */
    top: 0;
    background: white;
    z-index: 10;
}

.ep-modal-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
}

.ep-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #64748b;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
}

.ep-modal-body {
    padding: 1.5rem;
    color: #1e293b;
    overflow-y: auto;
    /* Ensure body scrolls independently if header is sticky */
}

.ep-modal-body p,
.ep-modal-body span,
.ep-modal-body div,
.ep-modal-body label {
    color: #334155 !important;
}

.ep-modal-body strong {
    color: #0f172a !important;
}

.ep-modal-body .text-red-500 {
    color: #dc2626 !important;
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Global Text Contrast Fix */
.academypanel-container p,
.academypanel-container span:not(.ep-badge),
.academypanel-container div,
.academypanel-container label,
.academypanel-container td {
    color: #334155;
}

/* Sidebar Contrast Fix - Override theme styles */
/* Sidebar Contrast Fix - Override theme styles */
.ep-nav-item {
    color: var(--panel-text-muted, #64748b) !important;
}

.ep-nav-item .label {
    color: inherit !important;
}

.ep-nav-item:hover {
    color: var(--panel-text-main, #0f172a) !important;
}

.ep-nav-item.active {
    color: var(--panel-primary-light, #2563eb) !important;
}

/* Homework Module Styles */
.ep-homework-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}

.ep-homework-card {
    background: var(--panel-bg-card, #ffffff);
    border-radius: 0.75rem;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #3b82f6;
    transition: transform 0.15s, box-shadow 0.15s;
    border: 1px solid var(--panel-border, #e2e8f0);
    border-left-width: 4px;
    /* Restore left border width */
}

.ep-homework-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ep-homework-card.urgent {
    border-left-color: #f59e0b;
    background: linear-gradient(to right, #fffbeb, white);
}

.ep-homework-card.overdue {
    border-left-color: #ef4444;
    background: linear-gradient(to right, #fef2f2, white);
}

.ep-homework-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.ep-homework-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #0f172a;
}

.ep-homework-desc {
    color: #64748b;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.ep-homework-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: #64748b;
}

.ep-homework-result {
    background: #f0fdf4;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    margin-top: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ep-homework-result strong {
    color: #16a34a !important;
    font-size: 1.1rem;
}

/* Multi-Select Dropdown */
.ep-multi-select {
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
    padding: 0.5rem;
    background: #f8fafc;
}

.ep-multi-select-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 0.25rem;
    transition: background 0.1s;
}

.ep-multi-select-option:hover {
    background: #e2e8f0;
}

.ep-multi-select-option input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: #3b82f6;
}

.ep-multi-select-option span {
    color: #1e293b !important;
}

/* NET Badge */
.ep-net-badge {
    background: rgba(21, 128, 61, 0.18) !important;
    color: #166534 !important;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-weight: 600;
    font-size: 0.875rem;
    border: 1px solid rgba(21, 128, 61, 0.3);
}

/* Status Badge Variants */
.ep-badge.urgent {
    background: #fef3c7;
    color: #b45309 !important;
}

.ep-badge.overdue {
    background: #fee2e2;
    color: #dc2626 !important;
}

.ep-badge.approved {
    background: #d1fae5;
    color: #059669 !important;
}

.ep-badge.completed {
    background: #dbeafe;
    color: #2563eb !important;
}

/* Red Color Utilities for Homework Widget */
.bg-red-100 {
    background-color: #fee2e2;
}

.text-red {
    color: #dc2626 !important;
}

.text-red-600 {
    color: #dc2626 !important;
}

.border-red {
    border-left: 4px solid #dc2626;
}

/* Modal Styles */
.ep-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.ep-modal {
    background: white;
    border-radius: 0.75rem;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.ep-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.ep-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #0f172a !important;
}

.ep-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #64748b;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.ep-close-btn:hover {
    color: #0f172a;
}

.ep-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: 60vh;
}

.ep-modal-body p {
    color: #334155 !important;
    margin-bottom: 0.5rem;
}

.ep-modal-body strong {
    color: #0f172a !important;
}

.ep-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Form Label Dark Text Override */
.ep-form-group label,
.ep-modal-body label,
form label {
    color: #1e293b !important;
    font-weight: 500 !important;
}

/* NET Score Badge */
.ep-net-badge {
    display: inline-block;
    background: rgba(21, 128, 61, 0.18) !important;
    color: #166534 !important;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid rgba(21, 128, 61, 0.3);
}

/* Table Cell Improvements */
.ep-table td {
    vertical-align: middle;
    white-space: nowrap;
}

.ep-table .flex {
    display: flex;
    align-items: center;
}

.ep-table .gap-2 {
    gap: 0.5rem;
}

/* Improved Badge Styling */
.ep-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 500;
    border-radius: 9999px;
    white-space: nowrap;
}

.ep-badge.approved {
    background-color: #dcfce7;
    color: #16a34a !important;
}

.ep-badge.completed {
    background-color: #dbeafe;
    color: #2563eb !important;
}

.ep-badge.overdue {
    background-color: #fee2e2;
    color: #dc2626 !important;
}

.ep-badge.urgent {
    background-color: #fef3c7;
    color: #d97706 !important;
}

.ep-badge.pending {
    background-color: #f1f5f9;
    color: #64748b !important;
}

/* Button in table - smaller */
.ep-table .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Outline button variant for detail buttons */
.ep-btn-outline,
button[variant="outline"],
.ep-table button.btn-sm {
    background: white !important;
    border: 1px solid #3b82f6 !important;
    color: #3b82f6 !important;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.ep-btn-outline:hover,
button[variant="outline"]:hover,
.ep-table button.btn-sm:hover {
    background: #3b82f6 !important;
    color: white !important;
}

/* Primary variant in table */
.ep-table button.btn-sm[class*="primary"],
.ep-table .ep-btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    color: white !important;
    border: none !important;
}

/* Danger button variant for delete */
.btn-danger,
.ep-btn-danger,
.ep-table .btn-danger {
    background: white !important;
    border: 1px solid #dc2626 !important;
    color: #dc2626 !important;
}

.btn-danger:hover,
.ep-btn-danger:hover,
.ep-table .btn-danger:hover {
    background: #dc2626 !important;
    color: white !important;
}

/* Module header styling */
.ep-module-header h2 {
    color: #1e293b !important;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

/* Section Title */
.ep-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Widget Card */
/* Widget Card */
.ep-widget-card {
    background: var(--panel-bg-card, #ffffff);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--panel-border, #e2e8f0);
}

/* Statistics Widget for Dashboard - Compact Style */
.ep-stats-widget {
    background: white;
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #6366f1;
    grid-column: span 2;
    display: flex;
    flex-direction: column;
    min-width: 280px;
}

.ep-stats-widget-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.ep-stats-widget-icon {
    font-size: 1.25rem;
}

.ep-stats-widget-title {
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
}

.ep-stats-chart-mini {
    background: #f8fafc;
    border-radius: 0.5rem;
    padding: 0.75rem;
    height: 120px;
    margin-bottom: 0.75rem;
    border: 1px solid #e2e8f0;
}

.ep-stats-chart-mini canvas {
    width: 100% !important;
    height: 100% !important;
}

.ep-stats-summary {
    display: flex;
    gap: 0.5rem;
}

.ep-summary-item {
    flex: 1;
    background: #f8fafc;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    text-align: center;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 50px;
}

.ep-summary-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.ep-summary-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 500;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 2px;
}

/* Responsive adjustments for stats widget */
@media (max-width: 768px) {
    .ep-stats-widget {
        grid-column: span 1;
    }
}

@media (max-width: 480px) {
    .ep-stats-summary {
        flex-direction: column;
        gap: 0.5rem;
    }

    .ep-stats-chart-mini {
        height: 60px;
    }
}

/* Full Width Statistics Widget Container */
.ep-stats-widget-fullwidth {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.ep-stats-widget-fullwidth .ep-stats-widget,
.ep-stats-widget-fullwidth .ep-stats-widget-v2 {
    grid-column: unset;
    width: 100%;
}

/* Statistics Widget V2 - Horizontal Layout */
.ep-stats-widget-v2 {
    background: white;
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #6366f1;
}

.ep-stats-widget-v2 .ep-stats-widget-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.ep-stats-widget-v2 .ep-stats-widget-icon {
    font-size: 1.25rem;
}

.ep-stats-widget-v2 .ep-stats-widget-title {
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
}

.ep-stats-widget-body {
    display: flex;
    gap: 1rem;
    align-items: stretch;
}

.ep-stats-chart-area {
    flex: 1;
    background: #f8fafc;
    border-radius: 0.5rem;
    padding: 0.75rem;
    min-height: 100px;
    border: 1px solid #e2e8f0;
}

.ep-stats-chart-area canvas {
    width: 100% !important;
    height: 100% !important;
}

.ep-stats-metrics {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 100px;
}

.ep-metric-box {
    background: #f8fafc;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    text-align: center;
    border: 1px solid #e2e8f0;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ep-metric-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
}

.ep-metric-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 500;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 2px;
}

/* Responsive for V2 widget */
@media (max-width: 480px) {
    .ep-stats-widget-body {
        flex-direction: column;
    }

    .ep-stats-metrics {
        flex-direction: row;
    }

    .ep-metric-box {
        flex: 1;
    }
}

/* Action Dropdown Styles */
.ep-action-dropdown {
    position: relative;
    display: inline-block;
}

.ep-action-dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 4px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 160px;
    padding: 4px 0;
}

.ep-action-dropdown-menu button {
    display: block;
    width: 100%;
    padding: 8px 16px;
    text-align: left;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.875rem;
    color: #334155;
}

/* Weekly Schedule Styles */
.ep-schedule-card {
    background: var(--panel-bg-card, #ffffff);
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    color: var(--panel-text-main, #1e293b);
}

.ep-schedule-card-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--panel-text-main, #1e293b);
}

.ep-schedule-card-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--panel-text-muted, #64748b);
    flex-wrap: wrap;
}

.ep-section-header {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--panel-text-main, #1e293b);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
}

.ep-section-header .title-text {
    flex: 1;
}

.ep-section-header .count {
    font-size: 0.8rem;
    color: var(--panel-text-muted, #94a3b8);
    font-weight: 400;
}

.ep-empty-state-box {
    text-align: center;
    padding: 1.5rem;
    background: var(--panel-bg-card, #f8fafc);
    border-radius: 0.75rem;
    color: var(--panel-text-muted, #94a3b8);
    border: 1px solid var(--panel-border, #e2e8f0);
}

.ep-stat-box {
    color: white;
    padding: 1rem;
    border-radius: 0.75rem;
    text-align: center;
}

.ep-stat-box.blue {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.ep-stat-box.orange {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.ep-stat-box.green {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.ep-stat-val {
    font-size: 1.5rem;
    font-weight: 700;
}

.ep-stat-lbl {
    font-size: 0.75rem;
    opacity: 0.9;
}

.ep-legend {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: var(--panel-bg-card, #f8fafc);
    border-radius: 0.5rem;
    flex-wrap: wrap;
    border: 1px solid var(--panel-border, #e2e8f0);
}

.ep-legend .text-muted {
    color: var(--panel-text-muted, #64748b);
}

/* Weekly Schedule Dark Mode Overrides */
html.dark-mode .ep-schedule-card {
    background: var(--panel-bg-card, #1e293b);
    color: var(--panel-text-main, #f1f5f9);
    border-color: var(--panel-border, #334155);
}

html.dark-mode .ep-schedule-card-title {
    color: #ffffff !important;
    /* Force White */
}

html.dark-mode .ep-schedule-card-meta {
    color: #e2e8f0 !important;
    /* Slate 200 - Very High Contrast */
}

html.dark-mode .ep-schedule-card-meta span {
    color: #e2e8f0 !important;
}

html.dark-mode .ep-section-header {
    color: #ffffff !important;
}

html.dark-mode .ep-section-header .count {
    color: #cbd5e1 !important;
    /* Slate 300 */
}

html.dark-mode .ep-empty-state-box {
    background: var(--panel-bg-card, #1e293b);
    color: #cbd5e1 !important;
    border-color: var(--panel-border, #334155);
}

html.dark-mode .ep-legend {
    background: var(--panel-bg-card, #1e293b);
    border-color: var(--panel-border, #334155);
}

html.dark-mode .ep-legend .text-muted {
    color: #cbd5e1 !important;
}

/* Utility Classes */
.ep-text-main {
    color: var(--panel-text-main, #1e293b);
}

.ep-text-muted {
    color: var(--panel-text-muted, #64748b);
}

/* Search Input Styles */
.ep-search-input {
    background-color: var(--panel-bg-card, #ffffff);
    color: var(--panel-text-main, #1e293b);
    border: 1px solid var(--panel-border, #e2e8f0);
}

.ep-search-input::placeholder {
    color: var(--panel-text-muted, #94a3b8);
}

/* Dark Mode Overrides for Utilities and Search */
html.dark-mode .ep-text-main {
    color: #f1f5f9 !important;
}

html.dark-mode .ep-text-muted {
    color: #cbd5e1 !important;
}

html.dark-mode .ep-search-input {
    background-color: var(--panel-bg-card, #1e293b) !important;
    /* Slate 800 */
    color: #f1f5f9 !important;
    border-color: var(--panel-border, #334155) !important;
}

html.dark-mode .ep-search-input::placeholder {
    color: #94a3b8 !important;
}

/* Mobile Card Dark Mode Override */
html.dark-mode .ep-session-mobile-card {
    background: var(--panel-bg-card, #1e293b) !important;
    border-color: var(--panel-border, #334155) !important;
    color: #f1f5f9;
}

.ep-text-success {
    color: #16a34a;
    /* Green 600 */
}

.ep-text-danger {
    color: #ef4444;
    /* Red 500 */
}

html.dark-mode .ep-text-success {
    color: #4ade80 !important;
    /* Green 400 - Brighter for dark mode */
}

html.dark-mode .ep-text-danger {
    color: #f87171 !important;
    /* Red 400 - Brighter for dark mode */
}

.ep-mobile-schedule-container {
    background: var(--panel-bg-card, #f8fafc);
    border-radius: 0.75rem;
    padding: 0.5rem;
    margin: 0.5rem 0;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--panel-border, #e2e8f0);
}

/* Profile Module Mobile Responsive */
@media (max-width: 1024px) {
    .ep-profile-form-group {
        padding: 1rem !important;
        margin-bottom: 1rem !important;
        max-width: 100%;
        overflow: hidden;
        box-sizing: border-box;
    }

    .ep-profile-form-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.75rem !important;
    }

    .ep-profile-form-title {
        font-size: 1rem !important;
    }

    .ep-profile-privacy-label {
        font-size: 0.7rem !important;
    }

    .ep-profile-template-section {
        padding: 0.75rem !important;
    }

    .ep-profile-info-text {
        font-size: 0.75rem !important;
    }

    .ep-profile-username-box {
        padding: 0.5rem 0.75rem !important;
    }

    /* Prevent form elements from overflowing cards */
    .ep-profile-form-group input,
    .ep-profile-form-group textarea,
    .ep-profile-form-group select {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .ep-profile-form-group textarea {
        width: 100% !important;
        box-sizing: border-box !important;
    }
}

/* Weekly Schedule Mobile */
@media (max-width: 768px) {
    .ep-day-column {
        min-width: 90px !important;
    }

    .ep-weekly-schedule-horizontal {
        gap: 0.25rem !important;
    }
}

/* Dark Mode Profile Overrides */
html.dark-mode .ep-profile-form-group {
    background: var(--panel-bg-card, #1e293b) !important;
    border-color: var(--panel-border, #334155) !important;
}

html.dark-mode .ep-profile-form-title {
    color: #f1f5f9 !important;
}

html.dark-mode .ep-profile-username-box {
    background: rgba(30, 41, 59, 0.8) !important;
}

html.dark-mode .ep-profile-template-section {
    background: rgba(30, 41, 59, 0.6) !important;
}

html.dark-mode .ep-profile-info-box {
    background: rgba(30, 58, 138, 0.2) !important;
    border-color: #1e3a8a !important;
}

html.dark-mode .ep-profile-info-text {
    color: #93c5fd !important;
}

html.dark-mode .ep-profile-privacy-box {
    background: var(--panel-bg-card, #1e293b) !important;
    border-color: var(--panel-border, #334155) !important;
}

html.dark-mode .ep-profile-privacy-text {
    color: #cbd5e1 !important;
}

html.dark-mode .ep-profile-privacy-strong {
    color: #f1f5f9 !important;
}

html.dark-mode .ep-profile-privacy-desc {
    color: #94a3b8 !important;
}

html.dark-mode .ep-profile-copy-btn {
    background: #334155 !important;
    color: #e2e8f0 !important;
}

html.dark-mode .ep-profile-edu-placeholder {
    background: rgba(30, 41, 59, 0.6) !important;
    color: #94a3b8 !important;
}

html.dark-mode .ep-profile-teaching-highlight {
    background: rgba(30, 58, 138, 0.15) !important;
}

html.dark-mode .ep-profile-section-divider {
    border-color: var(--panel-border, #334155) !important;
}

html.dark-mode .ep-profile-section-title {
    color: #f1f5f9 !important;
}

/* Allow td to display dropdown outside of table bounds */
.ep-table td {
    position: relative;
}

.ep-table tr {
    position: relative;
}

/* For tables that contain action dropdowns, allow overflow */
.ep-table-responsive:has(.ep-action-dropdown) {
    overflow: visible !important;
    overflow-x: visible !important;
}

/* Allow last td to have visible overflow */
.ep-table td:last-child {
    overflow: visible;
}

/* Widget card overflow for dropdowns */
.ep-widget-card {
    overflow: visible !important;
}

.ep-widget-card .ep-table-responsive {
    overflow: visible;
}

/* Base Card Style (Classes, etc) - Structure agnostic */
.ep-card {
    background: var(--panel-bg-card, #ffffff);
    border: 1px solid var(--panel-border, #e2e8f0);
    /* Ensure text inherits dark mode color */
    color: var(--panel-text-main, #1e293b);
}

.ep-card h3 {
    color: var(--panel-text-main, #1e293b) !important;
}

.ep-card p,
.ep-card small {
    color: var(--panel-text-muted, #64748b) !important;
}

/* Specific Homework Card Style */
.ep-homework-card {
    background: var(--panel-bg-card, #ffffff);
    border: 1px solid var(--panel-border, #e2e8f0);
    border-left-width: 4px;
    /* Maintain the colored left border */
}

/* Ensure dropdown menu appears above everything */
.ep-action-dropdown-menu {
    z-index: 9999 !important;
}

/* ============================================
   RESPONSIVE DESIGN - Mobile First
   ============================================ */

/* Hamburger Menu Button */
.ep-hamburger {
    display: none;
    position: absolute;
    top: 50%;
    left: 0.5rem;
    transform: translateY(-50%);
    z-index: 1001;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.5rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ep-hamburger span {
    display: block;
    width: 24px;
    height: 3px;
    background: #334155;
    margin: 4px 0;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.ep-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ep-sidebar-overlay.visible {
    display: block;
    opacity: 1;
}

/* ===== TABLET (max-width: 1024px) ===== */
@media (max-width: 1024px) {
    .ep-dashboard {
        padding: 1.5rem;
    }

    .ep-widgets-grid {
        gap: 1rem;
    }

    .ep-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

/* Global Utility for Visibility */
.ep-show-mobile-only {
    display: none;
}

/* ===== MOBILE LANDSCAPE / TABLET SMALL (max-width: 768px) ===== */
@media (max-width: 768px) {

    /* Visibility helpers */
    .ep-hide-mobile {
        display: none !important;
    }

    .ep-show-mobile-only {
        display: block !important;
    }

    /* Show hamburger menu */
    .ep-hamburger {
        display: block;
    }

    /* Sidebar becomes slide-out */
    .ep-sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    }

    .ep-sidebar.open {
        left: 0;
    }

    /* Main content takes full width */
    .ep-main {
        margin-left: 0;
        padding-top: 0;
    }

    /* Header bar needs relative positioning for hamburger */
    .ep-header-bar {
        position: relative;
        padding-left: 3.5rem !important;
        /* Space for hamburger */
    }

    .ep-dashboard {
        padding: 1rem;
        margin: 0;
    }

    /* ===== MOBILE FRAME & LAYOUT ===== */

    /* Main container with edge frame */
    .ep-main {
        margin-left: 0;
        padding: 0.75rem;
        background: #f1f5f9;
    }

    /* Dashboard with consistent spacing */
    .ep-dashboard {
        padding: 0.5rem;
        max-width: 100%;
        width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
    }

    /* Prevent any children from overflowing */
    .ep-dashboard>* {
        max-width: 100%;
        overflow-x: auto;
        box-sizing: border-box;
    }

    /* Header styling for mobile */
    .ep-header-bar {
        position: relative;
        padding: 0.5rem 1rem 0.5rem 3.5rem !important;
        margin: -0.75rem -0.75rem 0.75rem -0.75rem;
        border-radius: 0;
    }

    /* Page title section */
    .ep-dashboard-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
        text-align: center;
        padding: 1rem;
        background: white;
        border-radius: 1rem;
        margin-bottom: 1rem;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    }

    .ep-dashboard-header h1,
    .ep-dashboard-header h2,
    .ep-dashboard-title,
    .ep-section-title {
        font-size: 1.25rem;
        text-align: center;
        margin: 0;
    }

    .ep-dashboard-subtitle {
        text-align: center;
        font-size: 0.875rem;
    }

    /* ===== WIDGET CARDS - MOBILE ===== */

    .ep-stat-card {
        padding: 1.25rem;
        border-radius: 1rem;
        text-align: center;
        background: white;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
        margin-bottom: 0.75rem;
    }

    .ep-stat-icon {
        margin: 0 auto 0.75rem auto;
    }

    .ep-stat-value {
        font-size: 1.75rem;
        display: block;
        margin-bottom: 0.25rem;
    }

    .ep-stat-label {
        font-size: 0.8rem;
        color: #64748b;
    }

    /* Stats grid for mobile */
    .ep-stats-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        margin-bottom: 1rem;
    }

    /* Widget panels */
    .ep-widget {
        border-radius: 1rem;
        margin-bottom: 1rem;
        margin-left: 0.25rem;
        margin-right: 0.25rem;
        overflow: hidden;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    }

    .ep-widget-header {
        padding: 1rem 1.25rem;
        text-align: left;
    }

    .ep-widget-title {
        font-size: 1rem;
    }

    .ep-widget-content {
        padding: 1rem 1.25rem;
    }

    /* Widgets grid - single column */
    .ep-widgets-grid {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    /* ===== CONTENT CARDS ===== */

    .ep-homework-card,
    .ep-session-item {
        background: white;
        border-radius: 0.875rem;
        padding: 1rem 1.25rem;
        margin-bottom: 0.75rem;
        margin-left: 0.5rem;
        margin-right: 0.5rem;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    }

    .ep-session-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        text-align: left;
        border-left: 4px solid #3b82f6;
    }

    .ep-session-time {
        width: 100%;
        font-size: 0.8rem;
        color: #2563eb;
        font-weight: 600;
    }

    .ep-session-info {
        padding: 0;
        width: 100%;
    }

    .ep-session-title {
        font-size: 1rem;
        margin-bottom: 0.25rem;
    }

    /* ===== BUTTONS & ACTIONS ===== */

    .btn,
    button.btn {
        width: 100%;
        justify-content: center;
        padding: 0.875rem 1rem;
        font-size: 0.9rem;
        border-radius: 0.75rem;
    }

    .ep-form-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .ep-form-actions .btn {
        margin: 0;
    }

    /* Action buttons row */
    .ep-dashboard-header .btn,
    .ep-module-header .btn {
        width: 100%;
        margin-top: 0.5rem;
    }

    /* Tabs - Button Style */
    .ep-tabs {
        flex-wrap: wrap;
        gap: 0.5rem;
        border-bottom: none;
        padding: 0;
    }

    .ep-tab {
        flex: 1 1 auto;
        text-align: center;
        padding: 0.625rem 1rem;
        font-size: 0.8rem;
        background: #f1f5f9;
        border: 1px solid #e2e8f0;
        border-radius: 0.5rem;
        margin-bottom: 0;
    }

    .ep-tab.active {
        background: #2563eb;
        color: white;
        border-color: #2563eb;
    }

    .ep-tab:hover:not(.active) {
        background: #e2e8f0;
    }

    /* Tables become cards */
    .ep-table-responsive {
        overflow-x: visible;
        background: transparent;
        box-shadow: none;
    }

    .ep-table {
        display: block;
        min-width: unset;
    }

    .ep-table thead {
        display: none;
    }

    .ep-table tbody {
        display: block;
    }

    .ep-table tr {
        display: block;
        margin-bottom: 1rem;
        padding: 1rem;
        background: white;
        border-radius: 0.75rem;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        border-left: 4px solid #3b82f6;
    }

    .ep-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border: none;
        border-bottom: 1px solid #f1f5f9;
    }

    .ep-table td:last-child {
        border-bottom: none;
        padding-top: 0.75rem;
        justify-content: flex-end;
    }

    .ep-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #64748b;
        font-size: 0.8rem;
        text-transform: uppercase;
    }

    /* Homework cards */
    .ep-homework-grid {
        grid-template-columns: 1fr;
    }

    /* Widgets full width */
    .ep-widget {
        grid-column: span 12 !important;
    }

    /* Form grids */
    .grid-cols-2,
    .grid.grid-cols-2 {
        grid-template-columns: 1fr !important;
    }

    /* Action dropdown position fix */
    .ep-action-dropdown-menu {
        right: auto;
        left: 0;
    }
}

/* ===== MOBILE PORTRAIT (max-width: 480px) ===== */
@media (max-width: 480px) {
    .ep-dashboard {
        padding: 0.75rem;
    }

    .ep-dashboard-title {
        font-size: 1.25rem;
    }

    /* Tabs full width */
    .ep-tab {
        flex: 1 1 100%;
    }

    /* Form actions stack */
    .ep-form-actions {
        flex-direction: column;
    }

    .ep-form-actions button,
    .ep-form-actions .btn {
        width: 100%;
    }

    /* Stat cards smaller padding */
    .ep-stat-card {
        padding: 1rem;
    }

    .ep-stat-value {
        font-size: 1.25rem;
    }

    /* Modal full width */
    .ep-modal {
        width: 95%;
        max-height: 85vh;
    }

    .ep-modal-body {
        padding: 1rem;
    }

    /* Session info compact */
    .ep-session-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .ep-session-time {
        width: auto;
    }

    .ep-session-info {
        padding: 0;
    }

    /* Homework meta wrap */
    .ep-homework-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    /* Hide long text in badges */
    .ep-badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.5rem;
    }

    /* Button text smaller */
    .btn,
    button {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }

    .btn-sm {
        font-size: 0.75rem;
        padding: 0.375rem 0.5rem;
    }

    /* Multi-select smaller */
    .ep-multi-select {
        max-height: 150px;
    }

    /* Widget content padding */
    .ep-widget-content {
        padding: 1rem;
    }

    .ep-widget-header {
        padding: 0.75rem 1rem;
    }
}

/* ===== VERY SMALL SCREENS (max-width: 360px) ===== */
@media (max-width: 360px) {
    .ep-dashboard {
        padding: 0.5rem;
    }

    .ep-dashboard-title {
        font-size: 1.125rem;
    }

    .ep-stat-card {
        padding: 0.75rem;
    }

    .ep-stat-icon {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.25rem;
    }

    .ep-modal {
        width: 100%;
        border-radius: 0.75rem 0.75rem 0 0;
        max-height: 90vh;
    }
}

/* ===== WEEKLY SCHEDULE MOBILE - 90° ROTATED VIEW ===== */
@media (max-width: 768px) {

    /* Weekly schedule page wrapper */
    .ep-weekly-schedule-page {
        padding: 0.5rem;
    }

    /* Rotated schedule container */
    .ep-weekly-schedule-rotated-wrapper {
        position: relative;
        width: 100%;
        height: 90vw;
        /* Height based on viewport width for rotation */
        overflow: hidden;
        margin: 1rem 0;
    }

    .ep-weekly-schedule-rotated {
        transform: rotate(90deg);
        transform-origin: top left;
        position: absolute;
        top: 0;
        left: 100%;
        width: 90vw;
        max-height: 100vw;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Horizontal scroll alternative (current implementation) */
    .ep-weekly-schedule-horizontal {
        display: flex;
        flex-direction: row;
        gap: 0.5rem;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        padding: 0.5rem;
    }

    .ep-weekly-schedule-horizontal>div {
        scroll-snap-align: start;
        flex: 0 0 85%;
        min-width: 280px;
    }
}

/* ===== COMPACT MOBILE SESSION CARDS ===== */
@media (max-width: 768px) {

    /* Mobile session card container */
    .ep-session-mobile-card {
        display: block !important;
        padding: 0.5rem !important;
        background: white;
        border-radius: 0.625rem;
        border-left: 4px solid #3b82f6;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    }

    /* Row 1: Title + Student pills */
    .ep-mobile-card-header {
        display: flex;
        flex-wrap: wrap;
        gap: 0.375rem;
        justify-content: center;
        margin-bottom: 0.5rem;
    }

    .ep-mobile-pill {
        padding: 0.25rem 0.625rem;
        border-radius: 1rem;
        font-size: 0.75rem;
        font-weight: 500;
        text-align: center;
    }

    .ep-mobile-pill.primary {
        background: linear-gradient(135deg, #3b82f6, #1d4ed8);
        color: white;
    }

    .ep-mobile-pill.secondary {
        background: #f1f5f9;
        color: #475569;
    }

    /* Row 2: Date/Time/Duration meta */
    .ep-mobile-card-meta {
        display: flex;
        flex-wrap: wrap;
        gap: 0.375rem;
        justify-content: center;
        margin-bottom: 0.5rem;
        padding: 0.375rem;
        background: #f8fafc;
        border-radius: 0.375rem;
    }

    .ep-mobile-card-meta span {
        font-size: 0.7rem;
        color: #64748b;
        white-space: nowrap;
    }

    /* Row 3: Status + Actions */
    .ep-mobile-card-actions {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        padding-top: 0.375rem;
        border-top: 1px solid #f1f5f9;
    }

    .ep-mobile-card-actions .ep-badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.5rem;
    }

    .ep-mobile-action-buttons {
        display: flex;
        align-items: center;
        gap: 0.25rem;
    }

    /* Icon buttons for mobile */
    .ep-icon-btn {
        width: 28px;
        height: 28px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 1px solid #e2e8f0;
        border-radius: 0.375rem;
        background: white;
        cursor: pointer;
        font-size: 0.875rem;
        transition: all 0.15s ease;
    }

    .ep-icon-btn:hover {
        background: #f1f5f9;
    }

    .ep-icon-btn:active {
        transform: scale(0.95);
    }

    /* Table row compact */
    .ep-table tr {
        padding: 0.5rem;
        margin-bottom: 0.5rem;
        border-left: 3px solid #3b82f6;
    }

    /* Hide table header on mobile */
    .ep-table thead {
        display: none;
    }

    /* Hide data-label text on compact cards */
    .ep-table td[data-label="İşlem"]::before {
        display: none !important;
    }
}

/* ===== COMPACT SESSION CARDS FOR MOBILE ===== */
@media (max-width: 768px) {

    /* Session table - compact card layout */
    .ep-session-compact-card {
        background: white;
        border-radius: 0.75rem;
        padding: 0.75rem 1rem;
        margin-bottom: 0.75rem;
        border-left: 4px solid #3b82f6;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    }

    .ep-session-compact-card .session-title {
        font-weight: 600;
        font-size: 0.95rem;
        color: #1e293b;
        margin-bottom: 0.25rem;
    }

    .ep-session-compact-card .session-student {
        font-size: 0.8rem;
        color: #64748b;
        margin-bottom: 0.5rem;
    }

    /* Date/Time/Duration on SAME row */
    .ep-session-compact-card .session-meta {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        align-items: center;
        font-size: 0.75rem;
        color: #64748b;
        padding: 0.5rem 0;
        border-top: 1px solid #f1f5f9;
    }

    .ep-session-compact-card .session-meta-item {
        display: inline-flex;
        align-items: center;
        gap: 0.25rem;
        background: #f8fafc;
        padding: 0.25rem 0.5rem;
        border-radius: 0.375rem;
    }

    .ep-session-compact-card .session-status {
        margin-left: auto;
    }

    .ep-session-compact-card .session-actions {
        display: flex;
        justify-content: flex-end;
        gap: 0.5rem;
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px solid #f1f5f9;
    }

    /* Override default table row height */
    .ep-table tr {
        padding: 0.75rem;
        margin-bottom: 0.5rem;
    }

    /* Combine date/time/duration in mobile table cards */
    .ep-table td[data-label="Tarih"],
    .ep-table td[data-label="Saat"],
    .ep-table td[data-label="Süre"] {
        display: inline-flex;
        padding: 0.25rem;
        font-size: 0.75rem;
    }

    .ep-table td[data-label="Tarih"]::before,
    .ep-table td[data-label="Saat"]::before,
    .ep-table td[data-label="Süre"]::before {
        display: none;
    }

    /* Meta row for date/time/duration */
    .ep-session-meta-row {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.5rem 0 !important;
        border-bottom: none !important;
    }

    .ep-session-meta-row span {
        background: #f1f5f9;
        padding: 0.25rem 0.5rem;
        border-radius: 0.375rem;
        font-size: 0.75rem;
        color: #475569;
    }
}

/* ===== NOTIFICATION DROPDOWN MOBILE FIX ===== */
@media (max-width: 768px) {
    .ep-notification-bell {
        position: static !important;
    }

    .ep-notification-dropdown {
        position: fixed !important;
        left: 0.5rem !important;
        right: 0.5rem !important;
        top: 4rem !important;
        width: auto !important;
        max-width: none !important;
        transform: none !important;
    }
}

/* ===== PAGINATION STYLES ===== */
.ep-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
    margin-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.ep-pagination-info {
    color: #64748b;
    font-size: 0.875rem;
}

.ep-pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ep-pagination-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: white;
    color: #475569;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.ep-pagination-btn:hover:not(:disabled) {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.ep-pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ep-pagination-pages {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.ep-pagination-page {
    min-width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    background: white;
    color: #475569;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.ep-pagination-page:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.ep-pagination-page.active {
    background: #2563eb;
    border-color: #2563eb;
    color: white;
}

.ep-pagination-ellipsis {
    padding: 0 0.5rem;
    color: #94a3b8;
}

.ep-pagination-goto {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #64748b;
}

.ep-pagination-goto input {
    width: 60px;
    padding: 0.375rem 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    text-align: center;
    font-size: 0.875rem;
}

.ep-pagination-goto button {
    padding: 0.375rem 0.75rem;
    border: 1px solid #2563eb;
    border-radius: 0.375rem;
    background: #2563eb;
    color: white;
    font-size: 0.875rem;
    cursor: pointer;
}

.ep-pagination-goto button:hover {
    background: #1d4ed8;
}

/* Search Box Style */
.ep-search-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.ep-search-input {
    flex: 1;
    min-width: 200px;
    max-width: 400px;
    padding: 0.625rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.ep-search-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

@media (max-width: 768px) {
    .ep-pagination {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .ep-pagination-controls {
        justify-content: center;
        flex-wrap: wrap;
    }

    .ep-pagination-goto {
        justify-content: center;
    }
}

/* ===== PRINT STYLES ===== */
@media print {

    .ep-sidebar,
    .ep-hamburger,
    .ep-action-dropdown,
    .btn {
        display: none !important;
    }

    .ep-main {
        margin: 0;
    }

    .ep-table {
        display: table;
    }

    .ep-table thead {
        display: table-header-group;
    }

    .ep-table tr {
        display: table-row;
    }

    .ep-table td {
        display: table-cell;
    }
}

/* Notes Module Styles */

/* Tabs */
.ep-notes-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    background: var(--panel-bg-card, #f8fafc);
    padding: 0.75rem;
    border-radius: 0.75rem;
}

.ep-notes-tab {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.5rem;
    background: white;
    color: var(--panel-text-muted, #64748b);
    font-weight: 500;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.ep-notes-tab:hover {
    background-color: var(--panel-bg-hover, #f1f5f9);
    color: var(--panel-text-main, #334155);
}

.ep-notes-tab.active {
    background: #4f46e5;
    color: white;
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2);
}

/* Dark Mode Tabs */
html.dark-mode .ep-notes-tabs {
    background: var(--panel-bg-card, #1e293b);
}

html.dark-mode .ep-notes-tab {
    background: #0f172a;
    color: #94a3b8;
}

html.dark-mode .ep-notes-tab:hover {
    background: #334155;
    color: white;
}

html.dark-mode .ep-notes-tab.active {
    background: #4f46e5;
    color: white;
}

/* Note Cards */
.ep-note-card {
    border-radius: 0.75rem;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    position: relative;
    border-left-width: 4px;
    border-left-style: solid;
    background: white;
    /* Fallback */
}

.ep-note-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* Note typography */
.ep-note-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.4;
}

.ep-note-content {
    margin: 0 0 1rem 0;
    font-size: 0.875rem;
    color: #475569;
    line-height: 1.6;
    max-height: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
}

.ep-note-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding-top: 0.75rem;
    margin-top: 0.5rem;
}

.ep-note-date {
    font-size: 0.7rem;
    color: #94a3b8;
}

.ep-icon-btn.edit {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    cursor: pointer;
    color: #4f46e5;
    transition: background 0.2s;
}

.ep-icon-btn.delete {
    background: white;
    border: 1px solid #fee2e2;
    border-radius: 0.375rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    cursor: pointer;
    color: #dc2626;
    transition: background 0.2s;
}

/* Badge */
.ep-note-badge {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #1e293b;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

/* Color Variants */
/* Blue */
.ep-note-blue {
    background: #dbeafe;
    border-left-color: #3b82f6;
}

/* Green */
.ep-note-green {
    background: #dcfce7;
    border-left-color: #22c55e;
}

/* Purple */
.ep-note-purple {
    background: #e9d5ff;
    border-left-color: #a855f7;
}

/* Orange */
.ep-note-orange {
    background: #fed7aa;
    border-left-color: #f97316;
}

/* Pink */
.ep-note-pink {
    background: #fce7f3;
    border-left-color: #ec4899;
}

/* Yellow */
.ep-note-yellow {
    background: #fef08a;
    border-left-color: #eab308;
}

/* Indigo */
.ep-note-indigo {
    background: #c7d2fe;
    border-left-color: #6366f1;
}

/* Red */
.ep-note-red {
    background: #fee2e2;
    border-left-color: #ef4444;
}

/* Color Picker Buttons */
.ep-color-picker-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s;
    border: 2px solid #e5e7eb;
}

.ep-color-picker-btn.active {
    transform: scale(1.1);
    box-shadow: 0 0 0 2px white, 0 0 0 4px currentColor;
}

.ep-bg-blue {
    background: #dbeafe;
    color: #3b82f6;
}

.ep-bg-green {
    background: #dcfce7;
    color: #22c55e;
}

.ep-bg-purple {
    background: #e9d5ff;
    color: #a855f7;
}

.ep-bg-orange {
    background: #fed7aa;
    color: #f97316;
}

.ep-bg-pink {
    background: #fce7f3;
    color: #ec4899;
}

.ep-bg-yellow {
    background: #fef08a;
    color: #eab308;
}

.ep-bg-indigo {
    background: #c7d2fe;
    color: #6366f1;
}

.ep-bg-red {
    background: #fee2e2;
    color: #ef4444;
}


/* Dark Mode Overrides for Notes */
/* Strategy: Dark background, Colored borders, White text */

html.dark-mode .ep-note-card {
    background: #1e293b !important;
    /* Slate 800 */
    border-top: 1px solid #334155;
    border-right: 1px solid #334155;
    border-bottom: 1px solid #334155;
}

html.dark-mode .ep-note-title {
    color: #f1f5f9;
}

html.dark-mode .ep-note-content {
    color: #cbd5e1;
}

html.dark-mode .ep-note-date {
    color: #94a3b8;
}

html.dark-mode .ep-note-badge {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    border-color: rgba(255, 255, 255, 0.1);
}

html.dark-mode .ep-icon-btn {
    background: #0f172a !important;
    border-color: #334155 !important;
}

/* Specific Border Colors in Dark Mode */
html.dark-mode .ep-note-blue {
    border-left-color: #60a5fa !important;
}

html.dark-mode .ep-note-green {
    border-left-color: #4ade80 !important;
}

html.dark-mode .ep-note-purple {
    border-left-color: #c084fc !important;
}

html.dark-mode .ep-note-orange {
    border-left-color: #fb923c !important;
}

html.dark-mode .ep-note-pink {
    border-left-color: #f472b6 !important;
}

html.dark-mode .ep-note-yellow {
    border-left-color: #facc15 !important;
}

html.dark-mode .ep-note-indigo {
    border-left-color: #818cf8 !important;
}

html.dark-mode .ep-note-red {
    border-left-color: #f87171 !important;
}

/* Subtle Glow on Hover in Dark Mode */
html.dark-mode .ep-note-card:hover {
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.05);
}


/* Mobile Session Card Styles */
/* Mobile Session Card Styles */
.ep-session-mobile-card {
    /* display: block; - handled by ep-show-mobile-only in media query */
    background: var(--panel-bg-card, white);
    border: 1px solid var(--panel-border, #e2e8f0);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

html.dark-mode .ep-session-mobile-card {
    background: var(--panel-bg-card, #1e293b);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

.ep-mobile-card-header {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.ep-mobile-pill {
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.ep-mobile-pill.primary {
    background: #eff6ff;
    color: #3b82f6;
}

.ep-mobile-pill.secondary {
    background: #f1f5f9;
    color: #64748b;
}

html.dark-mode .ep-mobile-pill.primary {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

html.dark-mode .ep-mobile-pill.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

.ep-mobile-card-meta {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--panel-text-secondary, #64748b);
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--panel-border, #e2e8f0);
}

.ep-mobile-card-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.ep-mobile-card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ep-mobile-action-buttons {
    display: flex;
    gap: 0.5rem;
}

.ep-icon-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--panel-border, #e2e8f0);
    background: var(--panel-bg-card, white);
    color: var(--panel-text-secondary, #64748b);
    cursor: pointer;
    transition: all 0.2s;
}

html.dark-mode .ep-icon-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
}

/* Homework Card Styles - Premium Look */
.ep-homework-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.ep-homework-card {
    background: var(--panel-bg-card, white);
    border: 1px solid var(--panel-border, #e2e8f0);
    border-left-width: 4px;
    /* Status indicator */
    border-radius: 0.75rem;
    padding: 1.25rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.ep-homework-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

/* Status Variants - Light Mode defaults */
.ep-homework-card.approved {
    border-left-color: #10b981;
    background: linear-gradient(145deg, #ffffff 0%, #f0fdf4 100%);
}

.ep-homework-card.completed {
    border-left-color: #3b82f6;
    background: linear-gradient(145deg, #ffffff 0%, #eff6ff 100%);
}

.ep-homework-card.pending {
    border-left-color: #94a3b8;
    /* Neutral for normal pending */
    background: white;
}

.ep-homework-card.urgent {
    border-left-color: #f59e0b;
    background: linear-gradient(145deg, #ffffff 0%, #fffbeb 100%);
}

.ep-homework-card.overdue {
    border-left-color: #ef4444;
    background: linear-gradient(145deg, #ffffff 0%, #fef2f2 100%);
}

/* Card Typography */
.ep-homework-card h3 {
    color: var(--panel-text-main, #1e293b);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.ep-homework-card p.description {
    color: var(--panel-text-secondary, #64748b);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0.75rem 0;
}

.ep-homework-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: var(--panel-text-muted, #94a3b8);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--panel-border, #e2e8f0);
}

.ep-homework-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Result Box for Completed Tests */
.ep-homework-result {
    background: var(--panel-bg-main, #f8fafc);
    border: 1px solid var(--panel-border, #e2e8f0);
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Dark Mode Overrides for Cards */
html.dark-mode .ep-homework-card {
    background: var(--panel-bg-card, #1e293b);
    /* Dark card bg */
    border-color: var(--panel-border, rgba(255, 255, 255, 0.1));
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

html.dark-mode .ep-homework-card.approved {
    background: linear-gradient(145deg, rgba(16, 185, 129, 0.05) 0%, rgba(16, 185, 129, 0.1) 100%);
}

html.dark-mode .ep-homework-card.completed {
    background: linear-gradient(145deg, rgba(59, 130, 246, 0.05) 0%, rgba(59, 130, 246, 0.1) 100%);
}

html.dark-mode .ep-homework-card.pending {
    background: var(--panel-bg-card, #1e293b);
}

html.dark-mode .ep-homework-card.urgent {
    background: linear-gradient(145deg, rgba(245, 158, 11, 0.05) 0%, rgba(245, 158, 11, 0.1) 100%);
}

html.dark-mode .ep-homework-card.overdue {
    background: linear-gradient(145deg, rgba(239, 68, 68, 0.05) 0%, rgba(239, 68, 68, 0.1) 100%);
}

html.dark-mode .ep-homework-result {
    background: rgba(0, 0, 0, 0.2);
    /* Inset dark look */
    border-color: rgba(255, 255, 255, 0.05);
}

html.dark-mode .ep-homework-result strong {
    color: var(--panel-text-main, #e2e8f0);
}

/* Header Action Pills */
.ep-status-pill {
    padding: 0.25rem 0.6rem;
    border-radius: 1rem;
    font-size: 0.7rem;
    font-weight: 600;
}

.ep-status-pill.approved {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.ep-status-pill.completed {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.ep-status-pill.urgent {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.ep-status-pill.overdue {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.ep-status-pill.pending {
    background: var(--panel-bg-main, #f1f5f9);
    color: var(--panel-text-muted, #94a3b8);
}

html.dark-mode .ep-status-pill.pending {
    background: rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
}

/* Mobile Dark Mode Overrides (Appended for fixes) */
@media (max-width: 768px) {
    .ep-hamburger {
        background: var(--panel-bg-card, white) !important;
        border-color: var(--panel-border, #e2e8f0) !important;
    }

    .ep-hamburger span {
        background: var(--panel-text-main, #334155) !important;
    }

    .ep-main {
        background: var(--panel-bg-main, #f1f5f9) !important;
    }

    .ep-dashboard-header,
    .ep-stat-card,
    .ep-homework-card,
    .ep-session-item,
    .ep-widget,
    .ep-widget-card {
        background: var(--panel-bg-card, white) !important;
        border-color: var(--panel-border, transparent) !important;
        color: var(--panel-text-main) !important;
    }


    .ep-dashboard-header h1,
    .ep-dashboard-header h2,
    .ep-dashboard-title,
    .ep-section-title {
        color: var(--panel-text-main) !important;
    }
}

/* FORCE FIX: Mobile Card Internals (Dark Mode) */
html.dark-mode .ep-mobile-card-meta,
html.dark-mode .ep-mobile-card-header,
html.dark-mode .ep-mobile-card-actions {
    background: transparent !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #cbd5e1 !important;
}

html.dark-mode .ep-mobile-card-meta span {
    color: #cbd5e1 !important;
}

/* Ensure mobile session card TD is dark */
/* Ensure mobile session card TD is dark and borderless/dark-bordered */
html.dark-mode .ep-session-mobile-card {
    background: var(--panel-bg-card, #1e293b) !important;
    color: var(--panel-text-main, #e2e8f0) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    box-shadow: none !important;
}

/* Premium Dark Mode Pills */
html.dark-mode .ep-status-pill.approved {
    background: rgba(16, 185, 129, 0.2) !important;
    color: #34d399 !important;
}

html.dark-mode .ep-status-pill.completed {
    background: rgba(59, 130, 246, 0.2) !important;
    color: #60a5fa !important;
}

html.dark-mode .ep-status-pill.urgent {
    background: rgba(245, 158, 11, 0.2) !important;
    color: #fbbf24 !important;
}

html.dark-mode .ep-status-pill.overdue {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #f87171 !important;
}

html.dark-mode .ep-status-pill.pending {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #cbd5e1 !important;
}

/* Mobile Header Pills - Dark Mode Pop */
html.dark-mode .ep-mobile-pill.primary {
    background: rgba(59, 130, 246, 0.25) !important;
    color: #93c5fd !important;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

html.dark-mode .ep-mobile-pill.secondary {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #e2e8f0 !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* FIX: Table Rows in Mobile Dark Mode (Remove White Frame) */
@media (max-width: 768px) {

    html.dark-mode .ep-table tr,
    html.dark-mode .ep-table tbody,
    html.dark-mode .ep-table {
        background: transparent !important;
        box-shadow: none !important;
        border: none !important;
    }

    /* Ensure only the card has background */
    html.dark-mode .ep-session-mobile-card {
        background: var(--panel-bg-card, #1e293b) !important;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2) !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        margin-bottom: 1rem !important;
    }
}

/* Financial Badge Styles (Mobile) */
.ep-financial-badge {
    padding: 0.35rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    /* Larger text */
    font-weight: 700;
}

.ep-financial-badge.total {
    background: #dbeafe;
    color: #1d4ed8;
}

.ep-financial-badge.paid {
    background: #dcfce7;
    color: #16a34a;
}

.ep-financial-badge.remaining {
    background: #fee2e2;
    color: #dc2626;
}

html.dark-mode .ep-financial-badge.total {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

html.dark-mode .ep-financial-badge.paid {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

html.dark-mode .ep-financial-badge.remaining {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

/* Mobile Pill Font Size Bump */
.ep-mobile-pill {
    padding: 0.35rem 0.85rem !important;
}

/* Badge Contrast Fixes (Desktop & Mobile) */
.ep-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

.ep-badge.pending {
    background: #f1f5f9;
    color: #475569;
}

.ep-badge.paid {
    background: #dcfce7;
    color: #166534;
}

.ep-badge.completed {
    background: #eff6ff;
    color: #1e40af;
}

/* Used for Discount too */
.ep-badge.partial {
    background: #dbeafe;
    color: #1d4ed8;
}

/* Tailwind-like utility overrides for Discount/Change */
.bg-green-100 {
    background-color: #dcfce7 !important;
}

.text-green-800 {
    color: #166534 !important;
}

.bg-blue-100 {
    background-color: #dbeafe !important;
}

.text-blue-800 {
    color: #1e40af !important;
}

/* Dark Mode Badge Overrides */
html.dark-mode .ep-badge.pending {
    background: rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
}

html.dark-mode .ep-badge.paid {
    background: rgba(16, 185, 129, 0.2);
    color: #86efac;
}

html.dark-mode .ep-badge.completed {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

html.dark-mode .ep-badge.partial {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

html.dark-mode .bg-green-100 {
    background-color: rgba(16, 185, 129, 0.2) !important;
    color: #86efac !important;
}

html.dark-mode .text-green-800 {
    color: #86efac !important;
}

html.dark-mode .bg-blue-100 {
    background-color: rgba(59, 130, 246, 0.2) !important;
    color: #93c5fd !important;
}

html.dark-mode .text-blue-800 {
    color: #93c5fd !important;
}

/* Mobile Discount/Change Badge */
.ep-mobile-status-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    margin-left: 0.5rem;
}

.ep-mobile-status-badge.discount {
    background: #dcfce7;
    color: #166534;
}

.ep-mobile-status-badge.change {
    background: #dbeafe;
    color: #1e40af;
}

html.dark-mode .ep-mobile-status-badge.discount {
    background: rgba(16, 185, 129, 0.2);
    color: #86efac;
}

html.dark-mode .ep-mobile-status-badge.change {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

/* Statistics Module Card Integration */
.ep-stat-card-floating {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-radius: 1rem;
    padding: 1.25rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.ep-stat-card-floating:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.ep-stat-card-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e2e8f0;
}

.ep-stat-card-name {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
}

.ep-stat-card-role {
    font-size: 0.8rem;
    color: #64748b;
    display: block;
}

.ep-stat-card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.ep-stat-card-item {
    text-align: center;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 0.75rem;
}

.ep-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.ep-stat-label {
    font-size: 0.7rem;
    color: #64748b;
    margin-top: 0.25rem;
}

/* Dark Mode Overrides for Stats */
html.dark-mode .ep-stat-card-floating {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

html.dark-mode .ep-stat-card-name {
    color: #f1f5f9;
}

html.dark-mode .ep-stat-card-role,
html.dark-mode .ep-stat-label {
    color: #94a3b8;
}

html.dark-mode .ep-stat-card-item {
    background: #0f172a;
}

html.dark-mode .ep-stat-card-avatar {
    border-color: #334155;
}

/* Stats Detail Grid V2 - Force 4 columns on mobile as requested */
.ep-stats-detail-grid-v2 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .ep-stats-detail-grid-v2 {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 0.5rem !important;
    }

    .ep-stats-detail-grid-v2>div {
        padding: 0.75rem 0.25rem !important;
        /* Extremely compact padding */
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }

    .ep-stats-detail-grid-v2>div>div:first-child {
        font-size: 1.1rem !important;
        /* Smaller number */
    }

    .ep-stats-detail-grid-v2>div>div:last-child {
        font-size: 0.6rem !important;
        /* Smaller label */
        line-height: 1.1;
        white-space: normal;
        text-align: center;
        min-height: 2.2em;
        /* Ensure alignment if wrapping */
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Compact Summary Grid (Sessions, Duration, Homework) */
.ep-stats-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.ep-stats-summary-card {
    border-radius: 1rem;
    padding: 1rem;
    /* Compact padding */
    text-align: center;
    border: 1px solid transparent;
}

.ep-stats-summary-card.sessions {
    background: #e0e7ff;
    border-color: #c7d2fe;
}

.ep-stats-summary-card.duration {
    background: #ecfdf5;
    border-color: #d1fae5;
}

.ep-stats-summary-card.homework {
    background: #fffbeb;
    border-color: #fde68a;
}

.ep-stats-summary-card .value {
    font-size: 1.75rem;
    /* Slightly smaller than 2.5rem */
    font-weight: 700;
    margin-bottom: 0.25rem;
    line-height: 1.1;
}

.ep-stats-summary-card.sessions .value {
    color: #4338ca;
}

.ep-stats-summary-card.duration .value {
    color: #059669;
}

.ep-stats-summary-card.homework .value {
    color: #d97706;
}

.ep-stats-summary-card .value .unit {
    font-size: 1rem;
}

.ep-stats-summary-card .label {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.ep-stats-summary-card.sessions .label {
    color: #4f46e5;
}

.ep-stats-summary-card.duration .label {
    color: #10b981;
}

.ep-stats-summary-card.homework .label {
    color: #f59e0b;
}

.ep-stats-summary-card .subtext {
    font-size: 0.75rem;
    line-height: 1.2;
}

.ep-stats-summary-card.sessions .subtext {
    color: #6366f1;
}

.ep-stats-summary-card.duration .subtext {
    color: #34d399;
}

.ep-stats-summary-card.homework .subtext {
    color: #fbbf24;
}

@media (max-width: 768px) {
    .ep-stats-summary-grid {
        gap: 0.5rem !important;
    }

    .ep-stats-summary-card {
        padding: 0.75rem 0.25rem !important;
    }

    .ep-stats-summary-card .value {
        font-size: 1.5rem !important;
    }

    .ep-stats-summary-card .value .unit {
        display: block;
        font-size: 0.8rem;
    }

    .ep-stats-summary-card .label {
        font-size: 0.75rem !important;
        margin-bottom: 0.1rem;
        display: block;
        min-height: 2.2em;
        /* Align lines */
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .ep-stats-summary-card .subtext {
        font-size: 0.65rem !important;
        white-space: normal;
    }
}

/* DASHBOARD HEADER STYLES */
.ep-dashboard-header {
    margin-bottom: 2rem;
}

.ep-dashboard-header h1 {
    color: #1e293b;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.ep-dashboard-header .text-muted {
    color: #64748b;
    font-size: 1rem;
    margin: 0;
}

/* Dark Mode Dashboard Header */
html.dark-mode .ep-dashboard-header h1 {
    color: #f8fafc !important;
}

html.dark-mode .ep-dashboard-header .text-muted {
    color: #cbd5e1 !important;
}

/* Profile Dropdown Name */
.ep-profile-name {
    display: block;
}

html.dark-mode .ep-profile-name {
    color: #f1f5f9 !important;
}

/* User wants to see name, so we SHOW it on mobile too if space permits, or force it */
@media (max-width: 768px) {
    .ep-profile-name {
        display: block !important;
        font-size: 0.8rem !important;
        max-width: 100px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* Dark Mode Logo Effect */
html.dark-mode .ep-sidebar-brand {
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.15) 0%, transparent 60%);
    border-radius: 0.5rem;
    padding: 0.5rem;
}

html.dark-mode .ep-sidebar-brand img {
    /* Brightness increased, drop-shadow tightened to 1px for 'outline' effect */
    filter: brightness(1.3) drop-shadow(0 0 1px rgba(255, 255, 255, 0.5));
    transition: filter 0.3s ease;
}

/* STUDENT PERFORMANCE WIDGET STYLES */
.ep-stats-widget-v2 {
    background: #ffffff;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.ep-stats-widget-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.ep-stats-widget-icon {
    font-size: 1.5rem;
}

.ep-stats-widget-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: #1e293b;
}

.ep-stats-widget-body {
    display: grid;
    grid-template-columns: 1fr 200px;
    gap: 2rem;
}

.ep-stats-chart-area {
    height: 300px;
    width: 100%;
}

.ep-stats-metrics {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ep-metric-box {
    background: #f8fafc;
    border-radius: 0.75rem;
    padding: 1rem;
    text-align: center;
    border: 1px solid #e2e8f0;
}

.ep-metric-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.ep-metric-label {
    font-size: 0.8rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .ep-stats-widget-body {
        grid-template-columns: 1fr;
    }

    .ep-stats-chart-area {
        height: 250px;
    }

    .ep-stats-metrics {
        flex-direction: row;
    }

    .ep-metric-box {
        flex: 1;
    }
}

/* Dark Mode Overrides */
html.dark-mode .ep-stats-widget-v2 {
    background: #1e293b;
    border: 1px solid #334155;
}

html.dark-mode .ep-stats-widget-title {
    color: #f1f5f9;
}

html.dark-mode .ep-metric-box {
    background: #334155;
    /* Slightly lighter than card */
    border-color: #475569;
}

html.dark-mode .ep-metric-label {
    color: #cbd5e1;
}

/* Scroll Locking Utility */
body.ep-scroll-lock {
    overflow: hidden !important;
    height: 100vh !important;
    /* touch-action: none; REMOVED as it breaks child scrolling */
}

/* Ensure mobile sidebar is scrollable even when body is locked */
@media (max-width: 768px) {
    .ep-sidebar.open {
        overflow-y: hidden !important;
        /* Wrapper static */
        height: 100vh !important;
        position: fixed !important;
        top: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        z-index: 9999 !important;
        display: flex !important;
        flex-direction: column !important;
        background-color: #ffffff !important;
        /* Fix transparency */
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1) !important;
        width: 85% !important;
        /* Ensure it doesn't take full width if not intended, or 280px */
        max-width: 320px !important;
    }

    .ep-sidebar.open .ep-sidebar-nav {
        overflow-y: auto !important;
        flex: 1 !important;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        /* iOS Momentum */
        touch-action: pan-y;
        padding-bottom: 5rem;
        /* More space for safe area */
    }
}

html.dark-mode .ep-sidebar.open {
    background-color: #1e293b !important;
    border-right: 1px solid #334155 !important;
}

/* ================================================================
   COMPREHENSIVE DARK MODE OVERRIDES
   Covers: Modals, Forms, Dropdowns, Tabs, Badges, Homework,
   WeeklySchedule, Subscription, and remaining light backgrounds
   ================================================================ */

/* --- Modals --- */
html.dark-mode .ep-modal {
    background: var(--panel-bg-card, #1e293b) !important;
    color: var(--panel-text-main, #e2e8f0) !important;
    border: 1px solid var(--panel-border, #334155);
}

html.dark-mode .ep-modal-header {
    background: var(--panel-bg-card, #1e293b) !important;
    border-bottom-color: var(--panel-border, #334155) !important;
}

html.dark-mode .ep-modal-header h3 {
    color: var(--panel-text-main, #f1f5f9) !important;
}

html.dark-mode .ep-modal-body {
    color: var(--panel-text-main, #e2e8f0) !important;
}

html.dark-mode .ep-modal-body p,
html.dark-mode .ep-modal-body span,
html.dark-mode .ep-modal-body div,
html.dark-mode .ep-modal-body label {
    color: var(--panel-text-main, #cbd5e1) !important;
}

html.dark-mode .ep-modal-body strong {
    color: #f1f5f9 !important;
}

html.dark-mode .ep-close-btn {
    color: #94a3b8 !important;
}

html.dark-mode .ep-close-btn:hover {
    color: #f1f5f9 !important;
}

/* --- Forms & Inputs --- */
html.dark-mode .ep-form-group label {
    color: var(--panel-text-main, #cbd5e1) !important;
}

html.dark-mode .ep-form-control,
html.dark-mode .ep-modal-body input,
html.dark-mode .ep-modal-body select,
html.dark-mode .ep-modal-body textarea {
    background: #0f172a !important;
    color: #e2e8f0 !important;
    border-color: #475569 !important;
}

html.dark-mode .ep-form-control:focus,
html.dark-mode .ep-modal-body input:focus,
html.dark-mode .ep-modal-body select:focus,
html.dark-mode .ep-modal-body textarea:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2) !important;
}

html.dark-mode .ep-form-control::placeholder,
html.dark-mode .ep-modal-body input::placeholder,
html.dark-mode .ep-modal-body textarea::placeholder {
    color: #64748b !important;
}

html.dark-mode .ep-label {
    color: var(--panel-text-main, #cbd5e1) !important;
}

/* --- Tabs --- */
html.dark-mode .ep-tabs {
    border-bottom-color: var(--panel-border, #334155) !important;
}

html.dark-mode .ep-tab {
    color: #94a3b8 !important;
}

html.dark-mode .ep-tab:hover {
    color: #e2e8f0 !important;
}

html.dark-mode .ep-tab.active {
    color: #60a5fa !important;
    border-bottom-color: #3b82f6 !important;
}

/* --- Filter Buttons --- */
html.dark-mode .ep-filter-btn {
    background: var(--panel-bg-card, #1e293b) !important;
    border-color: var(--panel-border, #334155) !important;
    color: #94a3b8 !important;
}

html.dark-mode .ep-filter-btn:hover {
    background: #334155 !important;
    color: #e2e8f0 !important;
}

html.dark-mode .ep-filter-btn.active {
    background: #2563eb !important;
    border-color: #2563eb !important;
    color: #ffffff !important;
}

/* --- Button Outline Dark Mode --- */
html.dark-mode .btn-outline {
    border-color: #475569 !important;
    color: #94a3b8 !important;
}

html.dark-mode .btn-outline:hover {
    background: #334155 !important;
    color: #e2e8f0 !important;
}

/* --- Action Dropdown Menu --- */
html.dark-mode .ep-action-dropdown-menu {
    background: var(--panel-bg-card, #1e293b) !important;
    border: 1px solid var(--panel-border, #334155) !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4) !important;
}

html.dark-mode .ep-action-dropdown-menu button {
    color: #cbd5e1 !important;
}

html.dark-mode .ep-action-dropdown-menu button:hover {
    background: #334155 !important;
}

/* --- Homework: "Kaynağa Git" Resource Link Button --- */
html.dark-mode .ep-homework-card a[href][style*="eff6ff"],
html.dark-mode .ep-homework-card a[style*="backgroundColor"] {
    background-color: rgba(37, 99, 235, 0.15) !important;
    color: #60a5fa !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
}

/* --- Homework Card Headings & Description in Dark Mode --- */
html.dark-mode .ep-homework-card h3 {
    color: #f1f5f9 !important;
}

html.dark-mode .ep-homework-card .description {
    color: #94a3b8 !important;
}

html.dark-mode .ep-homework-meta {
    color: #94a3b8 !important;
}

html.dark-mode .ep-homework-meta span {
    color: #94a3b8 !important;
}

/* --- Homework Detail Modal Inner Panels --- */
html.dark-mode .ep-modal-body div[style*="f8fafc"],
html.dark-mode .ep-modal-body div[style*="f1f5f9"],
html.dark-mode .ep-modal-body div[style*="f0fdf4"] {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: var(--panel-border, #334155) !important;
}

html.dark-mode .ep-modal-body div[style*="f8fafc"] h4,
html.dark-mode .ep-modal-body div[style*="f1f5f9"] h4,
html.dark-mode .ep-modal-body div[style*="f0fdf4"] h4 {
    color: #f1f5f9 !important;
}

html.dark-mode .ep-modal-body hr {
    border-top-color: #334155 !important;
}

/* --- Homework: Approval Modal Success Rate Slider Panel --- */
html.dark-mode .ep-modal-body div[style*="linear-gradient(135deg, #f8fafc"] {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.1) 100%) !important;
    border-color: var(--panel-border, #334155) !important;
}

html.dark-mode .ep-modal-body div[style*="borderTop: '1px solid #e2e8f0'"] {
    border-top-color: #334155 !important;
}

/* --- Homework: Coach Teacher Select Panel --- */
html.dark-mode .ep-modal-body div[style*="f0fdf4"] {
    background: rgba(16, 185, 129, 0.1) !important;
    border-color: rgba(16, 185, 129, 0.2) !important;
}

html.dark-mode .ep-modal-body div[style*="f0fdf4"] label {
    color: #34d399 !important;
}

/* --- Badges Dark Mode Enhancements --- */
html.dark-mode .ep-badge.paid,
html.dark-mode .ep-badge.completed,
html.dark-mode .ep-badge.approved {
    background: rgba(16, 185, 129, 0.2) !important;
    color: #34d399 !important;
}

html.dark-mode .ep-badge.pending,
html.dark-mode .ep-badge.scheduled {
    background: rgba(245, 158, 11, 0.2) !important;
    color: #fbbf24 !important;
}

html.dark-mode .ep-badge.partial {
    background: rgba(59, 130, 246, 0.2) !important;
    color: #60a5fa !important;
}

html.dark-mode .ep-badge.overdue {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #f87171 !important;
}

/* NET Badge */
html.dark-mode .ep-net-badge {
    color: #60a5fa !important;
}

/* --- DataTable Component Dark Mode --- */
html.dark-mode .ep-datatable-wrap,
html.dark-mode [class*="datatable"] {
    background: var(--panel-bg-card, #1e293b) !important;
    border-color: var(--panel-border, #334155) !important;
}

html.dark-mode .ep-datatable-wrap th {
    background: var(--panel-bg-main, #0f172a) !important;
    color: #94a3b8 !important;
    border-bottom-color: var(--panel-border, #334155) !important;
}

html.dark-mode .ep-datatable-wrap td {
    color: var(--panel-text-main, #e2e8f0) !important;
    border-bottom-color: var(--panel-border, #334155) !important;
}

html.dark-mode .ep-datatable-wrap tr:hover td {
    background: rgba(255, 255, 255, 0.03) !important;
}

/* --- WeeklySchedule Dark Mode --- */
html.dark-mode div[style*="background: 'white'"],
html.dark-mode div[style*="background:'white'"] {
    background: var(--panel-bg-card, #1e293b) !important;
}

/* --- Subscription Module Dark Mode --- */
html.dark-mode div[style*="background: '#fff'"],
html.dark-mode div[style*="background:'#fff'"],
html.dark-mode div[style*="background: '#f8fafc'"],
html.dark-mode div[style*="background:'#f8fafc'"],
html.dark-mode div[style*="background: '#eff6ff'"],
html.dark-mode div[style*="backgroundColor: '#f8fafc'"],
html.dark-mode div[style*="backgroundColor: '#eff6ff'"] {
    background: rgba(255, 255, 255, 0.05) !important;
}

html.dark-mode div[style*="border: '1px solid #e2e8f0'"],
html.dark-mode div[style*="border: '1px solid #cbd5e1'"] {
    border-color: var(--panel-border, #334155) !important;
}

/* --- Pagination Dark Mode --- */
html.dark-mode .ep-pagination button {
    background: var(--panel-bg-card, #1e293b) !important;
    color: #94a3b8 !important;
    border-color: var(--panel-border, #334155) !important;
}

html.dark-mode .ep-pagination button:hover {
    background: #334155 !important;
    color: #e2e8f0 !important;
}

html.dark-mode .ep-pagination button.active {
    background: #2563eb !important;
    color: white !important;
}

html.dark-mode .ep-pagination span {
    color: #94a3b8 !important;
}

/* --- Text helpers that may be hardcoded --- */
html.dark-mode .text-muted {
    color: #94a3b8 !important;
}

html.dark-mode h4[style*="color: '#1e293b'"],
html.dark-mode label[style*="color: '#334155'"],
html.dark-mode label[style*="color: '#1e293b'"] {
    color: #f1f5f9 !important;
}

/* --- Widget Filter Dark Mode --- */
html.dark-mode .ep-widget-filter {
    background: var(--panel-bg-card, #1e293b) !important;
    border-color: var(--panel-border, #334155) !important;
    color: #94a3b8 !important;
}

html.dark-mode .ep-widget-filter:hover {
    background: #334155 !important;
    color: #e2e8f0 !important;
}

/* --- Support Module Dark Mode --- */
html.dark-mode div[style*="var(--card-bg, #f8fafc)"] {
    background: rgba(255, 255, 255, 0.05) !important;
}

/* --- ep-icon-btn w/o explicit bg should get dark bg --- */
html.dark-mode .ep-icon-btn:not([style*="background"]) {
    background: #334155 !important;
    color: #e2e8f0 !important;
}

/* --- Empty State --- */
html.dark-mode .ep-empty {
    color: #94a3b8 !important;
}

/* --- Select option dark mode --- */
html.dark-mode select option {
    background: #1e293b;
    color: #e2e8f0;
}

/* ================================================================
   NEW CLASSES: Resource Link, Dropdown Items, Action Menu
   ================================================================ */

/* Resource Link (Kaynağa Git button) */
.ep-resource-link {
    background-color: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
    transition: all 0.2s;
}

.ep-resource-link:hover {
    background-color: #dbeafe;
    color: #1d4ed8;
}

html.dark-mode .ep-resource-link {
    background-color: rgba(37, 99, 235, 0.15) !important;
    color: #60a5fa !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
}

html.dark-mode .ep-resource-link:hover {
    background-color: rgba(37, 99, 235, 0.25) !important;
    color: #93c5fd !important;
}

/* Dropdown Item (hover effect for action menus) */
.ep-dropdown-item {
    transition: background 0.15s ease;
    color: inherit;
}

.ep-dropdown-item:hover {
    background: #f1f5f9 !important;
}

html.dark-mode .ep-dropdown-item {
    color: #cbd5e1 !important;
}

html.dark-mode .ep-dropdown-item:hover {
    background: #334155 !important;
}

/* Keep explicit colors for WhatsApp and danger items */
html.dark-mode .ep-dropdown-item[style*="25D366"] {
    color: #34d399 !important;
}

html.dark-mode .ep-dropdown-item[style*="dc2626"] {
    color: #f87171 !important;
}

html.dark-mode .ep-dropdown-item[style*="16a34a"] {
    color: #34d399 !important;
}

/* Action Dropdown Menu Container */
.ep-action-dropdown-menu {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    z-index: 50;
}

html.dark-mode .ep-action-dropdown-menu {
    background: var(--panel-bg-card, #1e293b) !important;
    border-color: var(--panel-border, #334155) !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4) !important;
}

/* TeachersModule Mobile Card Dark Mode */
html.dark-mode .ep-teacher-mobile-card {
    background: var(--panel-bg-card, #1e293b) !important;
    border-color: var(--panel-border, #334155) !important;
    color: var(--panel-text-main, #e2e8f0) !important;
}

/* ================================================================
   SUPPORT MODULE - Dark Mode & Mobile Responsive
   ================================================================ */

/* Status Badges */
.ep-support-badge-open {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.ep-support-badge-closed {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
}

html.dark-mode .ep-support-badge-open {
    background: rgba(34, 197, 94, 0.2) !important;
    color: #4ade80 !important;
}

html.dark-mode .ep-support-badge-closed {
    background: rgba(148, 163, 184, 0.2) !important;
    color: #cbd5e1 !important;
}

/* Support Form Card - Dark Mode */
html.dark-mode .ep-support-form-card {
    background: var(--panel-bg-card, #1e293b) !important;
    border-color: var(--panel-border, #334155) !important;
}

html.dark-mode .ep-support-form-card label {
    color: var(--panel-text-main, #e2e8f0) !important;
}

html.dark-mode .ep-support-form-card input,
html.dark-mode .ep-support-form-card select,
html.dark-mode .ep-support-form-card textarea {
    background: var(--panel-bg-main, #0f172a) !important;
    color: var(--panel-text-main, #e2e8f0) !important;
    border-color: var(--panel-border, #334155) !important;
}

html.dark-mode .ep-support-form-card input:focus,
html.dark-mode .ep-support-form-card textarea:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2) !important;
}

html.dark-mode .ep-support-form-card input::placeholder,
html.dark-mode .ep-support-form-card textarea::placeholder {
    color: #64748b !important;
}

/* Upload Zone Dark Mode */
html.dark-mode .ep-support-form-card div[style*="dashed"] {
    border-color: #475569 !important;
    color: #94a3b8 !important;
    background: rgba(255, 255, 255, 0.03) !important;
}

html.dark-mode .ep-support-form-card div[style*="dashed"] span {
    color: #cbd5e1 !important;
}

html.dark-mode .ep-support-form-card div[style*="dashed"]:hover {
    border-color: #3b82f6 !important;
    background: rgba(59, 130, 246, 0.05) !important;
}

/* Support Tickets Container - Dark Mode */
html.dark-mode .ep-support-tickets {
    background: var(--panel-bg-card, #1e293b) !important;
    border-color: var(--panel-border, #334155) !important;
}

html.dark-mode .ep-support-tickets p {
    color: var(--panel-text-muted, #94a3b8) !important;
}

/* Ticket Card Hover */
html.dark-mode .ep-support-tickets div[style*="cursor: pointer"] {
    border-color: var(--panel-border, #334155) !important;
}

html.dark-mode .ep-support-tickets div[style*="cursor: pointer"]:hover {
    background: rgba(255, 255, 255, 0.03) !important;
    border-color: #475569 !important;
}

/* Support Mobile Responsive */
@media (max-width: 768px) {
    .ep-support-form-card {
        padding: 1.25rem !important;
    }

    .ep-support-form-card form>div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    .ep-support-tickets {
        padding: 1rem !important;
    }
}

/* ================================================================
   HOMEWORK TABLE - NET Badge & Title Overflow
   ================================================================ */

/* Table responsive wrapper */
.ep-table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

/* Override: allow dropdown overflow when action menus present */
.ep-table-responsive:has(.ep-action-dropdown) {
    overflow: visible !important;
    overflow-x: visible !important;
}

/* Homework title cell - truncate long titles (applied via className) */
.ep-title-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ep-title-cell:hover {
    white-space: normal;
    word-break: break-word;
    overflow: visible;
}

/* NET Badge - Light Mode */
.ep-net-badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.8rem;
    background: rgba(21, 128, 61, 0.18) !important;
    color: #166534 !important;
    border: 1px solid rgba(21, 128, 61, 0.3);
    white-space: nowrap;
}

/* NET Badge - Dark Mode */
html.dark-mode .ep-net-badge {
    background: rgba(34, 197, 94, 0.2) !important;
    color: #4ade80 !important;
    border-color: rgba(34, 197, 94, 0.4) !important;
}

/* Review tab action badges - Dark Mode */
html.dark-mode .ep-badge.approved[style*="dcfce7"] {
    background: rgba(34, 197, 94, 0.2) !important;
    color: #4ade80 !important;
}

html.dark-mode .ep-badge.overdue[style*="fee2e2"] {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #f87171 !important;
}

/* ================================================================
   PANEL-WIDE DARK MODE CONTRAST FIXES
   Uses className-based selectors (not attribute selectors,
   which fail because React renders rgb() not hex)
   ================================================================ */

/* --- FINANCIALS MODULE --- */

/* Balance card header divider */
html.dark-mode .ep-balance-divider {
    border-bottom-color: var(--panel-border, #334155) !important;
}

html.dark-mode .ep-balance-label,
html.dark-mode .ep-balance-label span {
    color: #e2e8f0 !important;
}

/* Progress bar track */
html.dark-mode .ep-progress-track {
    background-color: #334155 !important;
}

/* --- WEEKLY SCHEDULE MODULE --- */

/* Desktop day column card */
html.dark-mode .ep-day-column {
    background: var(--panel-bg-card, #1e293b) !important;
    border-color: var(--panel-border, #334155) !important;
}

/* Day column body (events area) */
html.dark-mode .ep-day-column-body {
    background: var(--panel-bg-card, #1e293b) !important;
}

/* Homework status badges in schedule (#dcfce7, #dbeafe, etc.) */
html.dark-mode .ep-hw-status-badge {
    opacity: 0.9;
}

/* Section header icons (⏳ and ✓) */
html.dark-mode .ep-section-icon {
    background: rgba(255, 255, 255, 0.1) !important;
}

/* Section header text ("Bekleyen Ödevler", "Tamamlanan / Onaylanan Ödevler") */
html.dark-mode .ep-section-header,
html.dark-mode .ep-section-header .title-text,
html.dark-mode .ep-section-header .count {
    color: #e2e8f0 !important;
}

/* Empty state boxes */
html.dark-mode .ep-empty-state-box {
    background: var(--panel-bg-card, #1e293b) !important;
    color: var(--panel-text-main, #e2e8f0) !important;
    border-color: var(--panel-border, #334155) !important;
}

/* Stat boxes */
html.dark-mode .ep-stat-box .ep-stat-lbl {
    color: rgba(255, 255, 255, 0.85) !important;
}

/* Schedule cards (homework section) */
html.dark-mode .ep-schedule-card {
    background: var(--panel-bg-card, #1e293b) !important;
    border-color: var(--panel-border, #334155) !important;
}

/* --- NOTES MODULE --- */

/* Note card dark mode - override light pastel backgrounds */
html.dark-mode .ep-note-card {
    background: var(--panel-bg-card, #1e293b) !important;
    border-color: var(--panel-border, #334155) !important;
}

/* Note card color variants - keep left border color, darken bg */
html.dark-mode .ep-note-blue {
    background: rgba(59, 130, 246, 0.08) !important;
}

html.dark-mode .ep-note-green {
    background: rgba(34, 197, 94, 0.08) !important;
}

html.dark-mode .ep-note-purple {
    background: rgba(168, 85, 247, 0.08) !important;
}

html.dark-mode .ep-note-orange {
    background: rgba(249, 115, 22, 0.08) !important;
}

html.dark-mode .ep-note-pink {
    background: rgba(236, 72, 153, 0.08) !important;
}

html.dark-mode .ep-note-yellow {
    background: rgba(234, 179, 8, 0.08) !important;
}

html.dark-mode .ep-note-indigo {
    background: rgba(99, 102, 241, 0.08) !important;
}

html.dark-mode .ep-note-red {
    background: rgba(239, 68, 68, 0.08) !important;
}

/* Note content text */
html.dark-mode .ep-note-content {
    color: var(--panel-text-muted, #94a3b8) !important;
}

/* Note related link */
html.dark-mode .ep-note-related {
    color: #94a3b8 !important;
}

/* Note date */
html.dark-mode .ep-note-date {
    color: #64748b !important;
}

/* Note badge (share count) */
html.dark-mode .ep-note-badge {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #cbd5e1 !important;
}

/* Notes tab buttons */
html.dark-mode .ep-notes-tab {
    background: var(--panel-bg-card, #1e293b) !important;
    color: var(--panel-text-main, #e2e8f0) !important;
    border-color: var(--panel-border, #334155) !important;
}

html.dark-mode .ep-notes-tab.active {
    background: var(--primary-color, #6366f1) !important;
    color: white !important;
    border-color: var(--primary-color, #6366f1) !important;
}

/* Sharing section in notes modal */
html.dark-mode .ep-note-share-section {
    background: rgba(255, 255, 255, 0.05) !important;
}

/* Checkbox lists in notes modal */
html.dark-mode .ep-note-checklist {
    background: var(--panel-bg-main, #0f172a) !important;
    border-color: var(--panel-border, #334155) !important;
    color: var(--panel-text-main, #e2e8f0) !important;
}

/* --- UTILITY CLASS OVERRIDES --- */
html.dark-mode .bg-gray-50,
html.dark-mode .bg-gray-100 {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

html.dark-mode .bg-green-100 {
    background-color: rgba(34, 197, 94, 0.15) !important;
}

html.dark-mode .text-green-800 {
    color: #4ade80 !important;
}

html.dark-mode .bg-blue-100 {
    background-color: rgba(59, 130, 246, 0.15) !important;
}

html.dark-mode .text-blue-800 {
    color: #60a5fa !important;
}

html.dark-mode .text-red-500 {
    color: #f87171 !important;
}

/* --- Mobile card borders in dark mode --- */
html.dark-mode .ep-session-mobile-card {
    border-color: var(--panel-border, #334155) !important;
}

/* --- ep-text-muted ensure readable on dark bg --- */
html.dark-mode .ep-text-muted {
    color: #94a3b8 !important;
}

/* --- Disabled input in dark mode --- */
html.dark-mode input[disabled],
html.dark-mode input.bg-gray-100[disabled] {
    background-color: #1e293b !important;
    color: #94a3b8 !important;
    border-color: #334155 !important;
}

/* ================================================================
   PROFILE MODULE - DARK MODE
   ================================================================ */

/* FormGroup main container */
html.dark-mode .ep-profile-form-group {
    background: var(--panel-bg-card, #1e293b) !important;
    border-color: var(--panel-border, #334155) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

/* FormGroup header divider */
html.dark-mode .ep-profile-form-header {
    border-bottom-color: var(--panel-border, #334155) !important;
}

/* FormGroup title text */
html.dark-mode .ep-profile-form-title {
    color: #e2e8f0 !important;
}

/* FormGroup icon badge */
html.dark-mode .ep-profile-form-icon {
    background: rgba(59, 130, 246, 0.15) !important;
    color: #60a5fa !important;
}

/* Avatar ring */
html.dark-mode .ep-dashboard div[style*="borderRadius"][style*="50%"] {
    border-color: var(--panel-border, #334155) !important;
}

/* Username box */
html.dark-mode .ep-profile-username-box {
    background: rgba(255, 255, 255, 0.05) !important;
}

/* Template section sidebar */
html.dark-mode .ep-profile-template-section {
    background: rgba(255, 255, 255, 0.05) !important;
}

/* Template section select */
html.dark-mode .ep-profile-template-section select {
    background: var(--panel-bg-main, #0f172a) !important;
    color: var(--panel-text-main, #e2e8f0) !important;
    border-color: var(--panel-border, #334155) !important;
}

/* Public profile info box */
html.dark-mode .ep-profile-info-box {
    background: rgba(59, 130, 246, 0.1) !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
}

html.dark-mode .ep-profile-info-text {
    color: #93c5fd !important;
}

/* Privacy controls box */
html.dark-mode .ep-profile-privacy-box {
    background: var(--panel-bg-main, #0f172a) !important;
    border-color: var(--panel-border, #334155) !important;
}

/* Privacy text */
html.dark-mode .ep-profile-privacy-text {
    color: #cbd5e1 !important;
}

html.dark-mode .ep-profile-privacy-strong {
    color: #e2e8f0 !important;
}

html.dark-mode .ep-profile-privacy-desc {
    color: #94a3b8 !important;
}

/* Privacy toggle label (Açık / Gizli) */
html.dark-mode .ep-profile-privacy-label {
    color: #4ade80 !important;
}

/* Copy button */
html.dark-mode .ep-profile-copy-btn {
    background: rgba(255, 255, 255, 0.1) !important;
    color: var(--panel-text-main, #e2e8f0) !important;
}

/* Teaching approach highlight */
html.dark-mode .ep-profile-teaching-highlight {
    background: rgba(59, 130, 246, 0.1) !important;
}

html.dark-mode .ep-profile-teaching-highlight span {
    color: #93c5fd !important;
}

/* Education placeholder */
html.dark-mode .ep-profile-edu-placeholder {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #94a3b8 !important;
}

/* Section dividers (password, delete) */
html.dark-mode .ep-profile-section-divider {
    border-top-color: var(--panel-border, #334155) !important;
}

/* Section titles (e.g., Şifre Değiştir) */
html.dark-mode .ep-profile-section-title {
    color: #e2e8f0 !important;
}

/* Profile form inputs, selects, textareas */
html.dark-mode .ep-profile-form-group input:not([type="checkbox"]):not([type="file"]),
html.dark-mode .ep-profile-form-group textarea,
html.dark-mode .ep-profile-form-group select {
    background: var(--panel-bg-main, #0f172a) !important;
    color: var(--panel-text-main, #e2e8f0) !important;
    border-color: var(--panel-border, #334155) !important;
}

/* Profile form labels */
html.dark-mode .ep-profile-form-group label {
    color: #cbd5e1 !important;
}

/* Password change form inputs + labels */
html.dark-mode .ep-profile-section-divider input:not([type="checkbox"]) {
    background: var(--panel-bg-main, #0f172a) !important;
    color: var(--panel-text-main, #e2e8f0) !important;
    border-color: var(--panel-border, #334155) !important;
}

html.dark-mode .ep-profile-section-divider label {
    color: #cbd5e1 !important;
}

/* Experience input fields */
html.dark-mode .ep-profile-form-group input[placeholder="Kurum"],
html.dark-mode .ep-profile-form-group input[placeholder="Pozisyon"],
html.dark-mode .ep-profile-form-group input[placeholder="Yıl/Süre"] {
    background: var(--panel-bg-main, #0f172a) !important;
    color: var(--panel-text-main, #e2e8f0) !important;
    border-color: var(--panel-border, #334155) !important;
}

/* Experience delete button */
html.dark-mode .ep-profile-form-group button[style*="fee2e2"] {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #f87171 !important;
}

/* Student form (simple profile) */
html.dark-mode .ep-dashboard .ep-input-wrapper input,
html.dark-mode .ep-dashboard .ep-input-wrapper label {
    color: var(--panel-text-main, #e2e8f0);
}

/* Mobile responsive - ensure all profile elements work on mobile */
@media (max-width: 768px) {
    html.dark-mode .ep-profile-form-group {
        padding: 1rem !important;
    }
}

/* ================================================================
   SUBSCRIPTION MODULE - DARK MODE
   ================================================================ */

/* Toggle Button */
html.dark-mode .ep-billing-toggle {
    background: var(--panel-bg-card, #1e293b) !important;
    border-color: var(--panel-border, #334155) !important;
    color: var(--panel-text-main, #e2e8f0) !important;
}

/* Billing Form Container */
html.dark-mode .ep-billing-form {
    background: var(--panel-bg-card, #1e293b) !important;
    box-shadow: none !important;
}

/* Info Box */
html.dark-mode .ep-billing-info {
    background: rgba(59, 130, 246, 0.1) !important;
    border-left-color: #3b82f6 !important;
    color: #93c5fd !important;
}

/* Form Labels */
html.dark-mode .ep-billing-form-group label {
    color: #cbd5e1 !important;
}

/* Inputs, Textareas, Selects */
html.dark-mode .ep-billing-form-group input:not([type="radio"]):not([type="checkbox"]),
html.dark-mode .ep-billing-form-group textarea,
html.dark-mode .ep-billing-form-group select {
    background: var(--panel-input-bg, #0f172a) !important;
    border-color: var(--panel-border, #334155) !important;
    color: var(--panel-text-main, #e2e8f0) !important;
}

/* Radio & Checkbox Containers */
html.dark-mode .ep-billing-radio,
html.dark-mode .ep-billing-checkbox {
    border-color: var(--panel-border, #334155) !important;
    color: var(--panel-text-main, #e2e8f0) !important;
}

/* Radio Selected State (overriding inline #e2e8f0) */
html.dark-mode .ep-billing-radio[style*="background: rgb(226, 232, 240)"],
html.dark-mode .ep-billing-radio[style*="background: #e2e8f0"] {
    background: #334155 !important;
    border-color: #475569 !important;
}

/* Radio Unselected State (overriding inline #f8fafc) */
html.dark-mode .ep-billing-radio[style*="background: rgb(248, 250, 252)"],
html.dark-mode .ep-billing-radio[style*="background: #f8fafc"] {
    background: transparent !important;
    border-color: var(--panel-border, #334155) !important;
}

/* Checkbox Selected State (overriding inline #f0fdf4) */
html.dark-mode .ep-billing-checkbox[style*="background: rgb(240, 253, 244)"],
html.dark-mode .ep-billing-checkbox[style*="background: #f0fdf4"] {
    background: rgba(34, 197, 94, 0.1) !important;
    border-color: rgba(34, 197, 94, 0.3) !important;
}

/* Checkbox Unselected State (overriding inline #f8fafc) */
html.dark-mode .ep-billing-checkbox[style*="background: rgb(248, 250, 252)"],
html.dark-mode .ep-billing-checkbox[style*="background: #f8fafc"] {
    background: transparent !important;
    border-color: var(--panel-border, #334155) !important;
}

/* Inner text spans */
html.dark-mode .ep-billing-checkbox span,
html.dark-mode .ep-billing-radio span {
    color: var(--panel-text-main, #e2e8f0) !important;
}

/* ================================================================
   SUPPORT MODULE - DARK MODE (Hardcoded for guaranteed contrast)
   ================================================================ */

/* Support Chat Container */
html.dark-mode .ep-support-chat {
    background: #0f172a !important;
    border-color: #334155 !important;
}

/* Admin Bubble - FORCE high contrast: light text on dark bg */
html.dark-mode .ep-support-bubble-admin {
    background: #1e293b !important;
    color: #f1f5f9 !important;
    border: 1px solid #475569 !important;
}

/* Force ALL children inside admin bubble to inherit light text */
html.dark-mode .ep-support-bubble-admin * {
    color: inherit !important;
    opacity: 1 !important;
}

/* Admin bubble timestamp - slightly muted but still readable */
html.dark-mode .ep-support-bubble-admin div:last-child {
    color: #94a3b8 !important;
}

/* User Bubble (Blue) - Ensure white text */
html.dark-mode .ep-support-bubble-user {
    color: #ffffff !important;
}

html.dark-mode .ep-support-bubble-user * {
    color: inherit !important;
}

html.dark-mode .ep-support-bubble-user div:last-child {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* Ticket Card */
html.dark-mode .ep-support-ticket-card {
    background: #1e293b !important;
    border-color: #475569 !important;
}

/* Subject text - bright white */
html.dark-mode .ep-support-ticket-card span {
    color: #f1f5f9 !important;
}

/* Meta row (date, reply count) - lighter muted */
html.dark-mode .ep-support-ticket-card div:last-child {
    color: #cbd5e1 !important;
}

html.dark-mode .ep-support-ticket-card div:last-child span {
    color: #cbd5e1 !important;
}

html.dark-mode .ep-support-ticket-card:hover {
    background: #253349 !important;
    border-color: #3b82f6 !important;
}

/* Status Badge */
html.dark-mode .ep-support-badge-open {
    background: rgba(34, 197, 94, 0.15) !important;
    color: #4ade80 !important;
}

html.dark-mode .ep-support-badge-closed {
    background: rgba(148, 163, 184, 0.15) !important;
    color: #94a3b8 !important;
}

/* Form Card */
html.dark-mode .ep-support-form-card {
    background: #1e293b !important;
    border-color: #334155 !important;
}

html.dark-mode .ep-support-form-card label {
    color: #e2e8f0 !important;
}

/* Tickets Container */
html.dark-mode .ep-support-tickets {
    background: #1e293b !important;
    border-color: #334155 !important;
}

/* Inputs & Textareas */
html.dark-mode .ep-support-input {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

html.dark-mode .ep-support-input:focus {
    border-color: #3b82f6 !important;
}

html.dark-mode .ep-support-input::placeholder {
    color: #64748b !important;
    opacity: 1;
}

/* --- DARK MODE MODAL FIXES --- */
html.dark-mode body.academypanel-app-mode .swal2-popup {
    background: var(--panel-bg-card) !important;
    color: var(--panel-text-main) !important;
    border: 1px solid var(--panel-border) !important;
}

html.dark-mode body.academypanel-app-mode .swal2-title,
html.dark-mode body.academypanel-app-mode .swal2-content,
html.dark-mode body.academypanel-app-mode .swal2-html-container {
    color: var(--panel-text-main) !important;
}

html.dark-mode body.academypanel-app-mode .swal2-input,
html.dark-mode body.academypanel-app-mode .swal2-textarea,
html.dark-mode body.academypanel-app-mode .swal2-select,
html.dark-mode body.academypanel-app-mode .swal2-radio,
html.dark-mode body.academypanel-app-mode .swal2-checkbox {
    background: var(--panel-bg-main) !important;
    color: var(--panel-text-main) !important;
    border-color: var(--panel-border) !important;
}

html.dark-mode body.academypanel-app-mode .swal2-input:focus,
html.dark-mode body.academypanel-app-mode .swal2-textarea:focus {
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5) !important;
    border-color: var(--ep-primary) !important;
}

/* Fix Validation/Error Messages in Dark Mode */
html.dark-mode body.academypanel-app-mode .swal2-validation-message {
    background: #2d1a1a !important;
    color: #fca5a5 !important;
}

/* Fix Close Button */
html.dark-mode body.academypanel-app-mode .swal2-close {
    color: var(--panel-text-muted) !important;
}

html.dark-mode body.academypanel-app-mode .swal2-close:hover {
    color: var(--panel-text-main) !important;
}

/* Generic Modal Fixes (Bootstrap/Custom) */
html.dark-mode body.academypanel-app-mode .modal-content {
    background-color: var(--panel-bg-card);
    color: var(--panel-text-main);
    border-color: var(--panel-border);
}

html.dark-mode body.academypanel-app-mode .modal-header,
html.dark-mode body.academypanel-app-mode .modal-footer {
    border-color: var(--panel-border);
}

html.dark-mode body.academypanel-app-mode .close {
    color: var(--panel-text-main);
    text-shadow: none;
    opacity: 0.8;
}

html.dark-mode body.academypanel-app-mode .close:hover {
    opacity: 1;
}

/* Tablet Responsive Adjustments */
@media (max-width: 1280px) {
    .ep-hidden-tablet {
        display: none !important;
    }

    .ep-table th,
    .ep-table td {
        padding: 0.75rem 0.5rem;
        /* Reduce padding to fit more content */
    }
}

/* Coach phone number contrast fix */
.ep-coach-phone,
.ep-coach-phone span {
    color: #ffffff !important;
}

/* ========================================
   TABLET RESPONSIVE — Homework Tables
   Progressive font & padding scaling
   ======================================== */

/* --- Level 1: ≤ 1200px (Small laptop / large tablet) --- */
@media screen and (max-width: 1200px) {
    .ep-table th {
        padding: 0.65rem 0.75rem;
        font-size: 0.8rem;
    }

    .ep-table td {
        padding: 0.65rem 0.75rem;
        font-size: 0.8rem;
    }

    .ep-table {
        min-width: unset;
    }

    .ep-net-badge {
        font-size: 0.75rem !important;
        padding: 3px 8px !important;
    }

    .ep-badge {
        font-size: 0.72rem;
        padding: 2px 6px;
    }

    .ep-table .btn-sm,
    .ep-table button.btn-sm {
        font-size: 0.72rem !important;
        padding: 4px 8px !important;
    }

    .ep-title-cell {
        max-width: 180px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .ep-action-dropdown-menu {
        min-width: 160px;
    }

    .ep-action-dropdown-menu button {
        font-size: 0.78rem !important;
        padding: 6px 10px !important;
    }
}

/* --- Level 2: ≤ 1024px (Standard tablet landscape) --- */
@media screen and (max-width: 1024px) {
    .ep-table th {
        padding: 0.5rem 0.5rem;
        font-size: 0.75rem;
    }

    .ep-table td {
        padding: 0.5rem 0.5rem;
        font-size: 0.75rem;
    }

    .ep-net-badge {
        font-size: 0.7rem !important;
        padding: 2px 6px !important;
        white-space: nowrap;
    }

    .ep-badge {
        font-size: 0.68rem;
        padding: 2px 5px;
        white-space: nowrap;
    }

    .ep-table .btn-sm,
    .ep-table button.btn-sm {
        font-size: 0.68rem !important;
        padding: 3px 6px !important;
    }

    .ep-title-cell {
        max-width: 140px;
    }

    /* Hide less critical columns on tablet */
    .ep-hidden-tablet {
        display: none !important;
    }

    .ep-action-dropdown-menu {
        min-width: 140px;
    }

    .ep-action-dropdown-menu button {
        font-size: 0.72rem !important;
        padding: 5px 8px !important;
    }

    /* Durum column badges compact */
    .ep-badge.approved {
        font-size: 0.65rem;
    }

    .ep-status-pill {
        font-size: 0.65rem;
        padding: 2px 6px;
    }
}

/* --- Level 3: ≤ 900px (Tablet portrait / narrow) --- */
@media screen and (max-width: 900px) {
    .ep-table th {
        padding: 0.4rem 0.35rem;
        font-size: 0.7rem;
    }

    .ep-table td {
        padding: 0.4rem 0.35rem;
        font-size: 0.7rem;
    }

    .ep-net-badge {
        font-size: 0.65rem !important;
        padding: 2px 4px !important;
    }

    .ep-badge {
        font-size: 0.62rem;
        padding: 1px 4px;
    }

    .ep-table .btn-sm,
    .ep-table button.btn-sm {
        font-size: 0.62rem !important;
        padding: 2px 5px !important;
    }

    .ep-title-cell {
        max-width: 110px;
    }

    .ep-action-dropdown-menu {
        min-width: 120px;
    }

    .ep-action-dropdown-menu button {
        font-size: 0.68rem !important;
        padding: 4px 6px !important;
    }

    /* Dashboard header compact */
    .ep-dashboard-title {
        font-size: 1.2rem;
    }

    .ep-tabs {
        gap: 0.25rem;
    }

    .ep-tab {
        font-size: 0.75rem;
        padding: 0.4rem 0.6rem;
    }
}

/* Review status cell — truncate long "Ders Planlandı (dd.mm.yyyy)" text */
.ep-review-status {
    font-size: 0.75rem;
}

@media screen and (max-width: 1200px) {
    .ep-review-status-cell {
        max-width: 180px;
    }

    .ep-review-status {
        font-size: 0.7rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 170px;
    }
}

@media screen and (max-width: 1024px) {
    .ep-review-status-cell {
        max-width: 150px;
    }

    .ep-review-status {
        font-size: 0.62rem !important;
        max-width: 140px;
    }
}

@media screen and (max-width: 900px) {
    .ep-review-status-cell {
        max-width: 110px;
    }

    .ep-review-status {
        font-size: 0.58rem !important;
        max-width: 100px;
    }
}

/* ─── Global Cursor Fix ────────────────────────────────────────── */
/* WordPress/Gutenberg may inherit cursor:text — force default everywhere */
.ep-app,
.ep-app * {
    cursor: default;
}

/* Restore text cursor only for actual editable elements */
.ep-app input,
.ep-app textarea,
.ep-app select,
.ep-app [contenteditable="true"] {
    cursor: text;
}

/* Restore pointer cursor for interactive elements */
.ep-app button,
.ep-app [role="button"],
.ep-app a,
.ep-app .ep-nav-item,
.ep-app [style*="cursor: pointer"],
.ep-app .btn,
.ep-app .ep-tab,
.ep-app .ep-filter-btn {
    cursor: pointer;
}

/* ─── AI Exam Warning Text ─────────────────────────────────────── */
/* Force white text on AI warning bar for dark mode readability */
.ep-module div[style*="rgba(245,158,11"] {
    color: #ffffff !important;
}

.ep-module div[style*="rgba(245,158,11"] span {
    color: #ffffff !important;
}