/* ============================================
   ESTILOS GENERALES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f2f5;
    color: #2d3748;
}

/* ============================================
   LOGIN
   ============================================ */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
    padding: 20px;
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 420px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header .paw-icon {
    font-size: 50px;
}

.login-header h1 {
    color: #1a73e8;
    font-size: 32px;
    margin: 10px 0;
}

.login-header p {
    color: #718096;
    font-size: 16px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #2d3748;
    font-weight: 600;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #fff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26,115,232,0.1);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #718096;
    font-size: 12px;
}

.btn-primary {
    background: #1a73e8;
    color: white;
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary:hover {
    background: #1557b0;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(26,115,232,0.3);
}

.error-message {
    color: #e53e3e;
    margin: 10px 0;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
}

.demo-info {
    text-align: center;
    margin-top: 20px;
    padding: 15px;
    background: #ebf4ff;
    border-radius: 10px;
    color: #1a73e8;
    font-size: 14px;
    line-height: 1.6;
}

/* ============================================
   LAYOUT PRINCIPAL
   ============================================ */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #1a237e 0%, #0d47a1 100%);
    color: white;
    padding: 20px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar .logo {
    text-align: center;
    padding: 20px 0;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    margin-bottom: 20px;
}

.sidebar .logo span {
    font-size: 50px;
}

.sidebar .logo h2 {
    font-size: 24px;
    margin: 5px 0;
    color: #fff;
}

.sidebar .logo small {
    color: rgba(255,255,255,0.7);
    font-size: 11px;
}

.sidebar nav {
    flex: 1;
}

.sidebar nav a {
    display: block;
    color: white;
    text-decoration: none;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 5px;
    transition: all 0.3s;
    font-size: 15px;
}

.sidebar nav a:hover {
    background: rgba(255,255,255,0.15);
}

.sidebar nav a.active {
    background: rgba(255,255,255,0.25);
    font-weight: 600;
}

.user-info {
    padding: 20px 0;
    border-top: 1px solid rgba(255,255,255,0.2);
}

.user-info p {
    font-size: 16px;
    margin-bottom: 5px;
}

.user-info small {
    display: block;
    color: rgba(255,255,255,0.7);
    margin-bottom: 10px;
    text-transform: uppercase;
    font-size: 11px;
}

.logout-btn {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 14px;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* Contenido principal */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 30px;
    overflow-y: auto;
    background: #f0f2f5;
    min-height: 100vh;
}

/* Páginas */
.page {
    display: none;
}

.page.active {
    display: block;
}

.main-content h2 {
    color: #1a237e;
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: 700;
}

/* ============================================
   ESTADÍSTICAS
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    transition: all 0.3s;
    border-left: 4px solid #1a73e8;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.stat-card h3 {
    font-size: 42px;
    color: #1a73e8;
    margin-bottom: 5px;
    font-weight: 700;
}

.stat-card p {
    color: #718096;
    font-size: 14px;
    font-weight: 500;
}

.stat-card:nth-child(2) {
    border-left-color: #48bb78;
}
.stat-card:nth-child(2) h3 {
    color: #48bb78;
}
.stat-card:nth-child(3) {
    border-left-color: #ed8936;
}
.stat-card:nth-child(3) h3 {
    color: #ed8936;
}
.stat-card:nth-child(4) {
    border-left-color: #9f7aea;
}
.stat-card:nth-child(4) h3 {
    color: #9f7aea;
}

/* ============================================
   FORMULARIO
   ============================================ */
.registro-form {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
}

fieldset {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    background: #fafbfc;
}

legend {
    font-weight: 700;
    font-size: 18px;
    color: #1a237e;
    padding: 0 15px;
    background: white;
    border-radius: 5px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

button {
    padding: 12px 30px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-success {
    background: #48bb78;
    color: white;
}

.btn-success:hover {
    background: #38a169;
}

.btn-secondary {
    background: #a0aec0;
    color: white;
}

.btn-secondary:hover {
    background: #718096;
}

/* Mensajes */
.mensaje {
    padding: 15px 20px;
    border-radius: 10px;
    margin-top: 20px;
    display: none;
    font-weight: 600;
    font-size: 15px;
}

.mensaje.success {
    display: block;
    background: #c6f6d5;
    color: #22543d;
    border: 1px solid #48bb78;
}

.mensaje.error {
    display: block;
    background: #fed7d7;
    color: #742a2a;
    border: 1px solid #fc8181;
}

/* ============================================
   TABLA DE REGISTROS - ELEGANTE CON SCROLL
   ============================================ */
.tabla-contenedor {
    background: white;
    border-radius: 15px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    overflow: hidden;
}

.tabla-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.tabla-header h3 {
    color: #1a237e;
    font-size: 18px;
}

.tabla-info {
    color: #718096;
    font-size: 14px;
}

/* Contenedor con scroll horizontal */
.tabla-scroll {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 600px;
    -webkit-overflow-scrolling: touch;
}

/* Estilo del scroll */
.tabla-scroll::-webkit-scrollbar {
    height: 10px;
    width: 10px;
}

.tabla-scroll::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.tabla-scroll::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

.tabla-scroll::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Tabla */
table {
    width: 100%;
    min-width: 1400px;
    border-collapse: collapse;
    font-size: 13px;
}

thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

thead th {
    background: #1a237e;
    color: white;
    padding: 14px 12px;
    text-align: center;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

tbody td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

tbody tr {
    transition: background 0.2s;
}

tbody tr:hover {
    background: #ebf4ff;
}

tbody tr:nth-child(even) {
    background: #f7fafc;
}

tbody tr:nth-child(even):hover {
    background: #ebf4ff;
}

/* Colores por especie */
td.especie-perro {
    color: #1a73e8;
    font-weight: 600;
}

td.especie-gato {
    color: #ed8936;
    font-weight: 600;
}

/* Sin registros */
.sin-registros {
    text-align: center;
    padding: 40px !important;
    color: #a0aec0;
    font-size: 16px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        position: relative;
        height: auto;
    }
    
    .main-content {
        margin-left: 0;
        padding: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    table {
        min-width: 800px;
        font-size: 11px;
    }
    
    thead th {
        padding: 10px 6px;
        font-size: 10px;
    }
    
    tbody td {
        padding: 8px 6px;
    }
}
/* Estilos para validación */
.error-campo {
    color: #e53e3e;
    font-size: 12px;
    font-weight: 600;
    display: block;
    margin-top: 4px;
    min-height: 18px;
}

.form-group input.error,
.form-group select.error {
    border-color: #fc8181 !important;
    background: #fff5f5;
}