/* Aexo Hub Mobile PWA - Complete Mobile-First Styles */

:root {
    --primary-color: #CC3366;
    --secondary-color: #000000;
    --accent-color: #CC6565;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --border-color: #dee2e6;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    
    --safe-area-inset-top: max(12px, env(safe-area-inset-top));
    --safe-area-inset-bottom: max(12px, env(safe-area-inset-bottom));
    --safe-area-inset-left: max(12px, env(safe-area-inset-left));
    --safe-area-inset-right: max(12px, env(safe-area-inset-right));
}

* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

html, body {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: #fff;
    color: var(--dark-color);
    overflow: hidden;
    touch-action: manipulation;
}

.pwa-body {
    display: flex;
    flex-direction: column;
    background: var(--light-color);
    margin: 0;
    padding: 0;
    height: 100vh;
}

/* App Container */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    background: var(--light-color);
}

/* Status Bar */
.status-bar {
    background: var(--secondary-color);
    color: white;
    padding: var(--safe-area-inset-top) 16px 8px;
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-bar-content {
    display: flex;
    justify-content: center;
    width: 100%;
}

.status-time {
    font-weight: 600;
}

/* App Header - NOW STICKY */
.app-header {
    background: var(--primary-color);
    color: white;
    padding: 12px 16px;
    padding-top: calc(12px + var(--safe-area-inset-top));
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    z-index: 100;
    position: sticky;
    top: 0;
    flex-shrink: 0;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-center {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.header-logo {
    height: 28px;
    width: auto;
    max-width: 100px;
    filter: brightness(0) invert(1);
    object-fit: contain;
}

.header-title {
    font-size: 16px;
    font-weight: 700;
    color: white;
}

.burger-menu {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 101;
    pointer-events: auto;
}

.burger-menu:active {
    opacity: 0.8;
}

.btn-icon {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:active {
    opacity: 0.8;
}

/* ===== BURGER MENU SIDEBAR ===== */
.burger-sidebar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
}

.burger-sidebar.open {
    display: flex;
}

.sidebar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
    animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.sidebar-content {
    position: relative;
    width: 280px;
    max-width: 80%;
    height: 100vh;
    background: white;
    z-index: 2;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.2);
    animation: slideInLeft 0.3s ease-out;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

.sidebar-header {
    padding: max(12px, env(safe-area-inset-top)) 16px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--primary-color);
    color: white;
    flex-shrink: 0;
}

.sidebar-header h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.sidebar-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 12px 0;
    flex: 1;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    color: var(--dark-color);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s;
    border-left: 4px solid transparent;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

.sidebar-item:active {
    background: var(--light-color);
    border-left-color: var(--primary-color);
    color: var(--primary-color);
}

.sidebar-item i {
    font-size: 20px;
    min-width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-divider {
    margin: 8px 0;
    border: none;
    border-top: 1px solid var(--border-color);
    height: 0;
}

/* Main Content Area */
.main-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 0px;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

/* Pages */
.page {
    display: none;
    height: 100%;
    animation: slideIn 0.3s ease-in-out;
}

.page.active {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Page Structure */
.page-header {
    background: white;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 50;
    flex-shrink: 0;
}

.page-header h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 8px;
}

.page-content {
    flex: 1;
    overflow: visible;
    padding: 12px;
	padding-bottom: 150px;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    box-sizing: border-box;
}

.page-content > *:last-child {
    margin-bottom: 30px;
}

/* Login Page */
.login-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.login-logo {
    margin-bottom: 20px;
    text-align: center;
}

.login-logo img {
    max-width: 200px;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

.login-title {
    display: none;
}

.login-form {
    width: 100%;
    max-width: 400px;
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.login-form .form-group {
    margin-bottom: 16px;
}

.login-form .form-label {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--dark-color);
}

.login-form .form-control {
    padding: 12px 16px;
    font-size: 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    box-sizing: border-box;
}

.login-form .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(204, 51, 102, 0.1);
    outline: none;
}

.login-form .btn {
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    width: 100%;
}

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

.login-form .btn-primary:active {
    background: #b8295a;
    opacity: 0.8;
}

.login-footer {
    margin-top: 20px;
    text-align: center;
    color: rgba(255,255,255,0.7);
}

.login-footer p {
    margin: 0;
    font-size: 12px;
}

/* Stats Container */
.stats-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.stat-icon.sales {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
}

.stat-icon.finance {
    background: linear-gradient(135deg, #f093fb 0%, var(--accent-color) 100%);
}

.stat-icon.projects {
    background: linear-gradient(135deg, #CC6565 0%, #CC3366 100%);
}

.stat-info {
    flex: 1;
}

.stat-label {
    font-size: 12px;
    color: #999;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

/* Quick Actions */
.quick-actions {
    background: white;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.quick-actions h3 {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: var(--dark-color);
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: var(--light-color);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    color: var(--dark-color);
    transition: all 0.2s;
}

.action-btn:active {
    background: var(--primary-color);
    color: white;
    transform: scale(0.95);
}

.action-btn i {
    font-size: 20px;
}

/* Recent Activity */
.recent-activity {
    background: white;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.recent-activity h3 {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 12px 0;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.activity-item {
    padding: 12px;
    background: var(--light-color);
    border-radius: 6px;
    font-size: 13px;
    color: var(--dark-color);
}

.activity-item .time {
    color: #999;
    font-size: 12px;
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    padding: 0 12px 8px 12px;
    -webkit-overflow-scrolling: touch;
}

.tab-btn {
    padding: 8px 16px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
}

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

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

/* Unit Filter */
.unit-filter {
    margin-bottom: 16px;
}

.form-control-sm {
    padding: 8px 12px;
    font-size: 14px;
}

.deals-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.deal-item {
    background: white;
    border-radius: 8px;
    padding: 16px;
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.deal-item .edit-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    min-width: 40px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    flex-shrink: 0;
    transition: all 0.2s;
}

.deal-item .edit-btn:active {
    background: var(--light-color);
    transform: scale(0.95);
}

.deal-item .edit-btn[title="View Details"] {
    color: #999;
}

.deal-item .edit-btn[title="View Details"]:active {
    background: #f0f0f0;
}

.deal-content {
    flex: 1;
}

.deal-name {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 4px;
}

.deal-status {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    background: var(--light-color);
    color: var(--dark-color);
    display: inline-block;
    margin-bottom: 8px;
}

.deal-amount {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.deal-customer {
    font-size: 12px;
    color: #999;
}

/* Finance Stats */
.finance-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.stat-item {
    background: white;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.stat-item label {
    font-size: 12px;
    color: #999;
    display: block;
    margin-bottom: 8px;
}

.stat-item .amount {
    font-size: 16px;
    font-weight: 700;
    color: var(--dark-color);
}

/* Invoices List */
.invoices-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.invoice-item {
    background: white;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.invoice-item .edit-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    min-width: 40px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    flex-shrink: 0;
}

.invoice-item .edit-btn:active {
    background: var(--light-color);
}

.invoice-content {
    flex: 1;
}

.invoice-number {
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--dark-color);
}

.invoice-status {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    background: var(--light-color);
    color: var(--dark-color);
    display: inline-block;
    margin-bottom: 8px;
}

.invoice-info {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #999;
    margin-bottom: 8px;
}

.invoice-amount {
    font-size: 16px;
    font-weight: 700;
    color: var(--dark-color);
}

/* Projects List */
.projects-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.project-item {
    background: white;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.project-item .edit-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    min-width: 40px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    flex-shrink: 0;
}

.project-item .edit-btn:active {
    background: var(--light-color);
}

.project-content {
    flex: 1;
}

.project-name {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--dark-color);
}

.project-progress {
    height: 6px;
    background: var(--light-color);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.project-progress-bar {
    height: 100%;
    background: var(--primary-color);
    border-radius: 3px;
}

.project-status {
    font-size: 12px;
    color: #999;
}

/* Customers List */
.customers-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.customer-item {
    background: white;
    border-radius: 8px;
    padding: 16px;
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.customer-item:active {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.customer-item .edit-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    min-width: 40px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    flex-shrink: 0;
}

.customer-item .edit-btn:active {
    background: var(--light-color);
}

.customer-content {
    flex: 1;
}

.customer-name {
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 4px;
    font-size: 16px;
}

.customer-type {
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    margin-bottom: 8px;
}

.customer-initial {
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
}

.customer-info {
    font-size: 12px;
    color: #bbb;
}

.customer-info span {
    display: inline-block;
    margin-right: 8px;
}

/* Settings List */
.settings-list {
    display: flex;
    flex-direction: column;
}

.setting-item {
    background: white;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.setting-item label {
    font-weight: 500;
    color: var(--dark-color);
}

.setting-value {
    font-size: 13px;
    color: #999;
}

.setting-item.danger {
    background: transparent;
    padding: 12px 0;
}

/* Toggle Switch */
.toggle-switch {
    display: inline-block;
}

.toggle-switch input {
    display: none;
}

.toggle-switch label {
    display: block;
    width: 50px;
    height: 28px;
    background: var(--border-color);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.toggle-switch label::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 12px;
    top: 2px;
    left: 2px;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.toggle-switch input:checked + label {
    background: var(--primary-color);
}

.toggle-switch input:checked + label::after {
    left: 24px;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: white;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-bottom: var(--safe-area-inset-bottom);
    z-index: 999;
    box-sizing: border-box;
    margin: 0;
    height: auto;
    min-height: 80px;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: none;
    border: none;
    color: #999;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
    padding: 8px 4px;
    min-height: 60px;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    height: 100%;
}

.nav-item.active {
    color: var(--primary-color);
    font-weight: 600;
}

.nav-item i {
    font-size: 24px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: flex-end;
    justify-content: center;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal.open {
    display: flex;
}

.modal-content {
    background: white;
    width: 100%;
    border-radius: 12px 12px 0 0;
    animation: slideUp 0.3s ease-out;
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

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

.modal-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    flex: 1;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--dark-color);
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:active {
    background: var(--light-color);
    border-radius: 50%;
}

.modal-form {
    padding: 16px;
    padding-bottom: 100px;
}

.modal-form .form-group {
    margin-bottom: 16px;
}

.modal-form label {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
    color: var(--dark-color);
}

.modal-form .form-control,
.modal-form select {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

.modal-form .form-control:focus,
.modal-form select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(204, 51, 102, 0.1);
    outline: none;
}

.modal-form textarea {
    font-family: inherit;
    resize: vertical;
}

.modal-form .btn {
    margin-top: 8px;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
}

.modal-form .btn-primary {
    background: var(--primary-color);
    color: white;
    position: sticky;
    bottom: 16px;
    margin-top: 20px;
    width: 100%;
}

.modal-form .btn-primary:active {
    background: #b8295a;
    opacity: 0.8;
}

/* 
   ADD THESE STYLES TO mobile-style.css
   Find the section with ".modal-form" and add these after it
*/

/* ✅ Input Group Styling for Revenue field */
.input-group {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background: white;
}

.input-group-text {
    padding: 12px 16px;
    background: var(--light-color);
    border-right: 1px solid var(--border-color);
    font-weight: 600;
    color: var(--dark-color);
    white-space: nowrap;
    display: flex;
    align-items: center;
    min-width: 45px;
    justify-content: center;
}

.input-group .form-control {
    border: none !important;
    margin: 0 !important;
    flex: 1;
    padding: 12px 16px !important;
    font-size: 16px;
}

.input-group .form-control:focus {
    border: none !important;
    box-shadow: none !important;
    outline: none;
}

/* Alternative styling for better visual clarity */
.input-group.currency .form-control {
    text-align: right;
    font-weight: 500;
}

.input-group.currency .input-group-text {
    background: var(--primary-color);
    color: white;
    border-right: none;
}

/* ✅ Select dropdown improvements */
.modal-form select.form-control {
    padding: 12px 16px;
    font-size: 16px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    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='%23CC3366' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px 12px;
    padding-right: 40px;
}

/* Focus state for select */
.modal-form select.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(204, 51, 102, 0.1);
}

/* ✅ Disabled state */
.modal-form select.form-control:disabled,
.modal-form input.form-control:disabled {
    background-color: var(--light-color);
    color: #999;
    cursor: not-allowed;
    opacity: 0.6;
}

/* ✅ Required field indicator */
.modal-form label .form-label:after {
    content: none;
}

.modal-form label:has(input[required]):before,
.modal-form label:has(select[required]):before,
.modal-form label:has(textarea[required]):before {
    content: ' *';
    color: var(--danger-color);
    font-weight: bold;
    margin-left: 2px;
}

/* ✅ Form validation feedback */
.form-control.is-invalid {
    border-color: var(--danger-color);
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.invalid-feedback {
    display: block;
    color: var(--danger-color);
    font-size: 12px;
    margin-top: 4px;
    margin-left: 4px;
}

/* ✅ Form group spacing */
.modal-form .form-group {
    margin-bottom: 20px;
}

.modal-form .form-group:last-child {
    margin-bottom: 16px;
}

/* ✅ Enhance readonly fields */
.form-control[readonly] {
    background-color: var(--light-color);
    cursor: default;
    border-color: var(--border-color);
}

/* ✅ Better number input styling */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

/* ✅ Number input with buttons (optional modern style) */
input[type="number"].modern {
    padding: 12px 16px;
    font-size: 16px;
    font-weight: 500;
}

/* ✅ Placeholder styling */
.form-control::placeholder {
    color: #bbb;
    font-weight: 400;
}

/* ✅ Textarea improvements */
.modal-form textarea.form-control {
    min-height: 80px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.5;
}

/* ✅ Success state for form fields */
.form-control.is-valid {
    border-color: var(--success-color);
}

.form-control.is-valid:focus {
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

.valid-feedback {
    display: block;
    color: var(--success-color);
    font-size: 12px;
    margin-top: 4px;
    margin-left: 4px;
}

/* Search Container */
.search-container {
    padding: 0 12px;
}

.search-container .input-group {
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border-radius: 8px;
    overflow: hidden;
}

.search-container .form-control {
    border: 1px solid var(--border-color);
    padding: 12px;
    font-size: 16px;
}

.search-container .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(204, 51, 102, 0.1);
}

.search-container .input-group-text {
    border: 1px solid var(--border-color);
    color: #999;
}

/* Select Dropdown */
select.form-control {
    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 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    padding-right: 2.5rem;
}

/* Toast Notifications */
.toast {
    display: none;
    position: fixed;
    bottom: 110px;
    left: 12px;
    right: 12px;
    padding: 16px;
    border-radius: 8px;
    z-index: 1500;
    animation: slideUp 0.3s ease-out;
    font-weight: 500;
}

.toast.show {
    display: block;
}

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

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

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

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

/* Loading Spinner */
.loading-spinner {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    z-index: 3000;
    align-items: center;
    justify-content: center;
}

.loading-spinner.active {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Utility Classes */
.text-muted {
    color: #999 !important;
}

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

.mt-3 {
    margin-top: 16px;
}

.mt-4 {
    margin-top: 24px;
}

.mb-3 {
    margin-bottom: 16px;
}

.gap-2 {
    gap: 16px;
}

.w-75 {
    width: 75%;
}

.w-100 {
    width: 100%;
}

.btn-outline-secondary {
    color: var(--primary-color);
    border-color: var(--border-color);
    background: white;
    padding: 12px 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-outline-secondary:active {
    background: var(--light-color);
    border-color: var(--primary-color);
}

/* Responsive */
@media (min-width: 768px) {
    .stats-container {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .finance-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .action-buttons {
        grid-template-columns: repeat(6, 1fr);
    }

    .modal-content {
        width: 80%;
        max-width: 500px;
        border-radius: 12px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print Styles */
@media print {
    .bottom-nav,
    .page-header,
    .status-bar,
    .app-header {
        display: none !important;
    }
}

/* ========== PROJECTS LIST STYLING ========== */

/* Projects List Container */
.projects-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Project Item with Checkbox Support */
.project-item {
    background: white;
    border-radius: 8px;
    padding: 16px;
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    display: flex;
    gap: 12px;
    align-items: flex-start;
    transition: all 0.2s ease;
}

.project-item:active {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    background: #f9f9f9;
}

/* Checkbox styling */
.project-item input[type="checkbox"] {
    accent-color: var(--primary-color);
    cursor: pointer;
    margin-top: 4px;
}

.project-item input[type="checkbox"]:checked {
    background-color: var(--primary-color);
}

/* Edit button in project item */
.project-item .edit-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    min-width: 40px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    flex-shrink: 0;
    transition: all 0.2s;
}

.project-item .edit-btn:active {
    background: var(--light-color);
    transform: scale(0.95);
}

/* Project content container */
.project-content {
    flex: 1;
    min-width: 0;
}

/* Project name */
.project-name {
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 6px;
    font-size: 15px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* ✅ NEW: Project customer info */
.project-customer {
    font-size: 12px;
    color: #666;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.project-customer i {
    font-size: 14px;
    color: #999;
    flex-shrink: 0;
}

/* Project progress bar */
.project-progress {
    height: 6px;
    background: var(--light-color);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.project-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--accent-color) 100%);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Project status */
.project-status {
    font-size: 12px;
    color: #666;
    text-transform: capitalize;
    padding: 4px 8px;
    background: var(--light-color);
    border-radius: 4px;
    display: inline-block;
}

/* ========== BULK ACTIONS BAR ========== */

.bulk-actions-bar {
    display: none;
    position: sticky;
    top: 0;
    z-index: 50;
    background: #e8f4f8;
    border-bottom: 2px solid #0097a7;
    margin: 0 -12px;
    padding: 12px;
    margin-top: -12px;
    animation: slideDown 0.2s ease-out;
}

.bulk-actions-bar.show {
    display: block;
}

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

.bulk-actions-bar > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
}

.bulk-actions-bar .bulk-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.bulk-actions-bar .bulk-count {
    font-weight: 600;
    color: #01579b;
    font-size: 14px;
}

.bulk-actions-bar .btn {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
    border: 1px solid #0097a7;
    background: white;
    color: #0097a7;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.bulk-actions-bar .btn:active {
    background: #b3e5fc;
    transform: scale(0.95);
}

.bulk-actions-bar .btn-primary {
    background: #0097a7;
    color: white;
    border-color: #0097a7;
}

.bulk-actions-bar .btn-primary:active {
    background: #00838f;
}

/* ========== RESPONSIVE ADJUSTMENTS ========== */

@media (min-width: 768px) {
    .project-item {
        flex-direction: row;
        align-items: center;
    }

    .project-content {
        flex: 1;
    }

    .project-name {
        font-size: 16px;
    }

    .project-customer {
        font-size: 13px;
    }
}

/* ========== TOUCH/INTERACTION STATES ========== */

.project-item:has(.project-checkbox:checked) {
    background: #f0f8fa;
    border-left-color: #0097a7;
}

.project-item:has(.project-checkbox:checked) .project-name {
    color: #01579b;
}

input[type="checkbox"].project-checkbox {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    background: white;
    transition: all 0.2s;
}

input[type="checkbox"].project-checkbox:checked {
    background: var(--primary-color);
    border-color: var(--primary-color);
    background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 16px;
}