/* Modern Management Portal CSS - Mobile First Design */

:root {
    --primary-color: #f97316;
    --primary-dark: #ea580c;
    --secondary-color: #6b7280;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
    --light-color: #fef7ed;
    --dark-color: #1f2937;
    --border-color: #fed7aa;
    --text-color: #374151;
    --text-muted: #6b7280;
    --sidebar-width: 280px;
    --header-height: 70px;
    
    /* Modern Color Palette */
    --blue-500: #3b82f6;
    --blue-600: #2563eb;
    --purple-500: #8b5cf6;
    --purple-600: #7c3aed;
    --green-500: #10b981;
    --green-600: #059669;
    --orange-500: #f97316;
    --orange-600: #ea580c;
    --red-500: #ef4444;
    --red-600: #dc2626;
    --pink-500: #ec4899;
    --pink-600: #db2777;
    --indigo-500: #6366f1;
    --indigo-600: #4f46e5;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    --gradient-secondary: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
    --gradient-green: linear-gradient(135deg, #10b981 0%, #047857 100%);
    --gradient-orange: linear-gradient(135deg, #f97316 0%, #c2410c 100%);
    --gradient-red: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    --gradient-warm: linear-gradient(135deg, #fed7aa 0%, #fb923c 100%);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #fef7ed 0%, #fed7aa 100%);
    color: var(--text-color);
    line-height: 1.6;
    font-size: 14px;
}

/* Layout */
.wrapper {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Mobile-First Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: white;
    color: #374151;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
    transform: translateX(-100%);
    box-shadow: var(--shadow-xl);
    border-right: 1px solid #fed7aa;
}

.sidebar.active {
    transform: translateX(0);
}

/* Mobile overlay */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #fed7aa;
    background: white;
    text-align: left;
}

.sidebar-logo {
    margin-bottom: 0.5rem;
}

.sidebar-logo img {
    max-height: 40px;
    max-width: 200px;
    height: auto;
    width: auto;
}

.sidebar-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #1f2937;
}

.sidebar-header p {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 400;
    margin: 0;
}

.sidebar-nav {
    list-style: none;
    padding: 1rem 0;
}

.nav-item {
    margin: 0.25rem 0;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: #6b7280;
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 0 24px 24px 0;
    position: relative;
    font-weight: 500;
    margin-right: 1rem;
    font-size: 0.875rem;
}

.nav-link:hover {
    background: #fef7ed;
    color: #f97316;
}

.nav-link.active {
    background: #f97316;
    color: white;
}

.nav-link i {
    width: 20px;
    margin-right: 0.75rem;
    font-size: 1rem;
    text-align: center;
}

.nav-header {
    margin: 1rem 0 0.5rem 0;
    padding: 0.5rem 1.5rem;
}

.nav-header .nav-text {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
}

/* Unified Spacing System for All Pages */
/* Card and Container Spacing */
.card {
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #dee2e6;
}

.card-body {
    padding: 1.25rem;
}

.card-title {
    margin-bottom: 0;
    font-weight: 600;
    color: #495057;
}

/* Button Spacing and Layout */
.btn-group-spacing {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.btn-group-spacing .btn {
    margin-bottom: 0;
    flex-shrink: 0;
}

/* Quick Actions Spacing */
.quick-actions-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.quick-actions-grid .btn {
    width: 100%;
    padding: 0.75rem 1rem;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

/* Service Management Spacing */
.service-management-container {
    padding: 1.5rem;
}

.service-management-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.service-management-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.service-management-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

/* Button Sizing and Spacing */
.btn {
    padding: 0.5rem 1rem;
    font-weight: 500;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.125rem;
}

/* Filter Tabs Spacing */
.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.filter-tabs .btn {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.filter-tabs .btn.active {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
}

/* Add Buttons Spacing */
.add-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.add-buttons .btn {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

/* Page Header Spacing */
.page-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.page-title {
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #495057;
}

.page-subtitle {
    color: #6c757d;
    font-size: 0.95rem;
}

/* Action Bar Spacing */
.action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    border: 1px solid #e9ecef;
}

.action-bar .btn {
    margin-bottom: 0;
}

/* Table Container Spacing */
.table-container {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.table-container .table {
    margin-bottom: 0;
}

.table-container .table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #495057;
    padding: 1rem 0.75rem;
}

.table-container .table tbody td {
    padding: 0.75rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f3f4;
}

/* Form Spacing */
.form-container {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

/* Alert Spacing */
.alert {
    border-radius: 0.5rem;
    border: none;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

/* Sticky Sidebar Styles */
.sticky-sidebar {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 2rem !important;
    max-height: calc(100vh - 4rem) !important;
    overflow-y: auto !important;
    z-index: 100 !important;
    align-self: flex-start !important;
}

.sticky-sidebar .card {
    margin-bottom: 1.5rem;
}

.sticky-sidebar .card:last-child {
    margin-bottom: 0;
}

/* Ensure parent containers support sticky positioning */
.row {
    display: flex;
    flex-wrap: wrap;
}

.col-md-4.sticky-sidebar {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 2rem !important;
    align-self: flex-start !important;
    height: fit-content !important;
}

/* Fallback for browsers that don't support sticky */
@supports not (position: sticky) {
    .sticky-sidebar {
        position: relative !important;
        top: auto !important;
    }
}

/* Ensure proper flex behavior for sticky elements */
.row .col-md-4.sticky-sidebar {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
}


/* Button Color Fixes */
.btn-white-fix {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: #ffffff !important;
}

.btn-white-fix:hover {
    background-color: #545b62 !important;
    border-color: #545b62 !important;
    color: #ffffff !important;
}

.btn-outline-white-fix {
    background-color: transparent !important;
    border-color: #6c757d !important;
    color: #6c757d !important;
}

.btn-outline-white-fix:hover {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: #ffffff !important;
}

/* Dashboard Statistics Cards */
.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.stat-card.stat-card-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
}

.stat-card.stat-card-success {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
}

.stat-card.stat-card-warning {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    color: #212529;
}

.stat-card.stat-card-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
}

.stat-card.stat-card-purple {
    background: linear-gradient(135deg, #6f42c1 0%, #5a32a3 100%);
}

.stat-card .stat-icon {
    font-size: 2rem;
    opacity: 0.8;
}

.stat-card .stat-number {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

.stat-card .stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Simple Button Spacing for Mobile */
/* Custom Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    max-width: 90%;
    max-height: 90%;
    overflow-y: auto;
    position: relative;
}

.modal.modal-lg {
    width: 800px;
    max-width: 90%;
}

.modal-content {
    border-radius: 0.5rem;
    border: none;
}

.modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #495057;
}

.modal-body {
    padding: 1.5rem;
    color: #495057;
}

.modal-body .form-label {
    color: #495057 !important;
    font-weight: 500;
}

.modal-body .form-control,
.modal-body .form-select {
    color: #495057 !important;
    border-color: #ced4da;
}

.modal-body .form-control:focus,
.modal-body .form-select:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #dee2e6;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    font-weight: bold;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.btn-close:hover {
    background-color: #f8f9fa;
    color: #495057;
}

/* Modal Button Styling */
.modal .btn-primary {
    background-color: #007bff !important;
    border-color: #007bff !important;
    color: #ffffff !important;
}

.modal .btn-primary:hover {
    background-color: #0056b3 !important;
    border-color: #0056b3 !important;
    color: #ffffff !important;
}

.modal .btn-secondary {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: #ffffff !important;
}

.modal .btn-secondary:hover {
    background-color: #545b62 !important;
    border-color: #545b62 !important;
    color: #ffffff !important;
}

/* Modal Icon Styling */
.modal .btn-primary i,
.modal .btn-secondary i {
    color: inherit !important;
}

.modal .modal-title i {
    color: #007bff !important;
    margin-right: 0.5rem;
}

@media (max-width: 768px) {
    /* Unified Mobile Spacing */
    .d-flex.flex-wrap.gap-2,
    .d-flex.flex-wrap.gap-3,
    .d-flex.flex-wrap.gap-4,
    .d-flex.flex-wrap.gap-5 {
        gap: 0.5rem !important;
    }
    
    .btn-group-spacing {
        gap: 0.5rem !important;
    }
    
    .quick-actions-grid {
        gap: 0.5rem;
        padding: 0.25rem 0;
    }
    
    .service-management-actions,
    .service-management-filters,
    .add-buttons,
    .filter-tabs {
        gap: 0.5rem !important;
        margin-bottom: 1rem !important;
    }
    
    .service-management-container {
        padding: 1rem;
    }
    
    .service-management-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .btn-sm {
        font-size: 0.8rem;
        padding: 0.375rem 0.75rem;
    }
    
    .btn-sm.me-2,
    .btn-sm.me-3 {
        margin-right: 0.5rem !important;
    }
    
    .modal {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .modal.modal-lg {
        width: calc(100% - 1rem);
        max-width: calc(100% - 1rem);
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 0;
    transition: margin-left 0.3s ease;
    min-height: 100vh;
    background: linear-gradient(135deg, #fef7ed 0%, #fed7aa 100%);
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: 0 1rem;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 9999;
    box-shadow: var(--shadow-sm);
}

@media (min-width: 768px) {
    .header {
        padding: 0 1.5rem;
    }
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Mobile Logo Styling */
.mobile-logo {
    display: flex;
    align-items: center;
    margin-right: 0.5rem;
}

.mobile-logo img {
    max-height: 32px;
    max-width: 120px;
    height: auto;
    width: auto;
    object-fit: contain;
}

.mobile-logo span {
    font-weight: 700;
    color: var(--text-color);
    font-size: 1.1rem;
}

.mobile-menu-btn {
    display: block;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-color);
    cursor: pointer;
    padding: 0.75rem;
    border-radius: var(--radius);
    transition: all 0.3s ease;
    min-height: 44px; /* Touch-friendly */
    min-width: 44px;
}

.mobile-menu-btn:hover {
    background: var(--light-color);
}

.header-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-menu {
    position: relative;
    z-index: 10000;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    display: flex !important;
    align-items: center;
    justify-content: center;
    color: white !important;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    position: relative;
    z-index: 10001;
    visibility: visible !important;
    opacity: 1 !important;
    border: 2px solid white;
}

.user-avatar:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    padding: 0.5rem;
    min-width: 200px;
    z-index: 10002;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown a {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    color: var(--text-color);
    text-decoration: none;
    border-radius: var(--radius);
    transition: all 0.3s ease;
    gap: 0.75rem;
}

.user-dropdown a:hover {
    background: var(--light-color);
}

/* Ensure user avatar is always visible */
.header-right {
    position: relative;
    z-index: 10003;
    display: flex !important;
    align-items: center !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Force visibility of user menu elements */
.user-menu {
    display: flex !important;
    align-items: center !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 10004 !important;
}

/* Additional visibility fixes */
.user-avatar {
    position: relative !important;
    z-index: 10001 !important;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Content Area */
.content {
    padding: 1rem;
    max-width: 100%;
    overflow-x: hidden;
    background: var(--light-color);
    min-height: calc(100vh - var(--header-height));
}

@media (min-width: 768px) {
    .content {
        padding: 1.5rem;
    }
}

/* Modern Cards */
.card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    border: 1px solid #fed7aa;
    overflow: hidden;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: #f8fafc;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card-body {
    padding: 1.5rem;
}

/* Modern Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 480px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
        margin-bottom: 2rem;
    }
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    border: 1px solid #fed7aa;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-blue);
}

.stat-card.success::before {
    background: var(--gradient-green);
}

.stat-card.warning::before {
    background: var(--gradient-orange);
}

.stat-card.danger::before {
    background: var(--gradient-red);
}

.stat-card.info::before {
    background: var(--gradient-purple);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: #1f2937;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Modern Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-transform: none;
    letter-spacing: 0.025em;
    min-height: 44px; /* Touch-friendly minimum size */
    color: white;
    background: var(--primary-color);
}

@media (min-width: 768px) {
    .btn {
        padding: 0.75rem 1.5rem;
    }
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--gradient-primary) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3) !important;
    border: none !important;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(249, 115, 22, 0.4) !important;
}

.btn-success {
    background: var(--gradient-green) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important;
    border: none !important;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

.btn-warning {
    background: var(--gradient-orange) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3) !important;
    border: none !important;
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(249, 115, 22, 0.4);
}

.btn-danger {
    background: var(--gradient-red) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3) !important;
    border: none !important;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
}

.btn-secondary {
    background: white;
    color: var(--text-color);
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: var(--light-color);
    border-color: var(--text-muted);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline, .btn-outline-secondary {
    background: transparent !important;
    color: var(--primary-color) !important;
    border: 2px solid var(--primary-color) !important;
}

.btn-outline:hover, .btn-outline-secondary:hover {
    background: var(--primary-color) !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(249, 115, 22, 0.3) !important;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

/* Modern Forms */
.form-group {
    margin-bottom: 1.5rem;
}

/* Mobile form improvements */
@media (max-width: 767px) {
    .form-group {
        margin-bottom: 1rem;
    }
    
    .row {
        margin: -0.5rem;
    }
    
    .row > * {
        padding: 0.5rem;
    }
    
    .col-md-3, .col-md-4, .col-md-6, .col-md-8, .col-md-9 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

.form-label {
    display: block;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.form-control, .form-select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    background: white;
    color: var(--text-color);
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    transform: translateY(-1px);
}

.form-control::placeholder {
    color: var(--text-muted);
}

/* Modern Tables */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin: 0 -1rem;
    padding: 0 1rem;
}

@media (min-width: 768px) {
    .table-responsive {
        margin: 0;
        padding: 0;
    }
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.table th {
    background: #f1f5f9;
    padding: 1rem;
    text-align: left;
    font-weight: 700;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
    font-size: 0.875rem;
}

.table tbody tr {
    transition: all 0.3s ease;
}

.table tbody tr:hover {
    background: rgba(79, 70, 229, 0.02);
    transform: scale(1.01);
}

/* Modern Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.bg-success {
    background: var(--gradient-green);
    color: white;
}

.bg-warning {
    background: var(--gradient-orange);
    color: white;
}

.bg-danger {
    background: var(--gradient-red);
    color: white;
}

.bg-info {
    background: var(--gradient-purple);
    color: white;
}

.bg-secondary {
    background: var(--secondary-color);
    color: white;
}

.bg-primary {
    background: var(--gradient-blue);
    color: white;
}

/* Modern Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
    color: var(--green-600);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: var(--red-600);
}

.alert-warning {
    background: rgba(249, 115, 22, 0.1);
    border-color: rgba(249, 115, 22, 0.2);
    color: var(--orange-600);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
    color: var(--blue-600);
}

/* Utility Classes */
.d-flex {
    display: flex;
}

.justify-content-between {
    justify-content: space-between;
}

.align-items-center {
    align-items: center;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

.text-success {
    color: var(--success-color);
}

.text-warning {
    color: var(--warning-color);
}

.text-danger {
    color: var(--danger-color);
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

.p-0 { padding: 0; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.p-5 { padding: 3rem; }

/* Responsive Grid */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: -0.75rem;
}

.col, .col-md-3, .col-md-4, .col-md-6, .col-md-8, .col-md-9, .col-md-12 {
    padding: 0.75rem;
}

.col {
    flex: 1;
}

.col-md-3 {
    flex: 0 0 100%;
    max-width: 100%;
}

.col-md-4 {
    flex: 0 0 100%;
    max-width: 100%;
}

.col-md-6 {
    flex: 0 0 100%;
    max-width: 100%;
}

.col-md-8 {
    flex: 0 0 100%;
    max-width: 100%;
}

.col-md-9 {
    flex: 0 0 100%;
    max-width: 100%;
}

.col-md-12 {
    flex: 0 0 100%;
    max-width: 100%;
}

/* Mobile Overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.active {
    display: block;
    opacity: 1;
}

/* Responsive Design */
/* Tablet and Desktop Styles */
@media (min-width: 768px) {
    .mobile-menu-btn {
        display: none;
    }
    
    .mobile-logo {
        display: none !important;
    }
    
    .sidebar {
        transform: translateX(0);
        position: fixed;
    }

    .main-content {
        margin-left: var(--sidebar-width);
    }
    
    .col-md-3 {
        flex: 0 0 25%;
        max-width: 25%;
    }
    
    .col-md-4 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
    
    .col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    .col-md-8 {
        flex: 0 0 66.666667%;
        max-width: 66.666667%;
    }
    
    .col-md-9 {
        flex: 0 0 75%;
        max-width: 75%;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    
    /* Better table display on tablets */
    .table-responsive {
        overflow-x: visible;
    }
    
    /* Improved button groups */
    .btn-group {
        display: flex;
        gap: 0.25rem;
    }
}

@media (min-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .content {
        padding: 2rem;
    }
}

@media (min-width: 1200px) {
    .content {
        padding: 2.5rem;
    }
}

/* Warm theme enforced */
body {
    background: linear-gradient(135deg, #fef7ed 0%, #fed7aa 100%) !important;
    color: #374151 !important;
}

.card {
    background: white !important;
    border-color: var(--border-color) !important;
    color: #374151 !important;
}

.card-header {
    background: #fef7ed !important;
    border-color: var(--border-color) !important;
    color: #374151 !important;
}

.header {
    background: white !important;
    border-color: var(--border-color) !important;
    color: #374151 !important;
}

.form-control, .form-select {
    background: white !important;
    border-color: var(--border-color) !important;
    color: #374151 !important;
}

.table {
    background: white !important;
    color: #374151 !important;
}

.table th {
    background: #fef7ed !important;
    border-color: var(--border-color) !important;
    color: #374151 !important;
}

.table td {
    border-color: var(--border-color) !important;
    color: #374151 !important;
}

/* Action Icons and Button Groups */
.btn-group {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.btn-group .btn {
    margin: 0;
}

.btn i {
    font-size: 0.875rem;
    color: inherit;
}

.btn-sm i {
    font-size: 0.75rem;
}

.btn-lg i {
    font-size: 1rem;
}

/* Ensure icons are visible */
.fas, .far, .fab {
    display: inline-block !important;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    line-height: 1;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Force button styles across all pages */
button, .btn, input[type="submit"], input[type="button"] {
    font-family: inherit !important;
}

.btn:not(.btn-outline):not(.btn-outline-secondary) {
    color: white !important;
}

/* Ensure all action buttons are visible */
.btn .fas, .btn .far, .btn .fab,
button .fas, button .far, button .fab {
    color: inherit !important;
    display: inline-block !important;
}

/* Enhanced Button Visibility Fixes */
.btn, button, input[type="button"], input[type="submit"] {
    opacity: 1 !important;
    visibility: visible !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    min-height: 44px !important;
    min-width: 44px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    border: none !important;
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    position: relative !important;
    overflow: hidden !important;
}

/* Ensure button text and icons are visible */
.btn *, button * {
    opacity: 1 !important;
    visibility: visible !important;
    color: inherit !important;
}

/* Button group improvements */
.btn-group {
    display: flex !important;
    gap: 0.25rem !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
}

.btn-group .btn {
    margin: 0 !important;
    flex-shrink: 0 !important;
    border-radius: 6px !important;
}

/* Ensure button groups are visible in tables */
.table .btn-group {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.table .btn-group .btn {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Mobile button group improvements */
@media (max-width: 768px) {
    .btn-group {
        flex-direction: column !important;
        gap: 0.5rem !important;
        width: 100% !important;
    }
    
    .btn-group .btn {
        width: 100% !important;
        justify-content: center !important;
    }
}

/* Specific button type visibility */
.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3) !important;
}

.btn-danger:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4) !important;
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3) !important;
}

.btn-warning:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.4) !important;
}

.btn-info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3) !important;
}

.btn-info:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4) !important;
}

/* Small button improvements */
.btn-sm {
    padding: 0.5rem 1rem !important;
    font-size: 0.8125rem !important;
    min-height: 36px !important;
    min-width: 36px !important;
}

/* Large button improvements */
.btn-lg {
    padding: 1rem 2rem !important;
    font-size: 1rem !important;
    min-height: 52px !important;
}

/* Ensure button icons are properly sized */
.btn i {
    font-size: 0.875rem !important;
    line-height: 1 !important;
    display: inline-block !important;
}

.btn-sm i {
    font-size: 0.75rem !important;
}

.btn-lg i {
    font-size: 1rem !important;
}

/* Ensure delete buttons are visible */
.btn-outline-danger {
    color: #dc3545 !important;
    border-color: #dc3545 !important;
    background-color: transparent !important;
}

.btn-outline-danger:hover {
    color: #fff !important;
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
}

.btn-outline-danger i {
    color: inherit !important;
}

/* Force all action buttons to be always visible */
.table .btn-group .btn {
    opacity: 1 !important;
    visibility: visible !important;
    display: inline-flex !important;
    pointer-events: auto !important;
}

.table .btn-group .btn-outline-danger {
    opacity: 1 !important;
    visibility: visible !important;
    display: inline-flex !important;
    color: #dc3545 !important;
    border-color: #dc3545 !important;
    background-color: transparent !important;
}

.table .btn-group .btn-outline-danger:hover {
    color: #fff !important;
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
}

.table .btn-group .btn-outline-danger i {
    opacity: 1 !important;
    visibility: visible !important;
    display: inline-block !important;
    color: inherit !important;
}

/* Ensure all buttons in action columns are visible */
.table td .btn-group {
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
}

.table td .btn-group .btn {
    opacity: 1 !important;
    visibility: visible !important;
    display: inline-flex !important;
    margin: 0 2px !important;
}


/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-color);
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Smooth Animations */
* {
    scroll-behavior: smooth;
}

/* Focus Styles */
*:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Modern Dashboard Styles - CRM Style */
.dashboard-header {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    border: 1px solid #fed7aa;
}

.dashboard-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.dashboard-subtitle {
    color: #6b7280;
    margin: 0;
    font-size: 0.875rem;
}

/* Modern Button Styles */
.btn-rounded {
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.btn-rounded:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Modern Table Styles */
.table-modern {
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.table-modern th {
    background: #fef7ed;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #374151;
    padding: 1rem;
    border: none;
}

.table-modern td {
    padding: 1rem;
    border-top: 1px solid #fed7aa;
    border-bottom: none;
    border-left: none;
    border-right: none;
}

.table-modern tbody tr:hover {
    background: #fef7ed;
}

/* Modern Form Styles */
.form-modern .form-control,
.form-modern .form-select {
    border-radius: 12px;
    border: 1px solid #fed7aa;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.form-modern .form-control:focus,
.form-modern .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
    outline: none;
}

/* Header Improvements */
.header-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.dashboard-header-inline {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.dashboard-header-inline .dashboard-title {
    font-size: 1.5rem;
    margin: 0;
}

.dashboard-header-inline .dashboard-subtitle {
    font-size: 0.75rem;
    margin: 0;
}

/* Additional Mobile Optimizations */
@media (max-width: 767px) {
    /* Mobile Header Improvements */
    .header {
        padding: 0 1rem;
        height: 60px;
        position: sticky;
        top: 0;
        z-index: 1000;
        background: white;
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-sm);
    }
    
    /* Management Section Layout Fixes */
    .card-header .d-flex.justify-content-between.align-items-center {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 1rem !important;
    }
    
    .card-header .d-flex.justify-content-between.align-items-center .card-title {
        margin-bottom: 0 !important;
        font-size: 1.1rem !important;
        line-height: 1.2 !important;
    }
    
    .card-header .d-flex.justify-content-between.align-items-center .btn-group {
        width: 100% !important;
        flex-direction: column !important;
        gap: 0.5rem !important;
    }
    
    .card-header .d-flex.justify-content-between.align-items-center .btn-group .btn {
        width: 100% !important;
        justify-content: center !important;
        margin: 0 !important;
    }
    
    /* Single button in management headers */
    .card-header .d-flex.justify-content-between.align-items-center > .btn {
        width: 100% !important;
        margin-top: 0.5rem !important;
    }
    
    /* Fix for buttons below edit in customer view */
    .card-header .d-flex.justify-content-between.align-items-center > div:not(.card-title) {
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 0.5rem !important;
        margin-top: 0.5rem !important;
    }
    
    .card-header .d-flex.justify-content-between.align-items-center > div:not(.card-title) .btn {
        width: 100% !important;
        justify-content: center !important;
        margin: 0 !important;
    }
    
    /* Ensure all management buttons are visible */
    .card-header .btn {
        display: inline-flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        min-height: 44px !important;
        padding: 0.75rem 1rem !important;
        font-size: 0.875rem !important;
        border-radius: 8px !important;
    }
    
    /* Fix for tab content button layouts */
    .tab-pane .d-flex.justify-content-between.align-items-center {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.75rem !important;
    }
    
    .tab-pane .d-flex.justify-content-between.align-items-center .btn {
        width: 100% !important;
        margin-top: 0.5rem !important;
    }
    
    /* Fix for form switches and labels */
    .tab-pane .d-flex.justify-content-between.align-items-center .d-flex.align-items-center {
        width: 100% !important;
        justify-content: space-between !important;
    }
    
    /* Ensure proper spacing in card bodies */
    .card-body {
        padding: 1rem !important;
    }
    
    /* Fix table responsive issues */
    .table-responsive {
        margin: 0 -1rem !important;
        padding: 0 1rem !important;
        border-radius: 0 !important;
    }
    
    /* Fix button groups in tables */
    .table .btn-group {
        flex-direction: column !important;
        width: 100% !important;
        gap: 0.25rem !important;
    }
    
    .table .btn-group .btn {
        width: 100% !important;
        margin: 0 !important;
        font-size: 0.8rem !important;
        padding: 0.5rem 0.75rem !important;
    }
    
    /* Invoice Management specific fixes */
    .card-header .d-flex.justify-content-between.align-items-center > div.btn-group {
        width: 100% !important;
        flex-direction: column !important;
        gap: 0.5rem !important;
    }
    
    /* User Management specific fixes */
    .card-header .d-flex.justify-content-between.align-items-center .btn-sm {
        width: 100% !important;
        font-size: 0.875rem !important;
        padding: 0.75rem 1rem !important;
        min-height: 44px !important;
    }
    
    /* Fix for action buttons in customer view */
    .card-header .d-flex.justify-content-between.align-items-center > div .btn {
        width: 100% !important;
        margin-bottom: 0.5rem !important;
        display: inline-flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .card-header .d-flex.justify-content-between.align-items-center > div .btn:last-child {
        margin-bottom: 0 !important;
    }
    
    /* Fix for bottom buttons going out of margins */
    .card-footer .btn,
    .modal-footer .btn {
        width: 100% !important;
        margin-bottom: 0.5rem !important;
    }
    
    .card-footer .btn:last-child,
    .modal-footer .btn:last-child {
        margin-bottom: 0 !important;
    }
    
    /* Fix for form buttons */
    .form-group .btn {
        width: 100% !important;
        margin-bottom: 0.5rem !important;
    }
    
    /* Fix for search and filter sections */
    .d-flex.flex-wrap.gap-2,
    .d-flex.flex-wrap.gap-3 {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }
    
    .d-flex.flex-wrap.gap-2 > *,
    .d-flex.flex-wrap.gap-3 > * {
        width: 100% !important;
        margin: 0 !important;
    }
    
    /* Fix for action bars */
    .action-bar {
        flex-direction: column !important;
        gap: 0.75rem !important;
    }
    
    .action-bar .btn {
        width: 100% !important;
        margin: 0 !important;
    }
    
    /* Fix for quick actions */
    .quick-actions-grid .btn {
        width: 100% !important;
        margin: 0 !important;
    }
    
    /* Ensure all buttons are touch-friendly */
    .btn, button, input[type="button"], input[type="submit"] {
        min-height: 44px !important;
        min-width: 44px !important;
        padding: 0.75rem 1rem !important;
        font-size: 0.875rem !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.5rem !important;
    }
    
    /* Fix for specific management sections */
    .card-header h5.card-title {
        font-size: 1.1rem !important;
        margin-bottom: 0 !important;
        word-break: break-word !important;
    }
    
    /* Fix for invoice management buttons */
    .card-header .btn-group .btn + .btn {
        margin-left: 0 !important;
        margin-top: 0.5rem !important;
    }
    
    /* Fix for user management navigation */
    .nav-pills .nav-link {
        padding: 0.75rem 1rem !important;
        margin-bottom: 0.5rem !important;
        border-radius: 8px !important;
    }
    
    /* Fix for modal buttons */
    .modal-dialog .modal-footer {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }
    
    .modal-dialog .modal-footer .btn {
        width: 100% !important;
        margin: 0 !important;
    }
    
    /* Fix for form controls */
    .form-control, .form-select {
        font-size: 16px !important; /* Prevents zoom on iOS */
        min-height: 44px !important;
    }
    
    /* Fix for card margins */
    .card {
        margin-left: -1rem !important;
        margin-right: -1rem !important;
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
    }
    
    .card:first-child {
        margin-top: -1rem !important;
    }
    
    /* Fix for content padding */
    .content {
        padding: 0.5rem !important;
    }
    
    /* Fix for page headers */
    .page-header {
        margin-bottom: 1rem !important;
        padding-bottom: 0.5rem !important;
    }
    
    /* Fix for stats grid */
    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    /* Fix for alert spacing */
    .alert {
        margin: 0 -1rem 1rem -1rem !important;
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
    }
    
    .header-left {
        gap: 0.75rem;
        flex: 1;
        min-width: 0;
    }
    
    .header-right {
        flex-shrink: 0;
        z-index: 1001;
    }
    
    .mobile-logo {
        display: flex !important;
        align-items: center;
        margin-right: 0.5rem;
        max-width: 120px;
    }
    
    .mobile-logo img {
        max-height: 28px;
        max-width: 100px;
        height: auto;
        width: auto;
        object-fit: contain;
    }
    
    .header-title {
        font-size: 1.1rem;
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        flex: 1;
        min-width: 0;
    }
    
    .user-avatar {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
        border: 2px solid white;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .mobile-menu-btn {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.1rem;
        color: var(--text-color);
        background: none;
        border: none;
        border-radius: var(--radius);
        transition: all 0.3s ease;
    }
    
    .mobile-menu-btn:hover {
        background: var(--light-color);
    }
    
    /* Improve touch targets */
    .nav-link {
        padding: 1rem 1.5rem;
        min-height: 48px;
        display: flex;
        align-items: center;
    }
    
    /* Better spacing for mobile cards */
    .card {
        margin-bottom: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    /* Mobile-friendly alerts */
    .alert {
        margin: 0 -1rem 1rem -1rem;
        border-radius: 0;
    }
    
    /* Improve form controls */
    .form-control, .form-select {
        min-height: 44px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Better modal display */
    .modal-dialog {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }
    
    /* Responsive text sizes */
    .header-title {
        font-size: 1.25rem;
    }
    
    .stat-value {
        font-size: 1.75rem;
    }
    
    /* Hide less important columns on mobile */
    .table .d-none-mobile {
        display: none;
    }
    
    /* Stack button groups vertically */
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        margin-bottom: 0.5rem;
        width: 100%;
    }
}

/* Login Page Styles */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fef7ed 0%, #fed7aa 100%);
    padding: 1rem;
}

.login-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 3rem;
    width: 100%;
    max-width: 420px;
    border: 1px solid #fed7aa;
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.login-header h1 i {
    color: #f97316;
    font-size: 1.75rem;
}

.login-header p {
    color: #6b7280;
    font-size: 1rem;
    margin: 0;
}

.login-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem;
}

.login-logo img {
    max-height: 60px;
    max-width: 200px;
    height: auto;
    width: auto;
    object-fit: contain;
}

.login-card .form-group {
    margin-bottom: 1.5rem;
}

.login-card .form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}

.login-card .form-label i {
    color: #f97316;
    width: 16px;
}

.login-card .form-control {
    width: 100%;
    padding: 1rem;
    border: 2px solid #fed7aa;
    border-radius: 12px;
    font-size: 1rem;
    background: white;
    color: #374151;
    transition: all 0.3s ease;
}

.login-card .form-control:focus {
    outline: none;
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
    transform: translateY(-1px);
}

.login-card .form-control::placeholder {
    color: #9ca3af;
}

.login-card .btn-primary {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    margin-top: 1rem;
}

.login-card .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(249, 115, 22, 0.3);
}

.login-card .btn-primary:active {
    transform: translateY(0);
}

.login-card .alert {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border-radius: 12px;
    border: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.login-card .alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.login-card .alert i {
    font-size: 1.125rem;
}

/* Fade in animation */
.fade-in {
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile responsive login */
@media (max-width: 768px) {
    .login-container {
        padding: 0.5rem;
    }
    
    .login-card {
        padding: 2rem 1.5rem;
        margin: 1rem;
    }
    
    .login-header h1 {
        font-size: 1.5rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .login-card .form-control {
        padding: 0.875rem;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .login-card .btn-primary {
        padding: 0.875rem 1.5rem;
    }
}

/* Hide default credentials */
.login-card .text-muted small {
    display: none !important;
}

/* Print Styles */
@media print {
    .sidebar,
    .header,
    .btn {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
}