/* =========================================================
   SMART NURSERY TRACKING
   SEEDLINGS PAGE
   Page-specific styles only
========================================================= */


/* =========================================================
   PAGE WRAPPER
========================================================= */

.seedlings-content {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}


/* =========================================================
   INTRO / PAGE HEADER
========================================================= */

.seedlings-intro {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.seedlings-intro > div {
    min-width: 0;
}

.seedlings-breadcrumb {
    margin: 0 0 8px;
    color: #16A34A;
    font-size: 13px;
    font-weight: 600;
}

.seedlings-intro h2 {
    margin: 0 0 7px;
    color: #334155;
    font-size: 25px;
    font-weight: 700;
    line-height: 1.25;
}

.seedlings-intro p:not(.seedlings-breadcrumb) {
    margin: 0;
    color: #64748B;
    font-size: 14px;
    line-height: 1.6;
}


/* =========================================================
   ADD SEEDLING BUTTON
========================================================= */

.seedlings-add-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    min-height: 44px;
    padding: 0 18px;

    border: none;
    border-radius: 9px;

    background: #14532D;
    color: #ffffff;

    font-family: inherit;
    font-size: 14px;
    font-weight: 600;

    cursor: pointer;
    transition:
        background 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;

    white-space: nowrap;
}

.seedlings-add-button span {
    font-size: 19px;
    line-height: 1;
}

.seedlings-add-button:hover {
    background: #166534;
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(20, 83, 45, 0.16);
}


/* =========================================================
   STATISTICS
========================================================= */

.seedlings-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

.seedlings-stat-card {
    display: flex;
    align-items: center;
    gap: 15px;

    min-width: 0;
    padding: 20px;

    background: #ffffff;
    border: 1px solid #E2E8F0;
    border-radius: 12px;

    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.035);
}

.seedlings-stat-icon {
    width: 46px;
    height: 46px;
    min-width: 46px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 11px;

    font-size: 20px;
    font-weight: 700;
}

.seedlings-green {
    background: #DCFCE7;
    color: #15803D;
}

.seedlings-healthy {
    background: #DCFCE7;
    color: #16A34A;
}

.seedlings-warning {
    background: #FEF3C7;
    color: #D97706;
}

.seedlings-danger {
    background: #FEE2E2;
    color: #DC2626;
}

.seedlings-stat-card > div:last-child {
    min-width: 0;
}

.seedlings-stat-card span {
    display: block;
    margin-bottom: 4px;

    color: #64748B;
    font-size: 12px;
    font-weight: 500;
}

.seedlings-stat-card strong {
    display: block;

    color: #334155;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
}

.seedlings-stat-card small {
    display: block;
    margin-top: 5px;

    color: #94A3B8;
    font-size: 11px;
}


/* =========================================================
   RECORDS CARD
========================================================= */

.seedlings-records {
    width: 100%;
    overflow: hidden;

    background: #ffffff;
    border: 1px solid #E2E8F0;
    border-radius: 12px;

    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.035);
}


/* =========================================================
   RECORD HEADER
========================================================= */

.seedlings-record-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    padding: 22px 24px;

    border-bottom: 1px solid #E2E8F0;
}

.seedlings-record-header h3 {
    margin: 0 0 5px;

    color: #334155;
    font-size: 17px;
    font-weight: 700;
}

.seedlings-record-header p {
    margin: 0;

    color: #94A3B8;
    font-size: 12px;
}

.seedlings-export-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 38px;
    padding: 0 14px;

    border: 1px solid #CBD5E1;
    border-radius: 8px;

    background: #ffffff;
    color: #334155;

    font-family: inherit;
    font-size: 13px;
    font-weight: 600;

    cursor: pointer;
    transition: all 0.2s ease;
}

.seedlings-export-button:hover {
    border-color: #16A34A;
    color: #15803D;
    background: #F0FDF4;
}


/* =========================================================
   FILTERS
========================================================= */

.seedlings-filters {
    display: grid;
    grid-template-columns: minmax(220px, 1.6fr) repeat(3, minmax(145px, 1fr));
    gap: 12px;

    padding: 18px 24px;

    background: #F8FAF7;
    border-bottom: 1px solid #E2E8F0;
}

.seedlings-search {
    position: relative;
    min-width: 0;
}

.seedlings-search span {
    position: absolute;
    left: 13px;
    top: 50%;

    transform: translateY(-50%);

    color: #94A3B8;
    font-size: 18px;
    pointer-events: none;
}

.seedlings-search input,
.seedlings-filters select {
    width: 100%;
    height: 40px;

    box-sizing: border-box;

    border: 1px solid #CBD5E1;
    border-radius: 8px;

    background: #ffffff;
    color: #334155;

    font-family: inherit;
    font-size: 13px;

    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.seedlings-search input {
    padding: 0 13px 0 38px;
}

.seedlings-filters select {
    padding: 0 12px;
    cursor: pointer;
}

.seedlings-search input::placeholder {
    color: #94A3B8;
}

.seedlings-search input:focus,
.seedlings-filters select:focus {
    border-color: #16A34A;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.08);
}


/* =========================================================
   TABLE
========================================================= */

.seedlings-table-container {
    width: 100%;
    overflow-x: auto;
}

.seedlings-table {
    width: 100%;
    min-width: 1050px;

    border-collapse: collapse;
    border-spacing: 0;
}

.seedlings-table th {
    padding: 13px 16px;

    background: #F8FAF7;

    border-bottom: 1px solid #E2E8F0;

    color: #64748B;

    font-size: 11px;
    font-weight: 700;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.03em;

    white-space: nowrap;
}

.seedlings-table td {
    padding: 16px;

    border-bottom: 1px solid #F1F5F9;

    color: #475569;

    font-size: 13px;
    white-space: nowrap;
}

.seedlings-table tbody tr {
    transition: background 0.15s ease;
}

.seedlings-table tbody tr:hover {
    background: #FAFDFB;
}

.seedlings-table tbody tr:last-child td {
    border-bottom: none;
}

.seedlings-table td strong {
    color: #334155;
    font-size: 12px;
    font-weight: 700;
}


/* =========================================================
   SPECIES
========================================================= */

.seedlings-species {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    color: #334155;
    font-weight: 600;
}


/* =========================================================
   GROWTH STAGE
========================================================= */

.seedlings-stage {
    display: inline-flex;
    align-items: center;

    padding: 5px 9px;

    border-radius: 20px;

    background: #F1F5F9;
    color: #475569;

    font-size: 11px;
    font-weight: 600;
}


/* =========================================================
   HEALTH STATUS
========================================================= */

.seedlings-health {
    display: inline-flex;
    align-items: center;
    gap: 5px;

    padding: 5px 9px;

    border-radius: 20px;

    font-size: 11px;
    font-weight: 600;
}

.seedlings-health::before {
    content: "";
    width: 6px;
    height: 6px;

    border-radius: 50%;
}

.health-good {
    background: #DCFCE7;
    color: #15803D;
}

.health-good::before {
    background: #16A34A;
}

.health-warning {
    background: #FEF3C7;
    color: #B45309;
}

.health-warning::before {
    background: #F59E0B;
}

.health-danger {
    background: #FEE2E2;
    color: #B91C1C;
}

.health-danger::before {
    background: #EF4444;
}


/* =========================================================
   VIEW BUTTON
========================================================= */

.seedlings-view {
    padding: 6px 10px;

    border: 1px solid #BBF7D0;
    border-radius: 7px;

    background: #F0FDF4;
    color: #15803D;

    font-family: inherit;
    font-size: 11px;
    font-weight: 600;

    cursor: pointer;

    transition: all 0.2s ease;
}

.seedlings-view:hover {
    background: #DCFCE7;
    border-color: #86EFAC;
}


/* =========================================================
   TABLE FOOTER
========================================================= */

.seedlings-table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    padding: 17px 24px;

    border-top: 1px solid #E2E8F0;
}

.seedlings-table-footer > span {
    color: #94A3B8;
    font-size: 12px;
}


/* =========================================================
   PAGINATION
========================================================= */

.seedlings-pagination {
    display: flex;
    align-items: center;
    gap: 5px;
}

.seedlings-pagination button {
    width: 32px;
    height: 32px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: 1px solid #E2E8F0;
    border-radius: 7px;

    background: #ffffff;
    color: #64748B;

    font-family: inherit;
    font-size: 12px;
    font-weight: 600;

    cursor: pointer;

    transition: all 0.2s ease;
}

.seedlings-pagination button:hover:not(:disabled) {
    border-color: #16A34A;
    color: #15803D;
    background: #F0FDF4;
}

.seedlings-pagination button.active {
    border-color: #14532D;
    background: #14532D;
    color: #ffffff;
}

.seedlings-pagination button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}


/* =========================================================
   DASHBOARD FOOTER
========================================================= */

.seedlings-content .dashboard-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-top: 28px;
    padding: 20px 0;

    border-top: 1px solid #E2E8F0;
}

.seedlings-content .dashboard-footer p,
.seedlings-content .dashboard-footer span {
    margin: 0;

    color: #94A3B8;
    font-size: 11px;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1200px) {

    .seedlings-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .seedlings-filters {
        grid-template-columns: 1fr 1fr;
    }

    .seedlings-search {
        grid-column: 1 / -1;
    }

}


@media (max-width: 800px) {

    .seedlings-intro {
        align-items: flex-start;
        flex-direction: column;
    }

    .seedlings-add-button {
        width: 100%;
    }

    .seedlings-record-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .seedlings-export-button {
        width: 100%;
    }

}


@media (max-width: 600px) {

    .seedlings-stats {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .seedlings-filters {
        grid-template-columns: 1fr;
        padding: 15px;
    }

    .seedlings-search {
        grid-column: auto;
    }

    .seedlings-record-header {
        padding: 18px;
    }

    .seedlings-table-footer {
        align-items: flex-start;
        flex-direction: column;
        padding: 15px 18px;
    }

    .seedlings-pagination {
        width: 100%;
        justify-content: flex-end;
    }

}


@media (max-width: 450px) {

    .seedlings-intro h2 {
        font-size: 21px;
    }

    .seedlings-stat-card {
        padding: 16px;
    }

    .seedlings-stat-card strong {
        font-size: 20px;
    }

    .seedlings-table-footer {
        font-size: 11px;
    }

}

/* =========================================================
   ADD SEEDLING MODAL
========================================================= */

.seedling-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;

    display: none;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background: rgba(15, 23, 42, 0.55);

    backdrop-filter: blur(3px);
}

.seedling-modal-overlay.active {
    display: flex;
}


.seedling-modal {
    width: 100%;
    max-width: 720px;
    max-height: 90vh;

    overflow-y: auto;

    background: #ffffff;

    border-radius: 14px;

    box-shadow:
        0 25px 60px rgba(15, 23, 42, 0.20);

    animation: seedlingModalIn 0.2s ease;
}


@keyframes seedlingModalIn {

    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

}


/* HEADER */

.seedling-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;

    padding: 24px;

    border-bottom: 1px solid #E2E8F0;
}

.seedling-modal-label {
    display: block;

    margin-bottom: 7px;

    color: #16A34A;

    font-size: 10px;
    font-weight: 700;

    letter-spacing: 0.08em;
}

.seedling-modal-header h2 {
    margin: 0 0 6px;

    color: #334155;

    font-size: 21px;
    font-weight: 700;
}

.seedling-modal-header p {
    margin: 0;

    color: #94A3B8;

    font-size: 12px;
}


.seedling-modal-close {
    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border: none;
    border-radius: 8px;

    background: #F1F5F9;
    color: #64748B;

    font-size: 22px;
    line-height: 1;

    cursor: pointer;

    transition: all 0.2s ease;
}

.seedling-modal-close:hover {
    background: #FEE2E2;
    color: #DC2626;
}


/* FORM */

#seedlingForm {
    padding: 24px;
}

.seedling-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}


.seedling-form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.seedling-form-group label {
    color: #475569;

    font-size: 12px;
    font-weight: 600;
}

.seedling-form-group input,
.seedling-form-group select {
    width: 100%;
    height: 43px;

    box-sizing: border-box;

    padding: 0 12px;

    border: 1px solid #CBD5E1;
    border-radius: 8px;

    background: #ffffff;
    color: #334155;

    font-family: inherit;
    font-size: 13px;

    outline: none;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.seedling-form-group input:focus,
.seedling-form-group select:focus {
    border-color: #16A34A;

    box-shadow:
        0 0 0 3px rgba(22, 163, 74, 0.08);
}

.seedling-form-group input::placeholder {
    color: #94A3B8;
}


/* ACTIONS */

.seedling-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;

    margin-top: 24px;
    padding-top: 20px;

    border-top: 1px solid #E2E8F0;
}


.seedling-cancel-button,
.seedling-save-button {
    min-height: 42px;

    padding: 0 17px;

    border-radius: 8px;

    font-family: inherit;
    font-size: 13px;
    font-weight: 600;

    cursor: pointer;

    transition: all 0.2s ease;
}


.seedling-cancel-button {
    border: 1px solid #CBD5E1;

    background: #ffffff;
    color: #475569;
}

.seedling-cancel-button:hover {
    background: #F8FAFC;
}


.seedling-save-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;

    border: none;

    background: #14532D;
    color: #ffffff;
}

.seedling-save-button:hover {
    background: #166534;
}

.seedling-save-button span {
    font-size: 17px;
}


/* MOBILE */

@media (max-width: 600px) {

    .seedling-modal-overlay {
        padding: 12px;
    }

    .seedling-modal {
        max-height: 94vh;
        border-radius: 12px;
    }

    .seedling-modal-header {
        padding: 19px;
    }

    #seedlingForm {
        padding: 19px;
    }

    .seedling-form-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .seedling-modal-actions {
        flex-direction: column-reverse;
    }

    .seedling-cancel-button,
    .seedling-save-button {
        width: 100%;
    }

}

/* =========================================================
   VIEW SEEDLING MODAL
========================================================= */

.seedling-details-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;

    display: none;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(3px);
}

.seedling-details-modal.active {
    display: flex;
}

.seedling-details-box {
    width: 100%;
    max-width: 650px;
    max-height: 90vh;

    overflow-y: auto;

    background: #ffffff;
    border-radius: 14px;

    box-shadow:
        0 25px 60px rgba(15, 23, 42, 0.20);
}

.seedling-details-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;

    padding: 24px;

    border-bottom: 1px solid #E2E8F0;
}

.seedling-details-header small {
    display: block;

    margin-bottom: 6px;

    color: #16A34A;

    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.seedling-details-header h2 {
    margin: 0 0 5px;

    color: #334155;

    font-size: 21px;
}

.seedling-details-header p {
    margin: 0;

    color: #94A3B8;

    font-size: 12px;
}

.seedling-details-close {
    width: 34px;
    height: 34px;

    border: none;
    border-radius: 8px;

    background: #F1F5F9;
    color: #64748B;

    font-size: 22px;

    cursor: pointer;
}

.seedling-details-close:hover {
    background: #FEE2E2;
    color: #DC2626;
}


/* DETAILS */

.seedling-details-body {
    padding: 24px;
}

.seedling-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.seedling-detail-item {
    padding: 15px;

    border: 1px solid #E2E8F0;
    border-radius: 9px;

    background: #F8FAF7;
}

.seedling-detail-item span {
    display: block;

    margin-bottom: 6px;

    color: #94A3B8;

    font-size: 10px;
    font-weight: 600;

    text-transform: uppercase;
}

.seedling-detail-item strong {
    color: #334155;

    font-size: 14px;
}


/* ACTIONS */

.seedling-details-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;

    margin-top: 22px;
    padding-top: 20px;

    border-top: 1px solid #E2E8F0;
}

.seedling-edit-button,
.seedling-delete-button {
    min-height: 40px;

    padding: 0 15px;

    border-radius: 8px;

    font-family: inherit;
    font-size: 12px;
    font-weight: 600;

    cursor: pointer;
}

.seedling-edit-button {
    border: none;

    background: #14532D;
    color: #ffffff;
}

.seedling-edit-button:hover {
    background: #166534;
}

.seedling-delete-button {
    border: 1px solid #FECACA;

    background: #FEF2F2;
    color: #DC2626;
}

.seedling-delete-button:hover {
    background: #FEE2E2;
}


/* MOBILE */

@media (max-width: 600px) {

    .seedling-details-modal {
        padding: 12px;
    }

    .seedling-details-header,
    .seedling-details-body {
        padding: 18px;
    }

    .seedling-details-grid {
        grid-template-columns: 1fr;
    }

    .seedling-details-actions {
        flex-direction: column;
    }

    .seedling-edit-button,
    .seedling-delete-button {
        width: 100%;
    }

}