:root {
    --bg-main: #0b0f19;
    --bg-card: rgba(18, 26, 43, 0.75);
    --bg-card-hover: rgba(28, 40, 65, 0.85);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(99, 102, 241, 0.5);

    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: rgba(99, 102, 241, 0.15);
    
    --secondary: #10b981;
    --secondary-hover: #059669;

    --accent-pink: #ec4899;
    --accent-cyan: #06b6d4;
    --accent-amber: #f59e0b;
    --danger: #ef4444;

    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dim: #6b7280;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;

    --shadow-glow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Plus Jakarta Sans', 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background Ambient Glows */
.background-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(140px);
    pointer-events: none;
    z-index: 0;
}
.glow-1 {
    top: -10%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.18), transparent 70%);
}
.glow-2 {
    bottom: -10%;
    right: -10%;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.14), transparent 70%);
}

/* Header */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(11, 15, 25, 0.82);
    border-bottom: 1px solid var(--border-color);
}

.header-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0.9rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.brand-logo {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}
.brand-text h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #fff 30%, #9ca3af);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.brand-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Main Nav */
.main-nav {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.04);
    padding: 0.35rem;
    border-radius: 99px;
    border: 1px solid var(--border-color);
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.55rem 1.1rem;
    border-radius: 99px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}
.nav-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}
.nav-btn.active {
    color: #fff;
    background: var(--primary);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}
.nav-btn.accent-btn {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(6, 182, 212, 0.2));
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #34d399;
}
.nav-btn.accent-btn:hover, .nav-btn.accent-btn.active {
    background: linear-gradient(135deg, var(--secondary), var(--accent-cyan));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.header-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 0.4rem 0.8rem;
    border-radius: 99px;
    font-size: 0.78rem;
    color: #34d399;
}
.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
}

/* App Content */
.app-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    position: relative;
    z-index: 1;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}
.tab-pane.active {
    display: block;
}

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

.page-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 1.8rem;
}
.page-title-row h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
}
.page-title-row .subtitle {
    color: var(--text-muted);
    font-size: 0.92rem;
    margin-top: 0.2rem;
}

/* Metric Cards */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.metric-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.4rem;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    transition: var(--transition);
}
.metric-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: var(--shadow-glow);
}
.metric-icon {
    font-size: 1.8rem;
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
}
.metric-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.metric-value {
    font-family: 'Outfit', sans-serif;
    font-size: 1.7rem;
    font-weight: 800;
    margin: 0.1rem 0;
}
.metric-trend {
    font-size: 0.78rem;
    color: var(--text-dim);
}

.metric-primary .metric-icon { background: rgba(99, 102, 241, 0.15); color: #818cf8; }
.metric-primary .metric-value { color: #818cf8; }

.metric-info-card .metric-icon { background: rgba(6, 182, 212, 0.15); color: #38bdf8; }
.metric-info-card .metric-value { color: #38bdf8; }

.metric-accent .metric-icon { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.metric-accent .metric-value { color: #fbbf24; }

.metric-success .metric-icon { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.metric-success .metric-value { color: #34d399; }

/* Dashboard Split */
.dashboard-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
@media (max-width: 900px) {
    .dashboard-split { grid-template-columns: 1fr; }
}

.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--border-color);
}
.card-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

/* Species Chart Container */
.species-chart-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;

}
.species-bar-item {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.species-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.88rem;
    font-weight: 600;
}
.species-bar-track {
    height: 10px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
}
.species-bar-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 0.8s ease;
}

/* Recent Feed */
.recent-feed {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}
.recent-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.recent-item:hover {
    background: rgba(255, 255, 255, 0.06);
}
.recent-item-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.recent-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.search-box {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}
.search-box svg {
    position: absolute;
    left: 1rem;
    color: var(--text-dim);
}
.search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.8rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: #fff;
    font-size: 0.92rem;
    outline: none;
    transition: var(--transition);
}
.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.custom-select, .custom-input, .custom-textarea {
    background: rgba(18, 26, 43, 0.9);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
}
.custom-select:focus, .custom-input:focus, .custom-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Grid Cards (Pets & Owners) */
.pets-grid, .owners-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}

.pet-card, .owner-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.3rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.pet-card:hover, .owner-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: var(--shadow-glow);
}

.card-top-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.8rem;
}
.pet-title-block, .owner-title-block {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.pet-emoji-avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: rgba(99, 102, 241, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}
.pet-card h4, .owner-card h4 {
    font-size: 1.1rem;
    font-weight: 700;

}
.pet-card .breed-text, .owner-card .doc-text {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Badge Pills */
.badge {
    padding: 0.25rem 0.65rem;
    border-radius: 99px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.badge-perro { background: rgba(99, 102, 241, 0.2); color: #a5b4fc; border: 1px solid rgba(99, 102, 241, 0.3); }
.badge-gato { background: rgba(236, 72, 153, 0.2); color: #f472b6; border: 1px solid rgba(236, 72, 153, 0.3); }
.badge-conejo { background: rgba(245, 158, 11, 0.2); color: #fcd34d; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-ave { background: rgba(6, 182, 212, 0.2); color: #67e8f9; border: 1px solid rgba(6, 182, 212, 0.3); }
.badge-otro { background: rgba(156, 163, 175, 0.2); color: #d1d5db; border: 1px solid rgba(156, 163, 175, 0.3); }

.details-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin: 1rem 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.detail-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.04);
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-sm);
}

.symptoms-box {
    background: rgba(0, 0, 0, 0.25);
    border-left: 3px solid var(--accent-cyan);
    padding: 0.6rem 0.8rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.82rem;
    color: #e5e7eb;
    margin-bottom: 1rem;
}
.symptoms-box strong { color: var(--accent-cyan); }

.card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding-top: 0.8rem;
    border-top: 1px solid var(--border-color);
}

/* Buttons */
.btn {
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.6rem 1.1rem;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition);
}
.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}
.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}
.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.14);
}
.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
    background: var(--danger);
    color: #fff;
}
.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
}
.btn-lg {
    padding: 0.85rem 1.5rem;
    font-size: 1rem;
    border-radius: var(--radius-md);
}
.w-100 { width: 100%; }

/* Form Styles */
.form-card-wrapper {
    max-width: min-content;
    margin: 0 auto;
}
.dual-form {
    display: grid;
    grid-template-columns: 1fr 20px 1fr;
    gap: 1.5rem;
}
@media (max-width: 850px) {
    .dual-form { grid-template-columns: 1fr; }
    .form-divider { display: none; }
}

.form-divider {
    background: var(--border-color);
    width: 1px;
    height: 100%;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.2rem;
}
.section-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.88rem;
}
.section-badge.badge-pet {
    background: var(--secondary);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1.1rem;
}
.form-group label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: #111827;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 520px;
    padding: 1.8rem;
    box-shadow: var(--shadow-glow);
    transform: scale(0.95);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-overlay.active .modal-card {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
}
.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
}
.close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
}
.close-btn:hover { color: #fff; }

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    background: #1e293b;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1.2rem;
    color: #fff;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    animation: toastIn 0.3s ease;
}
.toast-success { border-left: 4px solid var(--secondary); }
.toast-error { border-left: 4px solid var(--danger); }

@keyframes toastIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
