@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&family=DM+Sans:wght@400;500;600&display=swap');

:root {
    /* ComPAWnion — TUP Cats — refined yellow palette */
    --bg: #fffaeb;
    --surface: #ffffff;
    --surface-soft: #fff4c9;
    --text: #3a2d0f;
    --muted: #8a7226;
    --primary: #f4b400;       /* core TUP-cats amber */
    --primary-dark: #c88a00;
    --primary-light: #ffdd66;
    --secondary: #ffa41b;
    --accent: #ffcf3d;
    --danger: #e64a4a;
    --success: #4caf50;
    --info: #2196f3;
    --border: #f4e29a;
    --shadow: 0 14px 34px rgba(168, 120, 6, 0.16);
    --shadow-soft: 0 6px 16px rgba(168, 120, 6, 0.09);
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --focus-ring: 0 0 0 3px rgba(244, 180, 0, 0.28);
    --transition: 0.22s cubic-bezier(.4, 0, .2, 1);
}

html { scroll-behavior: smooth; }
* { margin: 0; padding: 0; box-sizing: border-box; }
.hidden { display: none !important; }

body {
    font-family: "DM Sans", "Segoe UI", Arial, sans-serif;
    background:
        radial-gradient(circle at 10% 10%, #fff5b3 0%, transparent 35%),
        radial-gradient(circle at 85% 0%, #fff0a8 0%, transparent 30%),
        var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
}

/* ─── Header ────────────────────────────────────────────────────────────── */
header {
    position: sticky;
    top: 0;
    z-index: 20;
    background:
        radial-gradient(circle at 80% -20%, rgba(255,255,255,0.55) 0%, transparent 55%),
        linear-gradient(120deg, #ffd83d 0%, #f4b400 55%, #ff9f1c 100%);
    color: var(--text);
    padding: 1rem 1.25rem;
    box-shadow: 0 10px 28px rgba(196, 140, 0, 0.28);
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
    max-width: 1100px;
    margin: 0 auto 0.9rem;
}

.topbar-right { display: flex; align-items: center; gap: 0.7rem; }

.brand-wrap { display: flex; align-items: center; gap: 0.7rem; }

.brand-logo {
    width: 46px; height: 46px;
    border-radius: 14px;
    display: grid; place-items: center;
    font-size: 1.4rem;
    background: rgba(255,255,255,0.55);
    border: 1px solid rgba(255,255,255,0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 6px 14px rgba(196, 140, 0, 0.18);
}

header h1 {
    font-family: "Nunito", sans-serif;
    font-size: 1.4rem;
    font-weight: 900;
    margin-bottom: 0.05rem;
    color: #2e2410;
    letter-spacing: -0.01em;
}

.brand-accent {
    font-weight: 700;
    color: #6b4f00;
    font-size: 0.95rem;
    margin-left: 0.2rem;
    opacity: 0.85;
}

.header-subtitle { font-size: 0.86rem; opacity: 0.85; color: #463813; }

/* User chip / sign-out */
.user-chip {
    display: flex; align-items: center; gap: 0.45rem;
    background: rgba(255,255,255,0.55);
    border: 1px solid rgba(255,255,255,0.7);
    border-radius: 999px;
    padding: 0.32rem 0.45rem 0.32rem 0.7rem;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 4px 10px rgba(196, 140, 0, 0.18);
}
.user-chip .user-icon { font-size: 0.95rem; }
.user-chip .user-name {
    font-weight: 800;
    color: #3d3414;
    font-size: 0.82rem;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.logout-btn {
    background: #fff;
    color: #c64a4a;
    border: 1px solid #ffcdd2;
    border-radius: 999px;
    padding: 0.3rem 0.7rem;
    font-size: 0.74rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: none;
}
.logout-btn:hover { background: #ffcdd2; color: #b71c1c; transform: none; box-shadow: none; }

nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.6rem;
    max-width: 1100px;
    margin: 0 auto;
}

nav button {
    background: rgba(255,255,255,0.5);
    border: 1px solid rgba(255,255,255,0.7);
    color: #3d3414;
    font-family: "Nunito", sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    padding: 0.65rem 0.4rem;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

nav button:hover, nav button.active {
    background: #ffffff;
    color: var(--primary-dark);
    box-shadow: 0 6px 14px rgba(217, 165, 0, 0.28);
    transform: translateY(-1px);
}

/* ─── Main / Layout ─────────────────────────────────────────────────────── */
main { max-width: 1100px; margin: 1.4rem auto; padding: 0 1rem; }

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.8rem;
    margin-bottom: 1.4rem;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem;
    text-align: center;
    box-shadow: var(--shadow-soft);
    transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.stat-icon { font-size: 1.6rem; margin-bottom: 0.3rem; }
.stat-val { font-family: "Nunito", sans-serif; font-size: 1.8rem; font-weight: 900; color: var(--primary-dark); }
.stat-label { font-size: 0.82rem; color: var(--muted); font-weight: 600; }

.section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.2rem 1.4rem;
    margin-bottom: 1.2rem;
    box-shadow: var(--shadow-soft);
}

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

.section h2 {
    font-family: "Nunito", sans-serif;
    color: var(--primary-dark);
    font-size: 1.25rem;
    font-weight: 800;
}

.toolbar-right { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }

.search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.search-icon {
    position: absolute; left: 0.7rem;
    color: var(--muted); font-size: 0.95rem;
    pointer-events: none;
}
.search-input {
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.45rem 0.9rem 0.45rem 2rem;
    font-family: "DM Sans", sans-serif;
    font-size: 0.9rem;
    background: var(--surface-soft);
    width: 240px;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.search-input:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus-ring); background: #fff; }

button {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #2e2410;
    border: none;
    border-radius: 999px;
    padding: 0.55rem 1.1rem;
    font-family: "DM Sans", sans-serif;
    font-weight: 700;
    font-size: 0.92rem;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(217, 165, 0, 0.28);
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}
button:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(217, 165, 0, 0.36); }
button:active { transform: translateY(0); }

/* ─── Cat Cards ─────────────────────────────────────────────────────────── */
#profiles-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

.cat-card {
    display: grid;
    grid-template-columns: 130px 1fr;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}
.cat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.cat-image {
    width: 100%; height: 180px;
    object-fit: cover;
    aspect-ratio: 9/16;
    background: #fff5c2;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.cat-card-content { padding: 0.85rem 1rem; }

.cat-card-header {
    /* Stack the name above the "fed today" badge so long names always
       fit on a single line with ellipsis when truly too long, instead
       of breaking mid-word. */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 0.4rem;
    gap: 0.3rem;
}
.cat-card-header h3 {
    font-family: "Nunito", sans-serif;
    font-weight: 800;
    font-size: 1.05rem;
    color: #3d3414;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.feeding-pill {
    font-size: 0.72rem;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-weight: 800;
    white-space: nowrap;
    border: 1px solid transparent;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.fed-full    { background: #a5d6a7; color: #1b5e20; border-color: #81c784; }
.fed-partial { background: #ffe082; color: #6b4f00; border-color: #ffca28; }
.fed-none    { background: #ffcdd2; color: #b71c1c; border-color: #ef9a9a; }

.cat-meta {
    display: flex; flex-wrap: wrap; gap: 0.3rem;
    margin-bottom: 0.5rem;
}
.cat-badge {
    background: #fff;
    border: 1px solid var(--border);
    color: #5a4a14;
    font-size: 0.72rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-weight: 600;
}
.gender-male    { background: #fff3c4; border-color: #ffe168; color: #6b5300; }
.gender-female  { background: #ffe8a8; border-color: #ffd55a; color: #7a5a00; }
.gender-unknown { background: #fff7d1; border-color: #ffe89a; color: #8a7733; }
.badge-health   { background: #fff3c4; border-color: #ffe168; color: #6b5300; }
.badge-deworm   { background: #e8f5e9; border-color: #a5d6a7; color: #1b5e20; }
.badge-overdue  { background: #ffe0e0; border-color: #ef9a9a; color: #b71c1c; }

.cat-fed-line {
    font-size: 0.82rem;
    color: #5a4a14;
    margin-bottom: 0.25rem;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.cat-notes-text {
    font-style: italic;
    color: var(--muted);
    font-size: 0.82rem;
    margin-bottom: 0.5rem;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.muted, .cat-muted { color: var(--muted); font-size: 0.82rem; }

.cat-actions {
    display: flex; flex-wrap: wrap; gap: 0.3rem;
    margin-top: 0.4rem;
}
.cat-actions button {
    padding: 0.35rem 0.7rem;
    font-size: 0.78rem;
    border-radius: 8px;
    box-shadow: none;
}

/* File Upload Styles */
.file-upload-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.file-upload-btn {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #2e2410;
    padding: 0.6rem 1.2rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    border: none;
    width: fit-content;
}

.file-upload-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(217, 165, 0, 0.3);
}

.cat-image-preview,
.proof-image-preview,
.m-cat-image-preview {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid var(--border);
    display: none;
    margin-top: 0.5rem;
    box-shadow: var(--shadow-soft);
}
.proof-image-preview { width: 110px; height: 110px; border-radius: 14px; }

.m-file-upload-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.m-file-upload-btn {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #2e2410;
    padding: 0.65rem 1rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    text-align: center;
    transition: transform 0.2s;
    border: none;
    width: fit-content;
    align-self: flex-start;
}

.edit-btn   { background: #fff3c4; color: #6b5300; }
.health-btn { background: #ffd3e8; color: #80004d; }
.delete-btn { background: #ffcdd2; color: #b71c1c; }

/* ─── Feeding modal — multi-cat checklist ──────────────────────────────── */
.feeding-cats-block {
    display: flex; flex-direction: column; gap: 0.5rem;
    margin-bottom: 0.8rem;
}
.feeding-cats-header {
    display: flex; justify-content: space-between; align-items: center;
}
.feeding-cats-label {
    font-weight: 700; color: var(--primary-dark);
}
.feeding-cats-toggle { display: flex; gap: 0.3rem; }
.feeding-toggle-btn {
    background: #fff3c4; color: #6b5300;
    border: none; border-radius: 999px;
    padding: 0.3rem 0.8rem;
    font-size: 0.78rem; font-weight: 700;
    cursor: pointer;
    box-shadow: none;
}
.feeding-toggle-btn:hover { background: #ffe89c; }
.feeding-cats-hint { color: #777; font-size: 0.78rem; }
.feeding-cat-list {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.4rem;
    max-height: 220px; overflow-y: auto;
    padding: 0.5rem;
    border: 1px solid var(--border, #e5d9bf);
    border-radius: 10px;
    background: #fffdf7;
}
.feeding-cat-option {
    display: flex; align-items: center; gap: 0.45rem;
    padding: 0.4rem 0.6rem;
    border: 1px solid #ece2c8;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.15s, border-color 0.15s;
}
.feeding-cat-option:hover { background: #fff8df; }
.feeding-cat-option input[type="checkbox"] {
    width: 18px; height: 18px; flex-shrink: 0; cursor: pointer;
    accent-color: var(--primary, #d9a500);
}
.feeding-cat-option-name { font-weight: 700; }
.feeding-cat-option-breed { color: #888; font-size: 0.75rem; }

/* ─── Feeding day-list — cat chips ─────────────────────────────────────── */
.feeding-cat-chips {
    display: flex; flex-wrap: wrap; gap: 0.3rem;
    margin-top: 0.35rem;
}
.feeding-cat-chip {
    background: #e8f5e9;
    color: #1b5e20;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
}

/* ─── Feeding Section ───────────────────────────────────────────────────── */
.feeding-summary { margin-bottom: 1rem; }
.reminder-banner {
    background: linear-gradient(135deg, #fff8c4, #ffe168);
    border: 1px solid #ffd54f;
    border-radius: var(--radius-md);
    padding: 0.7rem 1rem;
    color: #5e4b00;
    font-weight: 600;
    font-size: 0.92rem;
}
.feeding-stats {
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem;
}
.feeding-stats strong { color: var(--primary-dark); font-size: 1.1rem; }
.feeding-pct { font-weight: 700; color: var(--primary-dark); }

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

.feeding-calendar-wrap, .feeding-day-wrap {
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.feeding-day-header {
    display: flex; justify-content: space-between; align-items: center;
    gap: 0.5rem; margin-bottom: 0.6rem; flex-wrap: wrap;
}
.day-add-btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #2e2410; border: none;
    border-radius: 999px;
    padding: 0.35rem 0.8rem;
    font-size: 0.78rem; font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(217, 165, 0, 0.22);
}
.day-add-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(217, 165, 0, 0.32); }
.day-add-btn-inline {
    margin-top: 0.5rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #2e2410; border: none;
    border-radius: 999px;
    padding: 0.45rem 1rem;
    font-size: 0.82rem; font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(217, 165, 0, 0.22);
}

.calendar-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 0.7rem;
}
.calendar-header h3 {
    font-family: "Nunito", sans-serif;
    color: var(--primary-dark);
    font-weight: 800;
    font-size: 1rem;
}
.cal-nav-btn {
    width: 34px; height: 34px; padding: 0;
    border-radius: 50%;
    font-size: 1.2rem; line-height: 1;
    display: grid; place-items: center;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 4px;
}
.calendar-weekdays span {
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--muted);
    padding: 0.25rem 0;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.cal-cell {
    position: relative;
    aspect-ratio: 1 / 1;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.85rem;
    font-weight: 600;
    color: #3d3414;
}
.cal-cell:hover:not(.cal-empty) { background: var(--primary-light); border-color: var(--primary); transform: scale(1.05); }
.cal-empty { background: transparent; border: none; cursor: default; }
.cal-day { line-height: 1; }
.cal-today { border-color: var(--primary-dark); border-width: 2px; background: #fff8c4; }
.cal-selected { background: var(--primary); color: #2e2410; border-color: var(--primary-dark); box-shadow: 0 4px 10px rgba(217, 165, 0, 0.4); }
.cal-has-feedings { font-weight: 800; }
.cal-badge-count {
    position: absolute;
    bottom: 4px;
    background: var(--primary-dark);
    color: #fff;
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 999px;
    line-height: 1.2;
    font-weight: 700;
}
.cal-selected .cal-badge-count { background: #2e2410; }

.feeding-day-wrap h3 {
    font-family: "Nunito", sans-serif;
    color: var(--primary-dark);
    font-size: 0.95rem;
    font-weight: 800;
}

.feeding-log-item {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.7rem 0.85rem;
    margin-bottom: 0.55rem;
    position: relative;
}
.feeding-log-item.has-proof { border-color: #a5d6a7; background: linear-gradient(135deg, #fff 70%, #f1f8e9 100%); }
.feeding-log-main {
    display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center;
    padding-right: 1.6rem;
}
.feeding-time-badge {
    background: var(--primary-light);
    color: #6b5300;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}
.feeding-cat-name {
    color: #3d3414;
    font-size: 0.92rem;
    font-weight: 700;
    overflow-wrap: anywhere;
    word-break: break-word;
    min-width: 0;
    flex: 1 1 auto;
}
.feeding-food-badge {
    background: #fff3c4; color: #6b5300;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.feeding-log-notes {
    margin-top: 0.3rem;
    font-size: 0.8rem;
    color: var(--muted);
    font-style: italic;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Proof status pill */
.proof-pill {
    font-size: 0.7rem;
    font-weight: 800;
    border-radius: 999px;
    padding: 0.18rem 0.55rem;
    background: #c8e6c9;
    color: #1b5e20;
    border: 1px solid #a5d6a7;
}
.proof-pill.proof-pending {
    background: #ffe0e0; color: #b71c1c; border-color: #ef9a9a;
}

/* Proof block */
.proof-block {
    margin-top: 0.55rem;
    padding: 0.55rem 0.6rem;
    border: 1px dashed var(--border);
    border-radius: 12px;
    background: #fffbe6;
    display: flex;
    gap: 0.7rem;
    align-items: center;
    flex-wrap: wrap;
}
.proof-block.proof-missing { background: #fff5e0; border-color: #ffd55a; }
.proof-thumb {
    width: 88px; height: 88px;
    object-fit: cover;
    border-radius: 12px;
    border: 2px solid #a5d6a7;
    cursor: zoom-in;
    box-shadow: var(--shadow-soft);
    transition: transform 0.15s;
}
.proof-thumb:hover { transform: scale(1.04); }
.proof-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.proof-btn {
    background: #fff;
    color: #6b5300;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.32rem 0.7rem;
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: none;
}
.proof-btn:hover { background: #fff3c4; transform: none; }
.proof-btn.proof-remove { color: #b71c1c; border-color: #ffcdd2; }
.proof-btn.proof-remove:hover { background: #ffcdd2; }
.proof-add-btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #2e2410;
    border: none;
    border-radius: 999px;
    padding: 0.4rem 0.95rem;
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(217, 165, 0, 0.25);
}
.proof-missing-hint {
    color: #b06d00;
    font-size: 0.75rem;
    font-weight: 600;
    font-style: italic;
}

/* Proof viewer (lightbox) */
.proof-viewer {
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(4px);
}
.proof-viewer-content {
    background: #fff;
    margin: 4% auto;
    padding: 1rem;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 720px;
    text-align: center;
    position: relative;
    animation: modalSlide 0.25s ease;
}
.proof-viewer-content img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: var(--radius-md);
    margin-top: 0.4rem;
}
.proof-viewer-caption {
    margin-top: 0.6rem;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 600;
}
.proof-modal-info {
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.6rem 0.85rem;
    color: #5a4a14;
    font-size: 0.86rem;
}

.empty-state-small {
    padding: 1rem; text-align: center; color: var(--muted); font-size: 0.85rem;
}

/* ─── Inventory Cards ──────────────────────────────────────────────────── */
#inventory-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.8rem;
}
.item-card {
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    transition: transform 0.15s, box-shadow 0.15s;
}
.item-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.item-card.low-stock { border-color: var(--danger); background: #fff8e1; }
.item-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem; margin-bottom: 0.4rem; }
.item-card-header h3 {
    font-family: "Nunito", sans-serif;
    font-size: 0.95rem;
    color: #3d3414;
    overflow-wrap: anywhere;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-width: 0;
    flex: 1 1 auto;
}
.type-badge {
    font-size: 0.7rem;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    font-weight: 700;
    text-transform: capitalize;
}
.type-food { background: #fff3c4; color: #6b5300; }
.type-litter { background: #e0f2e9; color: #1b5e20; }
.type-toys { background: #ffd3e8; color: #80004d; }
.type-medication { background: #cce5ff; color: #0d3b66; }
.item-qty-row {
    display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}
.qty-label { color: var(--muted); font-weight: 600; }
.qty-value { font-weight: 800; color: var(--primary-dark); font-size: 1rem; }
.qty-low { color: var(--danger); }
.low-stock-tag {
    background: #ffefc4; color: #8a5a00; border: 1px solid #ffd55a;
    flex-shrink: 0;
    white-space: nowrap;
    padding: 0.15rem 0.5rem; border-radius: 999px;
    font-size: 0.7rem; font-weight: 700;
}
.item-actions { display: flex; gap: 0.4rem; }
.item-actions button { padding: 0.32rem 0.7rem; font-size: 0.78rem; border-radius: 8px; box-shadow: none; }

/* ─── Sanitation / Health Logs ─────────────────────────────────────────── */
.log-entry, .health-record-item {
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.7rem 0.9rem;
    margin-bottom: 0.5rem;
    position: relative;
}
.log-entry-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.3rem; }
.sanitation-type-badge, .health-type-badge {
    background: #fff3c4; color: #6b5300;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}
.san-litter-box { background: #e0f2e9; color: #1b5e20; }
.san-grooming   { background: #ffd3e8; color: #80004d; }
.san-bath       { background: #cce5ff; color: #0d3b66; }
.san-area-clean { background: #fff3c4; color: #6b5300; }

.htype-spay-neuter { background: #ffd3e8; color: #80004d; }
.htype-vaccination { background: #cce5ff; color: #0d3b66; }
.htype-deworming   { background: #e0f2e9; color: #1b5e20; }
.htype-weight      { background: #fff3c4; color: #6b5300; }
.htype-medication  { background: #ffe0e0; color: #b71c1c; }
.htype-general     { background: #eeeeee; color: #444; }

.log-notes, .health-notes {
    font-size: 0.85rem;
    color: #5a4a14;
    margin: 0.25rem 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.log-time { font-size: 0.75rem; color: var(--muted); }
.icon-delete-btn {
    position: absolute; top: 0.4rem; right: 0.5rem;
    background: transparent; color: var(--muted);
    width: 24px; height: 24px; padding: 0;
    border-radius: 50%;
    font-size: 0.85rem; line-height: 1;
    box-shadow: none;
}
.icon-delete-btn:hover { background: #ffcdd2; color: #b71c1c; transform: none; box-shadow: none; }

.health-cat-group {
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    margin-bottom: 0.8rem;
}
.health-cat-header { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.6rem; }
.health-avatar {
    width: 44px; height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
    box-shadow: var(--shadow-soft);
    flex-shrink: 0;
    background: #fff5c2;
}
.health-cat-header h4 {
    font-family: "Nunito", sans-serif;
    color: #3d3414; font-size: 1rem; font-weight: 800;
    flex: 1;
}
.record-count {
    background: var(--primary-light);
    color: #6b5300;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
}
.health-record-main { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; margin-bottom: 0.25rem; }
.weight-badge { background: #fff3c4; color: #6b5300; padding: 0.18rem 0.5rem; border-radius: 999px; font-size: 0.72rem; font-weight: 700; }
.health-date { color: var(--muted); font-size: 0.78rem; font-weight: 600; }
.more-records { font-size: 0.78rem; color: var(--muted); font-style: italic; padding: 0.3rem 0; text-align: center; }

/* ─── Empty States ─────────────────────────────────────────────────────── */
.empty-state {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--muted);
}
.empty-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.empty-state h3 { font-family: "Nunito", sans-serif; color: var(--primary-dark); margin-bottom: 0.4rem; }
.empty-state p { font-size: 0.9rem; }

/* ─── Modals ───────────────────────────────────────────────────────────── */
.modal {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 100;
    overflow-y: auto;
    backdrop-filter: blur(2px);
}
.modal-content {
    background: var(--surface);
    margin: 5% auto;
    padding: 1.4rem 1.5rem;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 520px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.25);
    position: relative;
    animation: modalSlide 0.25s ease;
}
@keyframes modalSlide {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.close {
    position: absolute; top: 0.7rem; right: 1rem;
    font-size: 1.6rem; line-height: 1;
    color: var(--muted);
    cursor: pointer;
    transition: color 0.15s;
}
.close:hover { color: var(--danger); }
.modal h3 {
    font-family: "Nunito", sans-serif;
    color: var(--primary-dark);
    margin-bottom: 1rem;
    font-size: 1.15rem;
    font-weight: 800;
}
form { display: flex; flex-direction: column; gap: 0.8rem; }
label {
    display: flex; flex-direction: column;
    gap: 0.3rem;
    font-weight: 600;
    color: var(--text);
    font-size: 0.88rem;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
input, textarea, select {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.6rem 0.75rem;
    font-size: 0.95rem;
    font-family: "DM Sans", sans-serif;
    background: var(--surface-soft);
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition);
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--focus-ring);
    background: #fff;
}
textarea { resize: vertical; min-height: 70px; }
small { color: var(--muted); font-size: 0.76rem; margin-top: -0.2rem; }
.req-star { color: var(--danger); font-weight: 800; margin-left: 0.15rem; }
form > button[type="submit"] {
    margin-top: 0.4rem;
    padding: 0.7rem 1rem;
    font-size: 0.95rem;
}

/* ─── Notifications ────────────────────────────────────────────────────── */
.notif-wrap { position: relative; }
.notif-btn {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    border: 1px solid rgba(255,255,255,0.55);
    color: #3d3414;
    font-size: 1.1rem;
    padding: 0;
    display: grid; place-items: center;
    box-shadow: none;
}
.notif-btn:hover { background: #fff; transform: none; }
.notif-badge {
    position: absolute; top: -4px; right: -4px;
    background: var(--danger);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    border: 2px solid #fff;
    line-height: 14px;
    text-align: center;
    display: inline-block;
}
.notif-panel {
    position: absolute; top: calc(100% + 8px); right: 0;
    width: 320px;
    max-height: 420px;
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    z-index: 50;
}
.notif-hd {
    padding: 0.7rem 0.9rem;
    font-family: "Nunito", sans-serif;
    font-weight: 800;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, #fff8c4, #ffe168);
    color: #5e4b00;
}
.notif-item {
    padding: 0.6rem 0.9rem;
    border-bottom: 1px solid #fff3c4;
    font-size: 0.82rem;
    transition: background 0.15s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: #fffbe6; }
.notif-unread { background: #fff8c4; border-left: 3px solid var(--primary); }
.notif-msg {
    color: var(--text);
    line-height: 1.35;
    margin-bottom: 0.1rem;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.notif-time { font-size: 0.7rem; color: var(--muted); }
.notif-empty { padding: 1.2rem; text-align: center; color: var(--muted); font-size: 0.82rem; }
.notif-clear-btn {
    width: 100%;
    background: none;
    color: var(--muted);
    font-size: 0.76rem;
    border-top: 1px solid var(--border);
    border-radius: 0 0 14px 14px;
    padding: 0.5rem;
    font-weight: 600;
    box-shadow: none;
}
.notif-clear-btn:hover { background: #fff8c4; color: var(--primary-dark); transform: none; box-shadow: none; }

/* ─── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .feeding-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
    .topbar { flex-direction: column; align-items: stretch; }
    header h1 { font-size: 1.15rem; }
    .header-subtitle { font-size: 0.8rem; }
    .topbar-right { justify-content: space-between; }
    nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    nav button { border-radius: 12px; }
    .summary-grid { grid-template-columns: 1fr 1fr; }
    main { padding: 0 0.7rem; }
    .section { padding: 1rem; border-radius: 14px; }
    .section-toolbar { flex-direction: column; align-items: stretch; }
    .toolbar-right { flex-direction: column; }
    .search-input { width: 100%; }
    .cat-card { grid-template-columns: 1fr; }
    .cat-image { min-height: 160px; max-height: 200px; }
    .cat-card-content { padding: 0.85rem; }
    .cat-actions button { flex: 1 1 45%; }
    .modal-content { margin: 3% auto; padding: 1rem; }
    .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
    nav { grid-template-columns: 1fr; }
    .summary-grid { grid-template-columns: 1fr; }
    .cat-card-header { flex-direction: column; gap: 0.3rem; align-items: flex-start; }
}
