/* Likviditetsprognos – scoped styles. All rules live under .likvprg-root
   to avoid leaking into the active WordPress theme. */

.likvprg-root {
    font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    color: #1a1a1a;
    background: rgb(250, 250, 250);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    margin: 1rem 0;
}

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

/* Header */
.likvprg-header {
    background: #FFCE00;
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}
.likvprg-header h2 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 900;
    letter-spacing: -0.01em;
    color: #1a1a1a;
}
.likvprg-header .likvprg-subtitle {
    font-size: 0.875rem;
    color: #4a4a4a;
    margin-top: 0.15rem;
}

/* Toolbar / mode selector */
.likvprg-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    padding: 1rem 1.5rem;
    background: rgb(233, 233, 233);
    border-bottom: 1px solid #d0d0d0;
}
.likvprg-mode-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.likvprg-mode-label {
    font-weight: 700;
    font-size: 0.9rem;
}
.likvprg-segmented {
    display: inline-flex;
    background: #fff;
    border: 1px solid #c4c4c4;
    border-radius: 6px;
    padding: 2px;
}
.likvprg-segmented button {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 0.4rem 1rem;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    border-radius: 4px;
    color: #333;
}
.likvprg-segmented button[aria-pressed="true"] {
    background: #5CC4C4;
    color: #fff;
}
.likvprg-segmented button:focus-visible {
    outline: 2px solid rgb(43, 125, 246);
    outline-offset: 2px;
}

.likvprg-company-field {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.likvprg-company-field input {
    padding: 0.4rem 0.6rem;
    border: 1px solid #c4c4c4;
    border-radius: 4px;
    font: inherit;
    min-width: 200px;
}

.likvprg-actions {
    margin-left: auto;
    display: flex;
    gap: 0.5rem;
}
.likvprg-btn {
    appearance: none;
    border: 0;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    padding: 0.55rem 1rem;
    border-radius: 6px;
    color: #fff;
    background: rgb(43, 125, 246);
    transition: filter 0.15s ease;
}
.likvprg-btn:hover { filter: brightness(0.95); }
.likvprg-btn:focus-visible { outline: 2px solid #1a1a1a; outline-offset: 2px; }
.likvprg-btn--secondary { background: #5CC4C4; color: #1a1a1a; }
.likvprg-btn--ghost { background: transparent; color: #1a1a1a; border: 1px solid #c4c4c4; }

/* Table area */
.likvprg-table-wrap {
    overflow-x: auto;
    background: #fff;
}
.likvprg-table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    min-width: 1100px;
    font-size: 0.875rem;
}
.likvprg-table th,
.likvprg-table td {
    padding: 0.5rem 0.65rem;
    text-align: right;
    border-bottom: 1px solid #ececec;
    white-space: nowrap;
}
.likvprg-table thead th {
    position: sticky;
    top: 0;
    background: #004A6E;
    color: #fff;
    font-weight: 700;
    text-transform: capitalize;
    z-index: 2;
}
.likvprg-table thead th.likvprg-row-label-head {
    text-align: left;
    background: #003a58;
}
.likvprg-table td.likvprg-row-label,
.likvprg-table th.likvprg-row-label-head {
    position: sticky;
    left: 0;
    text-align: left;
    background: #fff;
    font-weight: 600;
    min-width: 280px;
    z-index: 1;
    border-right: 1px solid #ececec;
}
.likvprg-table tbody tr:nth-child(even) td.likvprg-row-label { background: #fafafa; }
.likvprg-table tbody tr:nth-child(even) td:not(.likvprg-row-label) { background: #fafafa; }

/* Section header rows */
.likvprg-section-row td {
    background: #e9e9e9 !important;
    font-weight: 900;
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    color: #004A6E;
}

/* Total / computed rows */
.likvprg-total-row td {
    background: #eef6f6 !important;
    font-weight: 800;
}
.likvprg-result-row td {
    background: #fff7d6 !important;
    font-weight: 900;
    color: #1a1a1a;
    border-top: 2px solid #FFCE00;
}

/* Inputs */
.likvprg-input {
    width: 100%;
    min-width: 90px;
    padding: 0.35rem 0.5rem;
    border: 1px solid transparent;
    border-radius: 4px;
    font: inherit;
    text-align: right;
    background: transparent;
}
.likvprg-input:hover { border-color: #d0d0d0; background: #fff; }
.likvprg-input:focus { outline: none; border-color: rgb(43, 125, 246); background: #fff; box-shadow: 0 0 0 2px rgba(43,125,246,0.18); }
.likvprg-input.is-invalid { border-color: #c0392b; background: #fdecea; }

.likvprg-input[readonly],
.likvprg-input[aria-readonly="true"] {
    color: #333;
    cursor: not-allowed;
}

.likvprg-validation {
    color: #c0392b;
    font-size: 0.75rem;
    padding: 0.5rem 1.5rem;
    min-height: 1rem;
}

/* Footer */
.likvprg-footer {
    background: #004A6E;
    color: #fff;
    padding: 0.9rem 1.5rem;
    font-size: 0.8rem;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.likvprg-footer a { color: #FFCE00; }

/* Responsive */
@media (max-width: 720px) {
    .likvprg-header h2 { font-size: 1.15rem; }
    .likvprg-actions { width: 100%; justify-content: flex-end; }
    .likvprg-company-field input { min-width: 140px; }
}
