/**
 * SasiRental - Modern UI
 * Design system: Miranda Sans, dark blue, gold, soft surfaces, refined sidebar
 */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
    /* Brand */
    --color-primary: #0B1F3A;
    --color-primary-hover: #07162A;
    --color-primary-muted: rgba(11, 31, 58, 0.12);
    --color-secondary: #C9A227;
    --color-secondary-hover: #A8841E;
    --color-secondary-muted: rgba(201, 162, 39, 0.16);

    /* Surfaces - light theme */
    --bg-app: #f4f5f7;
    --bg-card: #ffffff;
    --bg-sidebar: #161b22;
    --bg-sidebar-hover: rgba(255, 255, 255, 0.06);
    --bg-sidebar-active: rgba(15, 98, 254, 0.2);
    --border-sidebar-active: #C9A227;

    /* Text */
    --text-primary: #1a1d21;
    --text-secondary: #5c6370;
    --text-muted: #8b929a;
    --text-sidebar: rgba(255, 255, 255, 0.85);
    --text-sidebar-muted: rgba(255, 255, 255, 0.55);

    /* Borders & radius */
    --border-color: #e8eaed;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.05);

    /* Font */
    --font-sans: 'Miranda Sans', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Base */
body {
    font-family: var(--font-sans);
    color: var(--text-primary);
    background: var(--bg-app);
    -webkit-font-smoothing: antialiased;
}

/* ----- Sidebar ----- */
.sidebar {
    background: var(--bg-sidebar);
    min-height: 100vh;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    position: fixed;
    width: 272px;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    transition: transform 0.25s ease, width 0.25s ease;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    overflow: hidden;
    box-sizing: border-box;
    touch-action: pan-y;
}

.sidebar .brand {
    padding: 1.5rem 1.5rem 1.25rem;
    color: #fff;
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 0.5rem;
    display: block;
    text-decoration: none;
    flex: 0 0 auto;
}

.sidebar .brand.brand-logo {
    padding: 1.25rem 1.5rem;
}

.sidebar .brand .brand-img {
    height: 36px;
    width: auto;
    display: block;
}

.sidebar .nav {
    padding: 0.5rem 0.75rem;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(1.75rem + env(safe-area-inset-bottom, 0px));
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.24) transparent;
}

.sidebar .nav-item {
    flex: 0 0 auto;
}

.sidebar .nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar .nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar .nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.22);
    border-radius: var(--radius-full);
}

.sidebar .nav-link {
    color: var(--text-sidebar);
    padding: 0.625rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 2px;
    font-weight: 500;
    font-size: 0.9375rem;
    transition: color 0.15s, background 0.15s;
    display: flex;
    align-items: center;
    border-left: 3px solid transparent;
}

.sidebar .nav-link i {
    font-size: 1.125rem;
    margin-right: 0.75rem;
    opacity: 0.9;
}

.sidebar .nav-link:hover {
    color: #fff;
    background: var(--bg-sidebar-hover);
}

.sidebar .nav-link.active {
    color: #fff;
    background: var(--bg-sidebar-active);
    border-left-color: var(--border-sidebar-active);
}

.sidebar .nav-item.mt-auto .nav-link {
    color: var(--text-sidebar-muted);
    font-weight: 400;
}

.sidebar .nav-item.mt-auto {
    margin-top: 0 !important;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar .nav-item.mt-auto .nav-link:hover {
    color: var(--text-sidebar);
}

/* ----- Main content ----- */
.main-content {
    margin-left: 272px;
    min-height: 100vh;
    padding: 1.75rem 2rem;
    background: var(--bg-app);
    transition: margin-left 0.25s ease;
}

.main-content .page-header {
    margin-bottom: 1.75rem;
}

.main-content h1.h3 {
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

/* ----- Global Search ----- */
.global-search-wrap {
    position: sticky;
    top: 0.75rem;
    z-index: 30;
    max-width: 760px;
}

.global-search-box {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 0 0.625rem;
}

.global-search-box > i {
    color: var(--text-muted);
    font-size: 1rem;
}

.global-search-box .form-control {
    border: 0;
    box-shadow: none;
    min-height: 42px;
    background: transparent;
    font-size: 0.9375rem;
}

.global-search-results {
    position: absolute;
    top: calc(100% + 0.375rem);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    max-height: min(70vh, 520px);
    overflow-y: auto;
}

.global-search-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.875rem;
    text-decoration: none;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

.global-search-item:last-child {
    border-bottom: 0;
}

.global-search-item:hover,
.global-search-item:focus {
    background: #f8fafc;
    color: var(--text-primary);
}

.global-search-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    display: grid;
    place-items: center;
    background: var(--color-primary-muted);
    color: var(--color-primary);
    flex: 0 0 auto;
}

.global-search-empty {
    padding: 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ----- Cards ----- */
.card {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    background: var(--bg-card);
    overflow: hidden;
}

.card-body {
    padding: 1.25rem 1.5rem;
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    font-weight: 600;
    font-size: 0.9375rem;
}

/* Stat / dashboard cards - icon circles */
.card .rounded-circle.bg-primary,
.card .rounded-circle[style*="rgba(0, 86, 180")] {
    background: var(--color-primary-muted) !important;
}

.card .rounded-circle.bg-success {
    background: var(--color-secondary-muted) !important;
}

.card .rounded-circle.bg-warning {
    background: rgba(234, 179, 8, 0.15) !important;
}

.card .rounded-circle i[style*="color: var(--color-primary)"],
.card .rounded-circle .bi-building,
.card .rounded-circle .bi-house-door,
.card .rounded-circle .bi-people {
    color: var(--color-primary) !important;
}

.card .rounded-circle .bi-person-check,
.card .rounded-circle .text-success {
    color: var(--color-secondary) !important;
}

.card .rounded-circle .bi-door-open,
.card .rounded-circle .text-warning {
    color: #b45309 !important;
}

/* ----- Buttons ----- */
.btn {
    font-weight: 500;
    border-radius: var(--radius-md);
    padding: 0.5rem 1rem;
    transition: transform 0.15s, box-shadow 0.15s;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--color-primary);
    border-color: var(--color-primary);
    box-shadow: 0 1px 2px rgba(15, 98, 254, 0.3);
}

.btn-primary:hover {
    background: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
    box-shadow: 0 4px 12px rgba(15, 98, 254, 0.25);
}

.btn-outline-primary {
    border-color: var(--border-color);
    color: var(--text-primary);
}

.btn-outline-primary:hover {
    background: var(--color-primary-muted);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.btn-outline-secondary:hover {
    background: var(--color-secondary-muted);
    border-color: var(--color-secondary);
    color: var(--color-secondary);
}

.btn-outline-danger:hover {
    background: rgba(218, 30, 40, 0.08);
}

.btn-sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.8125rem;
}

/* ----- Forms ----- */
.form-control,
.form-select {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    padding: 0.5rem 0.75rem;
    font-size: 0.9375rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-muted);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-label {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.875rem;
    margin-bottom: 0.375rem;
}

.form-check-input:checked {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px var(--color-primary-muted);
}

/* ----- Tables ----- */
.table {
    color: var(--text-primary);
}

.table thead th {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
}

.table tbody td {
    padding: 0.875rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.table-hover tbody tr:hover {
    background: rgba(0, 0, 0, 0.02);
}

.table-hover tbody tr:last-child td {
    border-bottom: none;
}

.table-actions {
    white-space: nowrap;
}

.table-actions .btn {
    transform: none;
}

.table-actions .btn:hover {
    transform: none;
}

/* ----- Badges ----- */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
}

.badge.bg-success {
    background: var(--color-secondary-muted) !important;
    color: var(--color-secondary);
}

.badge.bg-warning.text-dark {
    background: rgba(234, 179, 8, 0.2) !important;
    color: #b45309;
}

.badge.bg-danger {
    background: rgba(218, 30, 40, 0.12) !important;
    color: #da1e28;
}

.badge.bg-primary {
    background: var(--color-primary-muted) !important;
    color: var(--color-primary);
}

/* ----- List groups ----- */
.list-group-item {
    border-color: var(--border-color);
    padding: 0.875rem 1.25rem;
    font-size: 0.9375rem;
}

.list-group-flush .list-group-item:last-child {
    border-bottom: none;
}

/* ----- Input groups ----- */
.input-group .form-control,
.input-group .form-select {
    border-radius: 0;
}

.input-group .form-control:first-child,
.input-group .form-select:first-child {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.input-group .form-control:last-child,
.input-group .form-select:last-child {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ----- Alerts ----- */
.alert {
    border: none;
    border-radius: var(--radius-md);
}

.alert-light.border {
    background: var(--bg-card);
    border-color: var(--border-color) !important;
}

.alert-danger {
    background: rgba(218, 30, 40, 0.08);
    color: #9f1c24;
}

.alert-success {
    background: var(--color-secondary-muted);
    color: var(--color-secondary-hover);
}

/* ----- Modals ----- */
.modal-content {
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
}

.modal-title {
    font-weight: 600;
    font-size: 1.125rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
}

/* ----- Pagination ----- */
.pagination {
    gap: 2px;
}

.pagination .page-link {
    border: none;
    border-radius: var(--radius-sm) !important;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.4rem 0.75rem;
}

.pagination .page-item.active .page-link {
    background: var(--color-primary);
    color: #fff;
}

.pagination .page-link:hover {
    background: var(--color-primary-muted);
    color: var(--color-primary);
}

/* ----- Password toggle ----- */
.password-toggle {
    cursor: pointer;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.password-wrapper {
    position: relative;
}

.password-wrapper .form-control {
    padding-right: 40px;
}

/* ----- Mobile sidebar toggle ----- */
.sidebar-toggle {
    border-radius: var(--radius-md);
    z-index: 1001;
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.sidebar-toggle:hover {
    background: var(--bg-app) !important;
    border-color: var(--color-primary);
    color: var(--color-primary);
}

/* ----- Footer nav (mobile) ----- */
.footer-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.06);
    padding: 0.5rem 0;
    z-index: 1000;
    border-top: 1px solid var(--border-color);
}

.footer-nav .nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 0.5rem;
    color: var(--text-secondary);
    font-size: 0.6875rem;
    font-weight: 500;
}

.footer-nav .nav-link.active {
    color: var(--color-primary);
}

.footer-nav .nav-link i {
    font-size: 1.25rem;
    margin-bottom: 0.2rem;
}

/* ----- Responsive ----- */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
        padding: 1.25rem 1rem;
    }
    .main-content .page-header {
        margin-bottom: 1.25rem;
    }
}

@media (max-width: 991.98px) {
    .footer-nav {
        display: flex;
        justify-content: space-around;
    }
    .main-content {
        padding-bottom: 80px;
    }
}

/* ----- Login page ----- */
body.login-page {
    background: linear-gradient(145deg, #0f1623 0%, #1a2332 50%, #161b22 100%);
    min-height: 100vh;
}

.login-page .login-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.login-page .login-card .card-body {
    padding: 2rem 2.25rem;
}

.login-page .login-logo {
    max-width: 180px;
    height: auto;
    display: inline-block;
}

.login-page .card-title {
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
    color: var(--color-primary);
}

.login-page .btn-primary {
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
}

/* ----- Report print ----- */
@media print {
    .sidebar,
    .footer-nav,
    .d-print-none {
        display: none !important;
    }
    .main-content {
        margin-left: 0 !important;
    }
    .col-lg-4.mb-4 {
        display: none !important;
    }
    .col-lg-8 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
}

/* ----- Thermal receipt print ----- */
@media print {
    @page {
        size: 48mm auto;
        margin: 0;
    }
    body * {
        visibility: hidden;
    }
    #receipt-print,
    #receipt-print * {
        visibility: visible;
    }
    #receipt-print {
        position: absolute;
        left: 0;
        top: 0;
        width: 48mm !important;
        max-width: 48mm !important;
        font-size: 10px;
        line-height: 1.2;
    }
}

/* ----- PWA: native-like safe areas (notch, home indicator) ----- */
@media (display-mode: standalone) {
    .app-layout .main-content {
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 1rem);
    }
    .footer-nav {
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
    .sidebar {
        padding-top: env(safe-area-inset-top, 0px);
    }
    .login-page .min-vh-100 {
        padding-top: env(safe-area-inset-top, 0px);
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
}

/* ----- PWA: Install app button ----- */
.pwa-install-wrap {
    position: fixed;
    bottom: calc(4rem + env(safe-area-inset-bottom, 0px));
    right: 1rem;
    z-index: 999;
    display: inline-flex;
    align-items: center;
    gap: 0;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-lg);
    background: var(--color-primary);
}
/* On small screens, sit above the footer nav (~80px) */
@media (max-width: 991.98px) {
    .pwa-install-wrap {
        bottom: calc(5.25rem + env(safe-area-inset-bottom, 0px));
    }
}
.pwa-install-wrap-login {
    bottom: 1.5rem;
}
@media (max-width: 991.98px) {
    .pwa-install-wrap-login {
        bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
    }
}
.pwa-install-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #fff;
    background: transparent;
    border: none;
    border-radius: var(--radius-full);
    transition: opacity 0.2s;
}
.pwa-install-btn:hover {
    color: #fff;
    opacity: 0.95;
}
.pwa-install-btn:active {
    opacity: 1;
}
.pwa-install-btn i {
    font-size: 1.1rem;
}
.pwa-install-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    margin-right: 0.25rem;
    padding: 0;
    font-size: 1.25rem;
    line-height: 1;
    color: rgba(255, 255, 255, 0.9);
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.pwa-install-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
}
.pwa-install-close:active {
    background: rgba(255, 255, 255, 0.25);
}

/* ----- PWA: iOS install steps modal ----- */
.pwa-ios-steps {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.pwa-ios-step {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    background: var(--bg-app);
    border: 2px solid transparent;
    transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}
.pwa-ios-step.pwa-step-active {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px var(--color-primary-muted);
    animation: pwa-step-pulse 1.5s ease-in-out;
}
.pwa-ios-step-num {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    color: #fff;
    background: var(--color-primary);
    border-radius: 50%;
}
.pwa-ios-step-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}
.pwa-ios-step-icon {
    font-size: 1.5rem;
    color: var(--color-primary);
}
.pwa-ios-step-arrow {
    justify-content: center;
    background: transparent;
    padding: 0.25rem 0;
}
.pwa-ios-step-arrow i {
    color: var(--text-muted);
    font-size: 1.25rem;
}
@keyframes pwa-step-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* Payments page — compact row action buttons */
#paymentsTable .payments-table-actions .btn {
    --bs-btn-padding-y: 0.125rem;
    --bs-btn-padding-x: 0.3rem;
    line-height: 1;
}
#paymentsTable .payments-table-actions .btn .bi {
    font-size: 0.8rem;
    vertical-align: -0.05em;
}

/* Leases page — compact row action buttons */
#leasesTable .leases-table-actions .btn {
    --bs-btn-padding-y: 0.125rem;
    --bs-btn-padding-x: 0.3rem;
    line-height: 1;
}
#leasesTable .leases-table-actions .btn .bi {
    font-size: 0.8rem;
    vertical-align: -0.05em;
}

/* Properties / Units — compact row action buttons */
#propertiesTable .properties-table-actions .btn,
#unitsTable .units-table-actions .btn {
    --bs-btn-padding-y: 0.125rem;
    --bs-btn-padding-x: 0.3rem;
    line-height: 1;
}
#propertiesTable .properties-table-actions .btn .bi,
#unitsTable .units-table-actions .btn .bi {
    font-size: 0.8rem;
    vertical-align: -0.05em;
}

.owners-mobile-list {
    display: none;
}

.owner-mobile-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.875rem;
    margin-bottom: 0.75rem;
    background: var(--bg-card);
}

.properties-mobile-list {
    display: none;
}

.property-mobile-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.875rem;
    margin-bottom: 0.75rem;
    background: var(--bg-card);
}

.calendar-shell {
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card);
}
.calendar-weekdays,
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}
.calendar-weekdays > div {
    padding: 0.625rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    background: var(--bg-app);
    border-bottom: 1px solid var(--border-color);
}
.calendar-day {
    min-height: 8.5rem;
    padding: 0.5rem;
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}
.calendar-day:nth-child(7n) {
    border-right: 0;
}
.calendar-day-muted {
    background: var(--bg-app);
}
.calendar-day-today {
    box-shadow: inset 0 0 0 2px var(--color-secondary);
}
.calendar-day-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 1.5rem;
    margin-bottom: 0.35rem;
    font-weight: 700;
    font-size: 0.8rem;
}
.calendar-day-count {
    color: var(--text-muted);
    font-weight: 600;
}
.calendar-day-events {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.calendar-event {
    width: 100%;
    min-height: 1.7rem;
    padding: 0.25rem 0.35rem;
    overflow: hidden;
    border: 0;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 0.72rem;
    line-height: 1.15;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.calendar-event-booking {
    background: var(--color-primary);
}
.calendar-event-lease {
    color: #1f2937;
    background: var(--color-secondary);
}
.calendar-more {
    color: var(--text-muted);
    font-size: 0.72rem;
}
.calendar-loading {
    grid-column: 1 / -1;
    padding: 2rem;
    text-align: center;
}
.calendar-agenda {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.calendar-agenda-item {
    display: grid;
    grid-template-columns: 7rem minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    text-align: left;
}
.calendar-agenda-date {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
}
.calendar-agenda-main {
    min-width: 0;
}
.calendar-agenda-main strong,
.calendar-agenda-main small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.calendar-agenda-main small {
    color: var(--text-muted);
}

.help-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.help-list-item {
    display: block;
    width: 100%;
    padding: 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    text-align: left;
}
.help-list-item.active {
    border-color: var(--color-primary);
    box-shadow: inset 3px 0 0 var(--color-primary);
}
.help-list-item strong,
.help-list-item small,
.help-list-item span {
    display: block;
}
.help-list-item strong {
    margin: 0.1rem 0;
}
.help-list-item small {
    color: var(--text-muted);
}
.help-reader {
    min-height: 28rem;
}
.help-article-body {
    line-height: 1.7;
}
.help-role-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
    max-height: 10rem;
    overflow: auto;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.data-export-cards {
    display: none;
}
.data-export-card {
    padding: 0.875rem;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
}

@media (max-width: 767.98px) {
    .owners-table-wrap {
        display: none;
    }
    .owners-mobile-list {
        display: block;
    }
    .properties-table-wrap {
        display: none;
    }
    .properties-mobile-list {
        display: block;
    }
    .calendar-shell {
        overflow-x: auto;
    }
    .calendar-weekdays,
    .calendar-grid {
        min-width: 48rem;
    }
    .calendar-day {
        min-height: 6.25rem;
    }
    .calendar-agenda-item {
        grid-template-columns: 1fr auto;
    }
    .calendar-agenda-date {
        grid-column: 1 / -1;
    }
    .help-reader {
        min-height: 18rem;
    }
    .data-export-table-wrap {
        display: none;
    }
    .data-export-cards {
        display: block;
    }
}
