/* Promethea Voyages CRM - Main Stylesheet */

/* Georgian: Noto Sans Georgian (Google Fonts) + system fallbacks; BPG Arial omitted (no local files) */
:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    --secondary: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --light: #f8fafc;
    --dark: #1e293b;
    --border: #e2e8f0;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --font-georgian: 'Noto Sans Georgian', 'DejaVu Sans', 'Sylfaen', Arial, sans-serif;
    --font-english: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
}

body {
    font-family: var(--font-english);
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-overflow-scrolling: touch;
}

/* Georgian Language Support */
html[lang="ka"] body,
html[lang="ka"] * {
    font-family: var(--font-georgian) !important;
}

html[lang="ka"] .nav-links,
html[lang="ka"] .nav-brand,
html[lang="ka"] h1,
html[lang="ka"] h2,
html[lang="ka"] h3,
html[lang="ka"] .btn,
html[lang="ka"] .card,
html[lang="ka"] .table {
    font-family: var(--font-georgian) !important;
}

.container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    padding: 1rem 0;
    margin-bottom: 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: bold;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    transition: var(--transition);
}

.nav-brand:hover {
    transform: scale(1.05);
}

.nav-brand img {
    height: 32px;
    width: auto;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.nav-links li {
    white-space: nowrap;
}

.nav-links a {
    color: var(--dark);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    display: block;
    position: relative;
}

/* Nav icons – readable on all pages (navbar is always light bg) */
.nav-links .nav-link-with-icon,
.nav-links .nav-link-with-icon .nav-icon {
    color: #1e293b;
}
.nav-links .nav-link-with-icon:hover,
.nav-links .nav-link-with-icon:hover .nav-icon {
    color: var(--primary);
}
.nav-links .nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    width: 18px;
    height: 18px;
    margin-right: 0.4rem;
    flex-shrink: 0;
}
.nav-links .nav-icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    fill: none;
}
.nav-links .nav-icon.nav-icon-sm {
    width: 1.1em;
    height: 1.1em;
    font-size: 1em;
}
.nav-links .dropdown-arrow {
    font-size: 0.75rem;
    margin-left: 0.15rem;
    opacity: 0.8;
}
.nav-links .dropdown-menu .nav-icon {
    width: 1em;
    height: 1em;
    margin-right: 0.35rem;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
    transform: translateX(-50%);
}

.nav-links a:hover::after {
    width: 80%;
}

.nav-links a:hover {
    color: var(--primary);
    background: var(--light);
}

/* Primary Navigation Link - Leads */
.nav-links a.nav-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white !important;
    font-weight: 600;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.nav-links a.nav-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.nav-links a.nav-primary::after {
    display: none;
}

/* Navigation Separator */
.nav-links .nav-separator {
    color: var(--border);
    font-weight: 300;
    padding: 0 0.25rem;
    user-select: none;
}

/* Dropdown Menu */
.nav-links .dropdown {
    position: relative;
}

.nav-links .dropdown-toggle {
    cursor: pointer;
}

.nav-links .dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% - 5px);
    left: 0;
    margin-top: 0;
    padding-top: 8px;
    background: white;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius);
    padding-bottom: 0.5rem;
    min-width: 200px;
    list-style: none;
    z-index: 1000;
    animation: fadeInUp 0.2s ease;
}

/* Show dropdown on hover (desktop) */
.nav-links .dropdown:hover .dropdown-menu,
.nav-links .dropdown-menu:hover {
    display: block !important;
}

/* Show dropdown when active class is present (mobile/click) */
.nav-links .dropdown.dropdown-active .dropdown-menu {
    display: block !important;
}

.nav-links .dropdown-menu li {
    margin: 0;
}

.nav-links .dropdown-menu a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: var(--dark);
    text-decoration: none;
    transition: var(--transition);
}

.nav-links .dropdown-menu a:hover {
    background: var(--light);
    color: var(--primary);
}

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

/* Modern Language & Currency Switchers */
.modern-switcher {
    position: relative;
    display: inline-block;
}

.search-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    transition: var(--transition);
    border-radius: var(--radius-sm);
}

.search-icon-btn:hover {
    background: var(--light);
    color: var(--primary);
    transform: scale(1.1);
}

.switcher-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: white;
    padding: 0.4rem 0.7rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    cursor: pointer;
    font-weight: 500;
    color: var(--dark);
    transition: var(--transition);
    box-shadow: var(--shadow);
    font-size: 0.8rem;
    white-space: nowrap;
}

.switcher-btn:hover {
    background: var(--light);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* Uniform header switcher buttons */
.header-switcher-btn {
    height: 36px;
    padding: 0 0.6rem !important;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.switcher-icon {
    font-size: 1rem;
    line-height: 1;
}

.switcher-value {
    font-size: 0.75rem;
}

.switcher-arrow {
    font-size: 0.65rem;
    color: var(--secondary);
    transition: transform 0.2s;
    margin-left: 0.2rem;
}

.switcher-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    z-index: 1000;
    overflow: hidden;
    animation: fadeInUp 0.3s ease;
}

.switcher-option {
    display: block;
    padding: 0.75rem 1.25rem;
    color: var(--dark);
    text-decoration: none;
    transition: var(--transition);
    border-bottom: 1px solid var(--light);
}

.switcher-option:last-child {
    border-bottom: none;
}

.switcher-option:hover {
    background: var(--light);
}

.switcher-option.active {
    background: var(--primary);
    color: white;
}

/* Search Icon Button */
.search-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    transition: var(--transition);
    border-radius: var(--radius-sm);
}

.search-icon-btn:hover {
    background: var(--light);
    color: var(--primary);
    transform: scale(1.1);
}

/* Search Popup Modal */
#searchPopup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

#searchPopup > div {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-md);
    max-width: 600px;
    width: 90%;
    position: relative;
    box-shadow: var(--shadow-lg);
    animation: slideDown 0.3s ease;
}

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

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

/* Notifications */
.notification-icon {
    position: relative;
    padding: 0.5rem;
    text-decoration: none;
    color: var(--text);
    transition: var(--transition);
    border-radius: var(--radius-sm);
}

.notification-icon:hover {
    background: var(--light);
    color: var(--primary);
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    animation: pulse 2s infinite;
}

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

.notification-item.unread {
    background: var(--light);
    border-left: 3px solid var(--primary);
}

.notifications-list {
    max-height: 600px;
    overflow-y: auto;
}

/* Modern Search Popup */
.search-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.2s ease;
}

.search-popup-container {
    background: white;
    border-radius: var(--radius);
    max-width: 600px;
    width: 100%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease;
    overflow: hidden;
}

.search-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
}

.search-popup-header h2 {
    color: white;
    font-size: 1.5rem;
}

.search-popup-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.search-popup-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.search-popup-form {
    padding: 2rem;
}

.search-input-wrapper {
    position: relative;
    margin-bottom: 1.5rem;
}

.search-input-modern {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: var(--transition);
    background: var(--light);
}

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

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.25rem;
    color: var(--secondary);
    pointer-events: none;
}

.search-filters {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.search-filter-label {
    font-weight: 500;
    color: var(--dark);
    white-space: nowrap;
}

.search-filter-select {
    flex: 1;
    min-width: 150px;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    background: white;
    cursor: pointer;
    transition: var(--transition);
}

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

.search-submit-btn {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.search-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Modern Calendar Styles */
.calendar-card {
    padding: 0;
    overflow: hidden;
}

.calendar-container {
    padding: 1.5rem;
    min-height: 600px;
}

.event-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.2s ease;
}

.event-modal-container {
    background: white;
    border-radius: var(--radius);
    max-width: 500px;
    width: 100%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease;
    overflow: hidden;
}

.event-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}

.event-modal-title {
    color: white;
    margin: 0;
    font-size: 1.5rem;
}

.event-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.event-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.event-modal-content {
    padding: 1.5rem;
    max-height: 400px;
    overflow-y: auto;
}

.event-detail-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 1rem;
    background: var(--light);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary);
}

.event-detail-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.event-detail-item div {
    flex: 1;
}

.event-detail-item strong {
    display: block;
    color: var(--dark);
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.event-detail-item p {
    margin: 0;
    color: var(--text);
    font-size: 1rem;
}

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

/* FullCalendar Customization */
.fc {
    font-family: var(--font-english);
}
html[lang="ka"] .fc,
html[lang="ka"] .fc * {
    font-family: var(--font-georgian) !important;
}

.fc-toolbar-title {
    font-size: 1.5rem !important;
    font-weight: 600 !important;
    color: var(--dark) !important;
}

.fc-button {
    background: var(--primary) !important;
    border: none !important;
    border-radius: var(--radius-sm) !important;
    padding: 0.5rem 1rem !important;
    font-weight: 500 !important;
    transition: var(--transition) !important;
}

.fc-button:hover {
    background: var(--primary-dark) !important;
    transform: translateY(-2px) !important;
    box-shadow: var(--shadow) !important;
}

.fc-button-active {
    background: var(--primary-dark) !important;
}

.fc-event {
    border-radius: var(--radius-sm) !important;
    padding: 0.25rem 0.5rem !important;
    border: none !important;
    cursor: pointer !important;
    transition: var(--transition) !important;
}

.fc-event:hover {
    transform: scale(1.05) !important;
    box-shadow: var(--shadow) !important;
}

.fc-daygrid-day-number {
    color: var(--dark) !important;
    font-weight: 500 !important;
}

.fc-col-header-cell {
    background: var(--light) !important;
    padding: 0.75rem 0 !important;
    font-weight: 600 !important;
    color: var(--dark) !important;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .search-popup-container {
        max-width: 100%;
        margin: 0;
        border-radius: var(--radius) var(--radius) 0 0;
    }
    
    .search-popup-header {
        padding: 1rem;
    }
    
    .search-popup-form {
        padding: 1.5rem;
    }
    
    .search-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-filter-select {
        width: 100%;
    }
    
    .calendar-container {
        padding: 0.5rem;
    }
    
    .fc-toolbar {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }
    
    .fc-toolbar-chunk {
        display: flex !important;
        justify-content: center !important;
    }
    
    .fc-button {
        padding: 0.4rem 0.75rem !important;
        font-size: 0.875rem !important;
    }
    
    .event-modal-container {
        max-width: 100%;
        margin: 0;
        border-radius: var(--radius) var(--radius) 0 0;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .event-detail-item {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .grid {
        grid-template-columns: 1fr !important;
    }
    
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr !important;
    }
}

/* Additional Mobile Optimizations */
@media (max-width: 480px) {
    .search-popup-header h2 {
        font-size: 1.25rem;
    }
    
    .search-input-modern {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .fc-toolbar-title {
        font-size: 1.125rem !important;
    }
    
    .fc-button {
        padding: 0.35rem 0.5rem !important;
        font-size: 0.75rem !important;
    }
    
    .event-modal-title {
        font-size: 1.25rem;
    }
    
    .card {
        padding: 1rem;
    }
    
    h1, h2 {
        font-size: 1.5rem;
    }
}

/* User Profile Link */
.user-profile-link {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem;
    border-radius: 50%;
    transition: var(--transition);
}

.user-profile-link:hover {
    background: var(--light);
    transform: scale(1.1);
}

.user-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
    display: block;
}

.btn-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--danger);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: white;
    padding: 0;
}

.btn-logout svg {
    width: 20px;
    height: 20px;
}

.btn-logout:hover {
    background: #dc2626;
    transform: scale(1.05) rotate(5deg);
}

/* Cards */
.card {
    background: white;
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    transition: var(--transition);
    border: 1px solid var(--border);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}
.card h2 {
    margin-bottom: 1.5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    font-size: 0.875rem;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(37, 99, 235, 0.4);
}

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

.btn-secondary:hover {
    background: #475569;
    transform: translateY(-2px);
}

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

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
}

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

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

.btn-icon {
    padding: 0.5rem;
    width: 40px;
    height: 40px;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark);
    font-size: 0.875rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1.125rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: var(--transition);
    background: white;
    font-family: inherit;
    color: var(--dark);
}

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

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: var(--primary-light);
}

.form-group input[type="color"] {
    height: 50px;
    padding: 0.25rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
}

.form-group input[type="datetime-local"] {
    position: relative;
}

.form-group input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.form-group input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Search Bar */
.search-bar {
    position: relative;
    margin-bottom: 1.5rem;
}

.search-bar input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: var(--transition);
}

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

.search-bar::before {
    content: '🔍';
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
}

/* Advanced Filters */
.filters-panel {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.filters-panel.collapsed {
    display: none;
}

.filter-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 0.75rem;
    background: var(--light);
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    transition: var(--transition);
}

.filter-toggle:hover {
    background: #e2e8f0;
}

/* Tables */
.table-wrapper {
    max-width: 100%;
    overflow-x: auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    background: white;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    min-width: 800px;
}

.table thead {
    background: linear-gradient(135deg, var(--light) 0%, #e2e8f0 100%);
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table th {
    font-weight: 600;
    color: var(--dark);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background: var(--light);
    transform: scale(1.01);
}

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

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-new { background: #d1fae5; color: #065f46; }
.badge-assigned { background: #dbeafe; color: #1e40af; }
.badge-contacted { background: #fef3c7; color: #92400e; }
.badge-completed { background: var(--dark); color: white; }
.badge-active { background: var(--success); color: white; }
.badge-inactive { background: var(--secondary); color: white; }

/* Employee type badges */
.badge-agent { background: #dbeafe; color: #1e40af; }
.badge-accountant { background: #fef3c7; color: #92400e; }
.badge-director { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; }

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.3s ease;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 2px solid #10b981;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 2px solid #ef4444;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 2px solid #3b82f6;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 2px solid #f59e0b;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border);
    margin-bottom: 2rem;
    gap: 0.5rem;
    overflow-x: auto;
}

.tab {
    padding: 1rem 2rem;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
    white-space: nowrap;
    font-weight: 500;
    color: var(--secondary);
}

.tab:hover {
    color: var(--primary);
    background: var(--light);
}

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

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

.tab-content.active {
    display: block;
}

/* Grid */
.grid {
    display: grid;
    gap: 1.5rem;
}
.grid > * {
    min-width: 0; /* prevent grid blowout from wide children (tables etc.) */
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid .card { margin-bottom: 0; }

/* Section spacing (dashboard etc.) – overridable in @media */
.section-grid { margin-bottom: 2rem; }

/* Stats Cards */
.stats-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.stats-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* Clickable stats cards */
a.stats-card:hover {
    opacity: 0.95;
}

.stats-card h3 {
    font-size: 2.5rem;
    font-weight: bold;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.stats-card p {
    color: var(--secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.stats-card .icon {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    opacity: 0.1;
}

/* Dashboard header (title + quick-actions row) */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}
.dashboard-header .quick-actions {
    margin-bottom: 0;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: white;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--dark);
    font-weight: 500;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.quick-action-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Export Buttons */
.export-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.export-btn {
    padding: 0.5rem 1rem;
    background: white;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--dark);
    font-weight: 500;
    transition: var(--transition);
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.export-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--light);
}

/* File Upload */
.file-upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    background: var(--light);
}

.file-upload-area:hover {
    border-color: var(--primary);
    background: white;
}

.file-upload-area.dragover {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
}

/* Notifications */
.notification-badge {
    position: relative;
}

.notification-badge::after {
    content: attr(data-count);
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
}

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

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

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

@keyframes countUp {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.card {
    animation: fadeInUp 0.4s ease-out;
}

.table tbody tr {
    animation: slideIn 0.3s ease-out;
    animation-fill-mode: both;
}

.table tbody tr:nth-child(1) { animation-delay: 0.05s; }
.table tbody tr:nth-child(2) { animation-delay: 0.1s; }
.table tbody tr:nth-child(3) { animation-delay: 0.15s; }
.table tbody tr:nth-child(4) { animation-delay: 0.2s; }
.table tbody tr:nth-child(5) { animation-delay: 0.25s; }

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--dark);
    padding: 0.5rem;
    transition: var(--transition);
}

.mobile-menu-toggle:hover {
    color: var(--primary);
    transform: scale(1.1);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .container {
        max-width: 100%;
        padding: 0 15px;
    }
    
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        box-shadow: var(--shadow-lg);
        flex-direction: column;
        padding: 1rem;
        z-index: 1000;
        border-top: 1px solid var(--border);
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .nav-links li {
        width: 100%;
    }
    
    .nav-links .nav-separator {
        display: none;
    }
    
    .nav-links a {
        padding: 0.75rem 1rem;
        border-bottom: 1px solid var(--light);
    }
    
    .navbar {
        position: relative;
    }
    
    .navbar .container {
        flex-wrap: wrap;
    }
    
    .nav-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .nav-left {
        gap: 1rem;
    }
    
    /* Settings dropdown: always show sub-items on mobile (no hover) */
    .nav-links .dropdown .dropdown-menu {
        display: block !important;
        position: static;
        box-shadow: none;
        padding: 0.25rem 0 0.25rem 1rem;
        margin-top: 0;
        min-width: auto;
        border-left: 2px solid var(--border);
        margin-left: 0.5rem;
    }
    .nav-links .dropdown .dropdown-toggle span {
        display: none;
    }
    
    /* Tables as cards on mobile (dashboard etc.) */
    .table-mobile-cards {
        min-width: 0;
    }
    .table-mobile-cards thead {
        display: none;
    }
    .table-mobile-cards tbody tr {
        display: block;
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        padding: 1rem;
        margin-bottom: 1rem;
        background: white;
        box-shadow: var(--shadow);
    }
    .table-mobile-cards tbody tr:hover {
        background: var(--light);
        transform: none;
    }
    .table-mobile-cards tbody tr:last-child {
        margin-bottom: 0;
    }
    .table-mobile-cards td {
        display: block;
        padding: 0.5rem 0;
        border: none;
        border-bottom: 1px solid var(--light);
    }
    .table-mobile-cards td:last-child {
        border-bottom: none;
    }
    .table-mobile-cards td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.75rem;
        text-transform: uppercase;
        color: var(--secondary);
        display: block;
        margin-bottom: 0.25rem;
    }
    .table-mobile-cards td .btn {
        width: 100%;
        justify-content: center;
        margin-top: 0.5rem;
    }
    
    .modern-switcher {
        width: auto;
    }
    
    .section-grid {
        margin-bottom: 1.5rem;
    }
    .grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }
    
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr !important;
    }
    
    .card {
        padding: 1.25rem;
    }
    .card h2 {
        margin-bottom: 1rem;
    }
    
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .table {
        min-width: 600px;
    }
    .table th,
    .table td {
        padding: 0.75rem;
    }
    
    .stats-card {
        padding: 1rem;
    }
    .stats-card h3 {
        font-size: 1.75rem;
    }
    
    .quick-actions {
        flex-direction: column;
    }
    
    .quick-action-btn {
        width: 100%;
        justify-content: center;
    }
    
    .export-buttons {
        flex-direction: column;
    }
    
    .export-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }
    
    .navbar {
        padding: 0.75rem 0;
        margin-bottom: 1.5rem;
    }
    
    .nav-brand {
        font-size: 1.25rem;
    }
    
    .nav-left {
        gap: 0.5rem;
    }
    
    /* Touch targets min 44px (accessibility) */
    .search-icon-btn,
    .notification-icon,
    .user-profile-link,
    .btn-logout {
        min-width: 44px;
        min-height: 44px;
    }
    .btn-logout {
        width: 44px;
        height: 44px;
    }
    
    .section-grid {
        margin-bottom: 1rem;
    }
    .grid {
        gap: 0.75rem;
    }
    
    .card {
        padding: 0.875rem;
    }
    .card h2 {
        margin-bottom: 0.75rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .stats-card {
        padding: 0.875rem;
    }
    .stats-card h3 {
        font-size: 1.35rem;
    }
    
    .dashboard-header {
        margin-bottom: 1.25rem;
        gap: 0.75rem;
    }
    
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .tab {
        padding: 0.75rem 1.25rem;
        font-size: 0.875rem;
    }
}

/* ============================================
   Universal Upload Buttons - Modern Style
   ============================================ */
.upload-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: 2px solid transparent;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    color: #5b6af0;
    box-shadow: 0 2px 8px rgba(91, 106, 240, 0.12), 0 1px 3px rgba(0,0,0,0.08);
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

.upload-btn::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;
}

.upload-btn:hover::before {
    left: 100%;
}

.upload-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(91, 106, 240, 0.25), 0 4px 8px rgba(0,0,0,0.1);
    background: linear-gradient(135deg, #ffffff 0%, #f0f4ff 100%);
    border-color: rgba(91, 106, 240, 0.2);
}

.upload-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(91, 106, 240, 0.2);
}

.upload-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.35), 0 2px 6px rgba(0,0,0,0.1);
}

.upload-btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd6 0%, #6a4190 100%);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.45), 0 4px 10px rgba(0,0,0,0.15);
    border-color: transparent;
}

.upload-btn-secondary {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: #475569;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.upload-btn-secondary:hover {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Upload Area / Dropzone */
.upload-area {
    border: 2px dashed #cbd5e1;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover {
    border-color: #667eea;
    background: linear-gradient(135deg, #f0f4ff 0%, #e8ecff 100%);
}

.upload-area.dragover {
    border-color: #667eea;
    background: linear-gradient(135deg, #e8ecff 0%, #dde4ff 100%);
    transform: scale(1.01);
}

.upload-area-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.upload-area-text {
    color: #64748b;
    font-size: 0.95rem;
}

.upload-area-text strong {
    color: #667eea;
}

.upload-area input[type="file"] {
    display: none;
}

/* Upload Button Group */
.upload-btn-group {
    display: inline-flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    background: rgba(255,255,255,0.9);
    padding: 0.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.upload-btn-group .upload-btn {
    min-width: 110px;
    padding: 0.65rem 1.25rem;
}

/* Selected Media Grid - for forms */
.selected-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 15px;
}

.selected-media-item {
    position: relative;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    transition: var(--transition);
}

.selected-media-item:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.selected-media-item img {
    width: 100%;
    height: 70px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 8px;
}

.selected-media-item .file-icon {
    width: 100%;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 6px;
    margin-bottom: 8px;
}

.selected-media-item .file-icon i {
    font-size: 28px;
    color: #fff;
}

.selected-media-item .file-name {
    display: block;
    font-size: 11px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.selected-media-item .remove-file {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ef4444;
    color: #fff;
    border: 2px solid #fff;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.selected-media-item .remove-file:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.selected-files-list {
    min-height: 50px;
}

/* ============================================
   COMPREHENSIVE MOBILE RESPONSIVE STYLES
   ============================================ */

/* Tablet & Small Desktop (max-width: 1024px) */
@media (max-width: 1024px) {
    .container {
        padding: 0 15px;
    }
    
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile Landscape & Tablet Portrait (max-width: 768px) */
@media (max-width: 768px) {
    /* Container */
    .container {
        padding: 0 12px;
    }
    
    /* Navigation */
    .navbar {
        padding: 0.75rem 0;
        margin-bottom: 1rem;
    }
    
    .nav-container {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .nav-brand {
        font-size: 1rem;
    }
    
    .nav-brand img {
        max-height: 32px;
    }
    
    .nav-links {
        order: 3;
        width: 100%;
        justify-content: flex-start;
        gap: 0.25rem;
        overflow-x: auto;
        padding: 0.5rem 0;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    
    .nav-links::-webkit-scrollbar {
        display: none;
    }
    
    .nav-links a,
    .nav-links .dropdown > a {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .nav-user {
        gap: 0.5rem;
    }
    
    .nav-user .btn {
        padding: 0.35rem 0.5rem;
        font-size: 0.7rem;
    }
    
    .user-avatar {
        width: 32px;
        height: 32px;
    }
    
    /* Cards */
    .card {
        padding: 1rem;
        border-radius: 12px;
        margin-bottom: 1rem;
    }
    
    /* Grids */
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    
    /* Stats Cards */
    .stat-card {
        padding: 1rem;
    }
    
    .stat-card h3 {
        font-size: 1.25rem;
    }
    
    .stat-card p {
        font-size: 0.75rem;
    }
    
    /* Tables - Make Responsive */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -1rem;
        padding: 0 1rem;
    }
    
    .table {
        min-width: 600px;
        font-size: 0.8rem;
    }
    
    .table th,
    .table td {
        padding: 0.6rem 0.5rem;
        white-space: nowrap;
    }
    
    /* Mobile Card Table */
    .mobile-table {
        display: block;
    }
    
    .mobile-table thead {
        display: none;
    }
    
    .mobile-table tbody tr {
        display: block;
        margin-bottom: 1rem;
        background: white;
        border-radius: 12px;
        padding: 1rem;
        box-shadow: var(--shadow);
    }
    
    .mobile-table tbody td {
        display: flex;
        justify-content: space-between;
        padding: 0.5rem 0;
        border: none;
        border-bottom: 1px solid var(--border);
    }
    
    .mobile-table tbody td:last-child {
        border-bottom: none;
    }
    
    .mobile-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--secondary);
        font-size: 0.75rem;
        text-transform: uppercase;
    }
    
    /* Forms */
    .form-group {
        margin-bottom: 0.75rem;
    }
    
    .form-group label {
        font-size: 0.8rem;
        margin-bottom: 0.35rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.7rem 0.9rem;
        font-size: 16px; /* Prevents zoom on iOS */
        border-radius: 8px;
    }
    
    /* Buttons */
    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
        border-radius: 8px;
    }
    
    .btn-sm {
        padding: 0.4rem 0.7rem;
        font-size: 0.75rem;
    }
    
    /* Page Headers */
    .page-header,
    [style*="display: flex"][style*="justify-content: space-between"] {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch !important;
    }
    
    .page-header h2,
    .card > div:first-child h2 {
        font-size: 1.25rem;
    }
    
    /* Filters */
    .filters-row,
    .filter-group {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .filter-group > * {
        width: 100%;
    }
    
    /* Headings */
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1.1rem; }
    
    /* Lead/Client Cards */
    .lead-card,
    .client-card {
        padding: 1rem;
    }
    
    /* Tabs */
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        gap: 0;
        padding-bottom: 2px;
    }
    
    .tabs::-webkit-scrollbar {
        display: none;
    }
    
    .tab-btn {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    /* Modals */
    .modal-content {
        width: 95%;
        max-width: 95%;
        margin: 10px;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    /* Badges */
    .badge,
    .status-badge {
        font-size: 0.65rem;
        padding: 0.25rem 0.5rem;
    }
    
    /* Action Buttons */
    .action-buttons,
    .btn-group {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .action-buttons .btn {
        flex: 1;
        min-width: 100px;
        justify-content: center;
    }
    
    /* Quick Actions */
    .quick-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .quick-actions .btn {
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
    }
    
    /* Dashboard */
    .dashboard-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .summary-cards {
        grid-template-columns: 1fr 1fr;
    }
    
    .summary-card {
        padding: 1rem;
    }
    
    .summary-card .amount {
        font-size: 1.25rem;
    }
    
    /* Charts */
    .chart-container {
        height: 250px !important;
    }
    
    /* Upload Buttons */
    .upload-btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .upload-btn-group .upload-btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Selected Media Grid */
    .selected-media-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .selected-media-item img,
    .selected-media-item .file-icon {
        height: 50px;
    }
    
    /* Dropdown */
    .dropdown-menu {
        min-width: 180px;
        right: 0;
        left: auto;
    }
    
    /* Settings Tabs */
    .settings-tabs {
        flex-direction: column;
    }
    
    .settings-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    
    .settings-content {
        padding: 1rem;
    }
}

/* Mobile Portrait (max-width: 480px) */
@media (max-width: 480px) {
    /* Container */
    .container {
        padding: 0 8px;
    }
    
    /* Navigation */
    .navbar {
        padding: 0.5rem 0;
    }
    
    .nav-brand {
        font-size: 0.9rem;
    }
    
    .nav-brand img {
        max-height: 28px;
    }
    
    .nav-links a,
    .nav-links .dropdown > a {
        padding: 0.35rem 0.5rem;
        font-size: 0.7rem;
    }
    
    .nav-user .btn {
        padding: 0.3rem 0.4rem;
        font-size: 0.65rem;
    }
    
    .user-avatar {
        width: 28px;
        height: 28px;
    }
    
    /* Cards */
    .card {
        padding: 0.75rem;
        border-radius: 10px;
    }
    
    /* Stats */
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 0.75rem;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .stat-card .stat-icon {
        font-size: 1.5rem;
    }
    
    .stat-card h3 {
        font-size: 1.1rem;
        margin: 0;
    }
    
    .stat-card p {
        font-size: 0.7rem;
    }
    
    /* Summary Cards */
    .summary-cards {
        grid-template-columns: 1fr;
    }
    
    /* Tables */
    .table {
        font-size: 0.75rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem 0.35rem;
    }
    
    /* Forms */
    .form-group label {
        font-size: 0.75rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.6rem 0.75rem;
    }
    
    /* Buttons */
    .btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
    }
    
    /* Page Headers */
    .page-header h2,
    .card > div:first-child h2,
    h2 {
        font-size: 1.1rem;
    }
    
    /* Headings */
    h1 { font-size: 1.25rem; }
    h3 { font-size: 1rem; }
    
    /* Tabs */
    .tab-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }
    
    /* Modals */
    .modal-content {
        margin: 5px;
        border-radius: 12px;
    }
    
    .modal-header {
        padding: 0.75rem 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    /* Badges */
    .badge,
    .status-badge {
        font-size: 0.6rem;
        padding: 0.2rem 0.4rem;
    }
    
    /* Action Buttons */
    .action-buttons .btn {
        width: 100%;
        min-width: auto;
    }
    
    /* Quick Actions */
    .quick-actions {
        flex-direction: column;
    }
    
    .quick-actions .btn {
        width: 100%;
        text-align: center;
    }
    
    /* Selected Media */
    .selected-media-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Info Cards */
    .info-row {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .info-row .info-label {
        font-size: 0.7rem;
    }
    
    .info-row .info-value {
        font-size: 0.85rem;
    }
    
    /* Lead Show Page */
    .lead-header {
        flex-direction: column;
        text-align: center;
    }
    
    .lead-meta {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }
    
    /* Offers/Invoices List */
    .offer-card,
    .invoice-card {
        padding: 0.75rem;
    }
    
    .offer-header,
    .invoice-header {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    /* Media Picker Modal */
    #mediaPickerModal > div {
        width: 100% !important;
        max-width: 100% !important;
        height: 100vh !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        margin: 0 !important;
    }
    
    #mediaPickerGrid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
    }
    
    /* Profile Page */
    .profile-container {
        padding: 0.75rem;
    }
    
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-avatar {
        width: 80px;
        height: 80px;
    }
    
    /* Reports Page */
    .report-section {
        margin-bottom: 1rem;
    }
    
    .modern-table {
        font-size: 0.75rem;
    }
    
    /* Calendar */
    .fc-toolbar {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .fc-toolbar-title {
        font-size: 1rem !important;
    }
    
    .fc-button {
        padding: 0.3rem 0.5rem !important;
        font-size: 0.7rem !important;
    }
    
    /* Footer */
    footer {
        padding: 1rem;
        font-size: 0.75rem;
    }
}

/* Extra Small Screens (max-width: 360px) */
@media (max-width: 360px) {
    .container {
        padding: 0 5px;
    }
    
    .card {
        padding: 0.5rem;
    }
    
    .nav-brand {
        font-size: 0.8rem;
    }
    
    .nav-links a {
        padding: 0.3rem 0.4rem;
        font-size: 0.65rem;
    }
    
    h1 { font-size: 1.1rem; }
    h2 { font-size: 1rem; }
    h3 { font-size: 0.9rem; }
    
    .btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.5rem 0.6rem;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .nav-links a,
    .tab-btn {
        min-height: 40px;
        display: flex;
        align-items: center;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        min-height: 44px;
    }
    
    /* Remove hover effects on touch */
    .btn:hover,
    .card:hover,
    .nav-links a:hover {
        transform: none;
    }
    
    /* Active states instead */
    .btn:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
}

/* Landscape Mode on Mobile */
@media (max-width: 896px) and (orientation: landscape) {
    .navbar {
        padding: 0.4rem 0;
    }
    
    .nav-links {
        padding: 0.25rem 0;
    }
    
    .card {
        padding: 0.75rem;
    }
    
    .modal-content {
        max-height: 95vh;
    }
    
    #mediaPickerModal > div {
        height: 95vh !important;
    }
}

/* High DPI Screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .card {
        border-width: 0.5px;
    }
    
    .table th,
    .table td {
        border-width: 0.5px;
    }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles if needed */
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .btn,
    .quick-actions,
    .export-buttons {
        display: none;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px;
    }
}
