
/* General Body & Typography */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f4f7f9;
    color: #333;
    margin: 0;
    padding: 10px; /* Reduced padding for mobile */
    line-height: 1.6;
}

h1, h2, h3, h4 {
    color: #2c3e50;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: #fff;
    padding: 15px; /* Reduced padding for mobile */
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

/* Forms */
.form-container {
    max-width: 400px;
    margin: 40px auto;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

input[type="text"], input[type="password"], input[type="email"], input[type="number"], input[type="date"], input[type="datetime-local"], select, textarea {
    width: 100%;
    padding: 6px;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    background-color: #3498db;
    color: white;
    font-size: 16px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.3s;
    line-height: 1.5; /* Add line-height for consistency */
}

.btn:hover {
    background-color: #2980b9;
}

.btn-primary {
    background-color: #3498db;
}

.btn-secondary {
    background-color: #95a5a6;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-danger {
    background-color: #e74c3c;
}

.btn-danger:hover {
    background-color: #c0392b;
}


.btn-small {
    padding: 5px 10px;
    font-size: 0.8em;
}

/* Alerts and Messages */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    display: none; /* Hidden by default */
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Header/Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
    flex-wrap: wrap; /* Allow wrapping on small screens */
    gap: 10px;
}

.navbar .username {
    font-weight: bold;
}

.navbar > div:last-child,
.section-header > div {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Unified button style for headers */
.navbar .btn,
.section-header .btn {
    padding: 8px 16px;
    font-size: 14px;
    white-space: nowrap;
}


/* Modal, Drag&Drop, Progress Bar */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 10px;
    box-sizing: border-box;
}

.modal-content {
    position: relative; /* Needed for positioning the close button */
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content.large {
    max-width: 95%;
}

.close-modal-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
    z-index: 10; /* Ensure it's above other content */
}

.close-modal-btn:hover {
    color: #333;
}

.modal-actions {
    display: flex;
    justify-content: flex-end; /* Align buttons to the right */
    gap: 10px; /* Space between buttons */
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.modal-actions .btn {
    min-width: 120px; /* Ensure buttons have a consistent minimum width */
}

.drop-zone {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    color: #aaa;
    cursor: pointer;
    transition: background-color 0.3s, border-color 0.3s;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drop-zone.drag-over {
    background-color: #f0f8ff;
    border-color: #3498db;
}

.drop-zone p {
    margin: 0;
}

.progress-bar-container {
    width: 100%;
    background-color: #e0e0e0;
    border-radius: 4px;
    height: 10px;
    margin-top: 20px;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background-color: #3498db;
    border-radius: 4px;
    text-align: center;
    line-height: 20px;
    color: white;
    transition: width 0.4s ease;
}

/* --- DASHBOARD VIEW --- */
.dashboard-view .objects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.dashboard-view .object-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}

.dashboard-view .object-card-main-photo {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 15px;
}

.dashboard-view .object-card-content {
    flex-grow: 1;
}

.dashboard-view .object-card-actions {
    margin-top: auto;
    padding-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.dashboard-view .object-card h4 {
    margin-top: 0;
    color: #3498db;
}

.dashboard-view .object-card .address {
    font-size: 0.9em;
    color: #555;
    margin-bottom: 15px;
}

.dashboard-view .table-container {
    overflow-x: auto;
}

.dashboard-view .table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.dashboard-view .table th, .dashboard-view .table td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
    vertical-align: middle;
}

.dashboard-view .table th {
    background-color: #f2f2f2;
    font-weight: bold;
}

.dashboard-view .table .filter-row th {
    padding: 8px;
    background-color: #f8f9fa;
}

.dashboard-view .table .filter-row select {
    width: 100%;
    padding: 6px;
    font-size: 0.9em;
    border: 1px solid #ccc;
}

.dashboard-view .table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.dashboard-view .table .actions-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.dashboard-view .table .actions-cell .btn-small {
    width: 90px;
    box-sizing: border-box;
    margin: 0 !important;
    padding: 5px 8px;
}

.dashboard-view .passport-photo {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

.filters-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    align-items: flex-end;
}

.filters-container .form-group {
    flex-grow: 1;
    margin-bottom: 0;
}

.dashboard-view .passport-row {
    cursor: pointer;
}

.dashboard-view .details-row {
    display: none;
}

.dashboard-view .details-row.visible {
    display: table-row;
}

.dashboard-view .details-cell {
    background-color: #fafafa;
    padding: 15px !important;
}

.dashboard-view .details-grid, .dashboard-view .verification-grid, .dashboard-view .comparison-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.dashboard-view .details-grid div {
    padding: 5px;
}

.dashboard-view .details-grid strong {
    display: block;
    color: #555;
    font-size: 0.9em;
}

/* --- PUBLIC VIEW --- */
.public-view .objects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.public-view .object-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.public-view .object-photo-container {
    width: 100%;
    height: 200px;
    background-color: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #007bff;
    position: relative; /* Dodane dla pozycjonowania przycisku */
}

.public-view .object-photo-container .no-photo {
    font-weight: bold;
    text-transform: uppercase;
}

.public-view .object-card-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.public-view .clickable-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

.public-view .object-card-content {
    padding: 20px;
    flex-grow: 1;
}

.public-view .object-card h4 {
    margin-top: 0;
    color: #3498db;
}

.public-view .object-card .address {
    font-size: 0.9em;
    color: #555;
    margin-bottom: 15px;
}

.public-view .filters-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
    align-items: stretch;
}

/* --- COMMON STYLES --- */

.radio-group input {
    width: auto;
    margin-right: 5px;
}

.radio-group label {
    display: inline-block;
    margin-right: 15px;
    font-weight: normal;
}

.radio-group-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.occupancy-bar-container {
    width: 100%;
    background-color: #e0e0e0;
    border-radius: 4px;
    height: 10px;
    margin-top: 5px;
}

.occupancy-bar {
    height: 100%;
    background-color: #27ae60;
    border-radius: 4px;
    transition: width 0.4s ease;
}

.occupancy-bar.medium { background-color: #f39c12; }
.occupancy-bar.high { background-color: #e74c3c; }

.rooms-occupancy-container {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 10px;
    width: 100%;
}

.room-occupancy-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9em;
    width: 100%;
    flex-wrap: nowrap;
    gap: 5px;
}

.room-label {
    flex-shrink: 0;
    margin-right: 10px;
    min-width: 70px;
    cursor: pointer;
}

@keyframes fade-out-highlight {
  from { background-color: rgba(46, 204, 113, 0.75); }
  to { background-color: transparent; }
}

.item-saved-animation {
    animation: fade-out-highlight 1s ease-out forwards;
}

.room-occupancy-info {
    display: flex;
    align-items: center;
    flex-grow: 1;
    justify-content: flex-end;
    cursor: pointer;
}

.room-occupancy-numbers {
    flex-shrink: 0;
    margin-right: 10px;
    text-align: right;
}

.occupancy-bar-container.room-bar-short {
    width: 100px;
    flex-shrink: 0;
    margin-top: 0;
}

.residents-list {
    list-style-type: none;
    padding: 0;
    margin-top: 15px;
}

.residents-list li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
}

.residents-list li:last-child { border-bottom: none; }

.resident-photo {
    width: 40px;
    height: 40px;
    object-fit: cover;
    margin-right: 10px;
    border-radius: 4px;
}

#rooms-modal .modal-content {
    max-width: 95%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Zapobiega przewijaniu całego modala */
}

#room-list-container {
    overflow-y: auto; /* Włącza przewijanie dla listy pokoi */
    flex-grow: 1;
    min-height: 0; /* Poprawka dla poprawnego działania przewijania wewnątrz flexbox */
}


.add-room-inline-form {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
    width: 100%;
}

.add-room-inline-form .form-group { margin-bottom: 0; }
.add-room-inline-form .btn { width: 100%; }

.room-edit-fields {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 10px;
    align-items: stretch;
}

.room-edit-fields .form-group { margin-bottom: 0; }

.form-group-checkbox {
    display: flex;
    align-items: center;
    padding-top: 5px;
}

.form-group-checkbox input { margin-right: 8px; }
.form-group-checkbox label { margin-bottom: 0; font-weight: normal; }

#edit-passport-modal .modal-content { max-width: 95%; }

.large-face-photo {
    max-width: 120px;
    height: auto;
    border: 1px solid #ddd;
    margin-bottom: 15px;
    display: block;
}

.details-content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.details-photo-column {
    flex: 0 0 auto;
    padding-top: 0;
}

.details-grid-column { flex: 1; width: 100%; }

#app-dialog-modal {
    z-index: 1050; /* Ustawiamy wyższy z-index, aby był nad innymi modalami */
}

#app-dialog-modal .modal-content {
    max-width: 95%;
    text-align: center;
}

.app-dialog-actions {
    flex-direction: column;
    gap: 10px;
}
.app-dialog-actions .btn {
    width: 100%;
    margin: 0;
}

.status-indicator {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-right: 10px;
    cursor: help;
}

.status-indicator.free { background-color: #2ecc71; }
.status-indicator.reserved { background-color: #f1c40f; }
.status-indicator.disabled { background-color: #e74c3c; }
.status-indicator.disabled-reserved { background-color: #e67e22; }

/* Image Viewer Modal Styles */
#image-viewer-modal {
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 1001;
    padding: 20px;
    box-sizing: border-box;
}

.close-image-viewer {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close-image-viewer:hover {
    color: #bbb;
}

.image-viewer-content-wrapper {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    flex-direction: column; /* Stack images vertically on mobile */
}

.image-viewer-content {
    max-width: 100%;
    max-height: 45vh; /* Limit height to 45% of viewport height */
    object-fit: contain;
    cursor: pointer;
    background-color: #111;
    border: 1px solid #444;
}

.passport-scan-link, .face-image-link {
    text-decoration: underline;
    color: #3498db;
    cursor: pointer;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 0.9em;
}

.history-table th, .history-table td {
    padding: 8px;
}

#history-modal .modal-content { max-width: 95%; }

.archived-row {
    background-color: #f1f1f1 !important;
    color: #888;
}
.archived-row td { text-decoration: line-through; }
.archived-row .passport-photo { opacity: 0.5; }
.archived-text { font-style: italic; color: #777; }

#profile-modal .modal-content { max-width: 95%; }

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

.form-grid-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

#object-details-modal .modal-content.large {
    max-width: 95%;
    max-height: 90vh;
    overflow-y: auto;
}

#object-modal .modal-content.large {
    max-width: 95%;
    max-height: 90vh;
    overflow-y: auto;
}

/* --- Photo Gallery & Viewer --- */
.photo-gallery-container {
    margin-bottom: 20px;
}

.photo-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.gallery-thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.gallery-thumbnail:hover {
    opacity: 0.8;
}

.image-viewer-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1050; /* Above other modals */
}

.image-viewer-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

.image-viewer-close:hover {
    color: #bbb;
}

.image-viewer-content {
    max-width: 90%;
    max-height: 90%;
    border-radius: 4px;
}

#modal-rooms-list .room-card {
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
}

#modal-rooms-list .room-card-content {
    padding: 15px;
}

#modal-rooms-list .room-card h3 {
    margin-top: 0;
}

/* --- Document Viewer Modal --- */
.document-viewer {
    width: 100%;
    height: 70vh; /* Adjust height as needed */
    border: 1px solid #ccc;
    margin-bottom: 15px;
}

.document-viewer iframe, .document-viewer img {
    width: 100%;
    height: 100%;
    border: none;
}

/* --- Reservation Modal Styles --- */
.reservation-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.reservation-details {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.reservations-list {
    list-style: none;
    padding: 0;
    max-height: 250px;
    overflow-y: auto;
}

.reservation-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 8px;
    border: 1px solid #eee;
}

.reservation-item.status-confirmed {
    background-color: #e8f5e9; /* Light green */
}

.reservation-item.status-pending_confirmation {
    background-color: #fffde7; /* Light yellow */
}

.reservation-item-info {
    display: flex;
    flex-direction: column;
}

.reservation-item-info span {
    font-size: 0.9em;
    color: #555;
}

/* Custom styles for Vanilla Calendar */
.vcal-date--pending {
    background-color: rgba(255, 235, 59, 0.5) !important; /* Yellow for pending */
}

.vcal-date--confirmed {
    background-color: rgba(76, 175, 80, 0.5) !important; /* Green for confirmed */
}


/* Responsive Table Styles */
@media (max-width: 992px) {
    .dashboard-view .responsive-table thead {
        display: none;
    }

    .dashboard-view .responsive-table > tbody > tr.passport-row {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 4px;
        padding: 10px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }

    .dashboard-view .responsive-table > tbody > tr.details-row {
        display: none; /* Keep details row hidden by default */
        box-shadow: none;
        border: none;
        padding: 0;
        margin-bottom: 15px;
    }

    .dashboard-view .responsive-table > tbody > tr.details-row.visible {
        display: block; /* Show details row when visible */
    }

    .dashboard-view .responsive-table > tbody > tr > td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
        border: none;
        border-bottom: 1px solid #eee;
    }

    .dashboard-view .responsive-table > tbody > tr > td:last-child {
        border-bottom: none;
    }

    .dashboard-view .responsive-table .actions-cell {
        flex-direction: row;
        justify-content: flex-start;
        gap: 8px;
        flex-wrap: wrap;
    }

    .dashboard-view .responsive-table .actions-cell .btn-small {
        width: auto;
        padding: 5px 10px;
    }

    .dashboard-view .responsive-table .passport-photo {
        width: 40px;
        height: 40px;
    }

    .dashboard-view .details-grid {
        grid-template-columns: 1fr 1fr; /* Two columns for details */
        gap: 10px 20px;
    }
}


/* Desktop and larger screens */
@media (min-width: 769px) {
    body {
        padding: 20px;
    }
    .container {
        padding: 25px;
    }

    .filters-container {
        flex-direction: row;
        align-items: flex-end;
        gap: 20px;
    }

    .filters-container .form-group {
        flex-grow: 1;
    }

    .dashboard-view .details-grid, .dashboard-view .verification-grid, .dashboard-view .comparison-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .add-room-inline-form {
        flex-direction: row;
        align-items: flex-end;
    }

    .add-room-inline-form .btn {
        width: auto;
        flex-shrink: 0;
    }

    .room-edit-fields {
        flex-direction: row;
        align-items: flex-end;
    }

    .details-content-wrapper {
        flex-direction: row;
        align-items: flex-start;
    }

    .details-photo-column {
        flex: 0 0 170px;
    }

    .app-dialog-actions {
        flex-direction: row;
        justify-content: center;
    }

    .app-dialog-actions .btn {
        width: auto;
    }

    .profile-columns {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }

    .form-grid-2, .form-grid-3, .form-grid-auto {
        display: grid;
        gap: 15px;
    }
    .form-grid-2 {
        grid-template-columns: 1fr 1fr;
    }
    .form-grid-3 {
        grid-template-columns: 1fr 1fr 1fr;
    }
    .form-grid-auto {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    .modal-actions .btn-primary {
        width: auto; /* Override full-width on desktop */
    }

    .image-viewer-content-wrapper {
        flex-direction: row; /* Side-by-side images on desktop */
    }

    .image-viewer-content {
        max-height: 85vh; /* Taller images on desktop */
        max-width: 48%;
    }

    .dashboard-view .object-card-actions .btn-small {
        padding: 5px 10px;
        font-size: 0.8em;
    }

    .reservation-layout {
        flex-direction: row;
    }

    .reservation-details {
        min-width: 300px;
        max-width: 300px;
    }
}

@media (min-width: 993px) {
    .dashboard-view .responsive-table .actions-cell {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
    }

    .dashboard-view .responsive-table .actions-cell .btn-small {
        width: 90px;
    }
}


/* --- Photo Gallery Styles for Modals --- */
.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.photo-item {
    position: relative;
    width: 100%;
    padding-top: 100%; /* Creates a square aspect ratio */
    border-radius: 8px;
    overflow: hidden;
    background-color: #f0f0f0;
}

.photo-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures the image covers the square, cropping if necessary */
}

.photo-item .delete-photo-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: rgba(231, 76, 60, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    padding: 0;
    font-size: 14px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, background-color 0.2s;
}

.photo-item:hover .delete-photo-btn {
    opacity: 1;
}

.photo-item .delete-photo-btn:hover {
    background-color: rgba(192, 57, 43, 1);
}

#object-photos-section, .room-photos-section {
    border-top: 1px solid #eee;
    padding-top: 15px;
    margin-top: 15px;
}

.room-list {
    list-style: none;
    padding: 0;
}

.room-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 15px;
    background-color: #fdfdfd;
    overflow: hidden;
}

.room-header {
    display: flex;
    flex-direction: column;
    padding: 15px;
    gap: 15px;
}

.room-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.room-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.room-content-container {
    border-top: 1px solid #eee;
    padding: 15px;
}

.tab-content {
    padding-top: 15px;
}

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

.residents-list-detailed {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.residents-list-detailed li {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 15px;
    align-items: center;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 6px;
}

.residents-list-detailed .resident-info {
    display: flex;
    flex-direction: column;
}

.residents-list-detailed .resident-actions {
    display: flex;
    gap: 10px;
    flex-direction: column;
}

@media (min-width: 769px) {
    .room-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-end;
    }
    .room-details {
        flex-direction: row;
        align-items: flex-end;
        flex-grow: 1;
    }
    .room-actions {
        flex-shrink: 0;
    }
    .reservation-layout-grid {
        grid-template-columns: 300px 1fr;
    }
    .residents-list-detailed .resident-actions {
        flex-direction: row;
        align-items: center;
    }
}


/* --- LIST/GRID VIEW TOGGLE --- */

.view-toggle-container {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}

/* LIST VIEW (ACCORDION) STYLES */
.list-view .objects-grid {
    display: flex;
    flex-direction: column;
    gap: 5px; /* Smaller gap for accordion */
}

.list-view .object-card {
    flex-direction: column;
    padding: 0; /* Remove padding from the card itself */
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background-color: #fff;
    transition: border-color 0.2s;
}

.list-view .object-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: #f9f9f9;
    cursor: pointer;
    border-left: 4px solid transparent;
    transition: background-color 0.2s;
}

.list-view .object-card-header .object-name {
    color: #000;
    font-size: 1.1em;
    font-weight: bold;
}

.list-view .object-card-details {
    display: none; /* Hidden by default */
    padding: 15px;
    border-top: 1px solid #e0e0e0;
    background-color: #fff;
}

.list-view .object-card.active .object-card-details {
    display: block; /* Show on active */
}

/* Hide elements not needed in the compact header */
.list-view .object-card-main-photo,
.list-view .object-card .address,
.list-view .rooms-occupancy-container,
.list-view .occupancy-bar-container {
    display: none;
}

/* Adjust header content for list view */
.list-view .object-card-header .occupancy-info {
    font-size: 0.9em;
    color: #555;
}

/* Details section will contain the previously hidden elements */
.list-view .object-card-details .address,
.list-view .object-card-details .rooms-occupancy-container,
.list-view .object-card-details .occupancy-bar-container {
    display: block; /* Make them visible inside details */
    margin-bottom: 0;
}
.list-view .object-card-details .address {
    font-size: 1em;
    margin-bottom: 15px;
}

.list-view .object-card-actions {
    padding-top: 10px;
    margin-top: 10px;
    border-top: 1px solid #eee;
}

/* Status and Hover Styles for Object List View */
.list-view .object-card.status-ok .object-card-header {
    background-color: #eaf5ff;
    border-left-color: #2ecc71;
}
.list-view .object-card.status-ok:hover .object-card-header {
    background-color: #dceeff;
}

.list-view .object-card.status-warning .object-card-header {
    background-color: #fffbe6;
    border-left-color: #f1c40f;
}
.list-view .object-card.status-warning:hover .object-card-header {
    background-color: #fff8d4;
}

/* Critical State (Red) */
.list-view .object-card.status-critical .object-card-header {
    background-color: #fff2f2;
    border-left-color: #e74c3c;
}
.list-view .object-card.status-critical:hover .object-card-header {
    background-color: #ffeded;
}


/* --- Passports Accordion List --- */
#passports-container .passports-accordion {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.passport-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background-color: #fff;
    transition: border-color 0.2s;
}
.passport-item.archived-item {
    background-color: #f1f1f1;
    color: #888;
}
.passport-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    cursor: pointer;
    background-color: #f9f9f9;
    border-left: 4px solid transparent; /* Default transparent border */
    transition: background-color 0.2s;
}
.passport-item.archived-item .passport-item-header {
    background-color: #e9e9e9;
}

.header-main-info {
    display: flex;
    align-items: center;
    gap: 15px;
}
.header-main-info .passport-photo {
    width: 40px;
    height: 40px;
}
.header-main-info .name-details {
    display: flex;
    flex-direction: column;
}
.header-main-info .name-details strong {
    font-size: 1.1em;
}
.header-main-info .name-details span {
    font-size: 0.9em;
    color: #666;
}
.header-location-info {
    flex-shrink: 0;
}
.passport-item-details {
    display: none;
    padding: 15px;
    border-top: 1px solid #e0e0e0;
}
.passport-item.active .passport-item-details {
    display: block;
}
.passport-accordion-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}
/* Make sure the existing details grid works well here */
.passport-item-details .details-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}
#passports-container .filter-row {
    padding: 10px;
    background-color: #f8f9fa;
}
#passports-container .table {
    display: none; /* Hide original table */
}

/* --- Status and Hover Styles for Passport Items --- */

/* Default State (Green/Blue) */
.passport-item:not(.status-critical):not(.status-warning):not(.archived-item) .passport-item-header {
    background-color: #eaf5ff;
    border-left-color: #2ecc71;
}
.passport-item:not(.status-critical):not(.status-warning):not(.archived-item):hover .passport-item-header {
    background-color: #dceeff;
}

/* Warning State (Yellow) */
.passport-item.status-warning .passport-item-header {
    background-color: #fffbe6;
    border-left-color: #f1c40f;
}
.passport-item.status-warning:hover .passport-item-header {
    background-color: #fff8d4;
}

/* Critical State (Red) */
.passport-item.status-critical .passport-item-header {
    background-color: #fff2f2;
    border-left-color: #e74c3c;
}
.passport-item.status-critical:hover .passport-item-header {
    background-color: #ffeded;
}

/* Archived State Hover */
.passport-item.archived-item:hover .passport-item-header {
    background-color: #e0e0e0;
}

.header-status-info {
    flex-grow: 1;
    text-align: center;
}

.status-label {
    font-weight: bold;
    font-size: 0.9em;
    padding: 2px 8px;
    border-radius: 4px;
}

.status-critical-label {
    color: #c0392b;
    background-color: #fdd;
}

.status-warning-label {
    color: #8a6d3b;
    background-color: #fcf8e3;
}

/* --- NOWE STYLE DLA TABELI WYNIKÓW CHATBOTA --- */
.results-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 0.9em;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

.results-table thead tr {
    background-color: #3498db;
    color: #ffffff;
    text-align: left;
}

.results-table th,
.results-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
}

.results-table tbody tr {
    background-color: #ffffff;
    transition: background-color 0.2s;
}

.results-table tbody tr:nth-of-type(even) {
    background-color: #f8f9fa;
}

.results-table tbody tr:hover {
    background-color: #f1f1f1;
}

.results-table tbody tr:last-of-type td {
    border-bottom: 2px solid #3498db;
}

.results-table .btn-small {
    background-color: #2ecc71;
    padding: 5px 12px;
}

.results-table .btn-small:hover {
    background-color: #27ae60;
}

/* --- NOWE STYLE DLA CHATBOTA --- */
#chatbot-container {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

#chatbot-container h2 {
    margin-top: 0;
    font-size: 1.4em;
}

#chatbot-container p {
    margin-top: 0;
    color: #666;
    font-size: 0.9em;
}

#chat-window {
    height: 200px;
    overflow-y: auto;
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
}

.chat-message {
    margin-bottom: 12px;
    line-height: 1.4;
    max-width: 85%;
    padding: 8px 12px;
    border-radius: 18px;
    word-wrap: break-word;
}

.user-message {
    background-color: #3498db;
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.bot-message {
    background-color: #ecf0f1;
    color: #2c3e50;
    margin-right: auto;
    border-bottom-left-radius: 4px;
}

#chat-form {
    display: flex;
    gap: 10px;
}

#chat-input {
    flex-grow: 1;
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 10px 15px;
    font-size: 1em;
}

#send-chat {
    border-radius: 20px;
    padding: 10px 20px;
    font-size: 1em;
    background-color: #2ecc71;
}

#send-chat:hover {
    background-color: #27ae60;
}

/* --- Responsive Passport Item --- */
.header-name-mobile {
    display: none;
}

@media (max-width: 768px) {
    .passport-item-header {
        flex-direction: column;
        align-items: stretch;
    }

    .header-name-desktop {
        display: none;
    }

    .header-name-mobile {
        display: block;
        width: 100%;
        font-size: 0.9em;
        font-weight: bold;
        margin-bottom: 8px;
        text-align: left;
    }

    .header-main-info {
        width: 100%;
    }

    .name-details {
        flex-grow: 1;
    }

    .header-location-info {
        width: 100%;
        margin-top: 8px;
    }

    .header-status-info {
        width: 100%;
        margin-top: 8px;
    }
}

/* Mobile-specific adjustments */
@media (max-width: 768px) {
    /* Dashboard header buttons */
    .section-header {
        flex-direction: column;
        align-items: stretch;
    }

    .section-header > div {
        flex-direction: column;
        align-items: stretch;
    }

    .section-header .btn {
        padding: 10px 15px; /* Adjust padding to make buttons slightly shorter */
        font-size: 14px;
        white-space: normal; /* Allow text to wrap on smaller screens */
        width: 100%;
        box-sizing: border-box;
    }

    #edit-passport-modal .modal-actions {
        flex-direction: column;
    }

    #edit-passport-modal .modal-actions .btn {
        width: 100%;
        box-sizing: border-box;
        padding: 10px;
        font-size: 14px;
        min-width: unset;
    }
}

/* --- Notification Bell and Panel Styles --- */
.navbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative; /* For positioning the notification bell */
}

.notification-bell {
    position: relative;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.notification-bell:hover {
    background-color: #f0f0f0;
}

.notification-bell svg {
    width: 24px;
    height: 24px;
    color: #333;
}

.notification-count {
    position: absolute;
    top: 0px;
    right: 0px;
    background-color: #e74c3c;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.7em;
    font-weight: bold;
    line-height: 1;
    display: none; /* Hidden by default, shown when count > 0 */
}

.notification-panel {
    position: absolute;
    top: 100%; /* Position below the bell */
    right: 0;
    width: 300px;
    max-height: 400px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: none; /* Hidden by default */
    flex-direction: column;
    overflow: hidden;
}

.notification-panel.active {
    display: flex; /* Show when active */
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
    font-weight: bold;
}

.notification-header button {
    background: none;
    border: none;
    color: #3498db;
    cursor: pointer;
    font-size: 0.9em;
}

#notification-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.notification-item {
    padding: 10px 15px;
    border-bottom: 1px solid #f9f9f9;
    cursor: pointer;
    transition: background-color 0.2s;
}

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

.notification-item:hover {
    background-color: #f5f5f5;
}

.notification-item.unread {
    background-color: #fff2f2; /* Light red for unread */
    border-left-color: #e74c3c;
}

.notification-item-read {
    background-color: #e8f5e9; /* Light green */
    border-left-color: #2ecc71;
}

/* --- RESERVATIONS VIEW STYLES --- */

.reservations-view .reservations-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.reservations-view .bulk-actions {
    display: flex;
    gap: 10px;
}

/* Hide the old table container */
.reservations-view .table-container {
    display: none;
}

/* New list view for reservations */
.reservations-list-view {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.reservation-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background-color: #fff;
    transition: background-color 0.2s, border-color 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border-left: 4px solid transparent;
    padding: 15px;
    display: grid;
    grid-template-columns: auto 1fr 1fr 1fr auto;
    grid-template-areas:
        "checkbox main-info status-info date-info actions"
        "checkbox location-info location-info location-info actions";
    gap: 10px 20px;
    align-items: center;
}

.res-checkbox { grid-area: checkbox; }
.res-main-info { grid-area: main-info; }
.res-status-info { grid-area: status-info; }
.res-date-info { grid-area: date-info; }
.res-location-info { grid-area: location-info; }
.res-actions { grid-area: actions; }

.res-main-info, .res-status-info, .res-date-info, .res-location-info {
    display: flex;
    flex-direction: column;
}

.res-main-info strong, .res-status-info strong, .res-date-info strong, .res-location-info strong {
    font-size: 0.8em;
    color: #555;
    margin-bottom: 2px;
}

.res-actions {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* Status colors for reservation items, consistent with passport items */
.reservation-item.status-pending {
    background-color: #fffde7; /* Light yellow */
    border-left-color: #f1c40f;
}
.reservation-item.status-pending:hover {
    background-color: #fff8d4;
}

.reservation-item.status-pending-owner {
    background-color: #fff3e0; /* Light orange */
    border-left-color: #e67e22;
}
.reservation-item.status-pending-owner:hover {
    background-color: #ffe8cc;
}

.reservation-item.status-accepted,
.reservation-item.status-confirmed {
    background-color: #e8f5e9; /* Light green */
    border-left-color: #2ecc71;
}
.reservation-item.status-accepted:hover,
.reservation-item.status-confirmed:hover {
    background-color: #dceee0;
}

.reservation-item.status-cancelled {
    background-color: #f1f1f1;
    color: #888;
    text-decoration: line-through;
    border-left-color: #95a5a6;
}
.reservation-item.status-cancelled:hover {
    background-color: #e0e0e0;
}

/* Critical highlight style for reservations */
.reservation-item.status-critical-highlight {
    background-color: #fff2f2; /* Light red background */
    border-left-color: #e74c3c; /* Red left border */
}
.reservation-item.status-critical-highlight:hover {
    background-color: #ffeded; /* Slightly darker red on hover */
}


.tabs {
    display: flex;
    border-bottom: 2px solid #ddd;
    margin-bottom: 20px;
}

.tab-link {
    padding: 10px 20px;
    cursor: pointer;
    border: none;
    background-color: transparent;
    font-size: 1em;
    color: #666;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px; /* Align with container border */
}

.tab-link.active {
    color: #3498db;
    border-bottom-color: #3498db;
    font-weight: bold;
}

/* --- NOWE STYLE DLA SUGGESTIONS CHIPS --- */
.chat-suggestions-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    margin-bottom: 10px;
}

.chat-suggestion-chip {
    background-color: #e0e0e0;
    color: #333;
    padding: 8px 12px;
    border-radius: 20px; /* Zaokrąglona ramka */
    cursor: pointer; /* Kursor pointer */
    font-size: 0.9em;
    transition: background-color 0.2s ease;
    user-select: none; /* Zapobiega zaznaczaniu tekstu */
    border: 1px solid #ccc; /* Dodatkowa ramka */
}

.chat-suggestion-chip:hover {
    background-color: #d0d0d0;
    border-color: #a0a0a0;
}

.chat-suggestion-chip:active {
    background-color: #c0c0c0;
    border-color: #808080;
}

/* Responsive adjustments for reservation items */
@media (max-width: 992px) {
    .reservation-item {
        grid-template-columns: auto 1fr 1fr;
        grid-template-areas:
            "checkbox main-info status-info"
            "checkbox date-info date-info"
            "checkbox location-info location-info"
            "actions actions actions";
    }
    .res-actions {
        flex-direction: row;
        justify-content: flex-end;
        margin-top: 10px;
    }
}

@media (max-width: 576px) {
    .reservation-item {
        grid-template-columns: auto 1fr;
        grid-template-areas:
            "checkbox main-info"
            "checkbox status-info"
            "date-info date-info"
            "location-info location-info"
            "actions actions";
    }
}

/* --- NOTIFICATIONS PAGE STYLES --- */
.notifications-list-view {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background-color: #fff;
    transition: background-color 0.2s, border-color 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border-left: 4px solid transparent;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-item-content {
    flex-grow: 1;
}

.notification-item-actions {
    flex-shrink: 0;
    margin-left: 20px;
    display: flex;
    gap: 10px;
}

.notification-item-unread {
    background-color: #fff2f2; /* Light red */
    border-left-color: #e74c3c;
}

.notification-item-read {
    background-color: #e8f5e9; /* Light green */
    border-left-color: #2ecc71;
}

/* --- STYLES FOR PRICING LIST --- */
.pricing-list {
    list-style: none; /* Usuwamy domyślne bulletpointy */
    padding: 0;
}

.pricing-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    background-color: #fdfdfd;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pricing-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.pricing-item-header strong {
    font-size: 1.1em;
    color: #2c3e50;
}

.pricing-item-body p {
    margin: 5px 0;
    font-size: 0.95em;
    color: #555;
}

.pricing-item-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* Style dla radiobuttona domyślnego cennika */
.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 5px 0;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.radio-label:hover {
    background-color: #f0f0f0;
}

.radio-label input[type="radio"] {
    margin-right: 10px;
    width: 18px; /* Zwiększamy rozmiar dla lepszej widoczności */
    height: 18px;
    accent-color: #3498db; /* Kolor akcentu dla radiobuttona */
}

.radio-label strong {
    color: #3498db; /* Wyróżniamy nazwę domyślnego cennika */
}

.radio-label small {
    margin-left: 8px;
    color: #27ae60; /* Kolor dla tekstu "(domyślny)" */
    font-weight: bold;
}

/* Nowe style dla przycisku monitorowania */
.monitor-button {
    position: absolute;
    bottom: 10px;
    right: 10px;
    padding: 5px 10px;
    font-size: 0.8em;
    z-index: 10;
    border-radius: 4px; /* Zaokrąglone rogi */
    white-space: nowrap; /* Zapobiega zawijaniu tekstu */
}

/* --- Notification Settings Styles --- */
#notification-settings-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.setting-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 6px;
    border: 1px solid #eee;
}

.setting-toggle label {
    margin-bottom: 0;
    font-weight: normal;
    color: #333;
}

/* The switch - a wrapper for the slider */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

/* Hide default HTML checkbox */
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* The slider */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: #2ecc71; /* Green for enabled */
}

input:focus + .slider {
    box-shadow: 0 0 1px #2ecc71;
}

input:checked + .slider:before {
    transform: translateX(22px);
}

/* Rounded sliders */
.slider.round {
    border-radius: 28px;
}

.slider.round:before {
    border-radius: 50%;
}
