* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
}

/* Estilos básicos para login */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.login-container {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 450px;
}

.login-container h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    box-sizing: border-box;
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-login:hover {
    background: #5a67d8;
}

.error-message {
    background: #fee;
    color: #c33;
    padding: 10px;
    border-radius: 5px;
    margin-top: 20px;
    text-align: center;
}

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
}
/* Dashboard */
.dashboard {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.top-bar {
    background: white;
    padding: 15px 25px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.top-bar h1 {
    color: #333;
    font-size: 24px;
}

.user-info {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.user-details {
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
    padding: 5px 15px;
    border-radius: 8px;
}

.user-name {
    font-weight: bold;
    font-size: 14px;
}

.user-role {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    text-align: center;
}

.role-admin {
    background: #dc3545;
    color: white;
}

.role-tecnico {
    background: #17a2b8;
    color: white;
}

.role-cliente {
    background: #28a745;
    color: white;
}

/* Botones */
.btn-primary {
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    transition: all 0.3s;
}

.btn-primary:hover {
    background: #5a67d8;
    transform: scale(1.02);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-logout {
    background: #dc3545;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    padding: 8px 15px;
    font-size: 13px;
    font-weight: bold;
    transition: all 0.3s;
}

.btn-logout:hover {
    background: #c82333;
}

/* Stats bar */
.stats-bar {
    background: white;
    padding: 15px 20px;
    margin: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stats {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: space-around;
}

.stat-item {
    text-align: center;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    min-width: 80px;
}

.stat-icon {
    font-size: 20px;
    display: block;
}

.stat-label {
    font-size: 12px;
    color: #666;
    display: block;
}

.stat-number {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    display: block;
}

/* Tabla */
.table-container {
    margin: 0 20px 20px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: #667eea;
    color: white;
    padding: 12px;
    text-align: left;
    font-size: 13px;
}

td {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    font-size: 13px;
}

tr:hover {
    background: #f5f5f5;
}

/* Estados */
.estado-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: bold;
}

.estado-pendiente {
    background: #fff3cd;
    color: #f30707;
}

.estado-en_reparacion {
    background: #cfe2ff;
    color: #bbbe07;
}

.estado-reparado {
    background: #d1e7dd;
    color: #0fbd09;
}

.estado-entregado {
    background: #cff4fc;
    color: #055160;
}

/* Botones de acción */
.btn-ver, .btn-editar, .btn-eliminar {
    padding: 5px 8px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    margin: 0 2px;
}

.btn-ver {
    background: #17a2b8;
    color: white;
}

.btn-ver:hover {
    background: #138496;
}

.btn-editar {
    background: #ffc107;
    color: #333;
}

.btn-editar:hover {
    background: #e0a800;
}

.btn-eliminar {
    background: #dc3545;
    color: white;
}

.btn-eliminar:hover {
    background: #c82333;
}

/* Formularios */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 13px;
    color: #333;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 13px;
    font-family: inherit;
}

.form-group textarea {
    resize: vertical;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    overflow: auto;
}

.modal-content {
    background: white;
    margin: 50px auto;
    padding: 25px;
    border-radius: 10px;
    width: 90%;
    max-width: 700px;
    position: relative;
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}

.close:hover {
    color: #333;
}

/* Mensajes */
.mensaje {
    padding: 10px 15px;
    margin: 10px 20px;
    border-radius: 5px;
    text-align: center;
}

.mensaje.exito {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.mensaje.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
}

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
}

.no-registros {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* Grupo de botones */
.botones-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Estilos comunes para botones icono */
.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    border: none;
}

.btn-icon:hover {
    transform: scale(1.05);
}

/* Botón cambiar contraseña */
.btn-cambiar-password {
    background: #ffc107;
    color: #333;
}

.btn-cambiar-password:hover {
    background: #e0a800;
}

/* Botón nueva orden */
.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a67d8;
}

/* Botón logout */
.btn-logout {
    background: #dc3545;
    color: white;
}

.btn-logout:hover {
    background: #c82333;
}

/* Menú desplegable */
.dropdown {
    position: relative;
    display: inline-block;
}

.btn-dropdown {
    background: #17a2b8;
    color: white;
}

.btn-dropdown:hover {
    background: #138496;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 45px;
    background-color: white;
    min-width: 200px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    border-radius: 8px;
    z-index: 1000;
    overflow: hidden;
}

.dropdown-content.show {
    display: block;
}

.dropdown-content button {
    width: 100%;
    padding: 12px 16px;
    text-align: left;
    border: none;
    background: white;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.dropdown-content button:hover {
    background-color: #f1f1f1;
}

/* Grupo de botones */
.botones-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Botones redondos */
.btn-cambiar-password, .btn-nueva-orden, .btn-admin, .btn-logout {
    transition: all 0.3s;
}

.btn-cambiar-password:hover, .btn-nueva-orden:hover, .btn-admin:hover, .btn-logout:hover {
    transform: scale(1.05);
}

.btn-cambiar-password:hover {
    background: #e0a800 !important;
}

.btn-nueva-orden:hover {
    background: #5a67d8 !important;
}

.btn-admin:hover {
    background: #138496 !important;
}

.btn-logout:hover {
    background: #c82333 !important;
}

/* Menú desplegable */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 45px;
    background-color: white;
    min-width: 200px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    border-radius: 8px;
    z-index: 1000;
    overflow: hidden;
}

.dropdown-content.show {
    display: block;
}

.dropdown-content button {
    width: 100%;
    padding: 12px 16px;
    text-align: left;
    border: none;
    background: white;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.dropdown-content button:hover {
    background-color: #f1f1f1;
}

/* Barra de búsqueda */
.search-bar {
    margin: 20px;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.search-bar input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.search-bar input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-imprimir {
    background: #abacac;
    color: white;
    padding: 5px 8px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    margin: 0 2px;
}

.btn-imprimir:hover {
    background: #707070;
}

/* Estilos para texto largo en modales */
#contenidoVerParte {
    word-wrap: break-word;
    word-break: break-word;
}

#contenidoVerParte p {
    word-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    overflow-wrap: break-word;
}

#contenidoVerParte p strong {
    display: inline-block;
    min-width: 120px;
    vertical-align: top;
}

/* Estilos para el chat - texto largo */
#chatContainer, #chatInternoContainer {
    word-wrap: break-word !important;
    word-break: break-word !important;
    white-space: normal !important;
    overflow-wrap: break-word !important;
}

#chatContainer div, #chatInternoContainer div {
    word-wrap: break-word !important;
    word-break: break-word !important;
    white-space: normal !important;
    overflow-wrap: break-word !important;
    max-width: 100% !important;
}

#chatContainer div div, #chatInternoContainer div div {
    word-wrap: break-word !important;
    word-break: break-word !important;
    white-space: normal !important;
    overflow-wrap: break-word !important;
    max-width: 100% !important;
}

/* Para los mensajes dentro del chat */
#chatContainer .mensaje-bubble, #chatInternoContainer .mensaje-bubble {
    word-wrap: break-word !important;
    word-break: break-word !important;
    white-space: normal !important;
    max-width: 100% !important;
    display: inline-block !important;
}

/* Logo en esquina superior izquierda - Sin recuadro */
.logo-top-left {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 100;
}

.login-logo-small {
    width: auto;
    height: 60px;
    object-fit: contain;
    /* Eliminar bordes, sombras y fondos */
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .top-bar {
        flex-direction: column;
        text-align: center;
    }
    
    .user-info {
        justify-content: center;
    }
    
    .stats {
        gap: 8px;
    }
    
    .stat-item {
        min-width: 60px;
        padding: 5px 10px;
    }
    
    .stat-number {
        font-size: 16px;
    }
}

/* Eliminar subrayado de todos los enlaces */
a {
    text-decoration: none !important;
}

a:hover {
    text-decoration: none !important;
}

/* Colores de filas según estado */
tr.fila-pendiente {
    background-color: #f8d7da;
}

tr.fila-en_reparacion {
    background-color: #fff3cd;
}

tr.fila-reparado {
    background-color: #d4edda;
}

tr.fila-entregado {
    background-color: #e2e3e5;
}

.role-tecnico_externo {
    background: #6c757d;
    color: white;
}
