:root {
    --primary: #2563eb;
    --bg: #f8fafc;
    --card: #ffffff;
    --text: #1e293b;
    --border: #e2e8f0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 20px;
    line-height: 1.5;
}

.app-container {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 25px;
    max-width: 1600px;
    margin: 0 auto;
}

/* PANEL BOCZNY */
.config-panel {
    background: var(--card);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    position: sticky;
    top: 20px;
    height: fit-content;
    border: 1px solid var(--border);
}

h2, h3 {
    margin-top: 0;
    color: var(--text);
    border-bottom: 2px solid var(--border);
    padding-bottom: 10px;
}

.group {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f1f5f9;
}

label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.sub-label {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 4px;
    display: block;
}

input, select {
    width: 100%;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 0.9rem;
}

.input-row {
    display: flex;
    gap: 8px;
}

.price-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.drawer-btns {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
}

.btn-sm {
    flex: 1;
    padding: 8px 4px;
    font-size: 0.7rem;
    cursor: pointer;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-weight: 600;
}

.btn-sm:hover { background: #f1f5f9; border-color: var(--primary); }

.drawer-preview {
    font-size: 0.8rem;
    background: #f1f5f9;
    padding: 10px;
    border-radius: 6px;
    border-left: 4px solid var(--primary);
}

.add-button {
    width: 100%;
    padding: 15px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.2s;
}

.add-button:hover { background: #1d4ed8; transform: translateY(-1px); }

/* LISTA SZAFEK */
.cabinet-card {
    background: white;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.cabinet-header {
    padding: 15px 20px;
    background: #f8fafc;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.cabinet-content {
    padding: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th {
    text-align: left;
    background: #f8fafc;
    padding: 12px;
    color: #64748b;
    font-size: 0.75rem;
    text-transform: uppercase;
}

td {
    padding: 12px;
    border-bottom: 1px solid #f1f5f9;
}

/* OKLEJANIE CHECKBOXY */
.edge-box {
    display: flex;
    gap: 4px;
}

.edge-box input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* PODSUMOWANIE */
.summary-box {
    background: white;
    padding: 25px;
    border-radius: 15px;
    border: 2px dashed #cbd5e1;
    margin-top: 30px;
}

.total-banner {
    margin-top: 20px;
    padding: 25px;
    background: #1e293b;
    color: white;
    border-radius: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.final-price {
    font-size: 2.2rem;
    font-weight: 800;
    color: #34d399;
}

.btn-action {
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.clear-btn-text {
    background: none;
    border: none;
    font-size: 0.75rem;
    color: #ef4444;
    text-decoration: underline;
    cursor: pointer;
    margin-top: 5px;
}

/* WYDRUK PDF */
@media print {
    .no-print { display: none !important; }
    body { background: white; padding: 0; }
    .app-container { display: block; }
    .cabinet-card { border: 1px solid #000; break-inside: avoid; margin-bottom: 40px; }
    .cabinet-header { background: #eee !important; color: #000 !important; }
    .cabinet-content { display: block !important; }
    .final-price { color: #000; }
    .summary-box { border: 1px solid #000; }
}
/* Ukrywanie zawartości */
.cabinet-content {
    max-height: 5000px; /* Bardzo duża wartość, żeby zmieściło tabelę */
    overflow: hidden;
    transition: max-height 0.4s ease-in-out;
}

/* Kiedy dodasz klasę .collapsed, zawartość się chowa */
.cabinet-card.collapsed .cabinet-content {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
}

/* Obracanie strzałki */
.toggle-icon {
    display: inline-block;
    transition: transform 0.3s;
    margin-right: 10px;
}

.cabinet-card.collapsed .toggle-icon {
    transform: rotate(-90deg);
}