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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Para el dashboard, el body no debe centrar el contenido */
body.dashboard-page {
    align-items: flex-start;
    justify-content: flex-start;
}

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

.login-box {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 28px;
}

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

label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

input:focus {
    outline: none;
    border-color: #667eea;
}

button {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

button:active {
    transform: translateY(0);
}

.error-message {
    margin-top: 15px;
    padding: 12px;
    background: #fee;
    color: #c33;
    border-radius: 6px;
    display: none;
    text-align: center;
}

.error-message.show {
    display: block;
}

/* Dashboard Styles */
.dashboard-container {
    width: 100%;
    min-height: 100vh;
    background: #f5f5f5;
}

.dashboard-header {
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 20px 0;
    margin-bottom: 30px;
}

.header-content {
    width: 100%;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content h1 {
    margin: 0;
    color: #333;
    font-size: 24px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info span {
    color: #555;
    font-weight: 500;
}

/* Notificaciones */
.notifications-container {
    position: relative;
}

.btn-notifications {
    position: relative;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.3s;
    color: #333;
}

.btn-notifications:hover {
    background: #f0f0f0;
}

.notifications-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.notifications-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    width: 350px;
    max-height: 500px;
    overflow: hidden;
    z-index: 10000;
    display: none; /* Oculto por defecto */
}

.notifications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.notifications-header h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.btn-clear-notifications {
    background: none;
    border: none;
    color: #667eea;
    cursor: pointer;
    font-size: 14px;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background 0.3s;
}

.btn-clear-notifications:hover {
    background: #e0e0e0;
}

.notifications-list {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s;
}

.notification-item:hover {
    background: #f8f9fa;
}

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

.notification-content {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.notification-title {
    font-weight: 600;
    color: #667eea;
    font-size: 14px;
}

.notification-text {
    color: #333;
    font-size: 14px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.notification-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

.notification-from {
    font-weight: 500;
}

.notification-time {
    color: #999;
}

.notification-empty {
    padding: 40px 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

.btn-logout {
    padding: 8px 16px;
    background: #b02a37; /* rojo un poco más oscuro para contraste */
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.btn-logout:hover {
    background: #7b1f28;
}

.dashboard-main {
    width: 100%;
    margin: 0 auto;
    /* Dejar espacio para el paginador fijo inferior */
    padding: 0 30px 120px;
}

.dashboard-actions {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 30px;
}

.view-toggle {
    display: flex;
    gap: 5px;
    margin-left: auto;
    background: white;
    padding: 4px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.view-toggle-btn {
    background: transparent;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    color: #666;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-toggle-btn:hover {
    background: #f0f0f0;
    color: #333;
}

.view-toggle-btn.active {
    background: #667eea;
    color: white;
}

.view-toggle-btn i {
    font-size: 16px;
}

.btn-primary {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    padding: 12px 24px;
    background: #495057; /* gris más oscuro */
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-secondary:hover {
    background: #343a40;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 16px;
}

.tickets-list {
    display: grid;
    gap: 20px;
}

/* Vista lista compacta */
.tickets-list.list-view {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tickets-list.list-view .ticket-card {
    padding: 12px 16px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tickets-list.list-view .ticket-header {
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 90px 150px 120px 100px 220px;
    align-items: center;
    gap: 15px;
}

.tickets-list.list-view .ticket-title {
    font-size: 16px;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.tickets-list.list-view .ticket-number {
    font-size: 12px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.tickets-list.list-view .ticket-creator {
    display: flex; /* Visible solo en vista lista */
    align-items: center;
    color: #667eea;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tickets-list.list-view .ticket-meta {
    margin: 0;
    gap: 10px;
    flex-shrink: 0;
}

.tickets-list.list-view .ticket-date {
    font-size: 12px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    text-align: right;
}

.tickets-list.list-view .ticket-notes-container {
    display: none;
}

.tickets-list.list-view .ticket-state {
    font-size: 11px;
    padding: 3px 8px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tickets-list.list-view .ticket-priority {
    font-size: 11px;
    padding: 3px 8px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ticket-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.ticket-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background: #f8f9fa;
}

.ticket-header {
    display: grid;
    grid-template-columns: 1fr 90px 120px 100px 220px;
    align-items: center;
    margin-bottom: 15px;
    gap: 15px;
}

.ticket-title {
    font-size: 18px;
    color: #333;
    margin: 0;
    display: flex;
    align-items: center;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ticket-number {
    color: #999;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    white-space: nowrap;
}

.ticket-creator {
    display: none; /* Oculto por defecto (vista tarjetas) */
}

.tickets-list:not(.list-view) .ticket-creator {
    display: none; /* Asegurar que esté oculto en vista tarjetas */
}

.ticket-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.ticket-header .ticket-state {
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.ticket-header .ticket-priority {
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.ticket-header .ticket-date {
    color: #666;
    font-size: 14px;
    display: flex;
    align-items: center;
    white-space: nowrap;
    justify-content: flex-end;
    text-align: right;
}

.ticket-state, .ticket-priority {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    line-height: 1.2;
}

.ticket-state.state-new {
    background: #17a2b8;
    color: white;
}

.ticket-state.state-open {
    background: #28a745;
    color: white;
}

.ticket-state.state-pending,
.ticket-state.state-pending-reminder {
    background: #ffc107;
    color: #333;
}

.ticket-state.state-pending-close {
    background: #ff9800;
    color: white;
}

.ticket-state.state-closed {
    background: #6c757d;
    color: white;
}

.ticket-state.state-merged {
    background: #9c27b0;
    color: white;
}

/* Estado por defecto si no coincide */
.ticket-state:not([class*="state-"]) {
    background: #e0e0e0;
    color: #666;
}

.ticket-priority.priority-1 {
    background: #6c757d;
    color: white;
}

.ticket-priority.priority-2 {
    background: #17a2b8;
    color: white;
}

.ticket-priority.priority-3 {
    background: #dc3545;
    color: white;
}

/* Prioridad por defecto si no coincide */
.ticket-priority:not([class*="priority-"]) {
    background: #e0e0e0;
    color: #666;
}

.ticket-date {
    color: #666;
    font-size: 14px;
}

.ticket-notes-container {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.ticket-note {
    display: flex;
    flex-direction: column;
}

.note-label {
    font-size: 11px;
    text-transform: uppercase;
    color: #999;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
}

.note-author {
    color: #667eea;
    font-weight: 600;
}

.note-date {
    color: #999;
    font-size: 11px;
}

.note-body {
    color: #555;
    font-size: 13px;
    line-height: 1.5;
    max-height: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ticket-first-note {
    border-right: 1px solid #e0e0e0;
    padding-right: 15px;
}

.ticket-last-note {
    padding-left: 15px;
}

/* Si solo hay un comentario, ocupar todo el ancho */
.ticket-notes-container:has(.ticket-first-note:empty) .ticket-last-note,
.ticket-notes-container:has(.ticket-last-note:empty) .ticket-first-note {
    grid-column: 1 / -1;
    border: none;
    padding: 0;
}

@media (max-width: 768px) {
    .ticket-notes-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .ticket-first-note {
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        padding-right: 0;
        padding-bottom: 15px;
    }
    
    .ticket-last-note {
        padding-left: 0;
    }
}


.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 18px;
}

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

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-large {
    max-width: 800px;
}

.modal-body {
    max-height: 80vh;
    overflow-y: auto;
    padding: 0;
}

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

.modal-header h2 {
    margin: 0;
    color: #333;
    font-size: 24px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    line-height: 32px;
    transition: color 0.3s;
}

.modal-close:hover {
    color: #333;
}

.modal-content form {
    padding: 30px;
}

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

.form-actions button {
    width: auto;
    min-width: 120px;
}

textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
}

select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    transition: border-color 0.3s;
}

select:focus {
    outline: none;
    border-color: #667eea;
}

/* File input styles */
.file-input {
    width: 100%;
    padding: 12px;
    border: 2px dashed #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    background: #f8f9fa;
    cursor: pointer;
    transition: border-color 0.3s, background 0.3s;
}

.file-input:hover {
    border-color: #667eea;
    background: #f0f0f0;
}

.file-input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
}

.file-input-hint {
    display: block;
    margin-top: 5px;
    color: #999;
    font-size: 12px;
}

.attachments-preview {
    margin-top: 15px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
}

.attachment-preview-item {
    position: relative;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    background: white;
}

.preview-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

.preview-info {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.preview-filename {
    font-size: 11px;
    color: #333;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preview-size {
    font-size: 10px;
    color: #999;
}

.preview-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.preview-remove:hover {
    background: #dc3545;
}

/* Quill Editor Styles */
#ticketBodyEditor,
#commentBodyEditor {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 10px;
}

#ticketBodyEditor .ql-container,
#commentBodyEditor .ql-container {
    font-size: 14px;
    font-family: inherit;
    min-height: 150px;
}

#ticketBodyEditor .ql-editor,
#commentBodyEditor .ql-editor {
    min-height: 150px;
    padding: 12px;
}

#ticketBodyEditor .ql-editor.ql-blank::before,
#commentBodyEditor .ql-editor.ql-blank::before {
    color: #999;
    font-style: normal;
}

#ticketBodyEditor .ql-toolbar,
#commentBodyEditor .ql-toolbar {
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
    border-bottom: 1px solid #ddd;
    background: #f8f9fa;
}

#ticketBodyEditor .ql-toolbar .ql-stroke,
#commentBodyEditor .ql-toolbar .ql-stroke {
    stroke: #667eea;
}

#ticketBodyEditor .ql-toolbar .ql-fill,
#commentBodyEditor .ql-toolbar .ql-fill {
    fill: #667eea;
}

#ticketBodyEditor .ql-toolbar button:hover,
#ticketBodyEditor .ql-toolbar button.ql-active,
#commentBodyEditor .ql-toolbar button:hover,
#commentBodyEditor .ql-toolbar button.ql-active {
    color: #667eea;
}

#ticketBodyEditor .ql-toolbar button:hover .ql-stroke,
#ticketBodyEditor .ql-toolbar button.ql-active .ql-stroke,
#commentBodyEditor .ql-toolbar button:hover .ql-stroke,
#commentBodyEditor .ql-toolbar button.ql-active .ql-stroke {
    stroke: #667eea;
}

#ticketBodyEditor .ql-toolbar button:hover .ql-fill,
#ticketBodyEditor .ql-toolbar button.ql-active .ql-fill,
#commentBodyEditor .ql-toolbar button:hover .ql-fill,
#commentBodyEditor .ql-toolbar button.ql-active .ql-fill {
    fill: #667eea;
}

/* Add Comment Button Section */
.add-comment-button-section {
    margin-top: 30px;
    padding: 20px 30px;
    border-top: 2px solid #e0e0e0;
    text-align: center;
}

.add-comment-button-section button {
    width: auto;
    min-width: 200px;
}

/* Add Comment Section */
.add-comment-section {
    margin-top: 20px;
    padding: 30px;
    border-top: 2px solid #e0e0e0;
    background: #f8f9fa;
    border-radius: 8px;
}

.add-comment-section h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 18px;
}

.add-comment-section .form-group {
    margin-bottom: 20px;
}

.add-comment-section .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.add-comment-section .form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* Ticket Detail Styles */
.ticket-detail-content {
    padding: 30px;
    max-height: 60vh;
    overflow-y: auto;
}

.ticket-detail-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.detail-row {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row strong {
    width: 150px;
    color: #555;
}

.detail-row span {
    flex: 1;
    color: #333;
}

.ticket-articles {
    margin-top: 30px;
}

.ticket-articles h3 {
    margin-bottom: 20px;
    color: #333;
}

.article {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.article-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.article-header strong {
    color: #333;
}

.article-date {
    color: #999;
    font-size: 14px;
}

.article-body {
    color: #555;
    line-height: 1.6;
    white-space: pre-wrap;
}

.article-body-html {
    white-space: normal;
}

.article-body-html img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 10px 0;
    cursor: pointer;
    transition: transform 0.2s;
}

.article-body-html img:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.article-attachments {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.attachments-label {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.attachments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.attachment-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.attachment-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 2px solid #e0e0e0;
}

.attachment-image:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.attachment-filename {
    font-size: 11px;
    color: #999;
    text-align: center;
    word-break: break-word;
}

/* Modal para ver imagen en grande */
.image-modal {
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.image-modal-content {
    max-width: 90%;
    max-height: 90%;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

.image-modal-title {
    font-weight: 600;
    color: #333;
}

.image-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    line-height: 32px;
    transition: color 0.3s;
}

.image-modal-close:hover {
    color: #333;
}

.image-modal-body {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
}

.image-modal-img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 4px;
}

/* Filtros */
.filters-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);

    /* Filtros pegados bajo el header al hacer scroll */
    position: sticky;
    top: 0; /* pegado al tope de la ventana */
    z-index: 900;
}

.filters-row {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-size: 14px;
    font-weight: 500;
    color: #555;
}

.filter-input {
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
    min-width: 150px;
}

.filter-input:focus {
    outline: none;
    border-color: #667eea;
}

.filter-actions {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

.filter-actions button {
    width: auto;
    padding: 8px 16px;
    font-size: 14px;
}

/* Paginación - fija al fondo de la ventana */
.pagination-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;

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

    padding: 12px 30px;
    background: white;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);

    border-radius: 0;
    flex-wrap: wrap;
    gap: 15px;
    z-index: 1000;
}

.pagination-info {
    color: #666;
    font-size: 14px;
}

.pagination-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-pagination {
    padding: 8px 16px;
    background: #495057; /* gris más oscuro como los secundarios */
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
    width: auto;
}

.btn-pagination:hover:not(:disabled) {
    background: #343a40;
}

.btn-pagination:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

/* ==== Ajustes MUI CSS + clases existentes para alinear texto/iconos ==== */
.mui-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary.mui-btn,
.btn-secondary.mui-btn,
.btn-logout.mui-btn,
.btn-pagination.mui-btn {
    line-height: 1.2;
    padding-top: 8px;
    padding-bottom: 8px;
}

/* Botones flat (sin fondo) necesitan mejor contraste */
.btn-secondary.mui-btn--flat {
    color: #495057 !important;
    border: 1px solid #dee2e6;
    background: white;
}

.btn-secondary.mui-btn--flat:hover {
    background: #f8f9fa !important;
    border-color: #adb5bd;
    color: #343a40 !important;
}

.btn-notifications.mui-btn {
    min-width: 0;
    padding: 4px 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Icono de notificaciones (Font Awesome) */
#notificationsIcon {
    font-size: 18px;
    line-height: 1;
    display: inline-block;
}

.pagination-page-info {
    padding: 0 10px;
    color: #666;
    font-size: 14px;
}

.pagination-size {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pagination-size label {
    font-size: 14px;
    color: #666;
}

.per-page-select {
    padding: 6px 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

.per-page-select:focus {
    outline: none;
    border-color: #667eea;
}

@media (max-width: 768px) {
    .filters-row {
        flex-direction: column;
    }
    
    .filter-actions {
        margin-left: 0;
        width: 100%;
    }
    
    .filter-actions button {
        flex: 1;
    }
    
    .pagination-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .pagination-controls {
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 300px;
    max-width: 400px;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
    pointer-events: auto;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-content {
    display: flex;
    align-items: center;
    padding: 16px;
    gap: 12px;
}

.toast-icon {
    font-size: 20px;
    font-weight: bold;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    font-size: 14px;
    color: #333;
}

.toast-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast-close:hover {
    color: #333;
}

.toast-success {
    border-left: 4px solid #28a745;
}

.toast-success .toast-icon {
    color: #28a745;
}

.toast-error {
    border-left: 4px solid #dc3545;
}

.toast-error .toast-icon {
    color: #dc3545;
}

.toast-warning {
    border-left: 4px solid #ffc107;
}

.toast-warning .toast-icon {
    color: #ffc107;
}

.toast-info {
    border-left: 4px solid #17a2b8;
}

.toast-info .toast-icon {
    color: #17a2b8;
}

