/* ASTMS - Main Stylesheet */

:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --light-bg: #f8fafc;
    --dark-bg: #1e293b;
    --border-color: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --radius-sm: 10px;
    --radius-md: 15px;
    --radius-lg: 20px;
    --max-content-width: 1200px;
    --max-content-wide: 1400px;
    --container-padding: clamp(1.5rem, 3vw, 2.5rem);
    --container-padding-tight: clamp(1rem, 2.4vw, 1.75rem);
}

body.sidebar-open {
    overflow: hidden;
}

:root {
    --sidebar-overlay-z: 1050;
}

body.sidebar-open::after {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
    z-index: var(--sidebar-overlay-z);
}

/* Global Dark Mode Styles */
body {
    --background-color: #fff;
    --text-primary: #333;
    --text-secondary: #666;
    --primary-color: #2563eb;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --light-bg: #f9f9f9;
    --border-color: #e5e7eb;
    background-color: var(--background-color);
    color: var(--text-primary);
    transition: background-color 0.3s, color 0.3s;
}

body.dark-mode {
    --background-color: #121212;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --primary-color: #3b82f6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --light-bg: #1e1e1e;
    --border-color: #333;
    background-color: var(--background-color);
    color: var(--text-primary);
}

.card, .record-row, .sidebar, .main-content, .stat-card, .table, .navbar {
    background-color: var(--light-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

.status-badge, .record-status {
    background: rgba(16, 185, 129, 0.1);
}

body.dark-mode .status-approved { background: rgba(16, 185, 129, 0.3); color: #fff; }
body.dark-mode .status-pending { background: rgba(245, 158, 11, 0.3); color: #fff; }
body.dark-mode .status-rejected { background: rgba(239, 68, 68, 0.3); color: #fff; }

button, a.btn {
    background-color: var(--primary-color);
    color: white;
    transition: background-color 0.3s;
}

body.dark-mode button, body.dark-mode a.btn {
    background-color: var(--primary-color);
    color: white;
}

/* Ensure other elements adapt to dark mode if needed */
.dropdown-content, .sidebar-nav a {
    background-color: var(--light-bg);
    color: var(--text-primary);
}

body.dark-mode .dropdown-content, body.dark-mode .sidebar-nav a {
    background-color: #1e1e1e;
    color: #e0e0e0;
}

/* Scholar Portal Dark Mode Enhancements */
body.dark-mode .dashboard-container {
    background: radial-gradient(circle at top left, rgba(37, 99, 235, 0.18), transparent 55%),
                linear-gradient(180deg, #0f172a 0%, #050b18 100%);
}

body.dark-mode .content-wrapper {
    background: transparent;
    color: #f8fafc;
}

body.dark-mode .card {
    background: linear-gradient(165deg, rgba(15, 23, 42, 0.95), rgba(15, 118, 226, 0.08));
    border: 1px solid rgba(59, 130, 246, 0.18);
    box-shadow: 0 20px 45px rgba(8, 47, 73, 0.5);
}

body.dark-mode .card-header {
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

body.dark-mode .card-title,
body.dark-mode .card h2,
body.dark-mode .card h3,
body.dark-mode .card p,
body.dark-mode .card span {
    color: #f8fafc;
}

body.dark-mode .stats-grid .stat-card,
body.dark-mode .stat-card {
    background: radial-gradient(circle at top left, rgba(59, 130, 246, 0.22), transparent 55%),
                linear-gradient(160deg, rgba(15, 23, 42, 0.95), rgba(30, 64, 175, 0.18));
    border: 1px solid rgba(59, 130, 246, 0.18);
    box-shadow: 0 18px 38px rgba(8, 47, 73, 0.45);
}

body.dark-mode .stat-value {
    color: #f8fafc;
}

body.dark-mode .stat-label {
    color: #94a3b8;
}

body.dark-mode .stat-icon.primary,
body.dark-mode .stat-icon.success,
body.dark-mode .stat-icon.warning,
body.dark-mode .stat-icon.danger {
    background: rgba(37, 99, 235, 0.16);
    color: #93c5fd;
}

body.dark-mode .table {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(59, 130, 246, 0.12);
}

body.dark-mode .table thead {
    background: rgba(59, 130, 246, 0.18);
    color: #f8fafc;
}

body.dark-mode .table tbody tr {
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

body.dark-mode .table tbody tr:hover {
    background: rgba(37, 99, 235, 0.16);
}

body.dark-mode .badge,
body.dark-mode .status-badge {
    border: none;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.25);
}

body.dark-mode .progress-bar,
body.dark-mode .progress {
    background: rgba(148, 163, 184, 0.25);
}

body.dark-mode .progress-fill,
body.dark-mode .progress .progress-bar {
    background: linear-gradient(90deg, #3b82f6, #6366f1) !important;
}

body.dark-mode .form-control,
body.dark-mode select,
body.dark-mode textarea,
body.dark-mode input[type="text"],
body.dark-mode input[type="email"],
body.dark-mode input[type="password"],
body.dark-mode input[type="number"],
body.dark-mode input[type="date"],
body.dark-mode input[type="time"] {
    background: rgba(15, 23, 42, 0.78);
    border: 1px solid rgba(59, 130, 246, 0.22);
    color: #f8fafc;
}

body.dark-mode .scholar-card {
    background: linear-gradient(165deg, rgba(15, 23, 42, 0.95), rgba(30, 64, 175, 0.18));
    border: 1px solid rgba(59, 130, 246, 0.18);
    box-shadow: 0 18px 40px rgba(8, 47, 73, 0.45);
}

body.dark-mode .scholar-card::after {
    background: linear-gradient(140deg, rgba(59, 130, 246, 0.22), transparent 55%);
}

body.dark-mode .scholar-card .action-buttons .btn-secondary {
    background: rgba(148, 163, 184, 0.25);
    border: 1px solid rgba(203, 213, 225, 0.25);
    color: #f8fafc;
    box-shadow: 0 14px 30px rgba(8, 47, 73, 0.45);
}

body.dark-mode .scholar-card .action-buttons .btn-secondary:hover {
    background: rgba(148, 163, 184, 0.3);
}

body.dark-mode .scholar-info p,
body.dark-mode .meta-value {
    color: #cbd5f5;
}

body.dark-mode .meta-label {
    color: #94a3b8;
}

body.dark-mode .meta-highlight {
    background: rgba(59, 130, 246, 0.25);
    color: #bfdbfe;
}

body.dark-mode .progress-bar {
    background: rgba(148, 163, 184, 0.25);
}

body.dark-mode .progress-fill {
    background: linear-gradient(90deg, #3b82f6, #6366f1);
}

body.dark-mode .form-control::placeholder,
body.dark-mode textarea::placeholder {
    color: #94a3b8;
}

body.dark-mode .filter-controls select {
    background: rgba(15, 23, 42, 0.78);
    border: 1px solid rgba(59, 130, 246, 0.22);
    color: #f8fafc;
}

body.dark-mode .alert-success {
    background: rgba(34, 197, 94, 0.16);
    border: 1px solid rgba(34, 197, 94, 0.35);
    color: #bbf7d0;
}

body.dark-mode .alert-danger {
    background: rgba(239, 68, 68, 0.16);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fecaca;
}

body.dark-mode .empty-state {
    color: #cbd5f5;
}

body.dark-mode .empty-state i {
    color: rgba(96, 165, 250, 0.65);
}

/* Add more adaptations as needed for full coverage */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 100%;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    min-height: 100vh;
    min-height: 100dvh;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: clamp(0.95rem, 0.28vw + 0.85rem, 1.05rem);
    min-height: inherit;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

img,
svg,
video,
canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

picture {
    display: block;
}

/* Login Page Styles */
.login-container {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: clamp(1.5rem, 4vw, 3rem);
}

.login-box {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    width: min(100%, 440px);
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: clamp(2rem, 4vw, 2.75rem) clamp(1.5rem, 3vw, 2.5rem);
    text-align: center;
}

.login-header h1 {
    font-size: clamp(1.75rem, 2.2vw + 1.4rem, 2.25rem);
    margin-bottom: 0.65rem;
    font-weight: 700;
}

.login-header p {
    opacity: 0.9;
    font-size: clamp(0.95rem, 0.35vw + 0.85rem, 1.05rem);
}

.login-body {
    padding: clamp(2rem, 4vw, 2.75rem) clamp(1.5rem, 3vw, 2.5rem);
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
    background-color: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-group {
    position: relative;
}

.input-group-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.input-group .form-control {
    padding-left: 45px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: clamp(0.7rem, 2vw, 1rem) clamp(1.5rem, 3.5vw, 2.5rem);
    border: none;
    border-radius: var(--radius-sm);
    font-size: clamp(0.95rem, 0.3vw + 0.9rem, 1.05rem);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.alert {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border-left: 4px solid var(--success-color);
}

.alert-danger {
    background-color: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--danger-color);
}

.alert-info {
    background-color: #dbeafe;
    color: #1e40af;
    border-left: 4px solid var(--info-color);
}

/* Dashboard Layout */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: var(--dark-bg);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: transform 0.3s ease;
    left: 0;
    top: 0;
    z-index: 1100;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.38);
}

.sidebar-header {
    padding: 30px 25px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    font-size: 24px;
    font-weight: 700;
}

.sidebar-menu {
    padding: 20px 0;
}

.menu-item {
    display: block;
    padding: 15px 25px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding-left: 30px;
}

.menu-item.active {
    background: var(--primary-color);
    color: white;
}

.menu-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: white;
}

body:not(.dark-mode) .sidebar {
    background: linear-gradient(180deg, #ffffff 0%, #f5f7fb 100%);
    color: var(--text-primary);
    border-right: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 12px 0 32px rgba(15, 23, 42, 0.08);
}

body:not(.dark-mode) .sidebar-header {
    background: rgba(37, 99, 235, 0.08);
    border-bottom: 1px solid rgba(148, 163, 184, 0.24);
    color: var(--text-primary);
}

body:not(.dark-mode) .sidebar-header h2 {
    color: var(--text-primary);
}

body:not(.dark-mode) .menu-item {
    color: rgba(30, 41, 59, 0.9);
    font-weight: 500;
}

body:not(.dark-mode) .menu-item .menu-icon {
    color: var(--primary-color);
}

body:not(.dark-mode) .menu-item:hover {
    background: rgba(37, 99, 235, 0.14);
    color: var(--primary-color);
}

body:not(.dark-mode) .menu-item:hover .menu-icon {
    color: var(--primary-dark);
}

body:not(.dark-mode) .menu-item.active {
    background: var(--primary-color);
    color: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

body:not(.dark-mode) .menu-item.active .menu-icon {
    color: #ffffff;
}

.menu-icon {
    margin-right: 12px;
    width: 20px;
    display: inline-block;
}

.main-content {
    margin-left: 280px;
    flex: 1;
    width: 100%;
    background: var(--light-bg);
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.top-navbar {
    background: white;
    padding: 20px 30px;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    text-align: right;
}

.user-name {
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    font-size: 12px;
    color: var(--text-secondary);
}

body.dark-mode .top-navbar {
    background: #1f2937;
    border-bottom: 1px solid #374151;
    box-shadow: none;
}

body.dark-mode .navbar-title,
body.dark-mode .user-name,
body.dark-mode .menu-toggle {
    color: #f3f4f6;
}

body.dark-mode .user-role {
    color: #9ca3af;
}

body.dark-mode .menu-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--primary-color);
}

body.dark-mode .top-navbar .fas,
body.dark-mode .top-navbar .far {
    color: #e5e7eb;
}

body.dark-mode .navbar-user .dropdown-toggle {
    color: #f3f4f6;
    border-color: #374151;
}

body.dark-mode .navbar-user .dropdown-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
}

body.dark-mode .main-content {
    background: linear-gradient(160deg, rgba(15, 23, 42, 0.92) 0%, rgba(8, 47, 73, 0.85) 50%, rgba(30, 64, 175, 0.25) 100%);
}

body.dark-mode .content-wrapper {
    color: #e2e8f0;
}

body.dark-mode .card {
    background: radial-gradient(circle at top left, rgba(37, 99, 235, 0.18), transparent 55%),
                linear-gradient(165deg, #1f2937 0%, #111827 100%);
    border: 1px solid rgba(59, 130, 246, 0.12);
    box-shadow: 0 18px 40px rgba(8, 47, 73, 0.45);
}

body.dark-mode .card-header {
    border-bottom: 1px solid rgba(59, 130, 246, 0.12);
}

body.dark-mode .card-title,
body.dark-mode .card h2,
body.dark-mode .card h3 {
    color: #f8fafc;
}

body.dark-mode .card-body p,
body.dark-mode .card-body span,
body.dark-mode .card-body small {
    color: #cbd5f5;
}

body.dark-mode .stats-grid .stat-card,
body.dark-mode .stat-card {
    background: linear-gradient(165deg, rgba(15, 23, 42, 0.95), rgba(30, 64, 175, 0.18));
    border: 1px solid rgba(59, 130, 246, 0.14);
    box-shadow: 0 14px 32px rgba(8, 47, 73, 0.45);
}

body.dark-mode .stat-card::before {
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.65), rgba(99, 102, 241, 0.55));
}

body.dark-mode .stat-value {
    color: #f8fafc;
}

body.dark-mode .stat-label {
    color: #94a3b8;
}

body.dark-mode .stat-icon.primary,
body.dark-mode .stat-icon.success,
body.dark-mode .stat-icon.warning,
body.dark-mode .stat-icon.info,
body.dark-mode .stat-icon.danger {
    background: rgba(37, 99, 235, 0.18);
    color: #bfdbfe;
}

body.dark-mode .stat-icon.success {
    background: rgba(16, 185, 129, 0.18);
    color: #bbf7d0;
}

body.dark-mode .stat-icon.warning {
    background: rgba(245, 158, 11, 0.18);
    color: #fde68a;
}

body.dark-mode .stat-icon.danger {
    background: rgba(239, 68, 68, 0.18);
    color: #fecdd3;
}

body.dark-mode .table {
    background: rgba(15, 23, 42, 0.85);
}

body.dark-mode .table thead {
    background: rgba(59, 130, 246, 0.12);
}

body.dark-mode .table th {
    color: #cbd5f5;
    border-bottom: 1px solid rgba(59, 130, 246, 0.18);
}

body.dark-mode .table td {
    color: #e2e8f0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

body.dark-mode .table tbody tr:hover {
    background: rgba(59, 130, 246, 0.12);
}

body.dark-mode .badge,
body.dark-mode .status-badge,
body.dark-mode .approval-badge,
body.dark-mode .status-approved,
body.dark-mode .status-pending,
body.dark-mode .status-rejected {
    border: 1px solid rgba(148, 163, 184, 0.25);
    color: #f8fafc;
}

body.dark-mode .status-approved {
    background: rgba(16, 185, 129, 0.25);
}

body.dark-mode .status-pending {
    background: rgba(245, 158, 11, 0.25);
}

body.dark-mode .status-rejected {
    background: rgba(239, 68, 68, 0.25);
}

body.dark-mode .empty-state span {
    color: #e2e8f0;
}

body.dark-mode .time-clock {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(37, 99, 235, 0.25));
    color: #f8fafc;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.45);
}

body.dark-mode .date-display {
    color: #cbd5f5;
}

body.dark-mode .time-buttons .btn-time {
    border-color: rgba(148, 163, 184, 0.25);
    box-shadow: 0 10px 24px rgba(8, 47, 73, 0.4);
}

body.dark-mode .btn-time-in {
    background: rgba(248, 250, 252, 0.12);
    color: #bfdbfe;
}

body.dark-mode .btn-time-in:hover {
    background: rgba(191, 219, 254, 0.18);
}

body.dark-mode .btn-time-out {
    background: rgba(37, 99, 235, 0.12);
    color: #e2e8f0;
}

body.dark-mode .btn-time-out:hover {
    background: rgba(59, 130, 246, 0.18);
}

body.dark-mode .status-indicator.status-active {
    background: rgba(34, 197, 94, 0.18);
    color: #bbf7d0;
}

body.dark-mode .status-indicator.status-inactive {
    background: rgba(148, 163, 184, 0.12);
    color: #94a3b8;
}

body.dark-mode .time-form {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(59, 130, 246, 0.18);
}

body.dark-mode .time-form label {
    color: #e2e8f0;
}

body.dark-mode .time-form .form-control,
body.dark-mode .time-form textarea {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(59, 130, 246, 0.25);
    color: #f8fafc;
}

body.dark-mode .time-form .form-control::placeholder,
body.dark-mode .time-form textarea::placeholder {
    color: #94a3b8;
}

body.dark-mode .session-card {
    background: linear-gradient(165deg, rgba(15, 23, 42, 0.95), rgba(30, 64, 175, 0.18));
    border: 1px solid rgba(59, 130, 246, 0.14);
    box-shadow: 0 18px 40px rgba(8, 47, 73, 0.45);
}

body.dark-mode .session-time {
    color: #f8fafc;
}

body.dark-mode .session-location {
    color: #94a3b8;
}

body.dark-mode .session-hours {
    color: #60a5fa;
}

body.dark-mode .time-summary-card {
    background: rgba(37, 99, 235, 0.18);
}

body.dark-mode .time-summary-card .summary-value {
    color: #bfdbfe;
}

body.dark-mode input[type="text"],
body.dark-mode input[type="email"],
body.dark-mode input[type="number"],
body.dark-mode input[type="date"],
body.dark-mode input[type="time"],
body.dark-mode select,
body.dark-mode textarea {
    background: rgba(15, 23, 42, 0.75);
    border-color: rgba(59, 130, 246, 0.25);
    color: #f8fafc;
}

body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
    color: #94a3b8;
}

body.dark-mode .filter-bar input,
body.dark-mode .filter-bar select,
body.dark-mode .search-bar input,
body.dark-mode .search-bar select,
body.dark-mode .control-row input,
body.dark-mode .control-row select {
    background: rgba(15, 23, 42, 0.8);
    border-color: rgba(59, 130, 246, 0.3);
    color: #f8fafc;
}

body.dark-mode .progress-bar {
    background: rgba(148, 163, 184, 0.25);
}

body.dark-mode .progress-fill {
    background: linear-gradient(90deg, #3b82f6, #6366f1);
}

.content-wrapper {
    width: min(100%, var(--max-content-width));
    margin: 0 auto;
    padding: clamp(1.75rem, 3vw, 2.75rem);
}

/* Cards */
.card {
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: clamp(1.5rem, 3vw, 2rem);
    margin-bottom: clamp(1.5rem, 3vw, 2rem);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.card-title {
    font-size: clamp(1.1rem, 0.4vw + 1rem, 1.35rem);
    font-weight: 600;
    color: var(--text-primary);
}

.card-subtitle {
    font-size: clamp(0.9rem, 0.3vw + 0.85rem, 1rem);
    color: var(--text-secondary);
}

.card-body {
    padding: 10px 0;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: clamp(1.25rem, 2.8vw, 2rem);
    margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

.stat-card {
    background: white;
    border-radius: var(--radius-md);
    padding: clamp(1.5rem, 2.8vw, 2rem);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary-color), var(--primary-dark));
}

.stat-icon {
    width: clamp(3.1rem, 4vw, 3.5rem);
    height: clamp(3.1rem, 4vw, 3.5rem);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1.4rem, 1.2vw + 1rem, 1.8rem);
    margin-bottom: 0.9rem;
}

.stat-icon.primary {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
}

.stat-icon.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.stat-icon.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.stat-icon.danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.stat-value {
    font-size: clamp(1.35rem, 0.9vw + 1.1rem, 1.9rem);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.15;
    margin-bottom: 0.35rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: clamp(0.85rem, 0.3vw + 0.8rem, 0.95rem);
}

.stats-grid.compact {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.grid-auto-fit {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: clamp(1.25rem, 2.5vw, 2rem);
}

.grid-two-col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: clamp(1.25rem, 2.5vw, 2rem);
}

.flex-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(0.75rem, 2vw, 1.25rem);
}

.full-width {
    width: 100%;
}

.stack-sm {
    display: flex;
    flex-direction: column;
    gap: clamp(0.75rem, 1.6vw, 1rem);
}

.stack-lg {
    display: flex;
    flex-direction: column;
    gap: clamp(1.25rem, 2.6vw, 1.8rem);
}

.hide-desktop {
    display: none;
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(0.75rem, 1.8vw, 1.15rem);
}

.button-group.is-stacked {
    flex-direction: column;
    align-items: stretch;
}

.is-hidden {
    display: none !important;
}

.content-wrapper {
    width: min(100%, var(--max-content-width));
    margin: 0 auto;
    padding: clamp(1.75rem, 3vw, 2.5rem);
}

.content-section,
.content-wrapper.content-section {
    display: grid;
    gap: clamp(1.35rem, 2.6vw, 2rem);
}

.grid-three-col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: clamp(1.25rem, 2.4vw, 1.85rem);
}

.grid-auto-two {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: clamp(1rem, 2.1vw, 1.4rem);
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: clamp(0.75rem, 2vw, 1.2rem);
    flex-wrap: wrap;
}

.flex-stretch {
    display: flex;
    align-items: stretch;
    gap: clamp(1rem, 2vw, 1.5rem);
}

.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    font-size: clamp(0.75rem, 0.2vw + 0.7rem, 0.85rem);
    background: rgba(37, 99, 235, 0.12);
    color: var(--primary-color);
    font-weight: 600;
}

.badge-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: clamp(0.75rem, 2vw, 1.25rem);
    margin: clamp(0.9rem, 1.6vw, 1.2rem) 0;
}

.empty-state {
    padding: clamp(1.1rem, 2.8vw, 1.7rem);
    text-align: center;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    background: rgba(148, 163, 184, 0.08);
    border: 1px dashed rgba(148, 163, 184, 0.25);
    display: grid;
    gap: 0.45rem;
    place-items: center;
}

.logbook-summary-panel {
    display: grid;
    gap: clamp(0.9rem, 2.2vw, 1.3rem);
}

.logbook-summary-item {
    display: grid;
    gap: 0.35rem;
    text-align: center;
}

.logbook-summary-inline {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(0.75rem, 2vw, 1.1rem);
}

.summary-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.95rem;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
}

.summary-pill .pill-label {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 700;
}

.summary-pill .pill-value {
    font-size: 1rem;
    color: var(--primary-color);
}

body.dark-mode .summary-pill {
    background: rgba(59, 130, 246, 0.18);
    color: #93c5fd;
}

body.dark-mode .summary-pill .pill-label {
    color: #cbd5f5;
}

.empty-state i {
    font-size: clamp(1.8rem, 3vw, 2.3rem);
    opacity: 0.45;
}

/* Scholar Dashboard Enhancements */
.welcome-card {
    display: grid;
    gap: clamp(0.75rem, 1.8vw, 1.2rem);
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: clamp(1rem, 2.2vw, 1.45rem);
}

.kpi-item {
    display: grid;
    gap: 0.4rem;
    padding: clamp(0.85rem, 2vw, 1.2rem);
    border-radius: var(--radius-sm);
    background: rgba(148, 163, 184, 0.08);
}

.kpi-label {
    font-size: clamp(0.8rem, 0.2vw + 0.75rem, 0.9rem);
    color: var(--text-secondary);
}

.kpi-value {
    font-size: clamp(1.25rem, 0.6vw + 1.05rem, 1.5rem);
    font-weight: 700;
    color: var(--text-primary);
}

.progress-track {
    background: var(--border-color);
    border-radius: var(--radius-sm);
    height: 18px;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
    height: 100%;
    transition: width 0.4s ease;
}

.scholar-required {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-secondary);
    font-size: clamp(0.85rem, 0.25vw + 0.8rem, 0.95rem);
}

/* Time Log */
.time-log-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: clamp(1.75rem, 3vw, 2.3rem);
    align-items: stretch;
}

.time-log-layout > section {
    display: grid;
    gap: clamp(1.35rem, 2.6vw, 1.9rem);
    min-width: 0;
}

.badge-info {
    background: rgba(59, 130, 246, 0.12);
    color: var(--primary-color);
}

.btn-secondary {
    background: rgba(148, 163, 184, 0.16);
    color: var(--text-secondary);
    border: 1px solid rgba(148, 163, 184, 0.28);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.btn-secondary:hover,
.btn-secondary:focus {
    background: rgba(148, 163, 184, 0.22);
    border-color: rgba(148, 163, 184, 0.35);
}

.logbook-overview {
    background: rgba(148, 163, 184, 0.08);
    border-radius: var(--radius-md);
    padding: clamp(1.2rem, 2.8vw, 1.6rem);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.logbook-overview-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.logbook-overview-header p {
    margin: 0;
    color: var(--text-secondary);
    max-width: 420px;
    font-size: 0.92rem;
}

.overview-title {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    font-weight: 600;
    color: var(--text-primary);
}

.overview-title i {
    color: var(--primary-color);
}

.logbook-metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: clamp(1rem, 2.4vw, 1.4rem);
}

.logbook-metric-card {
    border-radius: var(--radius-md);
    padding: clamp(1rem, 2.4vw, 1.35rem);
    display: grid;
    gap: 0.5rem;
    background: white;
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.logbook-metric-card::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.12;
    pointer-events: none;
}

.logbook-metric-card .metric-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.12);
    color: var(--primary-color);
    font-size: 1.15rem;
}

.logbook-metric-card .metric-label {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
}

.logbook-metric-card .metric-value {
    font-size: clamp(1.4rem, 0.7vw + 1.2rem, 1.8rem);
    font-weight: 700;
    color: var(--text-primary);
}

.logbook-metric-card.is-pending {
    border-color: rgba(234, 179, 8, 0.35);
}

.logbook-metric-card.is-pending::after {
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.55), transparent 65%);
}

.logbook-metric-card.is-approved {
    border-color: rgba(16, 185, 129, 0.35);
}

.logbook-metric-card.is-approved::after {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.55), transparent 65%);
}

.logbook-metric-card.is-rejected {
    border-color: rgba(239, 68, 68, 0.35);
}

.logbook-metric-card.is-rejected::after {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.55), transparent 65%);
}

.logbook-metric-card.is-total {
    border-color: rgba(59, 130, 246, 0.35);
}

.logbook-metric-card.is-total::after {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.55), transparent 65%);
}

body.dark-mode .logbook-overview {
    background: linear-gradient(155deg, rgba(15, 23, 42, 0.92), rgba(30, 64, 175, 0.2));
    border: 1px solid rgba(59, 130, 246, 0.24);
}

body.dark-mode .logbook-metric-card {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(30, 64, 175, 0.4);
    box-shadow: 0 18px 36px rgba(8, 47, 73, 0.45);
}

body.dark-mode .logbook-metric-card .metric-label {
    color: #cbd5f5;
}

body.dark-mode .logbook-overview-header p {
    color: #cbd5f5;
}

.logbook-form {
    background: rgba(148, 163, 184, 0.08);
    padding: clamp(1rem, 2.6vw, 1.35rem);
    border-radius: var(--radius-md);
    border: 1px solid rgba(148, 163, 184, 0.18);
    display: grid;
    gap: clamp(0.85rem, 2vw, 1.15rem);
}

.logbook-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(0.85rem, 2vw, 1.15rem);
}

.muted {
    color: var(--text-secondary);
    font-weight: 400;
    font-size: 0.85em;
}

.logbook-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: clamp(0.85rem, 2vw, 1.15rem);
    flex-wrap: wrap;
}

.logbook-help {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.logbook-help i {
    color: var(--warning-color);
}

.logbook-list {
    display: grid;
    gap: clamp(1rem, 2.4vw, 1.3rem);
}

.logbook-item {
    background: white;
    border-radius: var(--radius-md);
    padding: clamp(1rem, 2.4vw, 1.4rem);
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: var(--shadow-sm);
    display: grid;
    gap: 0.9rem;
}

.logbook-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.logbook-item-header .row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.logbook-item-header i {
    color: var(--primary-color);
}

.logbook-description {
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 0.95rem;
}

.logbook-meta {
    display: grid;
    gap: 0.55rem;
}

.logbook-meta .row {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.logbook-meta .row i {
    color: var(--secondary-color);
}

.logbook-remarks span {
    color: var(--text-primary);
}

body.dark-mode .logbook-form {
    background: linear-gradient(160deg, rgba(15, 23, 42, 0.92), rgba(30, 64, 175, 0.22));
    border: 1px solid rgba(59, 130, 246, 0.24);
}

body.dark-mode .logbook-help {
    color: #cbd5f5;
}

body.dark-mode .logbook-help i {
    color: #facc15;
}

body.dark-mode .logbook-item {
    background: linear-gradient(160deg, rgba(15, 23, 42, 0.9), rgba(30, 64, 175, 0.18));
    border: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: 0 18px 38px rgba(8, 47, 73, 0.45);
}

body.dark-mode .logbook-item-header .row,
body.dark-mode .logbook-meta .row {
    color: #cbd5f5;
}

body.dark-mode .logbook-meta .row i {
    color: #93c5fd;
}

body.dark-mode .logbook-description {
    color: #f8fafc;
}

body.dark-mode .logbook-remarks span {
    color: #f1f5f9;
}

.time-clock {
    text-align: center;
    padding: clamp(1.75rem, 3vw, 2.25rem);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-radius: var(--radius-lg);
    display: grid;
    gap: clamp(0.85rem, 1.8vw, 1.2rem);
    box-shadow: var(--shadow-md);
}

.clock-display {
    font-size: clamp(2.2rem, 3vw + 1.8rem, 3.1rem);
    font-weight: 700;
    font-family: 'Courier New', monospace;
}

.date-display {
    font-size: clamp(1rem, 0.4vw + 0.95rem, 1.15rem);
    opacity: 0.9;
}

.time-buttons {
    display: flex;
    justify-content: center;
    gap: clamp(0.75rem, 2vw, 1.15rem);
}

.btn-time {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    padding: clamp(0.8rem, 2.2vw, 1.1rem) clamp(1.2rem, 3vw, 1.85rem);
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: clamp(0.95rem, 0.3vw + 0.9rem, 1.1rem);
    border: 2px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-time i {
    font-size: 1rem;
}

.btn-time-in {
    background: white;
    color: var(--primary-color);
    border-color: white;
    box-shadow: 0 14px 25px rgba(37, 99, 235, 0.12);
}

.btn-time-in:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
}

.btn-time-out {
    background: transparent;
    color: #2563eb;
    border-color: rgba(37, 99, 235, 0.45);
}

.btn-time-out:hover {
    background: rgba(37, 99, 235, 0.08);
    color: #1d4ed8;
    transform: translateY(-2px);
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.1rem;
    border-radius: 999px;
    font-size: clamp(0.85rem, 0.2vw + 0.8rem, 0.95rem);
    font-weight: 600;
    margin-top: 0.75rem;
}

.status-active {
    background: rgba(16, 185, 129, 0.18);
    color: var(--success-color);
}

.status-inactive {
    background: rgba(148, 163, 184, 0.16);
    color: rgba(71, 85, 105, 0.85);
}

.pulse {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: var(--success-color);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.65);
    }
    70% {
        box-shadow: 0 0 0 12px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.time-form {
    background: rgba(255, 255, 255, 0.08);
    padding: clamp(1rem, 2.4vw, 1.35rem);
    border-radius: var(--radius-md);
    margin-top: clamp(1rem, 2vw, 1.35rem);
    border: 1px solid rgba(148, 163, 184, 0.18);
    display: grid;
    gap: clamp(0.75rem, 2vw, 1.1rem);
}

.time-form .form-group {
    display: grid;
    gap: 0.5rem;
    margin-bottom: 0;
}

.time-form label {
    color: var(--text-primary);
    font-weight: 600;
}

.time-form .form-control,
.time-form textarea {
    background: rgba(255, 255, 255, 0.92);
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.75rem 0.95rem;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.session-card {
    background: white;
    border-radius: var(--radius-md);
    padding: clamp(1rem, 2.4vw, 1.35rem);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.session-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.session-info {
    display: grid;
    gap: 0.4rem;
}

.session-time {
    font-weight: 600;
    color: var(--text-primary);
    font-size: clamp(1rem, 0.3vw + 0.95rem, 1.1rem);
}

.session-location {
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.session-hours {
    font-weight: 700;
    font-size: clamp(1.05rem, 0.4vw + 1rem, 1.2rem);
    color: var(--primary-color);
}

.time-summary-card {
    background: rgba(148, 163, 184, 0.08);
    border-radius: var(--radius-md);
    padding: clamp(0.9rem, 2.2vw, 1.25rem);
}

.time-summary-card .summary-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.time-summary-card .summary-value {
    font-size: clamp(1.35rem, 0.8vw + 1.1rem, 1.85rem);
    font-weight: 700;
    color: var(--primary-color);
}

.weekly-summary-grid {
    display: grid;
    gap: clamp(0.65rem, 1.6vw, 1rem);
}

.week-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    border-radius: var(--radius-sm);
    padding: 0.85rem 1.1rem;
    border: 1px solid rgba(148, 163, 184, 0.15);
}

.week-item strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead {
    background: var(--light-bg);
}

.table th {
    padding: clamp(0.75rem, 2.4vw, 1.1rem);
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
}

.table td {
    padding: clamp(0.75rem, 2.4vw, 1.1rem);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.table tbody tr:hover {
    background: var(--light-bg);
}

.table-stack td::before {
    content: attr(data-label);
    font-weight: 600;
    display: none;
    margin-right: 0.75rem;
    color: var(--text-primary);
}

.table-stack td {
    display: table-cell;
}

.table-stack tr {
    transition: background 0.3s ease, transform 0.2s ease;
}

.table-stack tr:hover {
    transform: translateY(-2px);
}

.table-stack .table-actions {
    justify-content: flex-end;
}

.table-stack .table-actions .btn {
    min-width: 94px;
}

.table-stack .table-actions .btn + .btn {
    margin-left: 0.4rem;
}

.table-stack .status-badge {
    border-radius: 999px;
    font-size: 0.85rem;
    padding: 0.45rem 0.85rem;
}

.table-actions {
    display: inline-flex;
    gap: 0.5rem;
    align-items: center;
}

.table-actions .btn {
    padding: 0.5rem 0.9rem;
    border-radius: 12px;
    font-size: 0.9rem;
}

.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-gold {
    background: linear-gradient(135deg, #ffd700, #ffa000);
    color: white;
    box-shadow: 0 10px 18px rgba(250, 204, 21, 0.3);
}

.badge-silver {
    background: linear-gradient(135deg, #c0c0c0, #808080);
    color: white;
    box-shadow: 0 10px 18px rgba(148, 163, 184, 0.28);
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

/* Responsive Controls */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: background 0.3s ease;
}

.menu-toggle:hover {
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary-color);
}

/* Utilities */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: var(--text-secondary) !important;
}

.text-success {
    color: var(--success-color) !important;
}

.text-warning {
    color: var(--warning-color) !important;
}

.text-danger {
    color: var(--danger-color) !important;
}

.text-info {
    color: var(--info-color) !important;
}

.mt-3 {
    margin-top: 1rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.p-3 {
    padding: 1rem;
}

.d-flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.align-center {
    align-items: center;
}

.gap-2 {
    gap: 0.5rem;
}

/* Utilities */
@media (max-width: 1280px) {
    .content-wrapper {
        padding: clamp(1.5rem, 2.4vw, 2.25rem);
    }

    .stats-grid {
        gap: clamp(1rem, 2vw, 1.5rem);
    }
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .content-wrapper {
        width: min(100%, var(--max-content-wide));
        padding: clamp(1.5rem, 3vw, 2rem);
    }

    .top-navbar {
        padding-inline: clamp(1rem, 2.5vw, 1.5rem);
    }

    .button-group {
        gap: clamp(0.65rem, 1.6vw, 1rem);
    }

    .time-log-layout {
        grid-template-columns: 1fr;
    }

    .logbook-grid {
        grid-template-columns: 1fr;
    }

    .logbook-footer {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 900px) {
    .stats-grid,
    .grid-two-col {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }

    .card-header {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 260px;
    }

    .menu-toggle {
        display: block;
    }

    .dashboard-container {
        flex-direction: column;
    }

    .main-content {
        margin-left: 0;
        padding-bottom: clamp(3rem, 8vw, 4.5rem);
    }

    .content-wrapper {
        padding: clamp(1.25rem, 4vw, 1.75rem);
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .grid-auto-fit,
    .grid-two-col {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }

    .button-group.is-stacked {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 430px) {
    .content-wrapper {
        padding: clamp(1rem, 5vw, 1.5rem);
    }

    .card,
    .stat-card,
    .time-summary-card {
        padding: clamp(1.1rem, 5vw, 1.6rem);
    }

    .time-log-layout {
        gap: clamp(1rem, 4vw, 1.4rem);
    }

    .logbook-footer {
        align-items: flex-start;
    }

    .logbook-footer {
        align-items: flex-start;
    }

    .time-clock {
        padding: clamp(1.35rem, 5vw + 1rem, 1.9rem);
        border-radius: 18px;
    }

    .clock-display {
        font-size: clamp(1.8rem, 6vw + 1rem, 2.4rem);
    }

    .date-display {
        font-size: clamp(0.9rem, 0.8vw + 0.85rem, 1rem);
    }

    .time-buttons {
        gap: clamp(0.6rem, 3vw, 0.9rem);
    }

    .session-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .session-hours {
        width: 100%;
        text-align: left;
    }

    .table-responsive {
        margin-inline: -0.75rem;
    }

    .table {
        font-size: 0.92rem;
    }

    .main-navbar {
        padding: 0.75rem 1rem;
    }

    .navbar-title {
        font-size: clamp(1rem, 2.4vw + 0.9rem, 1.2rem);
    }

    .btn,
    .btn-time {
        width: 100%;
    }

    .badge-row {
        gap: 0.75rem;
    }

    .sidebar {
        width: min(82vw, 240px);
    }

    .menu-item {
        padding: 12px 18px;
        font-size: 0.95rem;
    }

    .menu-icon {
        margin-right: 10px;
    }

    .card-title {
        font-size: clamp(1rem, 2vw + 0.95rem, 1.15rem);
    }

    .card-subtitle {
        font-size: 0.9rem;
    }

    .card-header {
        margin-bottom: 14px;
        padding-bottom: 12px;
    }

    .stat-card {
        gap: 0.55rem;
        padding: clamp(1rem, 5vw, 1.4rem);
        border-radius: 16px;
    }

    .stat-icon {
        width: clamp(2.4rem, 7vw, 2.8rem);
        height: clamp(2.4rem, 7vw, 2.8rem);
        font-size: clamp(1rem, 2.6vw + 0.85rem, 1.25rem);
        margin-bottom: 0.5rem;
    }

    .stat-value {
        font-size: clamp(1.1rem, 4vw + 0.85rem, 1.45rem);
    }

    .stat-label,
    .summary-label,
    .session-location {
        font-size: 0.88rem;
    }

    .table th,
    .table td {
        padding: 0.55rem 0.7rem;
        font-size: 0.88rem;
    }

    .time-form {
        padding: clamp(0.85rem, 3.6vw, 1.15rem);
        border-radius: 16px;
    }

    .time-form .form-group {
        margin-bottom: 0.8rem;
    }

    .time-form label {
        font-size: 0.88rem;
    }

    .time-form .form-control,
    .time-form textarea {
        font-size: 0.92rem;
        border-radius: 12px;
    }

    .btn-time {
        padding: clamp(0.7rem, 3.6vw, 0.9rem) clamp(0.95rem, 4.2vw, 1.35rem);
        font-size: clamp(0.92rem, 0.55vw + 0.85rem, 1.02rem);
        border-radius: 12px;
    }

    .status-indicator {
        font-size: 0.88rem;
        padding: 0.45rem 0.85rem;
    }

    .badge,
    .status-badge,
    .approval-badge {
        font-size: 0.82rem;
        padding: 0.22rem 0.6rem;
        border-radius: 12px;
    }

    .welcome-card {
        gap: 0.85rem;
        text-align: center;
        align-items: center;
    }

    .welcome-card h2 {
        font-size: clamp(1.25rem, 5vw + 1rem, 1.5rem);
        line-height: 1.2;
    }

    .welcome-card p {
        font-size: 0.95rem;
        max-width: 28rem;
    }

    .badge-row {
        justify-content: center;
    }

    .kpi-grid {
        grid-template-columns: 1fr;
        gap: clamp(0.75rem, 4vw, 1.1rem);
    }

    .kpi-item {
        align-items: center;
        text-align: center;
        padding: clamp(0.75rem, 3.6vw, 1.05rem);
        border-radius: 16px;
        box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
    }

    .kpi-label {
        font-size: 0.9rem;
    }

    .kpi-value {
        font-size: clamp(1.3rem, 4.5vw + 0.95rem, 1.65rem);
    }

    .scholar-required {
        justify-content: center;
        width: 100%;
        font-size: 0.88rem;
    }

    .progress-track {
        height: 12px;
    }

    .stats-grid,
    .grid-two-col {
        gap: clamp(0.75rem, 3.4vw, 1.1rem);
    }

    .card-body.stack-lg {
        gap: clamp(0.65rem, 3.2vw, 1rem);
    }

    .time-clock {
        border-radius: 16px;
        padding: clamp(1.25rem, 5vw, 1.8rem);
        box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
    }
}

.time-buttons {
    flex-direction: column;
}

.session-card {
    border-radius: 16px;
    padding: clamp(0.95rem, 4vw, 1.25rem);
}

.table-stack td {
    display: table-cell;
}

.table-stack tr {
    transition: background 0.3s ease, transform 0.2s ease;
}

.table-stack tr:hover {
    transform: translateY(-2px);
}

.table-stack .table-actions {
    justify-content: flex-end;
}

.table-stack .table-actions .btn {
    min-width: 94px;
}

.table-stack .table-actions .btn + .btn {
    margin-left: 0.4rem;
}

.table-stack .status-badge {
    border-radius: 999px;
    font-size: 0.85rem;
    padding: 0.45rem 0.85rem;
}

body.dark-mode .table-stack tr {
    background: linear-gradient(155deg, rgba(15, 23, 42, 0.92) 0%, rgba(30, 64, 175, 0.22) 100%);
    box-shadow: 0 12px 28px rgba(8, 47, 73, 0.4);
    border: 1px solid rgba(59, 130, 246, 0.18);
}


body.dark-mode .table-stack td {
    color: #e2e8f0;
}

body.dark-mode .table-stack td::before {
    color: rgba(148, 163, 184, 0.98);
}

body.dark-mode .table-stack .table-actions {
    gap: 0.6rem;
}

body.dark-mode .table-stack .table-actions .btn-secondary {
    background: rgba(148, 163, 184, 0.18);
    border: 1px solid rgba(203, 213, 225, 0.18);
    color: #f8fafc;
}

body.dark-mode .table-stack .table-actions .btn-secondary:hover {
    background: rgba(148, 163, 184, 0.28);
}

body.dark-mode .table-stack .table-actions .btn-primary {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    box-shadow: 0 12px 24px rgba(59, 130, 246, 0.35);
}

@media (max-width: 1280px) {
    .content-wrapper {
        padding: clamp(1.5rem, 2.4vw, 2.25rem);
    }

    .stats-grid {
        gap: clamp(1rem, 2vw, 1.5rem);
    }
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .content-wrapper {
        width: min(100%, var(--max-content-wide));
        padding: clamp(1.5rem, 3vw, 2rem);
    }

    .top-navbar {
        padding-inline: clamp(1rem, 2.5vw, 1.5rem);
    }

    .button-group {
        gap: clamp(0.65rem, 1.6vw, 1rem);
    }

    .time-log-layout {
        grid-template-columns: 1fr;
    }

    .logbook-grid {
        grid-template-columns: 1fr;
    }

    .logbook-footer {
        flex-direction: column;
        align-items: stretch;
    }
}

body.dark-mode .table-stack td:last-child {
    padding-bottom: 0;
}

.table-stack {
    display: table;
    width: 100%;
}

@media (max-width: 900px) {
    .stats-grid,
    .grid-auto-fit,
    .grid-two-col {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }

    .card-header {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .button-group.is-stacked {
        flex-direction: column;
        align-items: stretch;
    }

    .table-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .table-actions .btn {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 260px;
    }

    .menu-toggle {
        display: block;
    }

    .dashboard-container {
        flex-direction: column;
    }

    .main-content {
        margin-left: 0;
        padding-bottom: clamp(3rem, 8vw, 4.5rem);
    }

    .content-wrapper {
        padding: clamp(1.25rem, 4vw, 1.75rem);
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .grid-auto-fit,
    .grid-two-col {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
}

@media (max-width: 640px) {
    .hide-desktop {
        display: block;
    }

    .top-navbar {
        gap: 0.75rem;
    }

    .navbar-title {
        font-size: clamp(1.15rem, 1vw + 1rem, 1.4rem);
    }

    .stats-grid,
    .grid-auto-fit,
    .grid-two-col {
        grid-template-columns: 1fr;
    }

    .card,
    .stat-card {
        padding: clamp(1.25rem, 4vw, 1.75rem);
    }

    .button-group {
        gap: clamp(0.6rem, 1.2vw, 0.85rem);
    }

    .time-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .time-buttons .btn-time {
        width: 100%;
    }

    .time-buttons .btn-time + .btn-time {
        margin-left: 0;
    }

    .session-card {
        border-radius: 16px;
        padding: clamp(0.95rem, 4vw, 1.25rem);
    }

    .table-responsive {
        margin-inline: -1.25rem;
    }

    .table-stack {
        display: block;
    }

    .table-stack thead {
        display: none;
    }

    .table-stack tbody {
        display: block;
    }

    .table-stack tr {
        display: block;
        background: white;
        margin-bottom: clamp(0.8rem, 3.6vw, 1.1rem);
        border-radius: 18px;
        box-shadow: 0 18px 32px rgba(15, 23, 42, 0.12);
        padding: clamp(1rem, 4.6vw, 1.4rem);
        border: 1px solid rgba(148, 163, 184, 0.2);
        position: relative;
        overflow: hidden;
    }

    .table-stack tr::after {
        content: '';
        position: absolute;
        inset: 0;
        border-radius: inherit;
        background: linear-gradient(120deg, rgba(37, 99, 235, 0.12), transparent 45%);
        opacity: 0;
        transition: opacity 0.3s ease;
        pointer-events: none;
    }

    .table-stack tr:hover::after {
        opacity: 1;
    }

    .table-stack td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border: none;
        padding: 0.65rem 0;
        gap: 0.75rem;
    }

    .table-stack td::before {
        display: inline-block;
        font-size: 0.92rem;
        font-weight: 600;
        letter-spacing: 0.01em;
        color: var(--text-secondary);
    }

    .table-stack td:last-child {
        justify-content: center;
    }

    .table-stack .table-actions {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 0.65rem;
    }

    .table-stack .table-actions .btn {
        width: 100%;
        justify-content: center;
        font-size: 0.95rem;
        padding: 0.75rem 1rem;
        border-radius: 14px;
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }

    .table-stack .table-actions .btn:active {
        transform: scale(0.97);
    }

    .table-stack td:last-child {
        padding-bottom: 0;
    }

    body.dark-mode .table-stack tr {
        background: linear-gradient(155deg, rgba(15, 23, 42, 0.92) 0%, rgba(30, 64, 175, 0.28) 100%);
        box-shadow: 0 20px 36px rgba(8, 47, 73, 0.55);
        border: 1px solid rgba(59, 130, 246, 0.22);
        border-radius: 20px;
    }

    body.dark-mode .table-responsive {
        margin-inline: 0;
    }

    body.dark-mode .card,
    body.dark-mode .records-table,
    body.dark-mode .stat-card,
    body.dark-mode .time-summary-card {
        background: linear-gradient(165deg, rgba(15, 23, 42, 0.95), rgba(30, 64, 175, 0.18));
        border: 1px solid rgba(59, 130, 246, 0.18);
        box-shadow: 0 18px 38px rgba(8, 47, 73, 0.45);
    }

    body.dark-mode .table-stack td {
        color: #e2e8f0;
    }

    body.dark-mode .table-stack td::before {
        color: rgba(148, 163, 184, 0.92);
    }

    body.dark-mode .table-stack .table-actions {
        gap: 0.75rem;
    }

    body.dark-mode .table-stack .table-actions .btn-secondary {
        background: rgba(148, 163, 184, 0.22);
        border: 1px solid rgba(203, 213, 225, 0.25);
        color: #f8fafc;
        box-shadow: 0 14px 28px rgba(15, 23, 42, 0.35);
    }

    body.dark-mode .table-stack .table-actions .btn-secondary:hover {
        background: rgba(148, 163, 184, 0.32);
    }

    body.dark-mode .table-stack .table-actions .btn-primary {
        background: linear-gradient(135deg, #3b82f6, #6366f1);
        box-shadow: 0 18px 36px rgba(59, 130, 246, 0.45);
    }
}

@media (max-width: 480px) {
    .login-box {
        width: min(100%, 360px);
    }

    .login-body,
    .login-header {
        padding: clamp(1.5rem, 6vw, 2rem);
    }

    .form-group label {
        font-size: 0.9rem;
    }

    .btn {
        width: 100%;
    }

    .button-group {
        flex-direction: column;
    }
}
