/* Staff Verification System - Main Stylesheet */

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #06b6d4;
    --light-color: #f8fafc;
    --dark-color: #1e293b;
    --border-color: #e2e8f0;
    --text-color: #334155;
    --text-muted: #64748b;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --border-radius: 0.5rem;
    --border-radius-lg: 0.75rem;
    --transition: all 0.2s ease-in-out;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-bottom: 1px solid var(--border-color);
    padding: 2rem 0 1.5rem 0;
    margin: 2rem 1rem 2rem 1rem;
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(37, 99, 235, 0.2);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.05)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.03)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.04)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
    pointer-events: none;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
    padding: 0 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.ministry-logo {
    width: 65px;
    height: 65px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.98);
    padding: 0.25rem;
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.ministry-logo:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.header-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.header h1 {
    color: white;
    font-size: 2rem;
    font-weight: 800;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    letter-spacing: -0.025em;
}

.header h1 i {
    margin-right: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.8rem;
}

.header-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
    font-weight: 500;
    margin: 0;
    letter-spacing: 0.025em;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.75rem 1.25rem;
    border-radius: 50px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.user-info:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.user-info span {
    color: white;
    font-weight: 500;
    font-size: 0.875rem;
}

.user-info small {
    display: block;
    font-size: 0.75rem;
    opacity: 0.8;
    margin-top: 0.25rem;
    color: rgba(255, 255, 255, 0.9);
}

.logout-btn {
    color: white;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 25px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.logout-btn i {
    font-size: 0.75rem;
}

/* Navigation */
.nav-tabs {
    display: flex;
    gap: 0.5rem;
    background: white;
    border-radius: 12px;
    padding: 0.75rem;
    margin: 0 1rem 2rem 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.nav-tab {
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    transition: var(--transition);
    font-weight: 500;
}

.nav-tab:hover,
.nav-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.nav-tab i {
    margin-right: 0.5rem;
}

/* Main Content */
.main-content {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin: 0 1rem 2rem 1rem;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 1.5rem;
    border-radius: var(--border-radius-lg);
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    font-size: 2rem;
    opacity: 0.8;
}

.stat-content h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-content p {
    opacity: 0.9;
    font-size: 0.875rem;
}

/* Dashboard Sections */
.dashboard-sections {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.section h2 {
    color: var(--dark-color);
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.section h2 i {
    margin-right: 0.5rem;
    color: var(--primary-color);
}

/* Tables */
.table-container {
    overflow-x: auto;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table th,
.data-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background-color: var(--light-color);
    font-weight: 600;
    color: var(--dark-color);
}

.data-table tr:hover {
    background-color: var(--light-color);
}

/* Staff Photos */
.staff-photo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.staff-photo-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.staff-photo-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--border-color);
    margin: 0 auto 1rem;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.25rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

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

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

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

.btn-secondary:hover {
    background-color: #475569;
}

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

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

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

.btn-warning:hover {
    background-color: #d97706;
}

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

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

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

.btn-info:hover {
    background-color: #0891b2;
}

/* Forms */
.staff-form {
    max-width: 800px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Staff Details */
.staff-details {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    align-items: flex-start;
}

.staff-photo-container {
    flex: 0 0 auto;
    text-align: center;
}

.staff-info {
    flex: 1;
}

.staff-info h3 {
    color: var(--dark-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.staff-info p {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.staff-info strong {
    color: var(--dark-color);
    font-weight: 600;
}

.qr-code-section {
    flex: 0 0 auto;
    text-align: center;
    margin-left: 2rem;
}

.qr-code-display {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.qr-code-display h4 {
    margin-bottom: 1rem;
    color: var(--dark-color);
    font-size: 1rem;
}

.qr-code-img {
    max-width: 250px;
    height: auto;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Expiring List */
.expiring-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.expiring-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background-color: var(--light-color);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--warning-color);
}

.expiring-info {
    flex: 1;
}

.expiring-info h4 {
    margin-bottom: 0.25rem;
    color: var(--dark-color);
}

.expiring-info p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.expiry-date {
    font-size: 0.75rem;
    color: var(--warning-color);
    font-weight: 500;
}

/* Scanner Styles */
.scanner-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.scanner-section h2 {
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.scanner-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.scanner-video-container {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

#scanner-video {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.scanner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.scanner-frame {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
}

.manual-input {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.manual-input h3 {
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.manual-form .form-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 0;
}

.manual-form input {
    flex: 1;
}

/* Scan Results */
.scan-result {
    margin-bottom: 2rem;
}

.scan-result-content {
    display: flex;
    gap: 2rem;
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
}

.scan-result-content.active {
    background-color: #f0fdf4;
    border-left: 4px solid var(--success-color);
}

.scan-result-content.expiring-soon {
    background-color: #fffbeb;
    border-left: 4px solid var(--warning-color);
}

.scan-result-content.expired {
    background-color: #fef2f2;
    border-left: 4px solid var(--danger-color);
}

.scan-result-content.error {
    background-color: #fef2f2;
    border-left: 4px solid var(--danger-color);
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--border-radius);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-badge.active {
    background-color: var(--success-color);
    color: white;
}

.status-badge.expiring-soon {
    background-color: var(--warning-color);
    color: white;
}

.status-badge.expired {
    background-color: var(--danger-color);
    color: white;
}

/* Recent Scans */
.recent-scans-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.recent-scan-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background-color: var(--light-color);
    border-radius: var(--border-radius);
}

.scan-info strong {
    display: block;
    color: var(--dark-color);
}

.scan-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.scan-status {
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius);
    font-size: 0.75rem;
    font-weight: 500;
}

.scan-status.success {
    background-color: var(--success-color);
    color: white;
}

.scan-status.expired {
    background-color: var(--danger-color);
    color: white;
}

.scan-status.inactive {
    background-color: var(--secondary-color);
    color: white;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-success {
    background-color: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-error {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Text Colors */
.text-success {
    color: var(--success-color);
}

.text-warning {
    color: var(--warning-color);
}

.text-danger {
    color: var(--danger-color);
}

.text-muted {
    color: var(--text-muted);
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.page-header h2 {
    color: var(--dark-color);
    font-size: 1.5rem;
    font-weight: 600;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 90%;
}

.modal-content h3 {
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.modal-content p {
    margin-bottom: 1.5rem;
    color: var(--text-muted);
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Login Page */
.login-page {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 1rem;
}

.login-box {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.login-logo {
    max-width: 80px;
    height: auto;
    display: block;
    margin: 0 auto 1rem auto;
    border-radius: 8px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.login-form .form-group {
    margin-bottom: 1.5rem;
}

.input-group {
    position: relative;
}

.input-group i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.input-group input {
    padding-left: 2.5rem;
}

.btn-full {
    width: 100%;
    justify-content: center;
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.login-footer p {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Utility Classes */
.no-data {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 2rem;
}

.current-photo {
    margin-top: 1rem;
}

.current-photo p {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.current-photo-img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        margin: 1rem 0.5rem 1rem 0.5rem;
        border-radius: 16px;
        padding: 1.5rem 0 1rem 0;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
        padding: 0 1.5rem;
    }
    
    .header-brand {
        width: 100%;
        gap: 1rem;
    }
    
    .ministry-logo {
        width: 55px;
        height: 55px;
        flex-shrink: 0;
    }
    
    .header-text {
        flex: 1;
    }
    
    .header-left {
        width: 100%;
    }
    
    .header h1 {
        font-size: 1.25rem;
    }
    
    .header h1 i {
        font-size: 1.1rem;
    }
    
    .header-subtitle {
        font-size: 0.75rem;
    }
    
    .user-info {
        width: 100%;
        justify-content: space-between;
        padding: 0.75rem 1rem;
    }
    
    .user-info span {
        font-size: 0.8rem;
    }
    
    .logout-btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .nav-tabs {
        margin: 0 0.5rem 1rem 0.5rem;
        border-radius: 8px;
        padding: 0.5rem;
        flex-wrap: wrap;
    }
    
    .main-content {
        margin: 0 0.5rem 1rem 0.5rem;
        border-radius: 12px;
        padding: 1.5rem;
    }
    
    .nav-tab {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-sections {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .staff-details {
        flex-direction: column;
        align-items: center;
    }
    
    .staff-photo-container {
        margin-bottom: 1.5rem;
    }
    
    .staff-info {
        text-align: center;
        margin-bottom: 1.5rem;
    }
    
    .qr-code-section {
        margin-left: 0;
        width: 100%;
        max-width: 300px;
    }
    
    .scanner-container {
        grid-template-columns: 1fr;
    }
    
    .scan-result-content {
        flex-direction: column;
        text-align: center;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .action-buttons {
        flex-wrap: wrap;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .login-box {
        padding: 1.5rem;
    }
    
    .modal-content {
        padding: 1.5rem;
        width: 95%;
    }
    
    .scanner-controls {
        flex-direction: column;
    }
    
    .manual-form .form-group {
        flex-direction: column;
    }
}

/* RBAC Specific Styles */
.section-tabs {
    display: flex;
    background: white;
    border-radius: 8px;
    padding: 0.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.section-tab {
    flex: 1;
    padding: 0.75rem 1.5rem;
    text-align: center;
    text-decoration: none;
    color: var(--text-muted);
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.section-tab:hover {
    background: var(--light-color);
    color: var(--primary-color);
}

.section-tab.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.permissions-form {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.permissions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.permission-module {
    background: var(--light-color);
    border-radius: 8px;
    padding: 1.5rem;
}

.permission-module h4 {
    margin: 0 0 1rem 0;
    color: var(--primary-color);
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.permission-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.permission-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem;
    background: white;
    border-radius: 6px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

.permission-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
}

.permission-item input[type="checkbox"] {
    margin-right: 0.75rem;
    transform: scale(1.2);
}

.permission-item input[type="checkbox"]:checked + .permission-name {
    color: var(--success-color);
    font-weight: 600;
}

.permission-name {
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.95rem;
}

.permission-description {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Role Badges */
.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-badge.superadmin {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
}

.role-badge.admin {
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
    color: white;
}

.role-badge.manager {
    background: linear-gradient(135deg, #ffeaa7, #fdcb6e);
    color: #2d3436;
}

/* User Info Enhancements */
.user-info small {
    display: block;
    font-size: 0.75rem;
    opacity: 0.8;
    margin-top: 0.25rem;
}

/* Access Denied Styles */
.access-denied {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.access-denied i {
    font-size: 4rem;
    color: var(--danger-color);
    margin-bottom: 1.5rem;
}

.access-denied h2 {
    color: var(--danger-color);
    margin-bottom: 1rem;
}

.access-denied p {
    color: var(--text-muted);
    margin-bottom: 2rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* Permission Indicators */
.permission-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.permission-indicator.allowed {
    background: #d1fae5;
    color: var(--success-color);
}

.permission-indicator.denied {
    background: #fee2e2;
    color: var(--danger-color);
}

/* Department Management Styles */
.department-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.department-stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.department-stat-card:hover {
    transform: translateY(-2px);
}

.department-stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.department-stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Reports Page Styles */
.reports-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.reports-title h2 {
    color: var(--primary-color);
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
}

.reports-title p {
    color: var(--text-muted);
    font-size: 1rem;
    margin: 0;
}

.report-actions {
    display: flex;
    gap: 0.75rem;
}

.btn-icon {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metric-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-color);
}

.metric-card.primary::before { background: var(--primary-color); }
.metric-card.success::before { background: var(--success-color); }
.metric-card.warning::before { background: var(--warning-color); }
.metric-card.info::before { background: var(--info-color); }

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.metric-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    flex-shrink: 0;
}

.metric-card.primary .metric-icon { background: linear-gradient(135deg, var(--primary-color), var(--primary-dark)); }
.metric-card.success .metric-icon { background: linear-gradient(135deg, var(--success-color), #059669); }
.metric-card.warning .metric-icon { background: linear-gradient(135deg, var(--warning-color), #d97706); }
.metric-card.info .metric-icon { background: linear-gradient(135deg, var(--info-color), #0891b2); }

.metric-content {
    flex: 1;
}

.metric-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-color);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.metric-label {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.metric-change {
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.metric-change.positive {
    color: var(--success-color);
}

.metric-change i {
    font-size: 0.625rem;
}

/* Analytics Grid */
.analytics-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.chart-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.chart-header h3 {
    color: var(--text-color);
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

.chart-controls {
    display: flex;
    gap: 0.5rem;
}

.chart-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-muted);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chart-btn:hover {
    background: var(--light-color);
    border-color: var(--primary-color);
}

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

.chart-container {
    height: 200px;
    position: relative;
}

/* Department Breakdown */
.department-breakdown {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dept-breakdown-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dept-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dept-name {
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.875rem;
}

.dept-stats {
    display: flex;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.dept-percentage {
    font-weight: 600;
    color: var(--primary-color);
}

.dept-bar {
    height: 8px;
    background: var(--light-color);
    border-radius: 4px;
    overflow: hidden;
}

.dept-progress {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Activity Section */
.activity-section {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
}

.activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.activity-header h3 {
    color: var(--text-color);
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

.activity-filters {
    display: flex;
    gap: 0.75rem;
}

.filter-select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: white;
    color: var(--text-color);
    font-size: 0.875rem;
    cursor: pointer;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.activity-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

/* For exactly 3 columns on larger screens */
@media (min-width: 1200px) {
    .activity-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

.activity-item {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--light-color);
    border-radius: 12px;
    transition: all 0.3s ease;
    min-height: 120px;
}

.activity-item:hover {
    background: #f1f5f9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.activity-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
    flex-shrink: 0;
    align-self: flex-start;
}

.activity-item[data-type="add"] .activity-icon { background: var(--success-color); }
.activity-item[data-type="edit"] .activity-icon { background: var(--warning-color); }
.activity-item[data-type="delete"] .activity-icon { background: var(--danger-color); }
.activity-item[data-type="view"] .activity-icon { background: var(--info-color); }
.activity-item[data-type="login"] .activity-icon { background: var(--primary-color); }
.activity-item[data-type="logout"] .activity-icon { background: var(--secondary-color); }
.activity-item[data-type="scan"] .activity-icon { background: #8B5CF6; }

.activity-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.activity-action {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.875rem;
}

.activity-details {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.activity-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.activity-user {
    font-weight: 500;
}

/* Health Section */
.health-section {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.health-section h3 {
    color: var(--text-color);
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 1.5rem 0;
}

.health-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.health-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--light-color);
    border-radius: 12px;
}

.health-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: white;
}

.health-icon.success {
    background: var(--success-color);
}

.health-icon.warning {
    background: var(--warning-color);
}

.health-icon.error {
    background: var(--danger-color);
}

.health-label {
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.875rem;
}

.health-status {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Responsive Design for Reports */
@media (max-width: 1024px) {
    .analytics-grid {
        grid-template-columns: 1fr;
    }
    
    .metrics-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .reports-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .report-actions {
        justify-content: stretch;
    }
    
    .report-actions .btn {
        flex: 1;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .activity-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .activity-meta {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .health-grid {
        grid-template-columns: 1fr;
    }
}
