/* AutoComp - Skånetrafiken-inspired Design System */

/* ============================================
   CSS Variables - Skånetrafiken Color Palette
   ============================================ */
:root {
    /* Primary Colors */
    --primary-red: #9D2235;
    --primary-red-dark: #6B1F24;
    --primary-red-light: #C23B4D;

    /* Neutral Colors */
    --bg-light: #F2F2F2;
    --bg-white: #FFFFFF;
    --text-dark: #1A1A1A;
    --text-gray: #666666;
    --text-light: #999999;
    --border-color: #E0E0E0;

    /* Status Colors */
    --success-green: #28A745;
    --warning-yellow: #FFC107;
    --danger-red: #DC3545;
    --info-blue: #17A2B8;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --radius-full: 9999px;
}

/* ============================================
   Reset & Base Styles
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
}

/* ============================================
   Views & Layout
   ============================================ */
.view {
    display: none;
}

.view.active {
    display: block;
}

/* ============================================
   Authentication View
   ============================================ */
.auth-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, var(--bg-white) 0%, var(--bg-light) 100%);
    position: relative;
    overflow: hidden;
}

.auth-card {
    background: var(--bg-white);
    padding: 3rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 420px;
    width: 90%;
    z-index: 10;
    text-align: center;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 0.5rem;
}

.brand-logo {
    width: 200px;
    height: auto;
    margin-right: -10px;
}

.logo-icon {
    font-size: 2.5rem;
}

.logo h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-red);
}

.tagline {
    color: var(--text-gray);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    text-align: left;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(157, 34, 53, 0.1);
}

.auth-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.auth-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    pointer-events: none;
}

.auth-wave svg {
    width: 100%;
    height: 100%;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary-red);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-red-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-red);
    border: 2px solid var(--primary-red);
}

.btn-secondary:hover {
    background: var(--primary-red);
    color: white;
}

.btn-full {
    width: 100%;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-updates {
    background: linear-gradient(135deg, var(--info-blue), #138496);
    color: white;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-updates:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-logout {
    background: transparent;
    color: var(--text-gray);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-logout:hover {
    color: var(--primary-red);
}

.btn-action {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
}

.btn-pilot {
    background: var(--info-blue);
    color: white;
}

.btn-approve {
    background: var(--success-green);
    color: white;
}

.btn-deny {
    background: var(--danger-red);
    color: white;
}

.btn-eligible {
    background: var(--success-green) !important;
    border-color: var(--success-green) !important;
}

.btn-eligible:hover {
    background: #218838 !important;
}

/* ============================================
   Header
   ============================================ */
.header {
    background: var(--bg-white);
    padding: 0.75rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0;
}

.header-logo {
    height: 96px;
    width: auto;
    margin-right: -15px;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-red);
}

.header-nav {
    display: flex;
    gap: 0.5rem;
}

.nav-btn {
    background: transparent;
    border: none;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-gray);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.nav-btn:hover {
    color: var(--primary-red);
    background: rgba(157, 34, 53, 0.05);
}

.nav-btn.active {
    color: var(--primary-red);
    background: rgba(157, 34, 53, 0.1);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-display {
    color: var(--text-gray);
    font-size: 0.9rem;
}

/* ============================================
   Main Content & Cards
   ============================================ */
.main-content {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Förseningar uses the full desktop width; other tabs stay at 1200px. */
.main-content:has(#tab-delays.active) {
    max-width: min(1440px, calc(100% - 64px));
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

.card h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: var(--text-dark);
}

.card-header-with-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.card-header-with-action h2 {
    margin-bottom: 0;
}

.card-description {
    color: var(--text-gray);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.search-status {
    padding: 1rem;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    min-height: 60px;
}

.search-status.loading {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-status .loading-spinner {
    width: 24px;
    height: 24px;
    margin: 0;
}

.search-status.success {
    background: rgba(40, 167, 69, 0.1);
    border-left: 4px solid var(--success-green);
}

.search-status.error {
    background: rgba(220, 53, 69, 0.1);
    border-left: 4px solid var(--danger-red);
}

.detected-delay-card {
    background: linear-gradient(135deg, var(--bg-light), #FDF5F6);
    border-left: 4px solid var(--primary-red);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
}

.detected-delay-card .delay-route {
    font-weight: 600;
    color: var(--primary-red);
}

#updates-btn {
    display: none;
    /* Admin only */
}

.btn-icon {
    margin-right: 0.25rem;
}

/* ============================================
   Financial Tracker
   ============================================ */
.financial-tracker {
    background: linear-gradient(135deg, var(--bg-white), #FDF5F6);
    border-left: 4px solid var(--primary-red);
}

.progress-container {
    margin-bottom: 1.5rem;
}

.progress-bar {
    height: 24px;
    background: var(--bg-light);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-red), var(--primary-red-light));
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.progress-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.progress-divider {
    color: var(--text-light);
}

.progress-percentage {
    display: block;
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-red);
    margin-top: 0.5rem;
}

.financial-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
}

.summary-item {
    text-align: center;
    padding: 1rem;
    border-radius: var(--radius-md);
    background: var(--bg-light);
}

.summary-item.approved {
    background: rgba(40, 167, 69, 0.1);
}

.summary-item.pending {
    background: rgba(255, 193, 7, 0.1);
}

.summary-item.denied {
    background: rgba(220, 53, 69, 0.1);
}

.summary-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-gray);
    margin-bottom: 0.25rem;
}

.summary-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.summary-item.approved .summary-value {
    color: var(--success-green);
}

.summary-item.pending .summary-value {
    color: var(--warning-yellow);
}

.summary-item.denied .summary-value {
    color: var(--danger-red);
}

/* ============================================
   Forms
   ============================================ */
.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.refund-preview {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.refund-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-red);
}

.eligibility-label {
    text-align: center;
    padding: 0.75rem;
    background: rgba(40, 167, 69, 0.1);
    color: var(--success-green);
    border-radius: var(--radius-md);
    font-weight: 600;
    margin-bottom: 1rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   Delays & Claims List
   ============================================ */
.delays-list,
.claims-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.delay-item,
.claim-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.delay-item:hover,
.claim-item:hover {
    box-shadow: var(--shadow-sm);
    transform: translateX(4px);
}

.delay-info,
.claim-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.delay-route,
.claim-route {
    font-weight: 600;
    font-size: 1rem;
}

.delay-meta,
.claim-meta {
    font-size: 0.85rem;
    color: var(--text-gray);
}

.delay-actions,
.claim-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.delay-refund,
.claim-refund {
    font-weight: 700;
    color: var(--primary-red);
    font-size: 1.1rem;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-detected {
    background: var(--bg-light);
    color: var(--text-gray);
}

.status-pilot_tested {
    background: rgba(23, 162, 184, 0.1);
    color: var(--info-blue);
}

.status-submitted {
    background: rgba(255, 193, 7, 0.1);
    color: #D39E00;
}

.status-approved {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success-green);
}

.status-denied {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger-red);
}

.empty-state {
    text-align: center;
    color: var(--text-light);
    padding: 2rem;
}

.status-cancelled {
    background-color: var(--danger-red);
    color: white;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    font-size: 0.75rem;
    margin-right: 0.5rem;
    display: inline-block;
}

.time-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: inherit;
}

.original-time {
    text-decoration: line-through;
    color: var(--text-gray);
    font-size: 0.9em;
}

.new-time {
    font-weight: 700;
    color: var(--text-dark);
    font-size: 1.1em;
    background-color: #FFF3CD;
    /* Warning yellow-ish background like screenshot */
    padding: 0 0.25rem;
}

.new-time-red {
    background-color: #FFE6E6;
    /* Light red for cancelled/delayed significant */
}

/* ============================================
   Receipts Gallery
   ============================================ */
.receipts-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.receipt-item {
    background: var(--bg-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.receipt-item:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
}

.receipt-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.receipt-item .receipt-label {
    padding: 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
}

/* ============================================
   Filter Row
   ============================================ */
.filter-row {
    margin-bottom: 1rem;
}

.filter-row select {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-family: inherit;
}

/* ============================================
   Modal
   ============================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: auto;
}

.modal-small {
    max-width: 400px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 1.25rem;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-gray);
}

.modal-close:hover {
    color: var(--primary-red);
}

.modal-body {
    padding: 1.5rem;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--bg-light);
    border-top-color: var(--primary-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Updates Modal Result */
.update-result {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.85rem;
    white-space: pre-wrap;
    background: #1E1E1E;
    color: #D4D4D4;
    padding: 1rem;
    border-radius: var(--radius-md);
    max-height: 400px;
    overflow: auto;
}

.update-result .success {
    color: var(--success-green);
}

.update-result .error {
    color: var(--danger-red);
}

.update-result .warning {
    color: var(--warning-yellow);
}

/* ============================================
   Messages
   ============================================ */
.error-message {
    color: var(--danger-red);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.success-message {
    color: var(--success-green);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .header-nav {
        order: 3;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .financial-summary {
        grid-template-columns: 1fr;
    }

    .auth-buttons {
        flex-direction: column;
    }

    .delay-item,
    .claim-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .delay-actions,
    .claim-actions {
        width: 100%;
        justify-content: space-between;
    }
}
/* NexusOS SSO login button + divider */
.btn-block {
    display: block;
    width: 100%;
    text-align: center;
    text-decoration: none;
}
.sso-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: #999;
    font-size: 0.85rem;
    margin: 1rem 0;
}
.sso-divider::before,
.sso-divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid #e0e0e0;
}
.sso-divider span {
    padding: 0 0.75rem;
}

/* --- 24h priority treatment for detected delay cards --- */
.detected-delay-card { border-left: 4px solid #d1d5db; transition: box-shadow .15s ease; }
.detected-delay-card.priority { border-left-color: #9D2235; background: linear-gradient(90deg, rgba(157,34,53,.05), transparent 60%); }
.detected-delay-card[data-priority="false"] { opacity: .92; }
.delay-badges { display: flex; gap: .4rem; margin-bottom: .35rem; flex-wrap: wrap; }
.delay-badge { font-size: .65rem; font-weight: 700; letter-spacing: .04em; padding: .15rem .5rem; border-radius: 999px; text-transform: uppercase; }
.badge-cancelled { background: #9D2235; color: #fff; }
.badge-eligible  { background: #d1fae5; color: #065f46; }
.badge-watch     { background: #f3f4f6; color: #6b7280; }
.delay-refund.muted { color: #9ca3af; font-weight: 500; font-size: .85rem; }

/* ============================================================
   Förseningar tab — screenshot redesign
   ============================================================ */
/* Both rows share ONE column template so the bottom cards align exactly under
   the top cards; stretch makes the two cards in each row equal height. */
.delays-grid { display: grid; gap: 1.5rem; margin-bottom: 1.5rem; align-items: stretch; }
.delays-grid-top,
.delays-grid-main { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.delays-grid .card { margin-bottom: 0; height: 100%; }
/* Keep the detected-delays card from collapsing when the list is empty. */
.detected-card { display: flex; flex-direction: column; }
.detected-card #auto-detected-delays { flex: 1 1 auto; min-height: 160px; }
@media (max-width: 900px) { .delays-grid-top, .delays-grid-main { grid-template-columns: 1fr; } }

.head-ic { display:inline-flex; width:1.9rem; height:1.9rem; align-items:center; justify-content:center;
    background:#fbe9ec; border-radius:8px; margin-right:.5rem; font-size:.95rem; }
.attribution { font-size:.75rem; color:#9ca3af; margin-top:.75rem; }

/* Snabböversikt stat tiles */
.stat-tiles { display:grid; grid-template-columns:repeat(4,1fr); gap:.6rem; margin:.5rem 0 1rem; }
@media (max-width:560px){ .stat-tiles{ grid-template-columns:repeat(2,1fr);} }
.stat-tile { background:#f8f9fb; border:1px solid #eef0f4; border-radius:12px; padding:.75rem .6rem;
    display:flex; flex-direction:column; gap:.15rem; }
.stat-ic { font-size:1rem; opacity:.85; }
.stat-val { font-size:1.35rem; font-weight:700; color:#1f2937; line-height:1.1; }
.stat-lbl { font-size:.72rem; color:#6b7280; }

.btn-soft { background:#fbe9ec; color:#9D2235; border:none; font-weight:600; }
.btn-soft:hover { background:#f6dbe0; }
.btn-outline { background:#fff; color:#374151; border:1px solid #e5e7eb; font-weight:600; }
.btn-outline:hover { background:#f9fafb; }
.btn-block { display:block; width:100%; text-align:center; }

/* Detected card header + toolbar */
.detected-head { display:flex; align-items:center; margin-bottom:.75rem; }
.count-badge { display:inline-flex; min-width:1.4rem; height:1.4rem; padding:0 .4rem; margin-left:.5rem;
    align-items:center; justify-content:center; background:#fbe9ec; color:#9D2235; border-radius:999px;
    font-size:.8rem; font-weight:700; }
.detected-toolbar { display:flex; flex-wrap:wrap; gap:.5rem; align-items:center; justify-content:space-between;
    margin-bottom:1rem; }
.filter-pills { display:flex; flex-wrap:wrap; gap:.4rem; }
.pill { border:1px solid #e5e7eb; background:#fff; color:#4b5563; border-radius:999px; padding:.35rem .8rem;
    font-size:.8rem; font-weight:600; cursor:pointer; transition:all .12s; }
.pill:hover { background:#f9fafb; }
.pill.active { background:#9D2235; border-color:#9D2235; color:#fff; }
.sort-select { border:1px solid #e5e7eb; border-radius:8px; padding:.35rem .6rem; font-size:.8rem;
    color:#4b5563; background:#fff; cursor:pointer; }

.automation-details { margin-top:1rem; border-top:1px solid #f0f0f2; padding-top:.75rem; }
.automation-details summary { cursor:pointer; font-size:.85rem; color:#6b7280; font-weight:600; }
.automation-details[open] summary { margin-bottom:.6rem; }

/* Redesigned detected delay card */
.detected-delay-card {
    display:grid; grid-template-columns:auto 1fr auto auto; gap:1rem; align-items:center;
    background:#fff; border:1px solid #eef0f4; border-left:4px solid #d1d5db; border-radius:14px;
    padding:1rem 1.1rem; margin-bottom:.85rem; transition:box-shadow .15s ease; }
.detected-delay-card:hover { box-shadow:0 4px 16px rgba(17,24,39,.06); }
.detected-delay-card.priority { border-left-color:#9D2235; background:linear-gradient(90deg, rgba(157,34,53,.045), #fff 55%); }
.detected-delay-card[data-priority="false"] { opacity:.94; }
@media (max-width:640px){ .detected-delay-card{ grid-template-columns:auto 1fr; } .card-alerts,.card-right{ grid-column:2; } }

.card-icon { width:2.5rem; height:2.5rem; border-radius:10px; background:#fbe9ec; display:flex;
    align-items:center; justify-content:center; font-size:1.15rem; }
.card-main { min-width:0; }
.delay-badges { margin-bottom:.3rem; }
.delay-badge { font-size:.62rem; font-weight:700; letter-spacing:.04em; padding:.15rem .5rem; border-radius:999px; text-transform:uppercase; }
.badge-cancelled { background:#9D2235; color:#fff; }
.badge-eligible  { background:#d1fae5; color:#065f46; }
.badge-watch     { background:#f3f4f6; color:#6b7280; }
.card-route { font-weight:700; color:#9D2235; font-size:.98rem; }
.card-date { font-size:.75rem; color:#9ca3af; margin:.1rem 0 .35rem; }
.card-time { display:flex; flex-wrap:wrap; align-items:center; gap:.4rem; font-size:.95rem; }
.t-sched { color:#374151; font-weight:600; }
.t-arrow { color:#9ca3af; }
.t-new { color:#9D2235; font-weight:700; }
.t-tag { font-size:.78rem; color:#6b7280; }
.status-cancelled { background:#9D2235; color:#fff; font-size:.7rem; font-weight:700; padding:.1rem .45rem; border-radius:6px; }
.card-sub { font-size:.8rem; color:#4b5563; margin-top:.2rem; }
.card-foot { font-size:.72rem; color:#b0b4bb; margin-top:.4rem; }
.card-alerts { display:flex; flex-direction:column; gap:.3rem; align-items:flex-start; }
.alert-chip { font-size:.72rem; color:#92400e; background:#fef3c7; padding:.2rem .5rem; border-radius:8px; white-space:nowrap; }
.alert-chip.muted { color:#6b7280; background:#f3f4f6; }
.card-right { display:flex; flex-direction:column; align-items:flex-end; gap:.2rem; position:relative; }
.right-refund { font-size:1.25rem; font-weight:800; color:#9D2235; }
.right-lbl { font-size:.72rem; color:#6b7280; }
.btn-apply { margin-top:.35rem; background:#10b981; color:#fff; border:none; border-radius:8px;
    padding:.4rem 1.1rem; font-weight:700; font-size:.85rem; cursor:pointer; }
.btn-apply:hover { background:#059669; }
.card-menu { position:absolute; top:-.4rem; right:-.4rem; background:none; border:none; color:#9ca3af;
    font-size:1.1rem; cursor:pointer; line-height:1; padding:.2rem; }
.card-menu:hover { color:#4b5563; }

/* Footer */
.delays-footer { display:flex; flex-wrap:wrap; gap:.75rem; justify-content:space-between; align-items:center;
    background:#fbe9ec; border-radius:12px; padding:.85rem 1.1rem; font-size:.82rem; color:#7a3b45; }
.delays-footer a { color:#9D2235; font-weight:600; text-decoration:none; white-space:nowrap; }
.delays-footer a:hover { text-decoration:underline; }
