:root {
    color-scheme: light;
    --tv-navy: #0e477a;
    --tv-ink: #1e2a32;
    --tv-mint: #11b4a3;
    --tv-lime: #c7e800;
    --tv-surf: #f5f7fa;
    --tv-ice: #e3f2ff;
    --tv-border: #dfe3e8;
    --tv-shadow: 0 14px 40px -18px rgba(14, 71, 122, 0.35);
    --tv-radius: 16px;
    --tv-radius-lg: 20px;
    --tv-font-display: "Space Grotesk", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --tv-font-body: "Manrope", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    font-family: var(--tv-font-body);
    color: var(--tv-ink);
    background: radial-gradient(circle at 20% 20%, rgba(17, 180, 163, 0.08), transparent 28%), radial-gradient(circle at 80% 0%, rgba(14, 71, 122, 0.08), transparent 30%), #f9fbfd;
    letter-spacing: 0.01em;
    overflow-x: hidden;
    max-width: 100vw;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--tv-font-display);
}

a {
    color: var(--tv-navy);
}

a:hover {
    color: #0b3a66;
}

.navbar {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
}

.navbar-logo {
    height: 32px;
    width: auto;
}

.mock-hero {
    position: relative;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(14, 71, 122, 0.08), rgba(17, 180, 163, 0.08));
    border-radius: var(--tv-radius-lg);
    border: 1px solid #e4e9f0;
    box-shadow: 0 18px 50px -32px rgba(14, 71, 122, 0.45);
}

.mock-panel {
    background: #fff;
    border: 1px solid #e6ebf2;
    border-radius: var(--tv-radius);
    box-shadow: 0 16px 36px -26px rgba(14, 71, 122, 0.35);
    padding: 1rem;
}

.mock-panel .bar {
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--tv-navy), var(--tv-mint));
    opacity: 0.65;
    margin-bottom: 0.75rem;
}

.mock-table {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 0.35rem;
}

.mock-cell {
    height: 10px;
    border-radius: 6px;
    background: #eef2f6;
}

.mock-cell.dark {
    background: #d7e4f3;
}

.mock-mobile {
    background: #0e477a;
    border-radius: 18px;
    padding: 0.75rem;
    color: #fff;
    width: 160px;
    box-shadow: 0 14px 30px -20px rgba(14, 71, 122, 0.7);
}

.mock-mobile .dot {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.18);
    margin-bottom: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mock-mobile .dot img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.section-spacious {
    padding: 2.75rem 2.25rem;
    border-radius: 20px;
    border: 1px solid #eef2f6;
    background: #fff;
    box-shadow: 0 16px 48px -34px rgba(14, 71, 122, 0.35);
}

.section-tint {
    background: var(--tv-surf);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    border: 1px solid #e7ecf2;
}

.feature-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    background: rgba(14, 71, 122, 0.08);
    color: var(--tv-navy);
    font-weight: 600;
    font-size: 0.8rem;
    margin-bottom: 0.4rem;
}

.icon-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(14, 71, 122, 0.08);
    color: var(--tv-navy);
    margin-bottom: 0.35rem;
}

.testimonial-card {
    background: #f7fafc;
    border: 1px solid #e3e8ef;
    border-radius: 18px;
    box-shadow: 0 18px 40px -30px rgba(14, 71, 122, 0.35);
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: 0.01em;
}

.btn-primary {
    background: var(--tv-navy);
    border-color: var(--tv-navy);
    box-shadow: 0 10px 24px -12px rgba(14, 71, 122, 0.7), 0 0 0 1px rgba(14, 71, 122, 0.08);
}

.btn-primary:hover,
.btn-primary:focus {
    background: #0b3a66;
    border-color: #0b3a66;
    box-shadow: 0 12px 30px -12px rgba(14, 71, 122, 0.85), 0 0 0 1px rgba(14, 71, 122, 0.12);
}

.btn-outline-primary {
    color: var(--tv-navy);
    border-color: rgba(14, 71, 122, 0.45);
    background: rgba(14, 71, 122, 0.05);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background: rgba(14, 71, 122, 0.12);
    border-color: var(--tv-navy);
}

.badge.text-bg-primary {
    background: var(--tv-navy) !important;
}

.badge.text-bg-success {
    background: var(--tv-mint) !important;
}

.badge.text-bg-warning {
    background: #f6b63f !important;
}

.badge.text-bg-light {
    background: var(--tv-surf) !important;
    color: var(--tv-ink) !important;
    border: 1px solid var(--tv-border);
}

.card {
    border-radius: var(--tv-radius);
    border: 1px solid #eef2f6;
    box-shadow: 0 20px 60px -36px rgba(14, 71, 122, 0.35);
}

.card-flagged {
    border-left: 4px solid #dc3545;
}

.hero {
    background: linear-gradient(135deg, rgba(14, 71, 122, 0.16), rgba(17, 180, 163, 0.14));
    border-radius: 28px;
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 82% 18%, rgba(199, 232, 0, 0.22), transparent 30%), radial-gradient(circle at 10% 20%, rgba(17, 180, 163, 0.24), transparent 28%);
    pointer-events: none;
}

.hero .card {
    box-shadow: 0 16px 50px -30px rgba(14, 71, 122, 0.4);
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    background: rgba(14, 71, 122, 0.06);
    border: 1px solid rgba(14, 71, 122, 0.14);
    font-weight: 600;
    color: var(--tv-navy);
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: var(--tv-surf);
    border: 1px solid var(--tv-border);
    font-weight: 600;
    color: var(--tv-ink);
}

.stat-bar {
    background: #fff;
    border-radius: var(--tv-radius-lg);
    border: 1px solid #eef2f6;
    box-shadow: var(--tv-shadow);
}

.stat-bar .stat {
    padding: 0.75rem 1.1rem;
}

.stat-bar .stat + .stat {
    border-left: 1px solid var(--tv-border);
}

.kpi-card {
    background: var(--tv-surf);
    border: 1px solid var(--tv-border);
    border-radius: var(--tv-radius-lg);
    box-shadow: none;
}

.section-muted {
    background: #fff;
    border: 1px solid #eef2f6;
    border-radius: 20px;
    box-shadow: 0 16px 48px -34px rgba(14, 71, 122, 0.35);
}

.pricing-highlight {
    border: 2px solid var(--tv-lime) !important;
    box-shadow: 0 22px 60px -30px rgba(199, 232, 0, 0.45);
}

.sticky-cta {
    position: sticky;
    bottom: 0;
    z-index: 1020;
}

.max-w-480 {
    max-width: 480px;
}

.ratio-3x4 {
    --bs-aspect-ratio: calc(4 / 3 * 100%);
}

/* ===================================
   LOADING ANIMATIONS & SPINNERS
   =================================== */

.upload-spinner {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto;
}

.spinner-ring {
    position: absolute;
    width: 80px;
    height: 80px;
    border: 4px solid transparent;
    border-top-color: rgba(199, 232, 0, 0.8);
    border-radius: 50%;
    animation: spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.spinner-ring-2 {
    border-top-color: rgba(17, 180, 163, 0.6);
    animation-delay: -0.15s;
    animation-duration: 1.5s;
}

.spinner-checkmark {
    position: absolute;
    width: 80px;
    height: 80px;
    opacity: 0;
}

.checkmark-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 2;
    stroke: #c7e800;
    fill: none;
}

.checkmark-check {
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    stroke-width: 3;
    stroke: #c7e800;
    stroke-linecap: round;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Progress Steps */
.upload-progress-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    max-width: 400px;
    margin: 0 auto;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.progress-step.active {
    opacity: 1;
}

.progress-step.completed {
    opacity: 0.7;
}

.progress-step.completed .progress-step-icon {
    background: var(--tv-mint);
    border-color: var(--tv-mint);
}

.progress-step.completed .progress-step-icon::after {
    content: '✓';
    color: white;
}

.progress-step-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
    transition: all 0.3s ease;
}

.progress-step.active .progress-step-icon {
    border-color: var(--tv-lime);
    background: rgba(199, 232, 0, 0.2);
    box-shadow: 0 0 0 4px rgba(199, 232, 0, 0.1);
    animation: pulse 2s ease-in-out infinite;
}

.progress-step-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.progress-step.active .progress-step-label {
    color: white;
    font-weight: 600;
}

.progress-step-line {
    width: 60px;
    height: 2px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 -0.5rem;
    margin-bottom: 1.5rem;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 4px rgba(199, 232, 0, 0.1);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(199, 232, 0, 0.05);
    }
}

.upload-time-estimate {
    margin-top: 1rem;
}

/* ===================================
   INTERACTIVE STATES & TRANSITIONS
   =================================== */

/* Global transition defaults */
* {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

a, button, .btn, .card, input, select, textarea {
    transition: all 0.2s ease;
}

/* Button States */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
}

.btn:focus-visible {
    outline: 2px solid var(--tv-lime);
    outline-offset: 2px;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary:active {
    box-shadow: 0 6px 16px -8px rgba(14, 71, 122, 0.85);
}

.btn:disabled,
.btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-outline-primary:active {
    transform: scale(0.98);
}

/* Link States */
a {
    transition: color 0.2s ease, text-decoration 0.2s ease;
}

a:focus-visible {
    outline: 2px solid var(--tv-lime);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Card Interactive States */
.card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

a.card:hover,
.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 24px 70px -40px rgba(14, 71, 122, 0.45);
}

a.card:active {
    transform: translateY(0);
}

/* Form Input States */
.form-control:focus,
.form-select:focus {
    border-color: var(--tv-navy);
    box-shadow: 0 0 0 3px rgba(14, 71, 122, 0.1);
}

.form-control:focus-visible {
    outline: 2px solid var(--tv-lime);
    outline-offset: 2px;
}

.form-check-input:focus {
    border-color: var(--tv-navy);
    box-shadow: 0 0 0 3px rgba(14, 71, 122, 0.15);
}

.form-check-input:checked {
    background-color: var(--tv-navy);
    border-color: var(--tv-navy);
}

/* Touch Target Sizes - Mobile */
@media (max-width: 768px) {
    .btn {
        min-height: 44px;
        padding: 0.625rem 1.25rem;
    }

    .btn-sm {
        min-height: 44px;
        padding: 0.5rem 1rem;
    }

    .form-check-input {
        width: 24px;
        height: 24px;
        margin-top: 0;
    }

    .nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    /* Reduce hero preview height on mobile */
    .mock-hero {
        max-height: 180px;
        overflow: hidden;
    }

    .mock-panel {
        padding: 0.5rem;
    }

    .mock-table {
        gap: 0.25rem;
    }

    .mock-cell {
        height: 8px;
    }

    /* Prevent horizontal overflow on mobile */
    .container,
    .pagination,
    .btn-group,
    footer,
    header {
        max-width: 100%;
        overflow-x: hidden;
    }

    .pagination {
        flex-wrap: wrap;
    }

    .btn-group {
        flex-wrap: wrap;
    }
}

/* Badge hover states */
.badge {
    transition: all 0.2s ease;
}

a.badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Chip interactive states */
.chip {
    transition: all 0.2s ease;
    cursor: pointer;
}

.chip:hover,
a.chip:hover {
    background: rgba(14, 71, 122, 0.12);
    border-color: var(--tv-navy);
    transform: translateY(-1px);
}

.chip:active {
    transform: scale(0.98);
}

/* Table row hover */
.table tbody tr {
    transition: background-color 0.15s ease;
}

.table tbody tr:hover {
    background-color: rgba(14, 71, 122, 0.02);
}

/* Icon animations */
.icon-circle {
    transition: all 0.2s ease;
}

.icon-circle:hover {
    transform: scale(1.1);
    background: rgba(14, 71, 122, 0.12);
}

/* ===================================
   EMPTY STATES
   =================================== */
.empty-state {
    padding: 3rem 1.5rem;
}

.empty-state-icon {
    display: inline-block;
    animation: fadeInUp 0.6s ease-out;
}

.empty-state-icon svg {
    filter: drop-shadow(0 4px 12px rgba(14, 71, 122, 0.08));
}

.empty-state-steps {
    max-width: 700px;
    margin: 0 auto;
}

.empty-state-step {
    text-align: center;
    padding: 1.5rem 1rem;
    background: var(--tv-surf);
    border-radius: var(--tv-radius);
    border: 1px solid var(--tv-border);
    transition: all 0.2s ease;
}

.empty-state-step:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px -8px rgba(14, 71, 122, 0.2);
    border-color: var(--tv-navy);
}

.step-number {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--tv-navy);
    color: white;
    font-weight: 700;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
    box-shadow: 0 4px 12px rgba(14, 71, 122, 0.25);
}

.step-title {
    font-weight: 600;
    color: var(--tv-ink);
    margin-bottom: 0.25rem;
}

.step-description {
    font-size: 0.875rem;
    color: #6c757d;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================================
   DRAG & DROP UPLOAD ZONE
   =================================== */
.upload-drop-zone {
    position: relative;
    min-height: 400px;
    border: 2px dashed var(--tv-border);
    border-radius: var(--tv-radius-lg);
    background: var(--tv-surf);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.upload-drop-zone:hover {
    border-color: var(--tv-navy);
    background: rgba(14, 71, 122, 0.02);
}

.upload-drop-zone.drag-over {
    border-color: var(--tv-mint);
    background: rgba(17, 180, 163, 0.05);
    border-style: solid;
    transform: scale(1.02);
}

.drop-zone-content {
    text-align: center;
    padding: 3rem 2rem;
    pointer-events: none;
}

.drop-zone-content button {
    pointer-events: all;
}

.drop-zone-icon {
    color: var(--tv-navy);
    opacity: 0.4;
    margin: 0 auto;
}

.upload-drop-zone:hover .drop-zone-icon {
    opacity: 0.6;
    transform: translateY(-4px);
    transition: all 0.2s ease;
}

.drop-zone-overlay {
    position: absolute;
    inset: 0;
    background: rgba(14, 71, 122, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.upload-drop-zone.drag-over .drop-zone-overlay {
    opacity: 1;
}

.drop-zone-overlay-content {
    text-align: center;
}

.upload-preview-card {
    padding: 1rem;
    background: white;
    border: 1px solid var(--tv-border);
    border-radius: var(--tv-radius);
    box-shadow: 0 4px 12px rgba(14, 71, 122, 0.08);
    animation: slideInUp 0.3s ease-out;
}

/* ===================================
   VISUAL FEEDBACK & ANIMATIONS
   =================================== */

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Page entrance animations */
.container {
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Alert/Message animations */
.alert {
    animation: slideInDown 0.3s ease-out;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Success animation for alerts */
.alert-success {
    animation: slideInDown 0.3s ease-out, successPulse 0.5s ease-out 0.3s;
}

@keyframes successPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(17, 180, 163, 0);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(17, 180, 163, 0.2);
    }
}

/* Card stagger animations */
.card {
    animation: fadeInUp 0.4s ease-out backwards;
}

.row > [class*='col-']:nth-child(1) .card {
    animation-delay: 0.05s;
}

.row > [class*='col-']:nth-child(2) .card {
    animation-delay: 0.1s;
}

.row > [class*='col-']:nth-child(3) .card {
    animation-delay: 0.15s;
}

.row > [class*='col-']:nth-child(4) .card {
    animation-delay: 0.2s;
}

/* Badge entrance */
.badge {
    animation: scaleIn 0.2s ease-out;
}

/* List item animations */
.list-group-item {
    animation: slideInRight 0.3s ease-out backwards;
}

.list-group-item:nth-child(1) { animation-delay: 0.05s; }
.list-group-item:nth-child(2) { animation-delay: 0.1s; }
.list-group-item:nth-child(3) { animation-delay: 0.15s; }
.list-group-item:nth-child(4) { animation-delay: 0.2s; }
.list-group-item:nth-child(5) { animation-delay: 0.25s; }

/* Table row animations */
.table tbody tr {
    animation: fadeIn 0.3s ease-out backwards;
}

.table tbody tr:nth-child(odd) { animation-delay: 0.05s; }
.table tbody tr:nth-child(even) { animation-delay: 0.1s; }

/* Number counter animation (for stats) */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.display-6,
.h1, .h2, .h3, .h4, .h5 {
    animation: fadeIn 0.5s ease-out;
}

/* Progress bar animations */
.progress-bar {
    animation: progressFill 0.8s ease-out;
}

@keyframes progressFill {
    from {
        width: 0;
    }
}

/* Button click ripple effect */
.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::after {
    width: 300px;
    height: 300px;
}

.btn-primary::after {
    background: rgba(255, 255, 255, 0.3);
}

.btn-outline-primary::after {
    background: rgba(14, 71, 122, 0.1);
}

/* Skeleton loading animation */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite linear;
}

/* Hover lift effect for interactive cards */
.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 12px 24px -10px rgba(14, 71, 122, 0.3);
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

/* Toast container positioning */
.toast-container {
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1080;
}

/* Mobile: Position above bottom nav, full width */
@media (max-width: 991.98px) {
    .toast-container {
        bottom: 90px; /* Above mobile bottom nav */
        right: 0.75rem;
        left: 0.75rem;
        max-width: none;
    }

    .toast-container .toast {
        width: 100%;
        max-width: none;
    }
}

/* Desktop positioning */
@media (min-width: 992px) {
    .toast-container {
        max-width: 380px;
    }
}

/* Toast base styles */
.toast {
    animation: toastSlideIn 0.3s ease-out;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    min-width: 280px;
}

/* Toast entrance animation */
@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Mobile: slide from bottom */
@media (max-width: 991.98px) {
    @keyframes toastSlideIn {
        from {
            opacity: 0;
            transform: translateY(100%);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* Toast exit animation */
.toast.hiding {
    animation: toastSlideOut 0.25s ease-in forwards;
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

@media (max-width: 991.98px) {
    @keyframes toastSlideOut {
        from {
            opacity: 1;
            transform: translateY(0);
        }
        to {
            opacity: 0;
            transform: translateY(100%);
        }
    }
}

/* Toast body styles */
.toast-body {
    font-weight: 500;
    font-size: 0.9375rem;
    padding: 0.875rem 1rem;
}

/* Toast icon styles */
.toast-body svg {
    flex-shrink: 0;
}

/* Toast colors - override Bootstrap defaults */
.toast.text-bg-success {
    background-color: var(--tv-mint) !important;
}

.toast.text-bg-danger {
    background-color: #dc3545 !important;
}

.toast.text-bg-warning {
    background-color: #ffc107 !important;
    color: #1e2a32 !important;
}

.toast.text-bg-warning .btn-close-white {
    filter: none;
}

.toast.text-bg-primary {
    background-color: var(--tv-navy) !important;
}

/* Toast close button */
.toast .btn-close {
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.toast .btn-close:hover {
    opacity: 1;
}

/* Toast stacking */
.toast-container .toast + .toast {
    margin-top: 0.5rem;
}

/* Reduce motion preference */
@media (prefers-reduced-motion: reduce) {
    .toast {
        animation: none;
    }

    .toast.hiding {
        animation: none;
        opacity: 0;
    }
}

/* Modal entrance */
.modal.show .modal-dialog {
    animation: modalZoomIn 0.3s ease-out;
}

@keyframes modalZoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Spinner enhancements */
.spinner-border {
    animation: spin 0.75s linear infinite;
}

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

/* Focus pulse for important elements */
@keyframes focusPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(199, 232, 0, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(199, 232, 0, 0);
    }
}

.focus-pulse {
    animation: focusPulse 2s ease-out infinite;
}

/* Fade out animation */
@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ===================================
   PROGRESS STEPPER COMPONENT
   =================================== */
.progress-stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1rem;
    margin-bottom: 2rem;
    background: white;
    border-radius: var(--tv-radius);
    border: 1px solid var(--tv-border);
    box-shadow: 0 2px 8px rgba(14, 71, 122, 0.06);
}

.progress-stepper-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
    text-align: center;
}

.progress-stepper-step::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: var(--tv-border);
    z-index: 0;
}

.progress-stepper-step:last-child::after {
    display: none;
}

.progress-stepper-step.completed::after {
    background: var(--tv-mint);
}

.progress-stepper-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--tv-surf);
    border: 2px solid var(--tv-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #6c757d;
    z-index: 1;
    position: relative;
    transition: all 0.3s ease;
    margin-bottom: 0.5rem;
}

.progress-stepper-step.completed .progress-stepper-circle {
    background: var(--tv-mint);
    border-color: var(--tv-mint);
    color: white;
}

.progress-stepper-step.completed .progress-stepper-circle::after {
    content: '✓';
    font-size: 1.2rem;
}

.progress-stepper-step.active .progress-stepper-circle {
    background: var(--tv-navy);
    border-color: var(--tv-navy);
    color: white;
    box-shadow: 0 0 0 4px rgba(14, 71, 122, 0.1);
    animation: pulse 2s ease-in-out infinite;
}

.progress-stepper-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #6c757d;
    margin-top: 0.25rem;
}

.progress-stepper-step.active .progress-stepper-label {
    color: var(--tv-navy);
    font-weight: 600;
}

.progress-stepper-step.completed .progress-stepper-label {
    color: var(--tv-ink);
}

.progress-stepper-description {
    font-size: 0.75rem;
    color: #999;
    margin-top: 0.25rem;
}

.progress-stepper-step.active .progress-stepper-description {
    color: #666;
}

/* Mobile responsive stepper */
@media (max-width: 768px) {
    .progress-stepper {
        padding: 1rem 0.5rem;
    }

    .progress-stepper-circle {
        width: 32px;
        height: 32px;
        font-size: 0.875rem;
    }

    .progress-stepper-label {
        font-size: 0.75rem;
    }

    .progress-stepper-description {
        display: none;
    }

    .progress-stepper-step::after {
        top: 16px;
    }
}

/* Vertical stepper variant */
.progress-stepper-vertical {
    flex-direction: column;
    align-items: stretch;
}

.progress-stepper-vertical .progress-stepper-step {
    flex-direction: row;
    text-align: left;
    padding: 1rem 0;
}

.progress-stepper-vertical .progress-stepper-step::after {
    top: 50px;
    left: 20px;
    width: 2px;
    height: calc(100% - 40px);
}

.progress-stepper-vertical .progress-stepper-circle {
    margin-right: 1rem;
    margin-bottom: 0;
}

.progress-stepper-vertical .progress-stepper-content {
    flex: 1;
}

/* ============================================
   MOBILE BOTTOM NAVIGATION
   ============================================ */

.mobile-bottom-nav {
    padding-bottom: env(safe-area-inset-bottom);
    max-width: 100vw;
    overflow-x: hidden;
}

.mobile-bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    color: #6c757d;
    transition: color 0.2s ease;
    min-width: 44px;
    padding: 0.5rem;
}

.mobile-bottom-nav-item:hover,
.mobile-bottom-nav-item:focus {
    color: var(--tv-navy);
    text-decoration: none;
}

.mobile-bottom-nav-item:active {
    transform: scale(0.95);
}

/* Active state - matches current page */
.mobile-bottom-nav-item.active {
    color: var(--tv-navy);
    font-weight: 600;
}

.mobile-bottom-nav-icon {
    font-size: 1.25rem;
    line-height: 1;
}

.mobile-bottom-nav-label {
    font-size: 0.625rem;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
}

/* Primary action (Scan button) */
.mobile-bottom-nav-item-primary {
    color: #fff !important;
    position: relative;
}

.mobile-bottom-nav-item-primary:hover,
.mobile-bottom-nav-item-primary:focus {
    color: #fff !important;
}

.mobile-bottom-nav-icon-primary {
    background: var(--tv-navy);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(14, 71, 122, 0.3);
    transition: all 0.3s ease;
    margin-top: -1rem;
}

.mobile-bottom-nav-item-primary:hover .mobile-bottom-nav-icon-primary,
.mobile-bottom-nav-item-primary:focus .mobile-bottom-nav-icon-primary {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(14, 71, 122, 0.4);
}

.mobile-bottom-nav-item-primary:active .mobile-bottom-nav-icon-primary {
    transform: scale(0.95);
}

.mobile-bottom-nav-item-primary .mobile-bottom-nav-label {
    color: var(--tv-navy);
    font-weight: 600;
}

/* Add bottom padding to main content when bottom nav is present */
@media (max-width: 991.98px) {
    body.mobile-nav-active main {
        padding-bottom: 80px !important;
    }

    /* Add bottom padding to footer on mobile to prevent overlap with bottom nav */
    body.mobile-nav-active footer {
        padding-bottom: 80px !important;
    }
}

/* Ensure accessibility */
@media (prefers-reduced-motion: reduce) {
    .mobile-bottom-nav-item,
    .mobile-bottom-nav-icon-primary {
        transition: none;
    }
}

/* ============================================
   MOBILE OFFCANVAS MENU
   ============================================ */

/* Ensure offcanvas menu is visible and readable */
.offcanvas {
    background-color: #fff !important;
    z-index: 9999 !important;
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 300px !important;
    max-width: 85vw !important;
}

.offcanvas.show {
    visibility: visible !important;
    transform: none !important;
}

.offcanvas-backdrop {
    z-index: 9998 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background-color: rgba(0, 0, 0, 0.5) !important;
}

.offcanvas-backdrop.show {
    opacity: 1 !important;
}

/* ============================================
   BOOTSTRAP MODAL Z-INDEX FIX
   Ensure modals appear above offcanvas backdrop
   ============================================ */
.modal {
    z-index: 10050 !important;
}

.modal-backdrop {
    z-index: 10040 !important;
}

.modal-dialog {
    z-index: 10051 !important;
}

/* Main content - avoid creating stacking context that traps modals */
main {
    position: relative;
    /* z-index removed: was causing modals to be trapped behind backdrop */
}

.offcanvas-header {
    background-color: #fff;
    position: relative;
    z-index: 1;
}

.offcanvas-body {
    background-color: #fff;
    position: relative;
    z-index: 1;
}

.offcanvas .nav-link {
    color: var(--tv-ink) !important;
    font-size: 1rem;
    padding: 0.75rem 0;
}

.offcanvas .nav-link:hover {
    color: var(--tv-navy) !important;
}

.offcanvas-title {
    color: var(--tv-ink);
    font-weight: 600;
}

/* ============================================
   DASHBOARD KPI CARDS
   ============================================ */

.kpi-card {
    transition: all 0.3s ease;
    cursor: pointer;
}

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(14, 71, 122, 0.15) !important;
    border-color: var(--tv-navy) !important;
}

.kpi-card:active {
    transform: translateY(-2px);
}

/* ============================================
   DROPDOWN MENUS IN CARDS
   ============================================ */

/* Ensure dropdown menus are visible and not clipped by card overflow */
.card {
    overflow: visible !important;
}

.card-body {
    overflow: visible !important;
}

/* Note: table-responsive needs overflow, but dropdowns should still be visible */
/* We handle this via z-index and proper positioning */

/* Ensure dropdown menus appear above all cards - ULTRA SOLID */
.dropdown-menu {
    z-index: 1050 !important;
    background-color: #ffffff !important;
    background: #ffffff !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    opacity: 1 !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    filter: none !important;
}

/* Ensure dropdown menu is shown - force solid background */
.dropdown-menu.show {
    background-color: #ffffff !important;
    background: #ffffff !important;
    opacity: 1 !important;
}

/* Target all possible dropdown states */
ul.dropdown-menu,
.dropdown-menu[data-bs-popper] {
    background-color: #ffffff !important;
    background: #ffffff !important;
    opacity: 1 !important;
}

/* Remove any pseudo-elements that might cause transparency */
.dropdown-menu::before,
.dropdown-menu::after {
    display: none !important;
}

/* Dropdown menu items - ensure solid background behind them */
.dropdown-menu li {
    background-color: #ffffff !important;
}

/* Force solid background on the entire dropdown container */
.btn-group .dropdown-menu,
.table .dropdown-menu,
.card .dropdown-menu {
    background-color: #ffffff !important;
    background: #ffffff !important;
    background-image: none !important;
    opacity: 1 !important;
}

/* ULTRA FIX: Target every possible selector that Bootstrap might use */
div.dropdown-menu,
.dropdown-menu[x-placement],
.dropdown-menu[style] {
    background-color: #ffffff !important;
    background: #ffffff !important;
}

/* Ensure nothing creates transparency layers */
.dropdown-menu * {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* Remove any transforms or filters that might cause transparency */
.dropdown-menu,
.dropdown-menu.show {
    transform: none !important;
    filter: none !important;
    -webkit-filter: none !important;
    will-change: auto !important;
}

.dropdown-item {
    background-color: transparent;
    transition: all 0.2s ease;
    position: relative;
    z-index: 1;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: rgba(14, 71, 122, 0.08) !important;
    color: var(--tv-navy) !important;
}

.dropdown-item:active {
    background-color: rgba(14, 71, 122, 0.12) !important;
}

.dropdown-item.text-danger:hover,
.dropdown-item.text-danger:focus {
    background-color: rgba(220, 53, 69, 0.08) !important;
    color: #dc3545 !important;
}

/* Dropdown divider */
.dropdown-divider {
    opacity: 0.1;
}

/* Ensure button group dropdowns work properly */
.btn-group {
    position: relative;
    z-index: 1;
}

.btn-group .dropdown-menu {
    position: absolute !important;
}

/* Prevent card transforms from affecting dropdown position */
.card:has(.dropdown-menu.show) {
    z-index: 10 !important;
}

/* ============================================
   MOBILE CARD ACTION BUTTONS
   ============================================ */

/* Mobile card action buttons - Delete icon + Open button */
@media (max-width: 767.98px) {
    /* Delete button - subtle, icon-only */
    .card-body button[title="Delete"],
    .card-body button[aria-label="Delete record"] {
        min-width: 44px;
        min-height: 44px;
        padding: 0.5rem;
        border-color: #dee2e6;
        color: #6c757d;
        transition: all 0.2s ease;
    }

    .card-body button[title="Delete"]:hover,
    .card-body button[aria-label="Delete record"]:hover {
        border-color: #dc3545;
        color: #dc3545;
        background-color: rgba(220, 53, 69, 0.05);
    }

    .card-body button[title="Delete"]:active,
    .card-body button[aria-label="Delete record"]:active {
        transform: scale(0.95);
        background-color: rgba(220, 53, 69, 0.1);
    }

    /* Delete icon size */
    .card-body button[title="Delete"] svg,
    .card-body button[aria-label="Delete record"] svg {
        width: 18px;
        height: 18px;
    }

    /* Open button - primary action */
    .card-body .btn-primary {
        min-width: 80px;
        min-height: 44px;
        font-weight: 500;
    }

    /* Action buttons container */
    .card-body .d-flex.justify-content-end {
        margin-top: 0.5rem;
    }
}

/* Stats bar */
.stat-bar {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.stat {
    flex: 1;
    min-width: 200px;
    padding: 0 1rem;
    border-right: 1px solid #e9ecef;
}

.stat:last-child {
    border-right: none;
}

@media (max-width: 768px) {
    .stat-bar {
        flex-direction: column;
    }

    .stat {
        border-right: none;
        border-bottom: 1px solid #e9ecef;
        padding: 1rem 0;
    }

    .stat:last-child {
        border-bottom: none;
    }
}

/* Ensure accessibility */
@media (prefers-reduced-motion: reduce) {
    .kpi-card {
        transition: none;
    }

    .kpi-card:hover {
        transform: none;
    }
}

/* ============================================
   RECORDS TABLE IMPROVEMENTS
   ============================================ */

/* Table row hover effects */
.table tbody tr {
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.table tbody tr:hover {
    background-color: rgba(14, 71, 122, 0.02);
}

/* Table action icon buttons */
.table .btn-sm {
    min-width: 36px;
    min-height: 36px;
    padding: 0.375rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.table .btn-outline-secondary {
    border-color: #dee2e6;
    color: #6c757d;
}

.table .btn-outline-secondary:hover {
    background-color: rgba(108, 117, 125, 0.1);
    border-color: #6c757d;
    color: #495057;
}

.table .btn-outline-primary:hover {
    background-color: var(--tv-navy);
    border-color: var(--tv-navy);
    color: #fff;
}

.table .btn-outline-danger:hover {
    background-color: #dc3545;
    border-color: #dc3545;
    color: #fff;
}

/* Icon button spacing */
.table td .d-flex.gap-1 {
    gap: 0.25rem !important;
}

/* Ensure accessibility */
@media (prefers-reduced-motion: reduce) {
    .table tbody tr,
    .table .btn-sm {
        transition: none;
    }
}

/* ============================================
   FOOTER STYLING
   ============================================ */

footer {
    background: #fff;
}

footer a {
    transition: color 0.2s ease;
}

footer a:hover {
    color: var(--tv-navy) !important;
}

/* Ensure footer links have proper touch targets on mobile */
@media (max-width: 991.98px) {
    footer a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        padding: 0.5rem;
    }
}

/* ============================================
   HELP BUTTON DESKTOP
   ============================================ */

#helpLauncher {
    transition: all 0.3s ease;
}

#helpLauncher:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(14, 71, 122, 0.2) !important;
}

#helpLauncher:active {
    transform: translateY(0);
}

/* ============================================
   USAGE PAGE PROGRESS BARS
   ============================================ */

/* Thicker progress bars (12px instead of default) */
.usage-progress {
    height: 12px;
    border-radius: 6px;
    background-color: #e9ecef;
}

.usage-progress .progress-bar {
    border-radius: 6px;
    transition: width 0.6s ease;
}

/* Ensure accessibility */
@media (prefers-reduced-motion: reduce) {
    .usage-progress .progress-bar {
        transition: none;
    }
}
