/* Zappartments System - Modern Custom Styles */

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #06b6d4;
    --dark-color: #1e293b;
    --light-bg: #f8fafc;
    --card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --card-shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --border-radius: 0.75rem;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    transition: var(--transition);
}

body {
    background-color: var(--light-bg);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #334155;
}

/* Modern card styles */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    background: white;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-2px);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    font-size: 1.1rem;
}

.card-header.bg-primary,
.card-header.bg-success,
.card-header.bg-danger,
.card-header.bg-warning,
.card-header.bg-info {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

.card-body {
    padding: 1.5rem;
}

/* Card spacing fix for mobile - Payments & Reports Pages */
/* Apply spacing to all screen sizes for consistency */
.row.mb-4,
.row {
    margin-left: -0.5rem;
    margin-right: -0.5rem;
}

.row .col-md-4,
.row .col-md-3,
.row .col-md-6 {
    margin-bottom: 1rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.row .col-md-4:last-child,
.row .col-md-3:last-child,
.row .col-md-6:last-child {
    margin-bottom: 1rem; /* Keep margin for consistency */
}

.card {
    margin-bottom: 1rem;
    margin-left: 0;
    margin-right: 0;
}

.card:last-child {
    margin-bottom: 0;
}

/* Ensure cards don't overlap */
.page-header + .row .card,
.row.mb-4 .card {
    width: 100%;
    max-width: 100%;
}

@media (max-width: 767.98px) {
    /* Fix card spacing in rows for mobile */
    .row.mb-4,
    .row {
        margin-left: 0;
        margin-right: 0;
    }
    
    .row .col-md-4,
    .row .col-md-3,
    .row .col-md-6 {
        margin-bottom: 1rem;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    .row .col-md-4:last-child,
    .row .col-md-3:last-child,
    .row .col-md-6:last-child {
        margin-bottom: 1rem; /* Keep spacing */
    }
    
    .card {
        margin-bottom: 1rem;
        margin-left: 0;
        margin-right: 0;
    }
    
    .card:last-child {
        margin-bottom: 0;
    }
    
    /* Ensure cards don't overlap */
    .page-header + .row .card,
    .row.mb-4 .card {
        width: 100%;
        max-width: 100%;
    }
}

/* Modern status badges */
.badge {
    font-weight: 600;
    padding: 0.5em 0.75em;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

.badge.bg-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%) !important;
}

.badge.bg-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%) !important;
}

.badge.bg-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #d97706 100%) !important;
    color: #1f2937 !important;
}

.badge.bg-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%) !important;
}

.badge.bg-secondary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #475569 100%) !important;
}

/* Modern table styles */
.table {
    font-size: 0.95rem;
    border-radius: var(--border-radius);
    overflow: hidden;
    width: 100%;
    table-layout: auto;
}

/* Table responsive is now handled in the responsive section below */

.table thead {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}

.table thead th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 1rem;
    border: none;
    white-space: nowrap;
    min-width: 100px;
    display: table-cell; /* Ensure header cells are visible */
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-color: #e2e8f0;
    white-space: nowrap;
    max-width: 200px;
    min-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: table-cell; /* Ensure body cells are visible */
}

.table tbody tr {
    transition: var(--transition);
}

.table-hover tbody tr:hover {
    background-color: #f1f5f9;
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Modern button styles */
.btn {
    font-weight: 600;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    transition: var(--transition);
    border: none;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.025em;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #4338ca 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(239, 68, 68, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #475569 100%);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(100, 116, 139, 0.4);
}

/* Modern form styles */
.form-control,
.form-select {
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.875rem 1rem;
    transition: var(--transition);
    font-size: 0.95rem;
    background: white;
    color: #111827; /* Ensure text is always visible, including on Android */
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    outline: none;
}

.form-label {
    font-weight: 600;
    margin-bottom: 0.625rem;
    color: #1e293b;
    font-size: 0.9rem;
    display: block;
}

.form-control.is-invalid {
    border-color: var(--danger-color);
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-control.is-valid {
    border-color: var(--success-color);
}

/* Form Group with Icon (for admin forms) */
.form-group-with-icon {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    z-index: 10;
    pointer-events: none;
    margin-top: 0.75rem; /* Account for label */
}

.form-icon i {
    font-size: 1.125rem;
}

.form-group-with-icon .form-label {
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.form-group-with-icon .form-control,
.form-group-with-icon .form-select {
    padding-left: 3rem;
}

.form-group-with-icon .form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    padding-right: 2.5rem;
    appearance: none;
}

.form-group-with-icon textarea.form-control {
    padding-top: 0.875rem;
    padding-bottom: 0.875rem;
    line-height: 1.5;
    min-height: 100px;
}

.form-group-with-icon .textarea-icon {
    top: 2.25rem;
    transform: translateY(0);
}

.invalid-feedback {
    display: block;
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    font-weight: 500;
}

.valid-feedback {
    display: block;
    color: var(--success-color);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* Enhanced form styling */
.form-control::placeholder {
    color: #94a3b8;
    opacity: 1;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    appearance: none;
    padding-right: 2.5rem;
}

/* Ensure dropdown options are readable on Android/WebView */
.form-select option {
    color: #111827;
    background-color: #ffffff;
}

.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    outline: none;
}

/* Modern alert styles */
.alert {
    border: none;
    border-left: 4px solid;
    border-radius: var(--border-radius);
    padding: 1rem 1.25rem;
    box-shadow: var(--card-shadow);
    margin-bottom: 1.5rem;
}

.alert-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
    border-left-color: var(--success-color);
    color: #065f46;
}

.alert-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.05) 100%);
    border-left-color: var(--danger-color);
    color: #991b1b;
}

.alert-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(245, 158, 11, 0.05) 100%);
    border-left-color: var(--warning-color);
    color: #92400e;
}

.alert-info {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.1) 0%, rgba(6, 182, 212, 0.05) 100%);
    border-left-color: var(--info-color);
    color: #155e75;
}

/* Modern dashboard cards */
.card.bg-primary,
.card.bg-success,
.card.bg-danger,
.card.bg-warning,
.card.bg-info,
.card.bg-secondary,
.card.bg-dark {
    border: none;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.card.bg-primary::before,
.card.bg-success::before,
.card.bg-danger::before,
.card.bg-warning::before,
.card.bg-info::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-10%, -10%) rotate(180deg); }
}

.card.bg-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
}

.card.bg-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
}

.card.bg-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #d97706 100%);
}

.card.bg-info {
    background: linear-gradient(135deg, var(--info-color) 0%, #0891b2 100%);
}

.card.bg-secondary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #475569 100%);
}

.card.bg-dark {
    background: linear-gradient(135deg, var(--dark-color) 0%, #0f172a 100%);
}

.card.bg-primary .card-body,
.card.bg-success .card-body,
.card.bg-danger .card-body,
.card.bg-warning .card-body,
.card.bg-info .card-body,
.card.bg-secondary .card-body,
.card.bg-dark .card-body {
    color: white;
    position: relative;
    z-index: 1;
}

.card.bg-primary .card-title,
.card.bg-success .card-title,
.card.bg-danger .card-title,
.card.bg-warning .card-title,
.card.bg-info .card-title,
.card.bg-secondary .card-title,
.card.bg-dark .card-title {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.card.bg-primary h3,
.card.bg-success h3,
.card.bg-danger h3,
.card.bg-warning h3,
.card.bg-info h3,
.card.bg-secondary h3,
.card.bg-dark h3 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

.card.bg-primary .card-body a,
.card.bg-success .card-body a,
.card.bg-danger .card-body a,
.card.bg-warning .card-body a,
.card.bg-info .card-body a,
.card.bg-secondary .card-body a,
.card.bg-dark .card-body a {
    color: white;
    text-decoration: underline;
    font-weight: 600;
}

/* Modern Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 260px;
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: var(--transition);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: white;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.25rem;
    transition: var(--transition);
}

.sidebar-brand:hover {
    color: white;
    transform: translateX(3px);
}

.sidebar-brand i {
    font-size: 1.5rem;
}

.sidebar-logo {
    height: 40px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
    transition: var(--transition);
}

.sidebar-brand:hover .sidebar-logo {
    transform: scale(1.05);
    opacity: 0.9;
}

/* Responsive logo sizing */
@media (max-width: 991.98px) {
    .sidebar-logo {
        height: 35px;
        max-width: 150px;
    }
}

.sidebar-toggle {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
}

.sidebar-user {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-user-info i {
    font-size: 2rem;
    opacity: 0.9;
}

.sidebar-user-info div {
    flex: 1;
}

.sidebar-user-info strong {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.sidebar-user-info small {
    display: block;
    font-size: 0.75rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.sidebar-divider {
    margin: 0.75rem 1.5rem;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
    font-weight: 500;
}

.sidebar-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border-left-color: rgba(255, 255, 255, 0.5);
    padding-left: 1.75rem;
}

.sidebar-link.active {
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
    border-left-color: white;
    font-weight: 600;
}

.sidebar-link i {
    font-size: 1.125rem;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logout {
    width: 100%;
    border: none;
    background: transparent;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.85);
}

.sidebar-logout:hover {
    background-color: rgba(239, 68, 68, 0.2);
    border-left-color: #ef4444;
    color: white;
}

/* Main Content Area */
.main-content {
    margin-left: 260px;
    min-height: 100vh;
    background-color: var(--light-bg);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.topbar {
    background: white;
    padding: 1rem 1.5rem;
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.sidebar-toggle-mobile {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 1.25rem;
    cursor: pointer;
    transition: var(--transition);
}

.sidebar-toggle-mobile:hover {
    background: var(--primary-color);
    color: white;
}

.topbar-title h4 {
    margin: 0;
    font-weight: 600;
    color: var(--dark-color);
    font-size: 1.25rem;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--secondary-color);
    font-weight: 500;
}

.topbar-user i {
    font-size: 1.5rem;
}

.content-wrapper {
    padding: 1.5rem;
}

/* Responsive Sidebar */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .topbar-title {
        flex: 1;
        margin-left: 1rem;
    }
}

/* Sidebar Overlay for Mobile */
@media (max-width: 991.98px) {
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        display: none;
    }

    .sidebar-overlay.show {
        display: block;
    }
}

/* Scrollbar for Sidebar */
.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Modern modal styles */
.modal {
    overflow-y: auto;
}

.modal.show {
    display: block !important;
}

.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.5);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    width: 100vw;
    height: 100vh;
}

.modal-dialog {
    position: relative;
    width: auto;
    margin: 1.75rem auto;
    max-width: 500px;
}

.modal-dialog-centered {
    display: flex;
    align-items: center;
    min-height: calc(100% - 3.5rem);
}

.modal-content {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    background-color: #fff;
    background-clip: padding-box;
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    padding: 1.5rem;
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: space-between;
}

.modal-header .btn-close {
    filter: invert(1);
    opacity: 1;
}

.modal-body {
    padding: 1.5rem;
    position: relative;
    flex: 1 1 auto;
}

.modal-footer {
    border-top: 1px solid #e2e8f0;
    padding: 1.5rem;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    display: flex;
    flex-wrap: wrap;
    flex-shrink: 0;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* Loading spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* Print styles */
@media print {
    .navbar,
    .btn,
    .no-print {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000;
        page-break-inside: avoid;
    }
}

/* Responsive improvements - Scrollable Tables */
/* Ensure tables are always visible as tables, not stacked */
.table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
}

.table-responsive::-webkit-scrollbar {
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.table-responsive table {
    width: 100%;
    min-width: 600px; /* Minimum width for horizontal scroll */
    border-collapse: collapse;
    table-layout: auto;
    display: table; /* Force table display */
}

.table-responsive thead {
    display: table-header-group; /* Ensure header is visible */
}

.table-responsive tbody {
    display: table-row-group; /* Ensure body is visible */
}

.table-responsive th,
.table-responsive td {
    display: table-cell; /* Force table cell display */
    white-space: nowrap;
    min-width: 100px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0.75rem;
}

.table-responsive th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.85rem;
    }
    
    .table-responsive table {
        min-width: 800px; /* Larger min-width for mobile to ensure scrolling */
    }
    
    .table-responsive th,
    .table-responsive td {
        min-width: 120px;
        max-width: 200px;
        padding: 0.5rem;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        margin-bottom: 0.25rem;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Modern animations */
@keyframes slideIn {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert {
    animation: slideIn 0.3s ease-out;
}

.card {
    animation: fadeIn 0.5s ease-out;
}

.table tbody tr {
    animation: fadeIn 0.3s ease-out;
}

/* Badge pulse animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.badge.bg-warning {
    animation: pulse 2s infinite;
}

/* Focus improvements for accessibility */
*:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Modern utility classes */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.shadow-sm-hover:hover {
    box-shadow: var(--card-shadow-hover) !important;
}

/* Page header styles */
.page-header {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    margin-bottom: 2rem;
}

.page-header h2 {
    font-weight: 700;
    font-size: 1.875rem;
    color: var(--dark-color);
    margin: 0;
}

.page-header p {
    color: var(--secondary-color);
    margin: 0.5rem 0 0 0;
}

/* Action buttons group */
.action-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Stats cards enhancement */
.stats-card {
    position: relative;
    overflow: hidden;
}

.stats-card .icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
    opacity: 0.2;
}

/* Loading states */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary-color);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--secondary-color);
}

.empty-state i {
    font-size: 4rem;
    opacity: 0.3;
    margin-bottom: 1rem;
}

/* Search and filter bar */
.filter-bar {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    margin-bottom: 1.5rem;
}

/* Login Page Styles */
.login-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.login-wrapper {
    width: 100%;
    max-width: 420px;
}

/* Wider wrapper for register page */
.register-wrapper {
    max-width: 480px;
}

.login-logo-container {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-logo {
    height: 50px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
}

.login-card {
    background: white;
    border-radius: 1rem;
    padding: 2.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    max-height: 90vh;
    overflow-y: auto;
}

/* Custom scrollbar for login card */
.login-card::-webkit-scrollbar {
    width: 6px;
}

.login-card::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.login-card::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.login-card::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    font-size: 0.95rem;
    color: #64748b;
    margin: 0;
}

.login-form {
    margin-bottom: 1.5rem;
}

.form-group-icon {
    position: relative;
    margin-bottom: 1.25rem;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    z-index: 10;
    pointer-events: none;
}

.input-icon i {
    font-size: 1.125rem;
}

.form-control-icon {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    transition: var(--transition);
    background: white;
}

.form-control-icon:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-control-icon::placeholder {
    color: #94a3b8;
}

.form-check-remember {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.form-check-input {
    margin-right: 0.5rem;
    margin-top: 0;
    cursor: pointer;
}

.form-check-label {
    color: #475569;
    cursor: pointer;
    user-select: none;
}

.btn-signin {
    width: 100%;
    padding: 0.875rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.3);
}

.btn-signin:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.4);
}

.btn-signin:active {
    transform: translateY(0);
}

.login-footer {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
    margin-bottom: 1.5rem;
}

.forgot-text {
    color: #64748b;
    font-size: 0.9rem;
    margin-right: 0.5rem;
}

.reset-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
}

.reset-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.register-link-container {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

.register-text {
    color: #64748b;
    font-size: 0.9rem;
    margin: 0;
}

.register-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.register-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.invalid-feedback {
    display: block;
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.form-control-icon.is-invalid {
    border-color: var(--danger-color);
}

.form-control-icon.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Textarea styling for register form */
textarea.form-control-icon,
textarea.textarea-field {
    resize: vertical;
    min-height: 80px;
    padding-top: 0.875rem;
    padding-bottom: 0.875rem;
    line-height: 1.5;
}

.textarea-icon {
    top: 1rem;
    transform: translateY(0);
}

.textarea-field {
    padding-left: 3rem;
}

/* Alert info for register page */
.alert-info-register {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.1) 0%, rgba(6, 182, 212, 0.05) 100%);
    border-left: 4px solid var(--info-color);
    color: #155e75;
    padding: 0.875rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.alert-info-register i {
    margin-right: 0.5rem;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .card-body {
        padding: 1rem;
    }
    
    .page-header {
        padding: 1.5rem;
    }
    
    .page-header h2 {
        font-size: 1.5rem;
    }

    .login-card {
        padding: 2rem 1.5rem;
    }

    .login-title {
        font-size: 1.5rem;
    }

    .login-logo {
        height: 50px;
    }

    .form-group-with-icon {
        margin-bottom: 1.25rem;
    }

    .form-icon {
        margin-top: 0.5rem;
    }

    .content-wrapper {
        padding: 1rem;
    }

    .topbar {
        padding: 0.75rem 1rem;
    }

    .topbar-title h4 {
        font-size: 1.125rem;
    }

    .topbar-user span {
        display: none;
    }

    .stats-card h3 {
        font-size: 1.5rem;
    }

    .stats-card .icon {
        font-size: 2rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }

    .page-header .btn {
        width: 100%;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons .btn {
        width: 100%;
    }

    /* Tables remain scrollable, not stacked */
    .table-responsive {
        overflow-x: auto;
        overflow-y: hidden;
        display: block;
    }
    
    .table-responsive table {
        display: table; /* Force table display */
        min-width: 800px;
    }
    
    .table-responsive thead {
        display: table-header-group; /* Ensure header is visible */
    }
    
    .table-responsive tbody {
        display: table-row-group; /* Ensure body is visible */
    }
    
    .table-responsive th,
    .table-responsive td {
        display: table-cell; /* Force table cell display */
    }
}

/* Tablet responsiveness */
@media (max-width: 991.98px) and (min-width: 769px) {
    .content-wrapper {
        padding: 1.25rem;
    }

    .page-header {
        padding: 1.5rem;
    }
}

/* Extra small devices */
@media (max-width: 576px) {
    .login-card {
        padding: 1.5rem 1rem;
    }

    .login-title {
        font-size: 1.25rem;
    }

    .login-subtitle {
        font-size: 0.875rem;
    }

    .form-control-icon {
        font-size: 0.9rem;
    }

    .btn-signin {
        font-size: 0.95rem;
        padding: 0.75rem;
    }

    .card-header {
        padding: 1rem;
        font-size: 1rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .modal-header {
        padding: 1rem;
    }
}

/* Footer Styles */
.app-footer {
    background: white;
    border-top: 1px solid #e2e8f0;
    padding: 1.5rem 2rem;
    margin-top: auto;
    color: #64748b;
    font-size: 0.875rem;
}

.app-footer p {
    margin: 0;
}

.app-footer strong {
    color: var(--primary-color);
    font-weight: 600;
}

@media (max-width: 768px) {
    .app-footer {
        padding: 1rem;
        text-align: center;
    }
    
    .app-footer .row {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .app-footer .text-md-end {
        text-align: center !important;
    }
}


/* Fix kwa Android APK - Record Payment -> Select Lease */
select[name="lease_id"],
select[name="lease_id"] option {
    background-color: #ffffff !important;   /* background nyeupe */
    color: #000000 !important;              /* maandishi meusi yaonekane */
    -webkit-text-fill-color: #000000 !important; /* kwa Android/WebView */
}

