.shefa-appcontrols-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.shefa-appcontrol-card {
    display: block;
    height: 100%;
    text-decoration: none !important;
    color: inherit;
}

.shefa-appcontrol-card .card {
    height: 100%;
    border-radius: 16px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.shefa-appcontrol-card:hover .card {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(93, 143, 83, 0.12) !important;
}

.shefa-appcontrol-card-body {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
}

.shefa-appcontrol-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: linear-gradient(135deg, #eaf5e6, #fff);
    box-shadow: 0 4px 14px rgba(93, 143, 83, 0.15);
    color: #497143;
    font-size: 1.15rem;
}

.shefa-appcontrol-text h5 {
    margin: 0 0 0.5rem;
    color: #2f6f36;
    font-size: 1.05rem;
}

.shefa-appcontrol-text p {
    margin: 0;
    color: #6c757d;
    font-size: 0.88rem;
    line-height: 1.45;
}

.shefa-plan-config-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.shefa-plan-config-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    flex-wrap: wrap;
    background: #fff;
    border: 1px solid #e2efe0;
    border-radius: 16px;
    padding: 1rem 1.25rem;
    box-shadow: 0 2px 12px rgba(93, 143, 83, 0.06);
}

.shefa-plan-config-row-plan {
    min-width: 180px;
    flex: 1 1 200px;
}

.shefa-plan-config-row-plan strong {
    display: block;
    color: #2f6f36;
    font-size: 1.02rem;
}

.shefa-plan-config-row-action {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 0 1 auto;
    min-width: 200px;
}

.shefa-plan-config-row-action .form-control {
    max-width: 160px;
}

.shefa-plan-config-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.shefa-plan-config-card {
    background: #fff;
    border: 1px solid #e2efe0;
    border-radius: 16px;
    padding: 1.1rem 1.25rem;
    box-shadow: 0 2px 12px rgba(93, 143, 83, 0.06);
}

.shefa-plan-config-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 0.85rem;
}

.shefa-fa-check-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    font-weight: 500;
    color: #497143;
    margin: 0;
}

.shefa-fa-check-toggle input[type="checkbox"] {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none;
}

.shefa-fa-check-toggle .shefa-fa-check-off {
    color: #c5c5c5;
    font-size: 1.45rem;
    line-height: 1;
    flex-shrink: 0;
}

.shefa-fa-check-toggle .shefa-fa-check-on {
    color: #2e7d32;
    font-size: 1.45rem;
    line-height: 1;
    display: none;
    flex-shrink: 0;
}

.shefa-fa-check-toggle input[type="checkbox"]:checked ~ .shefa-fa-check-off {
    display: none;
}

.shefa-fa-check-toggle input[type="checkbox"]:checked ~ .shefa-fa-check-on {
    display: inline-block;
}

.shefa-fa-check-toggle:hover .shefa-fa-check-off {
    color: #9e9e9e;
}

.shefa-fa-check-toggle:hover .shefa-fa-check-on {
    color: #1b5e20;
}

.shefa-farm-payment-alert {
    position: sticky;
    top: 0;
    z-index: 1030;
}

.shefa-farm-payment-alert .btn-success {
    font-weight: 600;
}

.shefa-portal-banner-stack {
    position: relative;
}

.shefa-portal-banner-inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
}

.shefa-portal-banner-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.shefa-portal-banner-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.shefa-portal-banner-compact-btn {
    width: 100%;
    border: 1px solid #cfe5cb;
    background: #f8faf8;
    border-radius: 12px;
    padding: 0.65rem 1rem;
    font-weight: 600;
    color: #497143;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shefa-portal-banner-stack.is-collapsed .shefa-portal-banner-list {
    display: none;
}

.shefa-portal-banner-stack.is-collapsed .shefa-portal-banner-compact {
    display: block !important;
}

.shefa-portal-banner-stack.is-expanded .shefa-portal-banner-chevron {
    transform: rotate(180deg);
}

.shefa-plan-cap-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 0.35rem;
}

.shefa-plan-cap-count {
    font-weight: 700;
    color: #2f6f36;
    font-size: 0.95rem;
}

.shefa-plan-cap-tile {
    display: block;
    color: inherit;
    border-radius: 12px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.shefa-plan-cap-tile-inner {
    background: #f8faf8;
    border: 1px solid #e2efe0;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.shefa-plan-cap-tile:hover .shefa-plan-cap-tile-inner {
    border-color: #5d8f53;
    box-shadow: 0 4px 16px rgba(93, 143, 83, 0.12);
    transform: translateY(-1px);
}

.shefa-email-pref-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    background: #fff;
}

.shefa-email-pref-copy {
    min-width: 0;
    flex: 1 1 auto;
}

.shefa-farm-tab-bar {
    display: flex;
    width: 100%;
    gap: 6px;
}

.shefa-farm-tab {
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 0;
}

.shefa-farm-tab-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eaf5e6;
    color: #497143;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.shefa-farm-tab.active .shefa-farm-tab-icon {
    background: #5d8f53;
    color: #fff;
}

.shefa-review-bubble-clickable {
    cursor: pointer;
}

.shefa-review-bubble-clickable:hover {
    border-color: #5d8f53;
    background: #f4faf2;
}

html[data-bs-theme="dark"] .shefa-appcontrol-icon {
    background: linear-gradient(135deg, #1a2e1a, #0d0d0d);
    color: #9fd69a;
}

html[data-bs-theme="dark"] .shefa-appcontrol-text h5 {
    color: #b6d7b0;
}

html[data-bs-theme="dark"] .shefa-plan-config-card,
html[data-bs-theme="dark"] .shefa-plan-config-row {
    background: #111;
    border-color: #2a3d2a;
}

html[data-bs-theme="dark"] .shefa-plan-config-row-plan strong {
    color: #b6d7b0;
}

html[data-bs-theme="dark"] .shefa-fa-check-toggle {
    color: #cfe5cb;
}

html[data-bs-theme="dark"] .btn-outline-success:hover,
html[data-bs-theme="dark"] .btn-outline-warning:hover,
html[data-bs-theme="dark"] .btn-outline-secondary:hover {
    color: #fff !important;
}

html[data-bs-theme="dark"] .shefa-farm-tab {
    color: #cfe5cb;
}

html[data-bs-theme="dark"] .shefa-farm-tab:hover,
html[data-bs-theme="dark"] .shefa-farm-tab.active {
    color: #fff;
}

html[data-bs-theme="dark"] .shefa-farm-more-btn:hover,
html[data-bs-theme="dark"] .shefa-farm-info-btn:hover,
html[data-bs-theme="dark"] .shefa-farm-rating-link:hover {
    color: #b6d7b0;
}

html[data-bs-theme="dark"] .shefa-portal-banner-compact-btn {
    background: #111;
    border-color: #2a3d2a;
    color: #b6d7b0;
}

/* Light mode: keep label text readable on hover/focus for outline and tinted controls */
.btn-outline-success:hover,
.btn-outline-success:focus,
.btn-outline-success:active,
.btn-outline-success.active {
    color: #fff !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active {
    color: #fff !important;
}

.btn-outline-warning:hover,
.btn-outline-warning:focus,
.btn-outline-warning:active {
    color: #212529 !important;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus,
.btn-outline-secondary:active {
    color: #fff !important;
}

.shefa-portal-card .btn-outline-success:hover,
.shefa-portal-card .btn-outline-success:focus {
    color: #fff !important;
}

.shefa-appcontrol-card:hover .shefa-appcontrol-text h5,
.shefa-appcontrol-card:hover .shefa-appcontrol-text p {
    color: inherit;
}

.badge.bg-success:hover,
.badge.bg-primary:hover,
.badge.bg-warning:hover {
    color: #fff !important;
}

.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    color: #fff !important;
}

.list-group-item-action:hover,
.list-group-item-action:focus {
    color: var(--bs-list-group-action-hover-color, #212529);
}

html[data-bs-theme="dark"] .list-group-item-action:hover,
html[data-bs-theme="dark"] .list-group-item-action:focus {
    color: var(--shefa-text) !important;
}
