:root {
    /* Newstate Travel Brand Palette */
    --primary-color: #229ba7;
    --primary-hover: #1b5e59;
    --primary-light: #2fccef;
    --primary-glow: rgba(34, 155, 167, 0.2);

    /* Semantic Colors */
    --success-color: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --warning-color: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --error-color: #dc2626;
    --error-bg: rgba(220, 38, 38, 0.1);

    /* Text & Surfaces */
    --text-main: #151515;
    --text-muted: #4a4a4a;
    --text-light: #6b7280;
    --secondary-bg: #f9f9f9;
    --border-color: #e5e7eb;

    /* Sidebar */
    --sidebar-bg: #1a2537;
    --sidebar-text: #e2e8f0;
    --sidebar-hover: #2d3a4d;

    /* Shadow System (Elevation) */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --card-shadow: var(--shadow-md);

    /* Transitions */
    --transition-fast: 150ms ease-out;
    --transition-normal: 250ms ease-out;
    --transition-slow: 400ms ease-out;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;

    /* Mobile sidebar width */
    --sidebar-width: 280px;

    /* Force cache refresh v6 - teal + responsive */
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--secondary-bg);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.app-container {
    display: flex;
    height: 100%;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    transition: transform var(--transition-normal);
    z-index: 100;
}

/* Mobile Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Hamburger Menu Button */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-main);
}

.hamburger-btn svg {
    width: 24px;
    height: 24px;
}

/* Mobile Responsive Sidebar */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        transform: translateX(-100%);
    }

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

    .sidebar-overlay {
        display: block;
    }

    .hamburger-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .app-container {
        flex-direction: column;
    }
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: white;
    margin-bottom: 2.5rem;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 0.5rem;
    margin-bottom: 0.25rem;
    transition: all 0.2s;
}

.sidebar nav a:hover,
.sidebar nav a.active {
    background-color: var(--sidebar-hover);
    color: white;
}

.sidebar nav a.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
        padding-top: 4rem;
        /* Space for mobile header */
    }
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Mobile Header with Hamburger */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: 0 1rem;
    align-items: center;
    gap: 1rem;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.mobile-header .logo-text {
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--text-main);
}

@media (max-width: 768px) {
    .mobile-header {
        display: flex;
    }

    .top-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .top-bar h1 {
        font-size: 1.5rem;
    }

    .header-actions {
        display: flex;
        gap: 0.5rem;
        flex-wrap: wrap;
    }
}

h1 {
    font-size: 1.875rem;
    font-weight: 700;
}

.btn {
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: background-color 0.2s;
}

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

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

.btn-secondary {
    background-color: white;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

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

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.btn-text {
    background: none;
    color: var(--text-muted);
}

.btn-text:hover {
    color: var(--text-main);
}

.btn-icon {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 0.5rem;
}

.btn-icon:hover {
    color: #dc2626;
}

/* View Toggle */
.view-toggle {
    display: flex;
    background: #e2e8f0;
    padding: 2px;
    border-radius: 0.5rem;
}

.view-toggle .btn {
    border: none;
    border-radius: 0.375rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.view-toggle .btn-primary {
    background-color: white;
    color: var(--primary-color);
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.view-toggle .btn-secondary {
    background-color: transparent;
    color: var(--text-muted);
    border: none;
}

.view-toggle .btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.5);
    color: var(--text-main);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    position: relative;
    overflow: hidden;
}

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

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

.stat-card h3 {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.stat-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

/* Trips Grid */
.section-header {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.trips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

@media (max-width: 640px) {
    .trips-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.trip-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    padding: 1.25rem;
}

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

.trip-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.trip-card-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.trip-date {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.trip-actions {
    display: flex;
    gap: 0.25rem;
}

.trip-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

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

.metric-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.metric-value {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
}

.actual-vs-projected {
    background-color: #f8fafc;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.actual-vs-projected h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-main);
}

.comparison-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.comparison-item {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5rem;
    font-size: 0.875rem;
    align-items: center;
}

.comparison-item span:first-child {
    font-weight: 500;
    color: var(--text-muted);
}

.comparison-item .actual {
    font-weight: 600;
    color: var(--success-color);
}

.comparison-item .projected {
    font-weight: 600;
    color: var(--text-muted);
}

.sync-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.wetravel-notice {
    background-color: #eff6ff;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    border-left: 3px solid var(--primary-color);
}

.wetravel-notice p {
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
    color: var(--text-main);
}

/* Trip Card Styles - Needs Review Variant */
.card.trip-card {
    position: relative;
    padding-top: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
    background-color: white;
    /* Default background */
}

/* Apply pale yellow to the entire card when it needs review */
.card.trip-card.needs-review {
    background-color: #fffde7;
    /* Lighter yellow */
    border: 1px solid #fde047;
    /* Yellow border */
    margin-top: 1.5rem;
    /* Space for the external tab */
    overflow: visible;
    /* Allow tab to sit outside */
}

.review-tab {
    position: absolute;
    top: -24px;
    /* Move outside card */
    left: 20px;
    /* Align to left (folder  style) instead of center */
    transform: none;
    background-color: #fde047;
    /* Match border color */
    color: #854d0e;
    /* Darker yellow/brown text */
    padding: 0.25rem 1rem;
    font-size: 0.7rem;
    font-weight: 700;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.05);
    /* Subtle shadow top */
    z-index: 10;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.25rem;
}

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

.commission-badge {
    background-color: #dcfce7;
    color: #166534;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem;
    background: white;
    border-radius: 0.75rem;
    border: 1px dashed var(--border-color);
    color: var(--text-muted);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-overlay.hidden {
    display: none;
}

.modal {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    width: 95%;
    max-width: 1100px;
    /* Increased from 800px approx */
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-main);
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}

/* Old Grid Rule Removed - Now using specific grid classes */
/* .modal-body form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
} */

/* Specific Grid Layouts for Tabs */
.trip-grid,
.costs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

/* Mobile responsive - stack back to 1 column */
@media (max-width: 768px) {

    .trip-grid,
    .costs-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
}

/* Tab Navigation Styles */
.modal-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    padding: 0.75rem 1rem;
    border: none;
    background: none;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

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

.tab-btn.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

/* Mobile responsive - stack back to 1 column */
@media (max-width: 768px) {
    .modal-body form {
        grid-template-columns: 1fr;
    }
}

/* .modal-footer removed */

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

/* Form Styles */
.form-section {
    margin-bottom: 2rem;
    /* Ensure sections don't break weirdly inside grid */
    break-inside: avoid;
}

.form-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-color);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--bg-secondary);
}

.form-group {
    flex: 1;
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #374151;
}

input,
select {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-family: inherit;
    font-size: 0.9375rem;
}

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

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper .currency {
    position: absolute;
    left: 0.75rem;
    color: var(--text-muted);
    pointer-events: none;
}

.input-wrapper input[type="number"] {
    padding-left: 1.75rem;
}

/* Cost Rows */
.cost-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
    align-items: center;
}

.cost-row .cost-description {
    flex: 2;
}

.cost-row .cost-amount {
    flex: 1;
}

.btn-remove {
    background-color: #fee2e2;
    color: #dc2626;
    border: none;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1;
    transition: background-color 0.2s;
}

.btn-remove:hover {
    background-color: #fecaca;
}

.total-row {
    display: flex;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-weight: 600;
    margin-top: 1rem;
}

/* Pricing Table */
.pricing-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.pricing-table th {
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0.25rem;
    border-bottom: 1px solid var(--border-color);
}

.pricing-table td {
    padding: 0.25rem;
    vertical-align: middle;
    font-size: 0.85rem;
}

.pricing-table tbody tr:nth-child(even) {
    background-color: #f8fafc;
}

.pricing-table tbody tr:hover {
    background-color: #f1f5f9;
}

.pricing-table input {
    padding: 0.2rem;
    font-size: 0.8rem;
}

.read-only-val {
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.9rem;
}

/* Chart */
.chart-container {
    height: 250px;
    width: 100%;
}

/* Utilities */
.hidden {
    display: none !important;
}

/* Data Table (Commissions) */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

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

.data-table th {
    background-color: #f8fafc;
}



/* Link Trips Modal Styles */
.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-linked {
    background-color: #dcfce7;
    color: #166534;
}

.badge-unlinked {
    background-color: #f3f4f6;
    color: #4b5563;
}

.badge-warning {
    background-color: #fef9c3;
    color: #854d0e;
}

.link-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.link-select {
    padding: 0.375rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    max-width: 200px;
}

/* Pricing Mode Toggle */
.toggle-group {
    display: inline-flex;
    background: #e2e8f0;
    padding: 2px;
    border-radius: 0.5rem;
    gap: 2px;
}

.toggle-btn {
    padding: 0.375rem 0.75rem;
    border: none;
    background: transparent;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-muted);
    transition: all 0.2s;
    font-weight: 500;
}

.toggle-btn:hover {
    color: var(--text-main);
}

.toggle-btn.active {
    background: white;
    color: var(--primary-color);
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Travelers Grid */
.travelers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}

.traveler-card {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.traveler-card:hover {
    background-color: #f8fafc;
    border-color: var(--primary-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

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

/* Loading Spinner Animation */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

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

/* Calendar View Styles */
.calendar-container {
    padding: 1.5rem;
    overflow-x: auto;
}

#calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    min-width: 800px;
    border: 1px solid var(--border-color);
    border-right: none;
    border-bottom: none;
}

.calendar-day-header {
    background-color: #f8fafc;
    padding: 0.75rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-muted);
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.calendar-day {
    min-height: 120px;
    padding: 0.5rem;
    background-color: white;
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
    overflow: hidden;
}

.calendar-day.other-month {
    background-color: #f9fafb;
    color: #cbd5e1;
}

.calendar-day.today {
    background-color: #eff6ff;
}

.calendar-day.today .day-number {
    background-color: var(--primary-color);
    color: white;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.day-number {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 4px;
}

/* Trip Event Bars */
.calendar-event {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background-color: transparent;
    /* Changed to transparent */
    color: var(--text-main);
    /* Darker text for visibility */
    border: 1.5px solid #2dd4bf;
    /* Teal border */
    cursor: pointer;
    transition: all 0.1s;
    z-index: 2;
    margin-bottom: 3px;
}

.calendar-event:hover {
    transform: scale(1.02);
    filter: brightness(1.1);
}

.calendar-event.event-start {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
}

.calendar-event.event-end {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-left: none;
}

.calendar-event.event-middle {
    border-radius: 0;
    border-left: none;
    border-right: none;
}

/* Deadline Dots */
.calendar-deadlines {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: auto;
    padding-top: 4px;
}

.deadline-dot {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 4px;
    border-radius: 3px;
    cursor: help;
    border-width: 1.5px;
    border-style: solid;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 12px;
    min-height: 12px;
}

.deadline-dot.supplier {
    border-color: #ef4444;
    background-color: #fee2e2;
    color: #991b1b;
}

.deadline-dot.public {
    border-color: #3b82f6;
    background-color: #dbeafe;
    color: #1e40af;
}

.deadline-dot.info {
    border-color: #10b981;
    background-color: #d1fae5;
    color: #065f46;
}

/* Deadline Bars (full-width like trip bars) */
.calendar-event.deadline-bar {
    background-color: transparent;
}

.calendar-event.deadline-bar.supplier {
    border-color: #ef4444;
    color: #991b1b;
}

.calendar-event.deadline-bar.public {
    border-color: #3b82f6;
    color: #1e40af;
}

.calendar-event.deadline-bar.info {
    border-color: #10b981;
    color: #065f46;
}

/* Drag and Drop Reordering */
.drag-handle {
    cursor: grab;
    user-select: none;
    font-size: 1rem;
    color: #94a3b8;
    transition: color 0.15s ease;
}

.drag-handle:hover {
    color: #475569;
}

.drag-handle:active {
    cursor: grabbing;
}

tr.dragging {
    opacity: 0.5;
    background: #e2e8f0 !important;
}

tr.dragging td {
    background: #e2e8f0 !important;
}

/* ================================================
   MOBILE RESPONSIVE FIXES 
   ================================================ */
@media (max-width: 768px) {

    /* Modal improvements */
    .modal {
        width: 100%;
        max-width: 100%;
        max-height: 100vh;
        height: 100%;
        border-radius: 0;
        margin: 0;
    }

    .modal-header {
        padding: 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .modal-header h2 {
        font-size: 1.25rem;
        order: 1;
        flex: 1;
    }

    .modal-header .close-btn {
        order: 0;
    }

    .modal-header .btn-group {
        order: 2;
        width: 100%;
        display: flex;
        gap: 0.5rem;
    }

    .modal-header .btn-group .btn {
        flex: 1;
    }

    .modal-body {
        padding: 1rem;
    }

    /* Modal tabs - horizontal scroll */
    .modal-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 0;
        flex-wrap: nowrap;
        padding-bottom: 2px;
    }

    .modal-tabs .tab-btn {
        flex-shrink: 0;
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
        white-space: nowrap;
    }

    /* Form rows - stack vertically */
    .form-row {
        flex-direction: column;
        gap: 0.75rem;
    }

    /* Form sections less padding */
    .form-section {
        margin-bottom: 1.5rem;
    }

    .form-section h3 {
        font-size: 1rem;
    }

    /* Pricing section specific */
    .pricing-grid,
    .costs-summary {
        grid-template-columns: 1fr !important;
    }

    /* Main content padding */
    .main-content {
        padding: 1rem;
        padding-top: 60px;
        /* Account for mobile header */
    }

    /* Mobile header */
    .mobile-header {
        display: flex;
        align-items: center;
        gap: 1rem;
        padding: 0.75rem 1rem;
        background: var(--secondary-bg);
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 98;
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-sm);
    }

    .mobile-header .logo-text {
        font-weight: 700;
        font-size: 1.125rem;
        color: var(--text-main);
    }

    /* View headers */
    .view-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .view-header h1 {
        font-size: 1.5rem;
    }

    /* View toggle and controls - wrap */
    .view-toggle {
        width: 100%;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .view-toggle .btn {
        flex: 1;
        min-width: auto;
        padding: 0.5rem;
        font-size: 0.875rem;
    }

    /* Travelers view fixes */
    .travelers-controls,
    .filter-bar {
        flex-direction: column;
        gap: 0.75rem;
    }

    .travelers-controls input,
    .travelers-controls select,
    .filter-bar input,
    .filter-bar select {
        width: 100%;
    }

    /* Data tables - horizontal scroll wrapper */
    .data-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -1rem;
        padding: 0 1rem;
    }

    .data-table-wrapper table {
        min-width: 600px;
    }

    /* Settings view */
    .settings-section {
        padding: 1rem;
    }

    .settings-grid,
    .settings-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }

    .settings-buttons .btn {
        width: 100%;
    }

    /* Historic trips table scroll */
    .historic-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Calendar responsive */
    .calendar-grid {
        font-size: 0.75rem;
    }

    .calendar-day {
        min-height: 60px;
        padding: 4px;
    }

    .calendar-event {
        font-size: 0.65rem;
        padding: 2px 4px;
    }

    /* Trip cards on dashboard */
    .trip-card .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .trip-card .card-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .modal-tabs .tab-btn {
        padding: 0.5rem;
        font-size: 0.8rem;
    }

    .stats-grid .stat-card {
        padding: 1rem;
    }

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

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

/* ===========================
   Extension Cards
   =========================== */
.extension-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
    background: white;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.extension-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    user-select: none;
    transition: background var(--transition-fast);
}

.extension-card-header:hover {
    background: #f1f5f9;
}

.extension-card-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.extension-collapse-icon {
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: transform var(--transition-fast);
    width: 1rem;
    text-align: center;
}

.extension-card-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.extension-card-body {
    padding: 1rem;
}

.extension-card .pricing-table {
    border-collapse: collapse;
    width: 100%;
}

.extension-card .pricing-table th,
.extension-card .pricing-table td {
    padding: 0.35rem 0.5rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
}

.extension-card .pricing-table th {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}

.extension-card .pricing-table input {
    text-align: center;
    padding: 0.25rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .ext-costs-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ===========================
   Phase 5: Vendor & Payment Tracking
   =========================== */

.cost-row-wrapper {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    background: white;
    overflow: hidden;
}

.cost-row-main {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
}

.cost-row-main input[type="text"],
.cost-row-main input[type="number"] {
    flex: 1;
    min-width: 0;
}

.cost-row-main select.cost-currency {
    flex: 0 0 70px;
    min-width: 70px;
    padding: 0.3rem 0.2rem;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--secondary-bg);
    color: var(--text-muted);
    cursor: pointer;
}

.cost-row-extras {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0 0.5rem 0.35rem;
    flex-wrap: wrap;
}

.vendor-toggle {
    font-size: 0.72rem;
    color: var(--text-muted);
    cursor: pointer;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.15rem 0.5rem;
    background: none;
    white-space: nowrap;
}

.vendor-toggle:hover {
    background: var(--secondary-bg);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.vendor-field {
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 0.15rem 0 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.vendor-field.hidden {
    display: none;
}

.vendor-field input {
    flex: 1;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    background: var(--secondary-bg);
}

.vendor-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: #e0f2fe;
    color: #0369a1;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Payment Accordion */
.payment-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    color: var(--primary-color);
    cursor: pointer;
    border: none;
    background: none;
    font-weight: 600;
}

.payment-toggle:hover {
    color: var(--primary-hover);
}

.payment-panel {
    background: var(--secondary-bg);
    border-top: 1px solid var(--border-color);
    padding: 0.5rem;
}

.payment-panel table {
    width: 100%;
    font-size: 0.8rem;
    border-collapse: collapse;
}

.payment-panel th {
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
    padding: 0.25rem 0.4rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.payment-panel td {
    padding: 0.25rem 0.4rem;
}

.payment-panel input {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.2rem 0.4rem;
    font-size: 0.8rem;
}

.payment-panel input[type="date"] {
    width: 130px;
}

.payment-panel input[type="number"] {
    width: 90px;
}

.payment-panel select {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.2rem 0.4rem;
    font-size: 0.8rem;
}

.payment-summary {
    display: flex;
    gap: 1rem;
    padding: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-top: 1px dashed var(--border-color);
    margin-top: 0.25rem;
}

.payment-summary .paid {
    color: var(--success-color);
}

.payment-summary .due {
    color: var(--error-color);
}

.btn-add-payment {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border: 1px dashed var(--primary-color);
    background: none;
    color: var(--primary-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    margin-top: 0.25rem;
}

.btn-add-payment:hover {
    background: var(--primary-glow);
}

/* Balance Due Badge (on trip cards) */
.balance-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: var(--warning-bg);
    color: #92400e;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.4rem;
}

.balance-badge.paid {
    background: var(--success-bg);
    color: #065f46;
}

/* ===========================
   Phase 5B: Checklists
   =========================== */

.checklist-container {
    padding: 0.5rem 0;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-fast);
}

.checklist-item:hover {
    background: var(--secondary-bg);
}

.checklist-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.checklist-item.done .checklist-task-text {
    text-decoration: line-through;
    color: var(--text-light);
}

.checklist-task-text {
    flex: 1 1 0;
    min-width: 0;
    font-size: 0.9rem;
    padding: 0.3rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: white;
}

.checklist-due {
    flex: 0 0 140px;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 0.3rem 0.4rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.checklist-progress {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* ===========================
   Phase 5B: Analytics Panel
   =========================== */

.analytics-panel {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.analytics-panel h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.analytics-chart-card {
    background: var(--secondary-bg);
    border-radius: var(--radius-md);
    padding: 1rem;
    min-height: 250px;
}

.analytics-chart-card h4 {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===========================
   Accordion - Progressive Disclosure
   =========================== */

.accordion-section {
    position: relative;
}

.accordion-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem 0;
    text-align: left;
    transition: opacity var(--transition-fast);
}

.accordion-trigger:hover {
    opacity: 0.8;
}

.accordion-icon {
    display: inline-block;
    font-size: 0.8rem;
    transition: transform var(--transition-normal);
    color: var(--text-muted);
}

.accordion-trigger[aria-expanded="true"] .accordion-icon {
    transform: rotate(90deg);
}

.accordion-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--primary-color);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: auto;
}

.accordion-panel {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height var(--transition-slow), opacity var(--transition-normal);
}

.accordion-panel.is-open {
    max-height: 800px;
    opacity: 1;
    padding-top: 0.75rem;
}