/* Beautified CSS */
:root {
    --bg: #0b1020;
    --card: #101935;
    --muted: #8e98b3;
    --text: #eaf0ff;
    --accent: #7aa2ff;
    --good: #00c28a;
    --bad: #ff5c7a;
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    background: linear-gradient(180deg, #0b1020, #0a1128 45%, #0b1020);
}

body {
    margin: 0;
    color: var(--text);
    font: 14px/1.5 Figtree, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, "Helvetica Neue", Arial;
}

.wrap {
    max-width: 1140px;
    margin: 40px auto;
}

h1 {
    font-size: clamp(22px, 3.4vw, 34px);
    margin: 0 0 12px;
}

.lead {
    margin: 0 0 18px;
    color: #8e98b3;
}

.grid {
    display: grid;
    grid-template-columns: 0.75fr 1.25fr;
    gap: 20px;
}

@media (max-width: 1100px) {
    .grid {
        grid-template-columns: 1fr;
    }
}

.card {
    background: linear-gradient(180deg, #111a39, #0f1a38);
    border: 1px solid #22305d;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    padding: 18px;
}

.card.wide {
    margin-top: 20px;
}

.section {
    margin-bottom: 16px;
    padding: 16px;
    background-color: hsl(226 56% 12% / 1);
    border-radius: 8px;
}

.section:last-child { margin-bottom:0px; }

.section h2 {
    font-size: 16px;
    color: #b9c5e9;
    margin: 0 0 10px;
    letter-spacing: .2px;
}

label {
    display: block;
    margin: 6px 0 6px;
    color: #c8d2f2;
}

input, select, button {
    font: inherit;
}

input[type="number"], select, input[type="text"] {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    background: #0b1430;
    border: 1px solid #26376c;
    color: #eaf0ff;
}

input[type="range"] {
    width: 100%;
}

/* Jednokolumnowy formularz */
.formCol {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    align-items: start;
}

.inline {
    display: flex;
    gap: 8px;
    align-items: center;
}

.hint {
    font-size: 12px;
    color: #8e98b3;
    margin-top: -4px;
}

.muted {
    color: #8e98b3;
}

.out {
    font-variant-numeric: tabular-nums;
}

.twoCol {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 900px) {
    .twoCol {
        grid-template-columns: 1fr;
    }
}

.badge {
    display: inline-block;
    font-size: 12px;
    padding: 2px 6px;
    border: 1px solid #33498e;
    border-radius: 6px;
    color: #bcd0ff;
    background: #0c1640;
    margin-right: 8px;
}

.pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: #0d1533;
    border: 1px solid #2a3a73;
    color: #c8d2f2;
    font-size: 12px;
    margin-right: 8px;
}

.netto {
    font-size: 26px;
    font-weight: 800;
    color: #00c28a;
}

.danger {
    color: #ff5c7a;
}

.foot {
    margin-top: 12px;
    color: #aab4d7;
    font-size: 12px;
}

.foot.small {
    font-size: 12px;
}

.btnRow {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(180deg, #2745a6, #1d3690);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 10px 14px;
    font-weight: 700;
}

.btn:active {
    transform: translateY(1px);
}

.kbd {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    background: #0d1533;
    border: 1px solid #2a3a73;
    border-radius: 8px;
    padding: 2px 6px;
    font-size: 12px;
}

/* --- Toggle styles --- */
/* Pattern A: input + label (siblings) */
.toggle-a {
    position: relative;
}

.toggle-a input {
    position: absolute;
    opacity: 0;
    left: 0;
    top: 0;
    width: 44px;
    height: 24px;
}

.toggle-a label {
    position: relative;
    padding-left: 56px;
    min-height: 24px;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.toggle-a label:before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 24px;
    background: #23315f;
    border: 1px solid #2a3a73;
    border-radius: 999px;
    transition: .2s;
}

.toggle-a label:after {
    content: "";
    position: absolute;
    left: 2px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background: #94a6e8;
    border-radius: 50%;
    transition: .2s;
}

.toggle-a input:checked + label:before {
    background: #3056f5;
    border-color: #2745a6;
}

.toggle-a input:checked + label:after {
    left: 20px;
    background: #fff;
}

/* Pattern B: label > input + span.slider */
.toggle-b label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.toggle-b input {
    display: none;
}

.toggle-b .slider {
    position: relative;
    min-width: 44px;
    min-height: 26px;
    background: #23315f;
    border: 1px solid #2a3a73;
    border-radius: 999px;
    display: inline-block;
    vertical-align: middle;
    transition: .2s;
}

.toggle-b .slider:after {
    content: "";
    position: absolute;
    left: 2px;
    top: 2px;
    width: 20px;
    height: 20px;
    background: #94a6e8;
    border-radius: 50%;
    transition: .2s;
}

.toggle-b input:checked + .slider {
    background: #3056f5;
    border-color: #2745a6;
}

.toggle-b input:checked + .slider:after {
    left: 20px;
    background: #fff;
}

/* tables */
table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 8px 6px;
    border-bottom: 1px dashed #27366b;
}

th {
    color: #b9c5e9;
    font-weight: 600;
    text-align: left;
}

td.num, th.num {
    text-align: right;
}

.nettoRow td {
    font-weight: 800;
    color: #00c28a;
}

/* Zebra striping for readability */
table tbody tr:nth-child(odd) {
    background: rgba(255,255,255,0.05);
}

table tbody tr:nth-child(even) {
    background: transparent;
}

table tbody tr:hover {
    background: rgba(255,255,255,0.08);
}

.reveal {
    display: none;
}

#annual tr {
    border-radius: 8px;
}

select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: #0b1430;
    border: 1px solid #26376c;
    color: #eaf0ff;
    border-radius: 12px;
    padding: 12px 40px 12px 12px; /* extra right padding for arrow */
    font: inherit;
    width: 100%;
    min-height: 44px; /* match input height, tweak as needed */
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

/* show native arrow by adding a background image on non-Safari, but keep minimal look */
/* Optionally, add custom dropdown arrows using ::after or background-image, if you want to control for all browsers. */ 

select:focus {
    border-color: #7aa2ff;
    box-shadow: 0 0 0 2px rgba(122,162,255,.22);
}

/* Optional: fix Safari focus outline glitch */
select:active,
select:focus {
    outline: none;
}

.inline-header h2{
    display: inline-block;
    margin-right: 8px;
}
.filler{
    display: block;
    height: 40px;
}

#month_summary {
    position: sticky;
    top: 24px;
    z-index: 10;
    background: hsl(226 56% 12% / 1);
}

.foot{
    text-align: center;
    margin-top: 12px;
    margin-bottom: 12px;
}