/* ==========================================================================
   JITY AI DESIGN SYSTEM (2.0)
   Theme: Light, Minimalist, "Goradar" Inspired
   Font: Space Grotesk
   Primary Accent: Vibrant Orange (HSL 24 95% 53%)
   ========================================================================== */

:root {
    /* --- COLOR PALETTE (HSL) --- */
    --primary: 0 0% 18%;
    /* Charcoal Text */
    --primary-foreground: 0 0% 98%;
    /* White Text */

    --secondary: 0 0% 45%;
    /* Medium Gray */
    --secondary-foreground: 0 0% 98%;

    --background: 0 0% 97%;
    /* Very Light Gray Main BG */
    --foreground: 0 0% 10%;
    /* Main Text */

    --accent: 24 95% 53%;
    /* #FD7F2C - Vibrant Orange */
    --accent-light: 24 95% 65%;
    /* Lighter Orange for hovers */
    --accent-foreground: 0 0% 98%;

    --card: 0 0% 100%;
    /* Pure White Cards */
    --card-foreground: 0 0% 10%;

    --border: 0 0% 90%;
    /* Subtle Light Border */
    --input: 0 0% 92%;
    --bg-secondary: 210 40% 96.1%;
    /* Added for secondary backgrounds */

    --radius: 0.75rem;
    /* 12px rounded corners */

    /* --- STATUS COLORS --- */
    --success: 142 71% 45%;
    /* Green */
    --warning: 38 92% 50%;
    /* Amber/Yellow */
    --danger: 0 84% 60%;
    /* Red */
    --info: 217 91% 60%;
    /* Blue */

    /* --- SHADOWS & GLOWS --- */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.05), 0 4px 6px -4px rgb(0 0 0 / 0.05);
    --glow-orange: 0 0 20px hsla(24, 95%, 53%, 0.15);
}

/* --- DARK MODE VARIABLES (Premium) --- */
body.dark-mode {
    --primary: 0 0% 98%;
    /* White */
    --primary-foreground: 0 0% 98%;

    --secondary: 0 0% 65%;
    /* Light Gray */
    --secondary-foreground: 0 0% 10%;

    --background: 0 0% 4%;
    /* #0A0A0A - Deep Dark */
    --foreground: 0 0% 98%;

    --accent: 24 95% 53%;
    /* Orange */
    --accent-light: 24 95% 58%;

    --card: 0 0% 9%;
    /* #171717 - Subtle Card */
    --card-foreground: 0 0% 98%;

    --border: 0 0% 16%;
    /* #292929 */
    --input: 0 0% 16%;
    --bg-secondary: 0 0% 12%;
    /* Added for dark mode secondary backgrounds */

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
}

/* --- RESET & TYPOGRAPHY --- */
* {
    box-sizing: border-box;
    border-color: hsl(var(--border));
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

body {
    margin: 0;
    font-family: 'Space Grotesk', system-ui, -apple-system, sans-serif;
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    letter-spacing: -0.01em;
    font-weight: 700;
    color: hsl(var(--primary));
    /* Uses var so it auto-switches */
    margin-top: 0;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.25rem;
}

code,
.mono {
    font-family: 'JetBrains Mono', monospace;
}

/* --- GLOBAL NAV --- */
nav {
    background: hsl(var(--card));
    border-bottom: 1px solid hsl(var(--border));
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

/* --- BRANDING & LOGO --- */
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: visible !important;
    /* Never clip the logo */
}

.brand-logo-final {
    font-family: 'Inter', sans-serif !important;
    font-weight: 900 !important;
    font-size: 38px;
    letter-spacing: -0.04em;
    color: #000 !important;
    display: inline-block !important;
    line-height: 1.1 !important;
    padding-bottom: 8px !important;
    /* Space for the curved y tail */
    margin-bottom: -4px !important;
    /* Re-center vertically */
    filter: drop-shadow(0 0 0 transparent);
    /* Force hardware acceleration */
    user-select: none;
    -webkit-font-smoothing: antialiased;
}

body.dark-mode .brand-logo-final {
    color: #fff !important;
}

.brand-logo-final .text-accent {
    color: hsl(var(--accent)) !important;
    margin: 0 !important;
}

@media (min-width: 768px) {
    .brand-logo-final {
        font-size: 44px;
    }
}

.brand img {
    height: 48px;
    width: auto;
    max-width: 150px;
    object-fit: contain;
    display: block;
}

/* --- PERSONA SWITCHER (Segmented Control) --- */
.persona-switcher {
    background: hsl(var(--input));
    padding: 4px;
    border-radius: 99px;
    display: flex;
    gap: 4px;
    width: fit-content;
    margin: 0;
}

.persona-btn {
    padding: 6px 16px;
    border-radius: 99px;
    border: none;
    background: transparent;
    color: hsl(var(--secondary));
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.persona-btn svg {
    flex-shrink: 0;
}

.persona-btn:hover {
    color: hsl(var(--foreground));
}

.persona-btn.active {
    background: hsl(var(--card));
    color: hsl(var(--accent));
    /* Orange text for active */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* --- INSIGHT NAV BAR --- */
.insight-nav-btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: hsl(var(--secondary));
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.insight-nav-btn:hover {
    color: hsl(var(--foreground));
    background: hsla(var(--accent), 0.05);
}

.insight-nav-btn.active {
    background: hsl(var(--accent));
    color: white;
    box-shadow: 0 2px 8px hsla(24, 95%, 53%, 0.2);
}

.store-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.store-badge {
    background: transparent;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: hsl(var(--foreground));
    border: 1px solid hsl(var(--border));
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.store-badge svg {
    color: hsl(var(--accent));
}

.store-badge:hover {
    background: hsl(var(--secondary) / 0.1);
}

.location-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: hsl(var(--bg-secondary));
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid hsl(var(--border));
    font-size: 13px;
    font-weight: 600;
    color: hsl(var(--foreground));
}

.location-box svg {
    color: hsl(var(--accent));
}

/* --- BUTTONS --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 99px;
    /* Pill Shape */
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    border: 1px solid transparent;
    gap: 8px;
    letter-spacing: -0.01em;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: hsl(var(--accent));
    color: white;
    box-shadow: 0 4px 12px hsla(24, 95%, 53%, 0.3);
}

.btn-primary:hover:not(:disabled) {
    background: hsl(var(--accent-light));
    transform: translateY(-1px);
    box-shadow: 0 6px 16px hsla(24, 95%, 53%, 0.4);
}

.btn-outline {
    background: hsla(24, 95%, 53%, 0.05);
    /* Very subtle orange tint */
    border: 1px solid hsl(var(--border));
    color: hsl(var(--primary));
}

.btn-outline:hover:not(:disabled) {
    border-color: hsl(var(--accent));
    color: hsl(var(--accent));
    background: hsla(24, 95%, 53%, 0.1);
}

/* Specific Dark Mode overrides for buttons */
body.dark-mode .btn-outline {
    background: hsl(var(--card));
    /* Dark card bg */
    border-color: hsl(var(--border));
    color: hsl(var(--secondary));
}

body.dark-mode .btn-outline:hover {
    color: hsl(var(--primary));
    border-color: hsl(var(--primary));
}

/* Strategic Decision Buttons */
.btn-strategic-red {
    background: linear-gradient(135deg, #ff4d4d 0%, #d62828 100%);
    color: white;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(214, 40, 40, 0.3);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 20px;
}

.btn-strategic-red:hover {
    background: linear-gradient(135deg, #ff6666 0%, #e63946 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(214, 40, 40, 0.4);
}

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

.btn-strategic-outline {
    background: hsla(0, 0%, 100%, 0.03);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-radius: 12px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
}

.btn-strategic-outline:hover {
    background: var(--border);
    color: hsl(var(--foreground));
    border-color: var(--text-secondary);
}


.cart-count {
    background: transparent;
    color: white;
    font-size: 14px;
    font-weight: 700;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    /* Distinct Square */
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid rgba(255, 255, 255, 0.9);
    /* Thicker, clearer border */
    min-width: 0;
}

/* --- LAYOUT & CARDS --- */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px;
}

.view-content {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.view-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.card {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.card:hover {
    box-shadow: var(--shadow-md);
    border-color: hsl(var(--border) / 0.8);
    /* Slightly darker border on hover */
}

/* Stats inside Cards */
.stat-val {
    font-size: 36px;
    font-weight: 700;
    margin: 8px 0;
    letter-spacing: -0.04em;
    color: hsl(var(--foreground));
}

.stat-label {
    font-size: 13px;
    font-weight: 500;
    color: hsl(var(--secondary));
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* --- IMPACT BAR (Orange Theme) --- */
.impact-bar {
    background: linear-gradient(135deg, hsla(24, 95%, 53%, 0.05) 0%, hsla(24, 95%, 53%, 0.02) 100%);
    border: 1px solid hsla(24, 95%, 53%, 0.1);
    padding: 32px;
    border-radius: var(--radius);
    display: flex;
    justify-content: center;
    gap: 80px;
    margin-bottom: 48px;
    width: 100%;
}

/* --- ACTION CARDS (Recommendations) --- */
.action-card {
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.action-card:hover {
    border-color: hsl(var(--accent));
    box-shadow: var(--glow-orange);
}

.risk-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.risk-CRITICAL {
    background: hsla(0, 84%, 60%, 0.1);
    color: hsl(var(--danger));
}

.risk-SAFE {
    background: hsla(142, 71%, 45%, 0.1);
    color: hsl(var(--success));
}

.risk-WATCH {
    background: hsla(38, 92%, 50%, 0.1);
    color: hsl(var(--warning));
}

/* Verified Outcomes */
.outcome-verified {
    font-weight: 700;
    font-size: 13px;
    letter-spacing: -0.01em;
}

.outcome-verified.success {
    color: #10b981;
    /* Emeral 500 */
}

.outcome-verified.failure {
    color: #ef4444;
    /* Red 500 */
}

.outcome-monitoring {
    color: #f59e0b;
    /* Amber 500 */
    font-weight: 600;
}

.outcome-unresolved {
    color: #6b7280;
    /* Gray 500 */
    font-weight: 500;
    opacity: 0.8;
}

.verification-tag {
    display: inline-block;
    font-size: 9px;
    text-transform: uppercase;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 6px;
}

.tag-monitoring {
    background: #fef3c7;
    color: #92400e;
}

.tag-verified {
    background: #d1fae5;
    color: #065f46;
}

.tag-closed {
    background: #f3f4f6;
    color: #374151;
}

/* Reason List bullets */
.reason-item {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 14px;
    color: hsl(var(--foreground));
    opacity: 0.9;
}

.reason-bullet {
    color: hsl(var(--accent));
    font-size: 18px;
    /* Larger bullet */
    line-height: 1;
}

/* --- TABLES --- */
.table-container {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

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

th {
    background: hsl(var(--background));
    /* Light gray header */
    padding: 16px 24px;
    font-size: 13px;
    /* Bumped from 12px */
    color: hsl(var(--secondary));
    text-transform: uppercase;
    font-weight: 700;
    text-align: left;
    border-bottom: 1px solid hsl(var(--border));
    letter-spacing: 0.05em;
}

td {
    padding: 18px 24px;
    /* More vertical padding */
    border-bottom: 1px solid hsl(var(--border));
    font-size: 15px;
    /* Bumped from 14px for clarity */
    color: hsl(var(--foreground));
    font-weight: 500;
}

tr:hover {
    background: hsla(0, 0%, 0%, 0.03);
    /* Slightly stronger hover */
}

/* --- NAVBAR ACTIONS --- */
/* --- REORDER BUTTON (PREMIUM RE-DESIGN) --- */
.cart-badge {
    all: unset;
    background: hsl(var(--accent)) !important;
    color: white !important;
    height: 38px !important;
    padding: 0 6px 0 18px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border-radius: 99px !important;
    cursor: pointer;
    font-weight: 700 !important;
    font-size: 14px !important;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px hsla(24, 95%, 53%, 0.25);
    white-space: nowrap;
    min-width: 120px;
}

.cart-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px hsla(24, 95%, 53%, 0.35);
    filter: brightness(1.1);
}

.cart-badge:active {
    transform: translateY(0);
}

.cart-count {
    background: white !important;
    color: hsl(var(--accent)) !important;
    font-size: 13px !important;
    font-weight: 900 !important;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
    /* Subtle depth */
}

/* --- DARK MODE TOGGLE (Visibility Fix) --- */
.dark-mode-toggle {
    background: transparent;
    border: 1px solid hsl(var(--border));
    color: hsl(var(--foreground)) !important;
    /* Force visible color */
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-right: 12px;
    transition: all 0.2s ease;
}

.dark-mode-toggle:hover {
    background: hsl(var(--input));
    transform: rotate(15deg);
}

.dark-mode-toggle svg {
    stroke: currentColor;
    stroke-width: 2;
    width: 20px;
    height: 20px;
    display: block;
    /* Ensure it renders */
}

/* --- MODALS --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: hsla(0, 0%, 0%, 0.4);
    /* Dark dimming */
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius);
    padding: 32px;
    width: 100%;
    max-width: 520px;
    animation: zoomIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes zoomIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Modal Form Elements */
.modal-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: hsl(var(--secondary));
    margin-bottom: 8px;
}

.modal-input {
    width: 100%;
    background: hsl(var(--input));
    border: 1px solid hsl(var(--border));
    color: hsl(var(--foreground));
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
}

.modal-input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: hsl(var(--accent));
    background: hsl(var(--card));
    box-shadow: 0 0 0 3px hsla(var(--accent), 0.1);
}

.filter-control {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--foreground));
    /* Black border request */
    color: hsl(var(--foreground));
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    min-width: 160px;
}

.filter-control option {
    background: hsl(var(--card));
    color: hsl(var(--foreground));
}

body.dark-mode .modal-input {
    background: hsl(var(--background));
}

body.dark-mode .modal-input:focus {
    background: hsl(var(--card));
}

/* --- CART PANEL --- */
/* --- PREMIUM CART PANEL --- */
.cart-panel {
    position: fixed;
    top: 0;
    right: -480px;
    width: 480px;
    height: 100vh;
    background: hsl(var(--card));
    border-left: 1px solid hsl(var(--border));
    box-shadow: -20px 0 50px rgba(0, 0, 0, 0.1);
    z-index: 2500;
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.cart-panel.open {
    right: 0;
}

.cart-header {
    padding: 32px 24px;
    border-bottom: 1px solid hsl(var(--border));
    background: hsl(var(--background));
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-items-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: hsla(var(--background), 0.5);
}

/* --- CART ITEM CARD --- */
.cart-item {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.cart-item:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.cart-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.cart-item-title {
    flex: 1;
}

.cart-item-title h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    color: hsl(var(--foreground));
}

.cart-item-title span {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: hsl(var(--secondary));
    margin-top: 4px;
}

/* --- PREMIUM QUANTITY INPUT --- */
.cart-qty-input {
    -webkit-appearance: none;
    -moz-appearance: textfield;
    appearance: none;
    width: 70px;
    height: 38px;
    background: hsl(var(--input)) !important;
    border: 1px solid hsl(var(--border)) !important;
    border-radius: 8px !important;
    padding: 0 10px !important;
    font-family: 'Space Grotesk', sans-serif !important;
    font-weight: 700 !important;
    font-size: 15px !important;
    color: hsl(var(--foreground)) !important;
    transition: all 0.2s ease;
    text-align: center;
    box-sizing: border-box;
}

.cart-qty-input:hover {
    border-color: hsl(var(--accent)) !important;
}

.cart-qty-input:focus {
    border-color: hsl(var(--accent)) !important;
    box-shadow: 0 0 0 3px hsla(24, 95%, 53%, 0.15);
    background: hsl(var(--card)) !important;
    outline: none;
}

/* Hide Spinners (Chrome, Safari, Edge, Opera) */
.cart-qty-input::-webkit-outer-spin-button,
.cart-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Close Button (X) */
.close-cart-btn {
    all: unset;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: hsl(var(--input));
    color: hsl(var(--secondary));
    font-size: 18px;
    font-weight: 600;
    transition: all 0.2s;
}

.close-cart-btn:hover {
    background: hsl(var(--border));
    color: hsl(var(--foreground));
    transform: rotate(90deg);
}

.remove-item-btn {
    all: unset;
    cursor: pointer;
    color: hsl(var(--border));
    padding: 4px;
    transition: color 0.2s;
}

.remove-item-btn:hover {
    color: hsl(var(--accent-red));
}

.cart-item-controls {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding-top: 12px;
    border-top: 1px dashed hsl(var(--border));
}

.qty-pill {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.qty-pill label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    color: hsl(var(--secondary));
    letter-spacing: 0.05em;
}

.item-total-price {
    text-align: right;
}

.item-total-price .label {
    font-size: 10px;
    font-weight: 800;
    color: hsl(var(--secondary));
    margin-bottom: 2px;
}

.item-total-price .value {
    font-size: 18px;
    font-weight: 800;
    color: hsl(var(--foreground));
}

/* --- CART FOOTER --- */
.cart-footer {
    padding: 32px 24px;
    background: hsl(var(--background));
    border-top: 1px solid hsl(var(--border));
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cart-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-stats {
    display: flex;
    flex-direction: column;
}

.summary-stats .total-label {
    font-size: 12px;
    font-weight: 600;
    color: hsl(var(--secondary));
}

.summary-stats .total-value {
    font-size: 28px;
    font-weight: 900;
    color: hsl(var(--foreground));
    letter-spacing: -0.02em;
}

.cart-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-generate-po {
    height: 52px;
    background: hsl(var(--accent)) !important;
    color: white !important;
    border-radius: 12px;
    font-weight: 800;
    font-size: 15px;
    box-shadow: 0 4px 20px hsla(24, 95%, 53%, 0.3);
}

.btn-clear-cart {
    height: 48px;
    background: transparent;
    border: 1px solid hsl(var(--border));
    border-radius: 12px;
    font-weight: 600;
    color: hsl(var(--secondary));
    transition: all 0.2s;
}

.btn-clear-cart:hover {
    background: hsla(var(--accent-red), 0.1);
    border-color: hsl(var(--accent-red));
    color: hsl(var(--accent-red));
}

/* --- OPS HEADER (Operations Hub) --- */
.ops-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 24px;
    border-bottom: 1px solid hsl(var(--border));
    padding-bottom: 24px;
}

.ops-header button {
    margin-left: 8px;
}

.cart-badge .cart-count {
    background: hsl(var(--accent));
    box-shadow: 0 0 0 2px hsl(var(--card));
    /* White ring around badge */
}

/* --- TOASTS --- */
.notifications-container {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    color: hsl(var(--foreground));
    padding: 16px 24px;
    border-radius: 99px;
    /* Pill toasted */
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    pointer-events: all;
    font-weight: 500;
}

.toast-success i {
    color: hsl(var(--success));
}

.toast-warning i {
    color: hsl(var(--warning));
}

.toast-danger i {
    color: hsl(var(--danger));
}

/* --- UTILITIES --- */
.empty {
    text-align: center;
    color: hsl(var(--secondary));
    padding: 60px;
}

.text-accent {
    color: hsl(var(--accent));
}

/* --- AGENT STATUS BAR (Premium Styling) --- */
.agent-status-bar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: hsla(var(--card), 0.9);
    backdrop-filter: blur(12px);
    border: 1px solid hsl(var(--border));
    padding: 12px 24px;
    border-radius: 99px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 5000;
    width: auto;
    min-width: 400px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.agent-status-bar.active {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: all;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.3);
        opacity: 0.6;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.action-card {
    background: hsl(var(--card));
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.action-card:hover:not(.monitor-card-passive) {
    transform: translateY(-4px) scale(1.01);
    border-color: rgba(239, 68, 68, 0.2);
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.1);
}

.monitor-card-passive {
    background: hsla(160, 20%, 50%, 0.02);
    border: 1px dashed var(--border);
}

.tooltip-container:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

.agent-icon {
    font-size: 24px;
    animation: bounce 2s infinite ease-in-out;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-4px);
    }
}

.agent-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.agent-name {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: hsl(var(--accent));
}

.agent-task {
    font-size: 14px;
    font-weight: 600;
    color: hsl(var(--foreground));
    white-space: nowrap;
}

.agent-progress {
    flex: 1;
    height: 6px;
    background: hsla(var(--foreground), 0.1);
    border-radius: 3px;
    overflow: hidden;
    min-width: 150px;
}

.agent-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, hsl(var(--accent)), #ff8c42);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 3px;
}

#agent-progress-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 700;
    color: hsl(var(--foreground));
}

/* ==========================================================================
   FIRST-TIME ONBOARDING SCREEN
   ========================================================================== */

.onboarding-screen {
    min-height: calc(100vh - 100px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.onboarding-content {
    max-width: 540px;
    text-align: center;
}

.onboarding-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 28px;
    background: linear-gradient(135deg, hsl(var(--accent)), hsl(var(--accent-light)));
    border-radius: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: float 3s ease-in-out infinite;
}

.onboarding-icon svg {
    width: 50px;
    height: 50px;
    color: white;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.onboarding-title {
    font-size: 36px;
    font-weight: 700;
    color: hsl(var(--foreground));
    margin-bottom: 12px;
}

.onboarding-subtitle {
    font-size: 17px;
    color: hsl(var(--secondary));
    margin-bottom: 40px;
}

.onboarding-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 40px;
    text-align: left;
}

.onboarding-step {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: 14px;
    transition: all 0.3s ease;
}

.onboarding-step.active {
    border-color: hsl(var(--accent));
    background: hsla(var(--accent), 0.04);
}

.onboarding-step.active .step-number {
    background: hsl(var(--accent));
    color: white;
}

.step-number {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    background: hsl(var(--input));
    color: hsl(var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    transition: all 0.3s ease;
}

.step-content h4 {
    font-size: 15px;
    font-weight: 700;
    color: hsl(var(--foreground));
    margin: 0 0 4px 0;
}

.step-content p {
    font-size: 13px;
    color: hsl(var(--secondary));
    margin: 0;
}

.onboarding-cta {
    margin-bottom: 28px;
}

.btn-large {
    padding: 16px 32px !important;
    font-size: 16px !important;
    gap: 10px;
    border-radius: 12px !important;
}

.onboarding-hint {
    font-size: 12px;
    color: hsl(var(--secondary));
    margin-top: 14px;
}

.onboarding-help {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    color: hsl(var(--secondary));
}

.onboarding-help a {
    color: hsl(var(--accent));
    text-decoration: none;
    font-weight: 600;
}

.onboarding-help a:hover {
    text-decoration: underline;
}

/* Hide main views when onboarding is shown */
body.onboarding-active .view-content,
body.onboarding-active .impact-bar,
body.onboarding-active .persona-nav {
    display: none !important;
}

body.onboarding-active #onboarding-welcome {
    display: flex !important;
}