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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    background: rgba(242, 240, 240, 0.95);
    padding: 1.5rem 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.header h1 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 2rem;
}

.role-selector {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.role-btn {
    padding: 0.75rem 2rem;
    font-size: 1rem;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.role-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

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

.role-btn.btn-logout {
    background: #dc3545;
    border-color: #dc3545;
    color: white;
}

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

.vista {
    display: none;
    animation: fadeIn 0.5s ease;
    flex: 1;
}

.vista.active {
    display: block;
}

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

.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Tabs del Administrador */
.admin-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    color: #333;
    font-weight: 600;
}

.tab-btn:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.tab-btn.active {
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.tab-content {
    display: none;
}

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

/* Formularios */
.form-box {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    margin: 0 auto;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 600;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input[type="file"] {
    padding: 0.5rem;
    cursor: pointer;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.btn-primary {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

/* Lista de Objetos */
.lista-objetos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.objeto-card {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
}

.objeto-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.objeto-imagen {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 1rem;
    border: 2px solid #f0f0f0;
}

.objeto-sin-foto {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    border-radius: 10px;
    margin-bottom: 1rem;
    color: #999;
    font-size: 3rem;
    text-align: center;
    line-height: 1.5;
    border: 2px dashed #ccc;
}

.objeto-card h3 {
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.objeto-card .categoria {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #667eea;
    color: white;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.objeto-card .descripcion {
    color: #666;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.objeto-card .info {
    color: #999;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.objeto-card .estado {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.estado.disponible {
    background: #d4edda;
    color: #155724;
}

.estado.reclamado,
.estado.en_reclamacion {
    background: #fff3cd;
    color: #856404;
}

.estado.entregado {
    background: #cce5ff;
    color: #004085;
}

.estado.expirado {
    background: #f8d7da;
    color: #721c24;
}

/* Alerta de expiración */
.alerta-expiracion {
    background: #fff3cd;
    color: #856404;
    padding: 0.5rem;
    border-radius: 8px;
    margin: 0.5rem 0;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    border-left: 4px solid #ffc107;
}

.objeto-card.expirado {
    opacity: 0.85;
    border: 2px solid #f8d7da;
}

/* Botones de gestión de estado */
.botones-gestion {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.btn-estado {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-estado:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.btn-estado.btn-entregado {
    background: #28a745;
    color: white;
}

.btn-estado.btn-entregado:hover {
    background: #218838;
}

.btn-estado.btn-disponible {
    background: #ffc107;
    color: #333;
}

.btn-estado.btn-disponible:hover {
    background: #e0a800;
}

.objeto-card button {
    margin-top: 1rem;
    padding: 0.5rem 1.5rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.objeto-card button:hover {
    background: #764ba2;
    transform: translateY(-2px);
}

.objeto-card button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.btn-eliminar {
    background: #dc3545 !important;
    margin-left: 0.5rem;
}

.btn-eliminar:hover {
    background: #c82333 !important;
}

/* Lista de Reclamaciones */
.lista-reclamaciones {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.reclamacion-card {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.reclamacion-card .reclamacion-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: flex-start;
}

.reclamacion-card .reclamacion-imagen {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.reclamacion-card .reclamacion-sin-foto {
    width: 100px;
    height: 100px;
    background: #f0f0f0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    flex-shrink: 0;
}

.reclamacion-card .reclamacion-info-objeto {
    flex: 1;
}

.reclamacion-card h4 {
    color: #667eea;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.reclamacion-card .info-reclamante {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

.reclamacion-card .info-reclamante p {
    margin-bottom: 0.25rem;
    color: #333;
}

.reclamacion-card .info-reclamante a {
    color: #667eea;
    text-decoration: none;
}

.reclamacion-card .info-reclamante a:hover {
    text-decoration: underline;
}

.reclamacion-card .detalles {
    color: #666;
    line-height: 1.5;
    margin-top: 0.75rem;
    background: #fff9e6;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #ffc107;
}

/* Botones de gestión en reclamaciones */
.botones-gestion-reclamacion {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.botones-gestion-reclamacion .btn-estado {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem 1rem;
}

.btn-estado.btn-rechazar {
    background: #dc3545;
    color: white;
}

.btn-estado.btn-rechazar:hover {
    background: #c82333;
}

.estado-entregado-info,
.estado-rechazado-info {
    width: 100%;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}

.estado-entregado-info {
    background: #d4edda;
    color: #155724;
}

.estado-rechazado-info {
    background: #f8d7da;
    color: #721c24;
}

.estado-entregado-info p,
.estado-rechazado-info p {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease;
}

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

.close {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
    transition: color 0.3s ease;
}

.close:hover {
    color: #333;
}

.modal-content h2 {
    color: #333;
    margin-bottom: 1.5rem;
}

/* Mensajes */
.mensaje {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    text-align: center;
    font-weight: 600;
    animation: slideDown 0.3s ease;
}

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

.mensaje.exito {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

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

.mensaje.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

h2 {
    color: #000;
    text-align: center;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    color: #666;
}

.empty-state p {
    font-size: 1.2rem;
    margin-top: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.5rem;
    }
    
    .role-selector {
        flex-direction: column;
    }
    
    .role-btn {
        width: 100%;
    }
    
    .lista-objetos {
        grid-template-columns: 1fr;
    }
    
    .admin-tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        width: 100%;
    }
}

/* Footer */
.footer {
    background: rgba(242, 240, 240, 0.95);
    padding: 1.5rem 2rem;
    text-align: center;
    margin-top: auto;
    border-top: 2px solid #667eea;
    width: 100%;
}

.link-terminos {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: inline-block;
}

.link-terminos:hover {
    color: #5568d3;
    transform: translateY(-2px);
}

/* Modal Términos y Condiciones */
.modal-terminos {
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
}

.terminos-content {
    text-align: left;
    line-height: 1.8;
    color: #333;
}

.terminos-content h3 {
    color: #667eea;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.terminos-content p {
    margin-bottom: 1rem;
    text-align: justify;
}

.terminos-content ul {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.terminos-content li {
    margin-bottom: 0.5rem;
}

.terminos-content hr {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 1.5rem 0;
}

/* Scroll personalizado para el modal de términos */
.modal-terminos::-webkit-scrollbar {
    width: 8px;
}

.modal-terminos::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.modal-terminos::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.modal-terminos::-webkit-scrollbar-thumb:hover {
    background: #5568d3;
}

@media (max-width: 768px) {
    .modal-terminos {
        max-width: 95%;
        max-height: 90vh;
        padding: 1rem;
    }
    
    .terminos-content {
        font-size: 0.9rem;
    }
    
    .footer {
        padding: 1rem;
        font-size: 0.9rem;
    }
}
