html, body {
    height: 100%;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background-color: #f5f5f5;
    color: #222;
    -webkit-font-smoothing: antialiased;
}

.app-root {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.content {
    max-width: 800px;
    margin: 1.5rem auto;
    padding: 0 1rem;
    flex: 1 0 auto;
}

.card {
    background: #ffffff;
    border-radius: 18px;
    padding: 1.25rem 1.5rem 1.5rem;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.08);
}

.card-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.card-subtitle {
    margin: 0.25rem 0 0;
    font-size: 0.9rem;
    color: #6b6b6b;
}

.actions {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    border: 1px solid #123b2b;
    background-color: #fff;
    color: #123b2b;
    text-decoration: none;
    font-weight: 500;
}

.btn.primary {
    background-color: #149c5f;
    border-color: #149c5f;
    color: #fff;
}

.btn:hover {
    filter: brightness(0.95);
}

button.btn {
    cursor: pointer;
}

.site-footer {
    text-align: center;
    padding: 1rem;
    font-size: 0.875rem;
    color: #666;
}

.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 3rem 1rem 2rem;
    gap: 1rem;
}

.hero-logo {
    width: 260px;
    max-width: 120vw;
    height: auto;
    display: block;
}

.hero-text {
    max-width: 380px;
}

.hero-subtitle {
    margin: 0;
    font-size: 0.9rem;
    color: #555;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.hero-user {
    font-size: 0.85rem;
    color: #555;
}

.hero-logout-form {
    display: inline;
}

.link-button {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    color: #0b6b3d;
    font-size: 0.85rem;
    text-decoration: underline;
    cursor: pointer;
}

.schedule-footer {
    margin-top: 0.75rem;
    text-align: right;
}

.settings-fab {
    position: fixed;
    left: 1rem;
    bottom: 1rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid #d0d0d0;
    background: #ffffff;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
}

.settings-fab:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.16);
}

.admin-settings-fab-form {
    position: fixed;
    left: 1rem;
    bottom: 1rem;
    z-index: 25;
}

.admin-settings-fab {
    font-size: 1rem;
}

.menu-modal {
    align-items: flex-end;
    justify-content: flex-start;
}

.menu-modal .modal-backdrop {
    background: transparent;
}

.menu-modal .modal-dialog {
    position: fixed;
    left: 1rem;
    bottom: 4.75rem;
    max-width: 220px;
    width: auto;
    padding: 1.1rem 0.8rem 0.8rem;
}

.menu-modal h3 {
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.menu-modal .modal-subtitle {
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.menu-modal .actions {
    margin-top: 0.5rem;
}

.qr-section {
    margin-top: 1.25rem;
}

.qr-modal-dialog {
    max-width: 480px;
    width: 90vw;
    padding: 1.25rem 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.qr-image {
    width: 100%;
    height: auto;
    display: block;
}

.field-inline .field-label .field-inline-main {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.35rem;
}

.field-inline .field-inline-main input[type="number"],
.field-inline .field-inline-main input[type="text"] {
    flex: 1 1 auto;
    min-width: 0;
}

.field-inline .field-inline-main .btn {
    white-space: nowrap;
}

.bookings-section {
    margin-top: 0.5rem;
}

.bookings-list {
    list-style: none;
    padding: 0;
    margin: 0.25rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.booking-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.booking-when {
    color: #222;
}

.booking-status {
    font-size: 0.8rem;
    color: #555;
}

.booking-cancel-form {
    margin-left: 0.5rem;
}

.btn.danger-ghost {
    border-color: #b3261e;
    color: #b3261e;
    background: transparent;
}

.btn.danger-ghost:hover {
    background: #fff2f2;
}

.settings-cancel-row {
    justify-content: flex-end;
}

.settings-actions-row {
    justify-content: flex-end;
}

.admin-bookings-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1.1rem;
    align-items: flex-end;
    margin-top: 0.5rem;
}

.admin-bookings-filters .field-label span {
    margin-bottom: 0.1rem;
}

.admin-bookings-filters input[type="date"],
.admin-bookings-filters input[type="text"] {
    max-width: 170px;
}

.admin-bookings-residence-filter {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.admin-bookings-clear {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
}

.admin-bookings-table-wrapper {
    margin-top: 0.75rem;
}

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

.admin-bookings-table th,
.admin-bookings-table td {
    padding: 0.4rem 0.5rem;
    text-align: left;
}

.admin-bookings-table thead th {
    border-bottom: 1px solid #e0e0e0;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #555;
}

.admin-bookings-table tbody tr:nth-child(even) {
    background: #fafafa;
}

.admin-nav {
    margin: 0.25rem 0 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    font-size: 0.85rem;
}

.admin-nav-link {
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    border: 1px solid transparent;
    text-decoration: none;
    color: #123b2b;
    background: transparent;
}

.admin-nav-link-active {
    background: #e8f7f0;
    border-color: #149c5f;
    color: #0c6b3e;
}

.admin-nav-link-disabled {
    opacity: 0.4;
    cursor: default;
}

.admin-nav-right {
    margin-left: auto;
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.issues-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.issue {
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    padding: 0.75rem 0.9rem;
    background: #fdfdfd;
}

.issue-resolved {
    background: #f4f7f5;
    opacity: 0.9;
}

.issue-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.issue-meta {
    margin-left: 0.5rem;
    color: #555;
}

.issue-date {
    font-size: 0.75rem;
    color: #777;
}

.issue-body {
    margin: 0.35rem 0;
    font-size: 0.9rem;
}

.issue-contact {
    margin: 0.1rem 0 0.4rem;
    font-size: 0.8rem;
    color: #555;
}

.issue-image-wrapper {
    margin: 0.3rem 0 0.4rem;
}

.issue-image {
    width: 140px;
    max-width: 40%;
    height: auto;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    display: block;
    object-fit: cover;
    cursor: zoom-in;
}

.issue-image-placeholder {
    border-radius: 8px;
    border: 1px dashed #d0d0d0;
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
    color: #888;
}

.issue-actions {
    text-align: right;
}

.apartments-list {
    margin-top: 0.75rem;
    border-top: 1px solid #eee;
}

.apartment-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid #f2f2f2;
}

.apartment-meta {
    font-size: 0.9rem;
}

.password-status {
    font-size: 0.75rem;
    color: #777;
}

.apartment-actions form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    justify-content: flex-end;
}

.apartment-actions input[type="password"] {
    max-width: 140px;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 0.5rem;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.field-password {
    gap: 0;
}

.field-label span {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 0.2rem;
}

.field input,
.field select,
textarea {
    width: 100%;
    padding: 0.45rem 0.6rem;
    border-radius: 9px;
    border: 1px solid #d0d0d0;
    font-size: 0.95rem;
    box-sizing: border-box;
    background-color: #fafafa;
}

.field input:focus,
.field select:focus,
textarea:focus {
    outline: none;
    border-color: #149c5f;
    box-shadow: 0 0 0 1px rgba(20, 156, 95, 0.12);
    background-color: #fff;
}

.field-hint {
    font-size: 0.8rem;
    color: #777;
}

.file-field input[type="file"] {
    display: none;
}

.file-input-button {
    display: inline-block;
    padding: 0.25rem 0.45rem;
    border-radius: 9px;
    border: 1px solid #123b2b;
    background-color: #fff;
    color: #123b2b;
    font-size: 0.8rem;
    cursor: pointer;
    max-width: 100px;
    white-space: normal;
    text-align: center;
}

.file-input-name {
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: #555;
}

.alert {
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.alert-error {
    background-color: #fff2f2;
    color: #b3261e;
    border: 1px solid #f5c2c0;
}

.alert-success {
    background-color: #e8f7f0;
    color: #0c6b3e;
    border: 1px solid #b7e2c9;
}

.schedule-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.slot {
    border-radius: 12px;
    padding: 0.5rem 0.6rem;
    border: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    font-size: 0.85rem;
}

.slot-free {
    background-color: #e8f7f0; /* light green for available */
    border-color: #b7e2c9;
}

.slot-booked {
    background-color: #fff2f2; /* light red for booked */
    border-color: #f5c2c0;
}

.slot-past {
    opacity: 0.7;
    background-color: #f1f1f1 !important;
    border-color: #e0e0e0 !important;
}

.slot-time {
    font-weight: 600;
}

.slot-status {
    font-size: 0.8rem;
    color: #777;
}

.slot-status-free {
    color: #0c6b3e;
}

.slot-meta {
    font-size: 0.75rem;
    color: #666;
}

.inline-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.inline-form input[type="date"] {
    padding: 0.3rem 0.45rem;
    border-radius: 9px;
    border: 1px solid #d0d0d0;
    font-size: 0.9rem;
    background-color: #fafafa;
}

.inline-form input[type="date"]:focus {
    outline: none;
    border-color: #149c5f;
    background-color: #fff;
}

.schedule-section {
    margin-top: 0.5rem;
    display: none;
}

.app-show-schedule .schedule-section {
    display: block;
}

.app-show-schedule .hero {
    padding-top: 1rem;
    padding-bottom: 0.75rem;
}

.app-show-schedule .hero-logo {
    width: 180px;
    max-width: 60vw;
}

.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 20;
}

.modal.is-open {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
}

.modal-dialog {
    position: relative;
    background: #fff;
    border-radius: 16px;
    padding: 1.25rem 1.5rem 1.5rem;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 24px 55px rgba(0, 0, 0, 0.25);
    z-index: 21;
}

.modal-close {
    position: absolute;
    top: 0.35rem;
    right: 0.5rem;
    border: none;
    background: transparent;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.modal-subtitle {
    margin: 0.4rem 0 0.8rem;
    font-size: 0.9rem;
    color: #666;
}

@media (min-width: 600px) {
    .hero {
        padding-top: 3.5rem;
    }
}


