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

        body {
            font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background: #faf8f3;
            min-height: 100vh;
        }

        /* Header */
        .header {
            background: linear-gradient(135deg, #1f2a46 0%, #2a3a5c 100%);
            padding: 15px 30px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        }

        .header h1 {
            color: white;
            font-size: 1.5em;
            font-weight: 700;
        }

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

        .company-info {
            color: white;
            text-align: right;
        }

        .company-info .company-name {
            font-weight: 600;
            font-size: 1.1em;
        }

        .company-info .company-role {
            font-size: 0.85em;
            opacity: 0.9;
        }

        .btn-logout {
            background: rgba(255,255,255,0.2);
            color: white;
            border: none;
            padding: 10px 20px;
            border-radius: 8px;
            cursor: pointer;
            font-weight: 600;
            transition: all 0.3s;
        }

        .btn-logout:hover {
            background: rgba(255,255,255,0.3);
        }

        /* Login Form */
        .login-container {
            display: none;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            background: linear-gradient(135deg, #1f2a46 0%, #2a3a5c 100%);
        }

        /* Loading screen shown while checking session */
        #loadingScreen {
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            background: linear-gradient(135deg, #1f2a46 0%, #2a3a5c 100%);
            flex-direction: column;
            gap: 20px;
        }
        #loadingScreen .spinner {
            width: 40px;
            height: 40px;
            border: 3px solid rgba(255,255,255,0.2);
            border-top-color: #d4a853;
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
        }
        #loadingScreen .loading-text {
            color: rgba(255,255,255,0.7);
            font-size: 0.95em;
            font-family: 'Inter', sans-serif;
        }
        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        .login-card {
            background: white;
            padding: 40px;
            border-radius: 20px;
            box-shadow: 0 10px 40px rgba(0,0,0,0.2);
            width: 100%;
            max-width: 400px;
        }

        .login-card h2 {
            text-align: center;
            color: #1f2a46;
            margin-bottom: 30px;
            font-size: 1.8em;
        }

        .login-card .subtitle {
            text-align: center;
            color: #5a6478;
            margin-bottom: 30px;
            font-size: 0.95em;
        }

        .form-group {
            margin-bottom: 20px;
        }

        .form-group label {
            display: block;
            margin-bottom: 8px;
            color: #1f2a46;
            font-weight: 600;
        }

        .form-group input {
            width: 100%;
            padding: 12px 15px;
            border: 2px solid #e0e0e0;
            border-radius: 10px;
            font-size: 1em;
            transition: border-color 0.3s;
        }

        .form-group input:focus {
            outline: none;
            border-color: #d4a853;
        }

        .btn-login {
            width: 100%;
            padding: 15px;
            background: linear-gradient(135deg, #1f2a46 0%, #2a3a5c 100%);
            color: white;
            border: none;
            border-radius: 10px;
            font-size: 1.1em;
            font-weight: 600;
            cursor: pointer;
            transition: transform 0.3s, box-shadow 0.3s;
        }

        .btn-login:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 20px rgba(31, 42, 70, 0.4);
        }

        .error-message {
            background: #fee2e2;
            color: #dc2626;
            padding: 12px;
            border-radius: 8px;
            margin-bottom: 20px;
            text-align: center;
            display: none;
        }

        /* Dashboard Container */
        .dashboard-container {
            display: none;
            padding: 30px;
            max-width: 1400px;
            margin: 0 auto;
        }

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

        .stat-card {
            background: white;
            padding: 25px;
            border-radius: 15px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.05);
        }

        .stat-card h3 {
            color: #5a6478;
            font-size: 0.9em;
            margin-bottom: 10px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .stat-card .stat-value {
            font-size: 2.5em;
            font-weight: 700;
            color: #d4a853;
        }

        .stat-card .stat-detail {
            color: #999;
            font-size: 0.9em;
            margin-top: 5px;
        }

        #unreadMessagesCard:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 25px rgba(212, 168, 83, 0.3);
        }

        .unread-client-list {
            max-height: 400px;
            overflow-y: auto;
            padding: 5px 0;
        }

        .unread-client-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 14px 16px;
            background: #faf8f3;
            border-radius: 12px;
            margin-bottom: 8px;
            cursor: pointer;
            transition: all 0.2s;
            border-left: 4px solid #d4a853;
        }

        .unread-client-row:hover {
            background: #f5f0e6;
            transform: translateX(4px);
        }

        .unread-client-info {
            display: flex;
            flex-direction: column;
            gap: 2px;
        }

        .unread-client-name {
            font-weight: 600;
            color: #1f2a46;
            font-size: 1em;
        }

        .unread-client-preview {
            color: #5a6478;
            font-size: 0.85em;
        }

        .unread-client-badge {
            background: #e53935;
            color: white;
            font-weight: 700;
            font-size: 0.85em;
            padding: 4px 12px;
            border-radius: 20px;
            min-width: 28px;
            text-align: center;
        }

        .unread-empty {
            text-align: center;
            padding: 40px 20px;
            color: #5a6478;
        }

        .unread-empty-icon {
            font-size: 3em;
            margin-bottom: 10px;
        }

        /* Tabs */
        .tabs {
            display: flex;
            gap: 10px;
            margin-bottom: 20px;
            border-bottom: 2px solid #e0e0e0;
            padding-bottom: 10px;
        }

        .tab-btn {
            padding: 12px 25px;
            border: none;
            background: transparent;
            color: #5a6478;
            font-size: 1em;
            font-weight: 600;
            cursor: pointer;
            border-radius: 8px 8px 0 0;
            transition: all 0.3s;
        }

        .tab-btn.active {
            background: #d4a853;
            color: #1f2a46;
        }

        .tab-btn:hover:not(.active) {
            background: #fdf6e3;
            color: #d4a853;
        }

        .tab-content {
            display: none;
        }

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

        /* Cards */
        .card {
            background: white;
            border-radius: 15px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.05);
            padding: 25px;
            margin-bottom: 20px;
        }

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

        .card-header h2 {
            color: #1f2a46;
            font-size: 1.3em;
        }

        .btn-small {
            padding: 8px 15px;
            border: none;
            border-radius: 6px;
            font-size: 0.85em;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
        }

        .btn-delete {
            background: #fee2e2;
            color: #dc2626;
        }

        .btn-delete:hover {
            background: #dc2626;
            color: white;
        }

        .btn-edit {
            background: #dbeafe;
            color: #2563eb;
        }

        .btn-edit:hover {
            background: #2563eb;
            color: white;
        }

        .btn-reset {
            background: #fef3c7;
            color: #d97706;
        }

        .btn-reset:hover {
            background: #d97706;
            color: white;
        }
















        .toggle-switch {
            display: flex;
            align-items: center;
            gap: 15px;
        }

        .toggle-switch input[type="checkbox"] {
            width: 50px;
            height: 26px;
            appearance: none;
            background: #ccc;
            border-radius: 13px;
            position: relative;
            cursor: pointer;
            transition: background 0.3s;
        }

        .toggle-switch input[type="checkbox"]:checked {
            background: #d4a853;
        }

        .toggle-switch input[type="checkbox"]::before {
            content: '';
            position: absolute;
            width: 22px;
            height: 22px;
            background: white;
            border-radius: 50%;
            top: 2px;
            left: 2px;
            transition: left 0.3s;
        }

        .toggle-switch input[type="checkbox"]:checked::before {
            left: 26px;
        }


        .btn-primary {
            background: linear-gradient(135deg, #1f2a46 0%, #2a3a5c 100%);
            color: white;
            border: none;
            padding: 15px 30px;
            border-radius: 10px;
            font-size: 1em;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
        }

        .btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 20px rgba(31, 42, 70, 0.4);
        }

        .btn-secondary {
            background: #f3f4f6;
            color: #374151;
            border: none;
            padding: 15px 30px;
            border-radius: 10px;
            font-size: 1em;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
        }

        .btn-secondary:hover {
            background: #e5e7eb;
        }

        /* Modal */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.5);
            justify-content: center;
            align-items: center;
            z-index: 1000;
        }

        .modal.show {
            display: flex;
        }

        .modal-content {
            background: white;
            padding: 30px;
            border-radius: 20px;
            width: 100%;
            max-width: 500px;
            max-height: 90vh;
            overflow-y: auto;
        }

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

        .modal-header h2 {
            color: #1f2a46;
        }

        .modal-close {
            background: none;
            border: none;
            font-size: 1.5em;
            cursor: pointer;
            color: #999;
        }

        .modal-close:hover {
            color: #1f2a46;
        }

        /* Limit warning */
        .limit-warning {
            background: #fef3c7;
            border: 1px solid #f59e0b;
            color: #92400e;
            padding: 15px;
            border-radius: 10px;
            margin-bottom: 20px;
        }

        /* ========== PORTED FROM AGENT DASHBOARD: Widget Grid + Detail View ========== */

        /* Detail Header/Content */
        .detail-header {
            padding: 30px;
            background: linear-gradient(135deg, #1f2a46 0%, #2a3a5c 100%);
            color: white;
            border-radius: 15px 15px 0 0;
        }

        .detail-header h1 {
            font-size: 2em;
            margin-bottom: 10px;
        }

        .detail-header .client-meta {
            display: flex;
            gap: 30px;
            font-size: 0.95em;
            opacity: 0.95;
            flex-wrap: wrap;
        }

        .detail-content {
            padding: 30px;
        }

        /* Widget Grid Layout */
        #clientList { max-height: calc(100vh - 420px); overflow-y: auto; }
        #clientDetailCard { max-height: calc(100vh - 280px); overflow-y: auto; }

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

        .widget-card {
            background: white;
            border-radius: 16px;
            padding: 24px;
            box-shadow: 0 2px 12px rgba(0,0,0,0.08);
            cursor: pointer;
            transition: all 0.3s ease;
            border: 2px solid transparent;
            position: relative;
            overflow: hidden;
        }

        .widget-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 4px;
            background: linear-gradient(90deg, #1f2a46 0%, #d4a853 100%);
            transform: scaleX(0);
            transition: transform 0.3s ease;
        }

        .widget-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 8px 24px rgba(31, 42, 70, 0.2);
            border-color: rgba(212, 168, 83, 0.3);
        }

        .widget-card:hover::before {
            transform: scaleX(1);
        }

        .widget-icon {
            font-size: 2.5em;
            margin-bottom: 12px;
            display: block;
        }

        .widget-title {
            font-size: 1.1em;
            font-weight: 700;
            color: #1f2a46;
            margin-bottom: 8px;
        }

        .widget-count {
            font-size: 2em;
            font-weight: 800;
            color: #d4a853;
            margin: 10px 0;
        }

        .widget-desc {
            font-size: 0.9em;
            color: #5a6478;
            margin-bottom: 12px;
        }

        .widget-status {
            display: inline-block;
            padding: 6px 14px;
            border-radius: 20px;
            font-size: 0.85em;
            font-weight: 600;
            margin-top: 8px;
        }

        .widget-status.success {
            background: #d4edda;
            color: #155724;
        }

        .widget-status.warning {
            background: #fff3cd;
            color: #856404;
        }

        .widget-status.info {
            background: #d1ecf1;
            color: #0c5460;
        }

        /* ===== COMPACT WIDGET CARDS OVERRIDE ===== */
        .widgets-grid {
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
            gap: 14px;
        }
        .widget-card {
            padding: 16px;
            border-radius: 12px;
        }
        .widget-icon {
            font-size: 1.8em;
            margin-bottom: 8px;
        }
        .widget-title {
            font-size: 0.95em;
            margin-bottom: 4px;
        }
        .widget-count {
            font-size: 1.5em;
            margin: 6px 0;
        }
        .widget-desc {
            font-size: 0.8em;
            margin-bottom: 8px;
        }
        .widget-status {
            padding: 4px 10px;
            font-size: 0.75em;
            margin-top: 4px;
        }
        .widget-card:hover {
            transform: translateY(-3px);
        }

        /* ===== STAT GRID WIDGETS ===== */
        .pill-section { margin-top: 20px; }
        .pill-group { margin-bottom: 18px; }
        .pill-group-label {
            font-size: 0.65em;
            font-weight: 700;
            letter-spacing: 0.12em;
            text-transform: uppercase;
            color: #b0b8cc;
            margin-bottom: 8px;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .pill-group-label::after {
            content: '';
            flex: 1;
            height: 1px;
            background: #f0f2f7;
        }
        .pill-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 6px;
        }
        .pill-bar {
            padding: 10px 10px 8px;
            border: 1px solid #eef0f6;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.15s ease;
            text-align: left;
            background: white;
            width: 100%;
            font-family: inherit;
        }
        .pill-bar:hover { border-color: #c5ceea; background: #f7f9fe; }
        .pill-bar:active { background: #eff3ff; }
        .pill-bar-count {
            font-size: 1.35em;
            font-weight: 800;
            color: #1f2a46;
            line-height: 1;
            display: block;
        }
        .pill-bar-count.sw-zero { color: #d0d6e8; }
        .pill-bar-count.sw-alert { color: #e53935; }
        .pill-bar-label {
            font-size: 0.68em;
            font-weight: 500;
            color: #8a93a8;
            margin-top: 4px;
            display: block;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .pill-bar:hover .pill-bar-label { color: #5a6478; }
        /* Segment row inside segment modal */
        .seg-row {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 10px 12px;
            border: 1px solid #e5e9f2;
            border-radius: 8px;
            margin-bottom: 6px;
            background: white;
        }
        .seg-row-info { flex: 1; min-width: 0; }
        .seg-row-title { font-size: 0.88em; font-weight: 600; color: #1f2a46; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .seg-row-sub { font-size: 0.78em; color: #5a6478; margin-top: 2px; }
        .seg-row-status { font-size: 0.7em; font-weight: 700; padding: 2px 8px; border-radius: 6px; white-space: nowrap; flex-shrink: 0; }
        .seg-row-edit { font-size: 0.78em; padding: 4px 10px; border: 1px solid #d0d5e8; border-radius: 6px; cursor: pointer; background: white; color: #1f2a46; white-space: nowrap; flex-shrink: 0; }
        .seg-row-edit:hover { background: #f0f4ff; }
        /* Segment detail panel */
        .seg-detail-back {
            background: none; border: none; color: #6b7280; font-size: 0.85em;
            cursor: pointer; padding: 0 0 12px 0; display: flex; align-items: center; gap: 4px;
        }
        .seg-detail-back:hover { color: #1f2a46; }
        .seg-detail-grid {
            display: grid; grid-template-columns: 140px 1fr; gap: 6px 16px;
            margin-bottom: 20px;
        }
        .seg-detail-label { font-size: 0.8em; color: #8a93a8; font-weight: 500; padding-top: 3px; }
        .seg-detail-value { font-size: 0.9em; color: #1f2a46; font-weight: 500; }
        .seg-detail-input {
            width: 100%; padding: 5px 8px; border: 1px solid #d0d6e8; border-radius: 5px;
            font-size: 0.875em; font-family: inherit; color: #1f2a46; box-sizing: border-box;
        }
        .seg-detail-actions { display: flex; gap: 8px; margin-top: 8px; padding-top: 16px; border-top: 1px solid #eef0f6; }
        .seg-detail-status {
            display: inline-block; font-size: 0.72em; font-weight: 700; letter-spacing: 0.06em;
            padding: 3px 10px; border-radius: 20px; text-transform: uppercase; margin-bottom: 14px;
        }
        .seg-itin-heading {
            font-size: 0.72em;
            font-weight: 700;
            letter-spacing: 0.1em;
            text-transform: uppercase;
            color: #8a93a8;
            margin: 16px 0 8px;
            padding-bottom: 6px;
            border-bottom: 1px solid #e5e9f2;
        }
        .seg-itin-heading:first-child { margin-top: 0; }
        .seg-itin-date { font-weight: 400; text-transform: none; letter-spacing: 0; margin-left: 8px; color: #a0aabb; }

        /* Widget Detail Modal */
        .widget-modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0,0,0,0.5);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 10000;
            padding: 20px;
        }

        .widget-modal-overlay.show {
            display: flex;
        }

        .widget-modal {
            background: white;
            border-radius: 20px;
            max-width: 900px;
            width: 100%;
            max-height: 90vh;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            box-shadow: 0 20px 60px rgba(0,0,0,0.3);
        }

        .widget-modal-header {
            padding: 30px;
            background: linear-gradient(135deg, #1f2a46 0%, #2a3a5c 100%);
            color: white;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .widget-modal-header h2 {
            font-size: 1.8em;
            margin: 0;
        }

        .widget-modal-close {
            background: rgba(255,255,255,0.2);
            border: none;
            color: white;
            font-size: 1.5em;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            cursor: pointer;
            transition: all 0.3s;
        }

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

        .widget-modal-body {
            padding: 30px;
            overflow-y: auto;
            flex: 1;
        }

        .widget-modal-footer {
            padding: 20px 30px;
            background: #faf8f3;
            border-top: 1px solid #e0e0e0;
            display: flex;
            gap: 15px;
            justify-content: flex-end;
        }

        /* Document Viewer */
        .document-viewer {
            background: #faf8f3;
            border-radius: 12px;
            padding: 20px;
            margin: 15px 0;
        }

        .document-item {
            background: white;
            border: 1px solid #e0e0e0;
            border-radius: 8px;
            padding: 15px;
            margin-bottom: 10px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            transition: all 0.2s;
        }

        .document-item:hover {
            border-color: #d4a853;
            box-shadow: 0 2px 8px rgba(212, 168, 83, 0.15);
        }

        .document-info {
            flex: 1;
        }

        .document-name {
            font-weight: 600;
            color: #1f2a46;
            margin-bottom: 4px;
        }

        .document-meta {
            font-size: 0.85em;
            color: #5a6478;
        }

        .document-actions {
            display: flex;
            gap: 10px;
        }

        .doc-btn {
            padding: 8px 16px;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            font-weight: 600;
            font-size: 0.9em;
            transition: all 0.2s;
        }

        .doc-btn-view {
            background: #1f2a46;
            color: white;
        }

        .doc-btn-view:hover {
            background: #2a3a5c;
        }

        .doc-btn-download {
            background: #fdf6e3;
            color: #d4a853;
        }

        .doc-btn-download:hover {
            background: #f5f0e6;
        }

        /* PDF Viewer Styles */
        .pdf-viewer-container {
            width: 100%;
            height: 600px;
            border-radius: 12px;
            overflow: hidden;
            background: #f5f5f5;
            border: 2px solid #e0e0e0;
        }

        .pdf-viewer-iframe {
            width: 100%;
            height: 100%;
            border: none;
        }

        .pdf-viewer-header {
            background: linear-gradient(135deg, #1f2a46 0%, #2a3a5c 100%);
            color: white;
            padding: 15px 20px;
            font-weight: 600;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .pdf-download-btn {
            background: rgba(255, 255, 255, 0.2);
            color: white;
            border: 1px solid rgba(255, 255, 255, 0.3);
            padding: 8px 16px;
            border-radius: 6px;
            cursor: pointer;
            font-weight: 600;
            transition: all 0.3s;
        }

        .pdf-download-btn:hover {
            background: rgba(255, 255, 255, 0.3);
            transform: translateY(-1px);
        }

        .doc-btn-pdf {
            background: #1f2a46;
            color: white;
            border: none;
            padding: 8px 16px;
            border-radius: 6px;
            cursor: pointer;
            font-size: 0.9em;
            font-weight: 600;
            transition: all 0.3s;
            margin-left: 8px;
        }

        .doc-btn-pdf:hover {
            background: #2a3a5c;
            transform: translateY(-1px);
        }

        /* Itinerary Editor Styles */
        .itin-editor-modal {
            max-width: 1000px !important;
            width: 95% !important;
            max-height: 90vh;
        }

        .itin-editor-body {
            max-height: 75vh;
            overflow-y: auto;
            padding: 20px;
            background: #f0f2f5;
        }

        .itin-save-bar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 20px 25px;
            background: #faf8f3;
            border-top: 1px solid #e0e0e0;
        }

        .itin-save-btn {
            background: linear-gradient(135deg, #1f2a46 0%, #2a3a5c 100%);
            color: white;
            border: none;
            padding: 18px 40px;
            border-radius: 12px;
            font-size: 1.2em;
            font-weight: 700;
            cursor: pointer;
            box-shadow: 0 4px 15px rgba(31, 42, 70, 0.3);
            transition: all 0.3s ease;
        }

        .itin-save-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(31, 42, 70, 0.4);
        }

        .itin-cancel-btn {
            background: #e5e7eb;
            color: #374151;
            border: none;
            padding: 18px 35px;
            border-radius: 12px;
            font-size: 1.1em;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .itin-cancel-btn:hover {
            background: #d1d5db;
        }

        /* Itinerary Card styles */
        .ie-flight-card {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white; padding: 20px; margin-bottom: 15px; border-radius: 10px;
        }
        .ie-hotel-card {
            background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
            color: white; padding: 20px; margin-bottom: 15px; border-radius: 10px;
        }
        .ie-transfer-card {
            background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
            color: white; padding: 20px; margin-bottom: 15px; border-radius: 10px;
        }
        .ie-activity-card {
            background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
            color: white; padding: 20px; margin-bottom: 15px; border-radius: 10px;
        }
        .ie-car-card {
            background: linear-gradient(135deg, #3d9a8b 0%, #2d7a6d 100%);
            color: white; padding: 20px; margin-bottom: 15px; border-radius: 10px;
        }
        .ie-train-card {
            background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
            color: white; padding: 20px; margin-bottom: 15px; border-radius: 10px;
        }
        .ie-cruise-card {
            background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
            color: white; padding: 20px; margin-bottom: 15px; border-radius: 10px;
        }
        .ie-overview-card {
            background: linear-gradient(135deg, #1f2a46 0%, #2d3a5a 100%);
            color: white; padding: 20px; margin-bottom: 15px; border-radius: 10px;
        }

        .ie-field-grid {
            display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-size: 0.9em;
        }
        .ie-edit-btn {
            background: rgba(255,255,255,0.2); border: 1px solid rgba(255,255,255,0.3);
            color: white; padding: 5px 10px; border-radius: 5px; font-size: 0.8em; cursor: pointer;
        }
        .ie-edit-btn:hover { background: rgba(255,255,255,0.3); }
        .ie-edit-form { display: none; background: rgba(255,255,255,0.1); padding: 15px; border-radius: 8px; margin-top: 10px; }
        .ie-edit-form.visible { display: block; }
        .ie-edit-row { display: flex; gap: 10px; margin-bottom: 10px; }
        .ie-edit-row label { flex: 1; }
        .ie-edit-row input, .ie-edit-row textarea {
            width: 100%; padding: 8px; border: 1px solid rgba(255,255,255,0.3);
            border-radius: 4px; margin-top: 4px; background: rgba(255,255,255,0.9);
        }
        .ie-edit-row span { font-size: 0.8em; color: rgba(255,255,255,0.8); }
        .ie-save-btn { background: #1f2a46; color: white; border: none; padding: 6px 12px; border-radius: 4px; cursor: pointer; }
        .ie-cancel-btn { background: #ef4444; color: white; border: none; padding: 6px 12px; border-radius: 4px; cursor: pointer; margin-left: 5px; }
        .ie-delete-btn { background: rgba(239,68,68,0.3); color: white; border: none; padding: 6px 12px; border-radius: 4px; cursor: pointer; margin-left: 5px; }

        .ie-voucher-section { margin-top: 15px; padding-top: 15px; border-top: 1px solid rgba(255,255,255,0.2); }
        .ie-voucher-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
        .ie-voucher-item { background: rgba(255,255,255,0.2); padding: 6px 10px; border-radius: 5px; display: flex; align-items: center; gap: 6px; font-size: 0.85em; }
        .ie-voucher-remove { background: rgba(255,255,255,0.3); border: none; color: white; width: 18px; height: 18px; border-radius: 50%; cursor: pointer; font-size: 0.75em; line-height: 1; }
        .ie-add-voucher-btn { background: rgba(255,255,255,0.15); border: 2px dashed rgba(255,255,255,0.4); color: white; padding: 8px 15px; border-radius: 6px; cursor: pointer; font-size: 0.85em; }
        .ie-add-voucher-btn:hover { background: rgba(255,255,255,0.25); }

        /* File Upload Area */
        .file-upload-area {
            border: 3px dashed #d4a853;
            border-radius: 12px;
            padding: 40px 20px;
            text-align: center;
            cursor: pointer;
            transition: all 0.3s;
            background: #fdf6e3;
            margin-bottom: 20px;
        }

        .file-upload-area:hover {
            background: #f5f0e6;
            border-color: #c49b45;
        }

        .file-upload-area.dragover {
            background: #f0e8d4;
            border-color: #c49b45;
            transform: scale(1.02);
        }

        .file-info {
            background: #faf8f3;
            padding: 15px;
            border-radius: 8px;
            margin-top: 15px;
            display: none;
        }

        .file-info.show {
            display: block;
        }

        .file-info p {
            margin: 5px 0;
            color: #5a6478;
        }

        /* Flight Alerts Panel */
        .flight-alerts-panel {
            position: fixed;
            top: 80px;
            right: 20px;
            width: 400px;
            max-height: 600px;
            background: white;
            border-radius: 12px;
            box-shadow: 0 10px 40px rgba(0,0,0,0.2);
            z-index: 1000;
            overflow: hidden;
            animation: slideInRight 0.3s ease;
        }

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

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

        .flight-alerts-header {
            background: linear-gradient(135deg, #1f2a46 0%, #2a3a5c 100%);
            color: white;
            padding: 15px 20px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .flight-alerts-header h3 { margin: 0; font-size: 1.1em; }

        .close-alerts-btn {
            background: none; border: none; color: white; font-size: 1.5em;
            cursor: pointer; padding: 0; width: 30px; height: 30px;
            display: flex; align-items: center; justify-content: center;
            border-radius: 50%; transition: background 0.2s;
        }

        .close-alerts-btn:hover { background: rgba(255,255,255,0.2); }

        .flight-alerts-list { max-height: 540px; overflow-y: auto; padding: 10px; }

        .flight-alert-item {
            background: white; border: 2px solid #e0e0e0; border-radius: 8px;
            padding: 15px; margin-bottom: 10px; transition: all 0.2s;
        }
        .flight-alert-item:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); transform: translateY(-2px); }
        .flight-alert-item.cancelled { border-color: #ef4444; background: #fef2f2; }
        .flight-alert-item.delayed { border-color: #f59e0b; background: #fffbeb; }

        .alert-type-badge { display: inline-block; padding: 4px 12px; border-radius: 12px; font-size: 0.75em; font-weight: bold; margin-bottom: 8px; }
        .alert-type-badge.cancelled { background: #ef4444; color: white; }
        .alert-type-badge.delayed { background: #f59e0b; color: white; }
        .alert-flight-number { font-weight: bold; font-size: 1.1em; margin: 5px 0; }
        .alert-client-name { color: #d4a853; font-weight: 600; }
        .alert-route { color: #5a6478; margin: 5px 0; }
        .alert-timestamp { font-size: 0.85em; color: #999; margin-top: 8px; }
        .no-alerts-message { text-align: center; padding: 40px 20px; color: #999; }

        /* Finalization styles */
        .finalization-modal-overlay {
            position: fixed; top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.7); display: flex; align-items: center;
            justify-content: center; z-index: 10000;
        }
        .finalization-modal {
            background: white; border-radius: 15px; max-width: 800px; width: 90%;
            max-height: 85vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
        }
        .finalization-modal-header {
            background: linear-gradient(135deg, #1f2a46 0%, #2a3a5c 100%);
            color: white; padding: 25px; border-radius: 15px 15px 0 0;
        }
        .finalization-modal-header h2 { margin: 0 0 10px 0; }
        .finalization-modal-header p { margin: 0; opacity: 0.9; }
        .finalization-modal-body { padding: 30px; }
        .finalization-modal-footer {
            display: flex; gap: 15px; justify-content: flex-end;
            padding: 20px 30px; border-top: 1px solid #e0e0e0;
        }
        .finalization-modal-footer button {
            padding: 12px 30px; border: none; border-radius: 8px;
            font-weight: 600; cursor: pointer; transition: all 0.3s;
        }
        .finalization-modal-footer .btn-cancel { background: #6c757d; color: white; }
        .finalization-modal-footer .btn-finalize { background: linear-gradient(135deg, #1f2a46 0%, #2a3a5c 100%); color: white; }
        .finalization-modal-footer button:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(0,0,0,0.2); }

        /* Voucher Badge */
        .voucher-badge {
            display: inline-block; min-width: 24px; height: 24px; padding: 0 5px; background: #FFD700;
            color: white; font-weight: bold; font-size: 14px; text-align: center;
            line-height: 24px; border-radius: 4px; margin-left: 8px; cursor: pointer;
            transition: all 0.2s; vertical-align: middle;
        }
        .voucher-badge:hover { background: #FFC700; transform: scale(1.1); box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4); }

        .eticket-badge, .emd-badge {
            display: inline-block; min-width: 24px; height: 24px; padding: 0 5px; background: #3b82f6;
            color: white; font-weight: bold; font-size: 14px; text-align: center;
            line-height: 24px; border-radius: 4px; margin-left: 4px; cursor: pointer;
            transition: all 0.2s; vertical-align: middle;
        }
        .eticket-badge:hover, .emd-badge:hover { background: #60a5fa; transform: scale(1.1); box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4); }

        /* Action buttons for widgets */
        .action-btn {
            padding: 15px 20px;
            background: white;
            border: 2px solid #e0e0e0;
            border-radius: 10px;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: 0.95em;
            font-weight: 600;
        }

        .action-btn:hover {
            border-color: #d4a853;
            background: #fdf6e3;
            transform: translateY(-2px);
        }

        /* Status badges */
        .status-badge { padding: 5px 12px; border-radius: 20px; font-size: 0.8em; font-weight: 600; }
        .status-draft { background: #fff3cd; color: #856404; }
        .status-finalized { background: #d1ecf1; color: #0c5460; }
        .status-uploaded { background: #d4edda; color: #155724; }

        /* Button styles from agent dashboard */
        .btn-view { background: #1f2a46; color: white; }
        .btn-view:hover { background: #2a3a5c; }
        .btn-upload { background: #28a745; color: white; }
        .btn-upload:hover { background: #218838; }
        .btn-message { background: #17a2b8; color: white; }
        .btn-message:hover { background: #138496; }
        .btn-success { background: #28a745; color: white; }
        .btn-success:hover { background: #218838; }
        .btn-danger { background: #dc3545; color: white; }
        .btn-danger:hover { background: #c82333; }
        .btn-danger:disabled { background: #ccc; cursor: not-allowed; }

        /* Trip info box */
        .trip-info-box { background: #faf8f3; border-radius: 8px; padding: 15px; margin-bottom: 20px; }
        .trip-info-item { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #e0e0e0; }
        .trip-info-item:last-child { border-bottom: none; }
        .trip-info-label { font-weight: 600; color: #5a6478; }
        .trip-info-value { color: #1f2a46; }

        /* Document category styles */
        .document-section { margin-bottom: 30px; }
        .document-section h3 { margin: 0 0 15px 0; color: #1f2a46; font-size: 1.2em; }
        .document-category { background: #faf8f3; border-left: 4px solid #d4a853; padding: 20px; margin-bottom: 20px; border-radius: 8px; }
        .document-category-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; }
        .document-category-title { font-weight: 600; font-size: 1.1em; color: #1f2a46; }
        .document-category-badge { padding: 5px 12px; border-radius: 20px; font-size: 0.85em; font-weight: 600; }
        .document-category-badge.archive { background: #28a745; color: white; }
        .document-category-badge.delete { background: #dc3545; color: white; }
        .document-category-badge.optional { background: #ffc107; color: #1f2a46; }

        /* Full message modal styles */
        .full-message-overlay {
            position: fixed; top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.5); display: flex; align-items: center;
            justify-content: center; z-index: 10001; padding: 20px;
        }

        @keyframes pulse-badge {
            0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(229, 57, 53, 0.4); }
            50% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(229, 57, 53, 0); }
        }

        /* ========== Upload Documents Modal ========== */
        .upload-modal-overlay {
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0, 0, 0, 0.6);
            z-index: 20000;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
            animation: uploadFadeIn 0.25s ease;
        }
        @keyframes uploadFadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }
        .upload-modal {
            background: #fff;
            border-radius: 20px;
            width: 100%;
            max-width: 700px;
            max-height: 90vh;
            overflow-y: auto;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
            position: relative;
            animation: uploadSlideUp 0.3s ease;
        }
        @keyframes uploadSlideUp {
            from { transform: translateY(30px); opacity: 0; }
            to { transform: translateY(0); opacity: 1; }
        }
        .upload-modal-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 20px 25px;
            border-bottom: 1px solid #e5e7eb;
        }
        .upload-modal-header h2 {
            margin: 0;
            font-size: 1.2em;
            color: #1f2937;
            font-weight: 700;
        }
        .upload-modal-close {
            background: none;
            border: none;
            font-size: 1.5em;
            cursor: pointer;
            color: #9ca3af;
            padding: 5px;
            line-height: 1;
            transition: color 0.2s;
        }
        .upload-modal-close:hover {
            color: #374151;
        }
        .upload-modal-body {
            padding: 25px;
        }

        /* Step Indicator */
        .upload-steps {
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 30px;
            gap: 0;
        }
        .upload-step {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 0.85em;
            color: #9ca3af;
            font-weight: 500;
            transition: color 0.3s;
        }
        .upload-step.active {
            color: #d4a853;
            font-weight: 600;
        }
        .upload-step.completed {
            color: #d4a853;
        }
        .upload-step-circle {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            border: 2px solid #d1d5db;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.8em;
            font-weight: 700;
            transition: all 0.3s;
            flex-shrink: 0;
        }
        .upload-step.active .upload-step-circle {
            border-color: #d4a853;
            background: #d4a853;
            color: white;
        }
        .upload-step.completed .upload-step-circle {
            border-color: #d4a853;
            background: #d4a853;
            color: white;
        }
        .upload-step-line {
            width: 50px;
            height: 2px;
            background: #d1d5db;
            margin: 0 10px;
            transition: background 0.3s;
        }
        .upload-step-line.completed {
            background: #d4a853;
        }

        /* Drop Zone */
        .upload-drop-zone {
            border: 2px dashed #d1d5db;
            border-radius: 16px;
            padding: 40px 20px;
            text-align: center;
            cursor: pointer;
            transition: all 0.3s;
            background: #f9fafb;
            margin-bottom: 20px;
        }
        .upload-drop-zone:hover,
        .upload-drop-zone.dragover {
            border-color: #d4a853;
            background: #fdf6e3;
        }
        .upload-drop-zone-icon {
            font-size: 3em;
            margin-bottom: 10px;
        }
        .upload-drop-zone-text {
            font-size: 1em;
            color: #6b7280;
            margin-bottom: 5px;
        }
        .upload-drop-zone-hint {
            font-size: 0.85em;
            color: #9ca3af;
        }

        /* File List */
        .upload-file-list {
            display: flex;
            flex-direction: column;
            gap: 8px;
            margin-bottom: 20px;
        }
        .upload-file-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px 15px;
            background: #f9fafb;
            border-radius: 12px;
            border: 1px solid #e5e7eb;
        }
        .upload-file-icon {
            font-size: 1.5em;
            flex-shrink: 0;
        }
        .upload-file-info {
            flex: 1;
            min-width: 0;
        }
        .upload-file-name {
            font-weight: 600;
            font-size: 0.9em;
            color: #1f2937;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .upload-file-size {
            font-size: 0.8em;
            color: #9ca3af;
        }
        .upload-file-remove {
            background: none;
            border: none;
            font-size: 1.2em;
            color: #9ca3af;
            cursor: pointer;
            padding: 5px;
            transition: color 0.2s;
            flex-shrink: 0;
        }
        .upload-file-remove:hover {
            color: #ef4444;
        }

        /* Process Button */
        .upload-process-btn {
            width: 100%;
            padding: 14px 20px;
            background: linear-gradient(135deg, #1f2a46 0%, #2a3a5c 100%);
            color: white;
            border: none;
            border-radius: 12px;
            font-size: 1em;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
        }
        .upload-process-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 20px rgba(31, 42, 70, 0.4);
        }
        .upload-process-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
            transform: none;
            box-shadow: none;
        }

        /* Processing Step */
        .upload-processing {
            text-align: center;
            padding: 60px 20px;
        }
        .upload-spinner {
            width: 60px;
            height: 60px;
            border: 4px solid #e5e7eb;
            border-top-color: #d4a853;
            border-radius: 50%;
            animation: uploadSpin 0.8s linear infinite;
            margin: 0 auto 25px;
        }
        @keyframes uploadSpin {
            to { transform: rotate(360deg); }
        }
        .upload-processing-title {
            font-size: 1.2em;
            font-weight: 700;
            color: #1f2937;
            margin-bottom: 8px;
        }
        .upload-processing-status {
            font-size: 0.95em;
            color: #6b7280;
            margin-bottom: 20px;
        }
        .upload-progress-bar {
            width: 100%;
            max-width: 350px;
            height: 8px;
            background: #e5e7eb;
            border-radius: 10px;
            margin: 0 auto;
            overflow: hidden;
        }
        .upload-progress-fill {
            height: 100%;
            background: linear-gradient(90deg, #1f2a46, #d4a853);
            border-radius: 10px;
            transition: width 0.4s ease;
            width: 0%;
        }

        /* Review Step */
        .upload-trip-card {
            background: linear-gradient(135deg, #1f2a46 0%, #2a3a5c 100%);
            border-radius: 16px;
            padding: 20px 25px;
            color: white;
            margin-bottom: 20px;
        }
        .upload-trip-card h3 {
            margin: 0 0 6px 0;
            font-size: 1.2em;
            font-weight: 700;
        }
        .upload-trip-card .upload-trip-dates {
            font-size: 0.9em;
            opacity: 0.9;
            margin-bottom: 4px;
        }
        .upload-trip-card .upload-trip-traveller {
            font-size: 0.85em;
            opacity: 0.8;
        }

        .upload-section {
            margin-bottom: 20px;
        }
        .upload-section-header {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 1em;
            font-weight: 700;
            color: #1f2937;
            margin-bottom: 10px;
        }
        .upload-section-header .upload-section-icon {
            font-size: 1.2em;
        }
        .upload-section-count {
            background: #d4a853;
            color: white;
            padding: 2px 8px;
            border-radius: 10px;
            font-size: 0.8em;
            font-weight: 600;
        }

        .upload-item-card {
            padding: 14px 16px;
            background: #f9fafb;
            border-radius: 12px;
            border: 1px solid #e5e7eb;
            margin-bottom: 8px;
        }
        .upload-item-title {
            font-weight: 600;
            font-size: 0.95em;
            color: #1f2937;
            margin-bottom: 4px;
        }
        .upload-item-detail {
            font-size: 0.85em;
            color: #6b7280;
            margin-bottom: 2px;
        }
        .upload-item-badge {
            display: inline-block;
            background: #e0e7ff;
            color: #4338ca;
            padding: 3px 8px;
            border-radius: 6px;
            font-size: 0.75em;
            font-weight: 600;
            margin-top: 5px;
            margin-right: 4px;
        }

        /* Document items with confidence */
        .upload-doc-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px 15px;
            background: #f9fafb;
            border-radius: 12px;
            border: 1px solid #e5e7eb;
            margin-bottom: 8px;
        }
        .upload-doc-name {
            flex: 1;
            font-weight: 600;
            font-size: 0.9em;
            color: #1f2937;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .upload-doc-type {
            font-size: 0.8em;
            color: #6b7280;
        }
        .upload-confidence-badge {
            padding: 3px 10px;
            border-radius: 20px;
            font-size: 0.75em;
            font-weight: 600;
            flex-shrink: 0;
        }
        .confidence-high {
            background: #d1fae5;
            color: #065f46;
        }
        .confidence-medium {
            background: #fef3c7;
            color: #92400e;
        }
        .confidence-low {
            background: #fee2e2;
            color: #991b1b;
        }

        /* Review Footer */
        .upload-review-footer {
            display: flex;
            gap: 12px;
            margin-top: 25px;
        }
        .upload-btn-reupload {
            flex: 0 0 auto;
            padding: 12px 24px;
            background: #f3f4f6;
            color: #374151;
            border: 1px solid #d1d5db;
            border-radius: 12px;
            font-size: 0.95em;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
        }
        .upload-btn-reupload:hover {
            background: #e5e7eb;
        }
        .upload-btn-confirm {
            flex: 1;
            padding: 12px 24px;
            background: linear-gradient(135deg, #1f2a46 0%, #2a3a5c 100%);
            color: white;
            border: none;
            border-radius: 12px;
            font-size: 1em;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
        }
        .upload-btn-confirm:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 20px rgba(31, 42, 70, 0.4);
        }
        .upload-btn-confirm:disabled {
            opacity: 0.5;
            cursor: not-allowed;
            transform: none;
            box-shadow: none;
        }

        /* Error display inside modal */
        .upload-error {
            background: #fef2f2;
            border: 1px solid #fecaca;
            color: #991b1b;
            padding: 12px 16px;
            border-radius: 10px;
            font-size: 0.9em;
            margin-bottom: 15px;
            display: none;
        }
        .upload-error.show {
            display: block;
        }

        /* ============================================================
           CLIENT VIEW PREVIEW MODAL — scoped with cv- prefix
           ============================================================ */
        #clientViewModal {
            position: fixed; top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.6);
            display: none; z-index: 10001;
            justify-content: center; align-items: center;
        }
        #clientViewModal.show { display: flex; }
        .cv-modal {
            background: #5d6d94;
            width: 100%; max-width: 900px; max-height: 95vh;
            border-radius: 20px; overflow: hidden;
            display: flex; flex-direction: column;
            box-shadow: 0 20px 60px rgba(0,0,0,0.4);
        }
        .cv-header {
            padding: 24px 30px;
            background: linear-gradient(135deg, #1f2a46 0%, #2a3a5c 100%);
            color: white;
            display: flex; justify-content: space-between; align-items: center;
            flex-shrink: 0;
        }
        .cv-header h2 { margin: 0; font-size: 1.3em; }
        .cv-header-sub { font-size: 0.85em; color: rgba(255,255,255,0.7); margin-top: 4px; }
        .cv-close {
            background: rgba(255,255,255,0.2); color: white; border: none;
            font-size: 1.5em; width: 40px; height: 40px; border-radius: 50%;
            cursor: pointer; transition: all 0.3s;
        }
        .cv-close:hover { background: rgba(255,255,255,0.3); transform: rotate(90deg); }
        .cv-toolbar {
            padding: 12px 30px; background: #4a5a80;
            display: flex; align-items: center; gap: 12px; flex-shrink: 0;
        }
        .cv-toolbar label { color: rgba(255,255,255,0.8); font-size: 13px; font-weight: 600; }
        .cv-toolbar select {
            padding: 6px 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.3);
            background: rgba(255,255,255,0.15); color: white; font-size: 13px;
        }
        .cv-toolbar select option { color: #333; background: white; }
        .cv-body {
            flex: 1; overflow-y: auto; padding: 30px;
        }
        .cv-day-card {
            background: white; border-radius: 20px; padding: 25px;
            margin-bottom: 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.05);
        }
        .cv-day-header {
            display: flex; align-items: center; gap: 16px;
            margin-bottom: 20px; padding-bottom: 12px;
            border-bottom: 2px solid #fdf6e3;
        }
        .cv-day-number {
            background: linear-gradient(135deg, #f5c842 0%, #e6b817 100%);
            color: #1f2a46; width: 50px; height: 50px; border-radius: 50%;
            display: flex; align-items: center; justify-content: center;
            font-size: 1.3em; font-weight: 700; flex-shrink: 0;
        }
        .cv-day-info h3 { color: #333; font-size: 1.2em; margin: 0; }
        .cv-day-date { color: #999; font-size: 0.9em; margin-top: 2px; }
        .cv-activity {
            display: flex; gap: 16px; padding: 15px;
            background: #fafbff; border-radius: 12px; margin-bottom: 12px;
        }
        .cv-activity-time {
            color: #1f2a46; font-weight: 700; min-width: 80px; font-size: 1em;
        }
        .cv-activity-content h4 { color: #333; margin: 0 0 6px 0; font-size: 1em; }
        .cv-activity-content p { color: #666; line-height: 1.5; font-size: 0.9em; margin: 0; }
        .cv-flight-activity {
            background: linear-gradient(135deg, #f0f7ff 0%, #e6f3ff 100%);
            border-left: 4px solid #1f2a46;
        }
        .cv-accommodation {
            background: #fdf6e3; padding: 18px; border-radius: 12px;
            margin-bottom: 12px; border-left: 4px solid #1f2a46;
        }
        .cv-accommodation h4 { color: #333; font-size: 1em; margin: 0 0 8px 0; }
        .cv-accommodation p { color: #666; line-height: 1.6; font-size: 0.9em; margin: 0; }
        .cv-checkin-reminder {
            background: #e8f5e9; border-left: 4px solid #4caf50;
            padding: 10px 15px; border-radius: 8px; margin-bottom: 12px;
            font-size: 0.9em; color: #2e7d32; display: flex; align-items: center; gap: 8px;
        }
        .cv-checkout-reminder {
            background: #fff3e0; border-left: 4px solid #ff9800;
            padding: 10px 15px; border-radius: 8px; margin-bottom: 12px;
            font-size: 0.9em; color: #e65100; display: flex; align-items: center; gap: 8px;
        }
        .cv-staying-reminder {
            background: #e3f2fd; border-left: 4px solid #2196f3;
            padding: 10px 15px; border-radius: 8px; margin-bottom: 12px;
            font-size: 0.9em; color: #1565c0; display: flex; align-items: center; gap: 8px;
        }
        .cv-hotel-name { font-weight: 600; }
        .cv-meals-included {
            background: #fff3cd; padding: 12px 15px; border-radius: 10px;
            margin-top: 12px; border-left: 4px solid #f39c12;
        }
        .cv-meals-included h4 { color: #856404; font-size: 0.9em; margin: 0 0 6px 0; }
        .cv-meals-included p { color: #856404; font-size: 0.85em; margin: 0; }
        .cv-free-day {
            padding: 15px; background: #f9f9f9; border-radius: 12px;
            color: #999; text-align: center; font-style: italic;
        }
        .cv-stops-info {
            margin-top: 8px; padding: 10px; background: #fff3e0;
            border-radius: 6px; font-size: 0.85em;
        }
        .cv-voucher-badge {
            display: inline-block; min-width: 24px; height: 24px; padding: 0 5px;
            background: #1f2a46; color: #fff; font-weight: bold; font-size: 14px;
            text-align: center; line-height: 24px; border-radius: 4px; margin-left: 8px;
            cursor: pointer; transition: all 0.2s; vertical-align: middle;
        }
        .cv-voucher-badge:hover { background: #f5c842; transform: scale(1.1); box-shadow: 0 2px 8px rgba(245,200,66,0.4); }
        .cv-eticket-badge {
            display: inline-block; min-width: 24px; height: 24px; padding: 0 5px;
            background: #3b82f6; color: #fff; font-weight: bold; font-size: 14px;
            text-align: center; line-height: 24px; border-radius: 4px; margin-left: 4px;
            cursor: pointer; transition: all 0.2s; vertical-align: middle;
        }
        .cv-eticket-badge:hover { background: #60a5fa; transform: scale(1.1); box-shadow: 0 2px 8px rgba(59,130,246,0.4); }
        .cv-emd-badge {
            display: inline-block; min-width: 24px; height: 24px; padding: 0 5px;
            background: #3b82f6; color: #fff; font-weight: bold; font-size: 14px;
            text-align: center; line-height: 24px; border-radius: 4px; margin-left: 4px;
            cursor: default; transition: all 0.2s; vertical-align: middle;
        }
        .cv-emd-badge:hover { background: #60a5fa; transform: scale(1.1); box-shadow: 0 2px 8px rgba(59,130,246,0.4); }
        .cv-badges { display: inline-flex; align-items: center; margin-left: 8px; }
        .cv-maps-link { color: #1f2a46; text-decoration: underline; cursor: pointer; }
        .cv-maps-link:hover { color: #3b82f6; }

        /* ========== SIDEBAR NAVIGATION ========== */
        #dashboardSection.sidebar-active {
            display: flex !important;
            flex-direction: row;
            height: 100vh;
            overflow: hidden;
        }
        .sidebar-nav {
            width: 88px; min-width: 88px; height: 100vh;
            background: linear-gradient(180deg, #1a2340 0%, #1f2a46 50%, #243050 100%);
            display: flex; flex-direction: column; align-items: center;
            padding: 12px 0; transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            z-index: 100; position: relative; overflow: hidden; flex-shrink: 0;
        }
        .sidebar-nav:hover, .sidebar-nav.expanded { width: 220px; }
        .sidebar-brand { padding: 12px 0 20px; text-align: center; width: 100%; }
        .sidebar-logo {
            display: block;
            max-width: 76px;
            max-height: 56px;
            object-fit: contain;
            margin: 0 auto;
        }
        .sidebar-items {
            flex: 1; width: 100%; display: flex; flex-direction: column;
            gap: 4px; padding: 0 8px;
        }
        .sidebar-item {
            display: flex; align-items: center; gap: 14px; width: 100%;
            padding: 12px 14px; border: none; background: transparent;
            color: rgba(255, 255, 255, 0.65); cursor: pointer; border-radius: 10px;
            transition: all 0.2s; font-size: 0.9em; font-weight: 500;
            white-space: nowrap; overflow: hidden; text-align: left; font-family: inherit;
        }
        .sidebar-item:hover { background: rgba(255, 255, 255, 0.1); color: white; }
        .sidebar-item.active { background: rgba(212, 168, 83, 0.2); color: #d4a853; }
        .sidebar-icon { font-size: 1.4em; min-width: 28px; text-align: center; flex-shrink: 0; }
        .sidebar-label { opacity: 0; transition: opacity 0.2s; font-weight: 600; }
        .sidebar-nav:hover .sidebar-label,
        .sidebar-nav.expanded .sidebar-label { opacity: 1; }
        .sidebar-badge {
            background: #d4a853; color: #1f2a46; font-size: 0.75em; font-weight: 700;
            padding: 2px 7px; border-radius: 10px; margin-left: auto;
            opacity: 0; transition: opacity 0.2s;
        }
        .sidebar-nav:hover .sidebar-badge,
        .sidebar-nav.expanded .sidebar-badge { opacity: 1; }
        .sidebar-badge-warning { background: #f59e0b; color: white; }
        .sidebar-badge-danger { background: #ef4444; color: white; }
        .sidebar-footer {
            width: 100%; padding: 8px; border-top: 1px solid rgba(255,255,255,0.1);
            display: flex; flex-direction: column; gap: 4px;
        }
        .sidebar-content-wrapper {
            flex: 1; display: flex; flex-direction: column;
            overflow-y: auto; height: 100vh;
        }
        #dashboardSection.sidebar-active .tabs { display: none !important; }
        #dashboardSection.sidebar-active .stats-grid { display: none; }
        #dashboardSection.sidebar-active[data-active-section="dashboard"] .stats-grid { display: grid; }
        #dashboardSection.sidebar-active #dashboardContainer {
            max-width: 100%; padding: 20px 30px; overflow-y: auto; flex: 1;
        }
        .sidebar-section { display: none; }
        .sidebar-section.active { display: block; }

        /* Dashboard Home Grid */
        .dashboard-home-grid {
            display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px;
        }
        .dash-card {
            background: white; border-radius: 15px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.05); overflow: hidden;
        }
        .dash-card-wide { grid-column: 1 / -1; }
        .dash-card-header {
            display: flex; justify-content: space-between; align-items: center;
            padding: 18px 20px; border-bottom: 1px solid #f0f0f0;
        }
        .dash-card-header h3 { color: #1f2a46; font-size: 1.05em; margin: 0; }
        .dash-card-body { padding: 15px 20px; max-height: 300px; overflow-y: auto; }
        .dash-card-badge {
            background: #d4a853; color: white; padding: 3px 10px;
            border-radius: 12px; font-size: 0.85em; font-weight: 700;
        }
        .dash-badge-danger { background: #ef4444; }
        .dash-empty { text-align: center; color: #999; padding: 20px; }
        .dash-activity-item {
            display: flex; gap: 12px; padding: 10px 0;
            border-bottom: 1px solid #f5f5f5;
        }
        .dash-activity-item:last-child { border-bottom: none; }
        .dash-activity-icon {
            width: 36px; height: 36px; border-radius: 50%; background: #fdf6e3;
            display: flex; align-items: center; justify-content: center; flex-shrink: 0;
        }
        .dash-activity-content { flex: 1; }
        .dash-activity-text { color: #1f2a46; font-size: 0.9em; }
        .dash-activity-time { color: #999; font-size: 0.8em; margin-top: 2px; }
        .dash-trip-item {
            display: flex; justify-content: space-between; align-items: center;
            padding: 10px 0; border-bottom: 1px solid #f5f5f5;
            cursor: pointer; transition: background 0.2s;
        }
        .dash-trip-item:hover { background: #faf8f3; margin: 0 -20px; padding: 10px 20px; }
        .dash-trip-item:last-child { border-bottom: none; }
        .agg-task-item {
            display: flex; align-items: center; gap: 15px; padding: 14px 16px;
            background: #faf8f3; border-radius: 10px; margin-bottom: 8px;
            border-left: 4px solid #d4a853; transition: all 0.2s;
        }
        .agg-task-item:hover { transform: translateX(3px); box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
        .agg-task-item.overdue { border-left-color: #ef4444; }
        .agg-task-item.high-priority { border-left-color: #ef4444; }
        .agg-task-item.done { opacity: 0.6; border-left-color: #28a745; }
        .agg-task-client { font-size: 0.8em; color: #d4a853; font-weight: 600; }
        .agg-task-title { font-weight: 600; color: #1f2a46; }
        .agg-task-due { font-size: 0.85em; color: #5a6478; }
        .agg-task-actions { margin-left: auto; display: flex; gap: 8px; }

        /* Remove all wasted space in sidebar mode */
        #dashboardSection.sidebar-active #dashboardContainer {
            max-width: 100%;
            padding: 0;
            margin: 0;
        }
        #dashboardSection.sidebar-active .header {
            padding: 10px 24px;
            margin: 0;
        }
        #dashboardSection.sidebar-active .stats-grid {
            padding: 15px 24px;
            margin: 0;
            gap: 15px;
        }
        /* Dashboard home section padding */
        #dashboardSection.sidebar-active #dashboardHomeSection {
            padding: 0 24px 24px;
        }
        /* Clients tab: fill full height, no card boxing */
        #dashboardSection.sidebar-active #clientsTab {
            padding: 0;
        }
        #dashboardSection.sidebar-active #clientsTab > div {
            min-height: calc(100vh - 80px);
            gap: 0;
        }
        #dashboardSection.sidebar-active #clientsTab > div > .card {
            box-shadow: none;
            border-radius: 0;
            margin-bottom: 0;
            padding: 15px;
            background: #f8f8f8;
        }
        #dashboardSection.sidebar-active #clientsTab > div > .card:last-child {
            background: white;
            border-left: 1px solid #e8e8e8;
            padding: 20px 24px;
        }
        /* Fix right panel — make clients layout a true fixed split pane */
        #dashboardSection.sidebar-active[data-active-section=clients] #dashboardContainer {
            overflow-y: hidden;
            padding: 0;
            display: flex;
            flex-direction: column;
        }
        #dashboardSection.sidebar-active[data-active-section=clients] #clientsTab {
            flex: 1;
            min-height: 0;
            display: flex;
            flex-direction: column;
        }
        #dashboardSection.sidebar-active[data-active-section=clients] #clientsTab > div {
            flex: 1;
            min-height: 0;
            height: 100%;
            overflow: hidden;
        }
        #dashboardSection.sidebar-active[data-active-section=clients] #clientsTab > div > .card {
            height: 100%;
            overflow-y: auto;
        }
        /* Support tab fill space */
        #dashboardSection.sidebar-active #supportTab {
            padding: 24px;
        }
        #dashboardSection.sidebar-active #supportTab > .card {
            box-shadow: none;
            border-radius: 12px;
        }
        /* Newsfeed fill space */
        #dashboardSection.sidebar-active #newsfeedTab {
            padding: 24px;
        }
        #dashboardSection.sidebar-active #newsfeedTab > .card {
            box-shadow: none;
            border-radius: 12px;
        }
        /* Tasks section padding */
        #dashboardSection.sidebar-active #tasksSection {
            padding: 24px;
        }

        /* Calendar hides main container so it fills the wrapper */
        #dashboardSection.sidebar-active[data-active-section=calendar] #dashboardContainer {
            display: none;
        }
        #dashboardSection.sidebar-active[data-active-section=calendar] #calendarTab {
            flex: 1;
            min-height: 0;
        }
        /* Calendar full-page layout */
        #dashboardSection.sidebar-active #calendarTab {
            padding: 0;
        }
        #dashboardSection.sidebar-active #calendarTab > .card {
            height: calc(100vh - 80px);
            display: flex;
            flex-direction: column;
            box-shadow: none;
            border-radius: 0;
            margin: 0;
        }
        #dashboardSection.sidebar-active #calendarTab #calendarGrid {
            flex: 1;
            min-height: 0;
        }
        #dashboardSection.sidebar-active #calendarTab #calendarGrid > div {
            height: 100%;
        }

        /* Report results */
        .report-result-item {
            background: white; border-radius: 12px; padding: 18px;
            margin-bottom: 10px; border-left: 4px solid #d4a853;
            box-shadow: 0 1px 4px rgba(0,0,0,0.04);
        }
        .report-result-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
        .report-result-name { font-weight: 700; color: #1f2a46; font-size: 1.05em; }
        .report-result-ref { color: #d4a853; font-size: 0.85em; font-weight: 600; margin-left: 8px; }
        .report-result-contact { color: #5a6478; font-size: 0.85em; margin-top: 4px; }
        .report-result-trip { margin-top: 10px; padding-top: 10px; border-top: 1px solid #f0f0f0; }
        .report-result-trip-title { font-weight: 600; color: #1f2a46; }
        .report-result-dates { color: #5a6478; font-size: 0.9em; margin-top: 2px; }
        .report-result-match { display: inline-block; background: #fdf6e3; color: #d4a853; padding: 3px 10px; border-radius: 8px; font-size: 0.8em; font-weight: 600; margin-top: 6px; }
        #dashboardSection.sidebar-active #reportsSection { padding: 24px; }

        /* Mobile: sidebar becomes bottom nav */
        @media (max-width: 768px) {
            #dashboardSection.sidebar-active { flex-direction: column; }
            .sidebar-nav {
                width: 100% !important; min-width: 100%; height: 60px;
                flex-direction: row; order: 2; position: fixed;
                bottom: 0; left: 0; right: 0; padding: 0 8px;
                z-index: 999; box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
            }
            .sidebar-brand { display: none; }
            .sidebar-footer { display: none; }
            .sidebar-items {
                flex-direction: row; justify-content: space-around; padding: 0; gap: 0;
            }
            .sidebar-item {
                flex-direction: column; padding: 8px 4px; gap: 2px;
                border-radius: 0; align-items: center; justify-content: center;
            }
            .sidebar-icon { font-size: 1.2em; min-width: auto; }
            .sidebar-label { opacity: 1 !important; font-size: 0.65em; }
            .sidebar-badge { display: none; }
            .sidebar-content-wrapper {
                padding-bottom: 70px; height: calc(100vh - 60px) !important;
            }
            .dashboard-home-grid { grid-template-columns: 1fr; }
            .dash-card-wide { grid-column: 1; }
        }

        /* AI Help Desk Chat Widget */
        .ai-chat-fab {
            position: fixed; bottom: 24px; right: 24px; width: 60px; height: 60px;
            border-radius: 50%; background: linear-gradient(135deg, #1f2a46, #2a3a5c);
            color: #d4a853; border: none; cursor: pointer; z-index: 10050;
            box-shadow: 0 4px 20px rgba(31,42,70,0.4); display: flex; align-items: center;
            justify-content: center; font-size: 28px; transition: transform 0.3s, box-shadow 0.3s;
        }
        .ai-chat-fab:hover { transform: scale(1.1); box-shadow: 0 6px 28px rgba(31,42,70,0.5); }
        .ai-chat-fab .fab-badge {
            position: absolute; top: -2px; right: -2px; width: 18px; height: 18px;
            background: #ef4444; border-radius: 50%; border: 2px solid white; display: none;
        }

        .ai-chat-panel {
            position: fixed; bottom: 96px; right: 24px; width: 380px; max-height: 520px;
            background: white; border-radius: 16px; box-shadow: 0 8px 40px rgba(0,0,0,0.2);
            z-index: 10050; display: none; flex-direction: column; overflow: hidden;
            font-family: 'Poppins', sans-serif;
        }
        .ai-chat-panel.open { display: flex; }

        .ai-chat-header {
            background: linear-gradient(135deg, #1f2a46, #2a3a5c); color: white;
            padding: 16px 20px; display: flex; align-items: center; gap: 12px;
        }
        .ai-chat-header-icon {
            width: 36px; height: 36px; background: rgba(212,168,83,0.2); border-radius: 50%;
            display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0;
        }
        .ai-chat-header-text h3 { font-size: 0.95em; font-weight: 600; margin: 0; }
        .ai-chat-header-text p { font-size: 0.75em; opacity: 0.7; margin: 0; }
        .ai-chat-close {
            margin-left: auto; background: none; border: none; color: white;
            font-size: 22px; cursor: pointer; opacity: 0.7; padding: 0 4px;
        }
        .ai-chat-close:hover { opacity: 1; }

        .ai-chat-messages {
            flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column;
            gap: 12px; max-height: 340px; min-height: 200px;
        }
        .ai-msg {
            max-width: 85%; padding: 10px 14px; border-radius: 12px; font-size: 0.88em;
            line-height: 1.5; word-wrap: break-word;
        }
        .ai-msg.bot {
            background: #f0f2f5; color: #1f2a46; align-self: flex-start;
            border-bottom-left-radius: 4px;
        }
        .ai-msg.user {
            background: #1f2a46; color: white; align-self: flex-end;
            border-bottom-right-radius: 4px;
        }
        .ai-msg.system {
            background: #fff3cd; color: #856404; align-self: center;
            font-size: 0.8em; text-align: center; border-radius: 8px; padding: 8px 12px;
        }
        .ai-typing { display: flex; gap: 4px; padding: 10px 14px; align-self: flex-start; }
        .ai-typing span {
            width: 8px; height: 8px; background: #bbb; border-radius: 50%;
            animation: aiTypingBounce 1.4s infinite both;
        }
        .ai-typing span:nth-child(2) { animation-delay: 0.2s; }
        .ai-typing span:nth-child(3) { animation-delay: 0.4s; }
        @keyframes aiTypingBounce { 0%,80%,100% { transform: scale(0.6); opacity: 0.4; } 40% { transform: scale(1); opacity: 1; } }

        .ai-chat-input-area {
            padding: 12px 16px; border-top: 1px solid #e5e7eb; display: flex; gap: 8px;
            align-items: center; background: #faf8f3;
        }
        .ai-chat-input {
            flex: 1; border: 1px solid #ddd; border-radius: 20px; padding: 10px 16px;
            font-size: 0.88em; font-family: 'Poppins', sans-serif; outline: none;
            resize: none; max-height: 80px; line-height: 1.4;
        }
        .ai-chat-input:focus { border-color: #d4a853; }
        .ai-chat-send {
            width: 38px; height: 38px; border-radius: 50%; border: none;
            background: #1f2a46; color: #d4a853; cursor: pointer; font-size: 16px;
            display: flex; align-items: center; justify-content: center; flex-shrink: 0;
            transition: background 0.2s;
        }
        .ai-chat-send:hover { background: #2a3a5c; }
        .ai-chat-send:disabled { opacity: 0.5; cursor: not-allowed; }

        .ai-chat-footer {
            padding: 8px 16px; text-align: center; border-top: 1px solid #f0f0f0;
        }
        .ai-chat-escalate {
            background: none; border: none; color: #d4a853; font-size: 0.78em;
            cursor: pointer; font-weight: 500; padding: 4px 8px;
        }
        .ai-chat-escalate:hover { text-decoration: underline; }

        @media (max-width: 768px) {
            .ai-chat-fab { bottom: 76px; right: 16px; width: 52px; height: 52px; font-size: 24px; }
            .ai-chat-panel {
                bottom: 0; right: 0; left: 0; width: 100%; max-height: 85vh;
                border-radius: 16px 16px 0 0;
            }
        }

        /* ========== AI Parse Modal ========== */
        .ai-parse-overlay {
            position: fixed; top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.65); z-index: 21000;
            display: flex; align-items: flex-start; justify-content: center;
            padding: 20px; overflow-y: auto;
            animation: uploadFadeIn 0.2s ease;
        }
        .ai-parse-modal {
            background: #fff; border-radius: 20px; width: 100%; max-width: 960px;
            box-shadow: 0 20px 60px rgba(0,0,0,0.3);
            animation: uploadSlideUp 0.3s ease; margin: auto;
        }
        /* Summary bar */
        .ai-summary-bar {
            display: flex; gap: 12px; flex-wrap: wrap;
            background: #f8fafd; border: 1px solid #e5e9f2; border-radius: 10px;
            padding: 12px 16px; margin-bottom: 16px; align-items: center;
        }
        .ai-sum-item { display: flex; align-items: center; gap: 6px; font-size: 0.84em; font-weight: 600; color: #374151; }
        .ai-sum-item.total { margin-left: auto; color: #64748b; font-weight: 500; }
        .ai-conf-dot {
            width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; display: inline-block;
        }
        .ai-conf-dot.green { background: #16a34a; }
        .ai-conf-dot.amber { background: #d97706; }
        .ai-conf-dot.red   { background: #dc2626; }
        /* Tab bar */
        .ai-parse-tabs {
            display: flex; gap: 4px; flex-wrap: wrap;
            border-bottom: 2px solid #e5e9f2; margin-bottom: 16px;
        }
        .ai-parse-tab {
            padding: 8px 14px; border: none; background: none; cursor: pointer;
            font-size: 0.83em; font-weight: 600; color: #64748b; border-radius: 8px 8px 0 0;
            transition: all 0.15s; white-space: nowrap;
        }
        .ai-parse-tab:hover { background: #f0f2f7; color: #1f2a46; }
        .ai-parse-tab.active { background: #1f2a46; color: #fff; }
        .ai-tab-badge {
            display: inline-block; background: #e5e9f2; color: #374151;
            border-radius: 10px; padding: 1px 7px; font-size: 0.78em;
            margin-left: 5px; font-weight: 700;
        }
        .ai-parse-tab.active .ai-tab-badge { background: rgba(255,255,255,0.25); color: #fff; }
        .ai-tab-badge.empty { opacity: 0.45; }
        /* Tab panels */
        .ai-parse-panel { display: none; }
        .ai-parse-panel.active { display: block; }
        /* Segment cards */
        .ai-seg-card {
            border: 1px solid #e5e9f2; border-left-width: 4px; border-radius: 0 10px 10px 0;
            padding: 14px 16px; margin-bottom: 12px; background: #fff;
        }
        .ai-seg-card.apc-green { border-left-color: #16a34a; }
        .ai-seg-card.apc-amber { border-left-color: #d97706; }
        .ai-seg-card.apc-red   { border-left-color: #dc2626; background: #fff8f8; }
        .ai-seg-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
        .ai-seg-title { font-weight: 700; font-size: 0.92em; color: #1f2a46; }
        .ai-seg-conf { display: flex; align-items: center; gap: 5px; }
        .ai-conf-pct { font-size: 0.78em; color: #64748b; font-weight: 600; }
        .ai-seg-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
        @media (max-width: 600px) { .ai-seg-fields { grid-template-columns: 1fr; } }
        .ai-field-row { font-size: 0.82em; }
        .ai-field-row.uncertain .ai-field-label { color: #d97706; }
        .ai-field-row.uncertain .ai-field-val { color: #92400e; }
        .ai-field-label { color: #64748b; font-weight: 600; margin-bottom: 1px; }
        .ai-field-val { color: #1f2a46; }
        .ai-null-val { color: #cbd5e1; font-style: italic; }
        .ai-uncertain-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
        .ai-utag {
            background: #fef3c7; color: #92400e; border: 1px solid #fde68a;
            border-radius: 6px; padding: 2px 8px; font-size: 0.75em; font-weight: 600;
        }
        .ai-source-details { margin-top: 10px; border-top: 1px solid #f0f2f7; padding-top: 8px; }
        .ai-source-details summary {
            font-size: 0.78em; color: #64748b; cursor: pointer; list-style: none;
        }
        .ai-source-details summary::-webkit-details-marker { display: none; }
        .ai-source-snip {
            margin-top: 8px; background: #f8fafd; border: 1px solid #e5e9f2;
            border-radius: 8px; padding: 10px 12px; font-size: 0.78em;
            color: #374151; line-height: 1.6; white-space: pre-wrap; word-break: break-word;
        }
        /* Overview panel */
        .ai-overview-grid {
            display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 8px;
        }
        @media (max-width: 600px) { .ai-overview-grid { grid-template-columns: 1fr 1fr; } }
        .ai-ov-item {
            background: #f8fafd; border: 1px solid #e5e9f2; border-radius: 10px;
            padding: 12px 14px;
        }
        .ai-ov-label { font-size: 0.75em; color: #64748b; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 4px; }
        .ai-ov-val { font-size: 0.9em; color: #1f2a46; font-weight: 600; }
        .ai-ov-type-row {
            display: flex; justify-content: space-between; align-items: center;
            padding: 8px 0; border-bottom: 1px solid #f0f2f7;
            font-size: 0.85em; color: #374151;
        }
        .ai-ov-type-row:last-child { border-bottom: none; }
        .ai-empty-tab {
            text-align: center; color: #94a3b8; font-style: italic;
            padding: 40px 0; font-size: 0.88em;
        }
        /* Scroll area for step 3 */
        .ai-review-scroll { max-height: 55vh; overflow-y: auto; padding-right: 4px; }
        /* Editable field values */
        .ai-editable {
            display: inline-block; min-width: 30px; cursor: text;
            border-bottom: 1px dotted #cbd5e1; border-radius: 3px;
            padding: 1px 4px; outline: none; transition: background 0.15s, border-color 0.15s;
            color: #1f2a46;
        }
        .ai-editable:empty::before { content: '—'; color: #cbd5e1; font-style: italic; }
        .ai-editable:hover { background: #f0f7ff; border-bottom-color: #93c5fd; }
        .ai-editable:focus { background: #eff6ff; border-bottom: 1px solid #3b82f6; }
        .ai-field-row.uncertain .ai-editable { border-bottom-color: #fbbf24; }
        .ai-field-row.uncertain .ai-editable:focus { border-bottom-color: #d97706; background: #fffbeb; }
        /* Stopover block */
        .ai-stops-block { margin-top: 10px; border-top: 1px solid #f0f2f7; padding-top: 8px; }
        .ai-stops-label { font-size: 0.75em; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 5px; }
        .ai-stop-row { display: flex; justify-content: space-between; align-items: baseline; padding: 4px 0; border-bottom: 1px dashed #f0f2f7; font-size: 0.81em; }
        .ai-stop-row:last-child { border-bottom: none; }
        .ai-stop-airport { color: #1f2a46; font-weight: 600; }
        .ai-stop-times { color: #64748b; }
