/* CSS Variables */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #22c55e;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;

    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-dark: #1e293b;

    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-light: #94a3b8;

    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

    --sidebar-width: 260px;
    --header-height: 70px;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e40af 100%);
    color: white;
    box-shadow: var(--shadow-md);
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 2rem;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.header h1 i {
    margin-right: 0.5rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
}

.user-info i {
    font-size: 1.5rem;
}

/* Container */
.container {
    display: flex;
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    padding: 2rem 0;
    position: fixed;
    height: calc(100vh - var(--header-height));
    overflow-y: auto;
    z-index: 500;
}

.sidebar-nav ul {
    list-style: none;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background: var(--bg-secondary);
    color: var(--primary-color);
}

.nav-link.active {
    background: #eff6ff;
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 500;
}

.nav-link i {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Fix Bootstrap tab-pane visibility */
.tab-pane.fade {
    display: none;
}
.tab-pane.fade.show.active {
    display: block;
    opacity: 1;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.section-header h2 i {
    margin-right: 0.5rem;
    color: var(--primary-color);
}

.section-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    min-height: 44px;
    min-width: 44px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #475569;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #16a34a;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-warning:hover:not(:disabled) {
    background: #d97706;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
    min-height: 36px;
}

.btn-icon {
    padding: 0.5rem;
    width: 36px;
    height: 36px;
    justify-content: center;
}

/* Table */
.table-container {
    background: var(--bg-primary);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
    overflow-y: hidden;
    margin-bottom: 1.5rem;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.data-table thead {
    background: var(--bg-secondary);
}

.data-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border-color);
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.data-table tbody tr {
    transition: background 0.2s ease;
}

.data-table tbody tr:hover {
    background: var(--bg-secondary);
}

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

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-secondary);
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-vacant {
    background: #dcfce7;
    color: #166534;
}

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

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

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-sm);
}

#page-info {
    font-weight: 500;
    color: var(--text-secondary);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: 0.5rem;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* Forms */
form {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
    flex: 1;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.required {
    color: var(--danger-color);
}

.form-control,
.form-select {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 16px;
    transition: all 0.2s ease;
}

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

.form-row {
    display: flex;
    gap: 1rem;
}

/* Loading Spinner */
.loading-spinner {
    width: 40px;
    height: 40px;
    margin: 2rem auto;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background: var(--bg-dark);
    color: white;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    transform: translateY(200%);
    transition: transform 0.3s ease;
    z-index: 2000;
    max-width: 400px;
}

.toast.show {
    transform: translateY(0);
}

.toast.success {
    background: var(--success-color);
}

.toast.error {
    background: var(--danger-color);
}

.toast.warning {
    background: var(--warning-color);
}

.toast.info {
    background: var(--info-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        width: 200px;
    }

    .main-content {
        margin-left: 200px;
        padding: 1rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .form-row {
        flex-direction: column;
    }

    .action-buttons {
        flex-wrap: wrap;
    }

    .data-table {
        font-size: 0.75rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.5rem;
    }
}

@media (max-width: 576px) {
    .sidebar {
        position: fixed;
        left: -100%;
        transition: left 0.3s ease;
    }

    .sidebar.active {
        left: 0;
    }

    .main-content {
        margin-left: 0;
    }

    .header-content h1 {
        font-size: 1.125rem;
    }

    .toast {
        right: 1rem;
        left: 1rem;
        bottom: 1rem;
    }
}

/* Dashboard Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 1.75rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.05);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, transparent, currentColor, transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    transform: translateY(-4px) scale(1.02);
}

.stat-card:hover::before {
    opacity: 0.2;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    flex-shrink: 0;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.stat-card:hover .stat-icon {
    transform: rotate(-5deg) scale(1.05);
}

.stat-content {
    flex: 1;
    min-width: 0;
    overflow: visible;
}

.stat-label {
    font-size: 0.813rem;
    color: var(--text-secondary);
    margin-bottom: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

.stat-value {
    font-size: clamp(0.875rem, 2vw, 1.25rem);
    font-weight: 700;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    display: block;
    width: 100%;
    letter-spacing: -0.02em;
}

.stat-sub {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-top: 0.5rem;
}

/* Revenue Grid */
.revenue-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.revenue-card {
    background: var(--bg-primary);
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.revenue-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.revenue-card h3 i {
    color: var(--warning-color);
}

.revenue-main {
    margin-bottom: 1.5rem;
}

.revenue-amount {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.revenue-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.revenue-label span {
    font-weight: 600;
    color: var(--success-color);
}

.revenue-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.revenue-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
}

.revenue-item span {
    color: var(--text-secondary);
}

.revenue-item strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Bills Summary */
.bills-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1rem;
}

.bill-stat {
    text-align: center;
    padding: 1.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.bill-stat.paid {
    background: #dcfce7;
}

.bill-stat.unpaid {
    background: #fee2e2;
}

.bill-stat:hover {
    transform: scale(1.05);
}

.bill-count {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.bill-stat.paid .bill-count {
    color: #166534;
}

.bill-stat.unpaid .bill-count {
    color: #991b1b;
}

.bill-label {
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.bill-stat.paid .bill-label {
    color: #166534;
}

.bill-stat.unpaid .bill-label {
    color: #991b1b;
}

/* Bill Status Badges */
.status-paid {
    background: #dcfce7;
    color: #166534;
}

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

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

.status-overdue {
    background: #fce7f3;
    color: #831843;
}

/* Utility Classes */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.font-bold { font-weight: 600; }
.font-normal { font-weight: 400; }

/* ============================================
   RESPONSIVE DESIGN FOR MOBILE
   ============================================ */

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1001;
    background: var(--primary-color);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    min-width: 50px;
    min-height: 50px;
    border-radius: 8px;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
    transition: all 0.3s ease;
    touch-action: manipulation;
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
    box-shadow: var(--shadow-md);
}

.mobile-menu-toggle:hover {
    background: var(--primary-hover);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.5);
}

/* Table Responsive Wrapper */
.table-container {
    background: var(--bg-primary);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

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

/* Tablet and below (max-width: 1024px) */
@media screen and (max-width: 1024px) {
    :root {
        --sidebar-width: 220px;
    }

    .header h1 {
        font-size: 1.25rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .table-container {
        margin: 0 -1rem;
        padding: 0 1rem;
    }

    .data-table {
        font-size: 0.875rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.75rem 0.5rem;
    }
}

/* Mobile (max-width: 768px) */
@media screen and (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }

    .header-content {
        padding: 0 1rem 0 70px;
    }

    .header h1 {
        font-size: 1rem;
    }

    .header h1 i {
        display: none;
    }

    /* User dropdown adjustments for mobile */
    .user-dropdown-toggle {
        padding: 0.375rem 0.75rem;
        font-size: 0.875rem;
    }

    .user-dropdown-toggle span:not(.user-role-badge) {
        display: none;
    }

    .user-dropdown-toggle i.fa-user-circle {
        font-size: 1.25rem;
    }

    .user-dropdown-menu {
        right: -10px;
        min-width: 200px;
    }

    /* Hide sidebar by default on mobile */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 999;
        width: 260px;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    /* Mobile Overlay */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 998;
    }

    .sidebar-overlay.active {
        display: block;
    }

    /* Main content takes full width on mobile */
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 1rem;
    }

    /* Stats Grid - 1 column on mobile */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Section Header - stack on mobile */
    .section-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .section-actions {
        flex-direction: column;
        width: 100%;
    }

    .section-actions .btn,
    .section-actions .form-select {
        width: 100%;
    }

    /* Filter Grid - stack on mobile */
    .filter-grid {
        grid-template-columns: 1fr;
    }

    /* Responsive Tables - horizontal scroll on mobile */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -1rem;
        padding: 0 1rem;
    }

    .bills-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    #bills-table {
        min-width: 1200px; /* Force horizontal scroll */
    }

    /* Make table text smaller but readable on mobile */
    .data-table {
        font-size: 0.875rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.75rem 0.5rem;
        white-space: nowrap;
    }

    /* Modal Adjustments */
    .modal-content {
        width: 95%;
        margin: 0.5rem;
        max-height: 95vh;
        overflow-y: auto;
    }

    .modal-body {
        padding: 1rem;
    }

    .modal-header {
        padding: 1rem;
    }

    .modal-footer {
        padding: 1rem;
        flex-direction: column;
        gap: 0.75rem;
    }

    .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    /* Form Controls - better touch on mobile */
    .form-control,
    .form-select {
        padding: 0.75rem;
        font-size: 16px;
        min-height: 48px;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    /* Action Buttons - better spacing on mobile */
    .action-buttons {
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    /* Keep touch targets at 44px minimum on mobile */
    .btn-sm {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        min-height: 44px;
    }

    .btn-icon {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
    }

    /* Pagination - better touch targets */
    .pagination {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 1rem 0.5rem;
    }

    .pagination button {
        font-size: 0.875rem;
        padding: 0.625rem 1rem;
        min-height: 44px;
        min-width: 44px;
    }
}

/* Small Mobile (max-width: 576px) */
@media screen and (max-width: 576px) {
    /* Modal Adjustments for Small Screens */
    .modal-content {
        width: 95%;
        max-width: 100%;
        margin: 0.5rem;
        max-height: 95vh;
    }

    /* Card Adjustments */
    .stat-card,
    .revenue-card,
    .info-card {
        padding: 0.75rem;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    /* Form Adjustments */
    .form-row {
        flex-direction: column;
        gap: 0.5rem;
    }

    .form-group {
        margin-bottom: 1rem;
    }

    /* Table Adjustments */
    .data-table th {
        padding: 0.75rem 0.5rem;
        font-size: 0.7rem;
    }

    .data-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }

    /* Button Adjustments - maintain 44px touch targets */
    .btn {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
        min-height: 44px;
    }

    .btn-icon {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
    }

    .btn-sm {
        min-height: 44px;
        padding: 0.5rem 0.875rem;
    }
}

/* Small Mobile (max-width: 480px) */
@media screen and (max-width: 480px) {
    .mobile-menu-toggle {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        font-size: 1.25rem;
    }

    .header h1 {
        font-size: 0.9rem;
    }

    .header-content {
        padding: 0 0.75rem 0 60px;
    }

    .user-info {
        font-size: 0.875rem;
    }

    .user-info span:not(.fa-user-circle) {
        display: none;
    }

    .user-dropdown-toggle i.fa-user-circle {
        font-size: 1.5rem;
    }

    .user-role-badge {
        display: none;
    }

    .user-dropdown-toggle i.fa-chevron-down {
        display: none;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }

    .stat-value {
        font-size: 1.25rem;
        white-space: nowrap;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    .data-table {
        font-size: 0.75rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.5rem 0.25rem;
    }

    /* Status Badges - better visibility on small screens */
    .status-badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }

    /* Section Header - better spacing */
    .section-header h2 {
        font-size: 1.25rem;
    }

    /* Action buttons - full width on very small screens */
    .action-buttons {
        flex-direction: column;
        width: 100%;
    }

    .action-buttons .btn {
        width: 100%;
    }

    /* Toast notification - full width */
    .toast {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
        max-width: calc(100% - 2rem);
    }
}

/* Print Styles */
@media print {
    .header,
    .sidebar,
    .section-actions,
    .filter-grid,
    .action-buttons,
    .pagination,
    .mobile-menu-toggle {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .data-table {
        font-size: 10px;
    }

    .data-table th,
    .data-table td {
        padding: 0.25rem;
    }
}

/* Breadcrumb Navigation */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.breadcrumb-separator {
    color: var(--text-light);
}

/* Info Grid for Room Details */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.info-card {
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.info-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.info-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Margin utilities */
.mt-3 {
    margin-top: 2rem;
}

/* Responsive for breadcrumb and info-grid */
@media screen and (max-width: 640px) {
    .breadcrumb {
        flex-wrap: wrap;
        font-size: 0.75rem;
    }

    .info-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .info-card {
        padding: 1rem;
    }
}

/* Info button style */
.btn-info {
    background: var(--info-color);
    color: white;
}

.btn-info:hover {
    background: #2563eb;
}

/* Zalo button style */
.btn-zalo {
    background: #0068FF;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-zalo:hover {
    background: #0052CC;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 104, 255, 0.3);
}

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

.btn-zalo i {
    font-size: 14px;
}

/* ============================================
   BILL DETAIL MODAL STYLES
   ============================================ */

.bill-modal-content {
    max-width: 800px;
}

.bill-detail {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
}

/* Bill Header */
.bill-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: #f9f9f9;
}

.bill-header-left {
    flex: 1;
}

.bill-header-right {
    flex: 1;
    text-align: right;
}

.bill-company-name {
    font-size: 20px;
    font-weight: bold;
    color: var(--primary-color);
    margin: 0 0 5px 0;
}

.bill-address {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
}

.bill-title {
    font-size: 18px;
    font-weight: bold;
    color: #e74c3c;
    margin: 0 0 5px 0;
}

.bill-period {
    color: var(--text-secondary);
    margin: 5px 0;
    font-size: 14px;
}

.bill-status-badge {
    display: inline-block;
    margin-top: 5px;
}

.bill-divider {
    border: none;
    border-top: 2px solid var(--border-color);
    margin: 15px 0;
}

/* Bill Info Section */
.bill-info-section {
    margin: 15px 0;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: #f9f9f9;
}

.bill-info-row {
    display: flex;
    gap: 30px;
    margin-bottom: 10px;
}

.bill-info-col {
    flex: 1;
    font-size: 13px;
}

.bill-info-col strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Bill Detail Table */
.bill-detail-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    font-size: 13px;
}

.bill-detail-table th,
.bill-detail-table td {
    padding: 10px;
    border: 1px solid var(--border-color);
}

.bill-detail-table th {
    background: var(--background-secondary);
    font-weight: 600;
    color: var(--text-primary);
}

.bill-detail-table tbody tr {
    transition: background 0.2s;
}

.bill-detail-table tbody tr:hover {
    background: var(--background-secondary);
}

.bill-detail-table .font-bold {
    font-weight: 600;
}

.bill-detail-table .text-left {
    text-align: left;
}

.bill-detail-table .text-center {
    text-align: center;
}

.bill-detail-table .text-right {
    text-align: right;
}

/* Bill Total Rows */
.bill-total-row td {
    font-size: 16px;
    background: var(--background-secondary);
    padding: 15px 12px;
    font-weight: 600;
}

.bill-total-amount {
    color: #e74c3c;
    font-size: 18px;
}

.bill-paid-row td {
    background: #d4edda;
}

.bill-remaining-row td {
    background: #fff3cd;
}

/* Bill Note */
.bill-note {
    margin: 20px 0;
    padding: 15px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 4px;
    font-size: 14px;
}

.bill-note strong {
    font-weight: 600;
    color: var(--text-primary);
}

/* Bill Footer */
.bill-footer {
    margin-top: 30px;
    text-align: center;
    color: var(--text-secondary);
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.bill-footer-text {
    font-size: 14px;
    margin-bottom: 10px;
    font-style: italic;
}

.bill-footer-date {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Bill History Section */
.bill-history-section {
    margin: 20px 0;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: #f0f7ff;
}

.bill-history-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bill-history-title i {
    font-size: 16px;
}

.bill-history-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bill-history-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 13px;
}

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

.history-label {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 130px;
    flex: 0 0 auto;
}

.history-value {
    color: var(--text-secondary);
    text-align: right;
    flex: 1;
}

/* Loading Spinner for Bill Modal */
.bill-detail .loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

/* Bank Transfer Info Section */
.bill-bank-info-section {
    margin: 15px 0;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: #f9f9f9;
}

.bank-info-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bank-info-title i {
    color: var(--primary-color);
    font-size: 18px;
}

.bank-info-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bank-info-row {
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: space-between;
}

.bank-info-label {
    font-weight: 600;
    color: #4b5563;
    font-size: 13px;
    min-width: 140px;
}

.bank-info-value {
    color: #1f2937;
    font-size: 14px;
    flex: 1;
    word-break: break-word;
}

/* Editable Transfer Content Field */
.bank-transfer-content-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 10px;
}

.bank-transfer-content-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.bank-transfer-content-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn-copy-transfer {
    padding: 8px 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-copy-transfer:hover {
    background: var(--primary-hover);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.btn-copy-transfer:active {
    transform: scale(0.95);
}

.btn-copy-transfer i {
    font-size: 12px;
}

/* Responsive for Bill Modal */
@media screen and (max-width: 768px) {
    .bill-modal-content {
        max-width: 95%;
        margin: 10px;
    }

    .bill-header {
        flex-direction: column;
        gap: 15px;
    }

    .bill-header-right {
        text-align: left;
    }

    .bill-company-name {
        font-size: 20px;
    }

    .bill-title {
        font-size: 18px;
    }

    .bill-info-row {
        flex-direction: column;
        gap: 10px;
    }

    .bill-detail-table {
        font-size: 12px;
    }

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

    .bill-total-row td {
        font-size: 14px;
    }

    .bill-total-amount {
        font-size: 16px;
    }

    /* Bill History Responsive */
    .bill-history-section {
        margin: 15px 0;
        padding: 12px;
    }

    .bill-history-title {
        font-size: 13px;
    }

    .history-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px 0;
        gap: 5px;
    }

    .history-label {
        min-width: auto;
        width: 100%;
    }

    .history-value {
        text-align: left;
        width: 100%;
    }
}

/* Print Styles for Bill */
@media print {
    body * {
        visibility: hidden;
    }

    #bill-print-area,
    #bill-print-area * {
        visibility: visible;
    }

    #bill-print-area {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }

    .modal,
    .modal-header button,
    .modal-footer {
        display: none !important;
    }

    .bill-detail {
        padding: 20px;
    }

    .no-print {
        display: none !important;
    }

    @page {
        margin: 1cm;
    }
}

/* ============================================
   HOUSE CONFIG SECTION IN BILL MODAL
   ============================================ */

.house-config-section {
    margin-top: 30px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background: var(--background-primary);
}

.house-config-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    user-select: none;
}

.house-config-header:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a4190 100%);
}

.house-config-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.house-config-header h4 i {
    font-size: 18px;
}

.house-config-header i.fa-chevron-down,
.house-config-header i.fa-chevron-up {
    font-size: 14px;
    transition: transform 0.3s;
}

.house-config-content {
    padding: 20px;
    background: var(--background-secondary);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

.house-config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.config-item {
    background: var(--background-primary);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.config-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.config-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.config-label i {
    font-size: 14px;
    color: var(--primary-color);
}

.config-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
}

.house-config-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* Responsive for House Config */
@media screen and (max-width: 768px) {
    .house-config-grid {
        grid-template-columns: 1fr;
    }

    .house-config-header h4 {
        font-size: 14px;
    }

    .config-value {
        font-size: 16px;
    }
}

/* ============================================
   MODAL MINIMIZE & FLOATING BUTTON
   ============================================ */

/* Modal Header Actions Container */
.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Modal Minimize Button */
.modal-minimize {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 18px;
}

.modal-minimize:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--primary-color);
}

.modal-minimize:active {
    transform: scale(0.95);
}

/* Floating Button for Minimized Modal */
.bill-floating-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #2563eb 100%);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 15px 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
    z-index: 999;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(100px) scale(0.8);
}

.bill-floating-btn.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.bill-floating-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 30px rgba(59, 130, 246, 0.5);
}

.bill-floating-btn:active {
    transform: translateY(-1px) scale(1);
}

.bill-floating-btn i {
    font-size: 18px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.bill-floating-btn span {
    font-size: 14px;
}

/* Responsive for Floating Button */
@media screen and (max-width: 768px) {
    .bill-floating-btn {
        bottom: 20px;
        right: 20px;
        padding: 12px 20px;
        font-size: 14px;
    }

    .bill-floating-btn i {
        font-size: 16px;
    }

    .bill-floating-btn span {
        font-size: 13px;
    }
}

/* ============================================
   LATE FEE CONFIGURATION STYLES
   ============================================ */

.house-detail-tabs {
    margin-top: 1rem;
}

.tab-nav {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 2rem;
}

.tab-button {
    padding: 0.75rem 1.5rem;
    border: none;
    background: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s ease;
}

.tab-button:hover {
    color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.05);
}

.tab-button.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-button i {
    margin-right: 0.5rem;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.late-fee-config-container {
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.radio-group {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.5rem;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    gap: 0.5rem;
}

.radio-label input[type="radio"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.late-fee-status {
    margin-top: 1.5rem;
}

.info-box {
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--info-color);
    background-color: #eff6ff;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.info-box.success {
    border-left-color: var(--success-color);
    background-color: #f0fdf4;
}

.info-box.error {
    border-left-color: var(--danger-color);
    background-color: #fef2f2;
}

.info-box i {
    font-size: 1.25rem;
    margin-top: 0.25rem;
}

.info-box strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.info-box p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.95rem;
}

/* ============================================
   BILL GENERATION MODAL STYLES
   ============================================ */

.bill-generation-options {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.generation-option {
    padding: 1.5rem;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.generation-option h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
    font-size: 1rem;
}

.generation-option p {
    margin: 0 0 1rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.generation-option .form-row {
    display: flex;
    gap: 1rem;
}

.generation-option .form-group {
    flex: 1;
}

.divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 0;
}

.status-box {
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--info-color);
    background-color: #eff6ff;
    display: flex;
}

.status-box.success {
    border-left-color: var(--success-color);
    background-color: #f0fdf4;
}

.status-box.error {
    border-left-color: var(--danger-color);
    background-color: #fef2f2;
}

.status-box.loading {
    border-left-color: var(--warning-color);
    background-color: #fffbeb;
}

.status-content {
    display: flex;
    gap: 1rem;
    align-items: center;
    width: 100%;
}

.status-content i {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.status-content p {
    margin: 0;
    color: var(--text-primary);
    font-weight: 500;
}

/* Late Fee Badge in Bill */
.late-fee-badge {
    display: inline-block;
    background-color: var(--danger-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-right: 0.25rem;
}

.late-fee-row {
    background-color: #fef2f2;
}

.late-fee-row td {
    border-top: 2px solid var(--danger-color);
}

/* Responsive Styles */
@media screen and (max-width: 768px) {
    .tab-nav {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .tab-button {
        flex: 1;
        min-width: 150px;
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
    }

    .generation-option .form-row {
        flex-direction: column;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions button {
        width: 100%;
    }

    .section-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .section-actions button {
        flex-grow: 1;
        min-width: 120px;
    }
}

@media screen and (max-width: 480px) {
    .tab-button {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
        min-width: 100px;
    }

    .late-fee-config-container {
        padding: 1rem;
    }

    .radio-group {
        flex-direction: column;
        gap: 0.75rem;
    }

    .generation-option {
        padding: 1rem;
    }
}

/* ============================================
   BILL STATUS UPDATE MODAL STYLES
   ============================================ */

/* Bill Status Modal Container */
.bill-status-modal {
    animation: fadeIn 0.25s ease;
}

.bill-status-modal.active {
    animation: fadeIn 0.25s ease;
}

/* Bill Status Modal Content */
.bill-status-modal-content {
    animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    overflow: hidden;
}

/* Modal Header Enhancement */
.bill-status-modal-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e40af 100%);
    color: white;
    padding: 1.5rem;
    border: none;
}

.bill-status-modal-header h3 {
    color: white;
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.bill-status-modal-header h3 i {
    font-size: 1.25rem;
}

/* Modal Body Enhancement */
.bill-status-modal-body {
    padding: 2rem 1.75rem;
    background: var(--bg-primary);
}

/* Form Group Styling */
.bill-status-form-group {
    margin-bottom: 0;
}

.bill-status-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.bill-status-label i {
    color: var(--primary-color);
    font-size: 1rem;
}

/* Select Wrapper */
.bill-status-select-wrapper {
    position: relative;
    margin-bottom: 1.25rem;
}

.bill-status-select {
    width: 100%;
    padding: 0.875rem 1rem;
    padding-right: 2.5rem;
    font-size: 0.95rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.25rem;
    padding-right: 2.75rem;
}

.bill-status-select:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
}

.bill-status-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15), inset 0 0 0 1px var(--primary-color);
}

.bill-status-select option {
    padding: 0.75rem;
    border: none;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-weight: 500;
}

.bill-status-select option:checked {
    background: linear-gradient(#e3f2fd, #e3f2fd);
    background-color: #e3f2fd;
    color: var(--primary-color);
    font-weight: 600;
}

/* Status Badge Preview */
.status-badge-preview {
    min-height: 3.5rem;
    padding: 1rem;
    border-radius: 0.5rem;
    background: var(--bg-secondary);
    border: 2px dashed var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.status-badge-preview.active {
    border-color: var(--primary-color);
    background: #eff6ff;
    border-style: solid;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.status-badge-preview-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    font-weight: 500;
}

.status-badge-preview-icon {
    font-size: 1.5rem;
    display: inline-flex;
    align-items: center;
}

.status-badge-color {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

/* Status Badge Colors */
.status-badge.bill-unpaid,
.status-color-unpaid {
    background: #fed7aa;
    color: #92400e;
}

.status-color-unpaid {
    background-color: #f97316;
}

.status-badge.bill-paid,
.status-color-paid {
    background: #dcfce7;
    color: #166534;
}

.status-color-paid {
    background-color: #22c55e;
}

.status-badge.bill-partial,
.status-color-partial {
    background: #bfdbfe;
    color: #1e40af;
}

.status-color-partial {
    background-color: #3b82f6;
}

.status-badge.bill-overdue,
.status-color-overdue {
    background: #fecaca;
    color: #7f1d1d;
}

.status-color-overdue {
    background-color: #ef4444;
}

/* Modal Footer */
.bill-status-modal-footer {
    padding: 1.25rem 1.75rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.bill-status-modal-footer .btn {
    padding: 0.625rem 1.5rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.bill-status-modal-footer .btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.bill-status-modal-footer .btn-secondary:hover {
    background: #475569;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(100, 116, 139, 0.2);
}

.bill-status-btn-update {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e40af 100%);
    color: white;
    font-weight: 600;
}

.bill-status-btn-update:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

.bill-status-btn-update:active {
    transform: translateY(0);
}

/* Responsive Design for Bill Status Modal */
@media screen and (max-width: 768px) {
    .bill-status-modal-content {
        width: 95%;
        margin: 1rem;
    }

    .bill-status-modal-body {
        padding: 1.5rem;
    }

    .bill-status-modal-header {
        padding: 1.25rem;
    }

    .bill-status-modal-header h3 {
        font-size: 1rem;
    }

    .bill-status-label {
        font-size: 0.9rem;
        margin-bottom: 0.75rem;
    }

    .bill-status-select {
        padding: 0.75rem 0.875rem;
        font-size: 0.875rem;
    }

    .status-badge-preview {
        min-height: 3rem;
        padding: 0.75rem;
    }

    .bill-status-modal-footer {
        padding: 1rem 1.5rem;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .bill-status-modal-footer .btn {
        flex: 1;
        min-width: 120px;
        justify-content: center;
        padding: 0.625rem 1rem;
    }
}

@media screen and (max-width: 480px) {
    .bill-status-modal-header h3 {
        font-size: 0.95rem;
        gap: 0.5rem;
    }

    .bill-status-modal-header h3 i {
        font-size: 1.1rem;
    }

    .bill-status-label {
        font-size: 0.875rem;
    }

    .bill-status-select {
        padding: 0.7rem 0.75rem;
        font-size: 0.8rem;
    }

    .status-badge-preview-content {
        font-size: 0.85rem;
        flex-direction: column;
        text-align: center;
    }

    .status-badge-preview-icon {
        font-size: 1.25rem;
    }

    .bill-status-modal-footer {
        flex-direction: column;
    }

    .bill-status-modal-footer .btn {
        width: 100%;
    }

    /* Extra-small screen bill modal adjustments */
    .bill-modal-content {
        max-width: 100% !important;
        margin: 0 !important;
        max-height: 100vh;
        overflow-y: auto;
    }

    .bill-header {
        padding: 10px;
        gap: 10px;
    }

    .bill-company-name {
        font-size: 16px !important;
    }

    .bill-title {
        font-size: 14px !important;
    }

    .bill-info-section,
    .bill-bank-info-section,
    .bill-history-section {
        padding: 10px;
        margin: 10px 0;
    }

    .bill-detail-table {
        font-size: 11px;
        margin: 10px 0;
    }

    .bill-detail-table th,
    .bill-detail-table td {
        padding: 5px 6px;
    }

    .bill-history-title {
        font-size: 12px;
        margin-bottom: 10px;
    }

    .history-item {
        padding: 8px 0;
    }

    .history-label,
    .history-value {
        font-size: 12px;
    }
}

/* Room Status Change Modal Centering */
#change-room-status-modal.modal.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

#change-room-status-modal .modal-dialog {
    margin: auto;
}

/* ============================================
   BULK BILL CREATION STYLES
   ============================================ */

/* Tabs Container for Bills Section */
.tabs-container {
    display: flex;
    gap: 10px;
    border-bottom: 2px solid #e5e7eb;
}

.tab-btn {
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 14px;
    color: #6b7280;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-btn:hover {
    color: #2563eb;
}

.tab-btn.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
    font-weight: 600;
}

.tab-btn i {
    font-size: 14px;
}

/* Bulk Bill Container */
.bulk-bill-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.bulk-bill-header h3 {
    margin-bottom: 15px;
    color: #1f2937;
    font-size: 1.25rem;
}

.bulk-bill-actions {
    position: sticky;
    bottom: 0;
    background: white;
    padding: 15px 0;
    border-top: 1px solid #e5e7eb;
}

/* Responsive table for bulk bills */
#bulk-bill-table-container table {
    width: 100%;
    font-size: 14px;
}

#bulk-bill-table-container input[type="number"] {
    padding: 5px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    width: 100%;
}

#bulk-bill-table-container input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.table-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 10px;
}

.table-actions button {
    font-size: 0.875rem;
}

.form-control-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 0.25rem;
}

.form-control-sm:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

/* Responsive for Bulk Bills */
@media screen and (max-width: 768px) {
    .tabs-container {
        gap: 5px;
    }

    .tab-btn {
        padding: 8px 15px;
        font-size: 13px;
    }

    .bulk-bill-container {
        padding: 15px;
    }

    .bulk-bill-header h3 {
        font-size: 1.1rem;
    }

    .form-row {
        flex-direction: column;
    }

    #bulk-bill-table-container {
        overflow-x: auto;
    }

    .table-actions {
        flex-direction: column;
    }

    .table-actions button {
        width: 100%;
    }
}

/* Logout Button Styling */
.btn-logout {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 15px;
}

.btn-logout:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
    color: white;
    text-decoration: none;
}

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

.btn-logout i {
    font-size: 14px;
}

/* User Dropdown Styles */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-dropdown {
    position: relative;
    z-index: 1100;
}

.user-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.user-dropdown-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.user-dropdown-toggle i.fa-user-circle {
    font-size: 1.5rem;
}

.user-dropdown-toggle i.fa-chevron-down {
    font-size: 0.75rem;
    transition: transform 0.3s ease;
}

.user-dropdown.active .user-dropdown-toggle i.fa-chevron-down {
    transform: rotate(180deg);
}

.user-role-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.user-role-badge.badge-admin {
    background: #ef4444;
    color: white;
}

.user-role-badge.badge-user {
    background: #3b82f6;
    color: white;
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 220px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1100;
}

.user-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #374151;
    text-decoration: none;
    transition: background 0.2s ease;
    font-size: 14px;
}

.dropdown-item:hover:not(.disabled) {
    background: #f3f4f6;
}

.dropdown-item.disabled {
    color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.6;
}

.dropdown-item i {
    width: 20px;
    text-align: center;
}

.dropdown-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 0.5rem 0;
}

/* Logout Modal Styles Enhancement */
#logout-modal .modal-content {
    animation: slideIn 0.3s ease;
    text-align: center;
}

#change-password-modal .modal-content {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.logout-modal-icon {
    font-size: 48px;
    color: #ffc107;
    margin-bottom: 20px;
    text-align: center;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.btn-danger {
    background: #ef4444;
    color: white;
    border: none;
}

.btn-danger:hover {
    background: #dc2626;
}

/* ============================================ */
/* Mobile Responsive - Bill Bank Transfer Section */
/* ============================================ */
@media (max-width: 768px) {
    /* Bank info section */
    .bill-bank-info-section {
        padding: 15px !important;
        margin-top: 15px !important;
    }

    /* Main container - stack vertically */
    .bank-transfer-container {
        flex-direction: column !important;
        gap: 15px !important;
    }

    /* Bank details section */
    .bank-info-details {
        min-width: 100% !important;
        width: 100%;
    }

    /* QR code section - center it */
    .bank-qr-code-section {
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    /* QR code image - responsive sizing */
    .bank-qr-code {
        max-width: 100% !important;
        width: auto !important;
        max-height: 300px;
    }

    /* Info rows - stack labels and values */
    .bank-info-row {
        flex-direction: column !important;
        align-items: flex-start !important;
        padding: 10px 0 !important;
    }

    /* Labels */
    .bank-info-label {
        min-width: auto !important;
        margin-bottom: 5px;
    }

    /* Transfer content wrapper - stack buttons */
    .bank-transfer-content-wrapper {
        flex-direction: column !important;
        width: 100%;
        gap: 8px !important;
    }

    /* Transfer input field */
    .bank-transfer-content-input {
        width: 100% !important;
        flex: none !important;
    }

    /* Copy buttons - full width on mobile */
    .btn-copy-transfer {
        width: 100%;
        padding: 8px 10px !important;
    }

    /* Bank info title */
    .bank-info-title {
        font-size: 1rem !important;
    }
}

/* ============================================
   MOBILE CARD LAYOUTS FOR LISTS/TABLES
   Optimized for mobile viewing
   ============================================ */

/* Mobile Card Container - Hidden on desktop */
.mobile-card-list {
    display: none;
}

/* Individual Mobile Card */
.mobile-card {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-left: 4px solid var(--primary-color);
}

.mobile-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.mobile-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.mobile-card-badge {
    margin-left: 0.5rem;
}

.mobile-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    padding: 0.25rem 0;
}

.mobile-card-label {
    color: var(--text-secondary);
    font-weight: 500;
    min-width: 120px;
}

.mobile-card-value {
    color: var(--text-primary);
    text-align: right;
    flex: 1;
    word-break: break-word;
}

.mobile-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.mobile-card-actions .btn {
    flex: 1;
    min-width: 44px;
    justify-content: center;
}

/* Mobile optimizations for specific lists */
@media screen and (max-width: 768px) {
    /* Hide desktop tables on mobile, but keep container visible for mobile cards */
    .table-container.has-mobile-cards table {
        display: none !important;
    }

    /* Show mobile card list */
    .mobile-card-list {
        display: block;
    }

    /* Bills mobile cards - special styling */
    .mobile-card.bill-card {
        border-left-color: var(--warning-color);
    }

    .mobile-card.bill-card.paid {
        border-left-color: var(--success-color);
    }

    .mobile-card.bill-card.overdue {
        border-left-color: var(--danger-color);
    }

    /* Rooms mobile cards - status colors */
    .mobile-card.room-card.vacant {
        border-left-color: var(--success-color);
    }

    .mobile-card.room-card.occupied {
        border-left-color: var(--danger-color);
    }

    .mobile-card.room-card.maintenance {
        border-left-color: var(--warning-color);
    }

    /* Houses mobile cards */
    .mobile-card.house-card {
        border-left-color: var(--primary-color);
    }

    /* Tenants mobile cards */
    .mobile-card.tenant-card {
        border-left-color: var(--info-color);
    }

    /* Enhanced amount display for bills */
    .mobile-card-amount {
        font-size: 1.25rem;
        font-weight: 700;
        color: var(--primary-color);
    }

    /* Status badges in mobile cards */
    .mobile-card .status-badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.625rem;
    }
}

/* ============================================
   BILL IMAGE EXPORT OPTIMIZATION
   Mobile-friendly image export for Zalo
   ============================================ */

/* Export-optimized bill layout */
.bill-detail.export-mode {
    background: white;
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
}

/* Enhanced header for export */
.bill-detail.export-mode .bill-header {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: white;
    padding: 20px;
    border: none;
    border-radius: 8px;
    margin-bottom: 20px;
}

.bill-detail.export-mode .bill-company-name {
    font-size: 24px;
    font-weight: bold;
    color: white;
    margin-bottom: 8px;
}

.bill-detail.export-mode .bill-address {
    color: rgba(255, 255, 255, 0.9);
    font-size: 15px;
}

.bill-detail.export-mode .bill-title {
    font-size: 22px;
    font-weight: bold;
    color: #fbbf24;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.bill-detail.export-mode .bill-period {
    color: rgba(255, 255, 255, 0.9);
    font-size: 15px;
}

.bill-detail.export-mode .bill-status-badge {
    font-size: 14px;
    padding: 6px 16px;
    font-weight: 600;
}

/* Enhanced info section for export */
.bill-detail.export-mode .bill-info-section {
    background: #f8fafc;
    padding: 18px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 20px;
}

.bill-detail.export-mode .bill-info-col {
    font-size: 15px;
    line-height: 1.8;
}

.bill-detail.export-mode .bill-info-col strong {
    color: #1e293b;
    font-weight: 600;
}

/* Enhanced table for export */
.bill-detail.export-mode .bill-detail-table {
    font-size: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.bill-detail.export-mode .bill-detail-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 16px;
    font-weight: 600;
    padding: 14px 12px;
}

.bill-detail.export-mode .bill-detail-table td {
    padding: 14px 12px;
    font-size: 15px;
    border-color: #e2e8f0;
}

.bill-detail.export-mode .bill-detail-table .font-bold {
    font-weight: 600;
    color: #1e293b;
}

/* Total rows with stronger visual hierarchy */
.bill-detail.export-mode .bill-total-row td {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    font-size: 18px;
    font-weight: 700;
    padding: 16px 12px;
    border-top: 3px solid #f59e0b;
}

.bill-detail.export-mode .bill-total-amount {
    color: #dc2626;
    font-size: 22px;
    font-weight: 700;
}

.bill-detail.export-mode .bill-paid-row td {
    background: #d4edda;
    font-size: 16px;
    font-weight: 600;
    padding: 14px 12px;
}

.bill-detail.export-mode .bill-remaining-row td {
    background: #fff3cd;
    font-size: 16px;
    font-weight: 600;
    padding: 14px 12px;
}

/* Bank info section for export */
.bill-detail.export-mode .bill-bank-info-section {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    padding: 24px;
    border-radius: 10px;
    border: 2px solid #0ea5e9;
    margin-top: 20px;
}

.bill-detail.export-mode .bank-info-title {
    color: #0c4a6e;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
}

.bill-detail.export-mode .bank-info-row {
    padding: 10px 0;
    border-bottom: 1px solid #bae6fd;
}

.bill-detail.export-mode .bank-info-label {
    font-weight: 600;
    color: #0c4a6e;
    font-size: 15px;
}

.bill-detail.export-mode .bank-info-value {
    color: #1e293b;
    font-size: 15px;
}

.bill-detail.export-mode .bank-qr-code {
    max-width: 220px;
    width: 100%;
    height: auto;
    border: 3px solid #0ea5e9;
    border-radius: 10px;
    padding: 12px;
    background: white;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.2);
}

/* Note section for export */
.bill-detail.export-mode .bill-note {
    background: #fef3c7;
    padding: 18px;
    border-left: 5px solid #f59e0b;
    border-radius: 6px;
    margin: 20px 0;
}

.bill-detail.export-mode .bill-note strong {
    color: #92400e;
    font-size: 16px;
}

/* Footer for export */
.bill-detail.export-mode .bill-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e2e8f0;
    text-align: center;
}

.bill-detail.export-mode .bill-footer-text {
    font-size: 15px;
    color: #059669;
    font-weight: 600;
    margin-bottom: 10px;
}

.bill-detail.export-mode .bill-footer-date {
    font-size: 14px;
    color: #64748b;
}

/* Hide buttons in export mode */
.bill-detail.export-mode .btn-copy-transfer,
.bill-detail.export-mode .bank-transfer-content-wrapper button {
    display: none !important;
}

/* Make transfer content input look like static text in export */
.bill-detail.export-mode .bank-transfer-content-input {
    border: none;
    background: transparent;
    padding: 0;
    font-size: 15px;
    color: #1e293b;
    font-weight: 600;
}

/* ==================== SEARCH BAR STYLES ==================== */

.search-bar-container {
    margin-bottom: 20px;
}

.search-bar {
    position: relative;
    display: flex;
    align-items: center;
    max-width: 600px;
    width: 100%;
}

.search-bar .search-icon {
    position: absolute;
    left: 12px;
    color: var(--text-secondary);
    font-size: 1rem;
    pointer-events: none;
    z-index: 2;
}

.search-bar .search-input {
    flex: 1;
    padding: 10px 40px 10px 38px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.search-bar .search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-bar .clear-search-btn {
    position: absolute;
    right: 8px;
    display: none;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--secondary-color);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 2;
}

.search-bar .clear-search-btn:hover {
    background: var(--danger-color);
    transform: scale(1.1);
}

.search-bar .clear-search-btn i {
    font-size: 12px;
}

.search-results-count {
    margin-top: 8px;
    padding: 6px 12px;
    background: #eff6ff;
    border-left: 3px solid var(--primary-color);
    color: var(--primary-color);
    font-size: 13px;
    font-weight: 500;
    border-radius: 4px;
}

/* Mobile search bar styles */
@media (max-width: 768px) {
    .search-bar {
        max-width: 100%;
    }

    .search-bar .search-input {
        padding: 12px 42px 12px 40px;
        font-size: 16px; /* Prevent zoom on iOS */
    }

    .search-bar .clear-search-btn {
        width: 32px;
        height: 32px;
    }

    .search-results-count {
        font-size: 12px;
    }
}

/* ==================== USER DROPDOWN MOBILE FIX ==================== */

/* Fix user dropdown z-index and positioning on mobile */
@media (max-width: 768px) {
    .user-dropdown {
        position: relative;
        z-index: 1200 !important; /* Higher than mobile menu */
    }

    .user-dropdown-menu {
        position: fixed !important;
        right: 10px !important;
        left: auto !important;
        top: calc(var(--header-height) + 5px) !important;
        z-index: 1200 !important;
        min-width: 200px;
        max-width: 250px;
    }

    /* Ensure dropdown is visible above overlay */
    .user-dropdown-menu.show {
        z-index: 1200 !important;
    }

    /* Adjust sidebar overlay z-index to be below dropdown */
    .sidebar-overlay {
        z-index: 998 !important;
    }

    .sidebar {
        z-index: 999 !important;
    }
}

/* ==================== BILL SHARING STYLES ==================== */

.modal-action-btn {
    background-color: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 18px;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
    margin-right: 8px;
}

.modal-action-btn:hover {
    background-color: rgba(0, 0, 0, 0.1);
    color: #667eea;
}

.share-link-input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.share-link-input-group input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    background-color: #f9f9f9;
}

.share-link-input-group input:focus {
    outline: none;
    border-color: #667eea;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.share-methods {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.share-methods h5 {
    margin: 0 0 15px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.share-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-share {
    flex: 1;
    min-width: 140px;
    background-color: #f0f3ff;
    color: #667eea;
    border: 1px solid #667eea;
    padding: 10px 16px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-share:hover {
    background-color: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.btn-zalo {
    flex: 1;
    min-width: 140px;
    background-color: #0084ff;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-zalo:hover {
    background-color: #0070d8;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 132, 255, 0.3);
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.text-muted {
    color: #999;
}

/* ==================== END BILL SHARING STYLES ==================== */

/* ==================== BULK BILL MOBILE ENHANCEMENTS ==================== */

/* Enhanced bulk bill form layout */
.bulk-bill-header .form-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.bulk-bill-header .form-group {
    flex: 1;
    min-width: 200px;
}

.bulk-bill-header .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
    color: #374151;
}

.bulk-bill-header .form-select,
.bulk-bill-header .form-control {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background-color: white;
}

.bulk-bill-header .form-select:focus,
.bulk-bill-header .form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Enhanced table actions buttons - min 44px height */
.table-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.table-actions button {
    padding: 12px 16px;
    min-height: 44px;
    font-size: 14px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Enhanced bulk bill container padding */
.bulk-bill-container {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Enhanced bulk bill table input styling */
#bulk-bill-table-container input[type="number"] {
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    width: 100%;
    font-size: 14px;
    min-height: 36px;
}

#bulk-bill-table-container input[type="checkbox"] {
    cursor: pointer;
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    margin: 0;
}

/* Enhanced form control styling */
.form-control-sm {
    padding: 8px 10px;
    font-size: 14px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    min-height: 36px;
    transition: all 0.2s ease;
}

.form-control-sm:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Enhanced bulk bill actions styling */
.bulk-bill-actions {
    position: sticky;
    bottom: 0;
    background: white;
    padding: 16px 0;
    border-top: 1px solid #e5e7eb;
    margin-top: 20px;
    z-index: 10;
}

.bulk-bill-actions .btn {
    min-height: 44px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
}

.bulk-bill-actions .btn-block {
    width: 100%;
}

/* Mobile card layout for bulk bill rooms */
.bulk-bill-mobile-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-left: 4px solid var(--primary-color);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
}

.bulk-bill-mobile-card:active {
    background-color: #f9fafb;
}

.bulk-bill-mobile-card.disabled {
    opacity: 0.6;
    background-color: #f9fafb;
}

.bulk-bill-mobile-card.occupied {
    border-left-color: var(--success-color);
}

.bulk-bill-mobile-card.vacant {
    border-left-color: var(--warning-color);
}

.bulk-bill-mobile-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.bulk-bill-mobile-card-header input[type="checkbox"] {
    width: 24px;
    height: 24px;
    cursor: pointer;
    flex-shrink: 0;
}

.bulk-bill-mobile-card-header .room-info {
    flex: 1;
}

.bulk-bill-mobile-card-header .room-name {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.bulk-bill-mobile-card-header .room-tenant {
    font-size: 13px;
    color: #6b7280;
    margin: 4px 0 0 0;
}

.bulk-bill-mobile-card-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bulk-bill-mobile-card-field {
    display: flex;
    flex-direction: column;
}

.bulk-bill-mobile-card-field label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.bulk-bill-mobile-card-field input[type="number"] {
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    min-height: 40px;
}

.bulk-bill-mobile-card-total {
    background: #f3f4f6;
    padding: 12px;
    border-radius: 6px;
    margin-top: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bulk-bill-mobile-card-total-label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
}

.bulk-bill-mobile-card-total-amount {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color);
}

/* ==================== MOBILE RESPONSIVE IMPROVEMENTS ==================== */

@media screen and (max-width: 768px) {
    /* Mobile bulk bill container */
    .bulk-bill-container {
        padding: 16px;
        border-radius: 8px;
    }

    .bulk-bill-header h3 {
        font-size: 1.125rem;
        margin-bottom: 16px;
    }

    /* Stack form fields vertically on mobile */
    .bulk-bill-header .form-row {
        flex-direction: column;
        gap: 12px;
    }

    .bulk-bill-header .form-group {
        min-width: auto;
        flex: none;
        width: 100%;
    }

    /* Full-width inputs and selects */
    .bulk-bill-header .form-select,
    .bulk-bill-header .form-control {
        width: 100%;
        padding: 12px;
        font-size: 16px; /* Prevent zoom on iOS */
    }

    /* Mobile-friendly table actions */
    .table-actions {
        flex-direction: column;
        gap: 8px;
    }

    .table-actions button {
        width: 100%;
        padding: 12px 16px;
        min-height: 44px;
        font-size: 14px;
    }

    /* Hide desktop table on mobile, show mobile cards */
    #bulk-bill-table-container .table-container {
        display: none;
    }

    #bulk-bill-table-container .table-actions {
        display: flex;
    }

    /* Mobile card list display */
    #bulk-bill-table-container {
        padding: 0;
    }

    .bulk-bill-mobile-cards-wrapper {
        display: block;
    }

    /* Enhanced touch targets in mobile cards */
    .bulk-bill-mobile-card {
        padding: 14px;
        margin-bottom: 10px;
        border-radius: 6px;
    }

    .bulk-bill-mobile-card-header {
        gap: 10px;
        margin-bottom: 10px;
    }

    .bulk-bill-mobile-card-header input[type="checkbox"] {
        width: 24px;
        height: 24px;
    }

    .bulk-bill-mobile-card-header .room-name {
        font-size: 15px;
        font-weight: 700;
    }

    .bulk-bill-mobile-card-header .room-tenant {
        font-size: 12px;
    }

    /* Single column layout for fields */
    .bulk-bill-mobile-card-fields {
        gap: 10px;
    }

    .bulk-bill-mobile-card-field input[type="number"] {
        padding: 12px;
        font-size: 16px; /* Prevent zoom on iOS */
        min-height: 44px;
    }

    .bulk-bill-mobile-card-total {
        padding: 10px;
        margin-top: 10px;
    }

    .bulk-bill-mobile-card-total-label {
        font-size: 11px;
    }

    .bulk-bill-mobile-card-total-amount {
        font-size: 15px;
    }

    /* Mobile sticky actions */
    .bulk-bill-actions {
        padding: 12px 0;
        margin: 16px -16px -16px -16px;
        border-radius: 0 0 8px 8px;
        background: white;
    }

    .bulk-bill-actions .btn {
        min-height: 44px;
        padding: 12px 16px;
        font-size: 14px;
        width: 100%;
    }

    /* Enhanced scrolling for long lists */
    .bulk-bill-table-responsive {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        max-height: calc(100vh - 400px);
    }

    /* Improved spacing for small screens */
    #bulk-bill-table-container {
        margin-top: 12px;
    }
}

@media screen and (max-width: 480px) {
    /* Extra mobile optimizations for very small screens */
    .bulk-bill-container {
        padding: 12px;
        border-radius: 6px;
    }

    .bulk-bill-header h3 {
        font-size: 1rem;
        margin-bottom: 12px;
    }

    .bulk-bill-header .form-select,
    .bulk-bill-header .form-control {
        padding: 12px;
        font-size: 16px;
    }

    .bulk-bill-mobile-card {
        padding: 12px;
        margin-bottom: 8px;
    }

    .bulk-bill-mobile-card-header .room-name {
        font-size: 14px;
    }

    .bulk-bill-mobile-card-field input[type="number"] {
        padding: 12px;
        font-size: 16px;
        min-height: 44px;
    }

    .table-actions button {
        padding: 12px 12px;
        font-size: 13px;
    }

    .bulk-bill-actions .btn {
        padding: 12px 12px;
        font-size: 13px;
    }

    .bulk-bill-table-responsive {
        max-height: calc(100vh - 350px);
    }
}

/* ==================== END BULK BILL MOBILE ENHANCEMENTS ==================== */

/* ==================== END MOBILE FIXES ==================== */
