/* ==========================================================================
   EcomResearch Intelligence Suite - Premium Design System (Light Theme)
   Crafted with: Plus Jakarta Sans, JetBrains Mono, Frosted Glass, HSL Micro-Tokens
   ========================================================================== */

:root {
    --bg-canvas: #f8fafc;
    --bg-surface: #ffffff;
    --bg-subtle: #f1f5f9;
    --bg-hover: #f8fafc;
    
    --border-subtle: #e2e8f0;
    --border-strong: #cbd5e1;
    --border-focus: #4f46e5;
    
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    
    --indigo-600: #4f46e5;
    --indigo-700: #4338ca;
    --indigo-50: #eef2ff;
    --indigo-100: #e0e7ff;
    
    --emerald-600: #059669;
    --emerald-700: #047857;
    --emerald-50: #ecfdf5;
    --emerald-100: #d1fae5;
    
    --amber-600: #d97706;
    --amber-50: #fffbeb;
    --amber-100: #fef3c7;
    
    --sky-600: #0284c7;
    --sky-50: #f0f9ff;
    --sky-100: #e0f2fe;
    
    --rose-600: #e11d48;
    --rose-50: #fff1f2;
    
    --shadow-card: 0 1px 3px 0 rgba(0, 0, 0, 0.04), 0 1px 2px -1px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.06), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
    --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.06);
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --radius-pill: 9999px;
    
    --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

/* Global Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-canvas);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

/* ==========================================================================
   Header & Navigation Bar
   ========================================================================== */

.app-header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 40;
}

.header-inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.brand-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-badge {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--indigo-600), #06b6d4);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.25);
    flex-shrink: 0;
}

.brand-title {
    font-size: 17px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.brand-tag {
    color: var(--indigo-600);
}

.brand-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 1px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.live-dot {
    color: var(--emerald-600);
    font-size: 8px;
    animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

/* Horizontal Segmented Nav Control */
.nav-segmented-control {
    background: var(--bg-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill);
    padding: 3px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.nav-segment-btn {
    border: none;
    background: transparent;
    padding: 7px 16px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-sans);
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.nav-segment-btn:hover {
    color: var(--text-primary);
}

.nav-segment-btn.active {
    background: #ffffff;
    color: var(--indigo-600);
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.segment-icon {
    font-size: 14px;
}

.segment-badge {
    background: var(--bg-subtle);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: var(--radius-pill);
}

.nav-segment-btn.active .segment-badge {
    background: var(--indigo-50);
    color: var(--indigo-600);
}

.segment-badge.alert {
    background: #fee2e2;
    color: var(--rose-600);
}

/* Auth Area */
.header-auth-zone {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.btn-auth-pill {
    background: linear-gradient(135deg, var(--indigo-600), var(--indigo-700));
    color: #ffffff;
    border: none;
    padding: 7px 18px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 700;
    font-family: var(--font-sans);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25);
    transition: all 0.2s ease;
}

.btn-auth-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.35);
}

.user-pill-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 3px 8px 3px 3px;
    background: var(--bg-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill);
}

.avatar-ring {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--indigo-600), #06b6d4);
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-details-mini {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.user-display-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.user-display-role {
    font-size: 10px;
    font-weight: 700;
    color: var(--indigo-600);
    text-transform: uppercase;
}

.btn-signout {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    padding: 2px 5px;
    border-radius: 50%;
}

.btn-signout:hover {
    color: var(--rose-600);
    background: var(--rose-50);
}

/* ==========================================================================
   Main Layout & Executive KPI Grid
   ========================================================================== */

.app-main {
    max-width: 1440px;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.kpi-card {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.kpi-card.accent-indigo::before { background: var(--indigo-600); }
.kpi-card.accent-emerald::before { background: var(--emerald-600); }
.kpi-card.accent-sky::before { background: var(--sky-600); }
.kpi-card.accent-amber::before { background: var(--amber-600); }

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.kpi-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.kpi-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    text-transform: uppercase;
}

.kpi-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-pill);
}

.badge-indigo { background: var(--indigo-50); color: var(--indigo-600); }
.badge-emerald { background: var(--emerald-50); color: var(--emerald-600); }
.badge-sky { background: var(--sky-50); color: var(--sky-600); }
.badge-amber { background: var(--amber-50); color: var(--amber-600); }

.kpi-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 4px;
}

.kpi-value.emerald-val {
    color: var(--emerald-600);
}

.kpi-sub {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ==========================================================================
   Search & Filter Control Panel
   ========================================================================== */

.control-panel-card {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.search-filter-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.search-box-wrap {
    flex: 1;
    min-width: 280px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-loupe {
    position: absolute;
    left: 14px;
    font-size: 14px;
    color: var(--text-light);
    pointer-events: none;
}

.search-input {
    width: 100%;
    height: 42px;
    padding: 0 36px 0 38px;
    font-size: 13px;
    font-family: var(--font-sans);
    color: var(--text-primary);
    background: var(--bg-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    background: #ffffff;
    border-color: var(--indigo-600);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.clear-search-btn {
    position: absolute;
    right: 12px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    padding: 4px;
}

.dropdown-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.select-wrapper {
    position: relative;
}

.select-control {
    height: 42px;
    padding: 0 32px 0 12px;
    font-size: 13px;
    font-family: var(--font-sans);
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: all 0.2s ease;
}

.select-control:focus {
    outline: none;
    border-color: var(--indigo-600);
    background-color: #ffffff;
}

.btn-action-light {
    height: 42px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-sans);
    color: var(--text-secondary);
    background: var(--bg-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.btn-action-light:hover {
    color: var(--text-primary);
    border-color: var(--border-strong);
    background: #ffffff;
}

.btn-action-primary {
    height: 42px;
    padding: 0 16px;
    font-size: 13px;
    font-weight: 700;
    font-family: var(--font-sans);
    color: var(--indigo-600);
    background: var(--indigo-50);
    border: 1px solid var(--indigo-100);
    border-radius: var(--radius-md);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-action-primary:hover {
    background: var(--indigo-100);
}

/* Quick Filter Preset Chips */
.quick-chips-row {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding-top: 4px;
}

.chips-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.filter-chip {
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-sans);
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-subtle);
    background: var(--bg-canvas);
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.filter-chip:hover {
    background: var(--bg-subtle);
    color: var(--text-primary);
}

.filter-chip.active {
    background: var(--text-primary);
    color: #ffffff;
    border-color: var(--text-primary);
}

/* ==========================================================================
   Catalog Table & Product Cards
   ========================================================================== */

.catalog-card {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.catalog-header-bar {
    padding: 14px 20px;
    background: #ffffff;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.catalog-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.results-bold {
    font-weight: 700;
    color: var(--text-primary);
}

.status-sep {
    color: var(--text-light);
}

.status-sub {
    color: var(--text-muted);
    font-size: 12px;
}

.catalog-page-meta {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
}

/* Table */
.table-responsive-wrapper {
    overflow-x: auto;
}

.premium-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 13px;
}

.premium-table th {
    background: var(--bg-canvas);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    white-space: nowrap;
}

.premium-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
}

.premium-table tbody tr {
    transition: background-color 0.15s ease;
}

.premium-table tbody tr:hover {
    background-color: #f8fafc;
}

.col-rank { width: 45px; text-align: center; }
.col-num { text-align: right; }
.col-score { text-align: center; }
.col-actions { text-align: right; }

/* Table Columns Internals */
.rank-pill {
    font-size: 11px;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-muted);
    background: var(--bg-subtle);
    padding: 3px 6px;
    border-radius: var(--radius-sm);
    display: inline-block;
}

.product-row-flex {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 480px;
}

.prod-thumb {
    width: 58px;
    height: 58px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    object-fit: contain;
    background: #ffffff;
    padding: 3px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.prod-thumb:hover {
    transform: scale(1.05);
}

.prod-info-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.prod-title-link {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.prod-title-link:hover {
    color: var(--indigo-600);
    text-decoration: underline;
}

.prod-badges-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    flex-wrap: wrap;
}

.asin-code {
    font-family: var(--font-mono);
    color: var(--text-muted);
    background: var(--bg-subtle);
    padding: 1px 5px;
    border-radius: 4px;
}

.category-tag {
    color: var(--text-secondary);
    background: var(--bg-subtle);
    padding: 1px 6px;
    border-radius: 4px;
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rating-stars {
    color: var(--amber-600);
    font-weight: 600;
}

/* Sales Velocity */
.velocity-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 700;
    color: #92400e;
    background: var(--amber-100);
    padding: 3px 9px;
    border-radius: var(--radius-pill);
    white-space: nowrap;
}

.velocity-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 3px;
    font-family: var(--font-mono);
}

/* Financials */
.price-bold {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

.margin-pill {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    color: var(--emerald-700);
    background: var(--emerald-100);
    padding: 2px 8px;
    border-radius: var(--radius-pill);
}

.unit-profit-sub {
    font-size: 11px;
    color: var(--emerald-600);
    margin-top: 2px;
    font-family: var(--font-mono);
}

.profit-total-bold {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

.revenue-sub {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* Viability */
.score-circle {
    font-size: 14px;
    font-weight: 800;
    color: var(--indigo-600);
    font-family: var(--font-mono);
}

.risk-tag {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    margin-top: 2px;
    display: inline-block;
}

.risk-tag.low { background: var(--emerald-50); color: var(--emerald-700); }
.risk-tag.medium { background: var(--amber-50); color: var(--amber-600); }

/* Table Actions (Streamlined & Clean) */
.table-actions-cell {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.btn-table-primary {
    background: var(--indigo-50);
    color: var(--indigo-600);
    border: 1px solid var(--indigo-100);
    border-radius: var(--radius-md);
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-table-primary:hover {
    background: var(--indigo-600);
    color: #ffffff;
    border-color: var(--indigo-600);
}

.btn-table-amazon {
    background: #ffffff;
    color: #b45309;
    border: 1px solid #fde68a;
    border-radius: var(--radius-md);
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 700;
    font-family: var(--font-sans);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-table-amazon:hover {
    background: var(--amber-50);
    border-color: var(--amber-600);
}

.btn-table-star {
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 6px 8px;
    font-size: 13px;
    cursor: pointer;
    color: var(--text-light);
    transition: all 0.15s ease;
}

.btn-table-star:hover {
    color: var(--amber-600);
    border-color: var(--amber-600);
    background: var(--amber-50);
}

.btn-table-star.active {
    color: var(--amber-600);
    border-color: var(--amber-600);
    background: var(--amber-100);
}

/* Pagination Footer */
.pagination-footer {
    padding: 14px 20px;
    background: #ffffff;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.pagination-info {
    font-size: 13px;
    color: var(--text-muted);
}

.pagination-controls {
    display: flex;
    gap: 8px;
}

.btn-page-nav {
    height: 36px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-sans);
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-page-nav:hover:not(:disabled) {
    background: var(--bg-subtle);
    color: var(--text-primary);
}

.btn-page-nav:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ==========================================================================
   Mobile Product Cards Grid (<= 768px)
   ========================================================================== */

.mobile-products-grid {
    display: none; /* Desktop default: hidden */
    flex-direction: column;
    gap: 12px;
    padding: 12px;
}

.mobile-product-card {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 14px;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mob-card-top {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.mob-thumb {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    object-fit: contain;
    background: #ffffff;
    padding: 3px;
    flex-shrink: 0;
}

.mob-details {
    flex: 1;
    min-width: 0;
}

.mob-tags-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.mob-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-decoration: none;
    margin-bottom: 6px;
}

.mob-metrics-box {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: var(--bg-subtle);
    border-radius: var(--radius-md);
    padding: 8px;
    text-align: center;
    gap: 4px;
}

.mob-m-item {
    display: flex;
    flex-direction: column;
}

.mob-m-lbl {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.mob-m-val {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-primary);
    font-family: var(--font-mono);
    margin-top: 1px;
}

.mob-m-val.emerald {
    color: var(--emerald-600);
}

.mob-actions-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 8px;
}

/* Mobile Bottom Navigation Bar */
.mobile-bottom-bar {
    display: none; /* Desktop default: hidden */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-subtle);
    z-index: 50;
    padding: 6px 8px;
    padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
    justify-content: space-around;
}

.mobile-tab-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-family: var(--font-sans);
    position: relative;
    padding: 3px 0;
}

.mobile-tab-btn.active {
    color: var(--indigo-600);
}

.mob-icon { font-size: 18px; }
.mob-lbl { font-size: 10px; font-weight: 700; margin-top: 2px; }

.mob-badge {
    position: absolute;
    top: 2px;
    right: 28%;
    background: var(--rose-600);
    color: #ffffff;
    font-size: 9px;
    font-weight: 800;
    border-radius: var(--radius-pill);
    padding: 1px 5px;
}

/* ==========================================================================
   Simulator & Analytics Tabs
   ========================================================================== */

.simulator-wrapper {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
}

.sim-header { margin-bottom: 24px; }
.sim-title { font-size: 18px; font-weight: 800; color: var(--text-primary); }
.sim-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.sim-layout-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.sim-inputs-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sim-form-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sim-input-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sim-input-row label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
}

.sim-input {
    height: 42px;
    padding: 0 12px;
    font-size: 14px;
    font-family: var(--font-mono);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--bg-subtle);
}

.sim-input:focus {
    outline: none;
    border-color: var(--indigo-600);
    background: #ffffff;
}

.sim-results-card {
    background: linear-gradient(135deg, #f8fafc, #eef2ff);
    border: 1px solid var(--indigo-100);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 20px;
}

.sim-result-lbl {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.sim-result-big {
    font-size: 38px;
    font-weight: 800;
    color: var(--indigo-600);
    font-family: var(--font-mono);
    margin: 4px 0;
}

.sim-result-pill {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    color: var(--emerald-700);
    background: var(--emerald-100);
    padding: 3px 10px;
    border-radius: var(--radius-pill);
}

.sim-breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
}

.sim-item {
    display: flex;
    justify-content: space-between;
    padding-bottom: 6px;
    border-bottom: 1px dashed var(--border-subtle);
}

.val-emerald { color: var(--emerald-600); font-family: var(--font-mono); }
.val-muted { color: var(--text-muted); font-family: var(--font-mono); }

/* ==========================================================================
   Slide-over Sourcing Dossier Drawer
   ========================================================================== */

.drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    z-index: 90;
    display: none;
    justify-content: flex-end;
}

.drawer-panel {
    background: #ffffff;
    width: 580px;
    max-width: 90vw;
    height: 100vh;
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    animation: slideRight 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.drawer-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.drawer-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
    margin-top: 4px;
}

.drawer-close-btn {
    border: none;
    background: var(--bg-subtle);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

/* ==========================================================================
   User Authentication Modal
   ========================================================================== */

.auth-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(6px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fadeIn 0.15s ease-out;
}

.auth-modal-card {
    background: #ffffff;
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-xl);
    padding: 28px;
    border: 1px solid var(--border-subtle);
    animation: scaleUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleUp { from { transform: scale(0.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.auth-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 18px;
}

.auth-modal-title { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; }
.auth-modal-sub { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

.modal-close-btn {
    border: none;
    background: var(--bg-subtle);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 18px;
    cursor: pointer;
}

.auth-tab-switch {
    display: flex;
    background: var(--bg-subtle);
    border-radius: var(--radius-md);
    padding: 3px;
    margin-bottom: 18px;
}

.auth-switch-btn {
    flex: 1;
    padding: 7px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.auth-switch-btn.active {
    background: #ffffff;
    color: var(--indigo-600);
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.auth-form-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.input-field-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.input-field-group label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.text-input {
    height: 42px;
    padding: 0 12px;
    font-size: 14px;
    font-family: var(--font-sans);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.text-input:focus {
    outline: none;
    border-color: var(--indigo-600);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.btn-submit-primary {
    height: 44px;
    background: linear-gradient(135deg, var(--indigo-600), var(--indigo-700));
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 4px;
    transition: all 0.15s ease;
}

.btn-submit-primary:hover {
    transform: translateY(-1px);
}

.demo-login-divider {
    display: flex;
    align-items: center;
    margin: 18px 0 12px;
    color: var(--text-light);
    font-size: 11px;
    font-weight: 700;
}

.demo-login-divider::before,
.demo-login-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-subtle);
}

.demo-login-divider span { padding: 0 10px; }

.btn-demo-access {
    width: 100%;
    height: 40px;
    font-size: 13px;
    font-weight: 700;
    color: var(--indigo-600);
    background: var(--indigo-50);
    border: 1px solid var(--indigo-100);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-demo-access:hover {
    background: var(--indigo-100);
}

.auth-alert {
    padding: 10px 12px;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 14px;
}

.auth-alert.error { background: #fee2e2; color: #991b1b; }
.auth-alert.success { background: #d1fae5; color: #065f46; }

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */

@media (max-width: 1024px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .sim-layout-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    body { padding-bottom: 68px; }
    
    .app-main { padding: 14px; gap: 14px; }
    .header-inner { padding: 10px 14px; }
    
    .nav-segmented-control { display: none; }
    .brand-subtitle { display: none; }
    
    .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .kpi-card { padding: 14px; }
    .kpi-value { font-size: 22px; }
    
    .search-filter-toolbar { flex-direction: column; align-items: stretch; }
    .dropdown-group { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
    .btn-action-light, .btn-action-primary { justify-content: center; }
    
    /* Swap Table for Mobile Cards */
    .table-responsive-wrapper { display: none; }
    .mobile-products-grid { display: flex; }
    .mobile-bottom-bar { display: flex; }
    
    .drawer-panel {
        width: 100%;
        max-width: 100%;
        height: 85vh;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    }
    
    @keyframes slideUp {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }
}

/* ==========================================================================
   Shortlist Gate, Pipeline Controls & Toast Notifications
   ========================================================================== */

.auth-gate-card {
    max-width: 580px;
    margin: 40px auto;
    padding: 44px 32px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    text-align: center;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.05), 0 8px 10px -6px rgba(15, 23, 42, 0.02);
}

.auth-gate-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 18px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--indigo-600);
}

.auth-gate-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px 0;
    letter-spacing: -0.02em;
}

.auth-gate-desc {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0 auto 24px auto;
    max-width: 440px;
}

.auth-gate-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.auth-gate-perks {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 12px;
    color: var(--text-light);
    border-top: 1px solid var(--border-subtle);
    padding-top: 18px;
    flex-wrap: wrap;
}

.perk-check {
    color: #10b981;
    font-weight: 700;
}

.pipeline-select {
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    outline: none;
    cursor: pointer;
    transition: all 0.15s ease;
    width: 100%;
    max-width: 160px;
}

.pipeline-select:hover, .pipeline-select:focus {
    border-color: var(--indigo-500);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

.priority-badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
    border-radius: 9999px;
    text-transform: uppercase;
}

.priority-badge.high {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.priority-badge.medium {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

.priority-badge.low {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.btn-table-danger {
    padding: 5px 9px;
    background: #ffffff;
    border: 1px solid #fecaca;
    color: #dc2626;
    border-radius: var(--radius-sm);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-table-danger:hover {
    background: #fee2e2;
    border-color: #f87171;
    color: #b91c1c;
}

#toastContainer {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast-message {
    pointer-events: auto;
    background: #1e293b;
    color: #ffffff;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 8px;
    animation: toastSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast-message.success {
    background: #065f46;
    border: 1px solid #059669;
}

.toast-message.warning {
    background: #92400e;
    border: 1px solid #d97706;
}

.toast-message.error {
    background: #991b1b;
    border: 1px solid #dc2626;
}

.toast-message.info {
    background: #0f172a;
    border: 1px solid #334155;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
