/* Admin Panel Styles */

/* Searchable Dropdown Component */
.searchable-dropdown {
    position: relative;
    display: inline-block;
    width: 100%;
}

.searchable-dropdown input[type="text"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
    cursor: pointer;
}

.searchable-dropdown input[type="text"]:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.searchable-dropdown .dropdown-arrow {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #666;
    transition: transform 0.2s;
}

.searchable-dropdown.open .dropdown-arrow {
    transform: translateY(-50%) rotate(180deg);
}

.searchable-dropdown .dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.searchable-dropdown.open .dropdown-list {
    display: block;
}

.searchable-dropdown .dropdown-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    transition: background-color 0.1s;
}

.searchable-dropdown .dropdown-item:hover {
    background-color: #f8f9fa;
}

.searchable-dropdown .dropdown-item.selected {
    background-color: #007bff;
    color: white;
}

.searchable-dropdown .dropdown-item.no-results {
    color: #999;
    font-style: italic;
    cursor: default;
}

.searchable-dropdown .dropdown-item.no-results:hover {
    background-color: transparent;
}

.searchable-dropdown .dropdown-loading {
    padding: 10px 12px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

/* Layout */
.admin-layout {
    display: flex;
    height: 100vh;
    background-color: #f0f2f5;
}

/* Sidebar */
.admin-sidebar {
    width: 280px;
    background-color: #1a1d23;
    color: #fff;
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #2d3139;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.btn-logout {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-logout:hover {
    background: #c82333;
}

/* Sidebar Sections */
.sidebar-section {
    padding: 20px 0;
    border-bottom: 1px solid #2d3139;
}

.section-title {
    padding: 0 20px;
    margin-bottom: 10px;
    font-size: 14px;
    text-transform: uppercase;
    color: #8b92a1;
    font-weight: 500;
    text-align: left;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-item {
    display: block;
    padding: 12px 20px;
    color: #c7cdd8;
    text-decoration: none;
    transition: all 0.3s;
    font-size: 14px;
}

.menu-item:hover {
    background-color: #2d3139;
    color: #fff;
    padding-left: 25px;
}

.menu-item.active {
    background-color: #3b82f6;
    color: #fff;
}

/* Main Content */
.admin-content {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

.content-section {
    display: none;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.content-section.active {
    display: block;
}

/* Section Header */
.section-header {
    padding: 20px 30px;
    border-bottom: 1px solid #e5e7eb;
}

.section-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: #1a1d23;
    margin: 0 0 15px 0;
}

.section-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.search-input {
    flex: 1;
    max-width: 400px;
    padding: 10px 15px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
    background-color: #ffffff;
    color: #495057;
}

.search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background-color: #ffffff;
}

.total-count {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

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

.admin-table thead {
    background-color: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
}

.admin-table th {
    padding: 12px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    color: #374151;
}

.admin-table td {
    padding: 12px 20px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
    color: #1f2937;
}

.admin-table tbody tr:hover {
    background-color: #f9fafb;
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.active {
    background-color: #d1fae5;
    color: #065f46;
}

.status-badge.inactive {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Placeholder Content */
.placeholder-content {
    padding: 60px;
    text-align: center;
    color: #6b7280;
}

.placeholder-content p {
    margin: 10px 0;
    font-size: 16px;
}

.placeholder-content p:first-child {
    font-size: 20px;
    font-weight: 500;
    color: #374151;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 40px;
    color: #6b7280;
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% {
        content: '';
    }
    40% {
        content: '.';
    }
    60% {
        content: '..';
    }
    80%, 100% {
        content: '...';
    }
}

/* Upload section styles */
.upload-block {
    background: #f8f9fa;
    padding: 24px;
    border-radius: 8px;
    margin-bottom: 24px;
}

.upload-block h3 {
    margin-top: 0;
    margin-bottom: 16px;
    color: #1a1d23;
}

.sync-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.upload-form {
    max-width: 600px;
}

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

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 4px;
    font-weight: 500;
    color: #495057;
}

.form-control {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    background-color: #ffffff;
    color: #495057;
}

.form-control:focus {
    outline: none;
    border-color: #4785ff;
    box-shadow: 0 0 0 3px rgba(71, 133, 255, 0.1);
    background-color: #ffffff;
}

.status-message {
    margin-top: 16px;
    padding: 12px;
    border-radius: 4px;
    display: none;
}

.status-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.status-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

.status-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
    display: block;
}

/* Progress display */
.status-message.info div {
    margin-bottom: 4px;
}

.status-message.info div:last-child {
    margin-bottom: 0;
}

.progress-bar {
    background: #f0f0f0;
    border-radius: 4px;
    height: 8px;
    margin-top: 8px;
    overflow: hidden;
}

.progress-bar-fill {
    background: #007bff;
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
    min-width: 2px;
}

.spinner {
    display: inline-block;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .admin-layout {
        flex-direction: column;
    }
    
    .admin-sidebar {
        width: 100%;
        height: auto;
    }
    
    .admin-content {
        padding: 20px;
    }
    
    .section-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-input {
        max-width: none;
    }
    
    .table-container {
        margin: 0 -20px;
        padding: 0 20px;
    }
    
    .admin-table {
        font-size: 12px;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 8px 12px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .sync-buttons {
        flex-direction: column;
    }
}

/* Filter controls */
.filter-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-controls .search-input {
    width: 200px;
}

.filter-controls .form-control {
    width: auto;
    min-width: 150px;
}

.filter-controls select.form-control {
    min-width: 180px;
}

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

/* Ensure month input fields have light background in admin panel */
#adminScreen input[type="month"] {
    background-color: #ffffff !important;
    color: #495057 !important;
    border: 1px solid #ced4da !important;
}

#adminScreen input[type="month"]:focus {
    background-color: #ffffff !important;
    border-color: #4785ff !important;
    box-shadow: 0 0 0 3px rgba(71, 133, 255, 0.1) !important;
}

/* Ensure time input fields have light background in admin panel (schedule details) */
#adminScreen input[type="time"] {
    background-color: #ffffff !important;
    color: #495057 !important;
    border: 1px solid #ced4da !important;
}

#adminScreen input[type="time"]:focus {
    background-color: #ffffff !important;
    border-color: #4785ff !important;
    box-shadow: 0 0 0 3px rgba(71, 133, 255, 0.1) !important;
}

.btn--success {
    background-color: #28a745;
    color: white;
    border: 1px solid #28a745;
}

.btn--success:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

/* Status styles in table */
.status-on_time {
    color: #059669;
    font-weight: 500;
}

.status-late {
    color: #dc2626;
    font-weight: 500;
}

.status-early_leave {
    color: #f59e0b;
    font-weight: 500;
}

.status-absent {
    color: #6b7280;
    font-weight: 500;
}

/* Off-schedule status styles */
.off-schedule-yes {
    color: #dc2626;
    font-weight: 500;
    background-color: #fef2f2;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #fecaca;
}

.off-schedule-no {
    color: #059669;
    font-weight: 500;
    background-color: #f0fdf4;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #bbf7d0;
}

.event-type-1 {
    color: #059669;
}

.event-type-2 {
    color: #3b82f6;
}

@media (max-width: 768px) {
    .filter-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-controls .search-input,
    .filter-controls .form-control {
        width: 100%;
    }
}

/* Schedule management styles */
.assign-container {
    padding: 20px;
}

.assign-block {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.assign-block h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #495057;
    font-size: 18px;
}

.employee-selection-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    background: #e9ecef;
    border-radius: 4px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 8px;
}

.selected-count {
    font-weight: 500;
    color: #007bff;
}

.employees-list-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.assign-actions {
    display: flex;
    gap: 20px;
    align-items: flex-end;
}

/* Schedule rules styles */
.schedule-rules-container {
    margin-bottom: 20px;
}

.schedule-rule {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 10px;
    position: relative;
}

.schedule-rule .rule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.schedule-rule .rule-number {
    font-weight: 600;
    color: #495057;
}

.schedule-rule .remove-rule-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 12px;
}

.schedule-rule .remove-rule-btn:hover {
    background: #c82333;
}

.schedule-rule .rule-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.schedule-rule .form-group {
    margin-bottom: 0;
}

/* Schedule details modal */
.schedule-details-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #dee2e6;
}

.tab-btn {
    background: none;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 16px;
    color: #6c757d;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: #495057;
}

.tab-btn.active {
    color: #007bff;
    border-bottom-color: #007bff;
}

.tab-content {
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Schedule card styles */
.schedule-card-container {
    padding: 20px;
}

.schedule-header-form {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.schedule-header-form h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #495057;
}

/* Schedule form sections */
.schedule-form-section {
    margin-bottom: 16px;
}

.schedule-form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #495057;
    font-size: 14px;
}

.schedule-name-input {
    width: 100%;
    font-size: 15px;
}

/* Organizations collapsible dropdown */
.org-container {
    margin: 0;
}

.org-loading {
    padding: 12px;
    color: #6c757d;
    font-style: italic;
}

.org-empty {
    padding: 12px;
    color: #856404;
    background: #fff3cd;
    border-radius: 6px;
    font-style: italic;
}

.org-collapsible {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
}

.org-collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    cursor: pointer;
    background: #f8f9fa;
    user-select: none;
    transition: background-color 0.15s ease;
}

.org-collapsible-header:hover {
    background: #e9ecef;
}

.org-collapsible[open] .org-collapsible-header {
    border-bottom: 1px solid #dee2e6;
}

.org-count {
    font-weight: 500;
    color: #495057;
}

.org-toggle-icon {
    color: #6c757d;
    font-size: 10px;
    transition: transform 0.2s ease;
}

.org-collapsible[open] .org-toggle-icon {
    transform: rotate(180deg);
}

.org-collapsible-content {
    max-height: 200px;
    overflow-y: auto;
}

.org-dropdown-item {
    display: flex;
    flex-direction: column;
    padding: 10px 14px;
    border-bottom: 1px solid #f0f0f0;
}

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

.org-name {
    font-weight: 500;
    color: #212529;
    font-size: 14px;
}

.org-bin {
    font-size: 12px;
    color: #6c757d;
    margin-top: 2px;
}

/* Schedule time section */
.schedule-time-section {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 16px;
    margin-top: 16px;
}

.schedule-time-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.schedule-time-field {
    display: flex;
    flex-direction: column;
}

.schedule-time-field input[type="time"] {
    padding: 10px 12px;
    font-size: 16px;
}

.schedule-apply-row {
    display: flex;
    justify-content: center;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}

.schedule-apply-btn {
    min-width: 200px;
}

/* Responsive for schedule form */
@media (max-width: 480px) {
    .schedule-time-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

.schedule-dates-section,
.schedule-employees-section {
    margin-bottom: 30px;
}

.dates-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.dates-header h3 {
    margin: 0;
    color: #495057;
}

.dates-table-container {
    border: 1px solid #dee2e6;
    border-radius: 4px;
    overflow: hidden;
}

.work-date-row {
    position: relative;
}

.work-date-input {
    border: none;
    background: transparent;
    width: 100%;
    padding: 8px;
}

.work-date-input:focus {
    background: #fff3cd;
    outline: 2px solid #ffc107;
}

.remove-date-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 12px;
}

.remove-date-btn:hover {
    background: #c82333;
}

.day-of-week {
    font-size: 12px;
    color: #6c757d;
}

.schedule-employees-section h3 {
    margin-bottom: 15px;
    color: #495057;
}

/* Empty state */
.empty-dates-message {
    text-align: center;
    padding: 40px;
    color: #6c757d;
    font-style: italic;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .schedule-card-container {
        padding: 10px;
    }
    
    .schedule-header-form {
        padding: 15px;
    }
    
    .dates-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
}

/* Hours breakdown styling */
.planned-hours { 
    color: #007bff; 
    font-weight: bold;
    background: #e7f3ff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
}

.actual-hours { 
    color: #28a745; 
    font-weight: bold;
    background: #d4edda;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
}

.overtime-hours.overtime-yes { 
    color: #dc3545; 
    font-weight: bold;
    background: #f8d7da;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
}

.overtime-hours.overtime-no { 
    color: #6c757d; 
    font-style: italic;
    font-size: 0.85em;
}

.lunch-break-yes { 
    color: #fd7e14; 
    background: #fff3cd;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.85em;
}

.lunch-break-no { 
    color: #6c757d; 
    font-style: italic;
    font-size: 0.85em;
}

/* Override dark theme styles for admin panel inputs */
.admin-content input[type="text"],
.admin-content input[type="date"],
.admin-content input[type="datetime-local"],
.admin-content input[type="number"],
.admin-content input[type="email"],
.admin-content input[type="password"],
.admin-content select,
.admin-content textarea {
    background-color: #ffffff !important;
    color: #495057 !important;
}

.admin-content input[type="text"]:focus,
.admin-content input[type="date"]:focus,
.admin-content input[type="datetime-local"]:focus,
.admin-content input[type="number"]:focus,
.admin-content input[type="email"]:focus,
.admin-content input[type="password"]:focus,
.admin-content select:focus,
.admin-content textarea:focus {
    background-color: #ffffff !important;
    color: #495057 !important;
}

/* News modal specific styles */
#newsModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

#newsModal.active {
    display: flex;
}

#newsModal .modal-content {
    background: #ffffff;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid #dee2e6;
    color: #495057;
}

#newsModal .modal-header {
    padding: 20px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f8f9fa;
}

#newsModal .modal-header h3 {
    color: #495057;
    margin: 0;
    font-size: 20px;
}

#newsModal .btn-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s;
}

#newsModal .btn-close:hover {
    color: #495057;
}

#newsModal .modal-body {
    padding: 20px;
    overflow-y: auto;
    background-color: #ffffff;
}

#newsModal .form-group {
    margin-bottom: 20px;
}

#newsModal .form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #495057;
}

#newsModal .form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    background-color: #ffffff;
    color: #495057;
    transition: border-color 0.3s;
}

#newsModal .form-control:focus {
    outline: none;
    border-color: #4785ff;
    box-shadow: 0 0 0 3px rgba(71, 133, 255, 0.1);
    background-color: #ffffff;
}

#newsModal textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

#newsModal .form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

#newsModal .btn {
    min-width: 100px;
}

/* Enhanced status indicators for night shifts */
.status-night_shift_on_time { 
    color: #17a2b8; 
    font-weight: bold;
    background: #d1ecf1;
    padding: 2px 6px;
    border-radius: 3px;
}

.status-night_shift_late { 
    color: #6f42c1; 
    font-weight: bold;
    background: #e2d9f3;
    padding: 2px 6px;
    border-radius: 3px;
}

.status-night_shift_early_leave { 
    color: #e83e8c; 
    font-weight: bold;
    background: #f8d7da;
    padding: 2px 6px;
    border-radius: 3px;
}

.status-night_shift_auto { 
    color: #6c757d; 
    font-weight: bold;
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
}

/* Report status styles */
.status-late {
    color: #dc3545;
    font-weight: bold;
}

.status-absent {
    color: #6c757d;
    font-style: italic;
}

/* Report filters layout improvements */
.filter-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.filter-controls .form-control,
.filter-controls .search-input {
    min-width: 200px;
}

/* Employee edit button styles */
.edit-employee-btn {
    background: #17a2b8;
    color: white;
    border: 1px solid #17a2b8;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.edit-employee-btn:hover {
    background: #138496;
    border-color: #117a8b;
}

/* Department edit button styles - identical to employee edit button */
.edit-department-btn {
    background: #17a2b8;
    color: white;
    border: 1px solid #17a2b8;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.edit-department-btn:hover {
    background: #138496;
    border-color: #117a8b;
}

/* Status message styles */
.status-message {
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
    display: none;
}

.status-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Employee modal specific styles */
#employeeModal {
    display: none !important; /* КРИТИЧНО: Скрыто по умолчанию */
    justify-content: center;
    align-items: center;
    z-index: 10000 !important;
}

/* Показываем модальное окно когда добавляется класс active */
#employeeModal.active {
    display: flex !important;
}

#employeeModal .modal-content {
    background: #ffffff;
    color: #212529;
    border: 1px solid #dee2e6;
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.1);
}

#employeeModal .modal-header {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    color: #212529;
}

#employeeModal .modal-header h3 {
    color: #212529;
}

#employeeModal .btn-close {
    color: #000;
    opacity: 0.5;
}

#employeeModal .btn-close:hover {
    opacity: 0.75;
}

/* Employee modal form styles */
#employeeModal .form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

#employeeModal .form-group {
    flex: 1;
}

#employeeModal .form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #495057;
}

#employeeModal .form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    background-color: #ffffff !important;
    color: #495057 !important;
}

#employeeModal .form-control:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

#employeeModal .form-control[readonly] {
    background-color: #e9ecef !important;
    color: #6c757d !important;
    opacity: 1;
}

#employeeModal .form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

/* Department modal specific styles - identical to employee modal */
#departmentModal {
    display: none !important; /* КРИТИЧНО: Скрыто по умолчанию */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 10000 !important;
}

/* Показываем модальное окно когда добавляется класс active */
#departmentModal.active {
    display: flex !important;
}

#departmentModal .modal-content {
    background: #ffffff;
    color: #212529;
    border: 1px solid #dee2e6;
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#departmentModal .modal-header {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    color: #212529;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#departmentModal .modal-header h3 {
    color: #212529;
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

#departmentModal .btn-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #000;
    opacity: 0.5;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s;
}

#departmentModal .btn-close:hover {
    opacity: 0.75;
}

#departmentModal .modal-body {
    padding: 20px;
    overflow-y: auto;
    background-color: #ffffff;
}

/* Department modal form styles - identical to employee modal */
#departmentModal .form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

#departmentModal .form-group {
    flex: 1;
}

#departmentModal .form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #495057;
}

#departmentModal .form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    background-color: #ffffff !important;
    color: #495057 !important;
    transition: border-color 0.3s;
}

#departmentModal .form-control:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    background-color: #ffffff !important;
}

#departmentModal .form-control[readonly] {
    background-color: #e9ecef !important;
    color: #6c757d !important;
    opacity: 1;
}

#departmentModal .form-text {
    font-size: 12px;
    color: #6c757d;
    margin-top: 4px;
}

#departmentModal .form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

/* Notification Toast Styles */
.notification-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #333;
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    max-width: 400px;
    transform: translateX(400px);
    transition: transform 0.3s ease-out;
    font-size: 14px;
    line-height: 1.5;
}

.notification-toast.show {
    transform: translateX(0);
}

.notification-toast.notification-success {
    background: #28a745;
}

.notification-toast.notification-error {
    background: #dc3545;
}

.notification-toast.notification-warning {
    background: #ffc107;
    color: #333;
}

.notification-toast.notification-info {
    background: #17a2b8;
}

#departmentModal .btn {
    min-width: 100px;
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 4px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.3s;
}

#departmentModal .btn--primary {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

#departmentModal .btn--primary:hover {
    background-color: #0056b3;
    border-color: #004085;
}

#departmentModal .btn--primary:disabled {
    background-color: #6c757d;
    border-color: #6c757d;
    cursor: not-allowed;
}

#departmentModal .btn--outline {
    background-color: transparent;
    color: #6c757d;
    border-color: #6c757d;
}

#departmentModal .btn--outline:hover {
    background-color: #6c757d;
    color: white;
}

#departmentModal .spinner {
    display: inline-block;
    animation: spin 1s linear infinite;
}

/* Ensure department modal form has proper white background */
#departmentModal input[type="text"],
#departmentModal input[type="hidden"],
#departmentModal textarea,
#departmentModal select {
    background-color: #ffffff !important;
    color: #495057 !important;
}

#departmentModal input[type="text"]:focus,
#departmentModal textarea:focus,
#departmentModal select:focus {
    background-color: #ffffff !important;
    color: #495057 !important;
}

/* Payroll report styles */
.payroll-total-row {
    background-color: #f8f9fa;
    font-weight: bold;
}

.payroll-total-row td {
    padding: 15px 20px;
    border-top: 2px solid #dee2e6;
    font-size: 16px;
}

.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
    color: #6c757d;
}

/* AI Recommendation Section Styles */
.ai-content-container {
    padding: 20px;
}

.ai-placeholder {
    text-align: center;
    padding: 60px 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
}

.ai-icon {
    font-size: 64px;
    margin-bottom: 20px;
    display: block;
}

.ai-placeholder h3 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 15px;
    color: white;
}

.ai-placeholder p {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 40px;
    color: rgba(255, 255, 255, 0.9);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.ai-features {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
    margin-top: 30px;
}

.ai-feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    min-width: 120px;
}

.feature-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 8px;
}

.ai-feature-item span:last-child {
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.95);
    text-align: center;
}

/* Filter controls for AI section */
#ai-recommendation-section .filter-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

#ai-recommendation-section .filter-controls select {
    min-width: 250px;
}

#ai-recommendation-section .btn--primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    padding: 8px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

#ai-recommendation-section .btn--primary:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

#ai-recommendation-section .btn--primary:disabled {
    background: #6c757d;
    transform: none;
    box-shadow: none;
    cursor: not-allowed;
}

/* Responsive design for AI section */
@media (max-width: 768px) {
    .ai-features {
        gap: 20px;
    }
    
    .ai-feature-item {
        min-width: 100px;
    }
    
    .ai-placeholder {
        padding: 40px 20px;
    }
    
    .ai-placeholder h3 {
        font-size: 24px;
    }
    
    .ai-placeholder p {
        font-size: 14px;
    }
    
    .ai-icon {
        font-size: 48px;
    }
    
    .feature-icon {
        font-size: 24px;
    }
}

/* CRON Scheduler Styles */
.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.status-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.status-item label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    font-weight: 600;
}

.status-item span {
    font-size: 14px;
    color: #1a1d23;
    font-weight: 500;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge.success, .badge.enabled {
    background: #d4edda;
    color: #155724;
}

.badge.error, .badge.disabled {
    background: #f8d7da;
    color: #721c24;
}

.badge.running {
    background: #fff3cd;
    color: #856404;
}

.badge.info {
    background: #d1ecf1;
    color: #0c5460;
}

/* ==========================================
   📊 PAYROLL OVERTIME REPORT STYLES
   ========================================== */

/* Overtime table specific styles */
.overtime-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.overtime-table thead tr:first-child th {
    border-bottom: none;
    padding-bottom: 5px;
}

.overtime-table thead tr:last-child th {
    padding-top: 5px;
}

.overtime-table th {
    background: #f8f9fa;
    font-weight: 600;
    padding: 12px;
    text-align: left;
    border: 1px solid #dee2e6;
}

.overtime-table td {
    padding: 10px 12px;
    border: 1px solid #dee2e6;
}

.overtime-table tbody tr:hover {
    background: #f8f9fa;
}

/* Color-coded cells for difference column */
.overtime-cell {
    background: #f8d7da !important;
    color: #721c24 !important;
    font-weight: 600;
}

.savings-cell {
    background: #d4edda !important;
    color: #155724 !important;
    font-weight: 600;
}

.neutral-cell {
    background: #e2e3e5 !important;
    color: #383d41 !important;
}

/* Summary row styling */
.overtime-table .summary-row {
    background: #e9ecef !important;
    font-weight: 700;
}

.overtime-table .summary-row td {
    border-top: 2px solid #495057;
    padding: 15px 12px;
}

/* Department block */
.department-block {
    margin-bottom: 30px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    background: white;
}

.department-block h4 {
    margin: 0;
    padding: 12px 15px;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    font-size: 16px;
    font-weight: 600;
}

/* Total summary cards */
.total-summary {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 30px;
    border: 1px solid #dee2e6;
}

.total-summary h3 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 18px;
}

/* Responsive design for overtime report */
@media (max-width: 768px) {
    .total-summary > div {
        grid-template-columns: 1fr !important;
    }

    .overtime-table {
        font-size: 12px;
    }

    .overtime-table th,
    .overtime-table td {
        padding: 6px 8px;
    }
}

/* ===== Organizations Section Styles ===== */

/* Controls layout */
.organizations-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.organizations-controls .search-wrapper {
    flex: 1;
    min-width: 200px;
    max-width: 400px;
}

.organizations-controls .controls-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.organizations-controls .btn-icon-add {
    font-weight: 700;
    margin-right: 4px;
}

/* BIN code styling */
.bin-code {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    background: #f1f3f5;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 13px;
    color: #495057;
    letter-spacing: 0.5px;
}

/* Organization name */
.org-name {
    font-weight: 500;
    color: #212529;
}

/* Text center utility */
.text-center {
    text-align: center;
}

/* Compact action buttons */
.actions-buttons {
    display: flex;
    gap: 6px;
    justify-content: center;
    align-items: center;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.action-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.action-btn svg {
    width: 16px;
    height: 16px;
}

.action-btn--edit {
    background: #e8f4fd;
    color: #0066cc;
}

.action-btn--edit:hover:not(:disabled) {
    background: #0066cc;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.3);
}

.action-btn--delete {
    background: #fef2f2;
    color: #dc3545;
}

.action-btn--delete:hover:not(:disabled) {
    background: #dc3545;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

/* Organization Modal Styles - аналогично departmentModal */
#organizationModal {
    display: none !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 10000 !important;
}

#organizationModal.active {
    display: flex !important;
}

#organizationModal .modal-content {
    background: #ffffff !important;
    color: #212529 !important;
    border: 1px solid #dee2e6;
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#organizationModal .modal-header {
    background: #f8f9fa !important;
    border-bottom: 1px solid #dee2e6;
    color: #212529 !important;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#organizationModal .modal-header h3 {
    color: #212529 !important;
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

#organizationModal .btn-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #000;
    opacity: 0.5;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s;
}

#organizationModal .btn-close:hover {
    opacity: 0.75;
}

#organizationModal .modal-body {
    padding: 20px;
    overflow-y: auto;
    background-color: #ffffff !important;
}

#organizationModal .form-group {
    margin-bottom: 15px;
}

#organizationModal .form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #495057 !important;
}

#organizationModal .form-group .required {
    color: #dc3545;
}

#organizationModal .form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    background-color: #ffffff !important;
    color: #495057 !important;
    box-sizing: border-box;
}

#organizationModal .form-control:focus {
    outline: none;
    border-color: #4785ff;
    box-shadow: 0 0 0 3px rgba(71, 133, 255, 0.1);
    background-color: #ffffff !important;
}

#organizationModal .form-control:disabled {
    background-color: #e9ecef !important;
    color: #6c757d !important;
    cursor: not-allowed;
}

#organizationModal textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

#organizationModal .form-text {
    font-size: 12px;
    color: #6c757d !important;
    margin-top: 5px;
}

#organizationModal .checkbox-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 0;
}

#organizationModal .checkbox-wrapper input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
    flex-shrink: 0;
    vertical-align: middle;
}

#organizationModal .checkbox-label-text {
    color: #495057 !important;
    font-size: 14px;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
}

#organizationModal .form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #dee2e6;
}

#organizationModal .btn--primary {
    background: #4785ff;
    border: none;
    color: white !important;
    padding: 8px 20px;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

#organizationModal .btn--primary:hover {
    background: #3a75e0;
}

#organizationModal .btn--primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#organizationModal .btn--outline {
    background: #ffffff !important;
    border: 1px solid #ced4da;
    color: #495057 !important;
    padding: 8px 20px;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

#organizationModal .btn--outline:hover {
    background: #f8f9fa !important;
    border-color: #adb5bd;
}

/* Organizations table specific styles */
#organizations-section .admin-table td {
    vertical-align: middle;
}

#organizations-section .admin-table th:last-child,
#organizations-section .admin-table td:last-child {
    width: 90px;
    text-align: center;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .organizations-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .organizations-controls .search-wrapper {
        max-width: none;
    }
    
    .organizations-controls .controls-right {
        justify-content: space-between;
    }
    
    #organizationModal.organization-modal .modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .action-btn {
        width: 28px;
        height: 28px;
    }
    
    .action-btn svg {
        width: 14px;
        height: 14px;
    }
}

/* ===== Reports Tabs Styles ===== */

.reports-tabs-container {
    padding: 0;
}

.reports-tabs-header {
    display: flex;
    gap: 0;
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    padding: 0 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.reports-tab-btn {
    background: none;
    border: none;
    padding: 14px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #6c757d;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.reports-tab-btn:hover {
    color: #495057;
    background: rgba(0, 123, 255, 0.05);
}

.reports-tab-btn.active {
    color: #007bff;
    border-bottom-color: #007bff;
    background: white;
}

.reports-tabs-content {
    padding: 0;
}

.reports-tab-pane {
    display: none;
    padding: 20px;
    animation: fadeInTab 0.3s ease;
}

.reports-tab-pane.active {
    display: block;
}

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

/* Tab controls layout */
.reports-tab-pane .tab-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

.reports-tab-pane .tab-controls .filter-controls {
    flex: 1;
}

/* Responsive tabs */
@media (max-width: 768px) {
    .reports-tabs-header {
        padding: 0 10px;
    }
    
    .reports-tab-btn {
        padding: 12px 14px;
        font-size: 13px;
    }
    
    .reports-tab-pane {
        padding: 15px;
    }
    
    .reports-tab-pane .tab-controls {
        flex-direction: column;
        align-items: stretch;
    }
}
