/* =========================================
   PREMIUM ADMIN THEME - GLASSMORPHISM
   ========================================= */

:root {
    /* --- COLOR PALETTE --- */
    --primary-hue: 210;
    /* Blue */
    --secondary-hue: 280;
    /* Purple accent */

    --color-primary: #12137F;
    --color-primary-dark: #090a57;
    --color-primary-light: #5b65b3;

    --color-secondary: hsl(var(--secondary-hue), 80%, 60%);

    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;

    --color-text-main: #1e293b;
    --color-text-muted: #64748b;
    --color-text-light: #94a3b8;

    /* --- GLASS VARIABLES --- */
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    --glass-blur: 16px;

    --card-radius: 20px;
    --btn-radius: 12px;
}

/* --- ANIMATED BACKGROUND --- */
body {
    font-family: 'Inter', sans-serif;
    color: var(--color-text-main);
    background-color: #f0f4f8;
    /* Fallback */
    overflow-x: hidden;
}

.admin-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    background:
        radial-gradient(circle at 15% 50%, rgba(100, 200, 255, 0.4), transparent 40%),
        radial-gradient(circle at 85% 30%, rgba(200, 100, 255, 0.3), transparent 40%),
        radial-gradient(circle at 50% 80%, rgba(100, 255, 200, 0.3), transparent 40%),
        linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 100%);
    background-size: 200% 200%;
    animation: bgMesh 20s ease infinite;
}

@keyframes bgMesh {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* --- GLASS CARD --- */
.card,
.stat-card,
.admin-sidebar,
.admin-header,
.modal-content {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(var(--glass-blur)) !important;
    -webkit-backdrop-filter: blur(var(--glass-blur)) !important;
    border: 1px solid var(--glass-border) !important;
    box-shadow: var(--glass-shadow) !important;
    border-radius: var(--card-radius) !important;
}

/* Header & Sidebar specific overrides to ensure transparency fits */
.admin-header {
    border-radius: 0 0 var(--card-radius) var(--card-radius) !important;
    background: rgba(255, 255, 255, 0.75) !important;
    /* Slightly more opaque */
    margin-bottom: 20px;
}

.admin-sidebar {
    border-radius: 0 var(--card-radius) var(--card-radius) 0 !important;
    margin-top: 0 !important;
    border-right: 1px solid var(--glass-border) !important;
    height: 100vh !important;
}

/* --- TYPOGRAPHY UPDATES --- */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--color-text-main);
    font-weight: 700;
    letter-spacing: -0.025em;
}

.page-title-new {
    font-size: 2rem;
    background: linear-gradient(135deg, var(--color-primary-dark), var(--color-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

/* --- BUTTONS --- */
.btn,
.button {
    border-radius: var(--btn-radius) !important;
    font-weight: 600 !important;
    padding: 0.75rem 1.5rem !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border: none !important;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.btn-primary,
.button-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark)) !important;
    color: white !important;
}

.btn-primary:hover,
.button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px rgba(37, 99, 235, 0.3);
}

.btn-secondary,
.button-secondary {
    background: white !important;
    color: var(--color-text-main) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
}

.btn-secondary:hover,
.button-secondary:hover {
    background: #f8fafc !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* --- TABLES --- */
.admin-table {
    border-spacing: 0 10px !important;
    border-collapse: separate !important;
}

.admin-table thead th {
    background: transparent !important;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
    padding: 1rem 1.5rem;
    border: none !important;
}

.admin-table tbody tr {
    background: rgba(255, 255, 255, 0.5);
    /* Semi-transparent rows */
    transition: transform 0.2s, background 0.2s;
}

.admin-table tbody tr:hover {
    transform: scale(1.01);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.admin-table td {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.6) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.6) !important;
    color: var(--color-text-main);
}

.admin-table td:first-child {
    border-left: 1px solid rgba(255, 255, 255, 0.6) !important;
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

.admin-table td:last-child {
    border-right: 1px solid rgba(255, 255, 255, 0.6) !important;
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

/* --- INPUTS --- */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea,
.form-control {
    background: rgba(255, 255, 255, 0.8) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    border-radius: var(--btn-radius) !important;
    padding: 0.75rem 1rem !important;
    transition: all 0.2s;
    font-size: 0.95rem;
}

input:focus,
select:focus,
textarea:focus {
    background: white !important;
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2) !important;
    outline: none;
}

/* --- STAT CARDS --- */
.stat-card {
    border-left: 4px solid var(--color-primary) !important;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4));
    transform: skewX(-20deg) translateX(150%);
    transition: transform 0.5s;
}

.stat-card:hover::after {
    transform: skewX(-20deg) translateX(-250%);
}

.stat-icon {
    background: linear-gradient(135deg, var(--color-primary-light), var(--color-primary)) !important;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
    border-radius: 12px !important;
}

/* --- SIDEBAR NAV --- */
.nav-item {
    border-radius: 10px !important;
    margin-bottom: 5px !important;
    color: var(--color-text-muted) !important;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.5) !important;
    color: var(--color-primary) !important;
}

.nav-item.active {
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary)) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3) !important;
}

.nav-item.active i {
    color: white !important;
}

/* --- SCROLLBAR --- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(156, 163, 175, 0.8);
}

/* --- PERSONNEL MANAGEMENT --- */
.personnel-layout.form-grid-personnel {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 30px;
    align-items: start;
}

@media (max-width: 1024px) {
    .personnel-layout.form-grid-personnel {
        grid-template-columns: 1fr;
    }
}

.personnel-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* Updated Personnel Card Style */
.personnel-card {
    background: rgba(255, 255, 255, 0.7);
    border-radius: var(--card-radius);
    padding: 20px;
    position: relative;
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.personnel-card:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.personnel-card-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Center content horizontally */
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.user-avatar-lg {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 10px;
    border: 2px solid white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.personnel-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 5px 0;
    color: var(--color-text-main);
}

.personnel-email {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: 10px;
}

.role-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-block;
    margin-top: 5px;
}

.role-admin {
    background-color: #fca5a5;
    color: #7f1d1d;
}

/* Redish */
.role-teacher {
    background-color: #93c5fd;
    color: #1e3a8a;
}

/* Blueish */
.role-giao_vu {
    background-color: #fdba74;
    color: #7c2d12;
}

/* Orangeish */
.role-ke_toan {
    background-color: #fde047;
    color: #713f12;
}

/* Yellowish */

/* Salary Input Section in Card */
.salary-section {
    background: rgba(240, 244, 248, 0.6);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 15px;
}

.salary-label {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-bottom: 5px;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.salary-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.salary-input {
    border: 1px solid #e2e8f0;
    background: white;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-primary-dark);
    padding: 8px 10px;
    width: 100%;
    border-radius: 8px !important;
}

.salary-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Action Bar at Bottom of Card */
.card-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.card-actions .btn {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.85rem;
    padding: 8px 0;
}

/* --- SCHEDULE SECTION --- */
/* Wrapper for horizontal scrolling */
.schedule-scroll-wrapper {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 15px;
    /* Space for scrollbar */
    /* Custom Scrollbar for this section */
    scrollbar-width: thin;
    scrollbar-color: rgba(156, 163, 175, 0.5) transparent;
}

/* Schedule Grid Layout */
.schedule-grid {
    display: grid;
    /* Ensure 7 columns with minimum width so they don't squash */
    grid-template-columns: repeat(7, minmax(220px, 1fr));
    gap: 15px;
    min-width: 1000px;
    /* Force scroll if screen is smaller */
}

/* Individual Day Column */
.schedule-day {
    background: rgba(255, 255, 255, 0.4);
    border-radius: var(--card-radius);
    padding: 15px;
    min-height: 300px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    flex-direction: column;
}

.schedule-day-header {
    text-align: center;
    font-weight: 700;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--color-primary-dark);
    font-size: 1.1rem;
    position: sticky;
    top: 0;
}

/* Schedule Item (Class Block) */
.schedule-item {
    background: white;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border-left: 4px solid var(--color-primary);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    font-size: 0.9rem;
}

.schedule-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.schedule-item-time {
    font-weight: 700;
    color: var(--color-primary);
    font-size: 0.85rem;
    margin-bottom: 4px;
    display: block;
}

.schedule-item-subject {
    font-weight: 600;
    color: var(--color-text-main);
    display: block;
}

.schedule-item-teacher {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.schedule-item.cancelled {
    opacity: 0.7;
    background: #fef2f2;
    border-left-color: var(--color-danger);
    text-decoration: line-through;
}

/* Schedule Card - Improved Spacing */
.schedule-card {
    position: relative;
    /* For absolute positioning of dropdown */
    padding-right: 30px !important;
    /* Make space for the menu icon */
}

/* Dropdown Menu Styles */
.schedule-actions-dropdown {
    position: absolute;
    top: 30px;
    right: 10px;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    z-index: 100;
    width: 150px;
    overflow: hidden;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 8px 12px;
    text-align: left;
    background: none;
    border: none;
    font-size: 0.85rem;
    color: var(--color-text-main);
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    /* Align icon and text */
    align-items: center;
    gap: 8px;
}

.dropdown-item:hover {
    background: #f3f4f6;
    color: var(--color-primary);
}

.dropdown-item i {
    width: 16px;
    /* Fixed width for icons alignment */
    text-align: center;
    font-size: 0.9em;
}

.dropdown-item.text-danger:hover {
    background: #fef2f2;
    color: var(--color-danger);
}

/* Three Dots Menu Icon */
.btn-menu-schedule {
    position: absolute;
    top: 5px;
    right: 5px;
    background: transparent !important;
    color: var(--color-text-muted) !important;
    padding: 5px !important;
    width: 25px;
    height: 25px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50% !important;
    box-shadow: none !important;
}

.btn-menu-schedule:hover {
    background: rgba(0, 0, 0, 0.05) !important;
    color: var(--color-primary) !important;
}

/* Compact Meet Link */
.schedule-card-meet {
    margin-top: 5px;
    display: flex;
}

.btn-meet-compact {
    font-size: 0.75rem !important;
    padding: 4px 8px !important;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #e0f2fe !important;
    /* Light blue bg */
    color: #0284c7 !important;
    /* Blue text */
    border: none !important;
}

.btn-meet-compact:hover {
    background: #bae6fd !important;
}

/* =========================================
   Report Details Modal (Glassmorphism)
   ========================================= */
.report-details-v2 {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 10px;
}

/* Info Grid (Top Section) */
.report-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.5);
    padding: 10px 15px;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    font-size: 0.95rem;
    color: var(--color-text-main);
}

.info-item i {
    color: var(--color-primary);
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.info-item span {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    margin-right: 5px;
}

.info-item strong {
    font-weight: 600;
    color: var(--color-text-main);
}

/* Details Grid (Bottom Section) */
.report-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

@media (max-width: 768px) {
    .report-details-grid {
        grid-template-columns: 1fr;
    }
}

.report-content-section {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.report-content-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.06);
    background: rgba(255, 255, 255, 0.85);
}

.report-content-section.full-width {
    grid-column: 1 / -1;
}

.report-content-section h4 {
    font-size: 1rem;
    color: var(--color-primary);
    margin: 0 0 5px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding-bottom: 8px;
}

.report-content-section h4 i {
    opacity: 0.8;
}

.report-content-section p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #4b5563;
    margin: 0;
    white-space: pre-wrap;
    /* Preserve line breaks */
}

/* Absentees List */
.absentees-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.absentees-list li {
    /* =========================================
   RESPONSIVE DESIGN (MOBILE OPTIMIZATION)
   ========================================= */

    @media (max-width: 1024px) {
        .admin-main {
            margin-left: 0;
            /* Sidebar ẩn làm main full width */
            padding: 1.5rem;
        }

        .admin-sidebar {
            transform: translateX(-100%);
            box-shadow: none;
            z-index: 1050;
            width: 280px;
            background: rgba(255, 255, 255, 0.95) !important;
            /* Less transparency for better reading */
        }

        .admin-sidebar.open {
            transform: translateX(0);
            box-shadow: 0 0 50px rgba(0, 0, 0, 0.2) !important;
        }

        .sidebar-overlay {
            display: block;
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            background: rgba(0, 0, 0, 0.5);
            z-index: 1000;
            opacity: 0;
            visibility: hidden;
            transition: all 0.3s ease;
            backdrop-filter: blur(2px);
        }

        .sidebar-overlay.open {
            opacity: 1;
            visibility: visible;
        }

        .sidebar-toggle-btn {
            display: block;
            /* Show hamburger */
        }
    }

    @media (max-width: 768px) {

        /* --- GENERAL LAYOUT --- */
        .admin-layout {
            flex-direction: column;
            margin-top: 60px;
            /* Smaller header */
        }

        .admin-header {
            padding: 0 10px;
            height: 60px;
        }

        .admin-header h1 {
            font-size: 1.2rem;
            display: none;
            /* Hide text on small screens */
        }

        .logo-img {
            height: 35px;
        }

        .admin-user-info span {
            display: none;
            /* Hide name/role on mobile */
        }

        .user-avatar img {
            /* Use ID selector specificity if needed, but class usually ok */
            width: 35px;
            height: 35px;
        }

        /* --- DASHBOARD STATS --- */
        .dashboard-charts,
        .stats-grid {
            grid-template-columns: 1fr;
            /* Full width cards */
        }

        /* --- TABLES TO CARDS (CARD VIEW) --- */
        /* Add class 'responsive-table-card' to tables if specific control needed, 
       but here we apply to .admin-table by default for mobile */

        .admin-table thead {
            display: none;
            /* Hide headers */
        }

        .admin-table,
        .admin-table tbody,
        .admin-table tr,
        .admin-table td {
            display: block;
            width: 100%;
        }

        .admin-table tr {
            margin-bottom: 1rem;
            background: rgba(255, 255, 255, 0.6);
            border: 1px solid var(--glass-border);
            border-radius: 12px;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
            padding: 10px;
        }

        .admin-table td {
            display: flex;
            justify-content: space-between;
            align-items: center;
            text-align: right;
            padding: 0.75rem 0.5rem;
            border: none !important;
            border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
            font-size: 0.9rem;
        }

        .admin-table td:last-child {
            border-bottom: none !important;
            justify-content: flex-end;
            /* Actions align right */
            gap: 10px;
        }

        /* Simulate Header with ::before */
        .admin-table td::before {
            content: attr(data-label);
            font-weight: 600;
            text-transform: uppercase;
            font-size: 0.75rem;
            color: var(--color-text-muted);
            text-align: left;
            margin-right: 1rem;
        }

        /* Exceptions for specific functional tables if needed */
        .schedule-grid {
            display: flex;
            flex-direction: column;
            /* Stack days */
            min-width: 0;
            /* Reset min-width */
        }

        .schedule-day {
            min-height: auto;
        }

        /* --- FORMS --- */
        .form-grid-2,
        .form-grid-3,
        .personnel-layout.form-grid-personnel {
            grid-template-columns: 1fr;
        }

        /* --- MODALS --- */
        .modal-content {
            width: 95% !important;
            padding: 0;
            /* Remove padding to allow full-width header */
            max-height: 90vh;
            display: flex;
            flex-direction: column;
            background: white;
            border-radius: 12px;
            overflow: hidden;
            /* Clip corners */
        }

        .modal-header {
            padding: 15px 24px;
            border-bottom: 1px solid var(--color-border);
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: white;
            z-index: 10;
        }

        .modal-body {
            padding: 24px;
            /* Move padding here */
            overflow-y: auto;
            flex: 1;
        }

        /* Specific fix for Submission Header Card */
        .submission-header-card {
            margin-bottom: 20px;
            background: white;
            border: 1px solid rgba(0, 0, 0, 0.05);
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
        }

        .proctoring-modal-content {
            flex-direction: column;
        }

        .proctoring-modal-body {
            /* Override for proctoring grid layout */
            display: grid;
            padding: 0;
            /* Proctoring body manages its own padding */
        }

        .proctoring-summary-panel {
            width: 100%;
            border-right: none;
            border-bottom: 1px solid var(--glass-border);
            padding: 20px;
            margin-bottom: 0;
            overflow-y: auto;
        }
    }

    font-size: 0.85rem;
    font-weight: 500;
}

/* =========================================
   Refined Form Styles (Add Report Modal)
   ========================================= */

/* Form Rows & Grids */
.form-row-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.form-row-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-section-card {
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    padding: 20px;
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.5);
}

.no-margin-bottom {
    margin-bottom: 0 !important;
}

/* Icons in Labels */
.form-group label i {
    color: var(--color-primary);
    margin-right: 5px;
    width: 20px;
    text-align: center;
}

/* Custom Checkbox */
.checkbox-container {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 35px;
    margin-bottom: 12px;
    cursor: pointer;
    font-size: 1rem;
    user-select: none;
    color: var(--color-text-main);
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 24px;
    width: 24px;
    background-color: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    transition: all 0.2s;
}

.checkbox-container:hover input~.checkmark {
    background-color: #f1f5f9;
}

.checkbox-container input:checked~.checkmark {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked~.checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 9px;
    top: 5px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Responsive Adjustments for Forms */
@media (max-width: 900px) {
    .form-row-4 {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {

    .form-row-4,
    .form-row-2 {
        grid-template-columns: 1fr;
    }
}

/* Announcement Card */
.announcement-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    /* For dropdown positioning */
}

.announcement-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
}

.announcement-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    gap: 12px;
}

.announcement-author-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.author-name {
    font-weight: 600;
    color: var(--color-text-main);
    font-size: 0.95rem;
}

.post-date {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.announcement-body {
    color: var(--color-text-main);
    line-height: 1.6;
    font-size: 0.95rem;
    padding-left: 2px;
}

.user-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Monthly Feedback UI Refinements */
.feedback-control-card .monthly-feedback-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--color-border);
}

.feedback-data-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    height: 100%;
}

.feedback-column {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.column-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.proctoring-tabs.flat-tabs {
    display: flex;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 0;
    padding: 0 10px;
}

.flat-tabs .proctoring-tab-btn {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--color-text-muted);
    padding: 12px 16px;
    margin-bottom: -2px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.flat-tabs .proctoring-tab-btn:hover {
    color: var(--color-primary);
    background: rgba(37, 99, 235, 0.05);
}

.flat-tabs .proctoring-tab-btn.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    font-weight: 600;
}

.proctoring-tab-content-wrapper {
    background: white;
    padding: 15px;
    border-radius: 0 0 12px 12px;
}

.data-list-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.scrollable-list-sm {
    max-height: 250px;
    overflow-y: auto;
}

.scrollable-list-md {
    max-height: 400px;
    overflow-y: auto;
}

.scrollable-list-lg {
    max-height: 500px;
    overflow-y: auto;
}

.sub-header {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.selected-items-list .empty-state-sm {
    text-align: center;
    padding: 30px;
    color: var(--color-text-muted);
    font-style: italic;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 8px;
}

/* Feedback History Card */
.feedback-history-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
    position: relative;
}

.feedback-history-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.08);
}

.feedback-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.feedback-meta {
    display: flex;
    align-items: center;
    gap: 15px;
}

.month-badge {
    background: linear-gradient(135deg, var(--color-primary), #60a5fa);
    color: white;
    padding: 8px 12px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 6px rgba(37, 99, 235, 0.2);
    min-width: 60px;
}

.month-badge .month {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
}

.month-badge .year {
    font-size: 0.75rem;
    opacity: 0.9;
}

.feedback-title h4 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--color-text-main);
}

.feedback-date {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

#monthly-feedback-section .card,
#announcements-section .card {
    padding: 25px;
}

.feedback-card-content {
    background: #f8fafc;
    border-radius: 8px;
    padding: 15px;
    position: relative;
}

.feedback-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--color-text-main);
    max-height: 120px;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.feedback-text.expanded {
    max-height: none;
}

.toggle-details-btn {
    display: block;
    width: 100%;
    text-align: center;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 8px;
    margin-top: 10px;
    cursor: pointer;
    color: var(--color-primary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.toggle-details-btn:hover {
    background: #eff6ff;
}

/* Common Dropdown Styles reused from Schedule (ensure these exist or are consistent) */
.schedule-actions-dropdown {
    position: absolute;
    right: 20px;
    top: 55px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 8px 0;
    z-index: 100;
    width: 160px;
}

.dropdown-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 15px;
    background: none;
    border: none;
    color: var(--color-text-main);
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dropdown-item:hover {
    background-color: #f1f5f9;
}

.dropdown-item.delete {
    color: #ef4444;
}

.dropdown-item.delete:hover {
    background-color: #fef2f2;
}

.btn-menu-schedule {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s;
}

.btn-menu-schedule:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--color-primary);
}

/* =========================================
   Proctoring Details Modal (Glassmorphism & Timeline)
   ========================================= */

/* Layout & Grid */
.proctoring-modal-content.large {
    max-width: 1800px;
    width: 95%;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    /* Prevent overflowing screen height */
}

.proctoring-modal-body {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 25px;
    padding: 20px 0;
    overflow: hidden;
    /* Contain scrollbars inside panels */
    height: 100%;
}

@media (max-width: 900px) {
    .proctoring-modal-body {
        grid-template-columns: 1fr;
        overflow-y: auto;
        /* Scroll whole body on mobile */
    }
}

/* --- Left Sidebar: Summary Panel --- */
.proctoring-summary-panel {
    background: rgba(255, 255, 255, 0.4);
    border-radius: var(--card-radius);
    padding: 20px;
    border: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
}

.proctoring-student-info {
    text-align: center;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.proctoring-student-info h3 {
    margin: 10px 0 5px;
    font-size: 1.2rem;
    color: var(--color-primary-dark);
}

.proctoring-student-info p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.proctoring-quick-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.6);
    padding: 10px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid var(--glass-border);
}

.stat-item span {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-item.violation span {
    color: var(--color-danger);
}

.stat-item.activity span {
    color: var(--color-primary);
}

.stat-item p {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--color-text-muted);
    font-weight: 600;
    margin: 0;
}

.proctoring-summary-details h4 {
    font-size: 0.95rem;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: 10px;
    letter-spacing: 0.05em;
}

#proctoring-summary-details-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.9rem;
}

#proctoring-summary-details-list li {
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
}

#proctoring-summary-details-list li strong {
    color: var(--color-text-main);
}

.proctoring-actions {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* --- Right Side: Details Panel --- */
.proctoring-details-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    /* Important for inner scroll */
}

/* Tabs */
.proctoring-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    overflow-x: auto;
}

.proctoring-tab-btn {
    background: transparent;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.proctoring-tab-btn:hover {
    background: rgba(255, 255, 255, 0.5);
    color: var(--color-primary);
}

.proctoring-tab-btn.active {
    background: var(--color-primary);
    color: white;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}

/* Tab Content */
.proctoring-tab-content-wrapper {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
    /* Space for scrollbar */
    position: relative;
}

.proctoring-tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.proctoring-tab-content.active {
    display: block;
}

/* TIMELINE (Log Cards) */
.log-card {
    position: relative;
    padding: 0 0 20px 35px;
    border-left: 2px solid rgba(0, 0, 0, 0.1);
    margin-left: 10px;
}

.log-card:last-child {
    border-left-color: transparent;
}

.log-icon {
    position: absolute;
    left: -13px;
    /* Center on the border line */
    top: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    z-index: 2;
    color: var(--color-primary);
    border: 2px solid var(--color-primary-light);
}

.log-card.violation .log-icon {
    color: var(--color-danger);
    border-color: #fecaca;
}

.log-details {
    background: rgba(255, 255, 255, 0.6);
    padding: 12px 15px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    transition: transform 0.2s;
}

.log-details:hover {
    transform: translateX(5px);
    background: rgba(255, 255, 255, 0.9);
}

.log-details p {
    margin: 0 0 5px;
    font-size: 0.95rem;
    color: var(--color-text-main);
}

.log-timestamp {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

/* SCREENSHOT GALLERY */
.screenshot-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.screenshot-gallery a {
    display: block;
    overflow: hidden;
    border-radius: 12px;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.screenshot-gallery a:hover {
    border-color: var(--color-primary);
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.screenshot-gallery img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    display: block;
}

/* =========================================
   Google Meet Management Layout
   ========================================= */

/* Google Meet Layout */
#google-meet-section .card {
    padding: 25px;
}

.meet-management-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 25px;
    align-items: start;
}

@media (max-width: 1024px) {
    .meet-management-layout {
        grid-template-columns: 1fr;
    }
}

.meet-main-content .card,
.meet-sidebar .card {
    height: 100%;
}

.meet-sidebar {
    position: sticky;
    top: 20px;
}

#existing-meet-links-list .btn-meet-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--color-primary);
    border-radius: 20px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

#existing-meet-links-list .btn-meet-link:hover {
    background: rgba(59, 130, 246, 0.2);
    transform: translateY(-1px);
}

/* =========================================
   Payroll & Finance Management
   ========================================= */

/* Main Controls Panel */
.payroll-main-controls {
    margin-bottom: 25px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.control-section-title {
    font-size: 1rem;
    color: var(--color-primary);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding-bottom: 8px;
}

.control-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: end;
}

.control-group .form-group {
    flex: 1;
    min-width: 200px;
}

.control-group .form-group-action {
    flex: 0 0 auto;
    min-width: auto;
}

.control-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.05);
    margin: 10px 0;
}

/* Payroll Cards Container */
.payroll-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

/* Card Styling (ensure consistency with generated JS) */
.payroll-card {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--card-radius);
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.payroll-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.9);
}

.payroll-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.payroll-card-info h4 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--color-text-main);
}

.payroll-card-info p {
    margin: 2px 0 0;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.payroll-card-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.payroll-stat-row {
    display: flex;
    justify-content: space-between;
}

.payroll-total-highlight {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-primary-dark);
    text-align: right;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* Summary Footer */
.payroll-summary {
    background: white;
    padding: 20px;
    border-radius: var(--card-radius);
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.05);
    position: sticky;
    bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--glass-border);
}

.payroll-summary h3 {
    margin: 0;
    font-size: 1.2rem;
}

.payroll-summary h3 span {
    color: var(--color-primary);
}

.payroll-summary-actions {
    display: flex;
    gap: 10px;
}

/* Payroll Details Modal */
.payroll-details-header {
    background: rgba(255, 255, 255, 0.5);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid var(--glass-border);
}

.payroll-details-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 15px;
}

@media(max-width: 768px) {
    .payroll-details-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.payroll-details-final-total {
    text-align: right;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.payroll-details-final-total label {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    margin-right: 10px;
}

.payroll-details-final-total p {
    display: inline-block;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--color-primary);
    margin: 0;
}

/* Finance Section Stats */
.finance-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card.income {
    border-bottom: 4px solid var(--color-success);
}

.summary-card.expense {
    border-bottom: 4px solid var(--color-danger);
}

.summary-card h3 {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
}

.summary-card p {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-text-main);
    margin: 5px 0 0;
}

/* =========================================
   Fee Notices Management
   ========================================= */

.fee-notice-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 25px;
    align-items: start;
}

@media (max-width: 1024px) {
    .fee-notice-layout {
        grid-template-columns: 1fr;
    }
}

/* Steps Cards */
.fee-notice-step {
    margin-bottom: 25px;
    position: relative;
    overflow: hidden;
    padding: 20px;
}

.fee-notice-step h3 {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.step-number {
    background: var(--color-primary);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
}

/* Student List */
.student-selection-controls {
    margin: 10px 0;
    display: flex;
    gap: 10px;
}

.class-checkbox-list {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.5);
}

.checkbox-item {
    padding: 8px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s;
}

.checkbox-item:hover {
    background: rgba(0, 0, 0, 0.03);
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary);
}

/* Preview Sidebar */
.fee-notice-sidebar {
    position: sticky;
    top: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.fee-notice-preview {
    min-height: 200px;
    max-height: 500px;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.preview-header {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.student-preview-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.student-preview-item {
    background: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.2s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.student-preview-item img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.empty-state {
    text-align: center;
    color: var(--color-text-muted);
    font-style: italic;
    padding: 20px;
    font-size: 0.9rem;
}

.fee-notice-action-box {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

/* =========================================
   Payroll Statistics
   ========================================= */

.payroll-stats-main-card {
    margin-bottom: 25px;
    padding: 25px;
}

.payroll-stats-top-panel {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 30px;
}

@media (max-width: 1024px) {
    .payroll-stats-top-panel {
        flex-direction: column;
        gap: 20px;
    }
}

.payroll-stats-filters {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    align-items: end;
}

.payroll-stats-filters .form-group {
    margin-bottom: 0;
}

.form-group-actions {
    display: flex;
    gap: 10px;
}

.payroll-stats-summary {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.5);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.payroll-stats-summary .summary-item {
    text-align: center;
    min-width: 100px;
    padding: 10px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.payroll-stats-summary .summary-item p {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text-main);
    margin: 0;
}

.payroll-stats-summary .summary-item span {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
}

.payroll-stats-summary .summary-item.total p {
    color: var(--color-primary);
    font-size: 1.5rem;
}

#payroll-stats-section .card {
    padding: 25px;
}

/* =========================================
   System Status
   ========================================= */

.system-status-container {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--card-radius);
    padding: 25px;
}

.status-header {
    display: flex;
    justify-content: space-between;
    padding-bottom: 15px;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.status-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--color-text-muted);
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    margin-bottom: 10px;
    transition: all 0.2s;
}

.status-item:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.status-name {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    color: var(--color-text-main);
}

.status-name i {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary-light);
    color: var(--color-primary);
    border-radius: 50%;
    font-size: 0.8rem;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-success);
}

.status-failed {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* =========================================
   Statistics Section
   ========================================= */

.statistics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .statistics-grid {
        grid-template-columns: 1fr;
    }
}

.chart-container {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--card-radius);
    padding: 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.chart-container h3 {
    margin-bottom: 20px;
    font-size: 1.1rem;
    color: var(--color-text-muted);
    text-align: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding-bottom: 10px;
}

.chart-container canvas {
    flex: 1;
    width: 100% !important;
    height: auto !important;
    max-height: 300px;
}

/* =========================================
   THEME SELECTION SETTINGS
   ========================================= */
.theme-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.theme-option {
    background: rgba(255, 255, 255, 0.4);
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.theme-option:hover {
    background: rgba(255, 255, 255, 0.7);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.theme-option.active {
    border-color: var(--color-primary);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 5px 15px rgba(37, 99, 235, 0.15);
}

.theme-preview {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: var(--color-text-light);
    transition: color 0.2s;
}

.theme-option.active .theme-preview {
    color: var(--color-primary);
}

.theme-info h4 {
    margin: 0 0 5px 0;
    font-size: 1rem;
    color: var(--color-text-main);
}

.theme-info p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.theme-check {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.2rem;
    color: var(--color-text-light);
    opacity: 0.3;
}

.theme-option.active .theme-check {
    color: var(--color-success);
    opacity: 1;
}

/* Specific Preview Colors */
.noel-preview {
    color: #5bc0de;
}

.theme-option.active .noel-preview {
    color: #5bc0de;
}

.tet-duong-preview {
    color: #f0ad4e;
}

.theme-option.active .tet-duong-preview {
    color: #f0ad4e;
}

.tet-nguyen-preview {
    color: #d9534f;
}

.theme-option.active .tet-nguyen-preview {
    color: #d9534f;
}

.quoc-khanh-preview {
    color: #d9534f;
}

.theme-option.active .quoc-khanh-preview {
    color: #d9534f;
}

/* =========================================
   NOTIFICATION PANEL STYLES (GLASSMORPHISM)
   ========================================= */

.notification-panel {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15),
        inset 0 0 0 1px rgba(255, 255, 255, 0.5) !important;
    border-radius: 16px !important;
    overflow: hidden;
    padding: 0;
}

.notification-panel-header {
    background: rgba(255, 255, 255, 0.5);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 15px 20px;
}

.notification-panel-header h4 {
    font-size: 1.1rem;
    color: var(--color-primary-dark);
    margin: 0;
}

.btn-clear-all {
    color: #0069ff;
    font-size: 0.85rem;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.03);
    transition: all 0.2s;
}

.btn-clear-all:hover {
    background: #fee2e2;
    color: var(--color-danger);
    transform: translateY(-1px);
}

.notification-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 5px 0;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
    gap: 15px;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item:hover {
    background: rgba(255, 255, 255, 0.6);
}

.notification-item.unread {
    background: rgba(235, 248, 255, 0.6);
    /* Very light blue */
}

.notification-item.unread:hover {
    background: rgba(235, 248, 255, 0.9);
}

.notification-item.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: var(--color-primary);
    border-radius: 0 4px 4px 0;
}

.notification-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #e0f2fe, #bae6fd);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.15);
}

.notification-item-content {
    flex: 1;
}

.notification-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text-main);
    margin: 0 0 4px 0;
}

.notification-message {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin: 0 0 6px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notification-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-time {
    font-size: 0.75rem;
    color: #94a3b8;
}

.btn-delete-notification {
    background: none;
    border: none;
    color: #cbd5e1;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 5px;
    line-height: 1;
    transition: color 0.2s;
    margin-left: auto;
    /* Push to right */
    align-self: flex-start;
}

.btn-delete-notification:hover {
    color: var(--color-danger);
}

.notification-panel-footer {
    background: rgba(255, 255, 255, 0.5);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding: 12px 20px;
    text-align: center;
}

.view-all-notifications-link {
    color: var(--color-primary);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.view-all-notifications-link:hover {
    color: var(--color-primary-dark);
}

/* Bell Animation */
.notification-bell {
    position: relative;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    border: 1px solid var(--glass-border);
}

.notification-bell:hover {
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
    color: var(--color-primary);
}

.notification-badge {
    top: -5px;
    right: -5px;
    border: 2px solid #fff;
    /* Match header bg */
    box-shadow: 0 2px 5px rgba(239, 68, 68, 0.4);
    animation: bounceIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
    }

    80% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

/* Custom Scrollbar for list */
.notification-list::-webkit-scrollbar {
    width: 6px;
}

.notification-list::-webkit-scrollbar-track {
    background: transparent;
}

.notification-list::-webkit-scrollbar-thumb {
    background: rgba(203, 213, 225, 0.5);
    border-radius: 10px;
}

.notification-list::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.8);
}

/* --- Responsive Design (Mobile & Tablet) --- */

/* 1. Tablet & Small Desktop (Max Width: 1024px) */
@media (max-width: 1024px) {
    .admin-sidebar {
        transform: translateX(-100%);
        z-index: 1000;
        width: 260px;
        background: rgba(255, 255, 255, 0.95) !important;
        /* Less transparent for readability */
        backdrop-filter: blur(20px) !important;
    }

    .admin-sidebar.open {
        transform: translateX(0);
        box-shadow: 5px 0 25px rgba(0, 0, 0, 0.2) !important;
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(15, 23, 42, 0.6);
        /* Darker overlay */
        backdrop-filter: blur(4px);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s;
    }

    .sidebar-overlay.open {
        opacity: 1;
        visibility: visible;
    }

    .admin-main {
        margin-left: 0 !important;
        /* Full width */
        width: 100%;
        padding: 15px;
    }

    .admin-header {
        left: 0 !important;
        width: 100% !important;
        transform: none !important;
    }

    .sidebar-toggle-btn {
        display: flex !important;
        /* Show toggle button */
        align-items: center;
        justify-content: center;
        font-size: 1.2rem;
        color: var(--color-primary);
        background: rgba(255, 255, 255, 0.8);
        border: 1px solid var(--glass-border);
        border-radius: 8px;
        width: 40px;
        height: 40px;
        cursor: pointer;
        margin-right: 15px;
    }

    .personnel-layout.form-grid-personnel {
        grid-template-columns: 1fr;
        /* Stack personnel form */
    }
}

/* 2. Mobile (Max Width: 768px) */
@media (max-width: 768px) {

    /* Header Adjustments */
    .admin-header {
        padding: 0 15px;
        height: 60px;
    }

    .admin-header-content {
        justify-content: space-between;
    }

    .admin-logo h1 {
        display: none;
        /* Hide text on mobile */
    }

    .admin-logo img {
        height: 32px;
    }

    .user-details,
    .user-avatar {
        display: none;
        /* Hide user info to save space */
    }

    .admin-layout {
        flex-direction: column;
    }

    /* Dashboard Grid Stacking */
    .dashboard-charts,
    .stats-grid {
        grid-template-columns: 1fr !important;
    }

    /* Form Grids Stacking */
    .form-grid-2,
    .form-grid-3 {
        grid-template-columns: 1fr !important;
    }

    /* --- Responsive Tables (Card View) --- */
    .admin-table {
        border: 0;
    }

    .admin-table thead {
        display: none;
        /* Hide headers */
    }

    .admin-table tr {
        display: block;
        margin-bottom: 20px;
        background: white;
        border: 1px solid var(--glass-border);
        border-radius: 12px;
        padding: 15px;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
    }

    .admin-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        font-size: 0.9rem;
        text-align: right;
    }

    .admin-table td:last-child {
        border-bottom: 0;
        justify-content: flex-end;
        /* Actions aligned right */
        padding-top: 15px;
    }

    .admin-table td::before {
        content: attr(data-label);
        /* Show label */
        flex-shrink: 0;
        font-weight: 600;
        color: var(--color-text-muted);
        text-align: left;
        margin-right: 15px;
    }

    /* Adjust specific elements in card view */
    .user-info-cell {
        flex-direction: row-reverse;
        /* Align matching flex behavior if needed, generally row is fine */
        justify-content: flex-end;
    }

    .user-avatar-sm {
        margin-right: 0;
        margin-left: 10px;
    }

    /* Table Actions */
    .table-actions {
        justify-content: flex-end;
        width: 100%;
    }

    /* Modal Adjustments */
    .modal-content {
        width: 95%;
        margin: 10px;
        max-height: 90vh;
        overflow-y: auto;
    }

    /* Filter Groups Stacking */
    .filter-group {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group input,
    .filter-group select,
    .filter-group .btn {
        width: 100%;
        margin-bottom: 10px;
    }

    /* --- Schedule Section Mobile Optimization --- */
    .schedule-grid {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .schedule-day {
        min-height: auto !important;
        /* Remove fixed height if any */
        border: 1px solid var(--glass-border);
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.5);
    }

    .schedule-day-header {
        border-radius: 12px 12px 0 0;
        background: rgba(var(--color-primary-rgb), 0.1);
        color: var(--color-primary);
        padding: 12px 15px;
        text-align: left;
        /* Align left for list view */
        font-weight: 700;
        border-bottom: 1px solid var(--glass-border);
    }

    .schedule-day-content {
        min-height: 80px;
        /* Ensure drop area size or visual spacing */
        padding: 10px;
    }

    .schedule-day-content.current-day {
        background: rgba(var(--color-primary-rgb), 0.05);
    }

    /* Adjust Schedule Cards for list view */
    .schedule-card {
        margin-bottom: 10px;
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    .schedule-card .card-actions {
        position: relative;
        opacity: 1;
        /* Always show actions on mobile */
        margin-top: 10px;
        justify-content: flex-end;
        background: transparent;
        padding: 0;
    }

    /* Optimize date/month filters for mobile */
    .schedule-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .schedule-controls>div {
        width: 100%;
        margin-bottom: 0;
    }

    .view-switcher,
    .header-actions {
        width: 100%;
        display: flex;
        gap: 10px;
    }

    .view-switcher button,
    .header-actions button {
        flex: 1;
        justify-content: center;
    }
}

/* --- Notification Panel Mobile Optimization --- */
@media (max-width: 768px) {
    .notification-panel {
        position: fixed !important;
        top: 60px !important;
        /* Height of header on mobile */
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        border-radius: 0 0 20px 20px !important;
        max-height: 85vh;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2) !important;
        transform: translateY(-20px);
    }

    .notification-panel.show {
        transform: translateY(0);
    }

    .notification-panel-header {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        padding: 15px 20px;
    }

    .notification-list {
        max-height: 60vh;
    }
}

/* =========================================
   MATCHING QUESTION STYLES (VSAT)
   ========================================= */
.matching-columns-container, .matching-render-container {
    padding: 15px;
    background: rgba(255,255,255,0.5);
    border-radius: 12px;
    margin-top: 15px;
}

.matching-columns-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.matching-column {
    flex: 1;
    min-width: 300px;
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.matching-column h5 {
    margin-bottom: 15px;
    text-align: center;
    color: var(--color-primary);
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.matching-item {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: flex-start;
}

.item-label {
    font-weight: bold;
    min-width: 25px;
    padding-top: 8px;
    color: var(--color-primary-dark);
}

.matching-left-text, .matching-right-text {
    flex: 1;
    min-height: 60px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px;
    resize: vertical;
}

.matching-correct-answers {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
}

.matching-pair-select {
    background: #fff;
    padding: 8px 12px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pair-label {
    font-weight: bold;
    color: var(--color-primary);
}

.matching-correct-select {
    border: none !important;
    background: transparent !important;
    font-weight: bold;
    color: var(--color-text-main);
    padding: 0 5px !important;
    min-width: 50px;
}

/* Student Render Styles */
.matching-columns-row {
     display: flex;
     flex-wrap: wrap;
     gap: 20px;
     margin-bottom: 15px;
}

.matching-col-left, .matching-col-right {
    flex: 1;
    min-width: 250px;
}

.matching-render-item {
    border: 1px solid #eee;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 4px;
}

.matching-col-left .matching-render-item {
    background: #f9f9f9;
}

.matching-col-right .matching-render-item {
    background: #fff;
}

.matching-answer-zone {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.matching-answer-inputs {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.matching-input-pair {
    display: flex;
    align-items: center;
    gap: 5px;
}