:root {
    --bg-main: #0b0f19;
    --bg-card: #141e30;
    --bg-card-light: #1e293b;
    --border: #26364f;
    --border-soft: #334155;

    --accent: #76c893;
    --accent-hover: #52b788;
    --accent-dark: #0f5132;

    --danger: #ef4444;
    --danger-hover: #dc2626;

    --success: #10b981;
    --warning: #f59e0b;
    --blue: #38bdf8;

    --text-main: #ffffff;
    --text-muted: #94a3b8;
    --text-soft: #cbd5e1;

    --radius: 16px;
    --shadow: 0 14px 35px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(118, 200, 147, 0.10), transparent 32%),
        radial-gradient(circle at top right, rgba(56, 189, 248, 0.08), transparent 28%),
        var(--bg-main);
    color: var(--text-main);
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

/* ========================= */
/* POMOCNICZE */
/* ========================= */

.hidden {
    display: none !important;
}

.error-message {
    display: none;
    margin-top: 16px;
    color: #fca5a5;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

.badge {
    display: inline-block;
    margin-bottom: 14px;
    padding: 5px 13px;
    border-radius: 999px;
    background: rgba(118, 200, 147, 0.14);
    color: var(--accent);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.4px;
}

hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 24px 0;
}

/* ========================= */
/* LOGOWANIE */
/* ========================= */

.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 450px;
    background: rgba(20, 30, 48, 0.96);
    border: 1px solid var(--border-soft);
    border-radius: 22px;
    padding: 38px;
    box-shadow: var(--shadow);
    text-align: center;
}

.login-logo {
    width: 92px;
    height: 92px;
    object-fit: contain;
    border-radius: 50%;
    border: 2px solid var(--accent);
    box-shadow: 0 0 30px rgba(118, 200, 147, 0.22);
    margin-bottom: 18px;
}

.login-card h1 {
    color: var(--accent);
    font-size: 32px;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.login-card p {
    color: var(--text-muted);
    margin-bottom: 26px;
}

/* ========================= */
/* APLIKACJA */
/* ========================= */

.app-screen {
    min-height: 100vh;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(20, 30, 48, 0.96);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);

    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 24px;

    padding: 14px 28px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 170px;
}

.brand-logo {
    width: 46px;
    height: 46px;
    object-fit: contain;
    border-radius: 50%;
    border: 1px solid var(--accent);
}

.brand strong {
    display: block;
    color: var(--accent);
    font-size: 23px;
    letter-spacing: 1px;
}

.brand span {
    display: block;
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 2px;
}

.main-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.nav-link {
    border: none;
    background: transparent;
    color: var(--text-muted);
    padding: 10px 15px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    transition: 0.2s;
}

.nav-link:hover,
.nav-link.active {
    background: var(--accent);
    color: #07110c;
}

.user-box {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

#user-info {
    color: var(--text-muted);
    font-size: 13px;
    white-space: nowrap;
}

.container {
    width: 100%;
    max-width: 1480px;
    margin: 30px auto;
    padding: 0 22px 50px;
}

/* ========================= */
/* SEKCJE */
/* ========================= */

.app-section {
    display: none;
}

.app-section.active-section {
    display: block;
}

.hero-card,
.card,
.stat-card {
    background: rgba(20, 30, 48, 0.96);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero-card {
    padding: 34px;
    margin-bottom: 26px;
}

.hero-card h1 {
    font-size: 32px;
    margin-bottom: 10px;
}

.hero-card p,
.card p {
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 14px;
}

.card {
    padding: 26px;
    margin-bottom: 24px;
}

.card h2 {
    font-size: 21px;
    margin-bottom: 18px;
    padding-left: 11px;
    border-left: 4px solid var(--accent);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.card-header h2 {
    margin-bottom: 0;
}

/* ========================= */
/* PULPIT */
/* ========================= */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(170px, 1fr));
    gap: 18px;
    margin-bottom: 26px;
}

.stat-card {
    padding: 22px;
}

.stat-card span {
    display: block;
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 10px;
}

.stat-card strong {
    display: block;
    font-size: 26px;
    color: var(--accent);
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(230px, 1fr));
    gap: 22px;
}

/* ========================= */
/* UKŁADY */
/* ========================= */

.layout-two {
    display: grid;
    grid-template-columns: repeat(3, minmax(230px, 1fr));
    gap: 22px;
    align-items: start;
}

#section-uslugi .uslugi-layout {
    display: grid;
    grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

@media (max-width: 1700px) {
    #section-uslugi .uslugi-layout {
        grid-template-columns: 1fr;
    }

    #section-uslugi #card-uslugi-form {
        max-width: 520px;
    }

    #section-uslugi .card {
        width: 100%;
    }
}

@media (max-width: 1400px) {
    #section-uslugi .uslugi-layout {
        grid-template-columns: 1fr;
    }
}

/* Jeśli formularz jest ukryty, wymuś jednokolumnowy układ i pełną szerokość listy */
#section-uslugi .uslugi-layout:has(#card-uslugi-form[hidden]),
#section-uslugi .uslugi-layout:has(#card-uslugi-form.hidden),
#section-uslugi .uslugi-layout:has(#card-uslugi-form[style*="display: none"]) {
    grid-template-columns: 1fr;
}

#section-uslugi .uslugi-layout:has(#card-uslugi-form[hidden]) .card,
#section-uslugi .uslugi-layout:has(#card-uslugi-form.hidden) .card,
#section-uslugi .uslugi-layout:has(#card-uslugi-form[style*="display: none"]) .card {
    width: 100%;
    max-width: 100%;
}

#section-wycena .layout-two {
    grid-template-columns: minmax(320px, 420px) minmax(520px, 1fr);
    align-items: start;
}

#section-wycena .layout-two > .card:first-child {
    max-width: 420px;
}

/* Small inline action buttons in Wycena table */
.wycena-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
}

.tiny-btn {
    padding: 6px 8px;
    font-size: 13px;
    border-radius: 8px;
    min-width: 0;
}

#section-wycena .table-wrapper td:last-child .wycena-actions .btn {
    padding: 6px 8px;
    min-width: 0;
}

#section-wycena .table-wrapper {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 520px;
}

#section-wycena .table-wrapper table {
    min-width: 940px;
    width: 100%;
}

#section-wycena .table-wrapper thead th,
#section-wycena .table-wrapper td {
    padding: 14px 16px;
    line-height: 1.45;
    white-space: nowrap;
}

#section-wycena .table-wrapper td {
    max-width: none;
    overflow: visible;
    text-overflow: clip;
}

#section-wycena .table-wrapper th:last-child,
#section-wycena .table-wrapper td:last-child {
    width: 130px;
    min-width: 130px;
    text-align: right;
}

#section-wycena .table-wrapper td:last-child .btn {
    min-width: 92px;
}

#section-wycena .table-wrapper td:first-child {
    min-width: 240px;
}

#section-wycena .summary-panel {
    display: grid;
    gap: 18px;
}

#section-wycena .summary-boxes {
    gap: 16px;
}

#section-wycena .summary-box {
    min-width: 180px;
    padding: 16px 18px;
}

#section-wycena .summary-box strong {
    font-size: 18px;
}

#section-wycena .summary-box.total strong {
    font-size: 20px;
}

#section-inwestycje .layout-two {
    grid-template-columns: minmax(320px, 420px) minmax(560px, 1fr);
    align-items: start;
}

#section-inwestycje .layout-two > .card:first-child {
    max-width: 420px;
}

#section-inwestycje .table-wrapper {
    max-height: 420px;
    overflow-y: auto;
    overflow-x: auto;
}

#section-inwestycje .table-wrapper table {
    width: 100%;
    table-layout: fixed;
}

#section-inwestycje .table-wrapper thead th,
#section-inwestycje .table-wrapper td {
    padding: 14px 16px;
    line-height: 1.45;
}

#section-inwestycje .table-wrapper td {
    white-space: normal;
    overflow-wrap: break-word;
    max-width: none;
    overflow: visible;
    text-overflow: clip;
}

#section-inwestycje .table-wrapper th:nth-child(1),
#section-inwestycje .table-wrapper td:nth-child(1) {
    width: 26%;
}

#section-inwestycje .table-wrapper th:nth-child(2),
#section-inwestycje .table-wrapper td:nth-child(2) {
    width: 18%;
}

#section-inwestycje .table-wrapper th:nth-child(3),
#section-inwestycje .table-wrapper td:nth-child(3),
#section-inwestycje .table-wrapper th:nth-child(4),
#section-inwestycje .table-wrapper td:nth-child(4),
#section-inwestycje .table-wrapper th:nth-child(5),
#section-inwestycje .table-wrapper td:nth-child(5) {
    width: 13%;
    white-space: nowrap;
}

#section-inwestycje .table-wrapper th:nth-child(6),
#section-inwestycje .table-wrapper td:nth-child(6) {
    width: 17%;
    min-width: 260px;
    white-space: nowrap;
    overflow: visible;
}

#section-inwestycje .table-wrapper td:first-child small {
    display: block;
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 4px;
    line-height: 1.3;
}

#section-inwestycje .table-wrapper th:last-child,
#section-inwestycje .table-wrapper td:last-child {
    text-align: right;
}

#section-inwestycje .table-wrapper td:first-child {
    min-width: 180px;
}

/* Make specific investment panel sections full-width and tables more readable */
#section-inwestycje .full-row {
    display: block;
    margin-top: 18px;
}

#section-inwestycje .full-row .card.inner-card {
    width: 100%;
    max-width: none;
}

/* Allow horizontal scrolling inside each table card to avoid page layout shift */
#section-inwestycje .table-wrapper {
    overflow-x: auto;
    overflow-y: auto;
}

#section-inwestycje .table-wrapper table {
    width: 100%;
    table-layout: auto;
    min-width: 720px; /* ensures columns keep readable widths; table can scroll horizontally */
}

#section-inwestycje .table-wrapper thead th,
#section-inwestycje .table-wrapper td {
    padding: 12px 16px;
    white-space: nowrap; /* prevent ugly wrapping that makes tables tall; allow horizontal scroll */
}

#section-inwestycje .table-wrapper td {
    overflow: visible;
    text-overflow: clip;
}

#section-inwestycje .table-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
}

#section-inwestycje .table-actions::before,
#section-inwestycje .table-actions::after {
    display: none;
    content: none;
}

#section-inwestycje .investycje-actions {
    display: flex;
    flex-direction: row;
    gap: 8px;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    white-space: nowrap;
}

#section-inwestycje .table-actions .btn,
#section-inwestycje .investycje-actions .btn {
    outline: none;
    box-shadow: none;
}

#section-inwestycje .table-actions .btn:focus,
#section-inwestycje .investycje-actions .btn:focus {
    outline: none;
    box-shadow: none;
}

#section-inwestycje .table-actions .btn {
    min-width: 80px;
    white-space: nowrap;
    flex: 0 0 auto;
}

#section-inwestycje .table-wrapper td:last-child {
    overflow: visible;
    text-overflow: clip;
}

#section-inwestycje .table-wrapper tbody tr {
    border-bottom: 1px solid var(--border-soft);
}

#section-inwestycje .table-wrapper td,
#section-inwestycje .table-wrapper th {
    color: var(--text-soft);
}

#section-inwestycje .table-wrapper td:first-child {
    color: var(--text-main);
    font-weight: 500;
}

.table-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

#section-uslugi td:last-child,
#section-uslugi th:last-child {
    width: 190px;
    min-width: 190px;
    white-space: nowrap;
    text-align: right;
}

#section-uslugi .table-actions,
#section-uslugi td:last-child .table-actions {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
    white-space: nowrap;
}

#section-uslugi td:last-child button,
#section-uslugi .table-actions button {
    min-width: 72px;
    white-space: nowrap;
    flex: 0 0 auto;
}

#section-uslugi table td,
#section-uslugi table th {
    padding: 12px 14px;
    vertical-align: middle;
}

#section-uslugi .table-wrapper table {
    width: 100%;
    table-layout: fixed;
}

#section-uslugi .table-wrapper thead th {
    font-size: 13px;
}

#section-uslugi .table-wrapper td:first-child {
    color: var(--text-main);
    font-weight: 500;
}

/* ========================= */
/* TABELE — OSTATNIE DANE */
/* ========================= */

.table-wrapper {
    max-height: 380px;
    overflow-y: auto;
    border-radius: 10px;
    border: 1px solid var(--border-soft);
}

.table-wrapper table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table-wrapper thead {
    position: sticky;
    top: 0;
    background: rgba(30, 41, 59, 0.98);
    border-bottom: 2px solid var(--border);
}

.table-wrapper th {
    padding: 13px 15px;
    text-align: left;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.table-wrapper tbody tr {
    border-bottom: 1px solid var(--border-soft);
    transition: background-color 0.2s;
}

.table-wrapper tbody tr:hover {
    background: rgba(118, 200, 147, 0.06);
}

.table-wrapper td {
    padding: 12px 15px;
    color: var(--text-soft);
    word-break: break-word;
    overflow-wrap: break-word;
}

.table-wrapper td:first-child {
    color: var(--text-main);
    font-weight: 500;
}

/* Wyrównaj kwoty do prawej */
.table-wrapper th:last-child,
.table-wrapper td:last-child {
    text-align: right;
    padding-right: 20px;
}

/* Ellipsis dla długich tekstów */
.table-wrapper td {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table-wrapper::-webkit-scrollbar {
    width: 8px;
}

.table-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: var(--border-soft);
    border-radius: 4px;
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

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

.form-group {
    margin-bottom: 17px;
    text-align: left;
    position: relative;
    overflow: visible;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

label {
    display: block;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 650;
    margin-bottom: 8px;
}

input,
select,
textarea {
    width: 100%;
    background: var(--bg-card-light);
    color: var(--text-main);
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    padding: 12px 13px;
    font-size: 14px;
    outline: none;
    transition: 0.2s;
}

textarea {
    min-height: 90px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(118, 200, 147, 0.12);
}

select option {
    background: var(--bg-card);
    color: var(--text-main);
}

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

.btn {
    border: none;
    border-radius: 10px;
    padding: 12px 17px;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    transition: 0.2s;
    text-align: center;
}

.btn-main {
    width: 100%;
    background: var(--accent);
    color: #07110c;
}

.btn-main:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    width: 100%;
    background: var(--bg-card-light);
    color: var(--text-main);
    border: 1px solid var(--border-soft);
}

.btn-secondary:hover {
    border-color: var(--accent);
    background: #26364f;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: var(--danger-hover);
}

.small-btn {
    width: auto;
    padding: 8px 12px;
}

.btn-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* ========================= */
/* PANEL EDYCJI POZYCJI */
/* ========================= */

#panel-edycji-pozycji {
    display: none;
    margin-top: 18px;
}

#panel-edycji-pozycji.visible {
    display: block;
}

/* ========================= */
/* TOOLBARY */
/* ========================= */

.toolbar {
    display: grid;
    grid-template-columns: 1fr 230px;
    gap: 14px;
    margin-bottom: 20px;
    background: rgba(30, 41, 59, 0.65);
    border: 1px solid var(--border-soft);
    padding: 16px;
    border-radius: 14px;
}

.magazyn-toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
}

.magazyn-scroll {
    max-height: 420px;
    overflow-y: auto;
}
 
 .terminarz-toolbar {
     display: flex;
     flex-wrap: wrap;
     gap: 12px;
     margin-bottom: 16px;
 }
 
 .terminarz-toolbar input,
 .terminarz-toolbar select {
     flex: 1 1 180px;
     padding: 10px 12px;
     border-radius: 12px;
     border: 1px solid var(--border-soft);
     background: var(--surface);
     color: var(--text);
 }
 
 .terminarz-scroll {
     max-height: 420px;
     overflow-y: auto;
     overflow-x: auto;
 }
 
 #section-terminarz .terminarz-scroll table {
     min-width: 1050px;
     width: 100%;
     border-collapse: collapse;
 }
 
 #section-terminarz .terminarz-scroll th,
 #section-terminarz .terminarz-scroll td {
     padding: 12px 14px;
     white-space: nowrap;
     text-align: left;
 }
 
 #section-terminarz .terminarz-scroll th:nth-child(1),
 #section-terminarz .terminarz-scroll td:nth-child(1) {
     width: 170px;
 }
 
 #section-terminarz .terminarz-scroll th:nth-child(2),
 #section-terminarz .terminarz-scroll td:nth-child(2) {
     width: 160px;
 }
 
 #section-terminarz .terminarz-scroll th:nth-child(3),
 #section-terminarz .terminarz-scroll td:nth-child(3) {
     width: 220px;
 }
 
 #section-terminarz .terminarz-scroll th:nth-child(4),
 #section-terminarz .terminarz-scroll td:nth-child(4) {
     width: 130px;
 }
 
 #section-terminarz .terminarz-scroll th:nth-child(5),
 #section-terminarz .terminarz-scroll td:nth-child(5) {
     width: 130px;
 }
 
 #section-terminarz .terminarz-scroll th:nth-child(6),
 #section-terminarz .terminarz-scroll td:nth-child(6) {
     min-width: 220px;
     max-width: 220px;
     overflow: hidden;
     text-overflow: ellipsis;
 }
 
 #section-terminarz .terminarz-scroll th:nth-child(7),
 #section-terminarz .terminarz-scroll td:nth-child(7) {
     width: 70px;
 }
 
 #section-terminarz .terminarz-scroll th:nth-child(8),
 #section-terminarz .terminarz-scroll td:nth-child(8) {
     width: 100px;
 }
 
 #section-terminarz .terminarz-scroll td:last-child .btn {
     min-width: 80px;
 }
 
 #section-terminarz .layout-two {
     grid-template-columns: 360px 1fr;
     grid-template-areas:
         "form right"
         "form list";
 }
 
 #section-terminarz #card-terminarz-form {
     grid-area: form;
 }
 
 #section-terminarz .calendar-card {
     grid-area: right;
     width: 100%;
     margin-bottom: 18px;
     padding: 16px;
     background: rgba(30, 41, 59, 0.88);
     border: 1px solid var(--border-soft);
     border-radius: 18px;
 }
 
 #section-terminarz .layout-two > .card:last-child {
     grid-area: list;
     width: 100%;
 }
 
 .calendar-header {
     display: flex;
     align-items: center;
     justify-content: space-between;
     gap: 12px;
     margin-bottom: 14px;
 }
 
 .calendar-title {
     font-size: 1rem;
     font-weight: 700;
     color: var(--text-main);
     text-transform: none;
 }
 
 #terminarz-calendar {
     width: 100%;
 }
 
 .calendar-grid {
     display: grid;
     grid-template-columns: repeat(7, minmax(110px, 1fr));
     gap: 6px;
     width: 100%;
 }
 
 .calendar-weekday {
     text-align: center;
     font-weight: 700;
     padding: 8px;
     color: var(--text-muted);
 }
 
 .calendar-day {
     min-height: 42px;
     border-radius: 12px;
     padding: 8px;
     display: flex;
     align-items: flex-start;
     justify-content: flex-start;
     font-size: 16px;
     font-weight: 800;
     color: var(--text-main);
     cursor: pointer;
     background: rgba(255, 255, 255, 0.05);
     transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
     overflow: hidden;
     text-overflow: ellipsis;
     white-space: nowrap;
 }
 
 .calendar-day:hover {
     transform: translateY(-1px);
     box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
 }
 .calendar-title {
     font-size: 1.15rem;
     font-weight: 800;
     color: var(--text-main);
     text-transform: capitalize;
 }

 
 .calendar-day.free {
     background: rgba(34, 197, 94, 0.12);
     color: #16a34a;
     border-color: rgba(34, 197, 94, 0.24);
 }
 
 .calendar-day.busy {
     background: rgba(239, 68, 68, 0.16);
     color: #b91c1c;
     border-color: rgba(239, 68, 68, 0.3);
 }
 
 .calendar-day.reserved {
     background: rgba(245, 158, 11, 0.16);
     color: #b45309;
     border-color: rgba(245, 158, 11, 0.3);
 }

.calendar-day.multiple {
    background: rgba(139, 92, 246, 0.12); /* fioletowy */
    color: #6b21a8;
    border-color: rgba(139, 92, 246, 0.24);
}

/* Mini calendar on dashboard uses separate class names; keep colors consistent */
.pulpit-calendar-day.free {
    background: rgba(34, 197, 94, 0.12);
    color: #16a34a;
}
.pulpit-calendar-day.busy {
    background: rgba(239, 68, 68, 0.16);
    color: #b91c1c;
}
.pulpit-calendar-day.reserved {
    background: rgba(245, 158, 11, 0.16);
    color: #b45309;
}
.pulpit-calendar-day.multiple {
    background: rgba(139, 92, 246, 0.12);
    color: #6b21a8;
}

.calendar-day.attention,
.pulpit-calendar-day.attention {
    background: rgba(245, 158, 11, 0.2);
    color: #92400e;
    border-color: rgba(245, 158, 11, 0.48);
}
 
 .calendar-day.empty {
     background: transparent;
     border: none;
     cursor: default;
 }
 
 .calendar-day.today {
     box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.38);
 }
 
 .calendar-legend {
     display: flex;
     flex-wrap: wrap;
     gap: 12px;
     margin-bottom: 12px;
     color: var(--text-soft);
     font-size: 0.88rem;
 }
 
 .calendar-chip {
     display: inline-block;
     width: 12px;
     height: 12px;
     border-radius: 999px;
     margin-right: 6px;
 }
 
 .calendar-chip.free {
     background: #16a34a;
 }
 
 .calendar-chip.busy {
     background: #b91c1c;
 }
 
 .calendar-chip.reserved {
     background: #b45309;
 }

.calendar-chip.multiple {
    background: #6b21a8;
}

.calendar-badge {
    display: inline-flex;
    min-width: 20px;
    height: 20px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(0,0,0,0.15);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    margin-left: 8px;
    padding: 0 6px;
}
 
 .status-tag {
     display: inline-block;
     padding: 4px 10px;
     border-radius: 999px;
     font-size: 0.82rem;
     font-weight: 700;
     text-transform: capitalize;
     border: 1px solid transparent;
 }

.status-tag-success {
    background: #22c55e;
    color: #0f172a;
    border-color: rgba(34, 197, 94, 0.4);
}

.status-tag-warning {
    background: #fde047;
    color: #1f2937;
    border-color: rgba(253, 224, 71, 0.4);
}
/* Buttons for kosztorys status */
.btn-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 130px;
    padding: 10px 14px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: none;
    white-space: nowrap;
    cursor: default;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn-status:disabled {
    opacity: 1;
    cursor: default;
}
.btn-status-pending {
    background: #f59e0b;
    color: #07110c;
    border: 1px solid #d97706;
}
.btn-status-pending:hover:not(:disabled) {
    background: #d97706;
    color: #ffffff;
}
.btn-status-accepted {
    background: #22c55e;
    color: #074214;
    border: 1px solid #16a34a;
}
.btn-status-accepted:hover:not(:disabled) {
    background: #16a34a;
    color: #ffffff;
}
 
 .status-zaplanowane {
     background: rgba(59, 130, 246, 0.15);
     color: #1d4ed8;
     border-color: rgba(59, 130, 246, 0.3);
 }
 
 .status-w-trakcie {
     background: rgba(34, 197, 94, 0.15);
     color: #15803d;
     border-color: rgba(34, 197, 94, 0.3);
 }
 
 .status-zakończone,
 .status-zakonczone {
     background: rgba(34, 197, 94, 0.12);
     color: #15803d;
     border-color: rgba(34, 197, 94, 0.3);
 }

.status-zrealizowane {
    background: rgba(148, 163, 184, 0.16);
    color: #475569;
    border-color: rgba(148, 163, 184, 0.32);
}

.status-zakonczona-pi {
    background: rgba(34, 197, 94, 0.14);
    color: #15803d;
    border-color: rgba(34, 197, 94, 0.35);
}

.status-do-wykonania {
    background: rgba(20, 184, 166, 0.16);
    color: #0f766e;
    border-color: rgba(20, 184, 166, 0.35);
}

.status-po-terminie,
.status-wymaga-potwierdzenia {
    background: rgba(245, 158, 11, 0.18);
    color: #b45309;
    border-color: rgba(245, 158, 11, 0.42);
}
 
 .status-przesunięte,
 .status-przesuniete {
     background: rgba(245, 158, 11, 0.15);
     color: #b45309;
     border-color: rgba(245, 158, 11, 0.3);
 }
 
 .status-odwołane,
 .status-odwolane {
     background: rgba(239, 68, 68, 0.15);
     color: #b91c1c;
     border-color: rgba(239, 68, 68, 0.3);
 }

th,
td {
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

th {
    color: var(--text-muted);
    font-weight: 700;
}

td {
    color: var(--text-soft);
}

.empty-row {
    color: var(--text-muted);
    text-align: center;
    padding: 26px !important;
}

.table-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.table-actions .btn {
    width: auto;
    padding: 7px 10px;
    font-size: 12px;
}

/* ========================= */
/* PODSUMOWANIE WYCENY */
/* ========================= */

.summary-panel {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px dashed var(--border);
}

.correction-box {
    max-width: 360px;
    margin-left: auto;
}

.summary-boxes {
    display: flex;
    justify-content: flex-end;
    gap: 13px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.summary-box {
    min-width: 170px;
    background: var(--bg-card-light);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
}

.summary-box span {
    display: block;
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 6px;
}

.summary-box strong {
    color: var(--text-main);
    font-size: 16px;
}

.summary-box.total {
    border-color: var(--accent);
    background: rgba(118, 200, 147, 0.08);
}

.summary-box.total strong {
    color: var(--accent);
    font-size: 19px;
}

#section-wycena .save-row {
    grid-template-columns: 1fr 170px;
    gap: 12px;
}

.save-row {
    display: grid;
    grid-template-columns: 1fr 170px;
    gap: 12px;
}
.edit-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    padding: 14px 16px;
    border: 1px solid var(--accent);
    border-radius: 14px;
    background: rgba(118, 200, 147, 0.08);
    color: var(--text-main);
}

.edit-panel p {
    margin: 0;
    color: var(--text-main);
    font-size: 14px;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(160px, 1fr));
    gap: 12px;
    margin: 20px 0;
}

.checkbox-grid label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-main);
    padding: 10px 14px;
}

.checkbox-grid label input[type="checkbox"] {
    width: auto;
    padding: 0;
    margin: 0;
    flex: none;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
}

.modal.hidden {
    display: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 14, 28, 0.72);
}

.modal-content {
    position: relative;
    z-index: 1;
    width: min(540px, calc(100% - 32px));
    background: rgba(20, 30, 48, 0.98);
    border: 1px solid var(--border-soft);
    border-radius: 22px;
    padding: 26px;
    box-shadow: var(--shadow);
}

.modal-content h2 {
    margin-bottom: 18px;
    color: var(--accent);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.calendar-attention-modal {
    max-width: 720px;
}

.calendar-attention-list {
    display: grid;
    gap: 10px;
    margin: 14px 0 18px;
}

.calendar-attention-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid rgba(245, 158, 11, 0.32);
    border-radius: 8px;
    background: rgba(245, 158, 11, 0.08);
}

.calendar-attention-item strong,
.calendar-attention-item span,
.calendar-attention-item small {
    display: block;
}

.calendar-attention-item p {
    margin: 6px 0 0;
    color: var(--text-main);
}

.calendar-attention-item small {
    margin-top: 4px;
    color: var(--text-muted);
}

.calendar-attention-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

@media (max-width: 700px) {
    .modal-content {
        width: 100%;
    }

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

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

    .calendar-attention-actions {
        justify-content: flex-start;
    }
}

.modal-content {
    width: min(560px, calc(100% - 32px));
}
/* ========================= */
/* STATUSY */
/* ========================= */

.status-pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.status-aktywna {
    background: rgba(16, 185, 129, 0.14);
    color: #6ee7b7;
}

.status-zakończona {
    background: rgba(56, 189, 248, 0.14);
    color: #7dd3fc;
}

.status-wstrzymana {
    background: rgba(245, 158, 11, 0.16);
    color: #fcd34d;
}

/* ========================= */
/* RESPONSYWNOŚĆ */
/* ========================= */

@media (max-width: 1180px) {
    .topbar {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .main-nav {
        justify-content: flex-start;
    }

    .user-box {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .layout-two {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(170px, 1fr));
    }

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

@media (max-width: 700px) {
    .login-card {
        padding: 28px 22px;
    }

    .container {
        margin: 20px auto;
        padding: 0 12px 35px;
    }

    .topbar {
        padding: 14px;
    }

    .brand strong {
        font-size: 21px;
    }

    .main-nav {
        gap: 7px;
    }

    .nav-link {
        padding: 9px 11px;
        font-size: 13px;
    }

    .hero-card {
        padding: 24px 20px;
    }

    .hero-card h1 {
        font-size: 25px;
    }

    .card {
        padding: 20px;
    }

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

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

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

    .save-row {
        grid-template-columns: 1fr;
    }

    .summary-boxes {
        justify-content: stretch;
    }

    .summary-box {
        width: 100%;
    }

    .correction-box {
        max-width: none;
    }
}

.investment-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.inner-card {
    box-shadow: none;
    background: rgba(30, 41, 59, 0.35);
}

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

/* ========================= */
/* PULPIT KALENDARZ */
/* ========================= */

.pulpit-cards {
    grid-template-columns: repeat(3, minmax(250px, 1fr));
}

@media (max-width: 1200px) {
    .pulpit-cards {
        grid-template-columns: repeat(2, minmax(250px, 1fr));
    }
}

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

#pulpit-calendar-widget {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pulpit-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.pulpit-calendar-title {
    font-weight: 700;
    color: var(--text-main);
    font-size: 14px;
}

.pulpit-calendar-nav {
    display: flex;
    gap: 6px;
}

.pulpit-calendar-nav button {
    background: transparent;
    border: 1px solid var(--border-soft);
    color: var(--text-muted);
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: 0.2s;
}

.pulpit-calendar-nav button:hover {
    background: var(--border-soft);
    color: var(--text-main);
}

.pulpit-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.pulpit-calendar-weekday {
    text-align: center;
    font-weight: 700;
    font-size: 11px;
    color: var(--text-muted);
    padding: 6px 0;
    text-transform: uppercase;
}

.pulpit-calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-soft);
    cursor: pointer;
    transition: transform 0.15s, background 0.15s;
}

.pulpit-calendar-day:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.08);
}

.pulpit-calendar-day.empty {
    background: transparent;
    cursor: default;
    color: transparent;
}

.pulpit-calendar-day.empty:hover {
    transform: none;
    background: transparent;
}

.pulpit-calendar-day.free {
    background: rgba(34, 197, 94, 0.20);
    color: #22c55e;
}

.pulpit-calendar-day.busy {
    background: rgba(239, 68, 68, 0.22);
    color: #fca5a5;
}

.pulpit-calendar-day.reserved {
    background: rgba(245, 158, 11, 0.20);
    color: #fbbf24;
}

.pulpit-calendar-day.today {
    border: 2px solid var(--accent);
}

/* ========================= */
/* ADMIN ALERTS */
/* ========================= */
.admin-alert {
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-weight: 700;
}

.admin-alert.warning {
    background: rgba(245, 158, 11, 0.12);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.22);
}

.admin-alert.danger {
    background: rgba(239, 68, 68, 0.10);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.20);
}

.admin-alert.success {
    background: rgba(16, 185, 129, 0.10);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.16);
}

.admin-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.admin-tab-btn {
    border: 1px solid var(--border-soft);
    background: var(--bg-card-light);
    color: var(--text-main);
    padding: 10px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    transition: 0.2s;
}

.admin-tab-btn.active {
    background: var(--accent);
    color: #07110c;
    border-color: var(--accent);
}

.admin-tab-content {
    display: none;
}

.admin-tab-content.active {
    display: block;
}

.investment-view-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0 0 14px;
}

.investment-view-btn {
    border: 1px solid var(--border-soft);
    background: var(--bg-card-light);
    color: var(--text-main);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
}

.investment-view-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #07110c;
}

.admin-notes-card textarea {
    min-height: 110px;
    resize: vertical;
}

.form-hint {
    display: block;
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 12px;
}

.admin-note-message {
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 8px;
    font-weight: 700;
}

.admin-note-message.success {
    background: rgba(16, 185, 129, 0.12);
    color: #86efac;
    border: 1px solid rgba(16, 185, 129, 0.24);
}

.admin-note-message.warning {
    background: rgba(245, 158, 11, 0.12);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.24);
}

.admin-note-message.danger {
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.24);
}

.admin-notes-list {
    display: grid;
    gap: 12px;
    margin-top: 12px;
}

.admin-note-item {
    padding: 14px;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.42);
}

.admin-note-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 12px;
    flex-wrap: wrap;
}

.admin-note-content {
    color: var(--text-main);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.45;
}

.admin-note-actions {
    margin-top: 12px;
}

.admin-logs-toolbar {
    display: grid;
    grid-template-columns: 1fr 170px;
    gap: 12px;
    margin-bottom: 16px;
}

.admin-logs-scroll {
    max-height: 420px;
    overflow-y: auto;
}

.admin-log-list {
    display: grid;
    gap: 10px;
}

.admin-log-row {
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.admin-log-date {
    display: block;
    margin-bottom: 6px;
    color: var(--text-muted);
    font-size: 12px;
}

.admin-log-meta {
    display: block;
    margin-bottom: 8px;
    color: var(--text-soft);
    font-size: 13px;
}

/* ========================= */
/* AUTOCOMPLETE - WYSZUKIWARKA USŁUG */
/* ========================= */

.autocomplete-box {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card-light);
    border: 1px solid var(--border-soft);
    border-top: none;
    border-radius: 0 0 10px 10px;
    max-height: 360px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.autocomplete-box.visible {
    display: block;
}

.autocomplete-box::-webkit-scrollbar {
    width: 8px;
}

.autocomplete-box::-webkit-scrollbar-track {
    background: transparent;
}

.autocomplete-box::-webkit-scrollbar-thumb {
    background: var(--border-soft);
    border-radius: 4px;
}

.autocomplete-box::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.autocomplete-item {
    padding: 12px 13px;
    cursor: pointer;
    border-bottom: 1px solid rgba(52, 65, 84, 0.5);
    transition: 0.15s;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background: rgba(118, 200, 147, 0.12);
    border-left: 3px solid var(--accent);
    padding-left: 10px;
}

.autocomplete-title {
    display: block;
    color: var(--text-main);
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.autocomplete-meta {
    display: flex;
    gap: 8px;
    color: var(--text-muted);
    font-size: 12px;
}

.autocomplete-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.autocomplete-empty {
    padding: 20px 13px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.warning-row {
    background: rgba(245, 158, 11, 0.08);
    border-left: 4px solid var(--warning);
}


/* ========================= */
/* APK MOBILE V2 - EL-NET */
/* ========================= */

html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    overscroll-behavior-x: none;
}

img,
video,
canvas,
svg {
    max-width: 100%;
}

.app-screen,
.container,
.app-section,
.hero-card,
.card,
.topbar,
.layout-two,
.table-wrapper {
    max-width: 100%;
    min-width: 0;
}

@media (max-width: 900px) {
    body {
        font-size: 15px;
    }

    .topbar {
        position: static !important;
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 10px !important;
        padding: 10px 12px !important;
    }

    .brand {
        min-width: 0 !important;
        gap: 10px !important;
    }

    .brand-logo {
        width: 38px !important;
        height: 38px !important;
    }

    .brand strong {
        font-size: 19px !important;
    }

    .brand span {
        font-size: 11px !important;
    }

    .main-nav {
        width: 100% !important;
        max-width: 100% !important;
        justify-content: flex-start !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch;
        gap: 7px !important;
        padding: 2px 0 7px !important;
        scrollbar-width: thin;
    }

    .main-nav .nav-link {
        flex: 0 0 auto !important;
        white-space: nowrap !important;
        padding: 9px 12px !important;
        font-size: 13px !important;
        border-radius: 999px !important;
    }

    .user-box {
        justify-content: flex-start !important;
        align-items: center !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
        font-size: 12px !important;
    }

    .user-box .btn,
    #btn-logout {
        padding: 9px 12px !important;
        font-size: 13px !important;
    }

    .container {
        width: 100% !important;
        max-width: 100% !important;
        margin: 12px 0 28px !important;
        padding: 0 10px 28px !important;
    }

    .hero-card,
    .card {
        width: 100% !important;
        max-width: 100% !important;
        padding: 17px !important;
        border-radius: 16px !important;
    }

    .hero-card h1,
    .card h2 {
        font-size: 22px !important;
        line-height: 1.18 !important;
    }

    .hero-card p {
        font-size: 14px !important;
    }

    .layout-two,
    .stats-grid,
    .cards-grid,
    .pulpit-cards,
    .investment-summary-grid,
    .form-row,
    .toolbar,
    .save-row,
    .summary-boxes {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }

    input,
    select,
    textarea,
    button {
        max-width: 100% !important;
    }

    .btn {
        min-height: 42px;
    }

    .table-wrapper,
    #section-wycena .table-wrapper,
    #section-inwestycje .table-wrapper,
    #section-uslugi .table-wrapper,
    #section-terminarz .terminarz-scroll {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .table-wrapper table,
    #section-wycena .table-wrapper table,
    #section-inwestycje .table-wrapper table,
    #section-uslugi .table-wrapper table,
    #section-terminarz .terminarz-scroll table {
        width: max-content !important;
        min-width: 720px !important;
        table-layout: auto !important;
    }

    /* TERMINARZ - najważniejsza poprawka po zrzucie z telefonu */
    #section-terminarz .layout-two {
        display: grid !important;
        grid-template-columns: 1fr !important;
        grid-template-areas:
            "form"
            "calendar"
            "list" !important;
        gap: 14px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    #section-terminarz #card-terminarz-form {
        grid-area: form !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    #section-terminarz .calendar-card {
        grid-area: calendar !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 14px !important;
        overflow: hidden !important;
    }

    #section-terminarz .layout-two > .card:last-child {
        grid-area: list !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    #section-terminarz .calendar-header {
        display: grid !important;
        grid-template-columns: auto 1fr auto !important;
        align-items: center !important;
        gap: 8px !important;
        margin-bottom: 10px !important;
    }

    #section-terminarz .calendar-header .btn,
    #section-terminarz .calendar-header .small-btn {
        min-height: 38px !important;
        padding: 8px 10px !important;
        font-size: 12px !important;
        border-radius: 12px !important;
        min-width: 0 !important;
    }

    #section-terminarz .calendar-title {
        text-align: center !important;
        font-size: 17px !important;
        line-height: 1.15 !important;
        white-space: normal !important;
    }

    #section-terminarz .calendar-legend {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px 10px !important;
        font-size: 12px !important;
        line-height: 1.2 !important;
        margin-bottom: 12px !important;
    }

    #section-terminarz .calendar-chip {
        width: 10px !important;
        height: 10px !important;
        margin-right: 5px !important;
    }

    #terminarz-calendar,
    #section-terminarz .calendar-grid {
        width: 100% !important;
        max-width: 100% !important;
    }

    #section-terminarz .calendar-grid {
        grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
        gap: 4px !important;
    }

    #section-terminarz .calendar-weekday {
        padding: 5px 0 !important;
        font-size: 11px !important;
        overflow: hidden !important;
        text-overflow: clip !important;
        white-space: nowrap !important;
    }

    #section-terminarz .calendar-day {
        min-height: 42px !important;
        height: 42px !important;
        padding: 5px !important;
        border-radius: 10px !important;
        font-size: 13px !important;
        line-height: 1 !important;
        align-items: flex-start !important;
        justify-content: flex-start !important;
        white-space: nowrap !important;
    }

    #section-terminarz .calendar-badge {
        min-width: 17px !important;
        height: 17px !important;
        padding: 0 5px !important;
        margin-left: 3px !important;
        font-size: 10px !important;
    }

    #section-terminarz .terminarz-toolbar {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    #section-terminarz .terminarz-scroll {
        max-height: 52vh !important;
        border-radius: 12px !important;
    }

    #section-terminarz .terminarz-scroll table {
        min-width: 860px !important;
    }
}

@media (max-width: 480px) {
    .container {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    .hero-card,
    .card {
        padding: 15px !important;
    }

    .badge {
        font-size: 10px !important;
        padding: 4px 10px !important;
    }

    #section-terminarz .calendar-card {
        padding: 12px !important;
    }

    #section-terminarz .calendar-header {
        grid-template-columns: 1fr 1fr !important;
        grid-template-areas:
            "title title"
            "prev next" !important;
    }

    #calendar-title {
        grid-area: title !important;
        margin-bottom: 2px !important;
    }

    #calendar-prev {
        grid-area: prev !important;
    }

    #calendar-next {
        grid-area: next !important;
    }

    #section-terminarz .calendar-legend {
        grid-template-columns: 1fr 1fr !important;
    }

    #section-terminarz .calendar-day {
        min-height: 36px !important;
        height: 36px !important;
        font-size: 12px !important;
        padding: 4px !important;
        border-radius: 8px !important;
    }

    #section-terminarz .calendar-weekday {
        font-size: 10px !important;
    }
}


/* ========================= */
/* MOBILE V3 - GORNA BELKA I MENU */
/* ========================= */
@media (max-width: 900px) {
    .topbar {
        position: static !important;
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
        grid-template-areas:
            "brand user"
            "nav nav" !important;
        align-items: start !important;
        gap: 12px !important;
        padding: 10px 12px !important;
    }

    .brand {
        grid-area: brand !important;
        min-width: 0 !important;
        align-self: start !important;
    }

    .user-box {
        grid-area: user !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-end !important;
        justify-content: flex-start !important;
        justify-self: end !important;
        text-align: right !important;
        gap: 8px !important;
        min-width: 0 !important;
    }

    #user-info {
        max-width: 190px !important;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        line-height: 1.2 !important;
        font-size: 12px !important;
    }

    #btn-logout,
    .user-box .btn {
        min-height: 40px !important;
        padding: 9px 14px !important;
        border-radius: 14px !important;
    }

    .main-nav {
        grid-area: nav !important;
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        width: 100% !important;
        max-width: 100% !important;
        gap: 8px !important;
        overflow: visible !important;
        padding: 0 !important;
    }

    .main-nav .nav-link {
        width: 100% !important;
        min-width: 0 !important;
        min-height: 42px !important;
        padding: 9px 10px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        white-space: normal !important;
        line-height: 1.15 !important;
        font-size: 13px !important;
        border-radius: 14px !important;
    }
}

@media (max-width: 680px) {
    .topbar {
        grid-template-columns: minmax(0, 1fr) auto !important;
    }

    .main-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    #user-info {
        max-width: 150px !important;
        font-size: 11px !important;
    }

    .brand-logo {
        width: 40px !important;
        height: 40px !important;
    }

    .brand strong {
        font-size: 18px !important;
    }
}


/* ========================= */
/* SZYBKA / INTELIGENTNA WYCENA */
/* ========================= */

.quick-estimate-card {
    margin-bottom: 18px;
    border-color: rgba(118, 200, 147, 0.38);
    background:
        radial-gradient(circle at top right, rgba(118, 200, 147, 0.10), transparent 38%),
        rgba(20, 30, 48, 0.96);
}

.quick-estimate-header {
    align-items: flex-start;
    gap: 14px;
}

.quick-estimate-subtitle {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.45;
}

.quick-estimate-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(118, 200, 147, 0.15);
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.quick-estimate-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.quick-estimate-info {
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(245, 158, 11, 0.28);
    border-radius: 12px;
    background: rgba(245, 158, 11, 0.10);
    color: #fcd34d;
    font-size: 13px;
    line-height: 1.35;
}

.quick-estimate-result {
    margin-top: 14px;
}

.quick-estimate-summary {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
}

.quick-estimate-summary strong {
    color: var(--accent);
    font-size: 17px;
}

.quick-estimate-summary span {
    color: var(--text-muted);
    font-size: 13px;
}

.quick-estimate-table {
    max-width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 14px;
}

.quick-estimate-table table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
}

.quick-estimate-table th,
.quick-estimate-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text-soft);
    font-size: 13px;
    text-align: left;
}

.quick-estimate-table th {
    color: var(--text-muted);
    background: rgba(15, 23, 42, 0.55);
    font-weight: 800;
}

.quick-estimate-total {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.quick-estimate-total span {
    padding: 9px 12px;
    border-radius: 12px;
    background: rgba(30, 41, 59, 0.72);
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.quick-estimate-total strong {
    color: var(--text-main);
}

@media (max-width: 900px) {
    .quick-estimate-header {
        display: grid !important;
        grid-template-columns: 1fr !important;
    }

    .quick-estimate-pill {
        justify-self: start;
    }

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

    .quick-estimate-actions .btn {
        width: 100%;
        min-height: 44px;
    }

    .quick-estimate-total {
        justify-content: stretch;
    }

    .quick-estimate-total span {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .quick-estimate-actions {
        grid-template-columns: 1fr;
    }
}


/* ========================= */
/* USŁUGI - SZERSZA KOLUMNA NAZWA */
/* ========================= */

#section-uslugi .table-wrapper table {
    width: 100%;
    table-layout: fixed !important;
}

#section-uslugi .table-wrapper th:nth-child(1),
#section-uslugi .table-wrapper td:nth-child(1) {
    width: auto !important;
    min-width: 0 !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    overflow-wrap: anywhere !important;
}

#section-uslugi .table-wrapper th:nth-child(2),
#section-uslugi .table-wrapper td:nth-child(2) {
    width: 90px !important;
    min-width: 90px !important;
    max-width: 90px !important;
    text-align: left;
    white-space: nowrap !important;
}

#section-uslugi .table-wrapper th:nth-child(3),
#section-uslugi .table-wrapper td:nth-child(3) {
    width: 135px !important;
    min-width: 135px !important;
    max-width: 135px !important;
    text-align: left;
    white-space: nowrap !important;
}

#section-uslugi .table-wrapper th:nth-child(4),
#section-uslugi .table-wrapper td:nth-child(4) {
    width: 175px !important;
    min-width: 175px !important;
    max-width: 175px !important;
    text-align: right;
    white-space: nowrap !important;
}

#section-uslugi .table-actions,
#section-uslugi td:last-child .table-actions {
    display: flex !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    min-width: 0 !important;
}

@media (max-width: 900px) {
    #section-uslugi .table-wrapper table {
        min-width: 720px !important;
    }

    #section-uslugi .table-wrapper th:nth-child(2),
    #section-uslugi .table-wrapper td:nth-child(2) {
        width: 76px !important;
        min-width: 76px !important;
        max-width: 76px !important;
    }

    #section-uslugi .table-wrapper th:nth-child(3),
    #section-uslugi .table-wrapper td:nth-child(3) {
        width: 120px !important;
        min-width: 120px !important;
        max-width: 120px !important;
    }

    #section-uslugi .table-wrapper th:nth-child(4),
    #section-uslugi .table-wrapper td:nth-child(4) {
        width: 150px !important;
        min-width: 150px !important;
        max-width: 150px !important;
    }
}


/* v11 — czytelniejsza tabela szybkiej wyceny w APK */
.szybka-wycena-wynik,
#szybka-wycena-wynik {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.szybka-wycena-wynik table,
#szybka-wycena-wynik table,
.table-scroll table {
  min-width: 760px;
}

.szybka-wycena-wynik th:first-child,
.szybka-wycena-wynik td:first-child,
#szybka-wycena-wynik th:first-child,
#szybka-wycena-wynik td:first-child {
  min-width: 220px;
  white-space: normal;
}

@media (max-width: 700px) {
  .szybka-wycena-wynik,
  #szybka-wycena-wynik {
    overflow-x: auto;
  }

  .szybka-wycena-wynik table,
  #szybka-wycena-wynik table {
    min-width: 780px;
  }
}
