:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --text-color: #333;
    --bg-color: #f5f6fa;
    --sidebar-width: 250px;
    /* Theme Colors */
    --blue: #3498db;
    --green: #2ecc71;
    --purple: #9b59b6;
    --orange: #e67e22;
    --red: #e74c3c;
    
    /* Default Values */
    --accent-color: var(--blue);
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
    --base-font-size: 0.9rem; /* Standardized, reduced from 14px */
    --font-scale: 1;
    
    /* Theme-specific variables */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #333333;
    --text-secondary: #666666;
    --border-color: #e0e0e0;
}

/* Dark theme */
[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --border-color: #404040;
}

/* High contrast mode */
[data-contrast="high"] {
    --text-primary: #000000;
    --text-secondary: #000000;
    --bg-primary: #ffffff;
    --bg-secondary: #ffffff;
    --border-color: #000000;
}

[data-theme="dark"][data-contrast="high"] {
    --text-primary: #ffffff;
    --text-secondary: #ffffff;
    --bg-primary: #000000;
    --bg-secondary: #000000;
    --border-color: #ffffff;
}

/* Layout density */
[data-density="comfortable"] {
    --spacing-unit: 1rem;
    --padding-sm: 0.5rem;
    --padding-md: 1rem;
    --padding-lg: 1.5rem;
}

[data-density="compact"] {
    --spacing-unit: 0.75rem;
    --padding-sm: 0.25rem;
    --padding-md: 0.75rem;
    --padding-lg: 1rem;
}

[data-density="spacious"] {
    --spacing-unit: 1.5rem;
    --padding-sm: 0.75rem;
    --padding-md: 1.5rem;
    --padding-lg: 2rem;
}

/* Animation settings */
[data-reduced-motion="none"] {
    --transition-speed: 0.2s;
}

[data-reduced-motion="reduced"] {
    --transition-speed: 0.4s;
}

[data-reduced-motion="minimal"] {
    --transition-speed: 0s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    font-size: var(--base-font-size);
    line-height: calc(1.5 * var(--font-scale));
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--primary-color);
    color: white;
    padding: 1rem;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.logo h2 {
    text-align: center;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.menu {
    list-style: none;
    margin-top: 2rem;
}

.menu li {
    margin-bottom: 0.5rem;
}

.menu a {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.menu a i {
    margin-right: 10px;
}

.menu a:hover, .menu a.active {
    background-color: var(--secondary-color);
}

.menu-dropdown .submenu {
    display: none;
    list-style: none;
    margin-left: 2rem;
    margin-top: 0.5rem;
}

.menu-dropdown:hover .submenu {
    display: block;
}

/* Main Content Styles */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 0.5rem;
    width: calc(100% - var(--sidebar-width));
    box-sizing: border-box;
}

/* Form Container Styles */
.form-container {
    width: 100%;
    max-width: none;
    padding: 1.5rem;
    margin: 0;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Content Container */
.content {
    width: 100%;
    margin: 0;
    padding: 1.5rem;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.top-nav {
    display: flex;
    justify-content: flex-end;  /* Changed from space-between to flex-end */
    align-items: center;
    padding: 1rem;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
    position: relative;
}

.search-bar {
    position: absolute;
    left: 1rem;
}

.top-nav-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;  /* Increased from 1rem for better spacing */
    margin-left: auto;
}

/* Notification Styles */
.notifications {
    position: relative;
    display: flex;
    align-items: center;
}

.notification-btn {
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    font-size: 1.2rem;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--accent-color);
    color: white;
    border-radius: 50%;
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
}

.notification-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    width: 300px;
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.notification-dropdown.show {
    display: block;
}

.notification-header {
    padding: 1rem;
    border-bottom: 1px solid #ddd;
}

.notification-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.notification-actions h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.notification-link {
    text-decoration: none;
    color: #3498db;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.notification-link:hover {
    background: #f8f9fa;
    color: #2980b9;
}

.mark-all-read {
    background: none;
    border: none;
    color: var(--secondary-color);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.mark-all-read:hover {
    background: #f8f9fa;
}

.notification-list {
    max-height: 300px;
    overflow-y: auto;
}

.notification-item {
    padding: 1rem;
    border-bottom: 1px solid #ddd;
    cursor: pointer;
}

.notification-item:hover {
    background-color: #f5f5f5;
}

/* User Profile Styles */
.user-profile {
    position: relative;
    display: flex;
    align-items: center;
}

.profile-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
}

.profile-btn img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    z-index: 1000;
}

.profile-dropdown.show {
    display: block;
}

.profile-dropdown ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.profile-dropdown ul li {
    padding: 0;
}

.profile-dropdown ul li a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s;
}

.profile-dropdown ul li a:hover {
    background-color: #f8f9fa;
}

.profile-dropdown ul li a i {
    margin-right: 10px;
    width: 16px;
    color: #666;
}

/* Ensure the profile button looks interactive */
.profile-btn {
    cursor: pointer;
    padding: 0;
    border: none;
    background: none;
    display: flex;
    align-items: center;
}

/* User Profile Dropdown Styles */
.user-info {
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.user-name {
    font-weight: 600;
    color: var(--text-color);
}

.admin-crown-icon {
    color: #ffd700; /* Gold color for the crown */
    margin-left: 0.5rem;
    font-size: 0.9rem;
    vertical-align: middle;
    animation: crown-glow 2s ease-in-out infinite alternate;
}

@keyframes crown-glow {
    from {
        text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
    }
    to {
        text-shadow: 0 0 10px rgba(255, 215, 0, 0.8), 0 0 15px rgba(255, 215, 0, 0.6);
    }
}

.user-email {
    font-size: 0.9rem;
    color: #666;
}

.user-status {
    margin-top: 0.25rem;
}

.divider {
    height: 1px;
    background-color: #eee;
    margin: 0.5rem 0;
}

/* Profile Dropdown Status Badge */
.user-status .status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
}

/* Content Styles */
.content {
    margin-top: 1rem; /* Reduced from 2rem */
    padding: 0.75rem; /* Reduced from 1rem */
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Table Styles */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.75rem; /* Reduced from 1rem */
}

.data-table th,
.data-table td {
    padding: 0.5rem 0.75rem; /* Reduced from 0.75rem 1rem */
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.data-table th {
    background-color: #f5f5f5;
    font-weight: 600;
}

.action-buttons {
    display: flex;
    gap: 0.25rem;
}

.btn {
    padding: var(--padding-sm) var(--padding-md);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all var(--transition-speed);
}

.btn-edit {
    background-color: var(--secondary-color);
    color: white;
}

.btn-approve {
    background-color: #27ae60;
    color: white;
}

.btn-decline {
    background-color: var(--accent-color);
    color: white;
}

.btn-delete {
    background-color: #e74c3c;
    color: white;
}

.btn-icon {
    padding: 0.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    color: white;
}

.btn-icon i {
    font-size: 0.9rem;
}

.btn-icon.btn-approve {
    background-color: #2ecc71;
}

.btn-icon.btn-approve:hover {
    background-color: #27ae60;
}

.btn-icon.btn-decline {
    background-color: #e74c3c;
}

.btn-icon.btn-decline:hover {
    background-color: #c0392b;
}

.btn-icon.btn-export {
    background-color: #9b59b6;
}

.btn-icon.btn-export:hover {
    background-color: #8e44ad;
}

.btn-icon.btn-delete {
    background-color: #e74c3c;
}

.btn-icon.btn-delete:hover {
    background-color: #c0392b;
}

.btn-icon:not(:last-child) {
    margin-right: 0.25rem;
}

/* Form Styles */
.form-container {
    width: 100%;
    max-width: none;
    margin: 1.5rem 0; /* Removed auto centering */
    padding: 1.5rem; /* Reduced from 2rem */
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: var(--spacing-unit);
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-actions {
    margin-top: 2rem;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Login Page Styles */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background-color: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-color);
    opacity: 0.8;
}

.login-form .form-group {
    margin-bottom: 1.5rem;
}

.input-with-icon {
    position: relative;
}

.input-with-icon input {
    padding-left: 40px;
    width: 100%;
    height: 45px;
}

.input-with-icon i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-color);
    opacity: 0.5;
}

.btn-login {
    width: 100%;
    background-color: var(--primary-color);
    color: white;
    height: 45px;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.btn-login:hover {
    background-color: var(--secondary-color);
}

.error-message {
    color: var(--accent-color);
    text-align: center;
    margin-top: 1rem;
    display: none;
}

.avatar-initials {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--secondary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 600;
}

/* Role Badge Styles */
.role-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.role-guest {
    background-color: #95a5a6;
    color: white;
}

.role-standard {
    background-color: #3498db;
    color: white;
}

.role-editor {
    background-color: #2ecc71;
    color: white;
}

.role-admin {
    background-color: #e67e22;
    color: white;
}

.role-superuser {
    background-color: #9b59b6;
    color: white;
}

/* Form Hint Style */
.form-hint {
    color: #666;
    font-size: 0.8rem;
    margin-top: 4px;
    display: block;
}

/* Content Header with Button */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

/* User Table Status Styles */
.status-active {
    background-color: #2ecc71;
    color: white;
}

.status-inactive {
    background-color: #95a5a6;
    color: white;
}

/* Modal Header Styles */
.modal-header {
    border-bottom: 1px solid #ddd;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

/* Modal Footer Styles */
.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    gap: 0.85rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-start; /* Changed from flex-end to flex-start to align buttons to the left */
    background: rgba(255, 255, 255, 0.95);
    position: sticky;
    bottom: 0;
    z-index: 2;
    box-shadow: 0 -2px 15px rgba(0, 0, 0, 0.03);
}

.modal-footer .btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

/* Color coding for different action buttons */
.btn-edit {
    background-color: #3b82f6; /* Blue */
    color: white;
    box-shadow: 0 2px 5px rgba(59, 130, 246, 0.3);
}

.btn-edit:hover {
    background-color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.4);
}

.btn-success {
    background-color: #10b981; /* Green */
    color: white;
    box-shadow: 0 2px 5px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    background-color: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.4);
}

.btn-danger {
    background-color: #ef4444; /* Red */
    color: white;
    box-shadow: 0 2px 5px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background-color: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.4);
}

.btn-delete {
    background-color: #f43f5e; /* Pink/Red */
    color: white;
    box-shadow: 0 2px 5px rgba(244, 63, 94, 0.3);
}

.btn-delete:hover {
    background-color: #e11d48;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(244, 63, 94, 0.4);
}

.btn-secondary {
    background-color: #6b7280; /* Gray */
    color: white;
    box-shadow: 0 2px 5px rgba(107, 114, 128, 0.3);
}

.btn-secondary:hover {
    background-color: #4b5563;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(107, 114, 128, 0.4);
}

/* New warning color button - Yellow/Amber */
.btn-warning {
    background-color: #f59e0b;
    color: white;
    box-shadow: 0 2px 5px rgba(245, 158, 11, 0.3);
}

.btn-warning:hover {
    background-color: #d97706;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(245, 158, 11, 0.4);
}

/* New info color button - Light blue */
.btn-info {
    background-color: #0ea5e9;
    color: white;
    box-shadow: 0 2px 5px rgba(14, 165, 233, 0.3);
}

.btn-info:hover {
    background-color: #0284c7;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(14, 165, 233, 0.4);
}

/* Disabled button styling */
.btn:disabled,
.btn.btn-disabled {
    opacity: 1; /* Changed from 0.6 */
    cursor: pointer; /* Changed from not-allowed */
    pointer-events: auto; /* Changed from none */
    position: relative;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.btn:disabled:hover,
.btn.btn-disabled:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn.btn-success:disabled,
.btn.btn-success.btn-disabled {
    background-color: #10b981; /* Changed from #92d3b5 to full color */
    color: #ffffff;
}

/* Add tooltip styling for disabled buttons */
.btn.btn-disabled::before {
    content: attr(title);
    position: absolute;
    background-color: rgba(51, 51, 51, 0.9);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.btn.btn-disabled::after {
    content: "";
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: rgba(51, 51, 51, 0.9) transparent transparent transparent;
    opacity: 0;
    transition: opacity 0.3s;
}

/* Settings Navigation Styles */
.settings-navigation {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
}

.settings-nav-item {
    background: white;
    border-radius: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.settings-nav-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.settings-nav-item a {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.settings-nav-item i {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.settings-nav-item span {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.settings-description {
    font-size: 0.9rem;
    color: #666;
    margin: 0;
}

/* Settings Section Styles */
.settings-section {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.settings-section h2 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

/* Role Management Styles */
.roles-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.roles-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    max-height: calc(100vh - 300px);
    overflow-y: auto;
}

.role-card {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.role-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.role-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.role-header h3 {
    margin: 0;
    color: #2c3e50;
}

.role-description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.role-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: #888;
}

.permission-section {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.permission-header {
    margin-bottom: 1rem;
}

.permission-header h3 {
    margin: 0;
    color: #2c3e50;
}

.permission-table {
    width: 100%;
    border-collapse: collapse;
}

.permission-table th,
.permission-table td {
    padding: 0.75rem;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.permission-table th:first-child,
.permission-table td:first-child {
    text-align: left;
}

.permission-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

/* Checkbox styling */
.checkbox-container {
    display: inline-block;
    position: relative;
    padding-left: 25px;
    cursor: pointer;
    user-select: none;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 18px;
    width: 18px;
    background-color: #eee;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.checkbox-container:hover input ~ .checkmark {
    background-color: #ccc;
}

.checkbox-container input:checked ~ .checkmark {
    background-color: #2196F3;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Role modal specific styles */
#roleModal .modal-content {
    max-width: 500px;
}

/* Enhanced Role Management Styles */
.roles-container {
    background: white;
    border-radius: 12px;
    padding: 2rem;
}

.roles-list {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
}

.roles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.role-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    border: 1px solid #eee;
}

.role-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-color: var(--secondary-color);
}

.role-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.role-header h3 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.role-actions {
    display: flex;
    gap: 0.5rem;
}

.role-actions .btn {
    padding: 0.4rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.role-actions .btn-edit {
    background: #e3f2fd;
    color: #2196f3;
}

.role-actions .btn-delete {
    background: #ffebee;
    color: #f44336;
}

.role-description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.role-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.8rem;
    color: #888;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.permissions-section {
    margin-top: 2rem;
}

.permissions-container {
    display: grid;
    gap: 1.5rem;
}

.permission-section {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #eee;
}

.permission-header {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f5f5f5;
}

.permission-header h3 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.permission-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

/* Approval Flow Table Styles */
.approval-flow-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
    margin: 1rem 0;
}

.approval-flow-table th {
    text-align: left;
    padding: 12px;
    background-color: #f8f9fa;
    color: #495057;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
}

.approval-flow-table td {
    padding: 12px;
    vertical-align: middle;
    background-color: #fff;
    border-top: 1px solid #e9ecef;
    border-bottom: 1px solid #e9ecef;
}

.approval-flow-table td:first-child {
    border-left: 1px solid #e9ecef;
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
}

.approval-flow-table td:last-child {
    border-right: 1px solid #e9ecef;
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
}

.approval-flow-table .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--secondary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 600;
}

.approval-flow-table .name-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.approval-flow-table .title-department {
    font-size: 0.875rem;
    color: #6c757d;
}

.approval-flow-table .approval-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
}

.approval-flow-table .status-pending {
    background-color: #fff3cd;
    color: #856404;
}

.approval-flow-table .status-approved {
    background-color: #d4edda;
    color: #155724;
}

.approval-flow-table .status-rejected {
    background-color: #f8d7da;
    color: #721c24;
}

.approval-flow-table .status-locked {
    background-color: #e9ecef;
    color: #495057;
}

.approval-flow-table .approval-date {
    color: #6c757d;
    font-size: 0.875rem;
}

.approval-flow-table .comments {
    color: #495057;
    font-size: 0.875rem;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.approval-flow-table tr.clickable {
    cursor: pointer;
}

.approval-flow-table tr.clickable:hover td {
    background-color: #f8f9fa;
}

/* Level divider */
.approval-flow-table tr.level-divider td {
    padding: 8px 12px;
    background-color: #f8f9fa;
    color: #495057;
    font-weight: 600;
}
/* Enhanced Form Styles for Access Request */
.form-container {
    max-width: none; /* Removed width limit for full page width */
    width: 100%; /* Use full width */
    margin: 1.5rem 0; /* Removed auto centering, use full width */
    padding: 1.5rem; /* Reduced from 2rem */
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.form-section {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    background-color: #fafbfc;
}

.form-section legend {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--primary-color);
    padding: 0 0.5rem;
    margin-bottom: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-row .form-group {
    margin-bottom: 0;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
}

.checkbox-label input[type="checkbox"] {
    margin-top: 15px;
}

/* Required field indicator */
.form-group label:after {
    content: "";
}

.form-group label[for*="required"]:after,
label:has(+ [required]):after {
    content: " *";
    color: #e74c3c;
}

/* File input styling */
input[type="file"] {
    padding: 0.5rem;
    border: 2px dashed #ddd;
    background-color: #f9f9f9;
}

input[type="file"]:hover {
    border-color: var(--secondary-color);
    background-color: #f0f8ff;
}

/* Time input styling */
input[type="time"] {
    appearance: none;
    -webkit-appearance: none;
}

/* Form validation styles */
.form-group input:invalid,
.form-group select:invalid,
.form-group textarea:invalid {
    border-color: #e74c3c;
}

.form-group input:valid,
.form-group select:valid,
.form-group textarea:valid {
    border-color: #27ae60;
}

/* Enhanced Access Request Details Modal Styles */
.request-details-container {
    max-height: 70vh;
    overflow-y: auto;
    padding: 1rem;
}

.details-section {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    padding: 1.5rem;
}

.details-section h4 {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-item.full-width {
    grid-column: 1 / -1;
}

.detail-item label {
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
}

.detail-item span {
    color: #333;
    font-size: 0.95rem;
    line-height: 1.4;
}

/* Badge Styles for Access Details */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 4px;
    margin: 0.125rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge.access-type-area { background-color: #d4edda; color: #155724; }
.badge.access-type-system { background-color: #d1ecf1; color: #0c5460; }
.badge.access-type-equipment { background-color: #fff3cd; color: #856404; }
.badge.access-type-vehicle { background-color: #f8d7da; color: #721c24; }
.badge.access-type-confined_space { background-color: #e2e3e5; color: #383d41; }
.badge.access-type-restricted_zone { background-color: #f5c6cb; color: #721c24; }
.badge.access-type-high_security { background-color: #d6d8db; color: #383d41; }
.badge.access-type-hazardous_area { background-color: #f8d7da; color: #721c24; }

.badge.priority-routine { background-color: #d4edda; color: #155724; }
.badge.priority-urgent { background-color: #fff3cd; color: #856404; }
.badge.priority-emergency { background-color: #f8d7da; color: #721c24; }
.badge.priority-critical { background-color: #721c24; color: #ffffff; }

.badge.risk-low { background-color: #d4edda; color: #155724; }
.badge.risk-medium { background-color: #fff3cd; color: #856404; }
.badge.risk-high { background-color: #f8d7da; color: #721c24; }
.badge.risk-critical { background-color: #721c24; color: #ffffff; }

.badge.env-none { background-color: #d4edda; color: #155724; }
.badge.env-chemical { background-color: #fff3cd; color: #856404; }
.badge.env-noise { background-color: #d1ecf1; color: #0c5460; }
.badge.env-radiation { background-color: #f8d7da; color: #721c24; }
.badge.env-temperature { background-color: #fff3cd; color: #856404; }
.badge.env-confined { background-color: #f8d7da; color: #721c24; }
.badge.env-oxygen { background-color: #721c24; color: #ffffff; }
.badge.env-explosive { background-color: #721c24; color: #ffffff; }

.training-badges, .ppe-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.training-badge {
    background-color: #e7f3ff;
    color: #004085;
    border: 1px solid #bee5eb;
}

.ppe-badge {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.no-items {
    color: #6c757d;
    font-style: italic;
    font-size: 0.9rem;
}

/* Declarations Section */
.declarations-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.declaration-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem;
    background-color: #f8f9fa;
    border-left: 4px solid #28a745;
    border-radius: 4px;
}

.declaration-item i {
    color: #28a745;
    margin-top: 0.125rem;
    flex-shrink: 0;
}

.declaration-item span {
    line-height: 1.4;
    font-size: 0.9rem;
}

.no-declarations {
    color: #6c757d;
    font-style: italic;
    text-align: center;
    padding: 1rem;
}

.text-success {
    color: #28a745 !important;
}

.text-danger {
    color: #dc3545 !important;
}

/* Multiple Select Styles */
select[multiple] {
    padding: 8px;
    width: 100%;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 4px;
    background-color: white;
}

select[multiple] option {
    padding: 8px;
    margin: 2px 0;
    border-radius: 2px;
}

select[multiple] option:checked {
    background-color: var(--secondary-color);
    color: white;
}

/* Visitor Input Group Styles */
.visitor-controls {
    display: flex;
    justify-content: flex-start;
    margin-top: 10px;
}

.visitor-row {
    margin-bottom: 20px;
}

.visitor-row .form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    align-items: flex-start;
    width: 100%;
}

.visitor-row .form-group {
    flex: 1;
    min-width: 200px;
}

.btn-add-visitor {
    padding: 8px 12px;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-add-visitor:hover {
    background-color: #2980b9;
}

.btn-remove-visitor {
    padding: 8px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
    width: 30px;
    height: 30px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

.btn-remove-visitor:hover {
    background-color: #c0392b;
}

.visitor-attachment {
    width: 100%;
}

/* Equipment Styles */
.equipment-row {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 1rem;
    padding: 1rem;
}

.equipment-row .form-row {
    position: relative;
    padding-right: 40px; /* Space for remove button */
}

.btn-remove-equipment {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

.btn-remove-equipment:hover {
    background-color: #c82333;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 6px rgba(220, 53, 69, 0.4);
}

.equipment-controls {
    margin-top: 1rem;
    text-align: left;
}

.btn-add-equipment {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-add-equipment:hover {
    background-color: #2980b9;
}

.equipment-attachment {
    margin-top: 0.5rem;
}

#referenceNumber {
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: not-allowed;
    font-family: monospace;
    font-size: 1.1em;
    letter-spacing: 1px;
}

#referenceNumber:focus {
    outline: none;
    box-shadow: none;
}

.declaration-text {
    display: inline-block;
    white-space: normal;
    line-height: 1.4;
    margin-left: 10px;
    padding: 8px 12px;
    background-color: var(--bg-secondary);
    border-radius: 4px;
    font-size: 0.95em;
    max-width: calc(100% - 40px);
}

/* Table styles for visitors and equipment sections */
.info-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #e2e8f0;
    margin: 1rem 0;
    font-size: 0.9rem;
}

.info-table th,
.info-table td {
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    text-align: left;
}

.info-table th {
    background-color: #f8fafc;
    font-weight: 600;
    white-space: nowrap;
}

.info-table td {
    background-color: #fff;
}

.info-table tbody tr:hover td {
    background-color: #f1f5f9;
}

.info-table td a {
    color: #3b82f6;
    text-decoration: none;
}

.info-table td a:hover {
    text-decoration: underline;
}

.table-responsive {
    overflow-x: auto;
    margin: 1rem -1rem;
    padding: 0 1rem;
}

/* Specific table styles */
.visitors-table th:first-child,
.visitors-table td:first-child {
    min-width: 200px; /* Ensure name column has enough space */
}

.equipment-table th:first-child,
.equipment-table td:first-child {
    min-width: 180px; /* Ensure equipment name has enough space */
}

/* Status badges in tables */
.info-table .status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Table footer/summary section */
.table-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
    font-size: 0.875rem;
    color: #64748b;
}

/* Empty state for tables */
.empty-state {
    text-align: center;
    padding: 2rem;
    color: #64748b;
    font-size: 0.875rem;
}

/* Password Strength Indicator Styles */
.password-strength {
    margin-top: 0.5rem;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.password-strength-bar {
    height: 100%;
    width: 0;
    transition: width 0.4s ease, background-color 0.3s ease;
    border-radius: 3px;
}

.password-strength-bar.weak {
    background-color: #dc3545;
    box-shadow: 0 0 8px rgba(220, 53, 69, 0.3);
}

.password-strength-bar.medium {
    background-color: #ffc107;
    box-shadow: 0 0 8px rgba(255, 193, 7, 0.3);
}

.password-strength-bar.strong {
    background-color: #28a745;
    box-shadow: 0 0 8px rgba(40, 167, 69, 0.3);
}

/* Password Requirements List */
.password-requirements {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background-color: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #6c757d;
    font-size: 0.85rem;
}

.password-requirements h6 {
    margin: 0 0 0.5rem 0;
    color: #495057;
    font-weight: 600;
}

.password-requirements ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.password-requirements li {
    display: flex;
    align-items: center;
    margin-bottom: 0.25rem;
    padding: 0.25rem 0;
    transition: color 0.3s ease;
}

.password-requirements li i {
    margin-right: 0.5rem;
    width: 14px;
    transition: color 0.3s ease;
}

.password-requirements li.valid {
    color: #28a745;
}

.password-requirements li.valid i {
    color: #28a745;
}

.password-requirements li.invalid {
    color: #6c757d;
}

.password-requirements li.invalid i {
    color: #6c757d;
}

/* Password confirmation feedback */
.password-match-feedback {
    margin-top: 0.5rem;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    display: none;
}

.password-match-feedback.match {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.password-match-feedback.no-match {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* Enhanced form input focus states for password fields */
input[type="password"]:focus {
    border-color: var(--secondary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Password field error state */
input[type="password"].error {
    border-color: #dc3545;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2);
}

/* Success state for password fields */
input[type="password"].success {
    border-color: #28a745;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.2);
}

/* Password Input Container with Toggle Button */
.password-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-container input {
    width: 100%;
    padding-right: 45px; /* Make room for the toggle button */
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: #6c757d;
    font-size: 16px;
    line-height: 1;
    transition: color 0.3s ease, transform 0.2s ease;
    z-index: 2;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.password-toggle:hover {
    color: var(--secondary-color);
    background-color: rgba(52, 152, 219, 0.1);
    transform: translateY(-50%) scale(1.1);
}

.password-toggle:active {
    transform: translateY(-50%) scale(0.95);
}

.password-toggle:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
    color: var(--secondary-color);
}

/* Icon animation when toggling */
.password-toggle i {
    transition: transform 0.2s ease;
}

.password-toggle.active i {
    transform: scale(1.1);
}

/* Ensure the toggle button works properly with different input states */
.password-input-container input:focus + .password-toggle,
.password-input-container input.error + .password-toggle,
.password-input-container input.success + .password-toggle {
    /* Keep toggle button visible and properly positioned even when input has focus/error/success states */
    z-index: 3;
}

/* Dark theme support for password toggle */
[data-theme="dark"] .password-toggle {
    color: #adb5bd;
}

[data-theme="dark"] .password-toggle:hover {
    color: var(--secondary-color);
    background-color: rgba(52, 152, 219, 0.2);
}

/* High contrast mode support */
[data-contrast="high"] .password-toggle {
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

[data-contrast="high"] .password-toggle:hover {
    background-color: var(--bg-secondary);
}

/* Current Password Validation Feedback */
.current-password-feedback {
    margin-top: 0.5rem;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    display: none;
}

.current-password-feedback.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.current-password-feedback.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* Enhanced feedback for all password validation states */
.current-password-feedback.success::before {
    content: "✓ ";
    font-weight: bold;
}

.current-password-feedback.error::before {
    content: "✗ ";
    font-weight: bold;
}

/* Dark theme support for current password feedback */
[data-theme="dark"] .current-password-feedback.success {
    background-color: rgba(40, 167, 69, 0.2);
    color: #28a745;
    border-color: rgba(40, 167, 69, 0.3);
}

[data-theme="dark"] .current-password-feedback.error {
    background-color: rgba(220, 53, 69, 0.2);
    color: #dc3545;
    border-color: rgba(220, 53, 69, 0.3);
}

/* High contrast mode support */
[data-contrast="high"] .current-password-feedback.success {
    background-color: var(--bg-primary);
    color: #006600;
    border: 2px solid #006600;
}

[data-contrast="high"] .current-password-feedback.error {
    background-color: var(--bg-primary);
    color: #cc0000;
    border: 2px solid #cc0000;
}

/* Preferences Page Styles */
.preferences-tabs {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin-top: 20px;
    overflow: hidden;
}

.tab-nav {
    display: flex;
    gap: 2px;
    padding: 2px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.tab-btn {
    flex: 1;
    padding: 14px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #6c757d;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab-btn:hover {
    background: #e9ecef;
    color: #495057;
}

.tab-btn.active {
    background: white;
    color: var(--accent-color);
}

.tab-btn i {
    font-size: 1.1em;
}

.tab-content {
    padding: 24px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Section Styles */
.section-header {
    margin-bottom: 24px;
}

.section-header h3 {
    font-size: 1.25rem;
    color: #2d3748;
    margin-bottom: 8px;
    font-weight: 600;
}

.section-header p {
    color: #718096;
    font-size: 0.95rem;
    margin: 0;
}

.settings-section {
    max-width: 800px;
    margin: 0 auto;
}

.settings-group {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.settings-group h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    color: #2d3748;
    margin: 0 0 16px 0;
}

.settings-group h4 i {
    color: var(--accent-color);
}

/* Toggle Switch Styles */
.toggle-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
}

.toggle-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.toggle-info {
    flex: 1;
    padding-right: 20px;
}

.toggle-info label {
    display: block;
    font-weight: 500;
    color: #2d3748;
    margin-bottom: 4px;
}

.toggle-description {
    display: block;
    font-size: 0.9rem;
    color: #718096;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e0;
    transition: .4s;
    border-radius: 24px;
}

.switch:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .switch {
    background-color: var(--accent-color);
}

input:focus + .switch {
    box-shadow: 0 0 1px var(--accent-color);
}

input:checked + .switch:before {
    transform: translateX(26px);
}

/* Notification Priority Styles */
.priority-high .toggle-info label {
    color: #e53e3e;
}

.priority-high .toggle-description {
    color: #f56565;
}

.priority-medium .toggle-info label {
    color: #d69e2e;
}

.priority-medium .toggle-description {
    color: #ecc94b;
}

/* Quiet Hours Settings */
.quiet-hours-settings {
    margin-top: 12px;
}

.time-range {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
}

.time-range .form-group {
    margin: 0;
}

.time-range input[type="time"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.95rem;
    color: #2d3748;
}

/* Action Buttons */
.notification-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e2e8f0;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-primary {
    background: var(--accent-color);
    color: white;
}

.btn-primary:hover {
    filter: brightness(110%);
}

.btn-secondary {
    background: #718096;
    color: white;
}

.btn-secondary:hover {
    background: #4a5568;
}

.btn-outline-danger {
    background: transparent;
    border: 1px solid #e53e3e;
    color: #e53e3e;
}

.btn-outline-danger:hover {
    background: #e53e3e;
    color: white;
}

/* Form Hint */
.form-hint {
    font-size: 0.85rem;
    color: #718096;
    margin-top: 4px;
}

/* Email History Table Styles */
.email-history-container {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin: 20px 0;
}

.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.search-box {
    position: relative;
    width: 300px;
}

.search-box input {
    width: 100%;
    padding: 8px 32px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
}

.search-box i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

.table-responsive {
    overflow-x: auto;
    margin-bottom: 20px;
}

#emailHistoryTable {
    width: 100%;
    border-collapse: collapse;
}

#emailHistoryTable th,
#emailHistoryTable td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

#emailHistoryTable th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #333;
}

#emailHistoryTable tbody tr:hover {
    background-color: #f8f9fa;
}

.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-sent {
    background-color: #d4edda;
    color: #155724;
}

.status-failed {
    background-color: #f8d7da;
    color: #721c24;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
}

.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
}

.pagination-controls button {
    padding: 6px 12px;
    border: 1px solid #dee2e6;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
}

.pagination-controls button:hover:not(:disabled) {
    background-color: #e9ecef;
}

.pagination-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-controls .active {
    background-color: #007bff;
    color: #fff;
    border-color: #007bff;
}

/* Notification System Styles for KPI Management */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10000;
    animation: slideIn 0.3s ease-out;
    max-width: 400px;
    color: white;
    font-weight: 500;
}

.notification-success {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
}

.notification-error {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.notification-warning {
    background: linear-gradient(135deg, #f39c12, #e67e22);
}

.notification-info {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.notification-content i {
    font-size: 1.2rem;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* KPI Management Styles */
.kpi-container {
    margin: 90px 0 0;
    padding: 0;
    width: 100%;
    max-width: none;
}

.kpi-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.kpi-title h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.kpi-title p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.dashboard-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.summary-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.summary-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    background: var(--primary-color);
}

.summary-icon.active {
    background: var(--success-color);
}

.summary-icon.critical {
    background: var(--danger-color);
}

.summary-icon.excellent {
    background: var(--warning-color);
}

.summary-content h3 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.25rem 0;
    color: var(--text-primary);
}

.summary-content p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.9rem;
}

.filter-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 200px;
}

.filter-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.filter-select {
    padding: 0.75rem;
    border: 2px solid rgba(0, 0, 0, 0.08);
    border-radius: 6px;
    font-size: 0.9rem;
    background: white;
    transition: border-color 0.2s ease;
}

.filter-select:focus {
    border-color: var(--primary-color);
    outline: none;
}

.table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-bottom: 2rem;
}

.table-header {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.table-actions {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.table-wrapper {
    overflow-x: auto;
}

.pagination-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
       background: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    flex-wrap: wrap;
    gap: 1rem;
}

.pagination-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-numbers {
    display: flex;
    gap: 0.25rem;
}

.pagination-number {
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-number:hover {
    background: var(--bg-secondary);
}

.pagination-number.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Overall Performance Summary Styles */
.overall-performance-summary {
    margin: 2rem 0;
    padding: 0;
}

.summary-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    overflow: hidden;
    position: relative;
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    pointer-events: none;
}

.summary-header {
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    color: white;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.summary-header h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
}

.summary-header h4 i {
    margin-right: 0.5rem;
    color: #ffd700;
}

.summary-header p {
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
}

.summary-content {
    padding: 2rem 1.5rem;
    background: white;
}

.performance-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metric-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 4px;
    width: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.metric-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.metric-info {
    flex: 1;
}

.metric-label {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    line-height: 1.2;
}

.metric-value.excellent {
    color: #28a745;
}

.metric-value.good {
    color: #17a2b8;
}

.metric-value.average {
    color: #ffc107;
}

.metric-value.poor {
    color: #dc3545;
}

.performance-analytics {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.analytics-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.analytics-item {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.analytics-header h5 {
    margin: 0 0 1rem 0;
    color: #2c3e50;
    font-size: 1.1rem;
    font-weight: 600;
}

.analytics-header h5 i {
    margin-right: 0.5rem;
    color: #3498db;
}

.distribution-chart {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.distribution-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 4px;
}

.distribution-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #495057;
}

.distribution-bar {
    flex: 1;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    margin: 0 1rem;
    position: relative;
    overflow: hidden;
}

.distribution-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.distribution-count {
    font-size: 0.8rem;
    font-weight: 600;
    color: #6c757d;
    min-width: 30px;
    text-align: right;
}

.achievement-summary {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.achievement-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #3498db;
}

.achievement-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #495057;
}

.achievement-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50;
}

.final-evaluation-summary {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid rgba(255, 255, 255, 0.1);
}

.summary-footer {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: 8px;
}

.summary-footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
}

.evaluation-conclusion h6 {
    margin: 0 0 0.5rem 0;
    color: white;
    font-size: 1rem;
    font-weight: 600;
}

.evaluation-conclusion h6 i {
    margin-right: 0.5rem;
    color: #f39c12;
}

.evaluation-conclusion p {
    margin: 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    line-height: 1.4;
}

.evaluation-timestamp {
    text-align: right;
    color: rgba(255, 255, 255, 0.6);
}

.evaluation-timestamp i {
    margin-right: 0.25rem;
}

/* Responsive design for analytics */
@media (max-width: 992px) {
    .analytics-row {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .summary-footer-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .evaluation-timestamp {
        text-align: left;
    }
}

@media (max-width: 768px) {
    .primary-metric {
        grid-column: span 1;
    }
    
    .metric-value.large {
        font-size: 2rem;
    }
    
    .year-end-summary {
        margin-top: 2rem;
    }
    
    .performance-analytics {
        padding: 1rem;
    }
    
    .analytics-item {
        padding: 1rem;
    }
}

/* Company Context Information Styles */
.company-context-info {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.context-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-primary);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.context-item label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.context-item span {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.access-granted {
    color: var(--green) !important;
    font-weight: 600;
}

.access-denied {
    color: var(--red) !important;
    font-weight: 600;
}

/* Responsive adjustments for company context */
@media (max-width: 768px) {
    .company-context-info {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding: 0.75rem;
    }
    
    .context-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0.75rem;
    }
    
    .context-item label,
    .context-item span {
        font-size: 0.85rem;
    }
}

/* Enhanced status messages for authentication */
.status-message.status-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-left: 4px solid #ffc107;
    color: #856404;
}

.status-message.status-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    border-left: 4px solid #17a2b8;
    color: #0c5460;
}

.status-message .fas {
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

/* Company-scoped settings indicator */
.settings-header::after {
    content: '';
    display: block;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    margin-top: 1rem;
    border-radius: 2px;
}