/* buttons.css - wydzielone style aplikacji. */

.button {
    display: inline-flex;
    min-height: var(--button-height);
    align-items: center;
    justify-content: center;
    gap: .4rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    padding: .45rem .75rem;
    color: inherit;
    font-size: var(--button-font-size);
    font-weight: 850;
    line-height: 1;
    text-align: center;
    transition: background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
}

.button:hover {
    box-shadow: none;
}

.button-small {
    min-height: calc(var(--button-height) - .35rem);
    padding: .4rem .62rem;
    font-size: var(--small-font-size);
}

.button-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: none;
}

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

.button-secondary {
    border-color: var(--border);
    background: var(--surface);
    color: var(--muted);
}

.button-secondary:hover {
    border-color: rgba(0, 108, 73, .22);
    background: var(--primary-soft);
    color: var(--primary);
}

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

.button-danger:hover {
    background: #a61e1e;
}

.button-ghost-danger {
    border-color: var(--border);
    background: var(--surface);
    color: var(--muted);
}

.button-ghost-danger:hover {
    border-color: var(--danger);
    background: var(--danger-soft);
    color: var(--danger);
}


.table-link {
    display: inline-flex;
    min-height: calc(var(--button-height) - .35rem);
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    border: 1px solid rgba(0, 108, 73, .18);
    background: var(--primary-soft);
    padding: .45rem .7rem;
    color: var(--primary-dark);
    font-size: .8rem;
    font-weight: 900;
}

.table-link:hover {
    background: var(--secondary-soft);
}

.table-card {
    overflow: hidden;
}

.table-search,
.table-limit,
.form-control {
    width: 100%;
}

.sow-row,
.sale-row,
.event-row,
.settlement-row,
.bulk-event-row {
    scroll-margin-top: calc(var(--topbar-height) + 1rem);
}

.delete-cell {
    text-align: center;
}

.chronology-note,
.sales-filter-bar {
    margin-bottom: 1.25rem;
}

.remove-row-btn,
.copy-sow,
.ingredient-checkbox {
    flex: 0 0 auto;
}

.row-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: .45rem;
}

.link-button-danger {
    display: inline-flex;
    min-height: calc(var(--button-height) - .35rem);
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: var(--radius);
    background: var(--danger-soft);
    padding: .45rem .65rem;
    color: var(--danger);
    font-size: .8rem;
    font-weight: 900;
}

.link-button-danger:hover {
    background: var(--danger-soft);
}


.mini-button {
    display: inline-flex;
    width: 2.25rem;
    min-width: 2.25rem;
    height: 2.25rem;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--muted);
    font-weight: 950;
    transition: background .18s ease, border-color .18s ease, color .18s ease;
}

.mini-button:hover {
    border-color: rgba(0, 108, 73, .22);
    background: var(--primary-soft);
    color: var(--primary);
}


.pagination-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: var(--panel-padding);
    border-top: 1px solid var(--border);
    background: var(--surface-soft);
}

.pagination-summary {
    color: var(--muted);
    font-size: .85rem;
    font-weight: 850;
}

.pagination-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .35rem;
}

.pagination-button,
.pagination-ellipsis {
    display: inline-flex;
    min-width: 2.4rem;
    min-height: 2.4rem;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    font-size: .85rem;
    font-weight: 900;
}

.pagination-button {
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    transition: background .18s ease, border-color .18s ease, color .18s ease;
}

.pagination-button:hover:not(.is-disabled):not(.is-active) {
    border-color: rgba(0, 108, 73, .22);
    background: var(--primary-soft);
    color: var(--primary);
}

.pagination-button.is-active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
    box-shadow: none;
}

.pagination-button.is-disabled {
    cursor: not-allowed;
    opacity: .45;
}

.pagination-ellipsis {
    color: var(--muted);
}


.button-link {
    border: 0;
    background: transparent;
    color: var(--primary);
    font-weight: 900;
}

.unit-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    padding: .12rem;
}

.unit-toggle button {
    min-height: calc(var(--control-height) - .35rem);
    border: 0;
    border-radius: calc(var(--radius) - .15rem);
    background: transparent;
    color: var(--muted);
    padding: .35rem .62rem;
    font-size: .78rem;
    font-weight: 950;
}

.unit-toggle button.is-active {
    background: var(--primary);
    color: #fff;
}
