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

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f5f7f9;
    color: #17212b;
    min-height: 100vh;
}


/* =========================
   NAVIGATION
========================= */

.navbar {
    width: 100%;
    background: #ffffff;
    border-bottom: 1px solid #e4e8ec;

    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    width: min(1200px, 92%);
    min-height: 70px;

    margin: auto;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;
}

.logo {
    color: #17212b;
    text-decoration: none;

    font-size: 17px;
    font-weight: 700;

    display: flex;
    align-items: center;

    gap: 8px;
}

.nav-links {
    display: flex;
    align-items: center;

    gap: 5px;
}

.nav-links a {
    color: #5f6b76;
    text-decoration: none;

    font-size: 13px;

    padding: 9px 12px;

    border-radius: 8px;

    transition: 0.2s ease;
}

.nav-links a:hover {
    background: #f1f3f5;
    color: #17212b;
}

.nav-links a.active {
    background: #17212b;
    color: #ffffff;
}

.menu-button {
    display: none;

    width: 42px;
    height: 42px;

    border: none;
    border-radius: 9px;

    background: #eef2f5;

    font-size: 20px;

    cursor: pointer;
}


/* =========================
   PAGE
========================= */

.page-container {
    width: min(1100px, 92%);
    margin: auto;

    padding-bottom: 60px;
}

.page-header {
    margin: 35px 0 25px;

    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 20px;
}

.page-label {
    color: #78838d;

    font-size: 11px;
    font-weight: 700;

    letter-spacing: 1.2px;
}

.page-header h1 {
    font-size: 28px;

    margin: 7px 0;
}

.page-header p {
    color: #6d7984;

    font-size: 14px;

    line-height: 1.6;
}


/* =========================
   BUTTONS
========================= */

.primary-button,
.secondary-button {
    border: none;

    border-radius: 10px;

    padding: 12px 17px;

    font-size: 14px;
    font-weight: 600;

    cursor: pointer;

    transition: 0.2s ease;
}

.primary-button {
    background: #17212b;
    color: #ffffff;
}

.secondary-button {
    background: #edf1f4;
    color: #17212b;
}

.primary-button:hover,
.secondary-button:hover {
    transform: translateY(-1px);
    opacity: 0.9;
}


/* =========================
   ANIMAL SELECTOR
========================= */

.animal-selector-card {
    background: #ffffff;

    border: 1px solid #e3e8ec;

    border-radius: 15px;

    padding: 18px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 15px;
}

.selector-info {
    flex: 1;
}

.selector-info > span {
    display: block;

    color: #78838d;

    font-size: 9px;
    font-weight: 700;

    letter-spacing: 1px;

    margin-bottom: 5px;
}

.selector-info strong {
    display: block;

    font-size: 16px;

    margin-bottom: 4px;
}

.selector-info p {
    color: #737e88;

    font-size: 11px;
}

#animalFilter {
    min-width: 220px;

    height: 43px;

    border: 1px solid #d8dfe4;

    border-radius: 9px;

    background: #ffffff;

    padding: 0 12px;

    font-size: 13px;

    outline: none;
}

#animalFilter:focus {
    border-color: #7c8791;
}


/* =========================
   SUMMARY
========================= */

.summary-grid {
    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap: 12px;

    margin-bottom: 30px;
}

.summary-card {
    background: #ffffff;

    border: 1px solid #e3e8ec;

    border-radius: 14px;

    padding: 16px;

    display: flex;
    align-items: center;

    gap: 11px;
}

.summary-icon {
    width: 42px;
    height: 42px;

    background: #f0f3f5;

    border-radius: 10px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 20px;
}

.summary-card span {
    display: block;

    color: #737e88;

    font-size: 10px;

    margin-bottom: 4px;
}

.summary-card strong {
    font-size: 20px;
}


/* =========================
   CONTENT
========================= */

.content-section {
    margin-top: 10px;

    margin-bottom: 30px;
}

.section-heading {
    margin-bottom: 15px;
}

.section-heading h2 {
    font-size: 20px;

    margin-bottom: 4px;
}

.section-heading p {
    color: #737e88;

    font-size: 12px;
}


/* =========================
   GROWTH CARD
========================= */

.growth-card {
    background: #ffffff;

    border: 1px solid #e3e8ec;

    border-radius: 15px;

    padding: 20px;
}

.growth-top {
    display: flex;

    justify-content: space-between;

    gap: 20px;

    margin-bottom: 17px;
}

.growth-top span {
    display: block;

    color: #78838d;

    font-size: 9px;
    font-weight: 700;

    letter-spacing: 0.8px;

    margin-bottom: 5px;
}

.growth-top strong {
    font-size: 25px;
}

.growth-change {
    text-align: right;
}

.growth-change strong {
    font-size: 16px;
}

.progress-track {
    width: 100%;

    height: 12px;

    background: #edf0f2;

    border-radius: 20px;

    overflow: hidden;
}

.progress-bar {
    width: 0;

    height: 100%;

    background: #17212b;

    border-radius: 20px;

    transition:
        width 0.6s ease;
}

.growth-details {
    display: flex;

    justify-content: space-between;

    gap: 15px;

    margin-top: 10px;

    color: #737e88;

    font-size: 10px;
}


/* =========================
   WEIGHT HISTORY
========================= */

.records-list {
    display: flex;

    flex-direction: column;

    gap: 10px;
}

.weight-record {
    background: #ffffff;

    border: 1px solid #e3e8ec;

    border-radius: 13px;

    padding: 16px;

    display: flex;

    align-items: center;

    gap: 15px;
}

.weight-date {
    min-width: 95px;

    text-align: center;

    background: #f0f3f5;

    border-radius: 10px;

    padding: 10px;
}

.weight-date span {
    display: block;

    color: #78838d;

    font-size: 9px;

    margin-bottom: 3px;
}

.weight-date strong {
    font-size: 12px;
}

.weight-main {
    flex: 1;
}

.weight-main h3 {
    font-size: 14px;

    margin-bottom: 4px;
}

.weight-main p {
    color: #737e88;

    font-size: 10px;
}

.weight-value {
    text-align: right;
}

.weight-value span {
    display: block;

    color: #78838d;

    font-size: 9px;

    margin-bottom: 4px;
}

.weight-value strong {
    font-size: 17px;
}

.delete-weight {
    border: none;

    background: #f5eeee;

    color: #7c4545;

    border-radius: 8px;

    padding: 8px 10px;

    font-size: 10px;

    cursor: pointer;
}


/* =========================
   EMPTY STATE
========================= */

.empty-state {
    display: none;

    background: #ffffff;

    border: 1px solid #e3e8ec;

    border-radius: 15px;

    text-align: center;

    padding: 50px 20px;
}

.empty-icon {
    font-size: 42px;

    margin-bottom: 12px;
}

.empty-state h3 {
    font-size: 18px;

    margin-bottom: 6px;
}

.empty-state p {
    color: #737e88;

    font-size: 13px;

    line-height: 1.5;

    margin-bottom: 18px;
}


/* =========================
   MODAL
========================= */

.modal {
    position: fixed;

    inset: 0;

    background:
        rgba(10, 17, 23, 0.55);

    display: none;

    align-items: center;
    justify-content: center;

    padding: 20px;

    z-index: 1000;
}

.modal.open {
    display: flex;
}

.modal-content {
    width: min(560px, 100%);

    max-height: 90vh;

    overflow-y: auto;

    background: #ffffff;

    border-radius: 18px;

    padding: 25px;
}

.modal-header {
    display: flex;

    justify-content: space-between;

    gap: 15px;

    margin-bottom: 22px;
}

.modal-header h2 {
    font-size: 21px;

    margin-bottom: 5px;
}

.modal-header p {
    color: #74808b;

    font-size: 13px;
}

.close-button {
    width: 36px;
    height: 36px;

    border: none;

    border-radius: 50%;

    background: #eef2f5;

    font-size: 22px;

    cursor: pointer;
}


/* =========================
   FORM
========================= */

.weight-form {
    display: flex;

    flex-direction: column;

    gap: 15px;
}

.form-group {
    display: flex;

    flex-direction: column;

    gap: 7px;
}

.form-group label {
    font-size: 12px;

    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;

    border: 1px solid #d8dfe4;

    border-radius: 9px;

    padding: 11px 12px;

    background: #ffffff;

    font-family: inherit;

    font-size: 13px;

    outline: none;
}

.form-group input,
.form-group select {
    height: 43px;
}

.form-group textarea {
    resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #7c8791;
}

.form-actions {
    display: flex;

    justify-content: flex-end;

    gap: 10px;

    margin-top: 5px;
}


/* =========================
   TABLET
========================= */

@media (max-width: 900px) {

    .menu-button {
        display: block;
    }

    .nav-links {
        position: absolute;

        top: 70px;

        left: 0;
        right: 0;

        background: #ffffff;

        border-bottom: 1px solid #e4e8ec;

        display: none;

        flex-direction: column;

        align-items: stretch;

        padding: 10px 5%;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        padding: 12px;
    }

    .summary-grid {
        grid-template-columns:
            repeat(2, 1fr);
    }

}


/* =========================
   MOBILE
========================= */

@media (max-width: 600px) {

    .page-header {
        flex-direction: column;

        align-items: stretch;

        margin-top: 25px;
    }

    .page-header h1 {
        font-size: 24px;
    }

    .page-header .primary-button {
        width: 100%;
    }

    .animal-selector-card {
        flex-direction: column;

        align-items: stretch;
    }

    #animalFilter {
        width: 100%;
        min-width: 0;
    }

    .summary-grid {
        grid-template-columns:
            1fr 1fr;

        gap: 10px;
    }

    .summary-card {
        padding: 13px;
    }

    .summary-icon {
        width: 37px;
        height: 37px;

        font-size: 18px;
    }

    .summary-card strong {
        font-size: 17px;
    }

    .growth-top {
        flex-direction: column;
    }

    .growth-change {
        text-align: left;
    }

    .growth-details {
        flex-direction: column;

        gap: 5px;
    }

    .weight-record {
        align-items: flex-start;

        flex-wrap: wrap;
    }

    .weight-date {
        min-width: 75px;
    }

    .weight-main {
        min-width: 130px;
    }

    .weight-value {
        margin-left: auto;
    }

    .delete-weight {
        width: 100%;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .form-actions button {
        width: 100%;
    }

}

/* =========================
   POLISHED MOTION
========================= */
@keyframes lmFadeUp { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }
.page-container > section, .content-section, .form-card, .history-card, .records-section, .profile-card, .summary-card, .animal-card, .feed-card, .record-card, .alert-card { animation: lmFadeUp .45s ease both; }
button, a, .action-card, .animal-card, .feed-card, .record-card, .summary-card { transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease; }
button:hover, .action-card:hover, .animal-card:hover, .feed-card:hover, .record-card:hover, .summary-card:hover { transform: translateY(-2px); }
.lm-toast { position:fixed; right:20px; bottom:20px; z-index:9999; padding:12px 16px; border-radius:10px; background:#17212b; color:#fff; font-size:12px; opacity:0; transform:translateY(12px); transition:.3s ease; box-shadow:0 10px 30px rgba(0,0,0,.16); }
.lm-toast.show { opacity:1; transform:translateY(0); }
.lm-toast.success { background:#1f6b45; } .lm-toast.warning { background:#8a6118; }
.profile-header-actions { display:flex; gap:8px; align-items:center; }
.secondary-button { border:1px solid #dce2e6; background:#fff; color:#17212b; padding:11px 15px; border-radius:9px; font:700 11px Arial,sans-serif; cursor:pointer; text-decoration:none; }
@media(max-width:600px){.profile-header-actions{width:100%;}.profile-header-actions button{flex:1}.lm-toast{left:15px;right:15px;bottom:15px;text-align:center;}}
