html, body {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
}
body {
    overflow-x: hidden;
}
body {
    margin: 0;
    padding: 20px 5vw;
    box-sizing: border-box;
}
.titleNew {
    font-family: 'Arial', sans-serif;
    font-weight: bold;
    letter-spacing: 1px;
}
.brand-first-letter,
.brand-first-letter-sm {
    color: #ffc107;
    font-size: 1.3em;
}
.navbar-brand {
    transition: transform 0.3s ease;
}
.navbar-brand:hover {
    transform: scale(1.05);
}
.container {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
}

.header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    width: 90%;
    margin-left: auto;
    margin-right: auto;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    display: flex;
    position: 'fixed';
    top: '0';
    left: '0';
    width: '100%';
    zIndex: '1000';
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.header-content {
    flex: 1;
}

.header img {
    height: 60px;
    filter: brightness(0) invert(1);
}

.controls {
    background: white;
    padding: 20px;
    width: 90%;
    margin-left: auto;
    margin-right: auto;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.advanced-tools {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.sort-control, .page-size-control, .quick-actions {
    background: #f8f9ff;
    border: 1px solid #e1e4f2;
    border-radius: 8px;
    padding: 12px;
}

.sort-control label, .page-size-control label {
    font-weight: 600;
    font-size: 13px;
    color: #444;
    display: block;
    margin-bottom: 6px;
}

.sort-row {
    display: flex;
    gap: 8px;
}

.sort-row select, .page-size-control select {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #d0d4e4;
    border-radius: 6px;
    background: white;
}

.quick-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
}

.quick-actions button {
    flex: 1;
    padding: 10px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    color: white;
    transition: all 0.2s ease;
}

.quick-actions .reset-filters {
    background: #009688;
}

.quick-actions .reset-filters:hover {
    background: #00796b;
}

.quick-actions .reset-sort {
    background: #673ab7;
}

.quick-actions .reset-sort:hover {
    background: #512da8;
}

.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.search-bar input {
    flex: 1;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
}

.search-bar input:focus {
    outline: none;
    border-color: #667eea;
}

.filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.filter-group select,
.filter-group input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-top: 1px solid #eee;
}

.stats-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
}

.stats-item strong {
    color: #667eea;
    font-size: 18px;
}

.export-panel {
    display: none;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    background: #fff;
    padding: 14px;
    margin: 14px 0 6px;
    border-radius: 10px;
    border: 1px solid #e1e4f2;
    box-shadow: 0 1px 6px rgba(0,0,0,0.05);
}

.export-title {
    font-weight: 700;
    color: #333;
}

.export-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.export-buttons button {
    border: none;
    border-radius: 6px;
    padding: 10px 14px;
    font-weight: 700;
    cursor: pointer;
    color: white;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.export-buttons button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.btn-export-csv { background: #009688; }
.btn-export-xlsx { background: #4caf50; }
.btn-export-pdf { background: #e53935; }
.btn-export-disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; transform: none; }

.table-container {
    background: white;
    border-radius: 8px;
    overflow-x: auto;
    overflow-y: visible;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    width: 100%;
    min-width: 100%;
    max-width: 100%;
}

table {
    width: 100%;
    min-width: 1200px;
    border-collapse: collapse;
}

thead {
    background: #667eea;
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

th {
    padding: 15px 10px;
    text-align: left;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

th:hover {
    background: #5568d3;
}

th.sortable::after {
    content: ' ⇅';
    opacity: 0.5;
}

th.sort-asc::after {
    content: ' ▲';
    opacity: 1;
}

th.sort-desc::after {
    content: ' ▼';
    opacity: 1;
}

tbody tr {
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

tbody tr:hover {
    background: #f8f9ff;
}

td {
    padding: 12px 10px;
    font-size: 14px;
}

.id-cell {
    font-weight: 600;
    color: #667eea;
}

.id-cell a {
    color: #667eea;
    text-decoration: none;
}

.id-cell a:hover {
    text-decoration: underline;
}

.type-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.type-wydzielony {
    background: #e3f2fd;
    color: #1976d2;
}

.type-masowy {
    background: #fff3e0;
    color: #f57c00;
}

.no-results {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 16px;
}

.loading {
    text-align: center;
    padding: 40px;
    font-size: 18px;
    color: #667eea;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    margin-top: 20px;
}

.pagination button {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: white;
    color: #333;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination button:hover:not(:disabled) {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination .page-info {
    font-size: 14px;
    color: #666;
}

.quick-contact {
    position: fixed;
    right: 20px;
    top: 35%;
    transform: translateY(-50%);
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quick-contact-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 8px 18px rgba(0,0,0,0.2);
    position: relative;
    overflow: visible;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.quick-contact-btn:hover,
.quick-contact-btn:focus {
    transform: translateX(-2px);
    box-shadow: 0 10px 22px rgba(0,0,0,0.24);
    color: #fff;
}

.quick-contact-btn i {
    font-size: 18px;
}

.quick-contact-label {
    position: absolute;
    right: 56px;
    top: 50%;
    transform: translateY(-50%) translateX(8px);
    background: rgba(33, 37, 41, 0.95);
    color: #fff;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.quick-contact-btn:hover .quick-contact-label,
.quick-contact-btn:focus .quick-contact-label,
.quick-contact-btn.contact-open .quick-contact-label {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.quick-contact-phone { background: #f57c00; }
.quick-contact-mail { background: #1e88e5; }
.quick-contact-fb { background: #1877f2; }

/* Admin panel styles */
.admin-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #f57c00;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(245, 124, 0, 0.3);
    z-index: 1000;
    transition: all 0.3s;
}

.admin-btn:hover {
    background: #e65100;
    transform: scale(1.05);
}

.admin-btn.logged-in {
    background: #4caf50;
}

.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.modal-header {
    margin-bottom: 20px;
}

.modal-header h2 {
    margin: 0;
    color: #333;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-actions button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #ddd;
    color: #333;
}

.btn-secondary:hover {
    background: #ccc;
}

.btn-danger {
    background: #f44336;
    color: white;
}

.btn-danger:hover {
    background: #d32f2f;
}

@media (max-width: 768px) {
    .quick-contact {
        top: auto;
        bottom: 84px;
        right: 14px;
        transform: none;
        gap: 6px;
    }

    .quick-contact-btn {
        width: 44px;
        height: 44px;
        border-radius: 10px;
    }

    .quick-contact-label {
        right: 52px;
        font-size: 12px;
    }
}


