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

:root {
    --primary-color: #4CAF50;
    --secondary-color: #2196F3;
    --danger-color: #F44336;
    --warning-color: #FF9800;
    --dark-color: #333;
    --light-color: #f5f5f5;
    --sidebar-width: 250px;
    --border-radius: 8px;
    --shadow: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 6px rgba(0,0,0,0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f2f5;
    color: var(--dark-color);
    line-height: 1.6;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #2c3e50 0%, #34495e 100%);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 15px;
}

.sidebar-header i {
    margin-right: 10px;
    color: var(--primary-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: rgba(255,255,255,0.8);
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 10px;
}

.user-info i {
    font-size: 18px;
    color: var(--primary-color);
}

.sidebar-nav {
    padding: 20px 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.nav-item {
    display: block;
    padding: 15px 20px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255,255,255,0.1);
    color: white;
    border-left-color: var(--primary-color);
}

.nav-item.active {
    background: rgba(255,255,255,0.15);
    color: white;
    border-left-color: var(--primary-color);
}

.nav-item i {
    width: 20px;
    margin-right: 10px;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.logout-btn {
    color: rgba(255,255,255,0.7) !important;
}

.logout-btn:hover {
    background: rgba(244, 67, 54, 0.2) !important;
    color: white !important;
    border-left-color: var(--danger-color) !important;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 30px;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-header h2 {
    font-size: 28px;
    font-weight: 600;
    color: var(--dark-color);
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.btn-primary:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.stat-info h3 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-info p {
    color: #666;
    font-size: 14px;
}

/* Sections */
.section {
    background: white;
    border-radius: var(--border-radius);
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.section h3 {
    margin-bottom: 20px;
    color: var(--dark-color);
    font-size: 20px;
}

/* Animals Grid */
.animals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.animal-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
}

.animal-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.animal-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
}

.animal-card-header h4 {
    font-size: 18px;
    color: var(--dark-color);
}

.animal-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-primary {
    background: #e3f2fd;
    color: var(--secondary-color);
}

.badge-success {
    background: #e8f5e9;
    color: var(--primary-color);
}

.animal-info {
    margin-bottom: 10px;
    font-size: 14px;
    color: #666;
}

.animal-info strong {
    color: var(--dark-color);
    margin-right: 5px;
}

.animal-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    flex-wrap: wrap;
}

.animal-details {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
    animation: slideDown 0.3s ease;
    display: none !important;
}

.animal-details.show {
    display: block !important;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 2000px;
    }
}

.details-loading {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}

.details-loaded {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.detail-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    border-left: 4px solid var(--primary-color);
}

.detail-section h5 {
    margin: 0 0 12px 0;
    color: var(--dark-color);
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-section h5 i {
    color: var(--primary-color);
}

.detail-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail-item {
    background: white;
    padding: 12px 15px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    font-size: 14px;
    line-height: 1.6;
}

.detail-item strong {
    color: var(--dark-color);
    margin-right: 5px;
}

.no-records {
    color: #999;
    font-style: italic;
    padding: 10px;
    text-align: center;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* Reminders List */
.reminders-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.reminder-item {
    background: white;
    border-radius: var(--border-radius);
    padding: 15px 20px;
    border-left: 4px solid var(--secondary-color);
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.reminder-item.priority-high {
    border-left-color: var(--danger-color);
}

.reminder-item.priority-critical {
    border-left-color: #d32f2f;
    background: #ffebee;
}

.reminder-info h4 {
    font-size: 16px;
    margin-bottom: 5px;
}

.reminder-info p {
    font-size: 14px;
    color: #666;
}

.reminder-date {
    font-weight: 600;
    color: var(--secondary-color);
}

/* Tables */
.table-container {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: #f8f9fa;
}

.data-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: var(--dark-color);
    border-bottom: 2px solid #dee2e6;
}

.data-table td {
    padding: 15px;
    border-bottom: 1px solid #dee2e6;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
}

.status-overdue {
    background: #ffebee;
    color: var(--danger-color);
}

.status-due-soon {
    background: #fff3e0;
    color: var(--warning-color);
}

.status-up-to-date {
    background: #e8f5e9;
    color: var(--primary-color);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark-color);
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.search-input {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 14px;
    min-width: 250px;
}

.filter-select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 14px;
    background: white;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--border-radius);
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    font-size: 24px;
    color: var(--dark-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    transition: color 0.3s;
}

.modal-close:hover {
    color: var(--danger-color);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

/* Reports */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

.report-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow);
}

.report-card h3 {
    margin-bottom: 20px;
    color: var(--dark-color);
}

/* Settings Tabs */
.settings-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #dee2e6;
}

.tab-btn {
    padding: 12px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn:hover {
    color: var(--primary-color);
    background: #f5f5f5;
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.settings-tab-content {
    display: none;
}

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

/* Report Tabs */
.report-tabs {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    padding: 20px;
    border-bottom: 3px solid #e0e0e0;
    flex-wrap: wrap;
    background: linear-gradient(to bottom, #ffffff 0%, #f8f9fa 100%);
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.report-tab-btn {
    padding: 14px 28px;
    background: linear-gradient(to bottom, #ffffff 0%, #f5f5f5 100%);
    border: 2px solid #d0d0d0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    color: #444;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1), inset 0 1px 0 rgba(255,255,255,0.8);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 160px;
    justify-content: center;
}

.report-tab-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.6s;
}

.report-tab-btn:hover::before {
    left: 100%;
}

.report-tab-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary-color);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.report-tab-btn:hover {
    color: var(--primary-color);
    background: linear-gradient(to bottom, #f0f8f0 0%, #e8f5e9 100%);
    border-color: var(--primary-color);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 6px 12px rgba(76, 175, 80, 0.25), inset 0 1px 0 rgba(255,255,255,0.9);
}

.report-tab-btn:hover::after {
    transform: scaleX(1);
}

.report-tab-btn.active {
    color: white;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 50%, #388e3c 100%);
    border-color: #388e3c;
    box-shadow: 0 6px 16px rgba(76, 175, 80, 0.4), inset 0 2px 4px rgba(0,0,0,0.1);
    transform: translateY(-3px) scale(1.05);
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.report-tab-btn.active::after {
    background: rgba(255,255,255,0.3);
    height: 4px;
    transform: scaleX(1);
}

.report-tab-btn.active:hover {
    background: linear-gradient(135deg, #45a049 0%, #4CAF50 50%, #388e3c 100%);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(76, 175, 80, 0.5), inset 0 2px 4px rgba(0,0,0,0.1);
}

.report-tab-btn i {
    font-size: 18px;
    transition: all 0.3s ease;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.1));
}

.report-tab-btn:hover i {
    transform: scale(1.15) rotate(5deg);
}

.report-tab-btn.active i {
    transform: scale(1.2);
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.3));
    color: white;
}

/* Responsive styles for report tabs */
@media (max-width: 768px) {
    .report-tabs {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
    }
    
    .report-tab-btn {
        width: 100%;
        justify-content: center;
        padding: 14px 24px;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .report-tabs {
        padding: 10px;
        gap: 8px;
    }
    
    .report-tab-btn {
        font-size: 13px;
        padding: 12px 20px;
        letter-spacing: 0.3px;
    }
    
    .report-tab-btn i {
        font-size: 16px;
    }
}

.report-tab-content {
    display: none !important;
}

.report-tab-content.active {
    display: block !important;
}

.report-filters {
    margin-bottom: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 5px;
}

.report-summary {
    margin-bottom: 20px;
    padding: 15px;
    border-radius: 5px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 70px;
    }
    
    .sidebar-header h1,
    .nav-item span {
        display: none;
    }
    
    .main-content {
        margin-left: 70px;
        padding: 15px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .animals-grid {
        grid-template-columns: 1fr;
    }
    
    .header-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .search-input,
    .filter-select {
        width: 100%;
    }
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: #999;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 20px;
    opacity: 0.5;
}

