/* css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    /* Fonts */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    /* Standard Colors (Light Mode by Default) */
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-sidebar: #0f172a;
    --text-main: #0f172a;
    --text-muted: #334155;
    --text-light: #475569;
    
    --primary: #0d9488;
    --primary-light: #ccfbf1;
    --primary-gradient: linear-gradient(135deg, #2dd4bf 0%, #0d9488 50%, #115e59 100%);
    --accent: #10b981;
    --accent-light: #d1fae5;
    
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #ea580c;
    --warning-light: #ffedd5;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    
    --border-color: #cbd5e1;
    --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.04), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --sidebar-shadow: 4px 0 25px rgba(15, 23, 42, 0.15);
    
    --border-radius-sm: 8px;
    --border-radius-md: 16px;
    --border-radius-lg: 24px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-main: #0b0f19;
    --bg-card: #111827;
    --bg-sidebar: #070a12;
    --text-main: #f8fafc;
    --text-muted: #cbd5e1;
    --text-light: #94a3b8;
    
    --border-color: #334155;
    --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
    
    --primary-light: #115e59;
    --accent-light: #064e3b;
    --success-light: #064e3b;
    --warning-light: #7c2d12;
    --danger-light: #7f1d1d;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
    transition: var(--transition);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: var(--font-body);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.08); opacity: 0.8; }
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 8px rgba(79,70,229,0.3); }
    50% { box-shadow: 0 0 20px rgba(79,70,229,0.6); }
}

/* Layout Utilities */
.dashboard-wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: 280px;
    background-color: var(--bg-sidebar);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    padding: 24px;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    box-shadow: var(--sidebar-shadow);
    transition: var(--transition);
    overflow-y: auto;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 24px;
    animation: slideInLeft 0.4s ease-out;
}

.sidebar-date {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    margin: 10px 0;
    background: rgba(255,255,255,0.04);
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(255,255,255,0.06);
}

.sidebar-logo img {
    height: 38px;
    filter: drop-shadow(0 2px 8px var(--primary));
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.menu-item > a {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    border-radius: var(--border-radius-sm);
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    transition: var(--transition);
}

.menu-item > a i {
    font-size: 18px;
}

.menu-item:hover > a, 
.menu-item.active > a {
    color: #ffffff;
    background: var(--primary-gradient);
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(13, 148, 136, 0.4);
}

/* Sidebar Submenu Layout */
.menu-item.has-submenu {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.menu-item .submenu-toggle {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    border-radius: var(--border-radius-sm);
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
}

.menu-item .submenu-toggle .arrow {
    margin-left: auto;
    font-size: 11px;
    transition: transform 0.2s ease-out;
}

.menu-item.open .submenu-toggle .arrow {
    transform: rotate(180deg);
}

.submenu-menu {
    list-style: none;
    padding-left: 14px;
    margin-top: 0;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-left: 1.5px dashed rgba(255, 255, 255, 0.15);
    margin-left: 26px;
    padding-bottom: 0;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease, margin-top 0.3s ease, padding-bottom 0.3s ease;
}

.menu-item.open .submenu-menu {
    max-height: 300px;
    opacity: 1;
    margin-top: 4px;
    padding-bottom: 6px;
}

.submenu-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--border-radius-sm);
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
}

.submenu-item a i {
    font-size: 14px;
    width: 20px;
    text-align: center;
}

.submenu-item:hover a {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(3px);
}

.submenu-item.active a {
    background: rgba(13, 148, 136, 0.25);
    border: 1px solid rgba(13, 148, 136, 0.4);
    color: var(--primary-light);
    transform: translateX(3px);
}

.sidebar-user {
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
}

.user-details h4 {
    font-size: 14px;
    font-weight: 600;
}

.user-details span {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: capitalize;
}

.logout-btn {
    color: rgba(255, 255, 255, 0.5);
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
}

.logout-btn:hover {
    color: var(--danger);
    transform: scale(1.1);
}

/* Main Content Layout */
.main-content {
    margin-left: 280px;
    flex-grow: 1;
    padding: 32px 36px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 22px;
    width: calc(100% - 280px);
    transition: var(--transition);
}

/* Topbar Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: fadeIn 0.4s ease-out;
}

.header-title h1 {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--text-main) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-title p {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 4px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.theme-toggle-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
}

.theme-toggle-btn:hover {
    transform: rotate(30deg) scale(1.05);
}

/* Cards & Styling */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.stat-card {
    background-color: var(--bg-card);
    border-radius: var(--border-radius-md);
    padding: 22px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    animation: fadeIn 0.5s ease-out both;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover::before { opacity: 1; }

.stat-card.primary-card { border-left: 3px solid var(--accent); }
.stat-card.primary-card::before { background: linear-gradient(90deg, var(--accent), transparent); }
.stat-card.success-card { border-left: 3px solid var(--success); }
.stat-card.success-card::before { background: linear-gradient(90deg, var(--success), transparent); }
.stat-card.warning-card { border-left: 3px solid var(--warning); }
.stat-card.warning-card::before { background: linear-gradient(90deg, var(--warning), transparent); }
.stat-card.danger-card { border-left: 3px solid var(--danger); }
.stat-card.danger-card::before { background: linear-gradient(90deg, var(--danger), transparent); }

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 18px 35px -8px rgba(15, 23, 42, 0.12);
}

.stat-details h3 {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-details .stat-number {
    font-size: 30px;
    font-weight: 800;
    color: var(--text-main);
    font-family: var(--font-heading);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%; /* Perfect circular icons */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.stat-card:hover .stat-icon {
    transform: scale(1.08) rotate(5deg);
}

.stat-icon.primary { background-color: var(--accent-light); color: var(--accent); box-shadow: 0 4px 10px rgba(79, 70, 229, 0.15); }
.stat-icon.success { background-color: var(--success-light); color: var(--success); box-shadow: 0 4px 10px rgba(16, 185, 129, 0.15); }
.stat-icon.warning { background-color: var(--warning-light); color: var(--warning); box-shadow: 0 4px 10px rgba(245, 158, 11, 0.15); }
.stat-icon.danger { background-color: var(--danger-light); color: var(--danger); box-shadow: 0 4px 10px rgba(239, 68, 68, 0.15); }

/* Dashboard Widgets Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.main-widget-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.side-widget-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.widget-card {
    background-color: var(--bg-card);
    border-radius: var(--border-radius-md);
    padding: 26px;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    animation: fadeIn 0.6s ease-out both;
    transition: box-shadow 0.3s ease;
}

.widget-card:hover {
    box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .widget-card:hover {
    box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.4);
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
}

.widget-header h2 {
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.2px;
}

.widget-header h2 i {
    color: var(--primary);
    font-size: 15px;
}

/* Profile Card Styling */
.profile-card {
    background: var(--primary-gradient);
    color: white;
    border: none;
}

.profile-card .widget-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.profile-card .widget-header h2 i {
    color: white;
}

.profile-grid {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 24px;
    align-items: center;
}

.profile-avatar-large {
    width: 100px;
    height: 100px;
    border-radius: var(--border-radius-sm);
    background: rgba(255, 255, 255, 0.2);
    border: 3px solid rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    font-weight: 800;
}

.profile-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.profile-data-item h5 {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.60);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.profile-data-item p {
    font-size: 15px;
    font-weight: 600;
}

/* Custom Table Design */
.table-container {
    overflow-x: auto;
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.custom-table th {
    background-color: rgba(99, 102, 241, 0.04); /* Light transparent indigo/blue tint header */
    color: var(--text-muted);
    font-weight: 600;
    padding: 15px 18px;
    font-size: 13px;
    border-bottom: 2px solid var(--border-color);
    letter-spacing: 0.5px;
}

[data-theme="dark"] .custom-table th {
    background-color: rgba(255, 255, 255, 0.02);
}

.custom-table td {
    padding: 16px 18px;
    font-size: 14px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    transition: var(--transition);
}

.custom-table tr:last-child td {
    border-bottom: none;
}

.custom-table tr:hover td {
    background-color: rgba(99, 102, 241, 0.03); /* Extremely clean dynamic light-indigo hover */
}

[data-theme="dark"] .custom-table tr:hover td {
    background-color: rgba(255, 255, 255, 0.015);
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.badge.success { background-color: var(--success-light); color: var(--success); }
.badge.success::before { background-color: var(--success); }

.badge.warning { background-color: var(--warning-light); color: var(--warning); }
.badge.warning::before { background-color: var(--warning); }

.badge.danger { background-color: var(--danger-light); color: var(--danger); }
.badge.danger::before { background-color: var(--danger); }

/* Noticeboard Item */
.notice-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.notice-item {
    border-left: 4px solid var(--primary);
    background-color: var(--bg-main);
    padding: 16px;
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
    transition: var(--transition);
}

.notice-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}

.notice-item-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.notice-item-header h4 {
    font-size: 14px;
    font-weight: 600;
}

.notice-item-header span {
    font-size: 11px;
    color: var(--text-muted);
}

.notice-item p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Homework List */
.homework-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.homework-card {
    border: 1px solid var(--border-color);
    padding: 18px;
    border-radius: var(--border-radius-sm);
    background-color: var(--bg-card);
    transition: var(--transition);
}

.homework-card:hover {
    box-shadow: var(--card-shadow);
}

.hw-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.hw-subject {
    font-size: 12px;
    font-weight: 700;
    background-color: var(--accent-light);
    color: var(--accent);
    padding: 4px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.hw-due {
    font-size: 11px;
    color: var(--danger);
    font-weight: 600;
}

.homework-card h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 8px;
}

.homework-card p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 12px;
}

/* Beautiful Interactive Calendar Grid */
.calendar-widget {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.calendar-days-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: 700;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    text-align: center;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-sm);
    font-size: 13px;
    font-weight: 500;
    background-color: var(--bg-main);
    position: relative;
    cursor: default;
    transition: var(--transition);
}

.calendar-day.empty {
    background-color: transparent;
    cursor: default;
}

.calendar-day.present {
    background-color: var(--success-light);
    color: var(--success);
    font-weight: 700;
}

.calendar-day.absent {
    background-color: var(--danger-light);
    color: var(--danger);
    font-weight: 700;
}

.calendar-day.leave {
    background-color: var(--warning-light);
    color: var(--warning);
    font-weight: 700;
}

.calendar-day.sunday {
    background-color: var(--border-color);
    color: var(--text-light);
    opacity: 0.6;
}

/* Custom Interactive Forms */
.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 14px;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background-color: var(--bg-card);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 24px;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(13, 148, 136, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13, 148, 136, 0.4);
}

.btn-secondary {
    background-color: var(--border-color);
    color: var(--text-main);
}

.btn-secondary:hover {
    background-color: var(--text-light);
}

.btn-success {
    background-color: var(--success);
    color: white;
}

.btn-success:hover {
    background-color: #0d9488;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 12px;
}

/* Modal Popup Core Styling */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;              /* Hidden by default — cannot block clicks */
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;       /* Prevent click blocking when inactive */
}

.modal.active {
    display: flex;              /* Show as flex when active */
    opacity: 1;
    pointer-events: auto;       /* Enable interaction when active */
}

.modal-container {
    background-color: var(--bg-card);
    border-radius: var(--border-radius-md);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.active .modal-container {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
}

.modal-close {
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--danger);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Circular Progress Chart */
.circular-progress-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.circular-progress {
    position: relative;
    width: 120px;
    height: 120px;
}

.circular-progress svg {
    width: 120px;
    height: 120px;
    transform: rotate(-90deg);
}

.circular-progress circle {
    width: 100%;
    height: 100%;
    fill: none;
    stroke-width: 10;
    stroke-linecap: round;
}

.circular-progress .bg-ring {
    stroke: var(--border-color);
}

.circular-progress .progress-ring {
    stroke: var(--primary);
    stroke-dasharray: 314; /* 2 * PI * r (r=50) */
    stroke-dashoffset: 314;
    transition: stroke-dashoffset 1s ease-in-out;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    font-weight: 800;
    font-family: var(--font-heading);
}

/* Beautiful Fee Challan (Printable Layout Component) */
.challan-print-area {
    padding: 30px;
    background-color: #ffffff;
    color: #000000;
    font-family: 'Inter', sans-serif;
    border: 1px dashed #cccccc;
    border-radius: var(--border-radius-sm);
    line-height: 1.4;
}

.challan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #000000;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.challan-school-info h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 22px;
    font-weight: 800;
}

.challan-school-info p {
    font-size: 11px;
    color: #555555;
}

.challan-logo-box {
    text-align: right;
}

.challan-logo-text {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary);
}

.challan-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
    font-size: 13px;
}

.challan-meta-box {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 12px;
    border-radius: 6px;
}

.challan-meta-box p {
    margin-bottom: 4px;
}

.challan-meta-box p strong {
    font-weight: 600;
}

.challan-details-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 13px;
}

.challan-details-table th, 
.challan-details-table td {
    border: 1px solid #cbd5e1;
    padding: 10px 12px;
    text-align: left;
}

.challan-details-table th {
    background-color: #f1f5f9;
    font-weight: 700;
}

.challan-details-table tr.total-row {
    font-weight: 800;
    font-size: 14px;
    background-color: #f8fafc;
}

.payment-methods-box {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    font-size: 12px;
    background-color: #f8fafc;
}

.payment-methods-box h4 {
    margin-bottom: 8px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 11px;
    color: #475569;
}

.pay-ref-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px dashed #e2e8f0;
}

.pay-ref-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.challan-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #64748b;
    margin-top: 20px;
}

.challan-qr-box {
    text-align: center;
}

.challan-qr-box canvas {
    background-color: #fff;
    padding: 5px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
}

/* Payment Simulator Selection */
.payment-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.payment-option-card {
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.payment-option-card:hover {
    border-color: var(--primary-light);
    background-color: rgba(13, 148, 136, 0.02);
}

.payment-option-card.selected {
    border-color: var(--primary);
    background-color: rgba(13, 148, 136, 0.05);
}

.payment-option-card img {
    height: 32px;
    margin-bottom: 8px;
    object-fit: contain;
}

.payment-option-card p {
    font-size: 12px;
    font-weight: 700;
}

/* Interactive Attendance Marker Grid */
.attendance-marker-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 8px;
}

.attendance-marker-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    background-color: var(--bg-main);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
}

.student-marker-info h4 {
    font-size: 14px;
    font-weight: 600;
}

.student-marker-info span {
    font-size: 11px;
    color: var(--text-muted);
}

.attendance-options {
    display: flex;
    gap: 6px;
}

.attendance-opt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    z-index: 10;
}

.attendance-opt-btn.present:hover, 
.attendance-opt-btn.present.active {
    background-color: var(--success);
    color: white;
    border-color: var(--success);
}

.attendance-opt-btn.absent:hover, 
.attendance-opt-btn.absent.active {
    background-color: var(--danger);
    color: white;
    border-color: var(--danger);
}

.attendance-opt-btn.leave:hover, 
.attendance-opt-btn.leave.active {
    background-color: var(--warning);
    color: white;
    border-color: var(--warning);
}

/* Toast Notification Styles via SweetAlert/Toastr override */
.toastr-custom {
    font-family: var(--font-body) !important;
}

/* Premium Floating Background Blobs */
.login-bg-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    z-index: -1;
    background-image: linear-gradient(rgba(15, 23, 42, 0.45), rgba(15, 23, 42, 0.55)), url('../img/school_bg.png'); /* Overlay for perfect readability */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

[data-theme="dark"] .login-bg-blobs {
    background-image: linear-gradient(rgba(2, 6, 19, 0.7), rgba(2, 6, 19, 0.8)), url('../img/school_bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.blob {
    display: none !important; /* Hide gradient blobs to let the high-quality school background shine */
}

@keyframes floatBlob {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(45px, -70px) scale(1.1);
    }
    66% {
        transform: translate(-30px, 30px) scale(0.9);
    }
}

/* Input Fields with Prefix Icons */
.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.input-with-icon .input-icon {
    position: absolute;
    left: 15px;
    color: #94a3b8;
    font-size: 14px;
    pointer-events: none;
    transition: color 0.3s ease;
}

.input-with-icon .form-control {
    padding-left: 42px !important;
}

.input-with-icon .form-control:focus + .input-icon {
    color: #6366f1;
}

/* Login Page Split-Card Styling */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    padding: 20px;
    width: 100%;
    position: relative;
}

.login-card-container {
    display: flex;
    background: rgba(255, 255, 255, 0.85); /* Perfect frosted glass transparency */
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 24px;
    width: 100%;
    max-width: 1050px;
    min-height: 620px;
    box-shadow: 0 35px 60px -15px rgba(0, 0, 0, 0.3); /* Strong drop shadow for separation */
    overflow: hidden;
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] .login-card-container {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 35px 60px -15px rgba(0, 0, 0, 0.6);
}

/* Left Panel - White background Form */
.login-left-panel {
    width: 55%;
    padding: 50px 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: rgba(255, 255, 255, 0.6); /* Slightly more frosted white */
    color: #0f172a;
}

[data-theme="dark"] .login-left-panel {
    background: rgba(15, 23, 42, 0.6);
    color: #f8fafc;
}

.login-left-panel h2 {
    font-size: 26px;
    font-weight: 700;
    color: #2c3a59;
    margin-bottom: 6px;
    font-family: var(--font-heading);
}

.login-left-panel .subtitle {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 25px;
}

.login-left-panel .form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
}

.login-left-panel .form-control {
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    color: #1e293b;
    border-radius: 8px;
    height: 44px;
    padding: 10px 16px;
    font-size: 14px;
}

.login-left-panel .form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.login-form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    margin-bottom: 20px;
    margin-top: -10px;
}

.login-form-options a {
    color: var(--accent);
    font-weight: 600;
}

.login-form-options a:hover {
    text-decoration: underline;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #64748b;
    cursor: pointer;
}

.checkbox-container input {
    cursor: pointer;
}

/* Beautiful Teal Login Button */
.btn-signin {
    width: 100%;
    height: 46px;
    background: var(--primary-gradient);
    color: #ffffff;
    font-weight: 700;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.25);
    transition: var(--transition);
}

.btn-signin:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(13, 148, 136, 0.35);
}

.signup-text {
    text-align: center;
    font-size: 13px;
    color: #64748b;
    margin-top: 18px;
    margin-bottom: 20px;
}

.signup-text a {
    color: var(--accent);
    font-weight: 700;
}

.signup-text a:hover {
    text-decoration: underline;
}

/* Play Store Badge Simulation */
.parents-message-sec {
    border-top: 1px solid #e2e8f0;
    padding-top: 18px;
    font-size: 11px;
    color: #64748b;
    line-height: 1.5;
}

.parents-message-sec h4 {
    color: var(--accent);
    font-weight: 700;
    margin-bottom: 6px;
    font-size: 11px;
}

.playstore-btn {
    display: inline-flex;
    align-items: center;
    background-color: #000000;
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 10px;
    gap: 8px;
    margin-top: 12px;
    font-weight: 600;
    text-transform: uppercase;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    transition: var(--transition);
}

.playstore-btn:hover {
    background-color: #1a1a1a;
    transform: translateY(-1px);
}

.playstore-btn i {
    font-size: 18px;
}

.playstore-btn-text {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.playstore-btn-text span {
    font-size: 8px;
    color: #94a3b8;
    text-transform: none;
}

/* Right Panel - Premium branding circle graphic */
.login-right-panel {
    width: 45%;
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%); /* Premium brand gradient */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
    color: #ffffff;
}

.graphic-circle-wrapper {
    position: relative;
    width: 380px;
    height: 380px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.4);
    background-color: rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 24px;
    text-align: center;
}

.arabic-header {
    font-family: 'Noto Naskh Arabic', 'Amiri', 'Georgia', serif;
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.graphic-parag {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.6;
    margin-top: 12px;
    max-width: 300px;
}

.graphic-partner-image {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    border: 4px solid #ffffff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    object-fit: cover;
    margin: 8px 0;
    transition: transform 0.5s ease;
}

.graphic-partner-image:hover {
    transform: scale(1.05);
}

/* Floating badges surrounding circular frame */
.floating-badge {
    position: absolute;
    width: 50px;
    height: 50px;
    background-color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
    z-index: 10;
    animation: pulse 3s infinite ease-in-out;
}

.floating-badge.badge-excellence {
    top: 50%;
    left: -25px;
    transform: translateY(-50%);
    border: 2px solid #e11d48; /* deep rose border */
    font-size: 11px;
    font-weight: 800;
    color: #e11d48;
    animation-delay: 0s;
}

.floating-badge.badge-tech {
    top: 50%;
    right: -25px;
    transform: translateY(-50%);
    border: 2px solid #3b82f6; /* electric blue border */
    font-size: 10px;
    font-weight: 800;
    color: #3b82f6;
    animation-delay: 0.8s;
}

.floating-badge.badge-care {
    bottom: 5px;
    left: 20px;
    border: 2px solid #10b981; /* mint green border */
    font-size: 9px;
    font-weight: 800;
    color: #10b981;
    animation-delay: 1.5s;
}

.floating-badge.badge-success {
    bottom: 5px;
    right: 20px;
    border: 2px solid #f59e0b; /* golden amber border */
    font-size: 10px;
    font-weight: 800;
    color: #f59e0b;
    animation-delay: 2.2s;
}

.floating-badge img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.captcha-container {
    display: flex;
    gap: 8px;
    align-items: center;
}

.captcha-image-canvas {
    background: linear-gradient(135deg, #f1f5f9 0%, #cbd5e1 100%);
    border-radius: 6px;
    height: 38px;
    width: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #cbd5e1;
}

.captcha-refresh-btn {
    width: 38px;
    height: 38px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background-color: #f8fafc;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
}

.captcha-refresh-btn:hover {
    background-color: #e2e8f0;
    transform: rotate(180deg);
}


/* Footer layout */
.footer-text {
    text-align: center;
    font-size: 11px;
    color: var(--text-light);
    margin-top: auto;
    padding-top: 40px;
    padding-bottom: 10px;
    border-top: 1px solid var(--border-color);
}

/* Sidebar logo improvement */
.sidebar-logo img {
    filter: drop-shadow(0 2px 8px rgba(213,24,117,0.3));
    transition: var(--transition);
}

.sidebar-logo img:hover {
    filter: drop-shadow(0 4px 12px rgba(213,24,117,0.5));
    transform: scale(1.05);
}

/* Print Stylesheet */

@media print {
    /* Hide all non-printable elements */
    .sidebar, 
    .top-header, 
    .no-print, 
    footer, 
    .sidebar-toggle, 
    .no-print-toolbar, 
    .logout-btn, 
    .dashboard-grid {
        display: none !important;
    }
    
    /* Reset layout wrappers to allow standard block flow */
    html, body {
        background: #ffffff !important;
        color: #000000 !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        display: block !important;
    }
    
    .dashboard-wrapper, 
    .main-content {
        padding: 0 !important;
        margin: 0 !important;
        background: transparent !important;
        width: 100% !important;
        height: auto !important;
        display: block !important;
        overflow: visible !important;
        box-shadow: none !important;
    }
    
    /* Transform active modal into a static block at the top of the canvas */
    .modal.active {
        position: static !important;
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        background: transparent !important;
        backdrop-filter: none !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .modal.active .modal-container {
        position: static !important;
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        border: none !important;
        box-shadow: none !important;
        transform: none !important;
        background: transparent !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .modal.active .modal-body {
        padding: 0 !important;
        margin: 0 !important;
        overflow: visible !important;
        display: block !important;
    }
    
    .challan-print-area {
        display: block !important;
        position: relative !important;
        width: 100% !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        background: transparent !important;
        overflow: visible !important;
    }
    
    .challan-copy-block {
        page-break-inside: avoid;
        break-inside: avoid;
        display: block !important;
    }
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .login-body {
        padding: 12px;
    }
    .login-card-container {
        flex-direction: column;
        max-width: 480px;
        min-height: auto;
        border-radius: 20px;
    }
    .login-left-panel {
        width: 100% !important;
        padding: 40px 24px !important;
    }
    .login-right-panel {
        display: none !important; /* Cleanly hide visual panel on tablets and mobile screens to prevent cramming */
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.active {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 24px;
    }
    .top-header {
        margin-top: 40px;
    }
    .sidebar-toggle {
        display: flex !important;
    }
}

/* Mobile Sidebar Toggle Button */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 200;
    width: 40px;
    height: 40px;
    background-color: var(--bg-sidebar);
    color: white;
    border-radius: 4px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    border: none;
}

/* Digital ID Card Styling */
.id-card-wrapper {
    perspective: 1000px;
    width: 320px;
    height: 470px;
    margin: 0 auto;
}

.id-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.id-card-inner.flipped {
    transform: rotateY(180deg);
}

.id-card-front, .id-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 16px;
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 45%, #064e3b 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 15px 35px rgba(6, 78, 59, 0.25);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-align: left;
    color: #ffffff;
}

.id-card-back {
    transform: rotateY(180deg);
}

.id-card-header {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 16px 15px;
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.id-card-header::after {
    display: none;
}

[data-theme="dark"] .id-card-header::after {
    display: none;
}

.id-card-school-title {
    font-family: var(--font-heading);
    font-size: 13.5px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin: 0;
    color: #ffffff;
}

.id-card-school-subtitle {
    font-size: 9px;
    opacity: 0.85;
    margin: 2px 0 0 0;
    font-weight: 500;
    letter-spacing: 0.5px;
    color: #ffffff;
}

.id-card-body {
    padding: 18px 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.id-card-photo-container {
    width: 90px;
    height: 90px;
    border-radius: 8px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    position: relative;
}

.id-card-photo-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.id-card-photo-container i {
    font-size: 40px;
    color: #a7f3d0;
}

.initials-avatar-idcard {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2dd4bf 0%, #0d9488 100%);
    color: #ffffff;
    font-size: 32px;
    font-weight: 800;
    font-family: var(--font-heading);
}

.id-card-student-name {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
    text-align: center;
}

.id-card-badge-role {
    font-size: 9px;
    font-weight: 800;
    background-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    padding: 3px 9px;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

[data-theme="dark"] .id-card-badge-role {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.15);
}

.id-card-details-grid {
    width: 100%;
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 12px;
    row-gap: 6px;
    font-size: 11.5px;
    margin-top: 5px;
}

.id-card-label {
    font-weight: 700;
    color: #a7f3d0;
}

.id-card-value {
    font-weight: 600;
    color: #ffffff;
    text-align: right;
}

.id-card-footer {
    padding: 12px;
    border-top: 1px dashed rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: #ffffff;
}

.barcode-container {
    width: 90%;
    height: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.barcode-bars {
    width: 100%;
    height: 20px;
    background: linear-gradient(90deg, 
        #000 0%, #000 2%, transparent 2%, transparent 4%,
        #000 4%, #000 7%, transparent 7%, transparent 8%,
        #000 8%, #000 9%, transparent 9%, transparent 12%,
        #000 12%, #000 13%, transparent 13%, transparent 15%,
        #000 15%, #000 18%, transparent 18%, transparent 19%,
        #000 19%, #000 20%, transparent 20%, transparent 24%,
        #000 24%, #000 25%, transparent 25%, transparent 26%,
        #000 26%, #000 29%, transparent 29%, transparent 32%,
        #000 32%, #000 35%, transparent 35%, transparent 36%,
        #000 36%, #000 38%, transparent 38%, transparent 40%,
        #000 40%, #000 41%, transparent 41%, transparent 44%,
        #000 44%, #000 47%, transparent 47%, transparent 48%,
        #000 48%, #000 50%, transparent 50%, transparent 52%,
        #000 52%, #000 55%, transparent 55%, transparent 58%,
        #000 58%, #000 60%, transparent 60%, transparent 63%,
        #000 63%, #000 65%, transparent 65%, transparent 66%,
        #000 66%, #000 68%, transparent 68%, transparent 72%,
        #000 72%, #000 75%, transparent 75%, transparent 76%,
        #000 76%, #000 78%, transparent 78%, transparent 80%,
        #000 80%, #000 83%, transparent 83%, transparent 84%,
        #000 84%, #000 86%, transparent 86%, transparent 90%,
        #000 90%, #000 92%, transparent 92%, transparent 95%,
        #000 95%, #000 98%, transparent 98%, #000 100%
    );
}

[data-theme="dark"] .barcode-bars {
    filter: none;
}

.barcode-text {
    font-size: 8px;
    font-family: monospace;
    letter-spacing: 2px;
    margin-top: 2px;
    color: #475569;
}

.id-card-back .id-card-body {
    align-items: flex-start;
    gap: 8px;
    padding-top: 15px;
}

.id-card-back-title {
    font-size: 10.5px;
    font-weight: 800;
    color: #a7f3d0;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    width: 100%;
    padding-bottom: 4px;
    margin-bottom: 4px;
}

.id-card-rules {
    font-size: 9.5px;
    color: #e2e8f0;
    line-height: 1.4;
    padding-left: 15px;
    margin: 0;
}

.id-card-rules li {
    margin-bottom: 4px;
}

.id-card-signature-area {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: auto;
    padding-top: 10px;
}

.id-card-sig-box {
    text-align: center;
    font-size: 8px;
    color: #a7f3d0;
}

.id-card-sig-line {
    width: 90px;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    margin-bottom: 4px;
}

.id-card-sig-image {
    font-family: 'Georgia', serif;
    font-style: italic;
    font-size: 12px;
    color: #ffffff;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* RTL Support for ID Card */
body[direction="rtl"] .id-card-front,
body[direction="rtl"] .id-card-back {
    text-align: right;
}

body[direction="rtl"] .id-card-details-grid {
    column-gap: 12px;
}

body[direction="rtl"] .id-card-value {
    text-align: left;
}

body[direction="rtl"] .id-card-back-title {
    text-align: right;
}

body[direction="rtl"] .id-card-rules {
    padding-left: 0;
    padding-right: 15px;
}

/* Status Dot Pulse Animation */
.status-dot-pulse {
    width: 7px;
    height: 7px;
    background-color: #10b981;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: statusPulse 1.6s infinite;
}

@keyframes statusPulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Print Styles for ID Card */
@media print {
    .id-card-print-container {
        display: flex !important;
        gap: 30px;
        justify-content: center;
        padding: 50px 0;
        background: #ffffff;
    }
    
    .id-card-print-container .id-card-front,
    .id-card-print-container .id-card-back {
        position: relative;
        display: flex;
        box-shadow: none;
        border: 1px solid #000000;
        page-break-inside: avoid;
    }
    
    .id-card-print-container .id-card-back {
        transform: none;
    }
    
    .id-card-inner.flipped {
        transform: none;
    }
    
    .id-card-print-container .barcode-bars {
        filter: none !important;
    }
}

/* ================= BIOMETRIC & FACE SCANNER INTERFACE ================= */

.biometric-scanner-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

@media (max-width: 768px) {
    .biometric-scanner-grid {
        grid-template-columns: 1fr;
    }
}

.scanner-terminal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    box-shadow: var(--card-shadow);
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.webcam-live-viewport {
    width: 100%;
    max-width: 480px;
    aspect-ratio: 4/3;
    margin: 0 auto;
    position: relative;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    border: 2px solid var(--primary);
    background: #020617;
    box-shadow: 0 0 20px rgba(13, 148, 136, 0.2);
}

.webcam-stream-source {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.webcam-canvas-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.scanner-hud-overlay {
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    bottom: 15px;
    pointer-events: none;
    z-index: 12;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-family: monospace;
    font-size: 11px;
    color: var(--accent);
    text-shadow: 0 0 4px rgba(16, 185, 129, 0.8);
}

.scanner-hud-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.scanner-hud-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.scanner-blink-dot {
    width: 8px;
    height: 8px;
    background-color: var(--danger);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--danger);
    display: inline-block;
    animation: pulse 1s infinite alternate;
}

.scanner-laser-line {
    position: absolute;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    box-shadow: 0 0 12px var(--accent);
    opacity: 0.8;
    z-index: 11;
    pointer-events: none;
    animation: laserMove 2.5s infinite ease-in-out;
}

@keyframes laserMove {
    0%, 100% { top: 0%; }
    50% { top: 100%; }
}

.fingerprint-sensor-circle {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: rgba(13, 148, 136, 0.05);
    border: 2px dashed var(--primary);
    margin: 25px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    user-select: none;
    -webkit-user-drag: none;
    transition: var(--transition);
}

.fingerprint-sensor-circle:hover {
    background: rgba(13, 148, 136, 0.1);
    transform: scale(1.03);
    box-shadow: 0 0 15px rgba(13, 148, 136, 0.15);
}

.fingerprint-sensor-circle i {
    font-size: 56px;
    color: var(--primary);
    transition: var(--transition);
}

.fingerprint-sensor-circle.scanning {
    border-color: var(--accent);
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.1);
}

.fingerprint-sensor-circle.scanning i {
    color: var(--accent);
    animation: fingerPulse 0.8s infinite alternate;
}

.fingerprint-sensor-circle.success {
    border-color: var(--accent);
    background: rgba(16, 185, 129, 0.2);
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.5);
}

.fingerprint-sensor-circle.success i {
    color: var(--accent);
    transform: scale(1.1);
}

.fingerprint-sensor-circle.error {
    border-color: var(--danger);
    background: rgba(220, 38, 38, 0.1);
    box-shadow: 0 0 25px rgba(220, 38, 38, 0.3);
}

.fingerprint-sensor-circle.error i {
    color: var(--danger);
}

@keyframes fingerPulse {
    0% { transform: scale(0.95); opacity: 0.8; }
    100% { transform: scale(1.05); opacity: 1; }
}

.fingerprint-progress-svg {
    position: absolute;
    top: -2px;
    left: -2px;
    width: 134px;
    height: 134px;
    transform: rotate(-90deg);
    pointer-events: none;
}

.fingerprint-progress-svg circle {
    fill: none;
    stroke-width: 4px;
}

.fingerprint-progress-svg .bg-track {
    stroke: transparent;
}

.fingerprint-progress-svg .progress-bar {
    stroke: var(--accent);
    stroke-dasharray: 408;
    stroke-dashoffset: 408;
    transition: stroke-dashoffset 0.1s linear;
}

.biometric-status-msg {
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    margin-top: 15px;
    min-height: 20px;
    color: var(--text-muted);
}

.student-match-card-pop {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: var(--border-radius-sm);
    padding: 15px;
    margin-top: 15px;
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.student-match-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    object-fit: cover;
    background: var(--bg-card);
}

.student-match-info {
    flex: 1;
}

.student-match-info h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 2px;
}

.student-match-info p {
    font-size: 11px;
    color: var(--text-muted);
}

.student-match-score {
    font-size: 12px;
    font-weight: 800;
    color: var(--accent);
    background: var(--accent-light);
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

[data-theme="dark"] .student-match-score {
    background: rgba(16, 185, 129, 0.15);
}

.cyber-panel-title {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--primary);
    text-transform: uppercase;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.scanner-btn-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.scanner-btn-tab {
    flex: 1;
    padding: 10px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.scanner-btn-tab:hover {
    background: var(--bg-main);
    color: var(--text-main);
}

.scanner-btn-tab.active {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

[data-theme="dark"] .scanner-btn-tab.active {
    background: rgba(13, 148, 136, 0.15);
    color: var(--primary);
}

/* ================= MOBILE RESPONSIVE OVERRIDES & FIXES ================= */
@media (max-width: 768px) {
    /* 0. Robust Sidebar Position & Stacking (Fixes Android WebView GPU Transparency Glitches) */
    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: -280px !important; /* Off-screen using left layout */
        width: 280px !important;
        height: 100vh !important;
        z-index: 9999 !important; /* Force to render above the page content */
        background-color: #0f172a !important; /* Light mode solid fallback */
        background: var(--bg-sidebar) !important; /* Force theme solid background */
        padding: 75px 24px 24px 24px !important; /* Clear spacing at top to prevent overlap with the menu toggle button */
        transform: translate3d(0, 0, 0) !important; /* Force GPU composite layer to solve transparency rendering bugs */
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        will-change: left;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        box-shadow: 4px 0 25px rgba(0, 0, 0, 0.25) !important;
    }
    
    [data-theme="dark"] .sidebar {
        background-color: #070a12 !important; /* Dark mode solid fallback */
        background: var(--bg-sidebar) !important;
    }
    
    .sidebar.active {
        left: 0 !important; /* Slide in on active */
        transform: translate3d(0, 0, 0) !important;
    }

    .sidebar-toggle {
        display: flex !important;
        z-index: 10000 !important; /* Place on top of the sidebar so it remains clickable */
    }

    /* 1. Top Header Flex Stacking */
    .top-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 14px !important;
        margin-top: 55px !important; /* Ensure spacing to clear the fixed sidebar-toggle */
        width: 100% !important;
    }
    
    .header-title {
        width: 100% !important;
    }
    
    .header-title h1 {
        font-size: 20px !important;
        line-height: 1.35 !important;
        word-wrap: break-word;
    }
    
    .header-title p {
        font-size: 12px !important;
        line-height: 1.4 !important;
        margin-top: 6px !important;
    }
    
    .header-actions {
        width: 100% !important;
        flex-wrap: wrap !important;
        justify-content: flex-start !important;
        gap: 10px !important;
        margin-top: 4px !important;
    }

    /* 2. Welcome Banner Responsive Layout */
    .welcome-hero-card {
        flex-direction: column !important;
        align-items: flex-start !important;
        padding: 20px 24px !important;
        gap: 16px !important;
    }
    
    .welcome-hero-card::after {
        display: none !important; /* Prevent background decorative shapes from causing layout shifts or overflow */
    }
    
    .welcome-text {
        width: 100% !important;
    }
    
    .welcome-text h2 {
        font-size: 19px !important;
        flex-wrap: wrap;
        gap: 8px !important;
        line-height: 1.3 !important;
    }
    
    .welcome-text p {
        font-size: 12.5px !important;
        line-height: 1.45 !important;
    }
    
    .system-status-pills {
        width: 100% !important;
        justify-content: flex-start !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    .status-pill {
        padding: 5px 10px !important;
        font-size: 10px !important;
    }
}

@media (max-width: 480px) {
    /* 3. Small Mobile Layout Overrides (<= 480px) */
    .main-content {
        padding: 16px !important;
        gap: 16px !important;
    }
    
    .top-header {
        margin-top: 45px !important;
    }
    
    .sidebar-toggle {
        top: 10px !important;
        left: 10px !important;
        width: 36px !important;
        height: 36px !important;
        font-size: 14px !important;
    }

    .welcome-hero-card {
        padding: 16px 18px !important;
    }

    .welcome-text h2 {
        font-size: 17px !important;
    }
}



/* Sidebar Scrollbar */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 10px; }
.sidebar::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.3); }


/* Submenu Scrollbar & Overflow customization */
.menu-item.open .submenu-menu {
    overflow-y: auto; /* Enable scrolling for large submenus */
}
.submenu-menu::-webkit-scrollbar {
    width: 4px;
}
.submenu-menu::-webkit-scrollbar-track {
    background: transparent;
}
.submenu-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}
.submenu-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}
