.main-header {
    background: rgba(255, 255, 255, 0.7);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    backdrop-filter: blur(20px) saturate(180%);
    position: sticky;
    top: 15px;
    z-index: 1000 !important;
    border: 1px solid rgba(255, 255, 255, 0.3);
    min-height: 75px;
    height: auto;
    display: flex;
    align-items: center;
    margin: 0 auto;
    width: min(1300px, 96%);
    border-radius: 100px;
    padding: 0 35px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05), inset 0 0 0 1px rgba(255, 255, 255, 0.5);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.main-header:hover {
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
}

/* Header Hidden class no longer needed if scrolling naturally, but kept for JS compatibility */
.main-header.header-hidden {
    opacity: 0;
    pointer-events: none;
}

.nav-container {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    position: relative;
}

.header-left {
    display: flex;
    align-items: center;
    justify-self: start;
}

.header-center {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-self: center;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-self: end;
}

.nav-links {
    display: none; /* Deprecated in favor of header-center/right */
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.logo img.app-brand-logo,
img.app-brand-logo {
    height: 40px;
    max-height: 40px;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.logo:hover img.app-brand-logo {
    transform: scale(1.05);
}

.logo span {
    color: var(--text-main);
    font-weight: 700;
    font-size: 1rem;
    opacity: 0.7;
}

.header-center .btn-ghost {
    font-weight: 800;
    padding: 10px 22px;
    border-radius: 100px;
    font-size: 0.9rem;
    color: #475569;
    letter-spacing: -0.2px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-center .btn-ghost:hover {
    background: var(--primary-light, rgba(211, 22, 40, 0.05));
    color: var(--primary);
    transform: translateY(-1px);
}

.header-center .btn-ghost i {
    font-size: 1.2rem;
    opacity: 0.7;
}

.header-right .btn-ghost {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: #64748b;
}

.header-right .btn-ghost:hover {
    background: #f1f5f9;
    color: var(--primary);
}

/* =========================================
   MOBILE BOTTOM NAVIGATION (2025 Modern)
   ========================================= */
/* --- MOBILE OPTIMIZATION --- */
/* --- MOBILE OPTIMIZATION --- */
@media (max-width: 991.98px) {
    body {
        /* Ensure content clears nav + home bar */
        padding-bottom: calc(70px + env(safe-area-inset-bottom)) !important;
    }

    /* HEADER SAFE AREA - AGGRESSIVE FIX */
    /* HEADER MOBILE CAPSULE */
    .main-header {
        position: relative;
        top: 0;
        margin: 15px auto !important;
        width: 92% !important;
        border-radius: 50px !important;
        z-index: 5000;
        height: auto !important;
        min-height: 60px !important;
        padding: 0 16px !important;
        padding-top: env(safe-area-inset-top) !important;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1) !important;
    }

    .nav-container {
        height: 40px !important;
        /* Compact inner content */
    }

    /* Ensure Search Container clears header */
    .search-container.show-mobile {
        margin-top: 10px !important;
        margin-bottom: 10px !important;
    }

    /* HIDE HEADER SEARCH ON MOBILE (Targeted by ID) */
    #header-search-btn {
        display: none !important;
    }

    /* Mobile Header Layout Corrections */
    .logo img.app-brand-logo {
        height: 28px !important;
        max-height: 28px !important;
    }

    .header-center .nav-btn-text {
        display: none !important;
    }

    .header-center .btn-ghost {
        padding: 0 !important;
        gap: 0 !important;
        width: 38px !important;
        height: 38px !important;
        justify-content: center !important;
    }

    .header-right .btn-ghost {
        width: 38px !important;
        height: 38px !important;
    }

    .user-profile-capsule {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        background: white !important;
        padding: 4px 8px 4px 4px !important;
        border-radius: 100px !important;
        border: 1px solid rgba(0, 0, 0, 0.05) !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03) !important;
    }

    .user-profile-capsule .user-info-text {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        line-height: 1.1 !important;
    }

    .user-profile-capsule .user-greeting {
        font-size: 0.65rem !important;
        color: #64748b !important;
    }

    .user-profile-capsule .user-name-title {
        font-size: 0.8rem !important;
        font-weight: 700 !important;
        color: #0f172a !important;
        max-width: 75px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .user-profile-capsule .logout-pill-btn {
        display: flex !important;
        width: 30px !important;
        height: 30px !important;
        background: #FFF1F2 !important;
        color: #ef4444 !important;
        border: none !important;
        border-radius: 50% !important;
        align-items: center !important;
        justify-content: center !important;
        margin: 0 0 0 2px !important;
        cursor: pointer !important;
        transition: all 0.2s ease !important;
    }

    .user-profile-capsule .logout-pill-btn i {
        font-size: 1rem !important;
    }

    .user-avatar-blue {
        width: 30px !important;
        height: 30px !important;
        font-size: 1rem !important;
    }
}

.mobile-nav {
    display: none;
    /* Hidden on Desktop */
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(226, 232, 240, 0.8);

    /* COMPACT HEIGHT */
    height: auto !important;
    min-height: 55px !important;

    /* SAFE AREA FOR HOME BAR */
    padding-bottom: max(20px, env(safe-area-inset-bottom)) !important;
    padding-top: 5px !important;
    /* Minimal spacing */

    z-index: 9000;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.05);

    /* CENTER ITEMS VERTICALLY */
    justify-content: space-around;
    align-items: center;
}

@media (max-width: 991.98px) {
    .mobile-nav {
        display: flex;
    }

    /* Adjust body to prevent content hiding behind nav */
    body {
        padding-bottom: 120px !important;
        /* Increase padding to be safe */
    }

    /* Hide Header Cart on Mobile (Redundant) */
    #nav-cart-btn {
        display: none !important;
    }

    .mobile-nav.hidden {
        display: none !important;
    }
}

.nav-item {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Center Vertically */
    gap: 4px;
    color: #94a3b8;
    font-size: 0.65rem;
    /* Smaller text */
    font-weight: 700;
    width: 25%;

    /* FIX: PUSH ICONS VISIBLY LOWER */
    padding-top: 10px;
    padding-bottom: 2px;
    height: auto;

    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.nav-item i {
    font-size: 1.5rem;
    /* Slightly larger */
    transition: transform 0.2s;
    margin-bottom: 2px;
}

.nav-item.active {
    color: var(--primary);
    /* Just Color */
}

.nav-item.active i {
    transform: translateY(-2px);
}

.nav-item.active span {
    font-weight: 700;
}

/* REMOVED RED LINE (Hat) AS REQUESTED CLEANER LOOK */
.nav-item.active::after {
    display: none;
}

/* === STORIES (New Arrivals) === */
.stories-rail {
    display: flex !important;
    flex-direction: row !important;
    gap: 15px;
    overflow-x: auto;
    padding: 10px 15px;
    margin-bottom: 5px;
    scrollbar-width: none;
    /* Hide scrollbar Firefox */
    -ms-overflow-style: none;
    /* Hide scrollbar IE */
    align-items: flex-start;
    -webkit-overflow-scrolling: touch;
}

.stories-rail::-webkit-scrollbar {
    display: none;
    /* Hide scrollbar Chrome/Safari */
}

.story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    width: 90px;
    /* Fixed width for alignment */
    flex-shrink: 0;
    transition: transform 0.2s;
}

.story-item:hover {
    transform: scale(1.05);
}

.story-ring {
    width: 82px;
    height: 82px;
    border-radius: 50%;
    padding: 3px;
    /* Blue brand solid color to avoid green mixing */
    background: var(--primary);
    position: relative;
    display: flex;
    /* Center img */
    align-items: center;
    justify-content: center;
}

/* Variant for "Seen" or less priority? Optional. */
.story-ring.seen {
    background: #e2e8f0;
}

.story-img-wrapper {
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 50%;
    border: 2px solid white;
    /* Gap between ring and img */
    overflow: hidden;
    position: relative;
}

.story-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.story-label {
    font-size: 0.75rem;
    color: #1e293b;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

/* === RESPONSIVE TABLES (App-Like Cards) === */
@media (max-width: 575.98px) {

    .table-wrap,
    .table-wrap table,
    .table-wrap tbody,
    .table-wrap th,
    .table-wrap td,
    .table-wrap tr {
        display: block;
        width: 100%;
    }

    /* Hide Headers */
    .table-wrap thead {
        display: none;
    }

    /* Row -> Card */
    .table-wrap tbody tr {
        background: var(--bg-card);
        margin-bottom: 15px;
        border-radius: 20px;
        padding: 20px;
        border: 1px solid var(--border);
        box-shadow: var(--shadow-card);
        position: relative;
    }

    /* Cells */
    .table-wrap td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 0;
        border-bottom: 1px dashed var(--border);
        text-align: right;
        font-size: 0.95rem;
    }

    .table-wrap td:last-child {
        border-bottom: none;
        justify-content: flex-end;
        /* Actions aligned right */
        gap: 15px;
        margin-top: 10px;
        padding-top: 15px;
        border-top: 1px solid var(--border);
    }

    /* Data Labels */
    .table-wrap td::before {
        content: attr(data-label);
        font-weight: 700;
        font-size: 0.75rem;
        color: var(--text-light);
        text-transform: uppercase;
        text-align: left;
        flex: 1;
        /* Push content to right */
    }

    /* Special Layout for Primary Columns (Product, Client) */
    .table-wrap td[data-label="Producto"],
    .table-wrap td[data-label="Cliente"],
    .table-wrap td[data-label="Proveedor"],
    .table-wrap td[data-label="Usuario"] {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        text-align: left;
        border-bottom: 2px solid var(--border);
        padding-bottom: 15px;
        margin-bottom: 5px;
    }

    /* Hide the label for these primary visual columns */
    .table-wrap td[data-label="Producto"]::before,
    .table-wrap td[data-label="Cliente"]::before {
        display: none;
    }

    /* Enhance Action Buttons */
    .table-wrap .btn-icon {
        width: 48px;
        height: 48px;
        font-size: 1.3rem;
        /* Larger touch target */
        background: var(--bg-body);
        /* Contrast against card */
        border: 1px solid var(--border);
    }
}

/* --- REPORT & ACTION PLAN STYLES --- */
.report-meta {
    text-align: right;
    color: #64748b;
    font-size: 0.9rem;
}

.report-footer {
    margin-top: 50px;
    text-align: center;
    border-top: 1px solid #e2e8f0;
    padding-top: 20px;
}

/* Status Boxes */
.box-success {
    background: #f0fdf4;
    border: 1px solid #86efac;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.box-warning {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.state-disabled {
    opacity: 0.6;
    pointer-events: none;
    filter: grayscale(1);
}

/* Typography */
.text-success-dark {
    color: #166534;
}

.text-warning-dark {
    color: #c2410c;
}

.text-danger-strike {
    color: #991b1b;
    text-decoration: line-through;
}

.text-strike {
    text-decoration: line-through;
    opacity: 0.7;
}

.text-small {
    margin-bottom: 0;
    font-size: 0.9rem;
}

.text-objective {
    margin-bottom: 30px;
    color: var(--text-light);
}

/* Labels */
.label-danger {
    font-weight: 700;
    color: red;
    margin-bottom: 5px;
}

.label-success {
    font-weight: 700;
    color: #166534;
    margin-bottom: 5px;
}

/* Architecture */
.arch-disabled {
    opacity: 0.6;
}

.arch-active {
    border: 2px solid #166534;
    background: #dcfce7;
}

.list-regular {
    text-align: left;
    font-size: 0.9rem;
}

/* Vulnerability Cards */
.vuln-remediated {
    background: #f0fdf4 !important;
    border-color: #86efac !important;
}

/* Badges & Icons */
.icon-badge {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-badge-danger {
    background: #fee2e2;
    color: #ef4444;
}

.icon-badge-info {
    background: #e0f2fe;
    color: #0284c7;
}

.icon-badge-warning {
    background: #fef3c7;
    color: #d97706;
}

.icon-badge-indigo {
    background: #e0e7ff;
    color: #4338ca;
}

.badge-completed {
    background: #dcfce7;
    color: #166534;
    margin-left: 10px;
}

.card-completed {
    border-left: 6px solid #10b981 !important;
}

/* --- REPORT & ACTION PLAN STYLES --- */
.report-container {
    max-width: 1000px;
    margin: 40px auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.report-header-dark {
    background: var(--dark);
    color: white;
    padding: 60px 40px;
    position: relative;
    overflow: hidden;
}

.report-header-dark h1 {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -1px;
}

.report-header-dark p {
    opacity: 0.8;
    font-size: 1.1rem;
    margin-top: 10px;
}

.section {
    padding: 40px;
    border-bottom: 1px solid #f1f5f9;
}

.section-title {
    font-size: 1.5rem;
    color: var(--dark);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
}

/* Card Styles */
.step-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 25px;
    margin-bottom: 20px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    padding-left: 30px;
}

.step-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card);
    border-color: var(--primary);
}

.step-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    background: #cbd5e1;
    border-radius: 12px 0 0 12px;
}

.step-card.priority-high::before {
    background: #ef4444;
}

.step-card.priority-med::before {
    background: var(--accent);
}

.step-card.priority-low::before {
    background: var(--success);
}

/* Flex Title for Badges */
.step-title {
    font-weight: 700;
    color: var(--dark);
    font-size: 1.1rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* Ensures badge goes to right, or use gap */
    gap: 10px;
    flex-wrap: wrap;
}

.step-desc {
    font-size: 0.95rem;
    color: var(--text-light);
    margin-bottom: 15px;
}

/* Tech Stack Container */
.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.tech-tag {
    background: #f1f5f9;
    color: #475569;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-family: monospace;
    white-space: nowrap;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.badge-completed {
    background: #dcfce7;
    color: #166534;
}

.text-strike {
    text-decoration: line-through;
    opacity: 0.6;
}

.timeline {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.timeline-item {
    flex: 1;
    text-align: center;
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px dashed #cbd5e1;
}

@media(max-width: 600px) {
    .timeline {
        flex-direction: column;
    }

    .report-container {
        margin: 0;
        border-radius: 0;
    }

    .step-title {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* --- AUDIT SPECIFIC STYLES --- */
.audit-container {
    max-width: 900px;
    margin: 40px auto;
}

.audit-header {
    margin-bottom: 40px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 20px;
}

.audit-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 10px;
}

.audit-meta {
    color: var(--text-light);
    font-size: 0.9rem;
    font-family: monospace;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.metric-box {
    background: #f8fafc;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.metric-label {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.metric-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #334155;
    font-family: monospace;
}

.code-snippet {
    background: #1e293b;
    color: #e2e8f0;
    padding: 15px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 0.8rem;
    overflow-x: auto;
    margin-top: 10px;
}

.finding-list {
    margin-top: 15px;
    padding-left: 20px;
}

.finding-list li {
    margin-bottom: 8px;
    color: #64748b;
    font-size: 0.95rem;
}

/* Audit Status Badges */
.status-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status-secure {
    background: #dcfce7;
    color: #166534;
}

.status-warning {
    background: #fef9c3;
    color: #854d0e;
}

.status-critical {
    background: #fee2e2;
    color: #991b1b;
}

/* --- FIX FOR AUDIT REPORT BADGES --- */
/* Override global absolute positioning for badges within reports */
.audit-container .status-badge,
.report-container .status-badge {
    position: static !important;
    display: inline-flex !important;
    box-shadow: none !important;
    transform: none !important;
    margin-left: 10px;
}

/* --- PHASE 5 STYLES --- */
.icon-badge-indigo {
    background: #e0e7ff;
    color: #4338ca;
}

/* --- SMART INVENTORY ANALYSIS UI (PHASE 5) --- */
.analysis-dashboard {
    font-family: 'Inter', sans-serif;
    text-align: left;
}

.analysis-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

.analysis-tab {
    background: none;
    border: none;
    padding: 8px 15px;
    font-weight: 700;
    color: var(--text-light);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}

.analysis-tab:hover {
    background: #f1f5f9;
    color: var(--text-main);
}

.analysis-tab.active {
    background: #eff6ff;
    color: #2563eb;
}

/* --- SMART ANALYSIS V2 (CLEAN) --- */

.analysis-dashboard-v2 {
    display: flex;
    flex-direction: column;
    height: 75vh;
    /* Natural height limit based on viewport */
    gap: 15px;
}

.analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 15px;
    flex-shrink: 0;
    /* Header stays fixed */
}

.analysis-tabs-group {
    display: flex;
    gap: 10px;
}

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



/* Refined Body Props */
body {
    overflow-x: hidden;
    padding-top: var(--safe-top);
    padding-bottom: var(--safe-bottom);
    min-height: 100vh;
}

/* Unified Action Button */
.input-field {
    width: 100%;
    padding: 12px 15px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 400;
    /* Regular weight for edit product fields */
    transition: all 0.3s;
}

.input-group {
    display: flex;
    align-items: center;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    overflow: hidden;
    transition: all 0.3s;
}

.input-group:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(211, 22, 40, 0.1);
}

.input-group select {
    border: none !important;
    background: #f1f5f9 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%232f76bd' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 4px center !important;
    background-size: 10px !important;
    padding: 0 16px 0 8px !important;
    height: 100% !important;
    font-weight: 800 !important;
    color: var(--primary) !important;
    border-right: 1px solid var(--border) !important;
    border-radius: 0 !important;
    outline: none !important;
    cursor: pointer;
    width: auto !important;
    min-width: -webkit-fill-available;
    min-width: max-content;
    font-size: 0.75rem;
    -webkit-appearance: none;
    appearance: none;
}

.input-group input {
    border: none !important;
    flex: 1;
    height: 44px !important;
    padding: 0 12px !important;
    outline: none !important;
    background: transparent !important;
    font-weight: 600 !important;
    font-size: 0.95rem;
    width: 100%;
}

.btn-action {
    height: 36px;
    padding: 0 16px;
    border-radius: 50px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-main);
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-action:hover {
    background: #f8fafc;
}

.btn-pdf {
    color: #ef4444;
    border-color: #fee2e2;
    background: #fef2f2;
}

.btn-pdf:hover {
    background: #fee2e2;
}

.btn-copy {
    color: #3b82f6;
    border-color: #dbeafe;
    background: #eff6ff;
}

.btn-copy:hover {
    background: #dbeafe;
}


.analysis-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    /* Grow to fill remaining space */
    min-height: 0;
    /* Critical for nested scroll */
    gap: 15px;
}

.analysis-table-wrapper {
    flex: 1;
    /* Take all vertical space */
    overflow-y: auto;
    /* Scroll ONLY the table area */
    border: 1px solid var(--border);
    border-radius: 8px;
    background: white;
}

.analysis-table {
    width: 100%;
    border-collapse: collapse;
}

.analysis-table thead {
    position: sticky;
    top: 0;
    background: #f8fafc;
    z-index: 5;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.analysis-table th {
    padding: 12px 15px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    font-weight: 700;
    background: #f8fafc;
    white-space: nowrap;
}

.analysis-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
    color: var(--text-main);
    white-space: nowrap;
}

/* Column Alignments */
.th-center,
.td-center {
    text-align: center;
}

.th-right,
.td-right {
    text-align: right;
}

.th-product,
.td-product {
    text-align: left;
    font-weight: 700;
}

/* Status Badges */
.td-status {
    text-align: center;
    font-weight: 700;
}

.status-dead {
    color: #ef4444;
    background: #fef2f2;
    border: 1px solid #fee2e2;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    display: inline-block;
}

.status-ok {
    color: #64748b;
    font-size: 0.85rem;
}

.analysis-alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    flex-shrink: 0;
    color: var(--text-main);
    white-space: nowrap;
    /* Prevent data wrapping */
}


.alert-box {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fee2e2;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fef3c7;
}

.alert-info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #dbeafe;
}

/* Premium Popup Override */
.premium-popup {
    border-radius: 24px !important;
    padding: 20px !important;
}

/* FIXED HEADER TABLE STYLES FOR INVENTORY ANALYSIS */
.analysis-table-container {
    max-height: 50vh;
    /* Adjust vertical height as requested */
    overflow-y: auto;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.analysis-table.fixed-header {
    width: 100%;
    border-collapse: collapse;
}

.analysis-table.fixed-header thead {
    position: sticky;
    top: 0;
    background: #f8fafc;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    /* Visual separation */
}

.analysis-table.fixed-header th {
    padding: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.analysis-table.fixed-header td {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
}

/* WIDE MODAL OVERRIDE FOR INVENTORY ANALYSIS ONLY */
.analysis-dashboard-popup {
    width: 1100px !important;
    /* Force wider horizontal */
    max-width: 95vw !important;
}