/* Monthly Data Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

/* Message Dialog Styles */
.message-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    animation: fadeIn 0.2s ease;
}

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

.message-dialog {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

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

.message-dialog-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.message-dialog-text {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.message-dialog-btn {
    background: #0F9FC4;
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    min-width: 100px;
}

.message-dialog-btn:hover {
    background: #0d8aa8;
}

.modal-overlay.active {
    display: flex;
}

.modal-type-selector {
    background: white;
    border-radius: 16px;
    padding: 2.5rem;
    max-width: 500px;
    width: 100%;
    text-align: center;
    animation: modalSlideIn 0.3s ease;
}

.modal-type-selector h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1F3D7C;
    margin-bottom: 0.75rem;
}

.modal-type-selector p {
    color: #808FAD;
    margin-bottom: 2rem;
}

.modal-type-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.modal-type-btn {
    flex: 1;
    padding: 1.5rem 1rem;
    background: white;
    border: 2px solid #E3E4E9;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    font-family: 'Red Hat Display', sans-serif;
}

.modal-type-btn:hover {
    border-color: #0F9FC4;
    background: #EAF7FA;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(15, 159, 196, 0.2);
}

.modal-type-btn i {
    font-size: 2rem;
    color: #0F9FC4;
}

.modal-type-btn span {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1F3D7C;
}

.monthly-data-modal {
    background: white;
    border-radius: 16px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.monthly-data-modal .modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #E3E4E9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #1F3D7C 0%, #2a4d8f 100%);
    border-radius: 16px 16px 0 0;
}

.monthly-data-modal .modal-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.modal-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: all 0.2s ease;
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.monthly-data-modal .modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.month-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: #F7F7F8;
    border-radius: 10px;
}

.month-selector label {
    font-weight: 600;
    color: #1F3D7C;
    font-size: 0.9375rem;
}

.month-selector input[type="month"] {
    padding: 0.625rem 1rem;
    border: 2px solid #E3E4E9;
    border-radius: 8px;
    font-family: 'Red Hat Display', sans-serif;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
}

.month-selector input[type="month"]:focus {
    outline: none;
    border-color: #0F9FC4;
    box-shadow: 0 0 0 3px rgba(15, 159, 196, 0.1);
}

.form-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: white;
    border: 1px solid #E3E4E9;
    border-radius: 12px;
}

.form-section h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1F3D7C;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #EAF7FA;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1rem;
}

.form-row:last-child {
    margin-bottom: 0;
}

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

.form-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1F3D7C;
    margin-bottom: 0.5rem;
}

.form-group input {
    padding: 0.75rem 1rem;
    border: 2px solid #E3E4E9;
    border-radius: 8px;
    font-family: 'Red Hat Display', sans-serif;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    background: #F7F7F8;
}

.form-group input:focus {
    outline: none;
    border-color: #0F9FC4;
    background: white;
    box-shadow: 0 0 0 3px rgba(15, 159, 196, 0.1);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid #E3E4E9;
    margin-top: 1.5rem;
}

.btn-cancel {
    padding: 0.75rem 1.5rem;
    background: white;
    border: 2px solid #E3E4E9;
    border-radius: 8px;
    font-family: 'Red Hat Display', sans-serif;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #808FAD;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cancel:hover {
    border-color: #808FAD;
    color: #1F3D7C;
}

.btn-submit {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #0F9FC4 0%, #0d8aa8 100%);
    border: none;
    border-radius: 8px;
    font-family: 'Red Hat Display', sans-serif;
    font-size: 0.9375rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(15, 159, 196, 0.3);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(15, 159, 196, 0.4);
}

/* Change Password Modal */
.change-password-modal {
    background: white;
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    animation: modalSlideIn 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.change-password-modal .modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #E3E4E9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #1F3D7C 0%, #2a4d8f 100%);
    border-radius: 16px 16px 0 0;
}

.change-password-modal .modal-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.change-password-modal .modal-body {
    padding: 2rem;
}

.change-password-modal .form-group {
    margin-bottom: 1.5rem;
}

.change-password-modal .form-group:last-of-type {
    margin-bottom: 0;
}

.change-password-modal .form-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1F3D7C;
    margin-bottom: 0.5rem;
    display: block;
}

.password-input {
    position: relative;
    width: 100%;
}

.password-input input {
    width: 100%;
    padding: 0.75rem 3rem 0.75rem 1rem;
    border: 2px solid #E3E4E9;
    border-radius: 8px;
    font-family: 'Red Hat Display', sans-serif;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    background: #F7F7F8;
    box-sizing: border-box;
}

.password-input input:focus {
    outline: none;
    border-color: #0F9FC4;
    background: white;
    box-shadow: 0 0 0 3px rgba(15, 159, 196, 0.1);
}

.password-input .toggle-password {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #808FAD;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.password-input .toggle-password:hover {
    color: #0F9FC4;
}

.password-input .toggle-password i {
    font-size: 1rem;
}

.password-hint {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    color: #808FAD;
    font-style: italic;
}

.password-strength {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    min-height: 1.25rem;
}

.change-password-modal .form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid #E3E4E9;
    margin-top: 2rem;
}

/* User Management Modal */
.user-management-modal {
    background: white;
    border-radius: 16px;
    max-width: 1200px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.user-management-modal .modal-header {
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #1F3D7C 0%, #2a4d8f 100%);
    flex-shrink: 0;
}

.user-management-modal .modal-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-management-modal .modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 1.25rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid #E3E4E9;
}

.btn-primary {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #0F9FC4 0%, #0d8aa8 100%);
    border: none;
    border-radius: 8px;
    font-family: 'Red Hat Display', sans-serif;
    font-size: 0.9375rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(15, 159, 196, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(15, 159, 196, 0.4);
}

.table-container {
    overflow-x: auto;
    border: 1px solid #E3E4E9;
    border-radius: 10px;
}

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

.users-table thead {
    background: #F7F7F8;
}

.users-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #1F3D7C;
    border-bottom: 2px solid #E3E4E9;
}

.users-table td {
    padding: 1rem;
    border-bottom: 1px solid #F7F7F8;
}

.users-table tbody tr:hover {
    background: #F7F7F8;
}

.role-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8125rem;
    font-weight: 600;
}

.role-badge.role-admin {
    background: #EAF7FA;
    color: #0F9FC4;
}

.role-badge.role-production_user {
    background: #e8f5e9;
    color: #4caf7d;
}

.role-badge.role-procurement_user {
    background: #fff3e0;
    color: #f0a500;
}

.role-badge.role-viewer {
    background: #f5f5f5;
    color: #808FAD;
}

.role-badge.role-production_viewer {
    background: #eef3ee;
    color: #4a7c59;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8125rem;
    font-weight: 600;
}

.status-badge.status-active {
    background: #e8f5e9;
    color: #4caf7d;
}

.status-badge.status-inactive {
    background: #fee;
    color: #e05c5c;
}

.actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    padding: 0.5rem;
    background: white;
    border: 1px solid #E3E4E9;
    border-radius: 6px;
    cursor: pointer;
    color: #808FAD;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: #F7F7F8;
    color: #0F9FC4;
    border-color: #0F9FC4;
}

.user-form-modal {
    background: white;
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.user-form-modal .modal-header {
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #1F3D7C 0%, #2a4d8f 100%);
}

.user-form-modal .modal-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-form-modal .modal-body {
    padding: 2rem;
}

.user-form-modal .form-group {
    margin-bottom: 1.25rem;
}

.user-form-modal .form-group:last-of-type {
    margin-bottom: 0;
}

.user-form-modal .form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #1F3D7C;
    margin-bottom: 0.5rem;
}

.user-form-modal .form-group input {
    width: 100%;
    box-sizing: border-box;
}

.user-form-modal .form-group input:disabled {
    background: #F0F0F3;
    color: #808FAD;
    cursor: not-allowed;
    border-color: #E3E4E9;
}

.user-form-modal small {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.8125rem;
    color: #808FAD;
    font-style: italic;
}

.user-form-modal .form-group select {
    padding: 0.75rem 1rem;
    border: 2px solid #E3E4E9;
    border-radius: 8px;
    font-family: 'Red Hat Display', sans-serif;
    font-size: 0.9375rem;
    background: #F7F7F8;
    transition: all 0.2s ease;
}

.user-form-modal .form-group select:focus {
    outline: none;
    border-color: #0F9FC4;
    background: white;
    box-shadow: 0 0 0 3px rgba(15, 159, 196, 0.1);
}

@media (max-width: 768px) {
    .monthly-data-modal,
    .user-management-modal {
        max-width: 100%;
        max-height: 95vh;
    }
    
    .monthly-data-modal .modal-body,
    .user-management-modal .modal-body,
    .user-form-modal .modal-body {
        padding: 1.5rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .modal-type-buttons {
        flex-direction: column;
    }
    
    .users-table {
        font-size: 0.8125rem;
    }
    
    .users-table th,
    .users-table td {
        padding: 0.75rem 0.5rem;
    }
}
