@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800&display=swap');

:root {
    --primary: #f97316;
    --primary-dark: #ea580c;
    --secondary: #10b981;
    --accent: #f97316;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #f97316;
    --bg-dark: #f5f5f5;
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;
    --bg-input: #f3f4f6;
    --text-primary: #1a1a1a;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.15);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s ease;
}

[data-theme="dark"] {
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-sidebar: #1e293b;
    --bg-input: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: #334155;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


body {
    font-family: 'Tajawal', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* Auth Pages */
.auth-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f5f5 0%, #e5e7eb 50%, #f5f5f5 100%);
}

.auth-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.auth-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.auth-logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary), #f59e0b);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 36px;
    color: white;
}

.auth-card h1 {
    font-size: 24px;
    margin-bottom: 5px;
    color: var(--text-primary);
}

.auth-subtitle {
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 14px;
}

.auth-form .form-group {
    margin-bottom: 20px;
    text-align: right;
}

.auth-form label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-size: 14px;
}

.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"],
.auth-form input[type="number"],
.auth-form input[type="date"],
.auth-form input[type="time"],
.auth-form select,
.auth-form textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 15px;
    transition: var(--transition);
    font-family: inherit;
}

.auth-form input:focus,
.auth-form select:focus,
.auth-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(249,115,22,0.2);
}

.password-field {
    position: relative;
}

.toggle-password {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 1000;
}

.nav-right, .nav-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    display: none;
    padding: 8px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 18px;
}

.nav-brand i {
    color: var(--primary);
    font-size: 22px;
}

.nav-notifications {
    position: relative;
}

.notif-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    position: relative;
}

.notif-badge {
    position: absolute;
    top: 0;
    left: 0;
    background: var(--danger);
    color: white;
    font-size: 10px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.notif-dropdown {
    display: none;
    position: absolute;
    top: 50px;
    right: 0;
    width: 340px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    max-height: 450px;
    overflow-y: auto;
}

.notif-dropdown.show {
    display: block;
}

.notif-dropdown h4 {
    padding: 15px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.notif-empty {
    padding: 30px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.notif-item {
    display: block;
    padding: 12px 15px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.15s;
}

.notif-item:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

.notif-item small {
    color: var(--text-muted);
    font-size: 11px;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    position: relative;
}

.nav-user:hover {
    background: var(--bg-input);
}

.nav-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), #f59e0b);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    color: white;
}

.nav-user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.nav-user-info span {
    font-size: 14px;
    font-weight: 600;
}

.nav-user-info small {
    color: var(--text-muted);
    font-size: 11px;
}

.nav-dropdown {
    display: none;
    position: absolute;
    top: 50px;
    left: 0;
    width: 200px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    overflow: hidden;
}

.nav-user:hover .nav-dropdown {
    display: block;
}

.nav-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition);
}

.nav-dropdown a:hover {
    background: var(--bg-input);
    color: var(--primary);
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 60px;
    right: 0;
    width: 250px;
    height: calc(100vh - 60px);
    background: var(--bg-sidebar);
    border-left: 1px solid var(--border);
    overflow-y: auto;
    z-index: 900;
    transition: var(--transition);
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary);
    font-weight: 700;
    font-size: 16px;
    border-bottom: 1px solid var(--border);
    display: none;
}

.sidebar-nav {
    padding: 10px 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-secondary);
    font-size: 14px;
    transition: var(--transition);
    border-right: 3px solid transparent;
}

.sidebar-link:hover {
    background: rgba(249,115,22,0.1);
    color: var(--primary);
}

.sidebar-link.active {
    background: rgba(249,115,22,0.15);
    color: var(--primary);
    border-right-color: var(--primary);
    font-weight: 600;
}

.sidebar-link i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.sidebar-divider {
    height: 1px;
    background: var(--border);
    margin: 10px 20px;
}

/* Sidebar Collapsible Groups */
.sidebar-group {
    margin-bottom: 2px;
}

.sidebar-group-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 11px 20px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    border-right: 3px solid transparent;
    text-align: right;
}

.sidebar-group-toggle:hover {
    background: rgba(249,115,22,0.07);
    color: var(--primary);
}

.sidebar-group-toggle i:first-child {
    width: 20px;
    text-align: center;
    font-size: 15px;
}

.sidebar-group-toggle .group-label {
    flex: 1;
    text-align: right;
}

.sidebar-group-toggle .group-arrow {
    font-size: 10px;
    transition: transform 0.25s ease;
    opacity: 0.5;
}

.sidebar-group.open > .sidebar-group-toggle .group-arrow {
    transform: rotate(90deg);
}

.sidebar-group.open > .sidebar-group-toggle {
    color: var(--primary);
    background: rgba(249,115,22,0.05);
}

.sidebar-group-items {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.sidebar-group.open > .sidebar-group-items {
    max-height: 500px;
}

.sidebar-group-items .sidebar-link {
    padding: 9px 20px 9px 20px;
    font-size: 13px;
    gap: 8px;
}

.sidebar-group-items .sidebar-link i {
    font-size: 6px;
    width: auto;
    opacity: 0.5;
}

.sidebar-group-items .sidebar-link.active {
    font-weight: 600;
}

.sidebar-group-items .sidebar-link.active i {
    opacity: 1;
    color: var(--primary);
}

/* Main Content */
main.with-sidebar {
    margin-top: 60px;
    margin-right: 250px;
    padding: 30px;
    min-height: calc(100vh - 60px);
}

main.auth-page {
    min-height: 100vh;
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 24px;
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.card-header h2 {
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header h2 i {
    color: var(--primary);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.blue { background: rgba(249,115,22,0.15); color: #f97316; }
.stat-icon.green { background: rgba(16,185,129,0.15); color: #10b981; }
.stat-icon.orange { background: rgba(245,158,11,0.15); color: #f59e0b; }
.stat-icon.red { background: rgba(239,68,68,0.15); color: #ef4444; }
.stat-icon.purple { background: rgba(139,92,246,0.15); color: #8b5cf6; }
.stat-icon.cyan { background: rgba(6,182,212,0.15); color: #06b6d4; }

.stat-info h3 {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-info p {
    color: var(--text-secondary);
    font-size: 13px;
}

/* Grid Layout */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

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

/* Tables */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-sm);
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    background: var(--bg-input);
    padding: 12px 16px;
    text-align: right;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

table tr:hover {
    background: rgba(249,115,22,0.08);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: white;
    transform: translateY(-1px);
}

.btn-success {
    background: var(--secondary);
    color: white;
}

.btn-success:hover {
    background: #059669;
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    color: white;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.btn-outline:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
    justify-content: center;
    padding: 14px;
    font-size: 16px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
    border-radius: 8px;
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition);
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(249,115,22,0.2);
}

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

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-input);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
}

.progress-fill.blue { background: var(--primary); }
.progress-fill.green { background: var(--secondary); }
.progress-fill.orange { background: var(--accent); }
.progress-fill.red { background: var(--danger); }

/* User Avatar */
.user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-cell .avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    font-size: 14px;
    background: linear-gradient(135deg, var(--primary), #f59e0b);
    flex-shrink: 0;
}

/* Alert */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-header h1 i {
    color: var(--primary);
}

/* Activity List */
.activity-list {
    list-style: none;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

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

.activity-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-content p {
    font-size: 14px;
    margin-bottom: 2px;
}

.activity-content small {
    color: var(--text-muted);
    font-size: 12px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    color: var(--text-muted);
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: 8px;
    color: var(--text-secondary);
}

/* Project Card */
.project-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 20px;
    transition: var(--transition);
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.project-card h3 {
    font-size: 16px;
    margin-bottom: 10px;
}

.project-card .project-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.project-card .project-stats {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    color: var(--text-secondary);
    font-size: 13px;
}

/* Attendance Clock */
.attendance-clock {
    text-align: center;
    padding: 30px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 30px;
}

.attendance-clock .time {
    font-size: 48px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 10px;
}

.attendance-clock .date {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* Preview Mode */
.preview-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 42px;
    background: linear-gradient(135deg, #1e1b4b, #312e81);
    border-bottom: 2px solid #818cf8;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 1100;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

.preview-banner-content {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #e0e7ff;
    font-size: 13px;
}

.preview-banner-content i {
    color: #a5b4fc;
}

.preview-banner-content strong {
    color: #c7d2fe;
    font-weight: 700;
}

.preview-separator {
    color: #6366f1;
    margin: 0 4px;
}

.preview-real-role {
    color: #a5b4fc;
    font-size: 12px;
}

.preview-pulse {
    width: 8px;
    height: 8px;
    background: #34d399;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
    flex-shrink: 0;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}

.preview-exit-form {
    display: flex;
}

.preview-exit-btn {
    background: rgba(239,68,68,0.2);
    color: #fca5a5;
    border: 1px solid rgba(239,68,68,0.3);
    padding: 5px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
    font-family: inherit;
}

.preview-exit-btn:hover {
    background: #ef4444;
    color: white;
}

body.preview-active .navbar {
    top: 42px;
}

body.preview-active main.with-sidebar {
    margin-top: calc(60px + 42px);
    min-height: calc(100vh - 60px - 42px);
}

body.preview-active .sidebar {
    top: calc(60px + 42px);
    height: calc(100vh - 60px - 42px);
}

/* Preview Switcher Button */
.preview-switcher {
    position: relative;
}

.preview-switcher-btn {
    background: linear-gradient(135deg, #312e81, #4338ca);
    color: #e0e7ff;
    border: 1px solid #6366f1;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: var(--transition);
    font-family: inherit;
}

.preview-switcher-btn:hover {
    background: linear-gradient(135deg, #4338ca, #6366f1);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99,102,241,0.4);
}

.preview-switcher-text {
    display: inline;
}

/* Preview Dropdown */
.preview-dropdown {
    display: none;
    position: absolute;
    top: 48px;
    left: 0;
    width: 280px;
    background: var(--bg-card);
    border: 1px solid #6366f1;
    border-radius: var(--radius);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    z-index: 100;
    overflow: hidden;
}

.preview-dropdown.show {
    display: block;
    animation: fadeIn 0.2s ease;
}

.preview-dropdown-header {
    padding: 14px 16px;
    background: linear-gradient(135deg, #312e81, #4338ca);
    color: #e0e7ff;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.preview-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    width: 100%;
    background: none;
    border: none;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
    text-align: right;
    font-family: inherit;
    color: var(--text-primary);
}

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

.preview-dropdown-item:hover {
    background: rgba(99,102,241,0.08);
}

.preview-dropdown-item div {
    flex: 1;
}

.preview-dropdown-item strong {
    display: block;
    font-size: 14px;
    margin-bottom: 2px;
}

.preview-dropdown-item small {
    color: var(--text-muted);
    font-size: 11px;
}

.preview-role-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

/* Preview Return Link in Nav Dropdown */
.preview-return-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 15px;
    color: #f97316 !important;
    font-weight: 600;
    font-size: 14px;
    width: 100%;
    background: rgba(249,115,22,0.08);
    border: none;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    transition: var(--transition);
}

.preview-return-link:hover {
    background: rgba(249,115,22,0.15);
}

/* Preview Section on Dashboard */
.preview-section {
    margin-bottom: 30px;
}

.preview-section-header {
    margin-bottom: 20px;
}

.preview-section-header h3 {
    font-size: 18px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.preview-section-header h3 i {
    color: #6366f1;
}

.preview-section-header p {
    color: var(--text-muted);
    font-size: 13px;
}

.preview-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.preview-role-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.preview-role-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    border-color: #6366f1;
}

.preview-role-header {
    padding: 24px;
    text-align: center;
    font-size: 36px;
    color: white;
}

.preview-role-body {
    padding: 20px;
    flex: 1;
}

.preview-role-body h4 {
    font-size: 16px;
    margin-bottom: 12px;
    color: var(--text-primary);
    text-align: center;
}

.preview-role-body ul {
    list-style: none;
    padding: 0;
}

.preview-role-body li {
    padding: 6px 0;
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.preview-role-body li i {
    color: var(--secondary);
    font-size: 11px;
    width: 16px;
    text-align: center;
}

.preview-role-footer {
    padding: 12px;
    background: linear-gradient(135deg, #312e81, #4338ca);
    color: #e0e7ff;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}

.preview-role-card:hover .preview-role-footer {
    background: linear-gradient(135deg, #4338ca, #6366f1);
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 899;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.show {
    display: block;
}

/* Bottom Mobile Navigation */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    z-index: 1001;
    padding: 4px 0 env(safe-area-inset-bottom, 4px);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.12);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.mobile-bottom-nav .bottom-nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-bottom-nav .bottom-nav-items a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px 4px;
    color: var(--text-muted);
    font-size: 10px;
    text-decoration: none;
    border-radius: 10px;
    transition: all .2s ease;
    min-width: 52px;
    min-height: 50px;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.mobile-bottom-nav .bottom-nav-items a i {
    font-size: 20px;
    transition: all .2s ease;
}

.mobile-bottom-nav .bottom-nav-items a.active {
    color: var(--primary);
    background: rgba(249,115,22,0.08);
}

.mobile-bottom-nav .bottom-nav-items a.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: var(--primary);
    border-radius: 0 0 4px 4px;
}

.mobile-bottom-nav .bottom-nav-items a:active {
    transform: scale(0.92);
    background: rgba(249,115,22,0.06);
}

/* Touch-friendly targets */
.btn,
.sidebar-link,
.mobile-bottom-nav a,
.nav-dropdown a,
.notif-item {
    min-height: 44px;
}

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    .sidebar {
        width: 220px;
    }

    main.with-sidebar {
        margin-right: 220px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-card {
        padding: 18px;
    }

    .stat-info h3 {
        font-size: 24px;
    }

    .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
}

/* Mobile (max-width: 768px) */
@media (max-width: 768px) {
    /* Hide sidebar off-screen */
    .sidebar {
        transform: translateX(100%);
        width: 260px;
        box-shadow: -4px 0 20px rgba(0,0,0,0.3);
    }

    .sidebar.open {
        transform: translateX(0);
    }

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

    /* Reset main margin */
    main.with-sidebar {
        margin-right: 0;
        margin-bottom: 70px;
        padding: 16px;
        min-height: calc(100vh - 60px);
    }

    /* Navbar adjustments */
    .navbar {
        padding: 0 12px;
    }

    .nav-brand {
        font-size: 16px;
    }

    .nav-brand i {
        font-size: 18px;
    }

    .nav-right {
        gap: 8px;
    }

    .nav-left {
        gap: 8px;
    }

    .nav-user-info {
        display: none;
    }

    .nav-user {
        padding: 4px 6px;
    }

    .nav-avatar {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .notif-dropdown {
        width: calc(100vw - 20px);
        right: 10px;
        left: auto;
        max-height: 70vh;
        border-radius: 12px;
        top: 46px;
    }

    /* Show bottom nav */
    .mobile-bottom-nav {
        display: block;
    }

    /* Stats */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-card {
        padding: 14px;
        gap: 10px;
    }

    .stat-icon {
        width: 42px;
        height: 42px;
        font-size: 18px;
        border-radius: 10px;
    }

    .stat-info h3 {
        font-size: 20px;
    }

    .stat-info p {
        font-size: 11px;
    }

    /* Grids */
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }

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

    /* Cards */
    .card {
        padding: 16px;
        margin-bottom: 12px;
    }

    .card-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .card-header h2 {
        font-size: 16px;
    }

    /* Page Header */
    .page-header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .page-header h1 {
        font-size: 20px;
    }

    /* Tables - horizontal scroll */
    .table-container {
        margin: 0 -16px;
        padding: 0 16px;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 600px;
    }

    table th, table td {
        padding: 10px 12px;
        font-size: 12px;
    }

    /* Buttons */
    .btn {
        padding: 10px 16px;
        font-size: 13px;
        min-height: 44px;
    }

    .btn-sm {
        padding: 8px 12px;
        font-size: 11px;
        min-height: 36px;
    }

    /* Preview Cards Mobile */
    .preview-cards-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .preview-role-header {
        padding: 16px;
        font-size: 28px;
    }

    .preview-role-body {
        padding: 14px;
    }

    .preview-role-body li {
        font-size: 12px;
    }

    .preview-banner {
        padding: 0 10px;
    }

    .preview-banner-content {
        font-size: 11px;
        gap: 6px;
    }

    .preview-real-role {
        display: none;
    }

    .preview-separator {
        display: none;
    }

    .preview-switcher-text {
        display: none;
    }

    .preview-switcher-btn {
        padding: 7px 10px;
    }

    .preview-dropdown {
        width: calc(100vw - 20px);
        left: -40px;
    }

    body.preview-active .navbar {
        top: 42px;
    }

    body.preview-active main.with-sidebar {
        margin-top: calc(60px + 42px);
        margin-bottom: 70px;
        min-height: calc(100vh - 60px - 42px);
    }

    body.preview-active .sidebar {
        top: calc(60px + 42px);
        height: calc(100vh - 60px - 42px);
    }

    .btn-block {
        padding: 12px;
        font-size: 15px;
    }

    .btn-group-mobile {
        display: flex;
        gap: 8px;
    }

    .btn-group-mobile .btn {
        flex: 1;
        justify-content: center;
    }

    /* Forms */
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 12px;
        font-size: 16px;
    }

    .auth-card {
        padding: 28px 20px;
    }

    .auth-logo {
        width: 64px;
        height: 64px;
        font-size: 28px;
    }

    .auth-card h1 {
        font-size: 20px;
    }

    /* Progress bars */
    .progress-bar {
        height: 6px;
    }

    /* Attendance clock */
    .attendance-clock .time {
        font-size: 36px;
    }

    .attendance-clock .date {
        font-size: 14px;
    }

    .attendance-clock {
        padding: 20px;
    }

    /* Project cards */
    .project-card {
        padding: 14px;
    }

    .project-card .project-stats {
        flex-wrap: wrap;
        gap: 8px;
    }

    /* Badges in tables */
    span[style*="padding:3px"] {
        font-size: 10px !important;
        padding: 2px 8px !important;
    }

    /* Modal-like sections */
    .card .form-row {
        grid-template-columns: 1fr;
    }

    /* Filter bars */
    .filter-bar {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .filter-bar .form-group {
        margin-bottom: 0;
    }

    /* Activity list */
    .activity-item {
        padding: 10px 0;
    }

    .activity-content p {
        font-size: 13px;
    }

    /* Print styles */
    @media print {
        .navbar, .sidebar, .mobile-bottom-nav, .sidebar-overlay {
            display: none !important;
        }

        main.with-sidebar {
            margin: 0 !important;
            padding: 10px !important;
        }

        .card {
            break-inside: avoid;
        }
    }
}

/* Small phones (max-width: 480px) */
@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        flex-direction: row;
        padding: 12px;
    }

    .stat-icon {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }

    .stat-info h3 {
        font-size: 18px;
    }

    main.with-sidebar {
        padding: 12px;
    }

    .card {
        padding: 12px;
    }

    .page-header h1 {
        font-size: 18px;
    }

    .mobile-bottom-nav .bottom-nav-items a {
        font-size: 9px;
        min-width: 44px;
        padding: 6px 2px;
        min-height: 46px;
    }

    .mobile-bottom-nav .bottom-nav-items a i {
        font-size: 18px;
    }
}

/* Landscape phone */
@media (max-height: 500px) and (orientation: landscape) {
    .navbar {
        height: 48px;
    }

    .sidebar {
        top: 48px;
        height: calc(100vh - 48px);
    }

    main.with-sidebar {
        margin-top: 48px;
        min-height: calc(100vh - 48px);
    }

    .attendance-clock {
        padding: 12px;
    }

    .attendance-clock .time {
        font-size: 28px;
    }
}

/* Hover states disabled on touch */
@media (hover: none) {
    .stat-card:hover {
        transform: none;
    }

    .project-card:hover {
        transform: none;
    }

    .nav-user:hover .nav-dropdown {
        display: none;
    }

    .nav-dropdown.show {
        display: block;
    }
}

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

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

.slide-up {
    animation: slideUp 0.3s ease;
}

/* ===== Dashboard Infographic Styles ===== */
.dash-hero {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 50%, #c2410c 100%);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 24px;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    position: relative;
    overflow: hidden;
}
.dash-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -30%;
    width: 60%;
    height: 200%;
    background: rgba(255,255,255,0.06);
    transform: rotate(20deg);
    pointer-events: none;
}
.dash-hero::after {
    content: '';
    position: absolute;
    bottom: -60%;
    right: -20%;
    width: 50%;
    height: 200%;
    background: rgba(255,255,255,0.04);
    transform: rotate(-15deg);
    pointer-events: none;
}
.dash-hero-text h1 { font-size: 26px; font-weight: 800; margin-bottom: 6px; }
.dash-hero-text p { font-size: 14px; opacity: 0.85; }
.dash-hero-stat {
    background: rgba(255,255,255,0.18);
    border-radius: 14px;
    padding: 18px 28px;
    text-align: center;
    backdrop-filter: blur(6px);
    position: relative;
    z-index: 1;
    min-width: 120px;
}
.dash-hero-stat .num { font-size: 32px; font-weight: 800; }
.dash-hero-stat .lbl { font-size: 12px; opacity: 0.85; margin-top: 2px; }

.gauge-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.gauge-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px 16px;
    text-align: center;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: var(--transition);
}
.gauge-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.gauge-svg { width: 110px; height: 110px; margin: 0 auto 12px; }
.gauge-bg { fill: none; stroke: #f3f4f6; stroke-width: 10; }
.gauge-fill { fill: none; stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset 1s ease; }
.gauge-center { font-size: 22px; font-weight: 800; fill: #1a1a1a; }
.gauge-label-center { font-size: 10px; fill: #9ca3af; }
.gauge-card .gauge-title { font-size: 14px; font-weight: 600; color: #374151; margin-top: 4px; }
.gauge-card .gauge-sub { font-size: 12px; color: #9ca3af; }

.chart-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}
.chart-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.chart-card h3 {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.chart-card h3 i { color: var(--primary); }

.donut-chart { position: relative; width: 180px; height: 180px; margin: 0 auto; }
.donut-chart svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut-segment { fill: none; stroke-width: 28; transition: stroke-dashoffset 0.8s ease; }
.donut-center-label {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    text-align: center;
}
.donut-center-label .num { font-size: 28px; font-weight: 800; color: #1a1a1a; }
.donut-center-label .lbl { font-size: 11px; color: #9ca3af; }

.donut-legend { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: center; }
.donut-legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #6b7280; }
.donut-legend-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }

.bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 160px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.bar-fill {
    width: 100%;
    border-radius: 6px 6px 0 0;
    transition: height 0.6s ease;
    min-height: 4px;
    position: relative;
}
.bar-fill:hover { opacity: 0.85; }
.bar-val { font-size: 11px; font-weight: 700; color: #374151; }
.bar-lbl { font-size: 10px; color: #9ca3af; white-space: nowrap; }

.infographic-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.info-card {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 14px;
    transition: var(--transition);
}
.info-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.info-card-icon {
    width: 50px; height: 50px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; flex-shrink: 0;
}
.info-card-text .big { font-size: 24px; font-weight: 800; color: #1a1a1a; line-height: 1; }
.info-card-text .small { font-size: 12px; color: #9ca3af; margin-top: 2px; }

.mini-bars { margin-top: 10px; }
.mini-bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.mini-bar-label { font-size: 12px; color: #6b7280; min-width: 70px; }
.mini-bar-track { flex: 1; height: 8px; background: #f3f4f6; border-radius: 4px; overflow: hidden; }
.mini-bar-fill { height: 100%; border-radius: 4px; transition: width 0.6s ease; }
.mini-bar-val { font-size: 12px; font-weight: 700; color: #374151; min-width: 28px; text-align: left; }

.full-width-chart { grid-column: 1 / -1; }

.activity-timeline { position: relative; padding-right: 24px; }
.activity-timeline::before {
    content: ''; position: absolute; right: 8px; top: 0; bottom: 0;
    width: 2px; background: #f3f4f6;
}
.tl-item { position: relative; padding: 0 0 20px 0; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
    position: absolute; right: -20px; top: 4px;
    width: 12px; height: 12px; border-radius: 50%;
    border: 2px solid #fff; box-shadow: 0 0 0 2px #f3f4f6;
}
.tl-content p { font-size: 13px; color: #374151; }
.tl-content p strong { color: #1a1a1a; }
.tl-content .tl-time { font-size: 11px; color: #9ca3af; margin-top: 2px; }

.tasks-list-card .task-row {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 0; border-bottom: 1px solid #f3f4f6;
}
.tasks-list-card .task-row:last-child { border-bottom: none; }
.task-priority-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.task-info { flex: 1; }
.task-info .task-name { font-size: 13px; font-weight: 600; color: #1a1a1a; }
.task-info .task-project { font-size: 11px; color: #9ca3af; }
.task-due { font-size: 11px; white-space: nowrap; }
.task-due.overdue { color: #ef4444; }
.task-due.on-time { color: #6b7280; }

@media (max-width: 1024px) {
    .gauge-grid { grid-template-columns: repeat(2, 1fr); }
    .infographic-row { grid-template-columns: repeat(2, 1fr); }
    .chart-row { grid-template-columns: 1fr; }
    .dash-hero { flex-direction: column; text-align: center; }
}
@media (max-width: 768px) {
    .gauge-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .gauge-card { padding: 16px 10px; }
    .gauge-svg { width: 80px; height: 80px; }
    .infographic-row { grid-template-columns: 1fr; }
    .dash-hero { padding: 20px; }
    .dash-hero-text h1 { font-size: 20px; }
    .chart-row { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .gauge-grid { grid-template-columns: 1fr; }
}

/* ============ DARK MODE OVERRIDES ============ */
[data-theme="dark"] .auth-body {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
}
[data-theme="dark"] .preview-banner {
    background: #1e293b;
    border-bottom: 1px solid #334155;
}
[data-theme="dark"] .preview-dropdown,
[data-theme="dark"] .notif-dropdown,
[data-theme="dark"] .nav-dropdown {
    background: #1e293b;
    border-color: #334155;
}
[data-theme="dark"] .notif-dropdown h4,
[data-theme="dark"] .preview-dropdown-header {
    border-color: #334155;
}
[data-theme="dark"] .notif-empty {
    color: #64748b;
}
[data-theme="dark"] .notif-item {
    border-color: #334155;
}
[data-theme="dark"] .notif-item:hover {
    background: #334155;
}
[data-theme="dark"] .nav-dropdown a:hover {
    background: #334155;
}
[data-theme="dark"] .preview-dropdown-item:hover {
    background: #334155;
}
[data-theme="dark"] .table-container table {
    background: #1e293b;
}
[data-theme="dark"] .table-container thead th {
    background: #334155;
    color: #94a3b8;
}
[data-theme="dark"] .table-container tbody td {
    border-color: #334155;
}
[data-theme="dark"] .table-container tbody tr:hover {
    background: #334155;
}
[data-theme="dark"] input, [data-theme="dark"] select, [data-theme="dark"] textarea {
    background: #334155;
    color: #f1f5f9;
    border-color: #475569;
}
[data-theme="dark"] input::placeholder, [data-theme="dark"] textarea::placeholder {
    color: #64748b;
}
[data-theme="dark"] input:focus, [data-theme="dark"] select:focus, [data-theme="dark"] textarea:focus {
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249,115,22,0.25);
}
[data-theme="dark"] .btn-outline {
    color: #94a3b8;
    border-color: #475569;
}
[data-theme="dark"] .btn-outline:hover {
    background: #334155;
    color: #f1f5f9;
}
[data-theme="dark"] .form-group label {
    color: #94a3b8;
}
[data-theme="dark"] select option {
    background: #1e293b;
    color: #f1f5f9;
}
[data-theme="dark"] .mobile-bottom-nav {
    background: #1e293b;
    border-top-color: #334155;
}
[data-theme="dark"] .modal-overlay {
    background: rgba(0,0,0,0.7);
}
[data-theme="dark"] .modal-content {
    background: #1e293b;
    border-color: #334155;
}
[data-theme="dark"] .password-field input {
    background: #334155;
}
[data-theme="dark"] .toggle-password {
    color: #64748b;
}

/* Dashboard infographic hardcoded fixes */
[data-theme="dark"] .gauge-card,
[data-theme="dark"] .info-card,
[data-theme="dark"] .chart-card {
    background: #1e293b;
    border-color: #334155;
}
[data-theme="dark"] .gauge-card .gauge-title {
    color: #94a3b8;
}
[data-theme="dark"] .donut-center-label .num,
[data-theme="dark"] .info-card-text .big,
[data-theme="dark"] .chart-card h3 {
    color: #f1f5f9;
}
[data-theme="dark"] .bar-val,
[data-theme="dark"] .mini-bar-val {
    color: #94a3b8;
}
[data-theme="dark"] .tl-content p {
    color: #94a3b8;
}
[data-theme="dark"] .tl-content p strong {
    color: #f1f5f9;
}
[data-theme="dark"] .activity-timeline::before {
    background: #334155;
}
[data-theme="dark"] .tl-dot {
    border-color: #1e293b;
    box-shadow: 0 0 0 2px #334155;
}
[data-theme="dark"] .task-info .task-name {
    color: #f1f5f9;
}
[data-theme="dark"] .task-info .task-project {
    color: #64748b;
}
[data-theme="dark"] .tasks-list-card .task-row {
    border-color: #334155;
}
[data-theme="dark"] .task-due.on-time {
    color: #94a3b8;
}

/* Dark mode theme toggle button */
.theme-toggle {
    background: none;
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--text-secondary);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: var(--transition);
}
.theme-toggle:hover {
    background: var(--bg-input);
    color: var(--primary);
}
[data-theme="dark"] .theme-toggle {
    border-color: #475569;
    color: #f59e0b;
}

/* ============ Messaging System ============ */
.msg-row {
    animation: msgIn 0.2s ease;
}
@keyframes msgIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

#messagesContainer::-webkit-scrollbar,
#userResults::-webkit-scrollbar,
#recipientResults::-webkit-scrollbar {
    width: 5px;
}
#messagesContainer::-webkit-scrollbar-track,
#userResults::-webkit-scrollbar-track,
#recipientResults::-webkit-scrollbar-track {
    background: transparent;
}
#messagesContainer::-webkit-scrollbar-thumb,
#userResults::-webkit-scrollbar-thumb,
#recipientResults::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

[data-theme="dark"] #messagesContainer {
    background: #0f172a;
}

/* Compose form responsive */
@media (max-width: 768px) {
    .page-header { flex-direction: column; gap: 10px; align-items: flex-start; }
    .page-header .btn { width: 100%; justify-content: center; }
    .chart-row, .gauge-grid, .infographic-row { grid-template-columns: 1fr !important; }
}

/* Sidebar message badge pulse */
.sidebar-link span[style*="background:#3b82f6"] {
    animation: badgePulse 2s infinite;
}
@keyframes badgePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(59,130,246,0.4); }
    50%      { box-shadow: 0 0 0 6px rgba(59,130,246,0); }
}

/* User pill in compose */
.user-pill:hover {
    border-color: #3b82f6 !important;
    background: rgba(59,130,246,0.05) !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59,130,246,0.1);
}

/* Conversation hover effect */
a[href*="conversation.php"]:hover {
    background: var(--bg-secondary) !important;
}

/* ===== Employee Profile Responsive ===== */
@media (max-width: 1024px) {
    .grid-2 { grid-template-columns: 1fr; }
}


/* ===============================
   TRAINING ATTENDANCE PAGE
   =============================== */

.training-clients-page {
    width:100%;
}


.training-clients-page .clients-list-card {

    width:100%;
    margin-top:20px;

    background:#fff;
    border:1px solid #e5e7eb;
    border-radius:14px;

    box-shadow:0 5px 20px rgba(0,0,0,.05);

    overflow:hidden;
}


.training-clients-page .clients-list-header {

    min-height:76px;
    padding:18px 22px;

    display:flex;
    align-items:center;
    justify-content:space-between;

    border-bottom:1px solid #eee;
}


.training-clients-page .clients-list-header h2 {

    margin:0;

    display:flex;
    align-items:center;
    gap:10px;

    font-size:17px;
    font-weight:800;

    color:var(--text-primary);
}


.training-clients-page table {

    width:100%;
    border-collapse:collapse;
}


.training-clients-page table th {

    background:#f9fafb;

    padding:15px 20px;

    text-align:right;

    font-size:13px;

    color:#6b7280;

}


.training-clients-page table td {

    padding:16px 20px;

    border-bottom:1px solid #f1f1f1;

    font-size:14px;

}


.training-clients-page tr:hover {

    background:#fafafa;

}


.training-clients-page .black-action-btn {

    display:inline-flex;

    align-items:center;
    gap:7px;

    background:#111827;

    color:#fff;

    padding:10px 16px;

    border-radius:9px;

    text-decoration:none;

    font-size:13px;

    font-weight:700;

}


.training-clients-page .black-action-btn:hover {

    background:#000;

}

