/* ============================================================
   Halal Livestock Management - Mobile-First CSS
   ============================================================ */

:root {
    --primary: #2E7D32;
    --primary-dark: #1B5E20;
    --primary-light: #4CAF50;
    --primary-ultra-light: #E8F5E9;
    --bg: #f0f2f5;
    --sidebar-bg: #1B5E20;
    --sidebar-width: 265px;
    --topbar-height: 58px;
    --text-dark: #1a1a2e;
    --text-muted: #6c757d;
    --card-shadow: 0 2px 12px rgba(0,0,0,0.08);
    --radius: 10px;
    --transition: 0.25s cubic-bezier(.4,0,.2,1);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text-dark);
    font-size: 15px;
    line-height: 1.5;
    overflow-x: hidden;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-body {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh;
    background: linear-gradient(145deg, var(--primary-dark) 0%, var(--primary) 100%);
    padding: 20px;
}
.login-container { width: 100%; max-width: 400px; }
.login-card {
    background: #fff; border-radius: 20px; padding: 40px 36px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.25);
}
.login-header { text-align: center; margin-bottom: 32px; }
.login-icon {
    width: 72px; height: 72px; background: var(--primary-ultra-light);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px; font-size: 2rem; color: var(--primary);
}
.login-header h2 { color: var(--primary-dark); font-size: 1.5rem; font-weight: 700; }
.login-header p { color: var(--text-muted); font-size: 0.9rem; margin-top: 4px; }
.login-footer { text-align: center; margin-top: 20px; color: var(--text-muted); font-size: 0.82rem; }

/* ============================================================
   LAYOUT — TOPBAR + SIDEBAR + CONTENT
   Mobile-first: topbar always visible, sidebar slides in
   ============================================================ */

/* Topbar (mobile nav bar) */
.topbar {
    position: fixed; top: 0; left: 0; right: 0;
    height: var(--topbar-height);
    background: var(--primary-dark);
    display: flex; align-items: center;
    padding: 0 16px;
    z-index: 1100;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.topbar-brand {
    flex: 1; color: #fff; font-weight: 700; font-size: 1rem;
    display: flex; align-items: center; gap: 8px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar-brand i { color: #81C784; font-size: 1.1rem; flex-shrink: 0; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-btn {
    background: rgba(255,255,255,0.15); border: none; color: #fff;
    width: 38px; height: 38px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; cursor: pointer; transition: background var(--transition);
    text-decoration: none; position: relative;
}
.topbar-btn:hover { background: rgba(255,255,255,0.25); }
.topbar-btn .badge-dot {
    position: absolute; top: 4px; right: 4px;
    width: 8px; height: 8px; background: #FF5252;
    border-radius: 50%; border: 2px solid var(--primary-dark);
}

/* Sidebar overlay backdrop */
.sidebar-backdrop {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.5); z-index: 1150;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0; transition: opacity var(--transition);
}
.sidebar-backdrop.visible { opacity: 1; }

/* Sidebar */
.sidebar {
    position: fixed; top: 0; left: 0;
    width: var(--sidebar-width); height: 100vh;
    background: var(--sidebar-bg);
    z-index: 1200;
    display: flex; flex-direction: column;
    transform: translateX(-100%);
    transition: transform var(--transition);
    overflow: hidden;
}
.sidebar.open { transform: translateX(0); }

.sidebar-header {
    padding: 0 20px;
    height: var(--topbar-height);
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
}
.sidebar-brand {
    color: #fff; font-weight: 700; font-size: 1rem;
    display: flex; align-items: center; gap: 8px;
}
.sidebar-brand i { color: #81C784; }
.sidebar-close {
    background: rgba(255,255,255,0.1); border: none; color: #fff;
    width: 32px; height: 32px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 1rem;
}

.sidebar-scroll { flex: 1; overflow-y: auto; padding: 8px 0 20px; }
.sidebar-scroll::-webkit-scrollbar { width: 4px; }
.sidebar-scroll::-webkit-scrollbar-track { background: transparent; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }

.sidebar-section-label {
    padding: 16px 20px 6px;
    font-size: 0.68rem; text-transform: uppercase;
    color: rgba(255,255,255,0.4); letter-spacing: 1.2px;
    font-weight: 600;
}
.sidebar-menu { list-style: none; }
.sidebar-menu li a {
    display: flex; align-items: center;
    padding: 11px 20px; gap: 12px;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    font-size: 0.9rem; font-weight: 500;
    transition: all var(--transition);
    border-left: 3px solid transparent;
}
.sidebar-menu li a i {
    width: 20px; text-align: center; font-size: 0.95rem;
    color: rgba(255,255,255,0.5); transition: color var(--transition);
}
.sidebar-menu li a:hover {
    background: rgba(255,255,255,0.08);
    color: #fff; border-left-color: rgba(255,255,255,0.3);
}
.sidebar-menu li a:hover i { color: #81C784; }
.sidebar-menu li a.active {
    background: rgba(255,255,255,0.12);
    color: #fff; border-left-color: #81C784;
}
.sidebar-menu li a.active i { color: #81C784; }

.sidebar-user {
    flex-shrink: 0;
    padding: 14px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex; align-items: center; gap: 10px;
}
.sidebar-user-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1rem; flex-shrink: 0;
}
.sidebar-user-info { min-width: 0; }
.sidebar-user-name {
    color: #fff; font-weight: 600; font-size: 0.85rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user-role {
    color: rgba(255,255,255,0.5); font-size: 0.75rem; text-transform: capitalize;
}
.sidebar-logout {
    margin-left: auto; color: rgba(255,255,255,0.5);
    text-decoration: none; font-size: 1rem;
    transition: color var(--transition); flex-shrink: 0;
}
.sidebar-logout:hover { color: #FF5252; }

/* Main content */
.main-content {
    padding-top: var(--topbar-height);
    min-height: 100vh;
    width: 100%;
}
.content-inner { padding: 16px; }

/* Desktop: persistent sidebar */
@media (min-width: 992px) {
    .topbar { left: var(--sidebar-width); }
    .topbar-hamburger { display: none !important; }
    .sidebar { transform: translateX(0) !important; }
    .sidebar-close { display: none; }
    .sidebar-backdrop { display: none !important; }
    .main-content { padding-left: var(--sidebar-width); }
    .content-inner { padding: 24px; }
}

/* ============================================================
   WRAPPER (for compatibility with existing pages)
   ============================================================ */
.wrapper { min-height: 100vh; }

/* Legacy mobile toggle (hidden — replaced by topbar) */
.mobile-toggle { display: none !important; }

/* ============================================================
   FLASH MESSAGES
   ============================================================ */
.flash-message {
    position: fixed; top: calc(var(--topbar-height) + 10px); right: 12px;
    left: 12px; max-width: 420px; margin: 0 auto;
    padding: 12px 18px; border-radius: 10px;
    color: #fff; font-weight: 500; font-size: 0.9rem;
    z-index: 9999; animation: slideDown 0.3s ease;
    display: flex; align-items: center; justify-content: space-between;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
@media (min-width: 992px) {
    .flash-message { left: auto; top: 70px; }
}
.flash-success { background: var(--primary); }
.flash-danger { background: #D32F2F; }
.flash-warning { background: #E65100; }
.flash-close { cursor: pointer; font-size: 1.2rem; margin-left: 12px; opacity: 0.8; }
@keyframes slideDown {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px; gap: 10px; flex-wrap: wrap;
}
.page-header h2 {
    color: var(--primary-dark); font-size: 1.25rem; font-weight: 700;
    display: flex; align-items: center; gap: 8px;
}
.page-header h2 i { font-size: 1.1rem; opacity: 0.8; }
.page-header-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: #fff; border-radius: var(--radius);
    box-shadow: var(--card-shadow); border: none; margin-bottom: 16px;
}
.card-header {
    padding: 14px 18px; font-weight: 600; font-size: 0.95rem;
    border-bottom: 1px solid #f0f0f0;
    display: flex; align-items: center; gap: 8px;
    background: #fff; border-radius: var(--radius) var(--radius) 0 0;
}
.card-header i { color: var(--primary); }
.card-body { padding: 18px; }
.card-footer { padding: 12px 18px; border-top: 1px solid #f0f0f0; }

/* ============================================================
   STAT CARDS
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}
@media (min-width: 768px) {
    .stats-grid { grid-template-columns: repeat(4, 1fr); }
}
.stat-card {
    background: #fff; border-radius: var(--radius);
    padding: 16px; box-shadow: var(--card-shadow);
    display: flex; align-items: center; gap: 12px;
    transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.12); }
.stat-icon {
    width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; color: #fff;
}
.stat-icon.green { background: linear-gradient(135deg, #2E7D32, #4CAF50); }
.stat-icon.blue { background: linear-gradient(135deg, #1565C0, #1976D2); }
.stat-icon.orange { background: linear-gradient(135deg, #E65100, #F57C00); }
.stat-icon.red { background: linear-gradient(135deg, #B71C1C, #D32F2F); }
.stat-icon.purple { background: linear-gradient(135deg, #6A1B9A, #7B1FA2); }
.stat-icon.teal { background: linear-gradient(135deg, #00695C, #00897B); }
.stat-info { min-width: 0; }
.stat-info h3 { font-size: 1.5rem; font-weight: 800; line-height: 1; color: var(--text-dark); }
.stat-info p { font-size: 0.75rem; color: var(--text-muted); margin-top: 3px; }

/* ============================================================
   GRID SYSTEM
   ============================================================ */
.row { display: grid; grid-template-columns: 1fr; gap: 16px; margin-bottom: 0; }
@media (min-width: 600px) {
    .row.row-2 { grid-template-columns: 1fr 1fr; }
    .row.row-3 { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 992px) {
    .row { grid-template-columns: 1fr 1fr; }
    .row.row-1 { grid-template-columns: 1fr; }
    .row.row-3 { grid-template-columns: repeat(3, 1fr); }
    .row.row-4 { grid-template-columns: repeat(4, 1fr); }
}
/* Legacy col- classes */
.col-12 { grid-column: 1 / -1; }
.col-6, .col-4, .col-3 { width: 100%; }
@media (min-width: 768px) {
    .col-6 { width: calc(50% - 8px); }
    .col-4 { width: calc(33.333% - 11px); }
    .col-3 { width: calc(25% - 12px); }
}

/* ============================================================
   TABLES — Mobile card-style
   ============================================================ */
.table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); }
table.table { width: 100%; border-collapse: collapse; min-width: 500px; }
table.table th {
    background: #f8faf8; padding: 11px 14px; text-align: left;
    font-size: 0.75rem; text-transform: uppercase; color: var(--text-muted);
    font-weight: 600; letter-spacing: 0.5px;
    border-bottom: 2px solid #e8f5e9;
}
table.table td {
    padding: 11px 14px; border-bottom: 1px solid #f5f5f5;
    font-size: 0.875rem; vertical-align: middle;
}
table.table tr:last-child td { border-bottom: none; }
table.table tr:hover td { background: #f9fdf9; }

/* Mobile table cards */
@media (max-width: 599px) {
    .table-mobile-cards table.table,
    .table-mobile-cards thead,
    .table-mobile-cards tbody,
    .table-mobile-cards th,
    .table-mobile-cards td,
    .table-mobile-cards tr { display: block; min-width: unset; }
    .table-mobile-cards thead tr { display: none; }
    .table-mobile-cards tbody tr {
        background: #fff; border-radius: var(--radius); margin-bottom: 10px;
        box-shadow: var(--card-shadow); padding: 14px;
        border-left: 4px solid var(--primary);
    }
    .table-mobile-cards td {
        padding: 4px 0; border: none; font-size: 0.85rem;
        display: flex; justify-content: space-between; align-items: center;
    }
    .table-mobile-cards td::before {
        content: attr(data-label);
        font-weight: 600; color: var(--text-muted);
        font-size: 0.75rem; text-transform: uppercase;
        letter-spacing: 0.5px; flex-shrink: 0; margin-right: 10px;
    }
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    display: inline-flex; align-items: center;
    padding: 3px 10px; border-radius: 20px;
    font-size: 0.72rem; font-weight: 600; letter-spacing: 0.3px;
    white-space: nowrap;
}
.badge-success { background: #E8F5E9; color: #2E7D32; }
.badge-danger { background: #FFEBEE; color: #C62828; }
.badge-warning { background: #FFF3E0; color: #E65100; }
.badge-info { background: #E3F2FD; color: #1565C0; }
.badge-secondary { background: #F5F5F5; color: #616161; }
.badge-purple { background: #F3E5F5; color: #6A1B9A; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 18px; border-radius: 8px; font-size: 0.875rem;
    font-weight: 600; border: none; cursor: pointer;
    transition: all var(--transition); text-decoration: none;
    white-space: nowrap; line-height: 1;
    -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn-success { background: var(--primary); color: #fff; }
.btn-success:hover { background: var(--primary-dark); }
.btn-danger { background: #D32F2F; color: #fff; }
.btn-danger:hover { background: #B71C1C; }
.btn-warning { background: #F57C00; color: #fff; }
.btn-warning:hover { background: #E65100; }
.btn-info { background: #1976D2; color: #fff; }
.btn-info:hover { background: #1565C0; }
.btn-secondary { background: #607D8B; color: #fff; }
.btn-secondary:hover { background: #455A64; }
.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; border-radius: 6px; }
.btn-lg { padding: 13px 28px; font-size: 1rem; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-icon { padding: 8px; width: 36px; height: 36px; border-radius: 8px; }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 16px; }
.form-label {
    display: block; font-weight: 600; font-size: 0.82rem;
    color: #444; margin-bottom: 6px; letter-spacing: 0.2px;
}
.form-control, .form-select {
    width: 100%; padding: 10px 14px; border: 1.5px solid #e0e0e0;
    border-radius: 8px; font-size: 0.9rem; color: var(--text-dark);
    background: #fff; transition: border-color var(--transition), box-shadow var(--transition);
    -webkit-appearance: none; appearance: none;
    min-height: 42px;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary); outline: none;
    box-shadow: 0 0 0 3px rgba(46,125,50,0.15);
}
textarea.form-control { min-height: 90px; resize: vertical; }
.form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23666' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center;
    padding-right: 36px;
}
.form-row { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 600px) {
    .form-row.cols-2 { grid-template-columns: 1fr 1fr; }
    .form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
}
.form-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }
.form-row > * { min-width: 0; }

/* ============================================================
   SEARCH
   ============================================================ */
.search-bar {
    display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap;
}
.search-bar input { flex: 1; min-width: 0; }
.search-bar select { min-width: 120px; }
.search-box { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.search-box input { flex: 1; min-width: 0; }

/* ============================================================
   TABS
   ============================================================ */
.tabs {
    display: flex; gap: 4px; margin-bottom: 16px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; padding-bottom: 2px;
}
.tabs::-webkit-scrollbar { display: none; }
.tab-btn {
    padding: 8px 16px; background: #f0f0f0; border: none; cursor: pointer;
    border-radius: 8px; font-size: 0.82rem; font-weight: 600;
    transition: all var(--transition); white-space: nowrap; color: #666;
    -webkit-tap-highlight-color: transparent;
}
.tab-btn.active { background: var(--primary); color: #fff; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ============================================================
   ALERTS & EMPTY STATES
   ============================================================ */
.alert {
    padding: 12px 16px; border-radius: 8px; font-size: 0.875rem;
    margin-bottom: 14px; display: flex; align-items: flex-start; gap: 10px;
}
.alert-danger { background: #FFEBEE; color: #C62828; border-left: 4px solid #D32F2F; }
.alert-success { background: #E8F5E9; color: #2E7D32; border-left: 4px solid #4CAF50; }
.alert-warning { background: #FFF3E0; color: #E65100; border-left: 4px solid #F57C00; }
.alert-info { background: #E3F2FD; color: #1565C0; border-left: 4px solid #1976D2; }

.empty-state {
    text-align: center; padding: 48px 20px; color: var(--text-muted);
}
.empty-state i { font-size: 3rem; color: #d0d0d0; margin-bottom: 16px; display: block; }
.empty-state h4 { color: #999; margin-bottom: 8px; }
.empty-state p { font-size: 0.875rem; margin-bottom: 16px; }

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.55); backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    display: flex; align-items: flex-end; justify-content: center;
    z-index: 10000; padding: 0;
}
@media (min-width: 600px) {
    .modal-overlay { align-items: center; padding: 20px; }
}
.modal-content {
    background: #fff;
    border-radius: 20px 20px 0 0;
    padding: 24px 20px 32px;
    width: 100%; max-width: 520px;
    max-height: 90vh; overflow-y: auto;
    animation: slideUp 0.3s cubic-bezier(.4,0,.2,1);
}
@media (min-width: 600px) {
    .modal-content { border-radius: 16px; padding: 28px; }
}
@keyframes slideUp {
    from { transform: translateY(40px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px;
}
.modal-header h5 { font-size: 1.05rem; font-weight: 700; }
.modal-close {
    background: #f5f5f5; border: none; width: 32px; height: 32px;
    border-radius: 50%; cursor: pointer; font-size: 1rem; color: #666;
    display: flex; align-items: center; justify-content: center;
}

/* ============================================================
   CHAT / AI ASSISTANT
   ============================================================ */
.chat-container { display: flex; flex-direction: column; height: calc(100vh - var(--topbar-height) - 48px); }
.chat-messages {
    flex: 1; overflow-y: auto; padding: 16px;
    background: #f9fdf9; border-radius: var(--radius);
    margin-bottom: 12px;
    -webkit-overflow-scrolling: touch;
}
.chat-message { display: flex; margin-bottom: 12px; }
.chat-message.user { justify-content: flex-end; }
.chat-bubble {
    max-width: 82%; padding: 11px 15px; border-radius: 16px;
    font-size: 0.875rem; line-height: 1.6;
}
.chat-message.user .chat-bubble {
    background: var(--primary); color: #fff;
    border-bottom-right-radius: 4px;
}
.chat-message.ai .chat-bubble {
    background: #fff; color: var(--text-dark);
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.chat-input-area { display: flex; gap: 8px; }
.chat-input-area input { flex: 1; }
.chat-options { margin-bottom: 12px; }

/* ============================================================
   MISC COMPONENTS
   ============================================================ */
.action-group { display: flex; gap: 6px; flex-wrap: wrap; }

.qr-container { text-align: center; padding: 16px; }

.stock-low { color: #D32F2F; font-weight: 700; }
.stock-ok { color: var(--primary); font-weight: 600; }

.spinner {
    display: inline-block; width: 20px; height: 20px;
    border: 2.5px solid #ddd; border-top-color: var(--primary);
    border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Invoice */
.invoice-box { padding: 24px; max-width: 800px; margin: 0 auto; }
@media (max-width: 600px) { .invoice-box { padding: 12px; } }

/* ============================================================
   ANIMAL CARDS (for animals list mobile view)
   ============================================================ */
.animal-grid {
    display: grid; grid-template-columns: 1fr; gap: 12px;
}
@media (min-width: 480px) { .animal-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .animal-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1200px) { .animal-grid { grid-template-columns: repeat(4, 1fr); } }

.animal-card {
    background: #fff; border-radius: var(--radius);
    box-shadow: var(--card-shadow); overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
    text-decoration: none; color: var(--text-dark);
    display: block;
}
.animal-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.13); }
.animal-card-img {
    height: 120px; background: var(--primary-ultra-light);
    display: flex; align-items: center; justify-content: center;
    font-size: 2.5rem; color: var(--primary);
}
.animal-card-body { padding: 12px; }
.animal-card-name { font-weight: 700; font-size: 0.95rem; margin-bottom: 4px; }
.animal-card-meta { font-size: 0.78rem; color: var(--text-muted); }

/* ============================================================
   BOTTOM NAV (mobile quick nav)
   ============================================================ */
.bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0;
    background: #fff; border-top: 1px solid #e8f5e9;
    z-index: 1050; padding: 6px 0 max(6px, env(safe-area-inset-bottom));
    box-shadow: 0 -4px 16px rgba(0,0,0,0.08);
}
.bottom-nav-item {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 3px; text-decoration: none; color: #9E9E9E;
    font-size: 0.65rem; font-weight: 600; padding: 4px 0;
    transition: color var(--transition);
    -webkit-tap-highlight-color: transparent;
}
.bottom-nav-item i { font-size: 1.2rem; }
.bottom-nav-item.active { color: var(--primary); }
.bottom-nav-item span { letter-spacing: 0.2px; }

/* Adjust content for bottom nav on mobile */
@media (max-width: 991px) {
    .main-content { padding-bottom: 70px; }
}
@media (min-width: 992px) {
    .bottom-nav { display: none; }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
    .sidebar, .topbar, .bottom-nav, .mobile-toggle,
    .page-header .btn, .no-print { display: none !important; }
    .main-content { padding: 0 !important; }
    .content-inner { padding: 0 !important; }
    .card { box-shadow: none !important; border: 1px solid #ddd; }
}

/* ============================================================
   UTILITIES
   ============================================================ */
.text-muted { color: var(--text-muted); }
.text-success { color: var(--primary); }
.text-danger { color: #D32F2F; }
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.p-0 { padding: 0; }
.d-flex { display: flex; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-100 { width: 100%; }
.list-unstyled { list-style: none; }
.float-end { float: right; }
.fw-bold { font-weight: 700; }
.small { font-size: 0.8rem; }
