:root {
    --primary: #3B58D7;
    --primary-container: #4d63d8;
    --secondary: #a63a21;
    --secondary-container: #ffdad3;
    --surface: #f8f9fb;
    --surface-container-low: #f3f4f6;
    --surface-container-lowest: #ffffff;
    --surface-bright: #f8f9fb;
    --on-surface: #191c1e;
    --on-surface-variant: #64748b;
    --outline-variant: rgba(25, 28, 30, 0.15);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--surface);
    color: var(--on-surface);
    margin: 0;
    padding: 0;
}

h1,
h2,
h3,
h4,
h5,
h6,
.font-manrope,
.font-headline,
.font-display,
.editorial-text {
    font-family: 'Manrope', -apple-system, sans-serif;
}

/* Base utility for any invert-white icons/logos if needed */
.logo-white {
    filter: brightness(0) invert(1);
}

/* Base utility for Ghost Border */
.ghost-border {
    border: 1px solid var(--outline-variant);
}

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* --- Round 2 prototypes --- */

/* Hide scrollbar but allow horizontal scroll */
.hide-scrollbar::-webkit-scrollbar {
    height: 4px;
}

.hide-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(117, 118, 133, 0.2);
    border-radius: 10px;
}

/* --- Table Styles from Prototype --- */
.table-container {
    background-color: var(--surface-container-lowest);
    border: 1px solid var(--outline-variant);
    border-radius: 0.5rem;
    overflow: hidden;
}

.data-table {
    width: 100%;
    font-size: 0.875rem;
    text-align: left;
    border-collapse: collapse;
}

.data-table thead tr {
    border-bottom: 1px solid var(--outline-variant);
    background-color: rgba(68, 70, 83, 0.05);
}

.data-table th {
    padding: 0.75rem 1rem;
    font-weight: 500;
    color: var(--on-surface-variant);
    text-align: left;
    white-space: nowrap;
}

.data-table tbody tr {
    border-bottom: 1px solid var(--outline-variant);
    transition: background-color 0.2s ease-in-out;
}

.data-table tbody tr:last-child {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background-color: rgba(68, 70, 83, 0.05);
}

.data-table td {
    padding: 0.75rem 1rem;
    color: var(--on-surface-variant);
}

.data-table td.highlight {
    font-weight: 500;
    color: var(--on-surface);
}

.table-action-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--primary);
    font-weight: 500;
    font-size: 0.75rem;
    transition: color 0.2s ease-in-out;
    text-decoration: none;
}

.table-action-link:hover {
    color: var(--primary-container);
}

/* --- Typography from Prototype --- */
.page-title {
    font-family: 'IBM Plex Serif', Georgia, serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--on-surface);
    margin-bottom: 0.25rem;
}

.page-subtitle {
    font-size: 0.875rem;
    color: var(--on-surface-variant);
    margin-bottom: 1.5rem;
}

/* --- Badges --- */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 0.25rem;
}

.status-badge.tracking {
    background-color: rgba(77, 99, 216, 0.1);
    color: var(--primary);
}

.status-badge.ended {
    background-color: rgba(166, 58, 33, 0.1);
    color: var(--secondary);
}

.status-badge.default {
    background-color: var(--surface-container-high);
    color: var(--on-surface-variant);
}

/* --- Detail Pages --- */
.detail-breadcrumb {
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--on-surface-variant);
    background-color: var(--surface-container-lowest);
    border-bottom: 1px solid var(--outline-variant);
}

.detail-breadcrumb a {
    transition: color 0.2s ease-in-out;
}

.detail-breadcrumb a:hover {
    color: var(--primary);
}

.detail-breadcrumb .current {
    color: var(--on-surface);
    font-weight: 500;
}

.detail-header {
    background-color: var(--surface-container-lowest);
    border-bottom: 1px solid var(--outline-variant);
    padding: 1rem 1.5rem;
}

.detail-header-title {
    font-family: 'IBM Plex Serif', Georgia, serif;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--on-surface);
}

.detail-meta {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    column-gap: 1.5rem;
    row-gap: 0.25rem;
    font-size: 0.875rem;
    color: var(--on-surface-variant);
}

.detail-meta-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

/* --- Stats Cards --- */
.stat-card {
    background-color: var(--surface-container-lowest);
    border: 1px solid var(--outline-variant);
    border-radius: 0.5rem;
    padding: 1rem;
    position: relative;
}

.stat-card-icon {
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: var(--primary);
    opacity: 1;
    font-size: 28px;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.stat-card-label {
    font-size: 0.625rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    color: var(--on-surface-variant);
    margin-bottom: 0.25rem;
}

.stat-card-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--on-surface);
    padding-right: 2rem;
}

/* --- Section Components --- */
.section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--on-surface);
    margin-bottom: 0.75rem;
}

.timeline-container {
    background-color: var(--surface-container-lowest);
    border: 1px solid var(--outline-variant);
    border-radius: 0.5rem;
    padding: 1rem;
}

/* --- Refresh button pulse (shown while a tracking job is loading) --- */
@keyframes pulseBadge {

    0%,
    100% {
        transform: scale(1);
        background-color: #4459DB;
    }

    50% {
        transform: scale(1.02);
        background-color: #AB351A;
    }
}

.animate-pulse-badge {
    animation: pulseBadge 2s ease-in-out infinite;
}

/* --- Stat Card Loader --- */
.stat-loader {
    height: 4px;
    width: 80px;
    --c: no-repeat linear-gradient(rgba(25, 28, 30, 0.3) 0 0);
    background: var(--c), var(--c), var(--outline-variant);
    background-size: 60% 100%;
    animation: statLoaderSlide 3s infinite;
    border-radius: 2px;
    margin-top: 0.25rem;
}

@keyframes statLoaderSlide {
    0% {
        background-position: -150% 0, -150% 0;
    }

    66% {
        background-position: 250% 0, -150% 0;
    }

    100% {
        background-position: 250% 0, 250% 0;
    }
}

/* --- Page content entrance --- */
@keyframes pageFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-fade-in {
    animation: pageFadeIn 0.45s ease-out both;
}

@media (prefers-reduced-motion: reduce) {
    .page-fade-in {
        animation: none;
    }
}