/* ==========================================================================
       GÜBRE DÜZENLEME PANELİ - Ana sayfa ile uyumlu, minimalist tasarım
       ========================================================================== */

    /* Layout fixes */
    body {
        min-height: auto !important;
        padding-bottom: 0 !important;
    }
    main.page-content {
        flex: 0 1 auto !important;
        padding-bottom: 0 !important;
    }
    main.page-content.container {
        width: 100% !important;
        max-width: none !important;
        padding-left: clamp(1rem, 4vw, 2.5rem) !important;
        padding-right: clamp(1rem, 4vw, 2.5rem) !important;
    }
    .site-footer {
        margin-top: 0 !important;
        padding-top: 1.5rem !important;
        padding-bottom: 0.5rem !important;
    }

    /* İçerik kartını ortalamak için sade düzen */
    .smart4drip-rails {
        display: flex;
        justify-content: center;
        margin: clamp(1.5rem, 4vw, 2.5rem) 0 clamp(3rem, 6vw, 4rem);
    }
    .smart4drip-rail {
        display: none;
    }
    .smart4drip-main {
        width: min(1100px, 100%);
        min-width: 0;
    }

    /* BAŞLIKLAR - Ana sayfa ile uyumlu */
    .smart4drip-header-text h1 {
        font-size: clamp(1.75rem, 4vw, 2.25rem) !important;
        font-weight: 700 !important;
        color: #ffffff !important;
        line-height: 1.3 !important;
    }

    .smart4drip-header-text .eyebrow {
        color: #64b5f6 !important;
        font-weight: 600 !important;
    }

    .smart4drip-description {
        color: #c5d4f0 !important;
        font-size: clamp(0.95rem, 2vw, 1.05rem) !important;
        line-height: 1.6 !important;
    }

    /* META BİLGİLER - Modern badge stil */
    .smart4drip-meta-item {
        background: rgba(63, 111, 215, 0.15) !important;
        border: 1px solid rgba(100, 181, 246, 0.25) !important;
        border-radius: 8px !important;
        padding: clamp(0.6rem, 1.5vw, 0.8rem) clamp(0.85rem, 2vw, 1.1rem) !important;
    }

    .meta-label {
        color: #bdc8e4 !important;
        font-size: clamp(0.8rem, 1.8vw, 0.9rem) !important;
    }

    .meta-value {
        color: #ffffff !important;
        font-weight: 600 !important;
        font-size: clamp(0.95rem, 2vw, 1.1rem) !important;
    }

    /* LEGEND VE HELPER TEXT */
    .field-group--table legend {
        color: #e5ecff !important;
        font-size: clamp(1rem, 2.2vw, 1.15rem) !important;
        font-weight: 600 !important;
        margin-bottom: clamp(0.75rem, 2vw, 1rem) !important;
    }

    .helper {
        color: #c5d4f0 !important;
        font-size: clamp(0.875rem, 2vw, 1rem) !important;
        line-height: 1.6 !important;
    }

    .smart4drip-note {
        color: #c5d4f0 !important;
        font-size: clamp(0.875rem, 2vw, 1rem) !important;
        padding: clamp(0.75rem, 2vw, 1rem) clamp(1rem, 2.5vw, 1.25rem) !important;
        background: rgba(63, 111, 215, 0.1) !important;
        border-left: 3px solid rgba(100, 181, 246, 0.5) !important;
        border-radius: 6px !important;
    }

    /* BUTONLAR - Ana sayfa CTA ile uyumlu */
    .button {
        font-family: "Inter", "Segoe UI", Arial, sans-serif !important;
        font-size: clamp(0.875rem, 2vw, 1rem) !important;
        font-weight: 600 !important;
        padding: clamp(0.65rem, 1.8vw, 0.85rem) clamp(1.25rem, 3vw, 1.75rem) !important;
        border-radius: 10px !important;
        transition: all 0.2s ease !important;
        min-height: 44px !important; /* Touch-friendly */
    }

    /* Primary button - Mavi-yeşil gradient */
    .button:not(.button-secondary):not(.button-warning) {
        background: linear-gradient(135deg, #3f6fd7 0%, #1ac79b 100%) !important;
        border: 2px solid rgba(100, 181, 246, 0.4) !important;
        color: #ffffff !important;
        box-shadow: 0 4px 16px rgba(63, 111, 215, 0.25) !important;
    }

    .button:not(.button-secondary):not(.button-warning):hover {
        box-shadow: 0 6px 20px rgba(63, 111, 215, 0.35) !important;
        transform: translateY(-1px) !important;
    }

    .button-back {
        display: inline-flex !important;
        align-items: center !important;
        gap: clamp(0.4rem, 1.2vw, 0.55rem) !important;
        padding-left: clamp(0.9rem, 2.2vw, 1.2rem) !important;
    }

    .button-back::before {
        content: '';
        width: clamp(0.45rem, 1.5vw, 0.65rem);
        height: clamp(0.45rem, 1.5vw, 0.65rem);
        border-left: 2px solid rgba(144, 202, 249, 0.75);
        border-bottom: 2px solid rgba(144, 202, 249, 0.75);
        transform: rotate(45deg);
        transition: border-color 0.2s ease;
    }

    .button-back:hover::before,
    .button-back:focus-visible::before {
        border-color: #ffffff;
    }

    /* Secondary button */
    .button-secondary {
        background: rgba(63, 111, 215, 0.15) !important;
        border: 1px solid rgba(100, 181, 246, 0.3) !important;
        color: #e5ecff !important;
    }

    .button-secondary:hover {
        background: rgba(63, 111, 215, 0.25) !important;
        border-color: rgba(100, 181, 246, 0.4) !important;
    }

    /* Reset button */
    .button-warning.smart4drip-reset {
        display: block !important;
        margin: clamp(2rem, 4vw, 3rem) auto 0 !important;
        font-size: clamp(0.75rem, 1.8vw, 0.875rem) !important;
        padding: clamp(0.65rem, 1.8vw, 0.85rem) clamp(1.2rem, 3vw, 1.5rem) !important;
        box-shadow: 0 4px 16px rgba(6, 18, 44, 0.2) !important;
        border-radius: 10px !important;
        opacity: 0.8 !important;
        transition: opacity 0.2s ease, transform 0.2s ease !important;
        max-width: fit-content !important;
    }

    .button-warning.smart4drip-reset:hover {
        opacity: 1 !important;
        transform: translateY(-1px) !important;
    }

    /* Text expandable styling - match smart4drip.html */
    .smart4drip-description {
        position: relative;
    }
    .smart4drip-description.text-expandable .text-expandable__short {
        display: block;
    }
    .smart4drip-description.text-expandable .text-expandable__full {
        display: none;
    }
    .smart4drip-description.text-expandable.is-expanded .text-expandable__short {
        display: none;
    }
    .smart4drip-description.text-expandable.is-expanded .text-expandable__full {
        display: block;
    }
    .smart4drip-description .text-expandable__toggle {
        display: inline;
        margin-left: 0.25rem;
        color: rgba(100, 181, 246, 0.90);
        background: none;
        border: none;
        padding: 0;
        cursor: pointer;
        font-size: inherit;
        font-weight: inherit;
        line-height: inherit;
        font-family: inherit;
        transition: color 0.2s ease;
    }
    .smart4drip-description .text-expandable__toggle:hover,
    .smart4drip-description .text-expandable__toggle:focus-visible {
        color: rgba(144, 202, 249, 1);
        text-decoration: underline;
    }

    /* TABLO - Sticky header ve minimalist stil */
    .table-scroll--wide {
        overflow: auto !important;
        -webkit-overflow-scrolling: touch !important;
        position: relative !important;
        border-radius: 12px !important;
        border: 1px solid rgba(100, 181, 246, 0.2) !important;
    }

    .fert-table.compact {
        font-size: clamp(0.875rem, 2vw, 0.95rem) !important;
    }

    .fert-table.compact thead {
        position: sticky !important;
        top: 0 !important;
        z-index: 10 !important;
    }

    .fert-table.compact thead th {
        background: rgba(15, 28, 58, 0.98) !important;
        color: #e5ecff !important;
        font-weight: 600 !important;
        border-bottom: 2px solid rgba(100, 181, 246, 0.3) !important;
        padding: clamp(0.75rem, 2vw, 1rem) clamp(0.5rem, 1.5vw, 0.75rem) !important;
    }

    .fert-table.compact th.sticky-col,
    .fert-table.compact td.fert-name-cell {
        position: sticky !important;
        left: 0 !important;
        background: rgba(11, 22, 45, 0.98) !important;
        z-index: 2 !important;
    }

    .fert-table.compact th.sticky-col {
        z-index: 11 !important;
        background: rgba(15, 28, 58, 0.98) !important;
    }

    /* Seçili satır vurgusu */
    .fert-table.compact tr.is-selected {
        background: rgba(63, 111, 215, 0.15) !important;
    }

    .fert-table.compact tr.is-selected td {
        border-color: rgba(100, 181, 246, 0.3) !important;
    }

    /* INPUT STİLLERİ - Ana sayfa ile uyumlu */
    .fert-table.compact input[type="text"],
    .fert-table.compact input[type="number"] {
        background: rgba(16, 27, 48, 0.6) !important;
        border: 1px solid rgba(100, 181, 246, 0.25) !important;
        border-radius: 8px !important;
        color: #ffffff !important;
        font-size: clamp(0.875rem, 2vw, 0.95rem) !important;
        padding: clamp(0.5rem, 1.5vw, 0.65rem) clamp(0.65rem, 1.8vw, 0.85rem) !important;
        transition: border-color 0.2s ease !important;
    }

    .fert-table.compact input:focus {
        border-color: rgba(100, 181, 246, 0.5) !important;
        outline: none !important;
        box-shadow: 0 0 0 3px rgba(100, 181, 246, 0.15) !important;
    }

    .input-suffix {
        color: #bdc8e4 !important;
        font-size: clamp(0.8rem, 1.8vw, 0.9rem) !important;
        font-weight: 500 !important;
    }

    /* MOBIL RESPONSIVE - Touch-friendly */
    @media (max-width: 768px) {
        .fert-table.compact {
            min-width: 100% !important;
            width: max-content !important;
            font-size: 0.875rem !important;
        }

        .fert-table.compact th,
        .fert-table.compact td {
            padding: 0.65rem 0.5rem !important;
            white-space: nowrap !important;
        }

        .fert-table.compact th.sticky-col,
        .fert-table.compact td.fert-name-cell {
            min-width: 130px !important;
            max-width: 160px !important;
        }

        .fert-table.compact .fert-name-cell input {
            width: 100% !important;
            font-size: 0.9rem !important;
            padding: 0.6rem 0.65rem !important;
            min-height: 44px !important; /* Touch-friendly */
        }

        .fert-table.compact .input-with-suffix {
            display: flex !important;
            align-items: center !important;
            gap: 0.35rem !important;
        }

        .fert-table.compact .input-percent {
            width: 65px !important;
            min-width: 65px !important;
            font-size: 0.9rem !important;
            padding: 0.6rem 0.5rem !important;
            min-height: 44px !important; /* Touch-friendly */
        }

        .fert-table.compact .input-suffix {
            font-size: 0.8rem !important;
            flex-shrink: 0 !important;
        }
    }

    /* Çok küçük ekranlar */
    @media (max-width: 480px) {
        .fert-table.compact th,
        .fert-table.compact td {
            padding: 0.55rem 0.4rem !important;
        }

        .fert-table.compact .input-percent {
            width: 60px !important;
            min-width: 60px !important;
        }
    }

    /* HINT BOX */
    .smart4drip-hint {
        background: rgba(63, 111, 215, 0.08) !important;
        border: 1px solid rgba(100, 181, 246, 0.2) !important;
        border-radius: 10px !important;
        padding: clamp(1rem, 2.5vw, 1.5rem) !important;
        margin-top: clamp(1.5rem, 3vw, 2rem) !important;
    }

    .smart4drip-hint p {
        color: #e5ecff !important;
        font-weight: 600 !important;
        font-size: clamp(0.95rem, 2vw, 1.05rem) !important;
        margin-bottom: clamp(0.5rem, 1.5vw, 0.75rem) !important;
    }

    .smart4drip-hint ul {
        color: #c5d4f0 !important;
        font-size: clamp(0.875rem, 2vw, 0.95rem) !important;
        line-height: 1.7 !important;
    }

    .smart4drip-hint li {
        margin-bottom: 0.35rem !important;
    }

/* ------------------------------------------------------------
   Stock editor (dynamic, fertilizer-linked)
------------------------------------------------------------ */
.stock-editor {
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 14px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
}

.stock-editor-header {
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: 0.75rem;
    padding: 0.75rem 0.9rem;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.stock-col-label {
    font-weight: 700;
    color: rgba(229, 236, 255, 0.92);
    font-size: 0.9rem;
}

.stock-editor-body {
    display: flex;
    flex-direction: column;
}

.stock-row {
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: 0.75rem;
    align-items: center;
    padding: 0.7rem 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.stock-row:last-child {
    border-bottom: none;
}

/* Assigned ones are "faded" like the desktop app */
.stock-row.is-assigned {
    opacity: 0.60;
}

.stock-row.is-unassigned {
    opacity: 1;
}

.stock-fert-name {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
}

.stock-name {
    font-weight: 700;
    color: rgba(255, 255, 255, 0.92);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stock-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.92);
    background: rgba(255, 255, 255, 0.06);
    flex: 0 0 auto;
}

.stock-badge--warn {
    border-color: rgba(255, 99, 99, 0.35);
    background: rgba(255, 66, 66, 0.12);
    color: rgba(255, 220, 220, 0.96);
}

.stock-select {
    width: 100%;
    min-height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(16, 27, 48, 0.55);
    color: rgba(255, 255, 255, 0.92);
    padding: 0.45rem 0.65rem;
}

.stock-select:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(121, 172, 255, 0.25);
}

@media (max-width: 768px) {
    .stock-editor-header,
    .stock-row {
        grid-template-columns: 1fr;
    }
    .stock-select {
        width: 100%;
    }
}