﻿@charset "UTF-8";

/* =========================================================
   MAXN AGRO-SILESIA - JEDNOLITY ARKUSZ STYLOW
   Wersja 2.2
   Aplikacja glowna + nazwa wlasna pola + reczne wprowadzanie + zarzadzanie projektem
   ========================================================= */

:root {
    --primary: #237447;
    --primary-dark: #185d37;
    --primary-light: #e7f5ed;

    --secondary: #475569;
    --secondary-dark: #334155;

    --success: #15803d;
    --success-light: #ecfdf3;

    --warning: #b45309;
    --warning-dark: #92400e;
    --warning-light: #fff7ed;

    --danger: #b91c1c;
    --danger-dark: #991b1b;
    --danger-light: #fef2f2;

    --clear-project: #ea580c;
    --clear-project-dark: #c2410c;
    --clear-project-light: #fff7ed;

    --info: #1d4ed8;
    --info-light: #eff6ff;

    --text: #1f2937;
    --muted: #64748b;
    --border: #d8e0e8;
    --background: #f4f7f5;
    --card: #ffffff;

    --shadow-sm:
        0 1px 2px rgba(15, 23, 42, 0.05);

    --shadow-md:
        0 8px 24px rgba(15, 23, 42, 0.08);

    --radius-small: 8px;
    --radius-medium: 12px;
    --radius-large: 18px;

    --container-width: 1440px;
}


/* =========================================================
   RESET
   ========================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-width: 320px;
    margin: 0;

    color: var(--text);

    background:
        linear-gradient(
            180deg,
            #eef7f1 0,
            var(--background) 320px
        );

    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Arial,
        sans-serif;

    font-size: 16px;
    line-height: 1.55;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    border: 0;
}

img {
    display: block;
    max-width: 100%;
}

[hidden] {
    display: none !important;
}

.visually-hidden {
    position: absolute !important;

    width: 1px !important;
    height: 1px !important;

    padding: 0 !important;
    margin: -1px !important;

    overflow: hidden !important;

    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;

    border: 0 !important;
}


/* =========================================================
   UKLAD
   ========================================================= */

.container {
    width: min(
        calc(100% - 32px),
        var(--container-width)
    );

    margin-inline: auto;
}

.main-content {
    padding: 28px 0 64px;
}


/* =========================================================
   NAGLOWEK
   ========================================================= */

.app-header {
    position: sticky;
    top: 0;
    z-index: 100;

    color: #ffffff;

    background:
        linear-gradient(
            135deg,
            var(--primary-dark),
            var(--primary)
        );

    box-shadow:
        0 8px 24px rgba(15, 71, 43, 0.18);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;

    min-height: 84px;
    padding-block: 14px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;

    flex: 0 0 auto;
}

.brand-mark {
    display: grid;
    place-items: center;

    width: 48px;
    height: 48px;

    border: 2px solid rgba(255, 255, 255, 0.75);
    border-radius: 14px;

    background: rgba(255, 255, 255, 0.12);

    font-size: 24px;
    font-weight: 800;
}

.brand h1 {
    margin: 0;

    font-size: 28px;
    line-height: 1.1;
}

.brand p {
    margin: 5px 0 0;

    color: rgba(255, 255, 255, 0.82);

    font-size: 13px;
}

.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;

    min-width: 0;
}

.autosave-status {
    margin-right: 8px;

    color: rgba(255, 255, 255, 0.82);

    font-size: 12px;
    white-space: nowrap;
}


/* =========================================================
   PRZYCISKI
   ========================================================= */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    min-height: 42px;
    padding: 10px 17px;

    border: 1px solid transparent;
    border-radius: var(--radius-small);

    cursor: pointer;

    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;

    text-align: center;
    text-decoration: none;

    transition:
        color 0.18s ease,
        background-color 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.18s ease;
}

.button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.button:focus-visible {
    outline: 3px solid rgba(35, 116, 71, 0.25);
    outline-offset: 2px;
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.52;
}

.button-primary {
    color: #ffffff;
    background: var(--primary);
}

.button-primary:hover:not(:disabled) {
    background: var(--primary-dark);

    box-shadow:
        0 6px 14px rgba(35, 116, 71, 0.22);
}

.button-secondary {
    color: var(--secondary-dark);
    border-color: var(--border);
    background: #ffffff;
}

.button-secondary:hover:not(:disabled) {
    border-color: #b8c4cf;
    background: #f8fafc;
}

.app-header .button-secondary {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.1);
}

.app-header .button-secondary:hover:not(:disabled) {
    color: var(--primary-dark);
    border-color: #ffffff;
    background: #ffffff;
}

.button-danger {
    color: #ffffff;
    background: var(--danger);
}

.button-danger:hover:not(:disabled) {
    background: var(--danger-dark);
}


/* =========================================================
   PRZYCISK WYCZYSC PROJEKT
   ========================================================= */

.button-clear-project {
    color: #ffffff;
    border-color: var(--clear-project);
    background: var(--clear-project);
}

.button-clear-project:hover:not(:disabled) {
    color: #ffffff;
    border-color: var(--clear-project-dark);
    background: var(--clear-project-dark);

    box-shadow:
        0 6px 14px rgba(194, 65, 12, 0.25);
}

.button-clear-project:focus-visible {
    outline-color: rgba(234, 88, 12, 0.32);
}

.app-header .button-clear-project {
    color: #ffffff;
    border-color: #fb923c;
    background: var(--clear-project);
}

.app-header .button-clear-project:hover:not(:disabled) {
    color: #ffffff;
    border-color: #fdba74;
    background: var(--clear-project-dark);
}


/* =========================================================
   KOMUNIKATY
   ========================================================= */

.notice {
    display: flex;
    align-items: flex-start;
    gap: 14px;

    padding: 17px 20px;
    margin-bottom: 22px;

    border: 1px solid transparent;
    border-radius: var(--radius-medium);
}

.notice-info {
    color: #1e3a8a;
    border-color: #bfdbfe;
    background: var(--info-light);
}

.notice-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;

    width: 28px;
    height: 28px;

    border-radius: 50%;

    color: #ffffff;
    background: var(--info);

    font-weight: 800;
}

.notice p {
    margin: 3px 0 0;
    font-size: 14px;
}

.app-messages {
    display: grid;
    gap: 10px;

    margin-bottom: 20px;
}

.app-message,
.manual-entry-message {
    padding: 14px 17px;

    border: 1px solid var(--border);
    border-radius: var(--radius-small);

    background: #ffffff;
}

.app-message-success,
.manual-entry-message-success {
    color: var(--success);
    border-color: #bbf7d0;
    background: var(--success-light);
}

.app-message-warning,
.manual-entry-message-warning {
    color: var(--warning);
    border-color: #fed7aa;
    background: var(--warning-light);
}

.app-message-error,
.manual-entry-message-error {
    color: var(--danger);
    border-color: #fecaca;
    background: var(--danger-light);
}


/* =========================================================
   KROKI
   ========================================================= */

.steps {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;

    margin-bottom: 28px;
}

.step {
    display: flex;
    align-items: center;
    gap: 11px;

    min-width: 0;
    padding: 14px;

    border: 1px solid var(--border);
    border-radius: var(--radius-medium);

    color: var(--muted);
    background: rgba(255, 255, 255, 0.88);

    cursor: pointer;
    text-align: left;

    box-shadow: var(--shadow-sm);
}

.step:hover {
    border-color: #9bbcab;
}

.step.active {
    color: var(--primary-dark);
    border-color: var(--primary);
    background: var(--primary-light);
}

.step-number {
    display: grid;
    place-items: center;
    flex: 0 0 auto;

    width: 32px;
    height: 32px;

    border-radius: 50%;

    color: #ffffff;
    background: var(--secondary);

    font-weight: 800;
}

.step.active .step-number {
    background: var(--primary);
}

.step-text {
    display: grid;
    min-width: 0;
}

.step-text strong,
.step-text small {
    overflow: hidden;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.step-text strong {
    font-size: 14px;
}

.step-text small {
    color: var(--muted);
    font-size: 11px;
}


/* =========================================================
   SEKCJE I KARTY
   ========================================================= */

.app-section {
    animation: fade 0.22s ease;
}

@keyframes fade {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;

    margin-bottom: 20px;
}

.section-heading h2 {
    margin: 2px 0 6px;

    font-size: clamp(25px, 3vw, 34px);
    line-height: 1.2;
}

.section-heading p {
    max-width: 760px;
    margin: 0;

    color: var(--muted);
}

.section-kicker {
    display: inline-block;

    color: var(--primary);

    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.card {
    padding: 24px;
    margin-bottom: 20px;

    border: 1px solid var(--border);
    border-radius: var(--radius-large);

    background: var(--card);

    box-shadow: var(--shadow-sm);
}

.card-heading {
    margin-bottom: 20px;
}

.card-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.card-heading h3 {
    margin: 0;

    font-size: 20px;
    line-height: 1.3;
}

.card-heading p {
    margin: 5px 0 0;

    color: var(--muted);

    font-size: 14px;
}


/* =========================================================
   FORMULARZE
   ========================================================= */

.form-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.form-field {
    min-width: 0;
}

.form-field-wide {
    grid-column: 1 / -1;
}

.form-field label {
    display: block;

    margin-bottom: 7px;

    color: var(--secondary-dark);

    font-size: 13px;
    font-weight: 750;
}

.required {
    color: var(--danger);
}

input,
select,
textarea {
    width: 100%;
    min-height: 44px;

    padding: 10px 12px;

    border: 1px solid #cbd5e1;
    border-radius: var(--radius-small);

    color: var(--text);
    background: #ffffff;

    outline: none;

    transition:
        border-color 0.18s ease,
        background-color 0.18s ease,
        box-shadow 0.18s ease;
}

input:hover,
select:hover,
textarea:hover {
    border-color: #94a3b8;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);

    box-shadow:
        0 0 0 3px rgba(35, 116, 71, 0.13);
}

input:read-only {
    color: var(--secondary);
    background: #f1f5f9;
}

input.is-invalid,
select.is-invalid,
.validation-card.is-invalid select:required:invalid {
    border-color: var(--danger);
    background: var(--danger-light);

    box-shadow:
        0 0 0 3px rgba(185, 28, 28, 0.1);
}

.validation-card.is-invalid {
    border-color: var(--danger);
    background: #fffafa;
}

.field-error {
    display: block;

    margin-top: 6px;

    color: var(--danger);

    font-size: 12px;
    font-weight: 700;
}

.field-help {
    display: block;

    margin-top: 6px;

    color: var(--muted);

    font-size: 12px;
}

.input-unit {
    display: flex;
    align-items: stretch;
}

.input-unit input {
    border-radius:
        var(--radius-small) 0 0 var(--radius-small);
}

.input-unit span {
    display: flex;
    align-items: center;
    justify-content: center;

    min-width: 78px;
    padding: 8px 10px;

    border: 1px solid #cbd5e1;
    border-left: 0;
    border-radius:
        0 var(--radius-small) var(--radius-small) 0;

    color: var(--secondary);
    background: #f8fafc;

    font-size: 12px;
    font-weight: 700;
}

.checkbox-field {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.checkbox-field input {
    flex: 0 0 auto;

    width: 19px;
    height: 19px;
    min-height: 0;
    margin-top: 2px;
}

.checkbox-field label {
    display: grid;
    gap: 3px;

    cursor: pointer;
}

.checkbox-field label span {
    color: var(--muted);
    font-size: 13px;
}

.separator {
    height: 1px;
    margin: 22px 0;

    background: var(--border);
}


/* =========================================================
   WYNIKI I KAFELKI
   ========================================================= */

.result-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;

    margin-top: 22px;
    overflow: hidden;

    border: 1px solid var(--border);
    border-radius: var(--radius-medium);

    background: var(--border);
}

.result-strip > div {
    display: grid;
    align-content: center;
    gap: 5px;

    min-height: 82px;
    padding: 16px;

    background: #f8fafc;
}

.result-strip span {
    color: var(--muted);
    font-size: 12px;
}

.summary-grid {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    gap: 14px;

    margin-bottom: 20px;
}

.summary-card {
    display: grid;
    align-content: space-between;
    gap: 7px;

    min-height: 104px;
    padding: 18px 20px;

    border: 1px solid var(--border);
    border-radius: var(--radius-medium);

    background: #ffffff;

    box-shadow: var(--shadow-sm);
}

.summary-card > span {
    color: var(--muted);
    font-size: 15px;
}

.summary-card strong {
    display: flex;
    align-items: baseline;
    gap: 6px;

    color: var(--primary-dark);

    font-size: 29px;
    font-weight: 800;
    line-height: 1.15;
}

.summary-card small {
    font-size: 18px;
}

.summary-card.success {
    border-color: #bbf7d0;
    background: var(--success-light);
}

.summary-card.warning {
    border-color: #fed7aa;
    background: var(--warning-light);
}


/* =========================================================
   IMPORT CSV
   ========================================================= */

.upload-zone {
    display: grid;
    justify-items: center;

    padding: 54px 24px;

    border: 2px dashed #92baa2;
    border-radius: var(--radius-large);

    background: #f5fbf7;

    text-align: center;
}

.upload-zone.drag-over {
    border-color: var(--primary);
    background: var(--primary-light);
}

.upload-icon {
    display: grid;
    place-items: center;

    width: 64px;
    height: 64px;
    margin-bottom: 14px;

    border-radius: 18px;

    color: var(--primary-dark);
    background: var(--primary-light);

    font-weight: 900;
}

.upload-zone h3 {
    margin: 0 0 8px;
}

.upload-zone p {
    max-width: 520px;
    margin: 0 0 20px;

    color: var(--muted);
}

.selected-file {
    display: grid;
    gap: 2px;

    margin-top: 18px;
    padding: 12px 16px;

    border: 1px solid #bbf7d0;
    border-radius: var(--radius-small);

    color: var(--success);
    background: var(--success-light);
}


/* =========================================================
   TABELE
   ========================================================= */

.table-wrapper {
    width: 100%;
    overflow-x: auto;

    border: 1px solid var(--border);
    border-radius: var(--radius-medium);
}

.data-table {
    width: 100%;
    min-width: 820px;

    border-collapse: collapse;

    background: #ffffff;
}

.data-table th,
.data-table td {
    padding: 13px 14px;

    border-bottom: 1px solid var(--border);

    text-align: left;
    vertical-align: middle;
}

.data-table th {
    color: var(--secondary-dark);
    background: #f1f5f9;

    font-size: 12px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.data-table td {
    font-size: 14px;
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.data-table tbody tr:hover {
    background: #f8fbf9;
}

.table-row-error {
    background: var(--danger-light);
}

.table-row-warning {
    background: var(--warning-light);
}

.status-badge {
    display: inline-flex;
    align-items: center;

    padding: 5px 9px;

    border-radius: 999px;

    font-size: 12px;
    font-weight: 800;
}

.status-badge-success {
    color: var(--success);
    background: var(--success-light);
}

.status-badge-warning {
    color: var(--warning);
    background: var(--warning-light);
}

.status-badge-danger {
    color: var(--danger);
    background: var(--danger-light);
}

button.status-badge {
    cursor: pointer;
}


/* =========================================================
   KOLUMNA AKCJI POLA
   ========================================================= */

.field-actions-column {
    width: 116px;
    min-width: 116px;

    text-align: center !important;
}

.field-actions-cell {
    width: 116px;
    min-width: 116px;

    text-align: center !important;
    white-space: nowrap;
}

.field-actions {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.field-actions .button {
    min-height: 38px;
    padding: 8px 12px;
}


/* =========================================================
   IKONA USUWANIA CALEGO POLA
   ========================================================= */

.delete-field-button {
    display: inline-grid;
    place-items: center;

    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0;

    color: var(--danger);

    border: 1px solid #fecaca;
    border-radius: var(--radius-small);

    background: var(--danger-light);

    cursor: pointer;

    transition:
        color 0.18s ease,
        background-color 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.18s ease;
}

.delete-field-button:hover {
    color: #ffffff;
    border-color: var(--danger);
    background: var(--danger);

    box-shadow:
        0 5px 12px rgba(185, 28, 28, 0.2);

    transform: translateY(-1px);
}

.delete-field-button:active {
    transform: translateY(0);
}

.delete-field-button:focus-visible {
    outline:
        3px solid rgba(185, 28, 28, 0.22);
    outline-offset: 2px;
}

.delete-field-button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.delete-field-icon {
    display: block;

    width: 18px;
    height: 18px;

    pointer-events: none;
}


/* =========================================================
   POLA
   ========================================================= */

.workspace {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    gap: 20px;
}

.field-sidebar {
    align-self: start;

    overflow: hidden;

    border: 1px solid var(--border);
    border-radius: var(--radius-large);

    background: #ffffff;
}

.field-sidebar-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    padding: 18px;

    border-bottom: 1px solid var(--border);
}

.field-sidebar-heading h3 {
    margin: 0;
}

.counter {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 32px;
    padding: 4px 9px;

    border-radius: 999px;

    color: var(--primary-dark);
    background: var(--primary-light);

    font-size: 12px;
    font-weight: 800;
}

.field-navigation {
    display: grid;
    gap: 7px;

    max-height: 650px;
    padding: 10px;
    overflow-y: auto;
}

.field-navigation-button {
    display: grid;
    grid-template-columns:
        auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;

    width: 100%;
    padding: 11px;

    border: 1px solid transparent;
    border-radius: var(--radius-small);

    color: var(--text);
    background: transparent;

    cursor: pointer;
    text-align: left;
}

.field-navigation-button:hover {
    background: #f1f5f9;
}

.field-navigation-button.active {
    border-color: #9ac9aa;
    background: var(--primary-light);
}

.field-navigation-designation {
    display: grid;
    place-items: center;

    width: 34px;
    height: 34px;

    border-radius: 10px;

    color: #ffffff;
    background: var(--primary);

    font-weight: 800;
}

.field-navigation-text {
    min-width: 0;
}

.field-navigation-text strong,
.field-navigation-text span {
    display: block;
    overflow: hidden;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.field-navigation-text span {
    color: var(--muted);
    font-size: 11px;
}

.field-title-card,
.fertilization-title-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    background:
        linear-gradient(
            135deg,
            #ffffff,
            #f0faf4
        );
}

.field-title-card h3,
.fertilization-title-card h3 {
    margin: 3px 0;

    font-size: 29px;
}

.field-title-card p,
.fertilization-title-card p {
    margin: 0;
    color: var(--muted);
}

.field-title-meta {
    text-align: right;
}

.field-title-meta span {
    display: block;

    color: var(--muted);

    font-size: 12px;
}

.field-title-meta strong {
    color: var(--primary-dark);
    font-size: 22px;
}


/* =========================================================
   DZIALKI
   ========================================================= */

.details-card {
    padding: 0;
    overflow: hidden;
}

.details-card summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    padding: 18px 22px;

    cursor: pointer;

    font-size: 14px;
    font-weight: 750;

    list-style: none;
}

.details-card summary::-webkit-details-marker {
    display: none;
}

.details-content {
    padding: 0 22px 20px;

    border-top: 1px solid var(--border);
}

.parcel-list {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(170px, 1fr));
    gap: 9px;

    padding-top: 16px;
}

.parcel-item {
    display: grid;
    gap: 3px;

    padding: 10px 12px;

    border: 1px solid var(--border);
    border-radius: var(--radius-small);

    background: #f8fafc;

    font-size: 13px;
}

.parcel-item strong {
    overflow-wrap: anywhere;
}

.parcel-item span {
    color: var(--muted);
    font-size: 12px;
}


/* =========================================================
   LIMITY
   ========================================================= */

.fertilization-title-card {
    min-height: 132px;
    padding: 27px 30px;
}

.limit-summary {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(190px, 1fr));
    gap: 14px;
}

.limit-box {
    display: grid;
    align-content: center;
    gap: 7px;

    min-width: 190px;
    min-height: 88px;
    padding: 16px 18px;

    border: 1px solid #b9ddc5;
    border-radius: var(--radius-medium);

    background: var(--primary-light);

    text-align: center;
}

.limit-box span {
    color: var(--muted);

    font-size: 13px;
    font-weight: 650;
}

.limit-box strong {
    color: var(--primary-dark);
    font-size: 25px;
}

.limit-box small {
    font-size: 14px;
}

.limit-box.is-exceeded {
    border-color: #fca5a5;
    background: var(--danger-light);
}

.limit-box.is-exceeded strong {
    color: var(--danger);
}

.fertilization-title-card.is-exceeded {
    border-color: #fca5a5;

    background:
        linear-gradient(
            135deg,
            #ffffff,
            var(--danger-light)
        );
}


/* =========================================================
   NAWOZY
   ========================================================= */

.fertilizer-list {
    display: grid;
    gap: 12px;
}

.fertilizer-item {
    display: grid;
    grid-template-columns:
        minmax(220px, 2fr)
        repeat(4, minmax(112px, 1fr))
        auto;
    align-items: center;
    gap: 12px;

    padding: 15px;

    border: 1px solid var(--border);
    border-radius: var(--radius-medium);

    background: #f8fafc;
}

.fertilizer-item-name strong,
.fertilizer-item-name span {
    display: block;
}

.fertilizer-item-name span,
.fertilizer-value span {
    color: var(--muted);
    font-size: 11px;
}

.fertilizer-value {
    display: grid;
    gap: 3px;
}

.fertilizer-value strong {
    font-size: 13px;
}

.fertilizer-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.icon-button {
    display: grid;
    place-items: center;

    width: 36px;
    height: 36px;

    border-radius: 8px;

    color: var(--danger);
    background: var(--danger-light);

    cursor: pointer;
    font-weight: 900;
}

.icon-button-edit,
.addon-edit-button {
    color: var(--primary-dark) !important;
    background: var(--primary-light) !important;
}


/* =========================================================
   BILANS
   ========================================================= */

.result-card {
    border-color: #acd1b9;
}

.result-card.is-exceeded {
    border-color: #fca5a5;
    background: #fffafa;
}

.balance-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    padding: 12px 0;

    border-bottom: 1px solid var(--border);
}

.balance-total {
    margin-top: 7px;
    padding: 16px;

    border: 0;
    border-radius: var(--radius-medium);

    color: var(--primary-dark);
    background: var(--primary-light);

    font-size: 17px;
}

.status-message {
    margin-top: 18px;
    padding: 13px 15px;

    border: 1px solid var(--border);
    border-radius: var(--radius-small);
}

.status-neutral {
    color: var(--secondary);
    background: #f8fafc;
}

.status-success {
    color: var(--success);
    border-color: #bbf7d0;
    background: var(--success-light);
}

.status-warning {
    color: var(--warning);
    border-color: #fed7aa;
    background: var(--warning-light);
}

.status-error {
    color: var(--danger);
    border-color: #fecaca;
    background: var(--danger-light);
}


/* =========================================================
   RECZNE WPROWADZANIE
   ========================================================= */

.entry-mode-tabs {
    display: inline-flex;
    gap: 6px;

    padding: 6px;
    margin: 0 0 20px;

    border: 1px solid var(--border);
    border-radius: 14px;

    background: #ffffff;

    box-shadow: var(--shadow-sm);
}

.entry-mode-tab {
    min-height: 44px;
    padding: 10px 22px;

    border: 1px solid transparent;
    border-radius: 10px;

    color: var(--secondary);
    background: transparent;

    cursor: pointer;

    font-size: 14px;
    font-weight: 750;
}

.entry-mode-tab:hover {
    color: var(--primary-dark);
    background: #f1f5f9;
}

.entry-mode-tab.active {
    color: #ffffff;
    border-color: var(--primary);
    background: var(--primary);

    box-shadow:
        0 5px 12px rgba(35, 116, 71, 0.2);
}

#manualEntryPanel {
    animation: fade 0.22s ease;
}

.manual-field-grid {
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
}

.manual-entry-buttons {
    justify-content: flex-end;

    padding-top: 22px;

    border-top: 1px solid var(--border);
}

.manual-entry-message {
    margin-top: 18px;
    font-weight: 650;
}

.manual-summary-grid {
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
}

.manual-fields-table {
    min-width: 780px;
}

.manual-fields-table td:first-child strong {
    display: inline-grid;
    place-items: center;

    min-width: 38px;
    min-height: 34px;
    padding: 4px 10px;

    border-radius: 9px;

    color: #ffffff;
    background: var(--primary);
}

.manual-row-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.manual-row-actions .button {
    min-width: 76px;
    min-height: 36px;
    padding: 8px 12px;

    font-size: 12px;
}

.manual-row-actions .icon-button,
.manual-row-actions .delete-field-button {
    min-width: 38px;
    width: 38px;
    min-height: 38px;
    height: 38px;
    padding: 0;
}

#manualFieldDesignation,
#manualParcelNumber {
    font-weight: 650;
}

#manualParcelArea {
    font-variant-numeric: tabular-nums;
}


/* =========================================================
   POZOSTALE
   ========================================================= */

.section-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    margin-top: 24px;
}

.inside-card {
    margin-top: 0;
}

.empty-state {
    display: grid;
    place-items: center;

    min-height: 260px;

    color: var(--muted);

    text-align: center;
}

.empty-state-small {
    padding: 20px;

    color: var(--muted);

    font-size: 13px;
    text-align: center;
}

.validation-list {
    display: grid;
    gap: 10px;

    padding: 0;
    margin: 0;

    list-style: none;
}

.validation-list li {
    padding: 12px 14px;

    border: 1px solid var(--border);
    border-radius: var(--radius-small);
}

.validation-neutral {
    color: var(--secondary);
    background: #f8fafc;
}

.validation-success {
    color: var(--success);
    background: var(--success-light);
}

.validation-warning {
    color: var(--warning);
    background: var(--warning-light);
}

.validation-error {
    color: var(--danger);
    background: var(--danger-light);
}

.export-grid {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.export-button {
    display: grid;
    gap: 6px;

    min-height: 110px;
    padding: 19px;

    border: 1px solid var(--border);
    border-radius: var(--radius-medium);

    color: var(--text);
    background: #ffffff;

    cursor: pointer;
    text-align: left;
}

.export-button:hover:not(:disabled) {
    border-color: var(--primary);
    background: var(--primary-light);
}

.export-button:disabled {
    cursor: not-allowed;
    opacity: 0.52;
}

.export-button span {
    color: var(--muted);
    font-size: 14px;
}


/* =========================================================
   DIALOGI
   ========================================================= */

.dialog {
    width: min(720px, calc(100% - 28px));
    max-height: calc(100vh - 40px);

    padding: 0;
    overflow: auto;

    border: 0;
    border-radius: var(--radius-large);

    background: #ffffff;

    box-shadow:
        0 24px 80px rgba(15, 23, 42, 0.28);
}

.dialog::backdrop {
    background: rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(3px);
}

.dialog-header {
    position: sticky;
    top: 0;
    z-index: 2;

    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;

    padding: 20px 22px;

    border-bottom: 1px solid var(--border);

    background: #ffffff;
}

.dialog-header h2 {
    margin: 2px 0;
}

.dialog-context {
    margin: 5px 0 0;

    color: var(--muted);

    font-size: 13px;
}

.dialog-close {
    display: grid;
    place-items: center;
    flex: 0 0 auto;

    width: 38px;
    height: 38px;

    border-radius: 50%;

    color: var(--secondary);
    background: #f1f5f9;

    cursor: pointer;
    font-size: 25px;
}

.dialog-content {
    padding: 22px;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;

    padding: 17px 22px;

    border-top: 1px solid var(--border);

    background: #ffffff;
}


/* =========================================================
   STOPKA
   ========================================================= */

.app-footer {
    padding: 28px 0;

    border-top: 1px solid var(--border);

    color: var(--muted);
    background: #ffffff;

    font-size: 12px;
    text-align: center;
}


/* =========================================================
   RESPONSYWNOSC DO 1280 PX
   ========================================================= */

@media (max-width: 1280px) {

    .header-content {
        align-items: flex-start;
    }

    .header-actions {
        max-width: 760px;
    }

    .autosave-status {
        flex-basis: 100%;
        margin-right: 0;

        text-align: right;
    }

}


/* =========================================================
   RESPONSYWNOSC DO 1180 PX
   ========================================================= */

@media (max-width: 1180px) {

    .steps {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }

    .summary-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .fertilizer-item {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .fertilizer-item-name {
        grid-column: 1 / -1;
    }

    .fertilizer-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }

    .export-grid {
        grid-template-columns: 1fr;
    }

}


/* =========================================================
   RESPONSYWNOSC DO 900 PX
   ========================================================= */

@media (max-width: 900px) {

    .app-header {
        position: static;
    }

    .header-content {
        align-items: flex-start;
        flex-direction: column;
    }

    .header-actions {
        width: 100%;
        max-width: none;
        justify-content: flex-start;
    }

    .autosave-status {
        width: 100%;
        margin: 0 0 5px;

        text-align: left;
    }

    .workspace {
        grid-template-columns: 1fr;
    }

    .field-navigation {
        grid-template-columns:
            repeat(auto-fit, minmax(180px, 1fr));

        max-height: none;
    }

    .form-grid,
    .manual-field-grid {
        grid-template-columns: 1fr;
    }

    .form-field-wide {
        grid-column: auto;
    }

    .result-strip {
        grid-template-columns: 1fr;
    }

    .fertilization-title-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .limit-summary {
        width: 100%;
    }

    .entry-mode-tabs {
        display: grid;
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        width: 100%;
    }

    .manual-summary-grid {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }

}


/* =========================================================
   RESPONSYWNOSC DO 680 PX
   ========================================================= */

@media (max-width: 680px) {

    .container {
        width: min(
            calc(100% - 20px),
            var(--container-width)
        );
    }

    .header-actions .button,
    .header-actions label.button {
        flex: 1 1 140px;
    }

    .header-actions .button-clear-project {
        flex-basis: 100%;
    }

    .steps,
    .summary-grid,
    .manual-summary-grid,
    .entry-mode-tabs {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 17px;
    }

    .details-card {
        padding: 0;
    }

    .card-heading-row,
    .field-title-card {
        align-items: stretch;
        flex-direction: column;
    }

    .section-actions,
    .manual-entry-buttons,
    .dialog-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .section-actions .button,
    .manual-entry-buttons .button,
    .dialog-actions .button {
        width: 100%;
    }

    .limit-summary {
        grid-template-columns: 1fr;
    }

    .limit-box {
        min-width: 0;
        text-align: left;
    }

    .fertilizer-item {
        grid-template-columns: 1fr;
    }

    .fertilizer-actions {
        grid-column: auto;
        justify-content: flex-start;
    }

    .field-actions-column,
    .field-actions-cell {
        width: 96px;
        min-width: 96px;
    }

    .manual-row-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .manual-row-actions .button {
        width: 100%;
    }

    .manual-row-actions .icon-button,
    .manual-row-actions .delete-field-button {
        width: 100%;
    }

    .dialog-content,
    .dialog-header,
    .dialog-actions {
        padding-inline: 16px;
    }

}


/* =========================================================
   DRUK
   ========================================================= */

@media print {

    @page {
        size: A4 landscape;
        margin: 10mm;
    }

    .app-header,
    .steps,
    .notice,
    .section-actions,
    .button,
    .field-sidebar,
    .app-footer {
        display: none !important;
    }

    body {
        background: #ffffff;
    }

    .container {
        width: 100%;
    }

    .card {
        break-inside: avoid;

        box-shadow: none;
    }

}

/* =========================================================
   ROZSZERZENIA v2.2 - NAZWA WŁASNA POLA I MAXN 0,70
   ========================================================= */
/* =========================================================
   MAXN AGRO-SILESIA - STYLE v2.2
   Plik wdrożeniowy dla:
   - app.js v0.5,
   - nazwy własnej pola,
   - współczynnika N mineralnego 0,70,
   - ręcznego dodawania pól,
   - usuwania pól i czyszczenia projektu.

   Bazuje na aktualnym arkuszu produkcyjnym i zawiera komplet
   reguł rozszerzających nową wersję interfejsu.
   ========================================================= */


/* =========================================================
   ZMIENNE UZUPEŁNIAJĄCE
   ========================================================= */

:root {
    --clear-project: #ea580c;
    --clear-project-dark: #c2410c;
    --clear-project-light: #fff7ed;
}

/* =========================================================
   PRZYCISK WYCZYŚĆ PROJEKT
   ========================================================= */

.button-clear-project {
    color: #ffffff;
    border-color: var(--clear-project);
    background: var(--clear-project);
}

.button-clear-project:hover:not(:disabled) {
    color: #ffffff;
    border-color: var(--clear-project-dark);
    background: var(--clear-project-dark);
    box-shadow: 0 6px 14px rgba(194, 65, 12, 0.25);
}

.button-clear-project:focus-visible {
    outline: 3px solid rgba(234, 88, 12, 0.32);
    outline-offset: 2px;
}

.app-header .button-clear-project {
    color: #ffffff;
    border-color: #fb923c;
    background: var(--clear-project);
}

.app-header .button-clear-project:hover:not(:disabled) {
    color: #ffffff;
    border-color: #fdba74;
    background: var(--clear-project-dark);
}

/* =========================================================
   NAGŁÓWEK EDYCJI POLA Z NAZWĄ WŁASNĄ
   ========================================================= */

.field-title-card {
    display: grid;
    grid-template-columns:
        minmax(220px, 1fr)
        minmax(300px, 1.55fr)
        minmax(130px, auto);
    align-items: center;
    gap: 28px;
    min-height: 154px;
    padding: 26px 30px;
}

.field-title-identification {
    min-width: 0;
}

.field-title-identification h3 {
    margin: 3px 0;
    font-size: 29px;
    line-height: 1.15;
}

.field-title-identification p {
    margin: 0;
    overflow: hidden;
    color: var(--muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.field-custom-name {
    min-width: 0;
    width: 100%;
    max-width: 560px;
    justify-self: center;
}

.field-custom-name label {
    display: block;
    margin-bottom: 7px;
    color: var(--secondary-dark);
    font-size: 13px;
    font-weight: 750;
}

.field-custom-name input {
    width: 100%;
    min-height: 46px;
    padding: 10px 13px;
    border: 1px solid #b8c7d4;
    border-radius: var(--radius-small, 8px);
    color: var(--text);
    background: rgba(255, 255, 255, 0.96);
    font-size: 15px;
    font-weight: 650;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.field-custom-name input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.field-custom-name input:hover {
    border-color: #90a4b6;
}

.field-custom-name input:focus {
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(35, 116, 71, 0.13);
}

.field-custom-name .field-help {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.35;
}

.field-title-card .field-title-meta {
    align-self: center;
    min-width: 125px;
    text-align: right;
}

.field-title-card .field-title-meta span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.field-title-card .field-title-meta strong {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    margin-top: 4px;
    color: var(--primary-dark);
    font-size: 22px;
}

/* Nagłówek nawożenia pozostaje układem poziomym flex. */
.fertilization-title-card {
    display: flex;
    grid-template-columns: none;
}

/* =========================================================
   NAZWA WŁASNA W TABELACH
   ========================================================= */

.field-custom-name-table {
    display: block;
    max-width: 180px;
    margin-top: 3px;
    overflow: hidden;
    color: var(--primary-dark);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.data-table tbody tr:hover .field-custom-name-table {
    color: var(--primary);
}

/* =========================================================
   NAZWA WŁASNA W NAWIGACJI BOCZNEJ
   ========================================================= */

.field-navigation-text strong {
    color: var(--text);
}

.field-navigation-button.active .field-navigation-text strong {
    color: var(--primary-dark);
}

.field-navigation-text span {
    margin-top: 2px;
}

/* =========================================================
   NOWE POLA NAWOZU MINERALNEGO
   ========================================================= */

#mineralFertilizerPurpose {
    font-weight: 650;
}

#mineralFertilizerActiveNitrogenKgHa {
    color: var(--primary-dark);
    font-weight: 800;
    background: var(--primary-light);
}

#mineralFertilizerActiveNitrogenKgHa + span {
    color: var(--primary-dark);
    border-color: #b9ddc5;
    background: var(--primary-light);
}

#mineralFertilizerForm .field-help {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.35;
}

/* =========================================================
   KOLUMNA AKCJI I USUWANIE POLA
   ========================================================= */

.field-actions-column,
.field-actions-cell {
    width: 116px;
    min-width: 116px;
    text-align: center !important;
}

.field-actions-cell {
    white-space: nowrap;
}

.field-actions {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.field-actions .button {
    min-height: 38px;
    padding: 8px 12px;
}

.delete-field-button {
    display: inline-grid;
    place-items: center;
    flex: 0 0 38px;
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0;
    color: var(--danger);
    border: 1px solid #fecaca;
    border-radius: var(--radius-small, 8px);
    background: var(--danger-light);
    cursor: pointer;
    transition:
        color 0.18s ease,
        background-color 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.18s ease;
}

.delete-field-button:hover:not(:disabled) {
    color: #ffffff;
    border-color: var(--danger);
    background: var(--danger);
    box-shadow: 0 5px 12px rgba(185, 28, 28, 0.20);
    transform: translateY(-1px);
}

.delete-field-button:active {
    transform: translateY(0);
}

.delete-field-button:focus-visible {
    outline: 3px solid rgba(185, 28, 28, 0.22);
    outline-offset: 2px;
}

.delete-field-icon {
    display: block;
    width: 18px;
    height: 18px;
    pointer-events: none;
}

/* =========================================================
   KARTY NAWOZÓW
   ========================================================= */

.fertilizer-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    min-width: 80px;
}

.fertilizer-actions .icon-button,
.fertilizer-item > .icon-button,
.fertilizer-item > .addon-edit-button {
    position: static !important;
    float: none !important;
    flex: 0 0 36px;
    margin: 0 !important;
}

/* Nawozy naturalne: równoważnik pozostaje w danych,
   ale jest ukryty w interfejsie zgodnie z wcześniejszą decyzją. */
#naturalFertilizersList .fertilizer-item > .fertilizer-value:nth-of-type(4) {
    display: none !important;
}

#naturalFertilizersList .fertilizer-item {
    grid-template-columns:
        minmax(240px, 2fr)
        minmax(115px, 1fr)
        minmax(130px, 1fr)
        minmax(145px, 1fr)
        auto;
}

/* =========================================================
   RĘCZNE WPROWADZANIE
   ========================================================= */

.entry-mode-tab:focus-visible {
    outline: 3px solid rgba(35, 116, 71, 0.22);
    outline-offset: 2px;
}

.manual-entry-message {
    margin-top: 18px;
    font-size: 14px;
    font-weight: 650;
}

.manual-row-actions {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
}

.manual-row-actions .button {
    min-width: 76px;
    min-height: 36px;
    padding: 8px 12px;
    font-size: 12px;
}

.manual-row-actions .delete-field-button {
    min-width: 38px;
    width: 38px;
    min-height: 38px;
    height: 38px;
    padding: 0;
}

/* =========================================================
   NAGŁÓWEK Z DODATKOWYM PRZYCISKIEM
   ========================================================= */

@media (max-width: 1280px) {
    .header-content {
        align-items: flex-start;
    }

    .header-actions {
        max-width: 760px;
    }

    .autosave-status {
        flex-basis: 100%;
        margin-right: 0;
        text-align: right;
    }
}

/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1050px) {
    .field-title-card {
        grid-template-columns:
            minmax(200px, 0.9fr)
            minmax(260px, 1.35fr)
            minmax(115px, auto);
        gap: 20px;
        padding: 24px;
    }
}

@media (max-width: 900px) {
    .field-title-card {
        grid-template-columns: 1fr;
        align-items: stretch;
        gap: 20px;
    }

    .field-custom-name {
        width: 100%;
        max-width: none;
        justify-self: stretch;
    }

    .field-title-card .field-title-meta {
        min-width: 0;
        text-align: left;
    }

    .app-header {
        position: static;
    }

    .header-actions {
        width: 100%;
        max-width: none;
        justify-content: flex-start;
    }

    .autosave-status {
        width: 100%;
        margin: 0 0 5px;
        text-align: left;
    }
}

/* =========================================================
   TELEFON
   ========================================================= */

@media (max-width: 680px) {
    .field-title-card {
        min-height: auto;
        padding: 20px 17px;
    }

    .field-title-identification h3 {
        font-size: 27px;
    }

    .field-custom-name input {
        min-height: 44px;
        font-size: 16px;
    }

    .field-actions-column,
    .field-actions-cell {
        width: 96px;
        min-width: 96px;
    }

    .header-actions .button-clear-project {
        flex-basis: 100%;
    }

    #naturalFertilizersList .fertilizer-item {
        grid-template-columns: 1fr;
    }

    .fertilizer-actions {
        grid-column: auto;
        justify-content: flex-start !important;
    }

    .manual-row-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .manual-row-actions .button,
    .manual-row-actions .delete-field-button {
        width: 100%;
    }
}

/* =========================================================
   DRUK INTERFEJSU
   ========================================================= */

@media print {
    .field-custom-name input {
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    .field-custom-name .field-help,
    .delete-field-button,
    .button-clear-project {
        display: none !important;
    }
}
