/* Quotes header layout */
.quotes-header { display: grid; grid-template-columns: 1fr; gap: 0.5rem; }
.quotes-title { padding-left: 0.75rem; padding-right: 0.75rem; }
.quotes-actions { padding: 0 0.75rem; gap: 0.3rem; flex-wrap: nowrap; display: flex; align-items: center; }
.quotes-action-btn { padding: 0.34rem 0.58rem; font-size: 0.85rem; line-height: 1; }
.quotes-action-btn svg { width: 14px; height: 14px; margin-right: 4px; }
@media (min-width: 1024px) {
  .quotes-title { padding-left: 2rem; padding-right: 2rem; }
  .quotes-actions { padding: 0 2rem; gap: 0.4rem; }
}
@media (max-width: 420px) {
  .quotes-actions { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .quotes-actions::-webkit-scrollbar { display: none; }
}
/* Quotes header layout */
.quotes-header {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}
@media (min-width: 768px) {
    .quotes-header {
        grid-template-columns: 1fr;
    }
}
@media (min-width: 1024px) {
    .quotes-header {
        grid-template-columns: 1fr;
    }
}
.quotes-title { padding-left: 0.75rem; padding-right: 0.75rem; }
.quotes-actions { padding: 0 0.75rem; gap: 0.375rem; flex-wrap: nowrap; }
.quotes-action-btn { padding: 0.4rem 0.7rem; font-size: 0.9rem; line-height: 1; }
.quotes-action-btn svg { width: 16px; height: 16px; margin-right: 4px; }
@media (min-width: 1024px) {
    .quotes-title { padding-left: 2rem; padding-right: 2rem; }
    .quotes-actions { padding: 0 2rem; gap: 0.5rem; }
}

/* Larger touch targets for settings toggles (mobile only) */
@media (max-width: 768px) {
    #settings-menu input[type="checkbox"],
    [data-dropdown-root] input[type="checkbox"] {
        width: 22px;
        height: 22px;
    }
    #settings-menu label,
    [data-dropdown-root] label {
        min-height: 44px; /* finger target */
        align-items: center;
    }
}
@media (max-width: 768px) {
    .quotes-actions { gap: 0.25rem; }
    .quotes-action-btn { padding: 0.35rem 0.6rem; font-size: 0.85rem; }
    .quotes-action-btn svg { width: 14px; height: 14px; margin-right: 3px; }
}

/* Force quotes actions to stay on one line and allow content to scroll */
@media (max-width: 420px) {
    .quotes-actions { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* Optional: provide a little spacing between actions and avoid wrap on iOS Safari rendering quirks */
.quotes-actions::-webkit-scrollbar { display: none; }
/* Quotes – apply same gradient accents as client cards */
.quote-card {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-sm), 0 0 0 1px rgba(0, 0, 0, 0.02);
}

/* Apply gradient to invoices and materials cards too */
.invoice-card, .material-card {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
}
.invoice-card::before, .material-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 50%, var(--success) 100%);
    opacity: 0.9;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
}
.quote-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 50%, var(--success) 100%);
    opacity: 0.9;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
}
.quote-field {
    position: relative;
    background: rgba(249, 250, 251, 0.8);
    border-radius: 12px;
    padding: 10px 12px 10px 14px;
}
.quote-field::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
    background: linear-gradient(180deg, var(--primary) 0%, var(--secondary) 50%, var(--accent) 100%);
}
/* Clients header positioning (mobile) */
@media (max-width: 768px) {
    .clients-view { margin-top: -0.75rem; }
    .clients-title { margin-top: -0.75rem; margin-bottom: 0.5rem; }
    .clients-header {
        display: flex;
        flex-direction: row; /* place title/subtitle left, actions right */
        align-items: flex-start;
        justify-content: space-between;
        text-align: left;
        gap: 0.5rem;
        position: relative;
    }
    .clients-header > div:first-child { flex: 1 1 auto; }
    .clients-header h2 { font-size: 1.5rem; }
    .clients-header p { margin-top: 0.125rem; font-size: 0.9rem; }
    /* Compact action button at top-right */
    .clients-header .btn-primary {
        width: auto;
        padding: 0.5rem 0.9rem;
        font-size: 0.9rem;
        border-radius: 12px;
    }
    .clients-header .btn-primary svg { width: 16px; height: 16px; margin-right: 6px; }
}

/* Clients gutter and compact button on mobile */
@media (max-width: 768px) {
    .clients-row { padding: 0 0.75rem; }
    .clients-label { margin-left: 0.25rem; }
    .clients-new-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.9rem;
        border-radius: 12px;
    }
    .clients-new-btn svg { width: 16px; height: 16px; margin-right: 6px; }
}

/* Clients heading/row gutter on desktop */
@media (min-width: 1024px) {
	.clients-title,
	.clients-row {
		padding-left: 3rem !important;
		padding-right: 3rem !important;
	}
	.clients-label { margin-left: 0 !important; }
	.clients-new-btn { margin-right: 0 !important; padding: 0.5rem 0.9rem; }
}
/* SideKick - Ultra-Modern PWA Design */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Modern Color Palette */
    --primary: #6366f1;
    --primary-light: #a5b4fc;
    --primary-dark: #4338ca;
    --secondary: #8b5cf6;
    --accent: #06b6d4;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    /* Neutral Grays */
    --gray-25: #fcfcfd;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --gray-950: #030712;
    
    /* Modern Shadows */
    --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    
    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(255, 255, 255, 0.2);
    
    /* Spacing Scale */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;
}

* {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
    min-height: 100vh;
    color: var(--gray-900);
    line-height: 1.6;
    letter-spacing: -0.01em;
}

/* Ultra-Modern Button System */
button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--radius-lg);
    font-weight: 500;
    font-size: 0.875rem;
    line-height: 1.25rem;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    outline: none;
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
}

button:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Primary Button - Modern gradient with glow */
.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: var(--shadow-sm), 0 0 0 1px rgba(99, 102, 241, 0.1);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #3730a3 100%);
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(99, 102, 241, 0.2), 0 0 20px rgba(99, 102, 241, 0.15);
    transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

/* Secondary Button - Glass effect */
.btn-secondary {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    color: var(--gray-700);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

/* Success Button - Subtle */
.btn-success {
    background: rgba(16, 185, 129, 0.08);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.2);
    box-shadow: none;
}

.btn-success:hover:not(:disabled) {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.3);
    transform: translateY(-1px);
}

/* Warning Button - Subtle */
.btn-warning {
    background: rgba(245, 158, 11, 0.08);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.2);
    box-shadow: none;
}

.btn-warning:hover:not(:disabled) {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.3);
    transform: translateY(-1px);
}

.btn-warning:disabled {
    background: var(--gray-100);
    color: var(--gray-500);
    border: 1px solid var(--gray-200);
    cursor: not-allowed;
    opacity: 0.7;
}

/* Danger Button - Subtle */
.btn-danger {
    background: rgba(239, 68, 68, 0.08);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
    box-shadow: none;
}

.btn-danger:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.3);
    transform: translateY(-1px);
}

/* Ghost Button */
.btn-ghost {
    background: transparent;
    color: var(--gray-600);
    border: 1px solid transparent;
}

.btn-ghost:hover:not(:disabled) {
    background: var(--gray-100);
    color: var(--gray-700);
}

/* Ultra-Modern Card System */
.card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-2xl);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-sm), 0 0 0 1px rgba(0, 0, 0, 0.02);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    pointer-events: none;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-2xl), 0 0 0 1px rgba(99, 102, 241, 0.05);
    border-color: rgba(99, 102, 241, 0.1);
}

/* Premium Dashboard Stats Cards */
.stat-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.9) 100%);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-2xl);
    padding: var(--space-2xl);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 50%, var(--success) 100%);
    opacity: 0.8;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(99, 102, 241, 0.03), transparent);
    animation: rotate 20s linear infinite;
    pointer-events: none;
}

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

.stat-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: var(--shadow-xl), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border-color: rgba(99, 102, 241, 0.15);
}

.stat-card:hover::before {
    opacity: 1;
    height: 4px;
}

/* Ultra-Modern Status System */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(12px);
    transition: all 0.2s ease;
}

.status-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.status-badge:hover::before {
    left: 100%;
}

.status-pending {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15) 0%, rgba(245, 158, 11, 0.1) 100%);
    color: #92400e;
    border: 1px solid rgba(245, 158, 11, 0.3);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.1);
}

.status-active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(67, 56, 202, 0.1) 100%);
    color: #3730a3;
    border: 1px solid rgba(99, 102, 241, 0.3);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.1);
}

.status-complete {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(5, 150, 105, 0.1) 100%);
    color: #047857;
    border: 1px solid rgba(16, 185, 129, 0.3);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.1);
}

.status-approved {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(5, 150, 105, 0.1) 100%);
    color: #047857;
    border: 1px solid rgba(16, 185, 129, 0.3);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.1);
}

.status-rejected {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(220, 38, 38, 0.1) 100%);
    color: #991b1b;
    border: 1px solid rgba(239, 68, 68, 0.3);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.1);
}

/* Floating Action Button */
.fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    box-shadow: var(--shadow-xl);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

.fab:hover {
    transform: translateY(-4px) scale(1.1);
    box-shadow: var(--shadow-2xl), 0 0 30px rgba(99, 102, 241, 0.3);
}

.fab:active {
    transform: translateY(-2px) scale(1.05);
}

/* Ultra-Modern Modal System */
.modal-backdrop {
    backdrop-filter: blur(20px);
    background: rgba(0, 0, 0, 0.4);
    animation: fadeIn 0.2s ease-out;
}

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

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-2xl);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-2xl), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Ultra-Modern Form System */
input, textarea, select {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(229, 231, 235, 0.5);
    border-radius: var(--radius-lg);
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-xs);
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1), var(--shadow-sm);
    transform: translateY(-1px);
}

input:hover, textarea:hover, select:hover {
    border-color: rgba(99, 102, 241, 0.3);
    background: rgba(255, 255, 255, 0.9);
}

/* Form Labels */
label {
    font-weight: 500;
    color: var(--gray-700);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    display: block;
}

/* Modern Empty States */
.empty-state {
    text-align: center;
    padding: var(--space-3xl);
    color: var(--gray-500);
}

.empty-state svg {
    margin: 0 auto var(--space-lg);
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: var(--space-sm);
}

.empty-state p {
    margin-bottom: var(--space-lg);
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* Table styling */
table {
    border-collapse: separate;
    border-spacing: 0;
}

table th:first-child {
    border-top-left-radius: 0.5rem;
}

table th:last-child {
    border-top-right-radius: 0.5rem;
}

/* Default - mobile cards (safe fallback) */
.desktop-table {
    display: none;
}

.mobile-cards {
    display: block;
}

/* Desktop - show tables only on very large screens */
@media (min-width: 1600px) {
    .desktop-table {
        display: block;
    }
    
    .mobile-cards {
        display: none;
    }
    
    /* Ensure table actions have enough space */
    .desktop-table table {
        min-width: 1200px;
    }
    
    /* Add horizontal scroll as backup safety */
    .desktop-table {
        overflow-x: auto;
    }
}

/* Medium and smaller screens - ensure mobile cards are shown */
@media (max-width: 1599px) {
    .desktop-table {
        display: none;
    }
    
    .mobile-cards {
        display: block;
    }
    
    /* Tablet-specific card styling */
    .mobile-card {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .mobile-card-actions {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    
    .mobile-card-actions button {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
}

/* Mobile card styling */
.mobile-card {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(229, 231, 235, 0.5);
}

/* Clients – Responsive Mobile Enhancements */
@media (max-width: 768px) {
    .clients-grid {
        gap: 16px;
    }
    .client-card {
        padding: 1rem !important;
        border-radius: 24px !important;
        margin-left: 0.75rem;
        margin-right: 0.75rem;
    }
    .client-header {
        margin-bottom: 0.75rem !important;
    }
    .client-avatar {
        width: 44px !important;
        height: 44px !important;
        border-radius: 9999px !important;
    }
    .client-actions button {
        padding: 0.4rem 0.6rem !important;
        font-size: 0.8rem !important;
    }
    /* Compact info rows */
    .client-card .space-y-2 > div {
        padding: 6px 8px;
        border-radius: 10px;
        background: rgba(243, 244, 246, 0.6);
    }
    .client-card h3 {
        font-size: 1rem !important;
        margin-bottom: 0.5rem !important;
    }
    .client-card .btn-ghost { background: transparent; }
    .client-card .btn-primary { border-radius: 10px; }
}

/* Dashboard-like gradient accent for client cards */
.client-card {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
}

/* Smooth collapse/expand animation */
.client-card .space-y-2[style],
.client-card .space-y-2 {
    transition: all 0.2s ease;
}
.client-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 50%, var(--success) 100%);
    opacity: 0.9;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
}

/* Left gradient accent for client fields */
.client-field {
    position: relative;
    background: rgba(249, 250, 251, 0.8);
    border-radius: 12px;
    padding: 10px 12px 10px 14px;
}
.client-field::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
    background: linear-gradient(180deg, var(--primary) 0%, var(--secondary) 50%, var(--accent) 100%);
}

.mobile-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    position: relative;
}

/* Consistent delete button for all cards - PERFECT CIRCLE */
.mobile-card-delete {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    width: 1.75rem;
    height: 1.75rem;
    min-width: 1.75rem;
    min-height: 1.75rem;
    max-width: 1.75rem;
    max-height: 1.75rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
    transition: all 0.2s ease;
    z-index: 10;
    flex-shrink: 0;
    padding: 0;
    box-sizing: border-box;
}

.mobile-card-delete:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    transform: scale(1.05);
}

.mobile-card-delete svg {
    width: 0.875rem;
    height: 0.875rem;
    flex-shrink: 0;
}

/* Ensure status badges don't overlap with delete button */
.card .status-badge {
    margin-right: 2rem;
}

.mobile-card-title {
    font-weight: 600;
    color: #1f2937;
    font-size: 1rem;
}

.mobile-card-subtitle {
    color: #6b7280;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.mobile-card-content {
    space-y: 0.5rem;
}

.mobile-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.mobile-card-row:last-child {
    border-bottom: none;
}

.mobile-card-label {
    font-weight: 500;
    color: #6b7280;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mobile-card-value {
    color: #1f2937;
    font-weight: 500;
}

.mobile-card-actions {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.mobile-card-actions.two-buttons {
    grid-template-columns: 1fr 1fr;
}

.mobile-card-actions.three-buttons {
    grid-template-columns: 1fr 1fr 1fr;
}

.mobile-card-actions.four-buttons {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.mobile-card-actions.five-buttons {
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.mobile-card-actions button {
    font-size: 0.7rem;
    padding: 0.4rem 0.75rem;
    text-align: center;
    white-space: nowrap;
    border-radius: 1rem;
    font-weight: 500;
}

/* Enhanced Mobile Responsiveness */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Compact header */
    nav {
        padding: 0.75rem 0;
    }
    
    nav .container {
        padding: 0 1rem;
    }
    
    /* Make logo smaller */
    nav .w-10 {
        width: 2rem;
        height: 2rem;
    }
    
    nav .w-6 {
        width: 1.25rem;
        height: 1.25rem;
    }
    
    nav h1 {
        font-size: 1rem;
        line-height: 1.2;
    }
    
    nav p {
        font-size: 0.7rem;
        margin-top: -0.125rem;
    }
    
    /* Keep brand row left-aligned; allow wrap but do not center */
    nav .flex.items-center.justify-between {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
    }
    
    /* Make navigation container full width and scrollable */
    nav .bg-gray-100\/80 {
        width: 100%;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        padding: 0.375rem;
    }
    
    nav .space-x-1 {
        display: flex;
        min-width: 0;
        width: 100%;
        gap: 0.25rem;
        justify-content: space-between;
    }
    
    /* Navigation improvements */
    nav .flex {
        flex-wrap: wrap;
        overflow-x: hidden;
        padding-bottom: 0.5rem;
        -webkit-overflow-scrolling: touch;
    }
    
    nav .space-x-1 {
        min-width: 0;
    }
    
    nav button {
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
        white-space: nowrap;
        min-width: 0;
        flex: 1 1 0;
        text-align: center;
    }
    
    /* Show only icons on mobile screens (not tablet) */
    @media (max-width: 768px) {
        nav button span {
            display: none;
        }
        /* Keep notification badge visible on mobile */
        nav button .notif-badge {
            display: inline-flex !important;
        }
        
        nav button {
            padding: 0.75rem;
            min-width: auto;
            flex: 1;
            display: flex;
            justify-content: center;
        }
        
        nav button .space-x-2 {
            margin: 0;
        }
        
        nav .space-x-1 {
            gap: 0.5rem;
            display: flex;
            width: 100%;
        }
    }
    
    /* Modal improvements */
    .modal-content {
        margin: 0.5rem;
        max-height: calc(100vh - 1rem);
        border-radius: 12px;
    }
    
    /* Card improvements */
    .stat-card {
        padding: 1.5rem;
    }
    
    .card {
        padding: 1rem;
    }
    
    /* Button improvements */
    button {
        min-height: 44px; /* Touch target size */
        font-size: 0.9rem;
    }
    
    /* Table improvements - already handled by main responsive rules */
    
    .grid-responsive {
        grid-template-columns: 1fr;
    }
    
    /* Job cards mobile layout */
    .grid.grid-cols-1.md\:grid-cols-2.lg\:grid-cols-3 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Form improvements */
    .grid.grid-cols-1.md\:grid-cols-2 {
        grid-template-columns: 1fr;
    }
    
    /* Status badges mobile */
    .status-badge {
        font-size: 0.7rem;
        padding: 0.4rem 0.8rem;
    }
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

/* Success/Error messages */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* Print styles for quotes */
@media print {
    body * {
        visibility: hidden;
    }
    
    .print-area, .print-area * {
        visibility: visible;
    }
    
    .print-area {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }
    
    nav, button, .no-print {
        display: none !important;
    }
}

/* PWA specific styles */
.pwa-install-prompt {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: #1f2937;
    color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: none;
}

.pwa-install-prompt.show {
    display: block;
    animation: slideUp 0.3s ease-out;
}

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

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Utility classes */
.text-shadow {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.glass-effect {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.gradient-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Animation classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.slide-in {
    animation: slideIn 0.3s ease-out;
}

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

/* Notifications dropdown tweaks */
.nav-pills + .relative .shadow-2xl {
    box-shadow: 0 20px 30px rgba(0,0,0,0.1), 0 6px 10px rgba(0,0,0,0.06);
}

.nav-pills button[aria-label="Notifications"]:focus-visible,
.nav-pills button[aria-label="Settings"]:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Ensure nav container can anchor absolute children */
nav .container {
    position: relative;
}

/* Reposition notification badge so it doesn't clip under the nav */
nav button[aria-label="Notifications"] .notif-badge {
    position: absolute;
    top: 1px;
    right: 0;
    transform: translate(35%, -35%);
    z-index: 3;
    border: 2px solid #fff;
    line-height: 1;
}

/* Compact icon buttons (bell/gear) */
nav button[aria-label="Notifications"],
nav button[aria-label="Settings"] {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
}

nav button[aria-label="Notifications"] svg,
nav button[aria-label="Settings"] svg {
    width: 20px;
    height: 20px;
}

@media (min-width: 1024px) {
    nav button[aria-label="Notifications"],
    nav button[aria-label="Settings"] {
        width: 38px;
        height: 38px;
    }
    nav button[aria-label="Notifications"] svg,
    nav button[aria-label="Settings"] svg {
        width: 22px;
        height: 22px;
    }
}

/* Tablet & down: place bell/gear at top-right beside logo and allow wrap */
@media (max-width: 1024px) {
    /* Ensure content doesn't sit under bell/gear */
    nav .container {
        padding-right: 72px; /* space for header-actions */
    }

    nav .header-actions {
        position: absolute;
        top: 10px;
        right: 16px; /* match px-6 */
        z-index: 50;
        overflow: visible;
    }
    nav { overflow: visible; }
    /* Let header wrap to avoid horizontal scroll while keeping brand left */
    nav .container > .flex.items-center.justify-between {
        flex-wrap: wrap;
        gap: 0.5rem 0.75rem;
        align-items: center;
    }
    nav .container > .flex.items-center.justify-between > .flex.items-center.space-x-3 { /* brand */
        flex: 1 1 auto;
        min-width: 0;
    }
    nav .container > .flex.items-center.justify-between > .status-inline { /* status inline beside brand */
        flex: 0 1 auto;
        order: 2;
        margin-left: 0.5rem;
        display: flex;
        flex-direction: column; /* Stack: Online on top, Last sync below */
        align-items: flex-start;
        gap: 2px;
        margin-right: 12px; /* subtle breathing room for bell/gear */
    }
    nav .container > .flex.items-center.justify-between > .nav-pills { /* nav pills full-width under brand */
        order: 3;
        width: 100%;
    }
    /* Make nav pills full width; allow horizontal scroll on tablet widths */
    .nav-pills {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    /* Edge-to-edge nav pills on mobile */
    @media (max-width: 768px) {
        .nav-pills {
            width: calc(100% + 2rem);
            margin-left: -1rem;
            margin-right: -1rem;
            overflow-x: hidden;
        }
    }
    .nav-pills button {
        flex: 0 0 auto;
        text-align: center;
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
    /* Tighter badge fit on small/tablet screens */
    /* Tighter badge fit on small screens */
    nav button[aria-label="Notifications"] .notif-badge {
        top: 3px;
        right: 0;
        transform: translate(25%, -25%);
    }
}

/* --- Mobile final overrides (stabilize layout) --- */
@media (max-width: 768px) {
    /* Remove extra right padding reserved for header actions on mobile */
    nav .container {
        padding-right: 1rem !important;
    }

    /* Nav pills fill container cleanly */
    .nav-pills {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        position: relative !important;
        left: 0 !important;
        transform: none !important;
        overflow-x: hidden !important;
    }
    /* Equal spacing for icons across the row */
    nav .space-x-1 {
        min-width: 0 !important;
        width: 100% !important;
        justify-content: space-between !important;
        gap: 0.5rem !important;
    }
    /* Neutralize Tailwind space-x margins so ends are flush */
    nav .space-x-1 > * {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    .nav-pills button {
        flex: 1 1 0 !important;
        min-width: 0 !important;
        text-align: center !important;
    }
    /* Status: stack Online + Last sync, keep clear of bell/gear */
    nav .container > .flex.items-center.justify-between > .status-inline {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 2px !important;
        padding-right: 8px !important;
        margin-right: 72px !important; /* reserve space for bell/gear */
        white-space: normal !important;
        text-align: left !important;
    }
}
