/* ==========================================================================
   Farms page — corporate look matching dashboard/settings
   (navy #10243b / #004AF7, green accent #3BD304, white cards)
   ========================================================================== */

body {
    background-color: #f6f8fb;
    overflow-x: hidden;
    font-family: 'Inter', sans-serif;
    color: #10243b;
}

/* --- Top bar / profile (shared pattern) --- */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.breadcrumb-nav {
    font-size: 14px;
    color: #94a3b8;
}

.breadcrumb-nav a {
    color: #94a3b8;
    text-decoration: none;
}

.breadcrumb-nav a:hover { color: #004AF7; }

.profile-container {
    position: relative;
    display: inline-block;
}

.profile-avatar {
    width: 40px;
    height: 40px;
    background: #004AF7;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 4px 10px rgba(13, 33, 66, 0.18);
    transition: 0.2s;
}

.profile-avatar:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(13, 33, 66, 0.25);
}

.profile-dropdown {
    position: absolute;
    top: 50px;
    right: 0;
    width: 180px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 1000;
    border: 1px solid #e2e8f0;
}

.profile-dropdown.show { display: flex; }

.profile-dropdown .dropdown-item {
    padding: 12px 15px;
    color: #10243b;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-dropdown .dropdown-item:hover {
    background: #f3f8f6;
    text-decoration: none;
}

.profile-dropdown .dropdown-item:last-child:hover {
    background: #fef2f2;
    color: #ef4444;
}

.profile-dropdown .dropdown-item i {
    font-size: 14px;
    color: #64748b;
}

/* --- Page header --- */
.farms-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.farms-header h1 {
    font-size: 26px;
    font-weight: 700;
    color: #10243b;
    margin: 0 0 4px 0;
}

.farms-header .farms-subtitle {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}

.btn-create-farm {
    background-color: #004AF7;
    color: #fff;
    padding: 12px 22px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-create-farm:hover {
    background-color: #0d3a72;
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(13, 33, 66, 0.22);
}

/* --- Farm cards grid --- */
.farms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.farm-card {
    background: #fff;
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    border: 1px solid #e2e8f0;
    border-top: 3px solid #3BD304;
    transition: all 0.25s ease;
    cursor: pointer;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    color: inherit;
}

.farm-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(13, 33, 66, 0.12);
    border-color: #d6e5d3;
    border-top-color: #56a832;
    text-decoration: none;
    color: inherit;
}

.farm-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.farm-card-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.farm-icon {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    background: #eef9ea;
    color: #56a832;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
}

.farm-name {
    font-size: 16.5px;
    font-weight: 700;
    color: #10243b;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.delete-farm-btn {
    color: #cbd5e1;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 8px;
    transition: 0.2s;
    flex-shrink: 0;
}

.delete-farm-btn:hover {
    background-color: #fee2e2;
    color: #dc2626;
}

.farm-location {
    font-size: 13px;
    color: #64748b;
    margin: 12px 0 16px;
    display: flex;
    align-items: center;
    gap: 7px;
}

.farm-location i { color: #94a3b8; }

.farm-stats {
    display: flex;
    gap: 10px;
    font-size: 12.5px;
    font-weight: 600;
    color: #334155;
    margin-top: auto;
}

.farm-stat {
    background: #f4fbf4;
    padding: 7px 14px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 7px;
}

.farm-stat--blue { background: #eaf1ff; }

.farm-stat .stat-ico-blue { color: #004AF7; }
.farm-stat .stat-ico-green { color: #56a832; }

.farm-card-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #f1f5f9;
    font-size: 12px;
    font-weight: 600;
    color: #004AF7;
}

.farm-card:hover .farm-card-footer i { transform: translateX(3px); }
.farm-card-footer i { transition: transform 0.2s; }

/* --- Empty / loading states --- */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: 14px;
    border: 1px dashed #cbd8e4;
}

.empty-state .empty-icon {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    background: #eef9ea;
    color: #56a832;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin: 0 auto 18px;
}

.empty-state h3 {
    font-size: 17px;
    font-weight: 700;
    color: #10243b;
    margin-bottom: 8px;
}

.empty-state p {
    color: #64748b;
    font-size: 13.5px;
    margin-bottom: 22px;
}

.farms-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px 20px;
    color: #94a3b8;
    font-size: 14px;
}

.farms-error {
    grid-column: 1 / -1;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    border-radius: 12px;
    padding: 18px 22px;
    font-size: 13.5px;
}

@media (max-width: 640px) {
    .farms-grid { grid-template-columns: 1fr; }
}

/* Area heading on the Farms grid.
   Shown only when the aqua farm has more than one area — grouping a single
   group is a label nobody needs. Spans the grid so the cards below it read as
   belonging to it rather than sitting beside it. */
.farms-area-head {
    grid-column: 1 / -1;
    margin: 18px 0 2px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--nz-text-3, #64748b);
}

.farms-area-head:first-child { margin-top: 0; }
.farms-area-head i { color: var(--nz-lime-text, #217A00); margin-right: 6px; }
