/* ================================================================
   DMB FARM RECORDS - FARWA
   Version 0.3.2
================================================================ */


/* ================================================================
   GLOBAL
================================================================ */

* {
    box-sizing: border-box;
}


html {
    margin: 0;
    padding: 0;
}


body {
    margin: 0;
    padding: 0;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    background: #f4f6f5;

    color: #243029;
}


button,
input,
select,
textarea {
    font-family: inherit;
}


button {
    cursor: pointer;
}


button:disabled {
    cursor: not-allowed;

    opacity: 0.55;
}


/* ================================================================
   HEADER
================================================================ */

.app-header {
    background: #244f38;

    color: white;

    padding: 18px 24px;

    border-bottom:
        4px solid
        #d6b65b;
}


.header-inner {
    max-width: 1450px;

    margin: 0 auto;
}


.app-header h1 {
    margin: 0;

    font-size: 24px;

    font-weight: 700;

    letter-spacing: 0.5px;
}


.app-header p {
    margin: 5px 0 0;

    font-size: 14px;

    font-weight: 600;

    opacity: 0.9;
}


/* ================================================================
   AUTHENTICATION
================================================================ */

.auth-section {
    min-height:
        calc(100vh - 90px);

    display: flex;

    align-items: flex-start;

    justify-content: center;

    padding: 60px 20px;
}


.auth-card {
    width: 100%;

    max-width: 430px;

    background: white;

    border-radius: 12px;

    padding: 30px;

    box-shadow:
        0 5px 20px
        rgba(0, 0, 0, 0.08);

    border:
        1px solid
        #e2e7e4;
}


.auth-card h2 {
    margin: 0 0 8px;

    color: #244f38;
}


.auth-description {
    margin: 0 0 25px;

    line-height: 1.5;

    color: #657069;

    font-size: 14px;
}


.auth-divider {
    display: flex;

    align-items: center;

    justify-content: center;

    margin: 20px 0;

    color: #8a938e;

    font-size: 12px;
}


.auth-divider::before,
.auth-divider::after {
    content: "";

    flex: 1;

    height: 1px;

    background: #dde3df;
}


.auth-divider span {
    margin: 0 12px;
}


.auth-back-btn {
    margin-top: 12px;
}


/* ================================================================
   NAVIGATION
================================================================ */

.main-nav {
    background: white;

    border-bottom:
        1px solid
        #dde3df;

    box-shadow:
        0 2px 7px
        rgba(0, 0, 0, 0.04);

    padding: 0 20px;
}


.nav-inner {
    max-width: 1450px;

    margin: 0 auto;

    display: flex;

    align-items: center;

    flex-wrap: wrap;

    gap: 5px;
}


.main-nav button {
    border: 0;

    background: transparent;

    color: #244f38;

    font-weight: 600;

    padding: 16px 15px;

    border-bottom:
        3px solid
        transparent;
}


.main-nav button:hover {
    background: #f3f7f4;

    border-bottom-color:
        #d6b65b;
}


/* ================================================================
   ADMIN NAV BADGE
================================================================ */

#adminNavButton {
    align-items: center;

    gap: 7px;
}


.nav-alert-badge {
    align-items: center;

    justify-content: center;

    min-width: 20px;

    height: 20px;

    padding: 0 6px;

    border-radius: 20px;

    background: #d93025;

    color: white;

    font-size: 11px;

    font-weight: bold;

    line-height: 1;
}


/* ================================================================
   MAIN CONTENT
================================================================ */

.main-content {
    max-width: 1450px;

    margin: 0 auto;

    padding:
        30px 24px
        50px;
}


.content-section {
    background: transparent;
}


.section-heading {
    margin-bottom: 25px;
}


.section-heading h2 {
    margin: 0;

    color: #244f38;

    font-size: 26px;
}


.section-heading p {
    margin: 8px 0 0;

    color: #68736c;

    font-size: 14px;
}


/* ================================================================
   DASHBOARD ADMIN ALERT
================================================================ */

.dashboard-alert {
    align-items: center;

    gap: 14px;

    max-width: 680px;

    margin-bottom: 22px;

    padding: 14px 18px;

    background: #fff7e6;

    border:
        1px solid
        #e7c86b;

    border-left:
        5px solid
        #d93025;

    border-radius: 8px;

    cursor: pointer;

    transition:
        box-shadow 0.2s,
        transform 0.2s;
}


.dashboard-alert:hover {
    box-shadow:
        0 4px 14px
        rgba(0, 0, 0, 0.08);

    transform:
        translateY(-1px);
}


.dashboard-alert-icon {
    width: 32px;

    height: 32px;

    min-width: 32px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 50%;

    background: #d93025;

    color: white;

    font-weight: bold;

    font-size: 18px;
}


.dashboard-alert-text {
    flex: 1;

    display: flex;

    flex-direction: column;

    gap: 3px;
}


.dashboard-alert-text strong {
    color: #244f38;

    font-size: 14px;
}


.dashboard-alert-text span {
    color: #636b66;

    font-size: 13px;

    line-height: 1.4;
}


.dashboard-alert-count {
    min-width: 30px;

    height: 30px;

    padding: 0 8px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 20px;

    background: #d93025;

    color: white;

    font-weight: bold;

    font-size: 13px;
}


/* ================================================================
   DASHBOARD CARDS
================================================================ */

.dashboard-cards {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(
                190px,
                1fr
            )
        );

    gap: 20px;
}


.dashboard-card {
    background: white;

    border-radius: 10px;

    padding: 24px;

    border:
        1px solid
        #e1e6e3;

    box-shadow:
        0 3px 10px
        rgba(0, 0, 0, 0.04);
}


.dashboard-card .card-label {
    display: block;

    color: #657069;

    font-size: 14px;

    margin-bottom: 10px;
}


.dashboard-card strong {
    color: #244f38;

    font-size: 32px;
}


/* ================================================================
   HERDS
================================================================ */

.herd-cards {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(
                230px,
                1fr
            )
        );

    gap: 20px;
}


.herd-card {
    background: white;

    border:
        1px solid
        #e0e6e2;

    border-radius: 10px;

    padding: 22px;

    box-shadow:
        0 3px 10px
        rgba(0, 0, 0, 0.04);
}


.herd-card h3 {
    margin-top: 0;

    color: #244f38;
}


.herd-card p {
    color: #5c675f;

    line-height: 1.6;
}


/* ================================================================
   FORMS
================================================================ */

.record-form {
    max-width: 900px;

    background: white;

    padding: 28px;

    border-radius: 10px;

    border:
        1px solid
        #e0e6e2;

    box-shadow:
        0 3px 10px
        rgba(0, 0, 0, 0.04);
}


.form-grid {
    display: grid;

    grid-template-columns:
        repeat(
            2,
            minmax(
                0,
                1fr
            )
        );

    gap: 18px 22px;
}


.form-group {
    margin-bottom: 18px;
}


.form-group label {
    display: block;

    font-weight: 600;

    margin-bottom: 7px;

    color: #334139;

    font-size: 14px;
}


.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;

    border:
        1px solid
        #cdd6d0;

    border-radius: 6px;

    padding: 11px 12px;

    font-size: 14px;

    background: white;

    color: #26332b;

    outline: none;

    transition:
        border-color 0.2s,
        box-shadow 0.2s;
}


.form-group textarea {
    resize: vertical;
}


.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #4f7c61;

    box-shadow:
        0 0 0 3px
        rgba(
            79,
            124,
            97,
            0.12
        );
}


.required {
    color: #d71920;

    font-weight: bold;
}


/* ================================================================
   BUTTONS
================================================================ */

.primary-btn,
.secondary-btn,
.small-btn {
    border-radius: 6px;

    border:
        1px solid
        transparent;

    font-weight: 600;

    transition:
        background 0.2s,
        border-color 0.2s;
}


.primary-btn {
    background: #244f38;

    color: white;

    border-color: #244f38;

    padding: 11px 18px;
}


.primary-btn:hover {
    background: #193d2b;

    border-color: #193d2b;
}


.secondary-btn {
    background: white;

    color: #244f38;

    border-color: #b8c5bd;

    padding: 10px 17px;
}


.secondary-btn:hover {
    background: #f0f5f1;
}


.small-btn {
    background: #244f38;

    color: white;

    padding: 7px 10px;

    font-size: 12px;

    margin: 2px;
}


.small-btn.secondary-btn {
    background: white;

    color: #244f38;

    border-color: #afbbb3;
}


.full-width-btn {
    width: 100%;

    padding: 12px 18px;
}


/* ================================================================
   MESSAGES
================================================================ */

.form-message {
    margin-top: 15px;

    font-size: 14px;

    line-height: 1.5;

    font-weight: 600;

    color: #244f38;
}


/* ================================================================
   TOOLBAR
================================================================ */

.toolbar {
    display: flex;

    gap: 12px;

    flex-wrap: wrap;

    margin-bottom: 20px;
}


.toolbar input,
.toolbar select {
    min-width: 230px;

    border:
        1px solid
        #ccd5cf;

    border-radius: 6px;

    padding: 10px 12px;

    background: white;

    outline: none;
}


.toolbar input {
    flex: 1;
}


.toolbar input:focus,
.toolbar select:focus {
    border-color: #4f7c61;
}


/* ================================================================
   TABLES
================================================================ */

.table-wrapper {
    width: 100%;

    overflow-x: auto;

    background: white;

    border-radius: 8px;

    border:
        1px solid
        #dde4df;
}


table {
    width: 100%;

    border-collapse: collapse;

    min-width: 900px;
}


thead {
    background: #244f38;

    color: white;
}


th {
    text-align: left;

    padding: 12px 11px;

    font-size: 13px;

    white-space: nowrap;
}


td {
    padding: 11px;

    border-bottom:
        1px solid
        #e5e9e6;

    font-size: 13px;

    vertical-align: top;
}


tbody tr:hover {
    background: #f7faf8;
}


tbody tr:last-child td {
    border-bottom: 0;
}


.actions-cell {
    min-width: 170px;
}


.status-badge {
    display: inline-block;

    border-radius: 20px;

    padding: 4px 9px;

    background: #edf4ef;

    color: #244f38;

    font-weight: 600;

    font-size: 11px;
}


/* ================================================================
   PAGINATION
================================================================ */

.pagination {
    display: flex;

    justify-content: center;

    align-items: center;

    gap: 15px;

    margin-top: 20px;
}


.pagination button {
    border:
        1px solid
        #b8c5bd;

    background: white;

    color: #244f38;

    border-radius: 5px;

    padding: 8px 14px;
}


.pagination button:hover:not(:disabled) {
    background: #edf3ef;
}


#animalPageInfo {
    font-size: 14px;

    font-weight: 600;

    color: #4b584f;
}


/* ================================================================
   REPORTS
================================================================ */

.report-filters {
    display: flex;

    align-items: end;

    gap: 14px;

    flex-wrap: wrap;

    background: white;

    padding: 18px;

    border:
        1px solid
        #e0e6e2;

    border-radius: 8px;

    margin-bottom: 20px;
}


.report-filters .form-group {
    margin-bottom: 0;

    min-width: 170px;
}


/* ================================================================
   MODALS
================================================================ */

.modal {
    position: fixed;

    inset: 0;

    background:
        rgba(
            0,
            0,
            0,
            0.42
        );

    z-index: 1000;

    align-items: center;

    justify-content: center;

    padding: 20px;
}


.modal-card {
    width: 100%;

    max-width: 520px;

    max-height: 90vh;

    overflow-y: auto;

    background: white;

    border-radius: 10px;

    padding: 26px;

    position: relative;

    box-shadow:
        0 12px 40px
        rgba(
            0,
            0,
            0,
            0.2
        );
}


.large-modal {
    max-width: 1000px;
}


.modal-card h2 {
    margin-top: 0;

    color: #244f38;
}


.modal-subtitle {
    color: #657069;

    margin-bottom: 20px;
}


.modal-close {
    position: absolute;

    top: 10px;

    right: 12px;

    border: 0;

    background: transparent;

    font-size: 28px;

    color: #5d675f;

    line-height: 1;
}


/* ================================================================
   EMPTY STATE
================================================================ */

.empty-state {
    background: white;

    padding: 30px;

    border:
        1px solid
        #e0e6e2;

    border-radius: 8px;

    text-align: center;

    color: #68736c;
}


/* ================================================================
   USER APPROVALS
================================================================ */

.admin-user-section {
    margin-bottom: 35px;
}


.admin-section-title {
    display: flex;

    align-items: center;

    gap: 10px;

    margin-bottom: 12px;
}


.admin-section-title h3 {
    margin: 0;

    color: #244f38;
}


.count-badge {
    display: inline-flex;

    align-items: center;

    justify-content: center;

    min-width: 28px;

    height: 28px;

    padding: 0 8px;

    border-radius: 20px;

    background: #244f38;

    color: white;

    font-size: 12px;

    font-weight: bold;
}


.approval-badge {
    display: inline-block;

    padding: 5px 9px;

    border-radius: 20px;

    font-size: 11px;

    font-weight: bold;
}


.approval-badge.approved {
    background: #e4f2e8;

    color: #244f38;
}


.approval-badge.pending {
    background: #fff4d6;

    color: #7a5b00;
}


.revoke-btn {
    background: white;

    color: #9c2f2f;

    border:
        1px solid
        #d9aaaa;
}


.revoke-btn:hover {
    background: #fff2f2;
}


.current-user-label {
    font-size: 12px;

    font-weight: 600;

    color: #68736c;
}


/* ================================================================
   RESPONSIVE
================================================================ */

@media
(max-width: 800px) {

    .app-header {
        padding:
            15px 18px;
    }


    .app-header h1 {
        font-size: 20px;
    }


    .main-content {
        padding:
            22px 14px
            40px;
    }


    .nav-inner {
        padding: 4px 0;
    }


    .main-nav button {
        padding:
            12px 10px;

        font-size: 13px;
    }


    .form-grid {
        grid-template-columns:
            1fr;
    }


    .dashboard-cards {
        grid-template-columns:
            repeat(
                2,
                minmax(
                    0,
                    1fr
                )
            );
    }


    .dashboard-alert {
        max-width: 100%;
    }


    .auth-section {
        padding:
            35px 15px;
    }


    .auth-card {
        padding: 22px;
    }


    .toolbar {
        flex-direction: column;
    }


    .toolbar input,
    .toolbar select {
        width: 100%;

        min-width: 0;
    }


    .report-filters {
        align-items: stretch;

        flex-direction: column;
    }


    .report-filters .form-group {
        width: 100%;
    }


    .report-filters button {
        width: 100%;
    }

}


@media
(max-width: 500px) {

    .dashboard-cards {
        grid-template-columns:
            1fr;
    }


    .section-heading h2 {
        font-size: 22px;
    }


    .app-header h1 {
        font-size: 18px;
    }


    .dashboard-alert {
        align-items: flex-start;
    }


    .dashboard-alert-count {
        min-width: 26px;

        height: 26px;
    }

}