:root {
    --primary-color: #e7a93c; /* Vibrant Sand Gold */
    --secondary-color: #108b96; /* Vivid Mediterranean Teal */
    --accent-color: #108b96; /* Mediterranean Teal */
    --accent-hover: #0b7a84;
    --text-main: #1e303a; /* Deep Mediterranean Navy */
    --text-muted: #5b707c; /* Sea Mist Gray-Blue */
    --bg-main: #fcf9f2; /* Vibrant Ivory */
    --card-bg: rgba(255, 255, 255, 0.9);
    --success: #17858c;
    --warning: #e07a5f;
    --danger: #d9534f;
    --sidebar-width: 280px;
    --sidebar-bg: #102a35; /* Deep Marine Navy/Teal */
    --sidebar-text: #8faab8;
    --glass-bg: rgba(255, 255, 255, 0.88);
    --glass-border: rgba(16, 139, 150, 0.18);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --accent-gradient: linear-gradient(135deg, #e7a93c 0%, #108b96 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', 'Outfit', sans-serif;
}

body {
    background: #fcf9f2 url('../img/office_8.jpeg') no-repeat center center/cover;
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Dark Overlay for Body */
body::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(252, 249, 242, 0.65) 0%, rgba(200, 235, 239, 0.55) 100%);
    z-index: -1;
    /* Behind content but above bg image */
    pointer-events: none;
}

/* Ensure app-container is above overlay */
.app-container {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    -webkit-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    padding: 2rem 0;
    position: fixed;
    height: 100vh;
    right: 0;
    z-index: 100;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.15);
}

.sidebar-header {
    padding: 0 2rem 2rem;
    text-align: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color) !important;
}

.logo i {
    font-size: 2rem;
    color: var(--primary-color) !important;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    padding: 0.5rem 1rem;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 1.5rem;
    text-decoration: none;
    color: var(--sidebar-text);
    border-radius: 12px;
    transition: var(--transition);
    font-weight: 600;
}

.sidebar-nav li.active a,
.sidebar-nav a:hover {
    background: var(--accent-gradient);
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(16, 139, 150, 0.25);
}

/* Sidebar Grouping & Dropdowns */
.nav-label {
    padding: 1.5rem 1.5rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.7;
}

.sidebar-nav ul ul {
    background: rgba(0, 0, 0, 0.2);
    margin: 5px 15px;
    border-radius: 12px;
    padding: 5px 0;
    list-style: none;
    border-right: 2px solid var(--primary-color);
}

.sidebar-nav ul ul li {
    padding: 0;
}

.sidebar-nav ul ul a {
    padding: 8px 1.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--sidebar-text) !important;
}

.sidebar-nav ul ul a:hover {
    color: var(--primary-color) !important;
    background: transparent !important;
    box-shadow: none !important;
}

.has-submenu>a::after {
    content: '\f107';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-right: auto;
    font-size: 0.8rem;
    transition: var(--transition);
}

.has-submenu.open>a::after {
    transform: rotate(180deg);
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info img {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    object-fit: cover;
}

.user-info .details p.name {
    font-weight: 700;
    font-size: 0.9rem;
    color: #ffffff;
}

.user-info .details p.role {
    font-size: 0.75rem;
    color: var(--sidebar-text);
}

.logout-btn {
    background: none;
    border: none;
    color: var(--sidebar-text);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
}

.logout-btn:hover {
    color: var(--danger);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-right: var(--sidebar-width);
    padding: 2rem;
}

/* Header */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);
    padding: 1rem 2rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 10px 30px rgba(30, 48, 58, 0.06);
}

.search-bar {
    position: relative;
    width: 400px;
}

.search-bar i {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-bar input {
    width: 100%;
    padding: 12px 3.5rem 12px 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    color: var(--text-main);
    outline: none;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.notifications {
    position: relative;
    cursor: pointer;
}

.notifications i {
    font-size: 1.4rem;
    color: var(--text-muted);
}

.notifications .badge {
    position: absolute;
    top: -5px;
    left: -5px;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 50%;
}

.add-btn {
    background: linear-gradient(135deg, #e2b76e, #cc9f56);
    color: #000;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.add-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(226, 183, 110, 0.3);
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--glass-bg);
    padding: 1.5rem;
    border-radius: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    border: 1px solid var(--glass-border);
    transition: var(--transition);
    position: relative;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
    box-shadow: 0 10px 30px rgba(226, 183, 110, 0.1);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.translation {
    background: rgba(226, 183, 110, 0.1);
    color: var(--accent-color);
}

.consultation {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.training {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.finance {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.stat-info h3 {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-main);
}

.stat-info p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.stat-trend {
    position: absolute;
    bottom: 1.5rem;
    left: 1.5rem;
    font-size: 0.8rem;
    font-weight: 700;
}

.stat-trend.up {
    color: var(--success);
}

.stat-trend.down {
    color: var(--danger);
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.card {
    background: var(--glass-bg);
    border-radius: 24px;
    padding: 2rem;
    border: 1px solid var(--glass-border);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(30, 48, 58, 0.04);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.card-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
}

.view-all {
    color: var(--accent-color);
    text-decoration: none;
    font-size: 0.9rem;
}

/* Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: right;
    color: var(--text-muted);
    font-size: 0.85rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.data-table td {
    padding: 1.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 0.9rem;
}

.status {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status.processing {
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent-color);
}

.status.pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.status.completed {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.actions-cell {
    display: flex;
    gap: 10px;
}

.action-btn-new {
    width: 35px;
    height: 35px;
    border-radius: 8px;
    border: 1px solid rgba(226, 183, 110, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    background: transparent;
    color: var(--text-muted);
}

.action-btn-new.view:hover {
    background: rgba(56, 189, 248, 0.1);
    color: #38bdf8;
    border-color: #38bdf8;
}

.action-btn-new.edit:hover {
    background: rgba(226, 183, 110, 0.1);
    color: var(--accent-color);
    border-color: var(--accent-color);
}

.action-btn-new.print:hover {
    background: rgba(46, 204, 113, 0.1);
    color: #2ecc71;
    border-color: #2ecc71;
}

.action-btn-new.assign {
    color: #e7a93c;
    border-color: rgba(231, 169, 60, 0.35);
}

.action-btn-new.assign:hover {
    background: rgba(231, 169, 60, 0.18);
    color: #d9911e;
    border-color: #e7a93c;
    box-shadow: 0 4px 12px rgba(231, 169, 60, 0.25);
}

.action-btn-new:hover {
    transform: translateY(-2px);
}

/* Course List */
.course-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.course-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.6);
    padding: 1rem;
    border-radius: 16px;
}

.course-date {
    background: var(--bg-main);
    padding: 8px 12px;
    border-radius: 10px;
    text-align: center;
    min-width: 60px;
}

.course-date .day {
    display: block;
    font-weight: 700;
    font-size: 1.2rem;
    line-height: 1;
}

.course-date .month {
    font-size: 0.75rem;
    color: var(--accent-color);
}

.course-details h3 {
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.course-details p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.course-occupancy {
    margin-right: auto;
    text-align: left;
    min-width: 80px;
}

.course-occupancy span {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 5px;
    display: block;
}

.progress-bar {
    width: 60px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: var(--accent-color);
}

/* التحسينات المتجاوبة (Media Queries) */
@media (max-width: 1024px) {
    .main-content { margin-right: 0 !important; padding: 1.5rem; }
    .sidebar { transform: translateX(100%); width: 280px; z-index: 2000; transition: transform 0.3s ease; }
    .sidebar.mobile-open { transform: translateX(0); }
    .content-grid { grid-template-columns: 1fr !important; }
}
@media (max-width: 768px) {
    .stats-grid { grid-template-columns: 1fr !important; }
    .main-header { flex-direction: column !important; text-align: center; gap: 15px; }
    .search-bar { width: 100% !important; }
    .data-table { display: block; overflow-x: auto; white-space: nowrap; }
}
.toggle-sidebar-btn {
    display: none; position: fixed; bottom: 25px; right: 25px; width: 60px; height: 60px;
    background: var(--accent-gradient); border-radius: 50%; align-items: center; justify-content: center;
    font-size: 1.5rem; color: #000; z-index: 2001; border: none; box-shadow: 0 4px 15px rgba(0,0,0,0.4); cursor: pointer;
}
@media (max-width: 1024px) { .toggle-sidebar-btn { display: flex !important; } }

/* ==========================================
   Light Theme Compatibility Overrides
   ========================================== */

/* Force all form controls to be light-theme friendly, overriding inline styles */
input, textarea, select {
    color: var(--text-main) !important;
    background: rgba(255, 255, 255, 0.85) !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

input:focus, textarea:focus, select:focus {
    border-color: var(--accent-color) !important;
    background: rgba(255, 255, 255, 0.95) !important;
    box-shadow: 0 0 10px rgba(226, 183, 110, 0.15) !important;
    color: var(--text-main) !important;
}

input::placeholder, textarea::placeholder {
    color: var(--text-muted) !important;
}

/* Classroom comment boxes and listings */
.comments-section {
    border-top: 1px solid rgba(0, 0, 0, 0.08) !important;
}

.comments-list > div > div {
    background: rgba(255, 255, 255, 0.6) !important;
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
}

/* Fix generic white text inside classroom panels */
.classroom-container h4, .classroom-container h5,
.classroom-card h4, .classroom-card h5,
.activity-card h4, .activity-card h5,
.comments-section h4, .comments-section h5,
.comments-list div {
    color: var(--text-main) !important;
}

/* Overriding specific inline styling where color: #fff or #ffffff is set in classroom panels */
div[style*="color:#fff"], div[style*="color: #fff"], div[style*="color:#ffffff"], div[style*="color: #ffffff"], div[style*="color:white"], div[style*="color: white"],
h4[style*="color:#fff"], h4[style*="color: #fff"], h4[style*="color:#ffffff"], h4[style*="color: #ffffff"], h4[style*="color:white"], h4[style*="color: white"],
h5[style*="color:#fff"], h5[style*="color: #fff"], h5[style*="color:#ffffff"], h5[style*="color: #ffffff"], h5[style*="color:white"], h5[style*="color: white"],
p[style*="color:#fff"], p[style*="color: #fff"], p[style*="color:#ffffff"], p[style*="color: #ffffff"], p[style*="color:white"], p[style*="color: white"],
span[style*="color:#fff"], span[style*="color: #fff"], span[style*="color:#ffffff"], span[style*="color: #ffffff"], span[style*="color:white"], span[style*="color: white"] {
    color: var(--text-main) !important;
}

/* Ensure classroom badges or buttons with white text on red/blue/green/gold backgrounds keep white text */
.badge-cat, .btn-primary, .btn, button.btn-primary, .badge, .status {
    color: #fff !important;
}
.btn-primary i, .btn i, button.btn-primary i {
    color: #fff !important;
}

