:root {
    /* Primary / Secondary / Accent as per AGENTS.md */
    --primary: #00B894;
    --primary-hover: #00A383;
    --secondary: #55EFC4;
    --accent: #FDCB6E;

    --bg-main: #0D1A0F;
    --bg-panel: #142817;
    --bg-hover: #1A361F;

    --text-main: #E2E8F0;
    --text-muted: #94A3B8;
    --border: #2D4A36;

    --success: #00B894;
    --warning: #FDCB6E;
    --danger: #FF7675;

    --radius: 16px;
    --font: 'Inter', system-ui, sans-serif;
}

[data-theme="light"] {
    --bg-main: #F0F5F0;
    --bg-panel: #FFFFFF;
    --bg-hover: #E6EDE6;

    --text-main: #1E293B;
    --text-muted: #64748B;
    --border: #D1E5D5;
}

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

body {
    font-family: var(--font);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: background-color 0.3s, color 0.3s;
}

/* Typography */
h1,
h2,
h3,
h4 {
    color: var(--text-main);
    font-weight: 600;
}

.text-accent {
    color: var(--accent);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    border: none;
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: #FFF;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text-main);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-text {
    background: transparent;
    color: var(--primary);
    padding: 0.5rem;
    border: none;
    font-weight: 600;
    cursor: pointer;
}

.btn-text:hover {
    text-decoration: underline;
}

.btn-icon {
    background: transparent;
    color: var(--text-muted);
    border: none;
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.btn-icon:hover {
    color: var(--primary);
    background: var(--bg-hover);
}

.btn-icon.small {
    padding: 0.25rem;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background-color: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo h1 {
    font-size: 1.25rem;
    color: var(--primary);
}

.logo .icon {
    font-size: 1.5rem;
}

/* Layout */
.app-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--bg-panel);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 1.5rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header h2 {
    font-size: 1rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pet-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.pet-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 12px;
    cursor: pointer;
    transition: 0.2s;
    background: transparent;
    border: 1px solid transparent;
}

.pet-nav-item:hover {
    background: var(--bg-hover);
}

.pet-nav-item.active {
    background: var(--bg-hover);
    border-color: var(--primary);
}

.pet-nav-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.pet-nav-info {
    display: flex;
    flex-direction: column;
}

.pet-nav-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
}

.pet-nav-type {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: capitalize;
}

.emergency-contacts {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.emergency-contacts h3 {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.btn-contact {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    transition: 0.2s;
}

.btn-contact:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
}

.btn-contact.emergency {
    color: var(--danger);
    border-color: rgba(255, 118, 117, 0.3);
}

.btn-contact.emergency:hover {
    background: rgba(255, 118, 117, 0.1);
    border-color: var(--danger);
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    background: var(--bg-main);
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    gap: 1rem;
    color: var(--text-muted);
}

.feature-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Dashboard */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.pet-info-large {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.pet-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}

.pet-meta {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Cards */
.card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.stat-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-card h3 {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

/* Timeline */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.timeline-item {
    display: flex;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.timeline-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.timeline-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.timeline-icon.type-vaccine {
    background: rgba(0, 184, 148, 0.1);
    color: var(--success);
}

.timeline-icon.type-deworm {
    background: rgba(253, 203, 110, 0.1);
    color: var(--warning);
}

.timeline-icon.type-medication {
    background: rgba(85, 239, 196, 0.1);
    color: var(--secondary);
}

.timeline-icon.type-vet {
    background: rgba(116, 185, 255, 0.1);
    color: #74B9FF;
}

.timeline-content {
    flex: 1;
}

.tl-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}

.tl-title {
    font-weight: 600;
    color: var(--text-main);
}

.tl-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.tl-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.tl-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    background: var(--bg-main);
    border: 1px solid var(--border);
    margin-top: 0.5rem;
    margin-right: 0.5rem;
}

.tl-badge.due {
    border-color: var(--warning);
    color: var(--warning);
}

/* Chart */
.chart-container {
    height: 250px;
    width: 100%;
    position: relative;
}

/* Forms & Modals */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 100%;
    max-width: 500px;
    padding: 2rem;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
}

.btn-close:hover {
    color: var(--text-main);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

input[type="text"],
input[type="date"],
input[type="number"],
input[type="url"],
select {
    width: 100%;
    background: var(--bg-main);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.75rem;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: 0.2s;
}

input:focus,
select:focus {
    border-color: var(--primary);
}

.select-small {
    padding: 0.5rem;
    font-size: 0.85rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-main);
    color: var(--bg-main);
    padding: 0.75rem 1.5rem;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: 0.3s;
    opacity: 0;
    z-index: 1000;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
}

.toast.show {
    bottom: 30px;
    opacity: 1;
}

/* Paw Animation */
.paw-animation {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 5rem;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.paw-animation.animate {
    transform: translate(-50%, -50%) scale(2);
    opacity: 1;
}

/* Printing styles */
@media print {
    .no-print {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .sidebar {
        display: none;
    }

    .main-content {
        padding: 0;
        background: white;
    }

    .card {
        border: none;
        margin-bottom: 2rem;
    }

    .timeline-item {
        border-bottom: 1px solid #ddd;
    }

    .print-header {
        border-bottom: 2px solid #000;
        padding-bottom: 1rem;
        margin-bottom: 2rem;
    }
}