@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

body {
    background-color: #ffffff;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #374151;
}

h1, h2, h3, h4, h5, h6 {
    color: #111827;
    font-weight: 600;
}

.text-muted {
    color: #6b7280 !important;
}

.login-body {
    background: linear-gradient(135deg, #4F46E5 0%, #3730a3 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 15px;
}

.login-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.login-card .text-primary {
    color: #4F46E5 !important;
}

.navbar {
    background-color: #ffffff !important;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    padding: 0.5rem 0;
    position: sticky;
    top: 0;
    z-index: 1050;
    overflow: visible;
}

.navbar > .container {
    overflow: visible;
}



.navbar .navbar-brand {
    color: #111827 !important;
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: -0.01em;
}

.navbar .navbar-brand:hover {
    color: #111827 !important;
}

.navbar .navbar-brand i {
    color: #4F46E5;
}

.navbar .nav-link {
    color: #6b7280 !important;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.5rem 1rem !important;
    transition: color 0.15s;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
    color: #111827 !important;
}

.nav-link-item {
    color: #6b7280;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
    text-decoration: none;
    border-radius: 6px;
    transition: color 0.15s, background-color 0.15s;
    white-space: nowrap;
}

.nav-link-item:hover {
    color: #111827;
    background-color: #f3f4f6;
}

.nav-link-item.nav-active {
    color: #ffffff;
    background-color: #4F46E5;
    font-weight: 600;
}

.nav-link-item.nav-active:hover {
    background-color: #4338CA;
    color: #ffffff;
}

.nav-links-row {
    overflow: visible;
    flex-wrap: nowrap;
}

.nav-dropdown {
    display: inline-flex;
    position: relative;
}

.nav-link-item.dropdown-toggle::after {
    font-size: 0.6rem;
    vertical-align: 0.15em;
    margin-left: 0.2rem;
}

.nav-dropdown-menu {
    font-size: 0.85rem;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    border: 1px solid #e5e7eb;
    padding: 4px 0;
    min-width: 180px;
    position: absolute;
    z-index: 1060;
}

.nav-dropdown-menu .dropdown-item {
    padding: 6px 14px;
    font-size: 0.82rem;
    border-radius: 4px;
    margin: 0 4px;
    width: calc(100% - 8px);
}

.nav-dropdown-menu .dropdown-item:hover {
    background-color: #f0f0ff;
    color: #4F46E5;
}

.nav-dropdown-menu .dropdown-item.active {
    background-color: #eef2ff;
    color: #4F46E5;
    font-weight: 600;
}

.nav-dropdown-menu .dropdown-divider {
    margin: 4px 0;
}

.navbar .navbar-toggler {
    border-color: #d1d5db;
}

.navbar .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2855, 65, 81, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background-color: #4F46E5;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.lang-switcher .btn {
    font-size: 0.75rem;
    padding: 2px 10px;
    border-radius: 9999px;
    font-weight: 500;
}

.lang-switcher .btn-lang-active {
    background-color: #4F46E5;
    color: #ffffff;
    border-color: #4F46E5;
}

.lang-switcher .btn-lang-inactive {
    background-color: #ffffff;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.lang-switcher .btn-lang-inactive:hover {
    background-color: #f9fafb;
    color: #374151;
}

.card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    background: #ffffff;
}

.card-header {
    background-color: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 500;
    padding: 1rem 1.25rem;
}

.card-header h5 {
    font-size: 1rem;
    font-weight: 600;
}

.card-footer {
    background-color: #ffffff;
    border-top: 1px solid #e5e7eb;
}

.stat-card {
    border-left-width: 4px;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.stat-card.border-primary {
    border-left-color: #4F46E5 !important;
}

.stat-card .text-primary {
    color: #4F46E5 !important;
}

.btn-primary {
    background-color: #4F46E5;
    border-color: #4F46E5;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #4338CA;
    border-color: #4338CA;
}

.btn-primary:active {
    background-color: #3730a3;
    border-color: #3730a3;
}

.btn-outline-primary {
    color: #4F46E5;
    border-color: #4F46E5;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
}

.btn-outline-primary:hover {
    background-color: #4F46E5;
    border-color: #4F46E5;
    color: #ffffff;
}

.btn-outline-secondary,
.btn-outline-info {
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #374151;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
}

.btn-outline-secondary:hover,
.btn-outline-info:hover {
    background-color: #f9fafb;
    border-color: #d1d5db;
    color: #374151;
}

.btn-success {
    background-color: #4F46E5;
    border-color: #4F46E5;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
}

.btn-success:hover,
.btn-success:focus {
    background-color: #4338CA;
    border-color: #4338CA;
}

.btn-outline-success {
    color: #4F46E5;
    border-color: #4F46E5;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
}

.btn-outline-success:hover {
    background-color: #4F46E5;
    border-color: #4F46E5;
    color: #ffffff;
}

.btn-danger {
    border-radius: 8px;
}

.btn-sm {
    border-radius: 8px;
    font-size: 0.8125rem;
    padding: 0.375rem 0.875rem;
}

.priority-badge {
    font-size: 0.75rem;
    padding: 2px 10px;
    border-radius: 9999px;
    font-weight: 500;
    display: inline-block;
}

.priority-low {
    background-color: #d1fae5;
    color: #065f46;
}

.priority-medium {
    background-color: #fef3c7;
    color: #92400e;
}

.priority-high {
    background-color: #fed7aa;
    color: #9a3412;
}

.priority-emergency {
    background-color: #dc3545 !important;
    color: #ffffff !important;
    animation: blink-emergency 1s ease-in-out infinite;
}

@keyframes blink-emergency {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.priority-unassigned {
    background-color: #fecaca !important;
    color: #991b1b !important;
}

.status-badge {
    font-size: 0.75rem;
    padding: 2px 10px;
    border-radius: 9999px;
    font-weight: 500;
    display: inline-block;
}

.status-submitted {
    background-color: #f3f4f6;
    color: #374151;
}

.status-reviewed {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-assigned {
    background-color: #e0e7ff;
    color: #3730a3;
}

.status-in_progress {
    background-color: #fef3c7;
    color: #92400e;
}

.status-completed,
.status-completed_not_paid {
    background-color: #fef3c7;
    color: #92400e;
}

.status-completed_paid {
    background-color: #d1fae5;
    color: #065f46;
}

.maint-timeline { padding: 4px 0; }
.maint-timeline-step { display: flex; align-items: flex-start; gap: 10px; }
.maint-timeline-track { display: flex; flex-direction: column; align-items: center; width: 18px; flex-shrink: 0; }
.maint-timeline-dot {
    width: 18px; height: 18px; border-radius: 50%;
    border: 2px solid #d1d5db; background: #fff;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 0.55rem; flex-shrink: 0;
}
.maint-timeline-dot.done { border-color: #16a34a; background: #16a34a; }
.maint-timeline-dot.current { border-color: #4F46E5; background: #4F46E5; box-shadow: 0 0 0 3px #c7d2fe; }
.maint-timeline-line { width: 2px; height: 20px; background: #e5e7eb; }
.maint-timeline-line.done { background: #16a34a; }
.maint-timeline-content { padding-bottom: 6px; min-height: 36px; display: flex; flex-direction: column; justify-content: center; }

.status-closed {
    background-color: #f3f4f6;
    color: #6b7280;
}

.status-inspection_pending {
    background-color: #fecaca !important;
    color: #991b1b !important;
}

.status-pending_violation {
    background-color: #fecaca !important;
    color: #991b1b !important;
}

.status-not_approved {
    background-color: #fee2e2;
    color: #991b1b;
}

.col-toggle-btn {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid #d1d5db;
    background: #f3f4f6;
    color: #9ca3af;
    font-size: 0.65rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    text-decoration: line-through;
}

.col-toggle-btn:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

.col-toggle-btn.active {
    background: #4F46E5;
    border-color: #4338CA;
    color: #ffffff;
    text-decoration: none;
}

.col-toggle-btn.active:hover {
    background: #4338CA;
}

.finance-chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 4px;
    border: 1px solid #d1d5db;
    background: #f3f4f6;
    color: #9ca3af;
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    text-decoration: line-through;
}

.finance-chip:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

.finance-chip.active {
    background: #4F46E5;
    border-color: #4338CA;
    color: #ffffff;
    text-decoration: none;
}

.finance-chip.active:hover {
    background: #4338CA;
}

.table {
    border-collapse: separate;
    border-spacing: 0;
}

.table th {
    font-weight: 600;
    color: #6b7280;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.75rem 1rem;
    background-color: #fff;
}

.table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    color: #374151;
    font-size: 0.875rem;
    vertical-align: middle;
}

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

.table thead th {
    border-top: none;
}

.table-responsive {
    max-height: calc(100vh - 240px);
    overflow: auto !important;
    -webkit-overflow-scrolling: touch;
}

.table-responsive > table > thead > tr > th {
    position: sticky;
    top: 0;
    background-color: #fff !important;
    z-index: 3;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.table-responsive > table > thead[style*="background"] > tr > th {
    background-color: #f8fafc !important;
}

.table-compact {
    font-size: 0.78rem;
    min-width: 1200px;
}
.table-compact th,
.table-compact td {
    padding: 0.35rem 0.5rem;
    white-space: nowrap;
}
.table-compact .sort-icon {
    font-size: 0.5rem;
    color: #9ca3af;
}
.table-compact th.col-title,
.table-compact td.col-title {
    min-width: 200px !important;
    white-space: normal !important;
    word-break: break-word;
}
.table-compact .col-trunc {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.table-compact .col-narrow {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.table-compact .col-date {
    white-space: nowrap;
}
.table-compact .col-xs {
    white-space: nowrap;
    text-align: center;
}
.table-compact .priority-badge,
.table-compact .status-badge {
    font-size: 0.65rem;
    padding: 1px 5px;
}
.table-compact th.sticky-col,
.table-compact td.sticky-col {
    position: sticky;
    background: #fff;
    z-index: 2;
}
.table-compact thead th.sticky-col {
    z-index: 3;
}
.table-compact .sticky-col-0 { left: 0; }
.table-compact .sticky-col-1 { left: 42px; border-right: 1px solid #e5e7eb; }
.col-toggle-btn {
    border: 1px solid #d1d5db;
    background: #fff;
    border-radius: 6px;
    padding: 3px 8px;
    cursor: pointer;
    font-size: 0.78rem;
    color: #4F46E5;
}
.col-toggle-btn:hover { background: #f3f4f6; }
.col-toggle-menu {
    position: absolute;
    right: 0;
    top: 100%;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    padding: 10px 14px;
    z-index: 1050;
    min-width: 200px;
    max-height: 350px;
    overflow-y: auto;
    display: none;
}
.col-toggle-menu.show { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 16px; }
.col-toggle-menu label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 6px;
    font-size: 0.8rem;
    cursor: pointer;
    white-space: nowrap;
    color: #374151;
    border-radius: 4px;
}
.col-toggle-menu label:hover { background: #f3f4f6; }
.col-toggle-menu input[type="checkbox"] {
    accent-color: #4F46E5;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.clickable-row {
    cursor: pointer;
}

.clickable-row:hover {
    background-color: #f9fafb;
}

.hover-card,
.property-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.hover-card:hover,
.property-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.form-control,
.form-select {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background-color: #ffffff;
    color: #374151;
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
}

.form-control:focus,
.form-select:focus {
    border-color: #4F46E5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-label {
    color: #374151;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.375rem;
}

.input-group-text {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background-color: #f9fafb;
    color: #6b7280;
}

.input-group .form-control {
    border-left: none;
}

.input-group-text + .form-control {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.input-group > .input-group-text:first-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.note-item {
    padding: 12px 0;
}

.back-link {
    color: #6b7280;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.15s;
}

.back-link:hover {
    color: #374151;
    text-decoration: none;
}

.list-group-item {
    border-color: #f3f4f6;
}

.list-group-item:hover {
    background-color: #f9fafb;
}

.list-group-item-action:focus,
.list-group-item-action:hover {
    background-color: #f9fafb;
}

.dropdown-menu {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 0.375rem;
}

.dropdown-item {
    border-radius: 6px;
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
}

.dropdown-item:hover {
    background-color: #f3f4f6;
}

.alert {
    border-radius: 8px;
    font-size: 0.875rem;
}

footer {
    color: #9ca3af;
    font-size: 0.8125rem;
}

footer .border-top {
    border-color: #f3f4f6 !important;
}

.property-popup h6 {
    margin-bottom: 8px;
    color: #4F46E5;
    font-family: 'Inter', sans-serif;
}

.property-popup .detail {
    margin: 3px 0;
    font-size: 0.9em;
    color: #374151;
}

.property-popup .badge {
    font-size: 0.75em;
}

.leaflet-container {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.page-header {
    margin-bottom: 1.5rem;
}

.page-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
}

.container {
    max-width: 1200px;
}

@media (max-width: 768px) {
    .navbar {
        padding: 2px 0;
    }
    .navbar .navbar-brand {
        font-size: 0.85rem;
    }
    .navbar .navbar-brand img {
        width: 24px !important;
        height: 24px !important;
    }
    .navbar .navbar-brand span.brand-text {
        display: none;
    }
    .navbar .navbar-brand span.brand-text-short {
        display: inline;
    }
    .user-avatar {
        width: 28px !important;
        height: 28px !important;
        font-size: 0.7rem !important;
    }
    .nav-links-row {
        display: none !important;
    }
    .mobile-nav {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #ffffff;
        border-top: 1px solid #e5e7eb;
        z-index: 9999;
        padding: 4px 2px 2px;
        padding-bottom: max(4px, env(safe-area-inset-bottom, 2px));
        box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        flex-wrap: nowrap;
        gap: 0;
    }
    .mobile-nav::-webkit-scrollbar {
        display: none;
    }
    .mobile-nav a {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-decoration: none;
        color: #6b7280;
        font-size: 0.58rem;
        font-weight: 500;
        padding: 4px 5px 3px;
        gap: 1px;
        min-width: 48px;
        flex: 0 0 auto;
        white-space: nowrap;
        -webkit-tap-highlight-color: rgba(79, 70, 229, 0.15);
        cursor: pointer;
    }
    .mobile-nav a i {
        font-size: 1rem;
    }
    .mobile-nav a.active {
        color: #4F46E5;
        font-weight: 700;
        background: rgba(79, 70, 229, 0.08);
        border-radius: 4px;
        position: relative;
    }
    .mobile-nav a.active::before {
        content: '';
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 16px;
        height: 2px;
        background: #4F46E5;
        border-radius: 0 0 2px 2px;
    }
    
    body {
        padding-bottom: calc(54px + env(safe-area-inset-bottom, 0px));
    }
    .container.mt-4 {
        margin-top: 0.75rem !important;
        padding-left: 12px;
        padding-right: 12px;
    }
    .page-header h2,
    h2 {
        font-size: 1.2rem;
    }
    .stat-card .card-body {
        padding: 6px 8px !important;
    }
    .stat-card h6 {
        font-size: 0.55rem !important;
        line-height: 1.2;
        min-height: 1.3em;
    }
    .stat-card h3 {
        font-size: 1.1rem !important;
    }
    .stat-card i {
        font-size: 1rem !important;
    }
    #filterForm {
        flex-wrap: wrap;
    }
    .conv-tab-bar::-webkit-scrollbar {
        display: none;
    }
    .stat-sticky {
        position: static !important;
        top: auto !important;
    }
    .maintenance-detail-badges {
        flex-wrap: wrap;
        gap: 4px;
    }
    .maintenance-detail-badges .btn {
        font-size: 0.65rem !important;
        padding: 3px 8px !important;
    }
    .house-report-table .table th,
    .house-report-table .table td {
        padding: 4px 6px !important;
        font-size: 0.7rem !important;
    }
    .house-report-table input[type="date"] {
        width: 100% !important;
        max-width: 120px;
    }
    .house-report-table input[type="text"] {
        width: 100% !important;
    }
    .prop-detail-header .d-flex.align-items-start {
        flex-wrap: wrap;
    }
    .prop-detail-header img {
        width: 70px !important;
        height: 70px !important;
    }
    .prop-detail-header .form-select.fw-bold {
        font-size: 0.9rem !important;
    }
    .cal-controls {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
    }
    .cal-controls .btn-group {
        align-self: flex-start;
    }
    .cal-nav {
        justify-content: center;
        flex-wrap: nowrap;
    }
    .cal-nav .btn {
        white-space: nowrap;
        flex-shrink: 0;
    }
    .cal-stats {
        display: flex;
        justify-content: center;
        text-align: center;
        flex-wrap: wrap;
        gap: 4px 8px;
    }
    .monthly-grid td {
        height: 50px !important;
        padding: 2px 3px !important;
        font-size: 0.7rem !important;
    }
    .monthly-grid th {
        font-size: 0.65rem !important;
        padding: 4px 2px !important;
    }
    .card-header {
        padding: 0.75rem 1rem;
    }
    .card-body {
        padding: 0.75rem 1rem;
    }
    .table th, .table td {
        padding: 0.5rem 0.625rem;
        font-size: 0.8rem;
    }
    .property-card .card-body {
        padding: 0.75rem;
    }
    .property-card .card-title {
        font-size: 0.9rem !important;
    }
    .login-card {
        padding: 28px 24px;
    }
    .photo-gallery-grid .col-lg-3 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    .lang-switcher {
        gap: 2px !important;
    }
    .lang-switcher .btn {
        font-size: 0.65rem;
        padding: 1px 8px;
    }
    .user-avatar {
        width: 30px;
        height: 30px;
        font-size: 0.75rem;
    }
    .d-flex.justify-content-between.align-items-center.mb-4 {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 8px;
    }
    .btn {
        font-size: 0.85rem;
        min-height: 36px;
    }
    .btn-sm {
        font-size: 0.8rem;
        padding: 0.35rem 0.8rem;
        min-height: 34px;
    }
    .btn-sm[style*="border-radius:50%"],
    .btn-sm[style*="border-radius: 50%"],
    .btn[style*="width:28px"],
    .btn[style*="width: 28px"],
    .chat-header .btn,
    .chat-back-btn {
        min-height: auto;
    }
    .form-control, .form-select {
        font-size: 1rem !important;
    }
    .form-control-sm, .form-select-sm {
        font-size: 1rem !important;
    }
}

@media (min-width: 769px) {
    .mobile-nav {
        display: none !important;
    }
    .navbar .navbar-brand span.brand-text {
        display: inline;
    }
    .navbar .navbar-brand span.brand-text-short {
        display: none;
    }
}

@media (max-width: 767.98px) {
    .notices-table .col-phone,
    .notices-table .col-status,
    .notices-table .col-msg-toggle,
    .notices-table .col-property {
        display: none !important;
    }
    .notices-table .col-actions {
        width: auto !important;
    }
    .notices-table td, .notices-table th {
        padding: 4px 4px !important;
        font-size: 0.75rem !important;
    }
    .notices-header-card .d-flex {
        flex-wrap: wrap !important;
        gap: 4px !important;
    }
    .notices-title {
        font-size: 1.2rem !important;
    }
    .notices-info-card .d-flex.gap-3 {
        flex-wrap: wrap !important;
        gap: 4px 8px !important;
    }
    .notices-info-card .mt-1 {
        display: none !important;
    }
}

.tooltip-light .tooltip-inner {
    background-color: #fef9c3;
    color: #713f12;
    font-size: 0.78rem;
    font-weight: 500;
    border: 1px solid #fde68a;
}
.tooltip-light .tooltip-arrow::before {
    border-top-color: #fde68a;
}
.tooltip-light.bs-tooltip-bottom .tooltip-arrow::before {
    border-bottom-color: #fde68a;
}
.tooltip-light.bs-tooltip-start .tooltip-arrow::before {
    border-left-color: #fde68a;
}
.tooltip-light.bs-tooltip-end .tooltip-arrow::before {
    border-right-color: #fde68a;
}

@media (max-width: 768px) {
    .row.g-2.align-items-end {
        flex-wrap: wrap !important;
    }
    .row.g-2.align-items-end > .col-auto {
        flex: 0 0 auto;
        width: auto;
        max-width: 100%;
    }
    .row.g-2.align-items-end > .col-auto:has(.form-select-sm),
    .row.g-2.align-items-end > .col-auto:has(.form-control-sm) {
        flex: 1 1 45%;
        min-width: 120px;
    }
    .row.g-3.align-items-end {
        flex-wrap: wrap !important;
    }
    .row.g-3.align-items-end > [class*="col-md-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }
    h4 {
        font-size: 1.15rem;
    }
    .d-flex.justify-content-between.align-items-center.mb-3 {
        flex-wrap: wrap;
        gap: 8px;
    }
    .house-report-table input[type="text"],
    .house-report-table input[type="date"] {
        font-size: 1rem !important;
        min-height: 32px;
    }
    .ledger-table {
        font-size: 0.78rem !important;
    }
    .master-table {
        font-size: 0.75rem !important;
    }
    .master-table th, .master-table td {
        padding: 4px 6px !important;
    }
    .master-categories-bar .d-flex {
        flex-wrap: wrap !important;
    }
    .master-cat-chip {
        font-size: 0.68rem !important;
        padding: 2px 6px !important;
    }
    .table-sm th, .table-sm td {
        padding: 4px 6px !important;
    }
    .accounting-filter-row {
        flex-wrap: wrap !important;
    }
    .accounting-filter-row > .col-auto {
        flex: 1 1 45% !important;
        min-width: 100px;
    }
    .accounting-filter-row > .col-auto:last-child {
        flex: 0 0 auto !important;
        width: auto !important;
    }
    footer.mt-5 {
        margin-bottom: 8px !important;
    }
    .d-flex.gap-2:last-child > .btn,
    .d-flex.gap-2.mb-4 > .btn,
    .mt-3.d-flex.gap-2 > .btn {
        min-height: 44px;
        font-size: 0.9rem;
    }
    .d-flex.justify-content-between.mb-4,
    .d-flex.justify-content-between.mb-3,
    .d-flex.justify-content-end.gap-2.mb-2 {
        flex-wrap: wrap;
        gap: 8px;
    }
    .card-header.d-flex.justify-content-between {
        flex-wrap: wrap;
        gap: 6px;
    }
    .d-flex.justify-content-between.mb-4 > .d-flex.gap-2 {
        flex-wrap: wrap;
    }
    .d-flex.justify-content-between.mb-4 > .d-flex.gap-2 > .btn,
    .d-flex.justify-content-between.mb-4 > .d-flex.gap-2 > form > .btn,
    .d-flex.justify-content-between.mb-4 > .d-flex.gap-2 > .dropdown > .btn {
        font-size: 0.75rem !important;
        padding: 4px 8px !important;
    }
    .d-flex.justify-content-end.gap-2.mb-2 > .btn,
    .d-flex.justify-content-end.gap-2.mb-2 > a.btn {
        font-size: 0.78rem !important;
        padding: 5px 10px !important;
    }
    .prop-detail-header .d-flex.flex-wrap.gap-1 {
        gap: 4px !important;
    }
    .prop-detail-header .d-flex.flex-wrap.gap-1 > .btn {
        font-size: 0.7rem !important;
        padding: 3px 8px !important;
    }
    .prop-detail-header .d-flex.flex-wrap.gap-2 > span {
        font-size: 0.78rem !important;
        padding: 2px 8px !important;
    }
    .fin-header .d-flex.gap-2.align-items-center.flex-wrap {
        width: 100%;
        justify-content: flex-start;
    }
    .fin-header .d-flex.gap-2.align-items-center.flex-wrap > .btn,
    .fin-header .d-flex.gap-2.align-items-center.flex-wrap > button {
        flex: 1 1 45%;
        min-width: 0;
        font-size: 0.72rem !important;
        padding: 5px 6px !important;
    }
    .fin-header .d-flex.gap-2.align-items-center.flex-wrap > input.form-control {
        flex: 1 1 100%;
        max-width: 100% !important;
    }
    .finance-chip {
        font-size: 0.68rem !important;
        padding: 2px 6px !important;
    }
    .d-flex.gap-2.mb-3.mt-3 {
        flex-wrap: wrap;
    }
    .d-flex.gap-2.mb-3.mt-3 > a.btn {
        font-size: 0.72rem !important;
        padding: 4px 10px !important;
    }
    .receipt-filter-btn {
        font-size: 0.65rem !important;
        padding: 1px 4px !important;
    }
}

@media (max-width: 576px) {
    .modal-dialog {
        margin: 12px;
        max-width: calc(100% - 24px);
    }
    .modal-dialog .modal-content {
        border-radius: 12px;
    }
    .modal-dialog.modal-dialog-centered {
        min-height: auto;
    }
    .modal-dialog.modal-sm {
        max-width: 280px;
        margin-left: auto;
        margin-right: auto;
    }
    .modal-dialog.modal-lg,
    .modal-dialog.modal-xl,
    .modal-dialog-scrollable,
    .modal-fullscreen-sm-down {
        margin: 0;
        max-width: 100%;
        min-height: 100vh;
        min-height: 100dvh;
    }
    .modal-dialog.modal-lg .modal-content,
    .modal-dialog.modal-xl .modal-content,
    .modal-dialog-scrollable .modal-content,
    .modal-fullscreen-sm-down .modal-content {
        min-height: 100vh;
        min-height: 100dvh;
        border: none;
        border-radius: 0;
    }
    .modal-dialog.modal-lg .modal-body,
    .modal-dialog.modal-xl .modal-body,
    .modal-dialog-scrollable .modal-body {
        overflow-y: auto;
        flex: 1;
    }
    .modal-footer {
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)) !important;
    }
    .modal-footer .btn {
        min-height: 42px;
        font-size: 0.88rem;
        padding: 8px 18px;
    }
    .modal-footer .btn-sm {
        min-height: 42px;
        font-size: 0.88rem !important;
        padding: 8px 18px !important;
    }
}

@media (max-width: 768px) {
    .accounting-filter-row {
        flex-direction: column !important;
    }
    .accounting-filter-row > .col-auto {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
    .accounting-filter-row .form-select,
    .accounting-filter-row .form-control {
        min-width: 0 !important;
        width: 100% !important;
    }

    .acct-page-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }
    .acct-page-header h4 {
        font-size: 1.05rem !important;
    }
    .acct-page-header .d-flex.gap-2 {
        width: 100%;
    }
    .acct-page-header .btn {
        font-size: 0.72rem !important;
        padding: 4px 8px !important;
    }

    .pl-table { font-size: 0.7rem !important; }
    .pl-table th, .pl-table td { padding: 4px 6px !important; white-space: normal !important; }
    .pl-table .amt { font-size: 0.68rem !important; min-width: 0 !important; }
    .pl-table .acct-name { padding-left: 16px !important; }
    .pl-table .section-hdr td { font-size: 0.72rem !important; padding: 5px 6px !important; }
    .pl-table .sub-hdr td { padding-left: 10px !important; font-size: 0.7rem !important; }
    .pl-table thead th { font-size: 0.62rem !important; padding: 4px 6px !important; min-width: 0 !important; }
    .pl-table .grand-total td { font-size: 0.72rem !important; }

    .table-responsive { -webkit-overflow-scrolling: touch; }

    .bs-table { font-size: 0.75rem !important; }
    .bs-table td { padding: 4px 8px !important; }
    .bs-table td:last-child { min-width: 90px; }

    .recon-summary-row {
        flex-wrap: wrap !important;
    }
    .recon-summary-row > .col {
        flex: 0 0 50% !important;
        max-width: 50% !important;
        padding: 3px !important;
    }
    .recon-summary-row .card-body {
        padding: 6px !important;
    }
    .recon-summary-row .card-body > div:first-child {
        font-size: 0.58rem !important;
    }
    .recon-summary-row .card-body > div:last-child {
        font-size: 0.85rem !important;
    }

    .recon-header-row {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 6px !important;
    }
    .recon-header-row h4 {
        font-size: 1rem !important;
    }
}
