@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ============================================================================
   CSS VARIABLES & RESET
   ============================================================================ */

:root {
    --sidebar-w: 260px;

    /* Colors */
    --primary-color: #4a90e2;
    --primary-gradient: linear-gradient(45deg, #4a90e2, #667eea);
    --success-color: #4CAF50;
    --success-gradient: linear-gradient(45deg, #4CAF50, #66BB6A);
    --warning-color: #FF9800;
    --warning-gradient: linear-gradient(45deg, #FF9800, #FFB74D);
    --danger-color: #f44336;
    --danger-gradient: linear-gradient(45deg, #f44336, #ef5350);
    --secondary-color: #6c757d;

    /* Neutral Colors */
    --white: #ffffff;
    --gray-50: #f8f9fa;
    --gray-100: #f1f3f4;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;

    /* Semantic Colors */
    --text-primary: #333;
    --text-secondary: #666;
    --text-muted: #999;
    --border-color: #e0e0e0;
    --background: #f5f7fa;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 8px 32px rgba(0, 0, 0, 0.1);

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 10px;
    --radius-xl: 12px;
    --radius-full: 50%;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding-top: var(--header-h);
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* ============================================================================
   LAYOUT COMPONENTS
   ============================================================================ */

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    position: fixed;
    left: var(--spacing-md);
    top: var(--spacing-md);
    width: var(--sidebar-w);
    height: calc(100vh - calc(var(--spacing-md) * 2));
    background: linear-gradient(135deg, #4a90e2 0%, #667eea 100%);
    box-shadow: 0 8px 32px rgba(74, 144, 226, 0.3);
    overflow-y: auto;
    z-index: 999;
    color: var(--white);
    border-radius: 12px;
    /* Prevent flicker during scroll */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Sidebar Logo */
.sidebar-logo {
    padding: 0.5rem 1rem;
    margin: 0.5rem 0.75rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sidebar-logo #companyName {
    color: var(--white);
}

/* Sidebar User Section */
.sidebar-user {
    padding: 0.75rem;
    margin: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: background 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sidebar-user:hover {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.user-info-compact {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-icon {
    font-size: 2rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-role {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-name {
    font-weight: 600;
    color: var(--white);
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-arrow {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
    transition: transform var(--transition-fast);
}

.sidebar-user.active .dropdown-arrow {
    transform: rotate(180deg);
}

.user-dropdown {
    display: none;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-dropdown.show {
    display: block;
}

.user-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    font-size: 0.9rem;
}

.user-dropdown .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
}

.user-dropdown .dropdown-item:last-child:hover {
    background: var(--danger-color);
}

.user-dropdown .dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0.5rem 0;
}

/* Language Submenu */
.dropdown-submenu-trigger {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    font-size: 0.9rem;
}

.dropdown-submenu-trigger:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
}

.language-submenu {
    display: none;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-md);
}

.language-submenu.show {
    display: flex !important;
}

.language-submenu .dropdown-item {
    padding: 0.5rem;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.language-submenu .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

/* Sidebar Bottom Section */
.sidebar-bottom {
    margin-top: auto;
    padding: 0;
    font-size: 0.8rem;
}

.sidebar-section {
    margin: 0.5rem 0.75rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: background 0.3s ease;
}

.sidebar-section:hover {
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sidebar-section:last-child {
    margin-bottom: 0.75rem;
}

.sidebar-section-title {
    font-weight: 600;
    color: var(--white);
    margin-bottom: 0.75rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-section-title::before {
    content: '';
    width: 3px;
    height: 12px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.3));
    border-radius: 2px;
}

.sidebar-info-item {
    color: rgba(255, 255, 255, 0.8);
    padding: 0.4rem 0;
    font-size: 0.75rem;
    line-height: 1.6;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.sidebar-info-item:hover {
    color: rgba(255, 255, 255, 1);
    padding-left: 0.25rem;
}

.nav-menu {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding-bottom: 0.5rem;
    padding-top: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.6rem var(--spacing-lg);
    margin: 0.15rem 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(135deg, #64B5F6, #2196F3);
    transform: scaleY(0);
    transition: transform 0.3s ease;
    border-radius: 0 2px 2px 0;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--white);
    transform: translateX(4px);
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.18);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-item.active::before {
    transform: scaleY(1);
}

.nav-icon {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    vertical-align: middle;
    opacity: 0.9;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
    opacity: 1;
    transform: scale(1.1);
}

.nav-item:not(.active) .nav-icon {
    opacity: 0.75;
}

.nav-item.active .nav-icon {
    color: white;
}

/* Expandable Settings Menu */
.nav-item-group {
    margin: 0.15rem 0.75rem;
}

.nav-item-parent {
    position: relative;
    justify-content: space-between;
    margin: 0;
}

.nav-arrow {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
    opacity: 0.7;
    margin-left: auto;
    padding-left: 0.5rem;
}

.nav-item-parent.expanded .nav-arrow {
    transform: rotate(-180deg);
}

.nav-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 0;
    border-radius: 10px;
}

.nav-submenu.expanded {
    max-height: 1000px;
    margin-top: 0.25rem;
    margin-left: 1rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.5rem 0;
}

.nav-subitem {
    display: flex;
    align-items: center;
    padding: 0.45rem 1rem;
    margin: 0.1rem 0.5rem;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.88rem;
    transition: all 0.2s ease;
    position: relative;
}

.nav-subitem .nav-icon {
    width: 16px;
    height: 16px;
    margin-right: 10px;
    opacity: 0.8;
}

.nav-subitem:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.95);
    transform: translateX(4px);
}

.nav-subitem:hover .nav-icon {
    opacity: 1;
    transform: scale(1.1);
}

.nav-subitem.active {
    background: rgba(255, 255, 255, 0.12);
    color: var(--white);
    border-left: 2px solid rgba(100, 181, 246, 0.8);
}

.nav-subitem.active .nav-icon {
    color: rgba(100, 181, 246, 1);
    opacity: 1;
}

/* Nested submenu parent styling */
.nav-subitem-parent {
    display: flex;
    align-items: center;
    padding: 0.45rem 1rem;
    margin: 0.1rem 0.5rem;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.88rem;
    transition: all 0.2s ease;
    position: relative;
    cursor: pointer;
    justify-content: space-between;
}

.nav-subitem-parent:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.95);
    transform: translateX(4px);
}

.nav-subitem-parent .nav-arrow {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
    margin-left: auto;
}

.nav-subitem-parent.expanded .nav-arrow {
    transform: rotate(-180deg);
}

/* Nested submenu container */
.nav-nested-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 0;
}

.nav-nested-submenu.expanded {
    max-height: 300px;
    margin-top: 0.25rem;
    margin-left: 0.5rem;
    padding-left: 1rem;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-nested-subitem {
    display: flex;
    align-items: center;
    padding: 0.4rem 0.75rem;
    margin: 0.1rem 0;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.nav-nested-subitem .nav-icon {
    width: 14px;
    height: 14px;
    margin-right: 8px;
    opacity: 0.7;
}

.nav-nested-subitem:hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
    transform: translateX(3px);
}

.nav-nested-subitem.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border-left: 2px solid rgba(100, 181, 246, 0.6);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
}

.mobile-only-items {
    display: none;
    margin-bottom: var(--spacing-xl);
    border-top: 1px solid var(--border-color);
    padding-top: var(--spacing-md);
    flex-shrink: 0;
}

.mobile-only-items .mobile-agent-info {
    background: rgba(74, 144, 226, 0.1) !important;
    color: var(--primary-color) !important;
    border-left-color: var(--primary-color) !important;
    font-weight: 600;
    cursor: default;
}

.mobile-only-items .nav-item:last-child {
    text-align: center;
    justify-content: center;
    display: flex;
    align-items: center;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-w);
    padding: var(--spacing-md) var(--spacing-xl);
    flex: 1;
    min-height: 100vh;
    width: calc(100vw - var(--sidebar-w));
    max-width: calc(100vw - var(--sidebar-w));
    overflow-x: hidden;
    /* Prevent flicker during scroll */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* ============================================================================
   COMMON COMPONENTS
   ============================================================================ */

/* Buttons */
.btn {
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    transition: all var(--transition-normal);
    white-space: nowrap;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #4a90e2, #667eea);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.3);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(74, 144, 226, 0.4);
    background: linear-gradient(135deg, #357abd, #5a67d8);
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #34d399);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    transition: all 0.3s ease;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
    background: linear-gradient(135deg, #059669, #10b981);
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
    transition: all 0.3s ease;
    font-weight: 600;
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4);
    background: linear-gradient(135deg, #d97706, #f59e0b);
}

.btn-danger {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
    transition: all 0.3s ease;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.4);
    background: linear-gradient(135deg, #b91c1c, #dc2626);
}

.btn-secondary {
    background: linear-gradient(135deg, #6b7280, #9ca3af);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(107, 114, 128, 0.3);
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(107, 114, 128, 0.4);
    background: linear-gradient(135deg, #4b5563, #6b7280);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.875rem;
    margin: 0 2px;
}

/* Button Icons */
.btn svg {
    display: inline-block;
    vertical-align: middle;
    margin-right: 0.5rem;
}

.btn-sm svg {
    width: 14px;
    height: 14px;
    margin-right: 0.35rem;
}

/* Container for Save All Settings */
.settings-save-container {
    background: #fff;
    padding: 1rem 1.5rem;
    padding-top: 0;
    border-radius: var(--radius-lg);
    box-shadow: none;
    text-align: right;
    /* aligns button to the right */
    margin-top: var(--spacing-lg);
    /* space above */
}

/* Save Button */
.settings-save-btn {
    background: #28a745;
    /* green */
    color: #fff;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Status Badges */
.status-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
}

.status-confirmed,
.status-active {
    background: #e8f5e8;
    color: #2e7d32;
}

.status-pending {
    background: #fff3e0;
    color: #f57c00;
}

.status-cancelled,
.status-inactive {
    background: #ffebee;
    color: #c62828;
}

.status-completed {
    background: #e3f2fd;
    color: #1976d2;
}

.status-new {
    background: #e3f2fd;
    color: #1976d2;
}

.status-progress {
    background: #fff3e0;
    color: #f57c00;
}

.status-waiting {
    background: #f3e5f5;
    color: #7b1fa2;
}

.status-resolved {
    background: #e8f5e8;
    color: #2e7d32;
}

.status-closed {
    background: #f5f5f5;
    color: #616161;
}

.status-sent {
    background: #e8f5e8;
    color: #2e7d32;
}

.status-failed,
.status-error {
    background: #ffebee;
    color: #c62828;
}


/* Role Badges */
.role-badge {
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-xl);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* Template Badges */
.template-badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    border: 1px solid #bbdefb;
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.template-badge.scheduled-report {
    background: #e8f5e8;
    color: #2e7d32;
    border-color: #c8e6c9;
}

.template-badge.booking-confirmation {
    background: #e3f2fd;
    color: #1976d2;
    border-color: #bbdefb;
}

.template-badge.wordpress-booking {
    background: #fff3e0;
    color: #f57c00;
    border-color: #ffcc02;
}

.template-badge.test-email {
    background: #f3e5f5;
    color: #7b1fa2;
    border-color: #ce93d8;
}

/* Page Structure */
.page-section {
    display: none;
}

.page-section.active {
    display: block;
}

.page-header {
    background: #ffffff;
    padding: 24px 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(230, 230, 230, 0.5);
    margin-bottom: var(--spacing-xl);
}

.page-title {
    font-size: 1.8rem;
    margin-bottom: var(--spacing-sm);
    color: #1a1a1a;
    font-weight: 700;
}

.page-subtitle {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.95rem;
}

.content-section .page-subtitle {
    padding: 0 var(--spacing-lg) 0 var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
}

/* Content Sections */
.content-section {
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    margin-bottom: var(--spacing-xl);
    overflow: hidden;
    width: 100%;
    border: 1px solid rgba(230, 230, 230, 0.5);
}

.section-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.03), rgba(74, 144, 226, 0.03));
}

.section-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.section-actions {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
}

/* ============================================================================
   FORMS & INPUTS
   ============================================================================ */

.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea,
.form-control {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    font-family: inherit;
    background: #ffffff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.form-control:focus {
    outline: none;
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: rgba(255, 255, 255, 1);
    transform: translateY(-1px);
}

/* Style calendar icon in date inputs */
.form-group input[type="date"]::-webkit-calendar-picker-indicator,
input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

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

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    padding: var(--spacing-lg);
}

.form-row {
    display: flex;
    gap: var(--spacing-md);
}

.form-row .form-group {
    flex: 1;
}

.form-check {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

/* Search & Filters */
.filters {
    background: var(--white);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--spacing-xl);
    width: 100%;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    align-items: end;
}

.search-bar {
    position: relative;
    margin-bottom: var(--spacing-md);
}

.search-input {
    width: 100%;
    padding: 0.8rem 2.5rem 0.8rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
}

.search-icon {
    position: absolute;
    right: var(--spacing-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
    transition: color 0.3s ease;
}

.search-input:focus ~ .search-icon {
    color: var(--primary-color);
}

/* Customer Search */
.customer-search {
    position: relative;
}

.customer-search-row {
    display: block;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.search-result-item {
    padding: 0.8rem;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

.search-result-item:hover {
    background: var(--gray-50);
}

/* Participant Counter */
.participant-counter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    background: rgba(102, 126, 234, 0.08);
    padding: var(--spacing-sm);
    border-radius: var(--radius-md);
    border: 1px solid rgba(102, 126, 234, 0.15);
}

.counter-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: var(--white);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.counter-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

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

.counter-value {
    min-width: 40px;
    text-align: center;
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--text-primary);
}

/* ============================================================================
   TABLES
   ============================================================================ */

.table-container {
    overflow-x: auto;
    margin-top: 0;
    padding-top: 0;
}

.content-section .table-container {
    padding: 0 var(--spacing-lg) var(--spacing-lg) var(--spacing-lg);
}

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

.data-table th,
.data-table td {
    padding: var(--spacing-md);
    text-align: left;
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
    word-wrap: break-word;
}

.data-table th {
    border-top: none;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.12), rgba(74, 144, 226, 0.12));
    font-weight: 600;
    color: #1a1a1a;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 2px solid rgba(102, 126, 234, 0.2);
}

.data-table tr:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.03), rgba(74, 144, 226, 0.03));
    transition: all 0.3s ease;
}

/* Table Actions Column - align with filter bar buttons */
/* Only apply to tables within bookings and customers sections */
#bookings .data-table td:last-child,
#customers .data-table td:last-child,
#log-settings .data-table td:last-child,
#service-extras .data-table td:last-child {
    text-align: right;
    width: auto;
    min-width: 180px;
    padding-right: 0;
}

#bookings .data-table th:last-child,
#customers .data-table th:last-child {
    text-align: left;
    width: auto;
    min-width: 180px;
    padding-right: 0;
}

/* Sortable Table Headers */
.data-table th.sortable {
    position: relative;
    transition: background-color 0.2s ease;
    white-space: nowrap;
    vertical-align: middle;
}

.data-table th.sortable:hover {
    background-color: rgba(102, 126, 234, 0.08);
}

.data-table th.sortable:active {
    background-color: rgba(102, 126, 234, 0.15);
}

.sort-indicator {
    display: inline-block;
    margin-left: 4px;
    color: #667eea;
    font-size: 0.75rem;
    vertical-align: middle;
}

/* Ensure all table headers are aligned properly */
.data-table th {
    white-space: nowrap;
    vertical-align: middle;
    padding: 0.75rem 1rem;
}

/* Email Logs Specific */
.email-date-time {
    min-width: 140px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 0.85rem;
}

.email-date {
    font-weight: 700;
    color: #2c3e50;
    display: block;
    margin-bottom: 4px;
    font-size: 0.9rem;
}

.email-time {
    color: #7f8c8d;
    font-size: 0.8rem;
    font-weight: 500;
}

.email-subject {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.email-recipient {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    color: var(--gray-700);
    font-size: 0.85rem;
}

.booking-id,
.booking-link {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    cursor: pointer;
}

.booking-link:hover,
.booking-id:hover {
    color: #357abd;
    text-decoration: underline;
}

#log-settings .date-range-inputs {
    display: flex;
    gap: 0.5rem;
}

/* Fix filter alignment in Email Logs */
#log-settings .filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    align-items: end;
}


/* ============================================================================
   STATS & DASHBOARD
   ============================================================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
    width: 100%;
}

/* Force 4-column layout on desktop screens */
@media (min-width: 769px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }

    /* Gallery management - 3 cards full width */
    #gallery-management .stats-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

.stat-card {
    background: #ffffff;
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(230, 230, 230, 0.5);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    min-height: 100px;
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.stat-card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    transition: all 0.3s ease;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--white);
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.stat-card:hover .stat-icon {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.stat-icon.bookings {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.stat-card:has(.stat-icon.bookings)::before {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.stat-icon.revenue {
    background: linear-gradient(135deg, #f093fb, #f5576c);
}

.stat-card:has(.stat-icon.revenue)::before {
    background: linear-gradient(135deg, #f093fb, #f5576c);
}

.stat-icon.customers {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
}

.stat-card:has(.stat-icon.customers)::before {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
}

.stat-icon.tours {
    background: linear-gradient(135deg, #43e97b, #38f9d7);
}

.stat-card:has(.stat-icon.tours)::before {
    background: linear-gradient(135deg, #43e97b, #38f9d7);
}

.stat-icon.messages {
    background: linear-gradient(135deg, #fa709a, #fee140);
}

.stat-card:has(.stat-icon.messages)::before {
    background: linear-gradient(135deg, #fa709a, #fee140);
}

.stat-info {
    flex: 1;
    min-width: 0;
}

.stat-info h3 {
    font-size: 2rem;
    margin-bottom: 0.2rem;
    color: var(--text-primary);
    word-wrap: break-word;
}

.stat-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

/* Modern Dashboard Components */
.modern-dashboard-header {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 24px 32px;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(230, 230, 230, 0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modern-page-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 4px 0;
}

.modern-page-subtitle {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.notifications-icon {
    position: relative;
    width: 44px;
    height: 44px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: #667eea;
}

.notifications-icon:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: translateY(-1px);
}

.notification-dot {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    background: #ff4757;
    border-radius: var(--radius-full);
    display: none; /* Hidden by default, shown when count > 0 */
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 11px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.4);
}

.notification-dot.has-notifications {
    display: flex;
}

/* Wobble animation for notification bell */
@keyframes wobble {
    0% { transform: rotate(0deg); }
    15% { transform: rotate(15deg); }
    30% { transform: rotate(-12deg); }
    45% { transform: rotate(9deg); }
    60% { transform: rotate(-6deg); }
    75% { transform: rotate(3deg); }
    100% { transform: rotate(0deg); }
}

.notifications-icon.has-unread {
    animation: wobble 1s ease-in-out;
    animation-iteration-count: 3;
}

.notifications-icon.has-unread:hover {
    animation: none;
}

/* Super Admin Home Button */
.super-admin-home-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin: 8px 16px;
    border-radius: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    transition: all var(--transition-fast);
    color: white;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    font-weight: 600;
    font-size: 14px;
}

.super-admin-home-btn:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
}

.super-admin-home-btn:active {
    transform: translateX(2px);
}

.super-admin-home-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.modern-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.modern-stat-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(230, 230, 230, 0.5);
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.modern-stat-card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.modern-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--accent-gradient);
}

.bookings-card {
    --accent-gradient: linear-gradient(135deg, #667eea, #764ba2);
}

.revenue-card {
    --accent-gradient: linear-gradient(135deg, #f093fb, #f5576c);
}

.customers-card {
    --accent-gradient: linear-gradient(135deg, #4facfe, #00f2fe);
}

.tours-card {
    --accent-gradient: linear-gradient(135deg, #43e97b, #38f9d7);
}

.stat-card-content {
    position: relative;
    z-index: 2;
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.stat-icon-modern {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    background: var(--accent-gradient);
}

.stat-trend {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 8px;
}

.stat-trend.positive {
    color: #27ae60;
    background: rgba(39, 174, 96, 0.1);
}

.stat-trend.negative {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

.stat-main {
    margin-bottom: 12px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1;
    margin: 0 0 8px 0;
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 500;
}

.stat-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Charts */
.modern-charts-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.modern-chart-card,
.modern-activity-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(230, 230, 230, 0.5);
    font-family: 'Inter', sans-serif;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.chart-title,
.activity-title {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

.chart-filters {
    display: flex;
    gap: 8px;
}

.filter-btn {
    padding: 8px 16px;
    border: none;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: 'Inter', sans-serif;
}

.filter-btn.active,
.filter-btn:hover {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: var(--white);
}

.chart-content {
    display: flex;
    flex-direction: column;
    /* Stack chart + summary */
    gap: var(--spacing-md);
    /* Small spacing only */
}

.chart-placeholder {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
}

.revenue-chart {
    width: 100%;
    height: 100%;
}

.chart-summary {
    margin: 0;
    /* Kill unwanted space */
    padding: var(--spacing-md);
    background: var(--gray-50);
    border-radius: var(--radius-md);

    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chart-summary>div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.chart-summary .summary-item {
    flex: 1;
    min-width: 120px;
    text-align: center;
}

.chart-summary .summary-item .summary-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.chart-summary .summary-item .summary-value {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--text-primary);
}

/* Activity Feed */
.activity-header {
    margin-bottom: 24px;
}

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

.activity-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: rgba(248, 249, 250, 0.8);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
}

.activity-item:hover {
    background: rgba(102, 126, 234, 0.05);
    transform: translateX(4px);
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
}

.activity-icon.booking {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.activity-icon.payment {
    background: linear-gradient(135deg, #f093fb, #f5576c);
}

.activity-icon.customer {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
}

.activity-content {
    flex: 1;
}

.activity-text {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.activity-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
}

.activity-time {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Quick Actions */
.modern-quick-actions {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(230, 230, 230, 0.5);
    margin-bottom: 24px;
    font-family: 'Inter', sans-serif;
}

.quick-actions-title {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 20px 0;
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.modern-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    color: #667eea;
    font-weight: 600;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
}

.modern-action-btn:hover {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: var(--white);
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.action-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    transition: all var(--transition-normal);
}

.modern-action-btn:hover .action-icon {
    background: rgba(255, 255, 255, 0.2);
}

/* ============================================================================
   MODERN PAGE COMPONENTS (Applied to all pages)
   ============================================================================ */

/* Modern Page Container */
.modern-page-container {
    max-width: 100%;
}

/* Modern Page Header - Applied to Calendar, Bookings, Customers, etc. */
.modern-page-header {
    background: #ffffff;
    padding: 24px 32px;
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(230, 230, 230, 0.5);
}

.modern-page-header h2,
.modern-page-header h3 {
    margin: 0;
    font-weight: 700;
    color: #1a1a1a;
}

.modern-page-header p {
    margin: 4px 0 0 0;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Modern Content Card */
.modern-content-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(230, 230, 230, 0.5);
    margin-bottom: 24px;
}

/* Modern Table Container */
.modern-table-container {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.modern-table-container table {
    margin: 0;
    border-radius: 0;
}

/* Modern Section Header */
.modern-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modern-section-title {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

/* Modern Filter Bar */
.modern-filter-bar {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(230, 230, 230, 0.5);
}

.modern-filter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1.5fr;
    gap: 16px;
    align-items: end;
}

.modern-filter-grid .form-group:last-child {
    justify-self: stretch;
}

/* Bookings page - 5 column layout to fit all filters in one row */
#bookings .modern-filter-grid {
    grid-template-columns: 2fr 120px 130px 130px auto;
    gap: 12px;
}

#bookings .modern-filter-grid input[type="date"] {
    width: 130px;
    min-width: 130px;
}

/* Invoices page - stretch filters to full width */
#invoices .modern-filter-grid {
    grid-template-columns: 1fr 1fr 2fr auto;
}

#invoices .modern-filter-grid .form-group:last-child {
    white-space: nowrap;
}

.modern-filter-bar .form-group input,
.modern-filter-bar .form-group select {
    background: #ffffff;
    border: 1px solid rgba(102, 126, 234, 0.2);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.modern-filter-bar .form-group input:focus,
.modern-filter-bar .form-group select:focus {
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.modern-filter-bar .form-group label {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

/* Make it responsive */
@media (max-width: 1200px) {
    .modern-filter-grid {
        grid-template-columns: 2fr 1fr 1fr 1fr;
    }

    /* Bookings page - stack buttons below on medium screens */
    #bookings .modern-filter-grid {
        grid-template-columns: 2fr 1fr 1fr 1fr;
    }

    #bookings .modern-filter-grid .form-group:last-child {
        grid-column: span 4;
    }
}

@media (max-width: 968px) {
    .modern-filter-grid {
        grid-template-columns: 1fr 1fr;
    }

    #bookings .modern-filter-grid {
        grid-template-columns: 1fr 1fr;
    }

    #bookings .modern-filter-grid .form-group:last-child {
        grid-column: span 2;
    }
}

@media (max-width: 640px) {
    .modern-filter-grid {
        grid-template-columns: 1fr;
    }

    #bookings .modern-filter-grid {
        grid-template-columns: 1fr;
    }

    #bookings .modern-filter-grid .form-group:last-child {
        grid-column: span 1;
    }

    #bookings .modern-filter-grid input[type="date"] {
        width: 100%;
        min-width: unset;
    }
}

/* ============================================================================
   TOURS & CONTENT CARDS
   ============================================================================ */

.tour-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(230, 230, 230, 0.5);
    margin-bottom: var(--spacing-lg);
    position: relative;
    transition: box-shadow 0.3s ease;
}

.tour-card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.tour-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    transition: all 0.3s ease;
}

.tour-card-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    background: rgba(102, 126, 234, 0.03);
}

.tour-card-header h3 {
    color: var(--text-primary);
    font-weight: 600;
    margin: 0;
}

.tour-card-title-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tour-id-badge {
    background: rgba(107, 114, 128, 0.15);
    color: #6b7280;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    font-family: monospace;
}

.tour-card-badges {
    display: flex;
    align-items: center;
}

.tour-card-category {
    color: #666;
    margin: 0;
    width: 100%;
    font-size: 0.9rem;
}

.tour-card-body {
    padding: var(--spacing-lg);
}

.tour-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
}

.info-item {
    display: flex;
    flex-direction: column;
    padding: 0.75rem;
    background: rgba(102, 126, 234, 0.05);
    border-radius: var(--radius-md);
    border: 1px solid rgba(102, 126, 234, 0.1);
    transition: all 0.3s ease;
}

.info-item:hover {
    background: rgba(102, 126, 234, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.info-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.info-value {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.05rem;
}

/* ============================================================================
   MODALS
   ============================================================================ */

.modal,
.settings-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    will-change: opacity;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    /* Flexbox centering for modal content */
    justify-content: center;
    align-items: center;
    padding: 1rem;
    box-sizing: border-box;
    overflow-y: auto;
}

/* When modal is shown, ensure flex centering is applied */
.modal[style*="display: block"],
.modal[style*="display:block"],
.modal[style*="display: flex"],
.modal[style*="display:flex"],
.settings-modal[style*="display: block"],
.settings-modal[style*="display:block"],
.settings-modal[style*="display: flex"],
.settings-modal[style*="display:flex"] {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

.modal-overlay {
    display: flex;
    position: fixed;
    z-index: 1999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
    padding: 1rem;
    box-sizing: border-box;
    overflow-y: auto;
}

.modal-content {
    background: #ffffff;
    margin: auto;
    padding: 0;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(230, 230, 230, 0.8);
    will-change: transform, opacity;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    /* Prevent modal from shrinking */
    flex-shrink: 0;
}

.modal-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--gray-50);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.close {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: var(--spacing-sm);
    background: none;
    border: none;
}

.close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: var(--spacing-xl);
}

/* Add Customer Modal - Desktop Styling */
#addCustomerModal .modal-content {
    max-width: 700px;
}

#addCustomerModal .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    padding: 0;
}

#addCustomerModal .form-group {
    margin-bottom: 0;
}

#addCustomerModal form > div[style*="display: flex"] {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

#addCustomerModal form > div[style*="display: flex"] .btn {
    min-width: 140px;
}

/* Edit Customer Modal - Desktop Styling */
#editCustomerModal .modal-content {
    max-width: 700px;
}

#editCustomerModal .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    padding: 0;
}

#editCustomerModal .form-group {
    margin-bottom: 0;
}

#editCustomerModal form > div[style*="display: flex"] {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

#editCustomerModal form > div[style*="display: flex"] .btn {
    min-width: 140px;
}

/* User Modal - Desktop Styling */
#userModal .modal-content {
    max-width: 700px;
}

#userModal .modal-body {
    padding: 1.5rem;
}

#userModal .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    padding: 0;
    margin-bottom: 1.5rem;
}

#userModal .form-grid:last-of-type {
    margin-bottom: 0;
}

#userModal .form-group {
    margin-bottom: 0;
}

#userModal #passwordSection {
    margin-top: 1.5rem;
}

#userModal #passwordSection .form-group {
    margin-bottom: 1.5rem;
}

#userModal #passwordSection .form-group:last-child {
    margin-bottom: 0;
}

/* Pickup Location Modal - Desktop Styling */
#pickupLocationModal .modal-body {
    padding: 1.5rem;
}

#pickupLocationModal .form-group {
    margin-bottom: 1.5rem;
}

#pickupLocationModal .form-group:last-of-type {
    margin-bottom: 0;
}

/* Ensure checkbox container is left-aligned */
#pickupLocationModal .form-group:has(#pickupLocationActive) {
    text-align: left !important;
    display: block !important;
    margin-bottom: 0 !important;
}

/* Ensure checkbox label is left-aligned with no wrapping */
#pickupLocationModal .form-group label[style*="display: flex"] {
    display: inline-flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
    white-space: nowrap !important;
    margin: 0 !important;
    width: auto !important;
}

/* Schedule New Report Modal - Desktop Styling */
#newReportModal .modal-content {
    max-width: 700px;
}

#newReportModal .modal-body {
    padding: 1.5rem;
}

#newReportModal .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    padding: 0;
}

#newReportModal .form-group {
    margin-bottom: 0;
}

/* Frequency/Time/Timezone row - preserve inline grid */
#newReportModal .form-grid > div[style*="grid-template-columns: 1fr 1fr 2fr"] {
    display: grid !important;
    grid-template-columns: 1fr 1fr 2fr !important;
    gap: 1rem !important;
}

/* Email Log Details Modal - Desktop Styling */
#emailLogModal .modal-content {
    max-width: 800px;
}

#emailLogModal .modal-body {
    padding: 1.5rem !important;
}

#emailLogModal .detail-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 1.5rem !important;
    padding: 0 !important;
    margin: 0 !important;
}

#emailLogModal .detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

#emailLogModal .detail-item label {
    font-weight: 600;
    color: #6b7280;
    font-size: 0.875rem;
    text-transform: uppercase;
}

#emailLogModal .detail-item.full-width {
    grid-column: 1 / -1;
}

/* Customer Details Modal - Desktop Styling */
@media (min-width: 769px) {
    /* Reduce modal width */
    #customerModal .modal-content {
        max-width: 850px;
    }

    /* Reduce modal body padding for customer modal */
    #customerModal .modal-body {
        padding: 1rem 1.5rem !important;
    }

    /* Compact 4-column grid for customer info */
    #customerModalBody .form-grid {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 0.75rem !important;
        padding: 0 !important;
    }

    /* Compact info items */
    #customerModalBody .info-item {
        padding: 0.5rem 0.75rem;
        background: #f8f9fa;
        border-radius: 6px;
    }

    #customerModalBody .info-item .info-label {
        font-size: 0.75rem;
        margin-bottom: 0.125rem;
    }

    #customerModalBody .info-item .info-value {
        font-size: 0.9rem;
    }

    /* Compact tables in customer modal */
    #customerModalBody .data-table {
        width: auto;
        min-width: 100%;
    }

    #customerModalBody .data-table th,
    #customerModalBody .data-table td {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    #customerModalBody .data-table th:first-child,
    #customerModalBody .data-table td:first-child {
        padding-left: 1rem;
    }

    #customerModalBody .data-table th:last-child,
    #customerModalBody .data-table td:last-child {
        padding-right: 1rem;
    }
}

/* Booking Details Modal - Desktop Styling */
@media (min-width: 769px) {
    /* Reduce modal body padding for booking modal */
    #bookingModal .modal-body {
        padding: 1.5rem !important;
    }

    /* Main container uses CSS Grid with 2 columns */
    #bookingModalBody .form-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 1.5rem !important;
        padding: 0 !important;
    }

    /* All info items get standard styling */
    #bookingModalBody .info-item {
        padding: 1rem;
        background: #f8f9fa;
        border-radius: 8px;
    }

    /* First info-grid (Booking Reference + Status) spans full width */
    #bookingModalBody .form-grid > .info-grid:first-child {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }

    /* Regular info items automatically flow in 2-column grid */

    /* Payment info row spans full width and creates 3-column layout */
    #bookingModalBody .payment-info-row {
        grid-column: 1 / -1;
        display: grid !important;
        grid-template-columns: 1fr 1fr 1fr !important;
        gap: 1.5rem !important;
    }

    /* Full width items (Pricing Breakdown, Special Requests, etc.) */
    #bookingModalBody .form-grid > .info-item[style*="grid-column"] {
        grid-column: 1 / -1 !important;
    }

    /* Booking modal buttons container */
    .booking-modal-actions {
        display: flex !important;
        gap: 1rem !important;
        justify-content: flex-end !important;
        align-items: center !important;
        margin-top: 2rem !important;
        padding: 0 !important;
    }

    .booking-modal-actions .btn-secondary {
        min-width: auto !important;
        padding: 0.75rem 1.5rem !important;
        height: auto !important;
        width: auto !important;
    }

    .booking-modal-actions .action-buttons-group {
        display: flex !important;
        gap: 1rem !important;
    }

    .booking-modal-actions .btn-warning,
    .booking-modal-actions .btn-danger {
        width: auto !important;
        height: auto !important;
        padding: 0.75rem 1.5rem !important;
        min-width: 100px !important;
    }

    .booking-modal-actions .btn-warning svg,
    .booking-modal-actions .btn-danger svg {
        margin-right: 0.5rem;
    }
}

/* Tour Modal Tabs */
.tour-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 1.5rem;
}

.tour-tab {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    position: relative;
    bottom: -2px;
}

.tour-tab:hover {
    color: var(--primary-color);
    background: rgba(74, 144, 226, 0.05);
}

.tour-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

.tour-tab svg {
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.tour-tab:hover svg,
.tour-tab.active svg {
    opacity: 1;
}

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

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

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

.modal-footer {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
    background: var(--gray-50);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Schedule New Report Modal - Extra footer padding */
#newReportModal .modal-footer {
    padding: 1.25rem 1.5rem;
}

/* ============================================================================
   SETTINGS COMPONENTS
   ============================================================================ */

.settings-tabs {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 0;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.05) 0%, rgba(59, 130, 246, 0.05) 100%);
    border-radius: 12px;
    padding: 1rem;
    gap: 0.5rem;
    border: 1px solid rgba(124, 58, 237, 0.1);
}

.tab-btn {
    background: #ffffff;
    border: 1px solid rgba(124, 58, 237, 0.15);
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-secondary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
    position: relative;
    overflow: hidden;
}

.tab-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.05) 0%, rgba(59, 130, 246, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(124, 58, 237, 0.3);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.15);
}

.tab-btn:hover::before {
    opacity: 1;
}

.tab-btn.active {
    color: var(--primary-color);
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
    border: 2px solid var(--primary-color);
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.2);
}

.tab-btn.active::before {
    opacity: 0;
}

.tab-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: 0.6;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.tab-btn.active .tab-icon,
.tab-btn:hover .tab-icon {
    opacity: 1;
    transform: scale(1.1);
}

.tab-btn:not(.active) .tab-icon {
    color: var(--text-secondary);
}

.tab-btn.active .tab-icon {
    color: var(--primary-color);
}

.settings-tab-content {
    display: none;
}

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

/* API Settings specific styles */
#api-settings .content-section {
    padding: var(--spacing-lg);
}

/* Notification Settings */
.notification-settings {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.5rem;
}

.notification-settings .notification-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background: var(--gray-50);
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.notification-settings .notification-content {
    flex: 1;
    margin-right: 1rem;
}

.notification-settings .notification-content h4 {
    margin: 0 0 0.35rem 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: #495057;
}

.notification-settings .notification-content p {
    margin: 0;
    font-size: 0.9rem;
    color: #6c757d;
    line-height: 1.4;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: var(--transition-normal);
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: var(--white);
    transition: var(--transition-normal);
    border-radius: var(--radius-full);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked+.toggle-slider {
    background-color: #28a745;
}

.toggle-switch input:focus+.toggle-slider {
    box-shadow: 0 0 1px #28a745;
}

.toggle-switch input:checked+.toggle-slider:before {
    transform: translateX(26px);
}

.toggle-slider:hover {
    background-color: #bbb;
}

.toggle-switch input:checked+.toggle-slider:hover {
    background-color: #218838;
}

.toggle-switch input:disabled+.toggle-slider {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Email Configuration */
.email-config-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-lg);
}

.config-group {
    display: flex;
    flex-direction: column;
}

.config-group h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #495057;
    margin: 0 0 var(--spacing-md) 0;
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid #e9ecef;
}

.test-button {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: box-shadow 0.3s ease, background 0.3s ease;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.test-button:hover {
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #5a67d8, #6b42a0);
}

/* Logo Upload */
.logo-upload-container {
    border: 2px dashed #d1d5db;
    border-radius: var(--radius-xl);
    padding: 2.5rem var(--spacing-xl);
    text-align: center;
    transition: all var(--transition-normal);
    cursor: pointer;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    margin-top: var(--spacing-md);
    position: relative;
    overflow: hidden;
}

.logo-upload-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(59, 130, 246, 0.05) 50%, transparent 70%);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.logo-upload-container:hover {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.15);
}

.logo-upload-container:hover::before {
    opacity: 1;
}

.logo-upload-container.drag-over {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    transform: scale(1.02);
    box-shadow: 0 12px 35px rgba(59, 130, 246, 0.2);
}

.logo-preview {
    max-width: 300px;
    max-height: 150px;
    margin: var(--spacing-md) auto;
    display: block;
    border-radius: var(--radius-xl);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border: 3px solid var(--white);
}

.upload-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto var(--spacing-md);
    background: var(--primary-gradient);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 20px;
}

.logo-upload-text {
    color: #374151;
    font-size: 1.1rem;
    margin: var(--spacing-md) 0 var(--spacing-sm);
    font-weight: 600;
}

.logo-upload-text .highlight {
    color: #3b82f6;
    font-weight: 700;
}

.upload-subtitle {
    color: #6b7280;
    font-size: 0.95rem;
    margin-bottom: var(--spacing-md);
}

.file-input {
    display: none;
}

/* Preview divs - ensure they're positioned properly and catch clicks */
#logoPreview, #heroPreview, #faviconPreview {
    position: relative;
    z-index: 10;
    pointer-events: auto;
    width: 100%;
}

.remove-logo-btn {
    background: var(--danger-gradient);
    color: var(--white);
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    margin-top: var(--spacing-md);
    font-size: 0.9rem;
    font-weight: 600;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    position: relative;
    z-index: 20;
    pointer-events: auto;
}

.remove-logo-btn:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(239, 68, 68, 0.4);
}

.upload-info {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: var(--spacing-md);
    background: rgba(255, 255, 255, 0.7);
    padding: 0.75rem var(--spacing-md);
    border-radius: 8px;
    border: 1px solid rgba(209, 213, 219, 0.5);
}

.upload-info .file-types {
    font-weight: 600;
    color: #374151;
}

/* Role-based visibility */
.role-admin,
.role-manager {
    display: none;
}

.user-admin .role-admin,
.user-admin .role-manager,
.user-manager .role-manager {
    display: block;
}

/* General Settings section only */
#settings #general-settings.content-section {
    padding: var(--spacing-lg);
}

#settings #general-settings .form-grid {
    padding: var(--spacing-md);
}

/* ============================================================================
   SUPPORT CENTER
   ============================================================================ */

.support-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.support-header h2 {
    font-size: 2rem;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.support-header p {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.support-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.support-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.support-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.support-card h3 {
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.2rem;
}

.card-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.1rem;
}

.support-stats {
    display: flex;
    justify-content: space-around;
    margin: var(--spacing-md) 0;
    padding: var(--spacing-md);
    background: var(--gray-50);
    border-radius: 8px;
}

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

.stat-number {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.priority-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: var(--spacing-sm);
}

.priority-option {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    font-size: 0.9rem;
}

.priority-option:hover,
.priority-option.selected {
    border-color: var(--primary-color);
    background: rgba(74, 144, 226, 0.1);
}

.priority-low {
    border-left: 4px solid #4CAF50;
}

.priority-normal {
    border-left: 4px solid var(--primary-color);
}

.priority-high {
    border-left: 4px solid #FF9800;
}

.priority-urgent {
    border-left: 4px solid #f44336;
}

.support-nav-tabs {
    display: flex;
    margin-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--border-color);
    background: var(--gray-50);
    border-radius: 8px 8px 0 0;
    padding: var(--spacing-sm);
    gap: 0.25rem;
}

.support-nav-tab {
    padding: 0.75rem var(--spacing-lg);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-secondary);
    transition: all var(--transition-normal);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    border: 1px solid transparent;
}

.support-nav-tab:hover {
    background: rgba(74, 144, 226, 0.1);
    color: var(--primary-color);
}

.support-nav-tab.active {
    color: var(--primary-color);
    background: var(--white);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.support-tab-content {
    display: none;
    background: transparent;
    border-radius: 0;
    padding: var(--spacing-md) 0;
    border-top: none;
}

.support-tickets-container {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.support-tickets-container h3 {
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border-color);
}

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

.ticket-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-normal);
    background: var(--white);
    border-radius: 8px;
    margin-bottom: var(--spacing-sm);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.ticket-item:hover {
    background: var(--gray-50);
}

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

.ticket-info h4 {
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    font-size: 1.1rem;
}

.ticket-meta {
    display: flex;
    gap: var(--spacing-md);
    font-size: 0.85rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.file-upload {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: var(--spacing-xl);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    background: #fafafa;
}

.file-upload:hover {
    border-color: var(--primary-color);
    background: rgba(74, 144, 226, 0.05);
}

.uploaded-files {
    margin-top: var(--spacing-md);
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-sm);
    border: 1px solid var(--border-color);
}

.ticket-upload-container {
    position: relative;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    background: #fafafa;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ticket-upload-container:hover {
    border-color: var(--primary-color);
    background: rgba(74, 144, 226, 0.05);
}

.ticket-upload-container.dragover {
    border-color: var(--primary-color);
    background: rgba(74, 144, 226, 0.1);
}

.upload-text {
    font-size: 1.1rem;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.upload-text .highlight {
    color: var(--primary-color);
    font-weight: 600;
}

/* ============================================================================
   EMAIL LOGS
   ============================================================================ */

.email-logs-container {
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(230, 230, 230, 0.5);
    overflow: hidden;
}

.email-logs-filters {
    background: rgba(102, 126, 234, 0.05);
    padding: var(--spacing-lg);
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

#emailLogsTable {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-top: var(--spacing-md);
}

#emailLogsTable thead {
    background: var(--gray-50);
    border-bottom: 2px solid #dee2e6;
}

#emailLogsTable th {
    padding: var(--spacing-md) 0.75rem;
    text-align: left;
    font-weight: 600;
    color: #495057;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #dee2e6;
    white-space: nowrap;
}

#emailLogsTable td {
    padding: 0.875rem 0.75rem;
    border-bottom: 1px solid #f1f3f4;
    vertical-align: middle;
    color: var(--text-primary);
}

#emailLogsTable tbody tr {
    transition: background-color var(--transition-fast);
}

#emailLogsTable tbody tr:hover {
    background-color: var(--gray-50);
}

#emailLogsTable tbody tr:last-child td {
    border-bottom: none;
}

.email-logs-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) var(--spacing-lg);
    background: rgba(102, 126, 234, 0.03);
    border-top: 1px solid rgba(102, 126, 234, 0.1);
}

.pagination-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.pagination-controls {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
}

.pagination-btn {
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid rgba(102, 126, 234, 0.2);
    background: #ffffff;
    color: var(--text-primary);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
    cursor: pointer;
}

.pagination-btn:hover:not(.disabled):not([disabled]) {
    background: rgba(102, 126, 234, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.pagination-btn.disabled,
.pagination-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(0, 0, 0, 0.02);
    color: #6c757d;
}

.pagination-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-color: transparent;
    color: var(--white);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-refresh,
.btn-clear {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.85rem;
    transition: box-shadow 0.3s ease, background 0.3s ease;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-refresh:hover,
.btn-clear:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, rgba(90, 103, 216, 1), rgba(107, 66, 160, 1));
}

.btn-clear {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

.btn-clear:hover {
    background: linear-gradient(135deg, #b91c1c, #991b1b);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}

.btn-view {
    padding: 0.375rem 0.75rem;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color var(--transition-fast);
}

.btn-view:hover {
    background: #357abd;
    color: var(--white);
    text-decoration: none;
}

.btn-retry {
    padding: 0.375rem 0.75rem;
    background: var(--warning-color);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color var(--transition-fast);
}

.btn-retry:hover {
    background: #f57c00;
    color: var(--white);
    text-decoration: none;
}

.action-buttons,
.email-log-actions {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
    flex-direction: row;
}

.email-log-actions button {
    width: auto;
    flex-shrink: 0;
}

.email-log-details {
    max-width: 100%;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-item.full-width {
    grid-column: 1 / -1;
}

.detail-item label {
    font-weight: 600;
    color: #495057;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-item span {
    color: var(--text-primary);
    word-break: break-word;
}

.error-message-box {
    background: #ffebee;
    color: #c62828;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    border-left: 4px solid #f44336;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    white-space: pre-wrap;
    word-break: break-word;
    margin-top: var(--spacing-sm);
}

#emailLogsLoadingState {
    padding: 3rem;
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
}

.email-logs-empty {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.email-logs-empty h4 {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

/* ============================================================================
   MESSAGES & ALERTS
   ============================================================================ */

.success-message,
.error-message,
.info-message {
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
    border-left: 4px solid;
    text-align: center;
}

.success-message {
    background: #e8f5e8;
    color: #2e7d32;
    border-left-color: #4CAF50;
}

.error-message {
    background: #ffebee;
    color: #c62828;
    border-left-color: #f44336;
}

.info-message {
    background: #e3f2fd;
    color: #1976d2;
    border-left-color: #2196f3;
}

.alert {
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
    border-left: 4px solid;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.alert-success {
    background: #e8f5e8;
    color: #2e7d32;
    border-left-color: #4CAF50;
}

.alert-error {
    background: #ffebee;
    color: #c62828;
    border-left-color: #f44336;
}

/* ============================================================================
   LOADING & EMPTY STATES
   ============================================================================ */

.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-xl);
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: var(--radius-full);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.no-data {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* ============================================================================
   FLOATING ACTION BUTTON
   ============================================================================ */

.floating-action-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    background: var(--primary-gradient);
    color: var(--white);
    border: none;
    border-radius: var(--radius-full);
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.4);
    transition: all var(--transition-normal);
    z-index: 1000;
}

.floating-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.5);
}

/* ============================================================================
   CONTENT TYPE & TEMPLATE EDITING
   ============================================================================ */

.content-type-toggle {
    margin-bottom: 10px;
}

.content-type-toggle label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    margin-right: 20px;
    font-weight: normal;
}

.content-type-toggle input[type="radio"] {
    margin-right: 5px;
}

.available-tags {
    background: #e3f2fd;
    border: 1px solid #90caf9;
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-bottom: 10px;
    font-size: 13px;
    line-height: 1.4;
}

.available-tags span {
    font-family: monospace;
    color: #1565c0;
    word-break: break-all;
}

#previewContent {
    border: 1px solid #ddd;
    border-radius: var(--radius-sm);
    padding: 12px;
    background: #f9f9f9;
    max-height: 200px;
    overflow-y: auto;
    font-size: 14px;
    word-wrap: break-word;
}

#previewContent.html-preview {
    font-family: Arial, sans-serif;
}

#previewContent.text-preview {
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
}

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

.delete-confirmation h3 {
    color: var(--danger-color);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.delete-confirmation p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.template-details {
    background-color: var(--gray-50);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    margin: 0.75rem 0 0 0;
    text-align: left;
}

.template-details h4 {
    margin: 0 0 0.35rem 0;
    color: var(--text-primary);
    font-size: 1rem;
}

.template-details p {
    margin: 0.2rem 0;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.3;
}

/* ============================================================================
   SKELETON LOADERS
   ============================================================================ */

.skeleton-loader {
    padding: 1.5rem;
    animation: fadeIn 0.3s ease;
}

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

.skeleton-header {
    height: 24px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 1.5rem;
}

.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.skeleton-item {
    height: 60px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Loading spinner */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color, #667eea);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 1200px) {
    .modern-charts-section {
        grid-template-columns: 1fr;
    }

    .filter-row {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-md);
    }

    .email-subject {
        max-width: 200px;
    }
}

@media (max-width: 768px) {

    /* Mobile Header */
    .mobile-menu-btn {
        display: block;
    }

    #companyName {
        display: none;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition-normal);
        padding-top: 0.6rem;
        /* space at the top */
        padding-left: 0.1rem;
        /* less space on the left */
        padding-right: 0.1rem;
        /* less space on the right */
        width: 220px;
        z-index: 999;
    }

    .nav-menu {
        padding-top: 0.2rem;
        /* extra fine-tune if needed */
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.active {
        display: block;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        max-width: 100%;
        padding: var(--spacing-md);
    }

    .header {
        padding: var(--spacing-md);
    }

    .header-content {
        gap: var(--spacing-md);
    }

    .logo {
        font-size: 1.2rem;
    }

    .user-info {
        display: none;
    }

    .agent-badge {
        padding: 0.3rem 0.8rem;
        font-size: 0.8rem;
    }

    .mobile-only-items {
        display: block;
    }

    /* Layout adjustments */
    .stats-grid,
    .modern-stats-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .filter-row,
    .form-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .filters .form-group:last-child {
        display: flex;
        gap: 1rem;
    }

    .filters .form-group:last-child button {
        flex: 1;
        /* make both buttons equal width */
    }

    .section-header {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-md);
    }

    .page-header {
        padding: var(--spacing-md);
        margin-bottom: var(--spacing-md);
    }

    .page-title {
        font-size: 1.5rem;
    }

    .btn {
        width: 100%;
        justify-content: center;
        padding: 0.8rem var(--spacing-md);
    }

    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .data-table {
        font-size: 0.9rem;
        border-collapse: collapse;
        border-spacing: 0;
    }

    .data-table th,
    .data-table td {
        padding: 0.75rem var(--spacing-sm);
        text-align: left;
        white-space: nowrap;
    }

    .data-table th {
        background: var(--gray-50);
        position: sticky;
        top: 0;
        z-index: 2;
    }

    .stat-card {
        padding: var(--spacing-md);
        min-height: 80px;
    }

    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .stat-info h3 {
        font-size: 1.5rem;
    }

    .form-group input,
    .form-group select,
    .form-group textarea,
    .form-control {
        padding: var(--spacing-md);
        font-size: 16px;
        /* Prevents zoom on iOS */
    }

    .content-section {
        margin-bottom: var(--spacing-md);
    }

    /* Settings mobile fixes */
    .settings-tabs {
        flex-direction: column;
    }

    .tab-btn {
        text-align: left;
        border-bottom: none;
        border-left: 3px solid transparent;
        padding: var(--spacing-md);
    }

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

    .notification-item {
        padding: var(--spacing-md);
    }

    .modal-content {
        width: 95%;
        margin: auto;
        max-height: 85vh;
    }

    .modal-header,
    .modal-body {
        padding: var(--spacing-md);
    }

    .search-input {
        padding: var(--spacing-md);
        font-size: 16px;
    }

    .footer {
        margin-left: 0;
        padding: var(--spacing-lg) var(--spacing-md);
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    /* Dashboard specific */
    .modern-dashboard-header {
        padding: 20px;
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .modern-page-title {
        font-size: 24px;
    }

    .modern-chart-card,
    .modern-activity-card,
    .modern-quick-actions {
        padding: 20px;
    }

    .chart-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }

    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .modern-action-btn {
        padding: 20px 16px;
    }

    .chart-summary>div {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .chart-summary .summary-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: var(--spacing-sm);
        background: var(--white);
        border-radius: var(--radius-sm);
        border: 1px solid var(--border-color);
        min-width: auto;
        text-align: left;
    }

    /* Email logs mobile */
    .email-logs-pagination {
        flex-direction: column;
        gap: var(--spacing-md);
        text-align: center;
    }

    .pagination-controls {
        justify-content: center;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .template-badge {
        font-size: 0.7rem;
        padding: 0.2rem var(--spacing-sm);
        max-width: 150px;
    }

    .action-buttons:not(.email-log-actions) {
        flex-direction: column;
        gap: 0.25rem;
    }

    .email-log-actions {
        flex-direction: row !important;
    }

    .btn-view,
    .btn-retry {
        font-size: 0.75rem;
        padding: 0.25rem var(--spacing-sm);
    }

    /* Support mobile */
    .support-dashboard {
        grid-template-columns: 1fr;
    }

    .priority-selector {
        grid-template-columns: 1fr 1fr;
    }

    .ticket-item {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }

    /* Tours mobile */
    .tour-info {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-md);
    }

    .info-item:nth-child(5) {
        grid-column: 1 / -1;
    }

    /* Email config mobile */
    .email-config-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        flex-direction: column;
    }

    #settings #general-settings.content-section {
        padding: var(--spacing-md);
    }

    #settings #general-settings .form-grid {
        padding: var(--spacing-md);
    }

    .customer-search-row {
        display: flex;
        gap: 1rem;
        align-items: stretch;
    }

    .customer-search {
        flex: 4 !important;
    }

    .customer-search input {
        width: 100%;
        height: 100%;
        box-sizing: border-box;
    }

    .customer-search-row button {
        flex: 1 !important;
        height: 100%;
    }

    /* Tour card buttons stacked */
    .tour-card-body {
        display: flex;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .tour-card-body .btn {
        flex: 1 1 100%;
        /* default full width */
    }

    /* First two buttons side by side */
    .tour-card-body .btn:nth-child(1),
    .tour-card-body .btn:nth-child(2) {
        flex: 1 1 calc(50% - 0.5rem);
        /* half width with gap */
    }

    /* Delete button full width below */
    .tour-card-body .btn:nth-child(3) {
        flex: 1 1 100%;
    }

    .button-row {
        display: flex;
        gap: 1rem;
        /* space between buttons */
        width: 100%;
        /* full width container */
    }

    .button-row .btn {
        flex: 1;
    }

    table td .btn {
        width: auto;
        /* shrink to text */
        min-width: 90px;
        /* keep consistent width */
        white-space: nowrap;
        /* prevent text from wrapping */
        flex: 0 0 auto;
        /* avoid stretching in flex */
        text-align: center;
        /* keep label centered */
    }

    .section-actions {
        display: flex;
        gap: 1rem;
        width: 100%;
    }

    .section-actions button {
        flex: 1;
        text-align: center;
    }

    /* Date fields in filters */
    .filters .date-fields-container {
        display: flex;
        gap: 10px;
        width: 100%;
        margin-top: 12px;
        align-items: flex-end;
        /* ✅ align inputs evenly at the bottom */
    }

    .filters .date-fields-container .form-group {
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    .filters .date-fields-container label {
        margin-bottom: 4px;
        font-size: 13px;
        color: var(--text-secondary);
        font-weight: 500;
        line-height: 1.2;
        min-height: 20px;
        /* reserve equal space for labels */
    }

    /* Ensure consistent input sizing */
    .filters .date-fields-container input[type="date"] {
        height: 44px;
        line-height: 1.2;
        box-sizing: border-box;
        padding: 8px 12px;
        font-size: 14px;
    }

    /* Buttons row */
    .filters .button-row {
        margin-top: 14px;
        display: flex;
        gap: 10px;
    }

    .filters .button-row .btn {
        flex: 1;
    }
}

@media (max-width: 480px) {
    .header {
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .main-content {
        padding: var(--spacing-sm);
    }

    .page-header {
        padding: var(--spacing-md) 0.75rem;
    }

    .content-section {
        border-radius: var(--radius-md);
    }

    .section-header {
        padding: var(--spacing-md);
    }

    #settings .content-section .form-grid,
    #settings .content-section .notification-settings {
        /*padding: var(--spacing-ld);*/
        padding: 1.5rem;
    }

    #settings .form-grid {
        padding: var(--spacing-md);
    }

    .stat-card {
        flex-direction: column;
        text-align: center;
        padding: var(--spacing-md);
    }

    .stat-info h3 {
        font-size: 1.8rem;
    }

    .quick-actions-grid {
        grid-template-columns: 1fr;
    }

    .filter-btn {
        padding: 6px 12px;
        font-size: 11px;
    }

    .chart-summary {
        padding: 0.75rem;
    }

    .chart-summary .summary-item {
        padding: 0.4rem 0.6rem;
    }

    .chart-summary .summary-item .summary-label {
        font-size: 0.75rem;
    }

    .chart-summary .summary-item .summary-value {
        font-size: 0.9rem;
    }

    input[type="date"] {
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
        -webkit-appearance: none;
        padding: 0.75rem;
        font-size: 16px;
    }

    .date-fields-container {
        display: flex;
        gap: 10px;
    }

    .date-fields-container .form-group {
        flex: 1;
        /* equal width */
        min-width: 0;
        /* prevent overflow */
    }

    .date-fields-container input[type="date"] {
        width: 100%;
        /* fill available space */
    }

    /* New Booking Page Mobile Responsive */
    #new-booking .customer-search-row {
        flex-direction: row !important;
        gap: 0.5rem !important;
        align-items: stretch !important;
    }

    #new-booking .customer-search-row .customer-search {
        flex: 1 !important;
    }

    #new-booking .customer-search-row button {
        width: auto !important;
        flex: 0 0 auto !important;
        white-space: nowrap !important;
        padding: 0.75rem 1rem !important;
    }

    #new-booking .form-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    /* Booking details two-column layout becomes single column */
    #new-booking div[style*="grid-template-columns: 1fr 1.5fr"] {
        display: flex !important;
        flex-direction: column !important;
        gap: 1.5rem !important;
    }

    /* Service selection and time slots stay in original order (first) */
    #new-booking div[style*="grid-template-columns: 1fr 1.5fr"] > div:first-child {
        order: 0;
    }

    /* Calendar container comes second */
    #new-booking div[style*="grid-template-columns: 1fr 1.5fr"] > div:last-child {
        order: 1;
    }

    /* Time slot section header */
    #new-booking h4 {
        font-size: 1.1rem !important;
        margin-bottom: 0.75rem !important;
    }

    /* Selected time slot date display */
    #timeSlotDate {
        font-size: 0.9rem !important;
        padding: 0.6rem !important;
    }

    /* Time slot list container */
    #timeSlotSection {
        margin-bottom: 1rem !important;
    }

    #timeSlotList {
        max-height: 250px !important;
        gap: 0.5rem !important;
    }

    /* Individual time slot buttons */
    .time-slot-option {
        padding: 0.75rem 1rem !important;
        font-size: 0.95rem !important;
        margin-bottom: 0.5rem !important;
    }

    /* Selected schedule display box */
    #selectedScheduleDisplay {
        font-size: 0.9rem !important;
        padding: 0.75rem !important;
        margin-top: 1rem !important;
    }

    /* Calendar section label */
    #new-booking div[style*="grid-template-columns: 1fr 1.5fr"] > div:last-child label {
        font-size: 1rem !important;
        margin-bottom: 0.75rem !important;
    }

    /* Calendar picker container */
    #bookingCalendarPicker {
        padding: 0.5rem !important;
    }

    /* Booking calendar wrapper */
    #bookingCalendarPicker .booking-calendar {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }

    /* Calendar navigation - month/year and arrows - positioned at top */
    #bookingCalendarPicker .booking-calendar > div:first-child {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        margin-bottom: 1rem !important;
        padding-bottom: 0.5rem !important;
        gap: 0.5rem !important;
        width: 100% !important;
        max-width: 400px !important;
        border-bottom: 1px solid #e0e0e0 !important;
    }

    /* Navigation buttons */
    #bookingCalendarPicker .booking-calendar > div:first-child button {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.85rem !important;
        min-width: 44px !important;
        height: 44px !important;
        white-space: nowrap !important;
    }

    /* Month/Year heading */
    #bookingCalendarPicker .booking-calendar > div:first-child h3 {
        font-size: 1rem !important;
        font-weight: 600 !important;
        text-align: center !important;
        flex: 1 !important;
        margin: 0 !important;
    }

    /* Calendar grid container - centered */
    #bookingCalendarPicker .booking-calendar > div:nth-child(2) {
        width: 100% !important;
        max-width: 400px !important;
    }

    /* Calendar grid */
    #bookingCalendarPicker .booking-calendar > div:nth-child(2) {
        display: grid !important;
        grid-template-columns: repeat(7, 1fr) !important;
        gap: 4px !important;
    }

    /* Day header cells (Sun, Mon, etc.) - keep original styles, just adjust size */
    #bookingCalendarPicker .booking-calendar > div:nth-child(2) > div:nth-child(-n+7) {
        padding: 0.4rem 0.2rem !important;
        font-size: 0.7rem !important;
    }

    /* Calendar day cells - adjust size only, preserve colors */
    #bookingCalendarPicker .booking-calendar > div:nth-child(2) > div:nth-child(n+8) {
        min-height: 68px !important;
        padding: 0.35rem 0.2rem !important;
        font-size: 0.75rem !important;
    }

    /* Calendar day numbers - adjust size */
    #bookingCalendarPicker .booking-calendar > div:nth-child(2) > div:nth-child(n+8) > div:first-child {
        font-size: 0.85rem !important;
        margin-bottom: 0.15rem !important;
    }

    /* Calendar availability text - smaller font */
    #bookingCalendarPicker .booking-calendar > div:nth-child(2) > div:nth-child(n+8) > div:last-child {
        font-size: 0.65rem !important;
        line-height: 1.1 !important;
    }

    /* Legend at bottom - center it */
    #bookingCalendarPicker .booking-calendar > div:nth-child(3) {
        width: 100% !important;
        max-width: 400px !important;
        font-size: 0.8rem !important;
    }

    /* Participant counters - only for New Booking page */
    #new-booking .participant-counter {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 1rem;
        padding: 0.75rem;
        background: var(--gray-50);
        border-radius: var(--radius-md);
    }

    #new-booking .counter-btn {
        width: 44px !important;
        height: 44px !important;
        font-size: 1.3rem !important;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 6px;
    }

    #new-booking .counter-value {
        min-width: 50px;
        text-align: center;
        font-weight: 600;
        font-size: 1.2rem;
    }

    /* Service extras mobile */
    #bookingExtrasList > div {
        margin-bottom: 1rem !important;
        padding: 1rem !important;
        border-radius: var(--radius-md);
        background: white !important;
        border: 1px solid #e0e0e0 !important;
    }

    #bookingExtrasList h4 {
        font-size: 1.05rem !important;
        margin-bottom: 0.5rem !important;
        font-weight: 600 !important;
    }

    #bookingExtrasList p {
        font-size: 0.9rem !important;
        margin-bottom: 0.5rem !important;
    }

    #bookingExtrasList .participant-counter {
        margin-top: 0.75rem;
    }

    /* Booking summary */
    #bookingSummary {
        font-size: 0.9rem;
        padding: 1rem !important;
    }

    #bookingSummary table {
        font-size: 0.85rem;
        width: 100% !important;
    }

    #bookingSummary td {
        padding: 0.5rem 0.25rem !important;
    }

    /* Additional Details section - make dropdowns full width */
    #new-booking select,
    #new-booking input[type="text"],
    #new-booking input[type="email"],
    #new-booking input[type="tel"],
    #new-booking input[type="date"] {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Pickup details section */
    #pickupDetailsContainer {
        margin-top: 1.5rem !important;
    }

    #pickupDetailsContainer .form-grid {
        grid-template-columns: 1fr !important;
    }

    #pickupDetailsContainer select,
    #pickupDetailsContainer input {
        font-size: 16px !important; /* Prevent iOS zoom */
    }

    /* Pickup time display */
    #pickupTimeDisplay {
        font-size: 0.9rem !important;
        padding: 0.6rem !important;
    }

    /* Special requests textarea */
    #specialRequests {
        font-size: 16px !important; /* Prevent iOS zoom */
        min-height: 100px !important;
    }

    /* Form action buttons at bottom - SIDE BY SIDE */
    #new-booking form > div:last-child {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0.75rem !important;
        margin-top: 1.5rem !important;
    }

    #new-booking form > div:last-child .btn {
        width: 100% !important;
        padding: 0.875rem 1rem !important;
        font-size: 1rem !important;
    }

    /* Reset button (danger) on left */
    #new-booking form > div:last-child .btn-danger {
        order: 1;
    }

    /* Create Booking button (success) on right */
    #new-booking form > div:last-child .btn-success {
        order: 2;
    }

    /* New Booking Page - Extra Small Screens */
    #new-booking .page-header {
        padding: 0.75rem !important;
    }

    #new-booking .page-title {
        font-size: 1.25rem !important;
    }

    #new-booking .page-subtitle {
        font-size: 0.85rem !important;
    }

    #new-booking h3, #new-booking h4 {
        font-size: 1rem !important;
        margin: 1rem 0 0.75rem 0 !important;
    }

    #new-booking .modal-body {
        padding: 0.75rem !important;
    }

    #bookingCalendarPicker {
        padding: 0.25rem !important;
    }

    #bookingCalendarPicker th,
    #bookingCalendarPicker td {
        padding: 0.3rem 0.1rem !important;
        font-size: 0.75rem !important;
    }

    #bookingCalendarPicker button {
        padding: 0.3rem 0.5rem !important;
        font-size: 0.75rem !important;
    }

    #new-booking .participant-counter {
        padding: 0.4rem !important;
        gap: 0.75rem !important;
    }

    #new-booking .counter-btn {
        width: 36px !important;
        height: 36px !important;
        font-size: 1rem !important;
    }

    #new-booking .counter-value {
        min-width: 36px !important;
        font-size: 1rem !important;
    }

    #bookingExtrasList > div {
        padding: 0.75rem !important;
    }

    #timeSlotList {
        max-height: 250px !important;
    }

    .time-slot-option {
        padding: 0.6rem !important;
        font-size: 0.85rem !important;
    }

    #selectedScheduleDisplay {
        font-size: 0.85rem !important;
        padding: 0.6rem !important;
    }
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

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

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

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

.d-none {
    display: none;
}

.d-block {
    display: block;
}

.d-flex {
    display: flex;
}

.d-grid {
    display: grid;
}

.w-100 {
    width: 100%;
}

.h-100 {
    height: 100%;
}

.m-0 {
    margin: 0;
}

.mt-1 {
    margin-top: var(--spacing-sm);
}

.mb-1 {
    margin-bottom: var(--spacing-sm);
}

.ml-1 {
    margin-left: var(--spacing-sm);
}

.mr-1 {
    margin-right: var(--spacing-sm);
}

.p-0 {
    padding: 0;
}

.pt-1 {
    padding-top: var(--spacing-sm);
}

.pb-1 {
    padding-bottom: var(--spacing-sm);
}

.pl-1 {
    padding-left: var(--spacing-sm);
}

.pr-1 {
    padding-right: var(--spacing-sm);
}

/* ============================================================================
   PRINT STYLES
   ============================================================================ */

@media print {

    .email-logs-filters,
    .email-logs-pagination,
    .section-actions,
    .action-buttons,
    .sidebar,
    .header,
    .mobile-menu-btn,
    .floating-action-btn {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
        padding: 0;
    }

    #emailLogsTable {
        font-size: 0.7rem;
        box-shadow: none;
    }

    #emailLogsTable th,
    #emailLogsTable td {
        padding: 0.25rem;
        border: 1px solid #ddd;
    }

    .template-badge,
    .status-badge {
        border: 1px solid #333;
        color: #000 !important;
        background: #fff !important;
    }

    body {
        padding-top: 0;
    }
}

/* ============================================================================
   iOS SAFE AREA SUPPORT
   ============================================================================ */

@supports (padding-top: env(safe-area-inset-top)) {
    .header {
        padding-top: calc(var(--spacing-md) + env(safe-area-inset-top));
    }

    body {
        padding-top: calc(var(--header-h) + env(safe-area-inset-top));
    }
}

/* Add these styles to your existing admin-styles.css file */

/* =========================
   WEEKDAY SCHEDULE STYLES
   ========================= */

.weekly-schedule-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.day-schedule-card {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.3s ease;
}

.day-schedule-card:hover {
    border-color: #4a90e2;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.1);
}

.day-header {
    margin-bottom: 1rem;
}

.day-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    color: #333;
}

.day-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
}

.day-name {
    font-size: 1.1rem;
}

.day-settings {
    transition: opacity 0.3s ease;
}

.day-settings.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.day-settings.enabled {
    opacity: 1;
}

.time-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.time-inputs .form-group {
    margin-bottom: 0;
}

.time-inputs label {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.time-inputs input[type="time"] {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.max-participants {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* Schedule Preview Styles */
.schedule-preview {
    max-height: 60vh;
    overflow-y: auto;
    padding: 1rem;
}

.preview-week {
    margin-bottom: 2rem;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    background: #f8f9fa;
}

.preview-week h4 {
    margin: 0 0 1rem 0;
    color: #333;
    border-bottom: 2px solid #4a90e2;
    padding-bottom: 0.5rem;
}

.preview-days {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
}

.preview-day {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 0.75rem;
    text-align: center;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.preview-day.enabled {
    border-color: #28a745;
    background: #f8fff9;
}

.preview-day.disabled {
    background: #f5f5f5;
    color: #999;
}

.preview-day-header {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.preview-day-times {
    font-size: 0.8rem;
    color: #666;
    line-height: 1.3;
}

.preview-day-disabled {
    font-size: 0.8rem;
    color: #999;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .weekly-schedule-grid {
        grid-template-columns: 1fr;
    }
    
    .time-inputs {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .preview-days {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .quick-actions-grid {
        flex-direction: column;
    }
    
    .quick-actions-grid .btn {
        width: 100%;
    }
}

/* Enhanced Tour Card Buttons */
.tour-card-body .btn {
    font-size: 0.85rem;
    padding: 0.6rem 1rem;
    min-width: 120px;
}

.tour-card-body .btn-primary {
    background: linear-gradient(135deg, #4a90e2, #5ba3f5);
    border: none;
}

.tour-card-body .btn-primary:hover {
    background: linear-gradient(135deg, #357abd, #4a90e2);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.3);
}

/* Modal Enhancements */
.modal-content {
    animation: modalSlideIn 0.3s ease;
}

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

/* Enhanced Form Styling */
.form-group label {
    font-weight: 500;
    color: #333;
    margin-bottom: 0.5rem;
    display: block;
}

.form-control, input[type="time"], input[type="number"] {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 0.75rem;
    font-size: 0.95rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus, input[type="time"]:focus, input[type="number"]:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

/* Status Indicators */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-weight: 500;
}

.status-indicator.enabled {
    background: #d4edda;
    color: #155724;
}

.status-indicator.disabled {
    background: #f8d7da;
    color: #721c24;
}

/* Loading States */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #4a90e2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success/Error Messages */
.message-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
    padding: 1rem;
    margin: 1rem 0;
}

.message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    padding: 1rem;
    margin: 1rem 0;
}

.message-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
    border-radius: 6px;
    padding: 1rem;
    margin: 1rem 0;
}

/* Improved Button Styles */
.btn {
    transition: all 0.3s ease;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn-success {
    background: linear-gradient(135deg, #28a745, #34ce57);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #ffc107, #ffcd39);
    color: #212529;
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545, #e4606d);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d, #7c868e);
    color: white;
}

/* Mobile Optimizations */
@media (max-width: 480px) {
    .modal-content {
        margin: auto;
        width: calc(100% - 1rem);
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
    }

    .modal,
    .settings-modal {
        padding: 0.5rem;
    }

    .modal-footer {
        flex-direction: column;
        gap: 0.5rem;
    }

    .modal-footer .btn {
        width: 100%;
    }
    
    .day-schedule-card {
        padding: 0.75rem;
    }
    
    .preview-days {
        grid-template-columns: 1fr;
    }

    /* Assigned Providers Tab Mobile Styles */
    #tourTabProviders .form-group > div[style*="display: flex"] {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1rem !important;
    }

    #tourTabProviders button[onclick*="assignProviderToTourFromModal"] {
        width: 100%;
        padding: 0.75rem 1rem !important;
    }

    #tourTabProviders label[style*="display: flex"][style*="cursor: pointer"] {
        justify-content: center !important;
        padding: 0.75rem !important;
    }

    #tourTabProviders select[id="tourModalProviderSelect"] {
        width: 100% !important;
    }

    /* Provider cards spacing on mobile */
    #tourAssignedProvidersList > div {
        flex-direction: column !important;
        gap: 1rem !important;
        padding: 1rem !important;
    }

    #tourAssignedProvidersList > div > div[style*="display: flex"][style*="gap"] {
        flex-direction: column !important;
        width: 100% !important;
        gap: 0.5rem !important;
    }

    #tourAssignedProvidersList button {
        width: 100% !important;
        padding: 0.625rem !important;
    }
}

/* ===== Pricing Rules Styles ===== */
#pricing-rules .content-section {
    background: transparent;
    backdrop-filter: none;
    box-shadow: none;
    border: none;
    padding: 0;
}

.pricing-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.pricing-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: white;
    border-bottom: none;
}

.pricing-card-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    display: flex;
    align-items: center;
}

.rules-list {
    padding: 0 2rem 2rem 2rem;
}

.rule-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
}

.rule-item:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.rule-item-info {
    flex: 1;
}

.rule-item-name {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.rule-item-details {
    font-size: 0.875rem;
    color: #6b7280;
}

.rule-item-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.rule-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.rule-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.rule-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.rule-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.rule-toggle input:checked + .rule-toggle-slider {
    background-color: #28a745;
}

.rule-toggle input:checked + .rule-toggle-slider:hover {
    background-color: #218838;
}

.rule-toggle input:checked + .rule-toggle-slider:before {
    transform: translateX(20px);
}

.btn-icon {
    background: #e9ecef;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    color: #6c757d;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background-color: #dee2e6;
    color: #495057;
}

.btn-icon.btn-icon-success {
    background-color: #d4edda;
    color: #28a745;
}

.btn-icon.btn-icon-success:hover {
    background-color: #c3e6cb;
    color: #218838;
}

.btn-icon.btn-icon-danger {
    background-color: #f8d7da;
    color: #dc3545;
}

.btn-icon.btn-icon-danger:hover {
    background-color: #f5c6cb;
    color: #c82333;
}

.adjustment-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
}

.adjustment-badge.discount {
    background-color: #d1fae5;
    color: #065f46;
}

.adjustment-badge.surcharge {
    background-color: #fee2e2;
    color: #991b1b;
}

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

/* Fix table container inside pricing cards */
.pricing-card .table-container {
    padding: 0;
    margin: 0 1.5rem 1.5rem 1.5rem;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.pricing-card .data-table {
    margin: 0;
}
/* Info box for helpful messages */
.info-box {
    padding: 0.75rem;
    background: rgba(59, 130, 246, 0.05);
    border-left: 3px solid var(--primary-color);
    border-radius: 6px;
    font-size: 0.875rem;
    color: var(--text-primary);
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

/* Display utilities */
.u-hidden {
    display: none;
}

.u-inline-block {
    display: inline-block;
}

.u-block {
    display: block;
}

/* Flexbox utilities */
.u-flex {
    display: flex;
}

.u-flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.u-flex-end {
    display: flex;
    align-items: end;
}

.u-flex-gap-sm {
    gap: 0.5rem;
}

.u-flex-gap-md {
    gap: 1rem;
}

.u-flex-gap-lg {
    gap: 1.5rem;
}

.u-flex-wrap {
    flex-wrap: wrap;
}

.u-flex-1 {
    flex: 1;
}

.u-flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Spacing utilities */
.u-m-0 {
    margin: 0;
}

.u-mt-0 {
    margin-top: 0;
}

.u-mt-1 {
    margin-top: 0.25rem;
}

.u-mt-2 {
    margin-top: 0.5rem;
}

.u-mt-3 {
    margin-top: 1rem;
}

.u-mb-0 {
    margin-bottom: 0;
}

.u-mb-1 {
    margin-bottom: 0.25rem;
}

.u-mb-2 {
    margin-bottom: 0.5rem;
}

.u-mb-3 {
    margin-bottom: 1rem;
}

.u-mb-4 {
    margin-bottom: 1.5rem;
}

.u-mb-5 {
    margin-bottom: 2rem;
}

.u-mr-1 {
    margin-right: 0.25rem;
}

.u-mr-2 {
    margin-right: 0.5rem;
}

.u-ml-2 {
    margin-left: 0.5rem;
}

.u-p-2 {
    padding: 0.5rem;
}

.u-p-3 {
    padding: 1rem;
}

/* Text utilities */
.u-text-center {
    text-align: center;
}

.u-text-muted {
    color: #666;
}

.u-text-primary {
    color: #333;
}

.u-font-sm {
    font-size: 0.875rem;
}

.u-font-md {
    font-size: 0.9rem;
}

.u-font-lg {
    font-size: 1.75rem;
}

/* Icon utilities */
.u-icon-inline {
    display: inline-block;
    vertical-align: middle;
    margin-right: 0.5rem;
}

.u-icon-sm {
    width: 14px;
    height: 14px;
}

.u-icon-md {
    width: 16px;
    height: 16px;
}

.u-icon-lg {
    width: 20px;
    height: 20px;
}

/* Action button utilities (for table action buttons) */
.action-btn {
    padding: 0.375rem 0.625rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.action-btn-blue {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.action-btn-blue:hover {
    background: rgba(59, 130, 246, 0.2);
}

.action-btn-gray {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

.action-btn-gray:hover {
    background: rgba(107, 114, 128, 0.2);
}

.action-btn-red {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.action-btn-red:hover {
    background: rgba(239, 68, 68, 0.2);
}

.action-btn-green {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.action-btn-green:hover {
    background: rgba(16, 185, 129, 0.2);
}

.action-btn-orange {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.action-btn-orange:hover {
    background: rgba(245, 158, 11, 0.2);
}

/* Card header utilities */
.card-header {
    margin-bottom: 1.5rem;
}

.card-title {
    margin: 0;
    font-size: 1.75rem;
    color: #333;
}

.card-subtitle {
    margin: 0.25rem 0 0 0;
    color: #666;
    font-size: 0.9rem;
}

/* ============================================================================
   KEYBOARD SHORTCUTS
   ============================================================================ */

.keyboard-shortcuts-help kbd {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Mono', 'Droid Sans Mono', 'Source Code Pro', monospace;
    color: #333;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.1);
    min-width: 2rem;
    text-align: center;
}

.keyboard-shortcuts-help table {
    margin-top: 1rem;
}

.keyboard-shortcuts-help td:first-child {
    width: 40%;
    font-weight: 500;
}

.keyboard-shortcuts-help td:last-child {
    color: #666;
}

/* ============================================================================
   BULK ACTIONS - COMPACT MENU DESIGN
   ============================================================================ */

.bulk-actions-compact {
    position: relative;
}

.bulk-actions-toggle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 8px;
    color: #667eea;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.08);
}

.bulk-actions-toggle:hover {
    background: rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.3);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.12);
    transform: translateY(-1px);
}

.bulk-count-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
    animation: scaleIn 0.2s ease-out;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

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

.bulk-actions-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: auto;
    background: #ffffff;
    border: 1px solid rgba(102, 126, 234, 0.15);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    animation: slideDown 0.2s ease-out;
    overflow: hidden;
}

.bulk-actions-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    background: rgba(102, 126, 234, 0.05);
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
    color: #667eea;
    font-size: 0.875rem;
    font-weight: 600;
}

.bulk-actions-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bulk-actions-close:hover {
    background: rgba(107, 114, 128, 0.1);
    color: #374151;
}

.bulk-actions-menu-items {
    padding: 0.5rem;
}

.bulk-action-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
}

.bulk-action-item svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.bulk-action-success {
    color: #10b981;
}

.bulk-action-success:hover {
    background: rgba(16, 185, 129, 0.1);
    transform: translateX(4px);
}

.bulk-action-warning {
    color: #f59e0b;
}

.bulk-action-warning:hover {
    background: rgba(245, 158, 11, 0.1);
    transform: translateX(4px);
}

.bulk-action-secondary {
    color: #6b7280;
}

.bulk-action-secondary:hover {
    background: rgba(107, 114, 128, 0.1);
    transform: translateX(4px);
}

.bulk-action-danger {
    color: #ef4444;
}

.bulk-action-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    transform: translateX(4px);
}

.modern-section-header.u-flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Checkbox styling for bulk selection */
.data-table tbody tr td:first-child {
    text-align: center;
}

.data-table tbody tr.selected {
    background-color: rgba(102, 126, 234, 0.1);
}

.data-table input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.data-table thead input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* ============================================================================
   GENERATE SCHEDULES FROM TEMPLATE MODAL - DESKTOP
   ============================================================================ */

/* Form wrapper - use flexbox for layout control */
#generateScheduleForm {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    row-gap: 1.5rem;
}

/* Date fields side by side on desktop */
#generateScheduleForm .form-group:nth-child(1),
#generateScheduleForm .form-group:nth-child(2) {
    flex: 1;
    min-width: 200px;
    margin-bottom: 0;
}

#generateScheduleForm .form-group:nth-child(1) {
    padding-right: 1.5rem;
}

/* Checkbox section - full width */
#generateScheduleForm .form-group:nth-child(3) {
    flex-basis: 100%;
    width: 100%;
    margin-top: 0;
    margin-bottom: 0.75rem;
}

/* Warning box - full width with minimal spacing */
#generateScheduleModal .modal-body form > div[style*="background: #fff3cd"] {
    flex-basis: 100%;
    width: 100%;
    margin: 0 !important;
}

/* ============================================================================
   TRIAL COUNTDOWN BANNER
   ============================================================================ */

.trial-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    animation: slideDown 0.3s ease-out;
}

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

.trial-banner.warning {
    background: linear-gradient(135deg, #FF9800 0%, #FF5722 100%);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.2);
}

.trial-banner.expired {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.2);
}

.trial-banner-content {
    display: flex;
    align-items: center;
    gap: 16px;
    color: white;
}

.trial-banner-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.trial-banner-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.trial-banner-text strong {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.trial-banner-text span {
    font-size: 13px;
    opacity: 0.95;
}

.trial-banner-action {
    padding: 10px 24px;
    background: white;
    color: #667eea;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.trial-banner-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.trial-banner.warning .trial-banner-action {
    color: #FF9800;
}

.trial-banner.expired .trial-banner-action {
    color: #f44336;
}

.trial-banner-close {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.trial-banner-close:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .trial-banner-content {
        gap: 12px;
    }

    .trial-banner-icon {
        width: 36px;
        height: 36px;
    }

    .trial-banner-text strong {
        font-size: 14px;
    }

    .trial-banner-text span {
        font-size: 12px;
    }

    .trial-banner-action {
        padding: 8px 16px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .trial-banner-content {
        flex-wrap: wrap;
    }

    .trial-banner-action {
        order: 3;
        width: 100%;
        margin-top: 8px;
    }

    .trial-banner-close {
        order: 2;
    }
}

/* ============================================================================
   FEATURE UPGRADE BADGES
   ============================================================================ */

.upgrade-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    font-weight: 500;
    padding: 0.2rem 0.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 4px;
    margin-left: 0.5rem;
    cursor: pointer;
    vertical-align: middle;
    transition: opacity 0.2s, transform 0.2s;
}

.upgrade-badge:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.upgrade-badge.grandfathered {
    background: linear-gradient(135deg, #f6ad55 0%, #ed8936 100%);
    cursor: help;
}

.upgrade-badge i {
    font-size: 0.65rem;
}

/* Locked feature item styling */
.notification-item.locked {
    opacity: 0.6;
}

.notification-item.locked .toggle-switch {
    pointer-events: none;
    opacity: 0.5;
}

.notification-item.locked .notification-content h4,
.notification-item.locked .notification-content p {
    color: #999;
}

/* Locked feature content (for integrations/advanced settings) */
.locked-feature {
    position: relative;
    pointer-events: none;
}

.locked-feature::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    z-index: 10;
    border-radius: 12px;
}

.locked-feature::after {
    content: '🔒 Upgrade Required';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1rem;
    z-index: 11;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* Plan banner in feature settings */
.plan-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: white;
    margin-bottom: 1rem;
}

.plan-banner a {
    color: white;
    text-decoration: underline;
}

.plan-banner a:hover {
    opacity: 0.9;
}
