*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { touch-action: manipulation; overflow-x: hidden; }

:root {
    --primary: #064273;
    --primary-hover: #0a5a9e;
    --accent: #5aabd6;
    --teal: #30b7ca;
    --navy: #0c1829;
    --navy-light: #11243d;
    --white: #ffffff;
    --bg: #f8f9fb;
    --surface: #ffffff;
    --border: rgba(0,0,0,0.06);
    --border-strong: rgba(0,0,0,0.1);
    --text: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --success: #059669;
    --success-soft: rgba(5, 150, 105, 0.08);
    --warning: #d97706;
    --warning-soft: rgba(217, 119, 6, 0.08);
    --danger: #dc2626;
    --danger-soft: rgba(220, 38, 38, 0.08);
    --info: #2563eb;
    --info-soft: rgba(37, 99, 235, 0.08);
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 2px 8px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.03);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
    --shadow-xl: 0 16px 48px rgba(0,0,0,0.1), 0 4px 12px rgba(0,0,0,0.04);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --transition: 180ms ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

.app { display: flex; min-height: 100vh; }

/* ===== SIDEBAR ===== */
.sidebar {
    width: 256px;
    background: var(--navy);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar-header { padding: 28px 24px 24px; }
.sidebar-logo {
    display: flex; align-items: center; gap: 12px;
    text-decoration: none; color: var(--white);
}
.logo-icon { height: 32px; flex-shrink: 0; }
.logo-icon img { height: 100%; width: auto; object-fit: contain; filter: brightness(0) invert(1); }
.sidebar-nav {
    flex: 1; padding: 8px 12px;
    display: flex; flex-direction: column; gap: 1px;
}
.nav-label {
    font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px;
    color: rgba(255,255,255,0.3); padding: 20px 12px 8px;
}
.nav-item {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 12px; border-radius: var(--radius-sm);
    color: rgba(255,255,255,0.55); text-decoration: none;
    font-size: 13.5px; font-weight: 500;
    transition: all var(--transition); cursor: pointer; position: relative;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.85); }
.nav-item.active { background: rgba(90, 171, 214, 0.12); color: var(--white); }
.nav-item.active::before {
    content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: 3px; height: 18px; background: var(--accent); border-radius: 0 3px 3px 0;
}
.nav-icon { width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.nav-icon svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-footer { padding: 16px; border-top: 1px solid rgba(255,255,255,0.06); }
.user-card {
    display: flex; align-items: center; gap: 11px;
    padding: 8px; border-radius: var(--radius-sm);
    cursor: pointer; transition: background var(--transition);
}
.user-card:hover { background: rgba(255,255,255,0.06); }
.user-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--teal));
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 13px; color: var(--white);
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; color: var(--white); }
.user-email { font-size: 11px; color: rgba(255,255,255,0.4); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== MAIN ===== */
.main { flex: 1; margin-left: 256px; min-height: 100vh; }
.topbar {
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0 32px; height: 60px;
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.mobile-menu-btn { display: none; background: none; border: none; color: var(--text); cursor: pointer; padding: 4px; }
.mobile-menu-btn svg { width: 22px; height: 22px; }
.page-title { font-weight: 600; font-size: 16px; color: var(--text); letter-spacing: -0.2px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.fetch-group { display: flex; align-items: center; }
.fetch-last-updated { display: none; font-size: 10.5px; color: var(--text-muted); text-align: center; }
.content { padding: 28px 32px; max-width: 1260px; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 16px; border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 600; font-family: 'Inter', sans-serif;
    border: none; cursor: pointer; transition: all var(--transition);
    text-decoration: none; white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-hover); box-shadow: var(--shadow-sm); }
.btn-accent { background: linear-gradient(135deg, var(--accent), var(--teal)); color: var(--white); }
.btn-accent:hover { opacity: 0.92; box-shadow: var(--shadow-sm); }
.btn-outline { background: var(--white); color: var(--text); border: 1px solid var(--border-strong); }
.btn-outline:hover { background: var(--bg); box-shadow: var(--shadow-xs); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-success { background: var(--success); color: var(--white); }
.btn-success:hover { opacity: 0.92; box-shadow: var(--shadow-sm); }
.btn-success-soft { background: var(--success-soft); color: var(--success); border: 1px solid rgba(5,150,105,0.2); }
.btn-success-soft:hover { background: rgba(5,150,105,0.14); box-shadow: var(--shadow-xs); }
.btn-sm { padding: 6px 11px; font-size: 12px; border-radius: 7px; }
.btn-lg { padding: 11px 22px; font-size: 14.5px; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text); margin-bottom: 5px; }
.form-input {
    width: 100%; padding: 10px 13px;
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    font-size: 14px; font-family: 'Inter', sans-serif;
    color: var(--text); background: var(--white);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(90,171,214,0.12); }
.form-input::placeholder { color: var(--text-muted); }
select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px;
}

/* ===== CARDS ===== */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 22px; border-bottom: 1px solid var(--border);
}
.card-header h3 { font-size: 14px; font-weight: 600; color: var(--text); letter-spacing: -0.1px; }
.card-body { padding: 22px; }

/* ===== BADGES ===== */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px; border-radius: 6px; font-size: 11.5px; font-weight: 600;
}
.badge.success {
    background: linear-gradient(135deg, rgba(5,150,105,0.12), rgba(5,150,105,0.06));
    color: var(--success); border: 1px solid rgba(5,150,105,0.15);
}
.badge.warning {
    background: linear-gradient(135deg, rgba(217,119,6,0.12), rgba(217,119,6,0.06));
    color: var(--warning); border: 1px solid rgba(217,119,6,0.15);
}
.badge.danger {
    background: linear-gradient(135deg, rgba(220,38,38,0.12), rgba(220,38,38,0.06));
    color: var(--danger); border: 1px solid rgba(220,38,38,0.15);
}
.badge.info {
    background: linear-gradient(135deg, rgba(37,99,235,0.12), rgba(37,99,235,0.06));
    color: var(--info); border: 1px solid rgba(37,99,235,0.15);
}
.badge.neutral {
    background: linear-gradient(135deg, rgba(0,0,0,0.04), rgba(0,0,0,0.02));
    color: var(--text-secondary); border: 1px solid var(--border);
}

/* ===== TABS ===== */
.tab-bar {
    display: flex; gap: 0; border-bottom: 1px solid var(--border);
    padding: 0 22px; background: var(--surface); overflow: visible;
}
.tab {
    padding: 13px 14px; font-size: 13px; font-weight: 600;
    color: var(--text-muted); text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: all var(--transition); cursor: pointer; white-space: nowrap;
}
.tab:hover { color: var(--text-secondary); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-count {
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--bg); color: var(--text-muted);
    font-size: 10.5px; font-weight: 600; padding: 1px 6px; border-radius: 8px; margin-left: 5px;
}
.tab.active .tab-count { background: rgba(6,66,115,0.08); color: var(--primary); }
.tab-dropdown { display: none; }

/* ===== REVIEW BANNER ===== */
.review-banner {
    display: flex; align-items: center; gap: 18px;
    padding: 20px 22px; border-radius: var(--radius); margin-bottom: 18px;
    border: 1px solid rgba(217,119,6,0.25); border-left: 4px solid var(--warning);
    background: linear-gradient(135deg, rgba(217,119,6,0.08) 0%, rgba(217,119,6,0.03) 100%);
    box-shadow: var(--shadow-sm);
}
.review-banner-icon {
    width: 42px; height: 42px; border-radius: 10px;
    background: rgba(217,119,6,0.12); color: var(--warning);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.review-banner-body { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.review-banner-row { display: flex; align-items: center; gap: 8px; }
.review-banner-row strong { font-size: 13.5px; font-weight: 700; color: var(--text); }
.review-banner-row span { font-size: 12.5px; color: var(--text-secondary); }

/* ===== CONNECTION CARD ===== */
.connection-card {
    border-radius: var(--radius-lg); padding: 28px; margin-bottom: 22px;
    box-shadow: var(--shadow-sm); background: var(--white);
    border: 1px solid rgba(5,150,105,0.25); border-left: 4px solid var(--success);
}
.connection-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 22px; }
.connection-info { display: flex; align-items: center; gap: 14px; }
.connection-icon {
    width: 48px; height: 48px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
}
.connection-icon.connected { background: var(--success-soft); color: var(--success); }
.connection-title { font-weight: 700; font-size: 16px; margin-bottom: 2px; letter-spacing: -0.2px; }
.connection-desc { font-size: 13.5px; color: var(--text-secondary); }
.connection-meta { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.meta-item { padding: 14px 16px; background: var(--bg); border-radius: var(--radius-sm); }
.meta-label { font-size: 11px; color: var(--text-muted); font-weight: 500; margin-bottom: 3px; text-transform: uppercase; letter-spacing: 0.4px; }
.meta-value { font-weight: 700; font-size: 14px; letter-spacing: -0.1px; }

/* ===== REVIEW ROWS ===== */
.review-bar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 22px; background: var(--bg); border-bottom: 1px solid var(--border);
}
.or-divider {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 22px; color: var(--text-muted); font-size: 12px; font-weight: 500;
}
.or-divider::before, .or-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.review-row {
    display: flex; flex-direction: column; align-items: flex-start;
    padding: 20px 22px; border-bottom: 1px solid var(--border);
    transition: background var(--transition); gap: 0;
}
.review-row:hover { background: rgba(0,0,0,0.012); }
.review-row:last-child { border-bottom: none; }
.review-row.dismissed {
    opacity: 0; max-height: 0; padding: 0 22px; overflow: hidden; border-bottom: none;
    transition: opacity 300ms ease, max-height 300ms ease, padding 300ms ease;
}
.review-info { flex: 1; display: flex; flex-direction: column; gap: 0; min-width: 0; width: 100%; }
.route-cell { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.route-dot { display: none; }
.route-name { font-weight: 600; font-size: 13px; letter-spacing: -0.1px; }
.route-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.date-expiry { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.delay-tag {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 9px; border-radius: 6px; font-size: 12px; font-weight: 600;
    background: var(--warning-soft); color: var(--warning); white-space: nowrap;
}
.delay-tag.severe { background: var(--danger-soft); color: var(--danger); }
.review-actions { display: flex; width: 100%; margin-top: 16px; flex-direction: column; gap: 12px; }
.review-actions-btns { display: flex; gap: 10px; width: 100%; }
.review-actions-btns .btn-ghost { margin-left: auto; }
.override-label {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 11.5px; font-weight: 600; color: var(--warning);
    background: var(--warning-soft); border: 1px solid rgba(217,119,6,0.15);
    border-radius: 6px; padding: 3px 8px; cursor: default; align-self: flex-start;
}
.override-input {
    width: 36px; padding: 3px 4px;
    border: 1px solid var(--border-strong); border-radius: 4px;
    font-size: 12.5px; text-align: center; font-family: 'Inter', sans-serif; outline: none;
    background: var(--white);
}
.override-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(90,171,214,0.12); }
.expiry-tag { font-size: 10.5px; font-weight: 600; white-space: nowrap; padding: 2px 7px; border-radius: 5px; }
.expiry-tag.urgent { background: var(--danger-soft); color: var(--danger); }
.expiry-tag.normal { background: var(--bg); color: var(--text-muted); }

/* ===== STAGING ===== */
.submit-staging { display: none; margin-top: 22px; }
.submit-staging.has-items { display: block; }
.staging-cards { padding: 0; }
.staging-card {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 22px; border-bottom: 1px solid var(--border);
}
.staging-card:last-child { border-bottom: none; }
.staging-card-left { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.staging-card-info { min-width: 0; }
.staging-card-info .route-name { font-weight: 600; font-size: 13px; }
.staging-card-info .route-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.staging-card-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; margin-left: 16px; }
.submit-staging .remove-btn {
    background: none; border: none; color: var(--text-muted); cursor: pointer;
    font-size: 12px; font-weight: 500; padding: 4px 8px; border-radius: 4px;
    transition: all var(--transition);
}
.submit-staging .remove-btn:hover { color: var(--danger); background: var(--danger-soft); }
.submit-footer {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; background: var(--bg); border-top: 1px solid var(--border);
    border-radius: 0 0 var(--radius) var(--radius);
}

/* ===== JOURNEY CARDS ===== */
.journey-card {
    border-bottom: 1px solid var(--border); padding: 14px 22px;
    cursor: pointer; transition: background var(--transition);
}
.journey-card:last-child { border-bottom: none; }
.journey-card:hover { background: rgba(0,0,0,0.012); }
.journey-card-summary { display: flex; flex-direction: column; gap: 4px; }
.journey-card-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.journey-card-expand {
    width: 20px; height: 20px; color: var(--text-muted);
    transition: transform 200ms ease; flex-shrink: 0;
}
.journey-card.open .journey-card-expand { transform: rotate(180deg); }
.journey-card-details { display: none; padding: 12px 0 4px 0; }
.journey-card.open .journey-card-details { display: block; }
.journey-card-detail { font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; }
.journey-card-detail strong { color: var(--text); font-weight: 600; }
.journey-card-actions { margin-top: 10px; display: flex; align-items: center; gap: 8px; }

/* ===== LINKED CARDS ===== */
.linked-cards { display: flex; gap: 12px; flex-wrap: wrap; }
.linked-card {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; background: var(--bg); border-radius: var(--radius-sm); flex: 1; min-width: 0;
}
.card-chip {
    width: 36px; height: 24px; border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 700; color: var(--white);
}
.card-chip.visa { background: #1a1f71; }
.card-chip.mastercard { background: #eb001b; }
.card-chip.amex { background: #006fcf; }
.card-info .card-label { font-size: 13px; font-weight: 600; }
.card-info .card-number { font-size: 11px; color: var(--text-muted); }

/* ===== SETTINGS ===== */
.settings-section { padding: 22px 0; border-bottom: 1px solid var(--border); }
.settings-section:last-child { border-bottom: none; }
.settings-section h4 { font-weight: 700; font-size: 14.5px; margin-bottom: 3px; letter-spacing: -0.1px; }
.settings-section .section-desc { font-size: 12.5px; color: var(--text-secondary); margin-bottom: 18px; }
.settings-row { display: flex; align-items: center; justify-content: space-between; padding: 11px 0; }
.setting-label { font-size: 13.5px; font-weight: 600; }
.setting-desc { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }
.toggle {
    width: 42px; height: 23px; background: var(--border-strong); border-radius: 12px;
    position: relative; cursor: pointer; transition: background var(--transition); flex-shrink: 0;
}
.toggle.active { background: var(--success); }
.toggle::after {
    content: ''; position: absolute; width: 19px; height: 19px;
    background: var(--white); border-radius: 50%; top: 2px; left: 2px;
    transition: transform var(--transition); box-shadow: var(--shadow-xs);
}
.toggle.active::after { transform: translateX(19px); }

/* ===== PLAN CARDS ===== */
.plan-card {
    border: 1.5px solid var(--border-strong); border-radius: var(--radius-lg);
    padding: 28px; text-align: center; transition: all var(--transition);
}
.plan-card:hover { border-color: var(--accent); box-shadow: var(--shadow-md); }
.plan-card.recommended { border-color: var(--primary); position: relative; }
.plan-card.recommended::before {
    content: 'Best Value'; position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
    background: var(--primary); color: var(--white);
    font-size: 10.5px; font-weight: 600; padding: 3px 12px; border-radius: 8px;
}
.plan-tier { font-size: 12.5px; font-weight: 600; color: var(--text-secondary); }
.plan-price { font-size: 36px; font-weight: 700; color: var(--text); line-height: 1; margin: 14px 0 4px; letter-spacing: -1px; }
.plan-price span { font-size: 14px; font-weight: 500; color: var(--text-muted); letter-spacing: 0; }
.plan-desc { font-size: 12.5px; color: var(--text-muted); margin-bottom: 18px; }
.pro-tag {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px; border-radius: 5px;
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
    background: linear-gradient(135deg, rgba(90,171,214,0.12), rgba(48,183,202,0.12));
    color: var(--primary);
}

/* ===== LOGIN PAGE ===== */
.login-page {
    min-height: 100vh; min-height: 100dvh;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: var(--bg); padding: 24px;
}
.login-logo { margin-bottom: 28px; }
.login-logo img { height: 40px; width: auto; display: block; }
.login-card {
    background: var(--white); border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%; max-width: 400px; padding: 44px 36px; text-align: center;
}
.login-card h1 { font-weight: 700; font-size: 22px; margin-bottom: 6px; letter-spacing: -0.3px; }
.login-card .login-desc { font-size: 13.5px; color: var(--text-secondary); margin-bottom: 28px; line-height: 1.6; }
.login-card .form-input { text-align: center; font-size: 15px; padding: 12px; }
.login-card .btn { width: 100%; justify-content: center; padding: 12px; font-size: 14px; }
.login-divider {
    display: flex; align-items: center; gap: 14px;
    margin: 22px 0; color: var(--text-muted); font-size: 11.5px;
}
.login-divider::before, .login-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ===== ONBOARDING STEPS ===== */
.steps { display: flex; align-items: center; justify-content: center; gap: 6px; margin-bottom: 28px; }
.step-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); }
.step-dot.active { background: var(--primary); width: 24px; border-radius: 4px; }
.step-dot.done { background: var(--success); }
.step-line { width: 28px; height: 1.5px; background: var(--border-strong); }
.step-line.done { background: var(--success); }

/* ===== HELP ===== */
.help-item { padding: 22px 0; border-bottom: 1px solid var(--border); }
.help-item:last-child { border-bottom: none; }
.help-item h4 { font-size: 14px; font-weight: 700; margin-bottom: 6px; letter-spacing: -0.1px; }
.help-item p { font-size: 13px; color: var(--text-secondary); line-height: 1.65; }

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.45);
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    z-index: 300; opacity: 0; pointer-events: none; transition: opacity 200ms ease;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal {
    background: var(--white); border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl); width: 90%; max-width: 440px;
    padding: 32px; transform: translateY(12px); transition: transform 200ms ease;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal h2 { font-size: 18px; font-weight: 700; margin-bottom: 4px; letter-spacing: -0.2px; }
.modal .modal-desc { font-size: 13px; color: var(--text-secondary); margin-bottom: 22px; line-height: 1.6; }
.modal-actions { display: flex; gap: 10px; margin-top: 22px; }
.modal-actions .btn { flex: 1; justify-content: center; }

/* ===== TOAST ===== */
.toast {
    position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%) translateY(20px);
    background: var(--navy); color: var(--white); padding: 14px 24px;
    border-radius: var(--radius); box-shadow: var(--shadow-xl);
    font-size: 13.5px; font-weight: 600; z-index: 600;
    display: flex; align-items: center; gap: 10px;
    opacity: 0; transition: opacity 300ms ease, transform 300ms ease; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast svg { width: 18px; height: 18px; stroke: var(--success); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ===== CONFETTI ===== */
.confetti-wrap {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 999; overflow: hidden;
}
.confetti-piece { position: absolute; width: 8px; height: 8px; border-radius: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== UTILITIES ===== */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mb-16 { margin-bottom: 16px; }
.mb-22 { margin-bottom: 22px; }
.mb-28 { margin-bottom: 28px; }
.text-sm { font-size: 12.5px; }
.text-muted { color: var(--text-secondary); }
.w-full { width: 100%; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }

/* ===== SIDEBAR OVERLAY ===== */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 99; backdrop-filter: blur(4px); }

/* ===== MOBILE ===== */
@media (max-width: 1024px) {
    .connection-meta { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.open { display: block; }
    .main { margin-left: 0; }
    .mobile-menu-btn { display: flex; }
    .content { padding: 20px 16px; }
    .main { overflow-x: hidden; width: 100%; }
    .connection-meta { grid-template-columns: 1fr; }
    .topbar { padding: 0 16px; }
    .fetch-group { flex-direction: column; }
    .fetch-last-updated { display: block; margin-top: 3px; }
    .grid-2 { grid-template-columns: 1fr !important; }
    .grid-3 { grid-template-columns: 1fr !important; gap: 16px !important; }
    .tab-bar { display: none; }
    .tab-dropdown {
        display: block; padding: 14px 16px;
        border-bottom: 1px solid var(--border); background: var(--surface);
    }
    .tab-dropdown select {
        width: 100%; padding: 12px 14px; font-size: 15px; font-weight: 600;
        font-family: inherit; border: 1.5px solid var(--border-strong);
        border-radius: var(--radius-sm); background: var(--white);
        color: var(--text); appearance: auto; cursor: pointer;
    }
    .review-banner { flex-direction: column; padding: 16px 16px; gap: 14px; max-width: 100%; }
    .review-banner-icon { display: none; }
    .review-banner .btn { width: 100%; text-align: center; justify-content: center; }
    .review-row { padding: 20px 16px; }
    .review-bar { padding: 16px 16px; flex-wrap: wrap; gap: 12px; }
    .review-bar .btn { padding: 12px 24px; font-size: 15px; width: 100%; justify-content: center; }
    .connection-card { padding: 20px !important; }
    .staging-card { padding: 14px 16px; }
    .submit-footer { flex-direction: column; gap: 10px; padding: 14px 16px; }
    .submit-footer span { text-align: center; }
    .submit-footer .btn { width: 100%; justify-content: center; }
}
@media (max-width: 480px) {
    .connection-meta { grid-template-columns: 1fr; }
}
