/* ====== Demo Orders Page - WOW! ====== */

.ns-demo-page-new {
    background: var(--ns-bg);
}

/* Demo Hero */
.ns-demo-hero {
    position: relative;
    padding: 140px 0 80px;
    overflow: hidden;
}

.ns-demo-hero-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, #0b1220 0%, #101828 100%);
    z-index: 0;
}

.ns-demo-hero-bg::before {
    content: '';
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 600px;
    background: radial-gradient(ellipse, rgba(251, 87, 8, 0.1) 0%, transparent 60%);
    pointer-events: none;
}

.ns-demo-hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.ns-demo-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: 30px;
    color: #22c55e;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 24px;
}

.ns-demo-badge-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.ns-demo-title {
    font-size: 3.2rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
    margin: 0 0 20px 0;
}

.ns-demo-subtitle {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.7;
    margin: 0 0 40px 0;
}

.ns-demo-channels {
    display: flex;
    justify-content: center;
    gap: 30px;
}

.ns-channel-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    font-weight: 500;
    transition: all 0.3s ease;
}

.ns-channel-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--ns-primary);
    transform: translateY(-2px);
}

.ns-channel-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(251, 87, 8, 0.15);
    border-radius: 10px;
    color: var(--ns-primary);
}

.ns-channel-icon.whatsapp {
    background: rgba(37, 211, 102, 0.15);
    color: #25D366;
}

.ns-channel-icon.erp {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

/* Stats Bar */
.ns-demo-stats-bar {
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 20px 0;
}

.ns-stats-row {
    display: flex;
    justify-content: center;
    gap: 60px;
}

.ns-stat-mini {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.ns-stat-mini-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--ns-primary);
}

.ns-stat-mini-label {
    font-size: 0.85rem;
    color: var(--ns-muted);
}

.ns-text-success {
    color: #22c55e !important;
}

/* Demo Layout - Centered Approach matching User Request */
.ns-demo-layout {
    display: flex;
    flex-direction: column;
    gap: 32px;
    margin-bottom: 24px;
}

.ns-demo-panel.ns-panel-incoming {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    /* Center the panel */
    min-height: 400px;
    /* Give it some presence */
    display: flex;
    flex-direction: column;
}

.ns-panel-incoming .ns-panel-header {
    justify-content: center;
    /* Center header content */
    padding: 24px;
}

.ns-panel-incoming .ns-panel-header h3 {
    margin-right: auto;
    /* Push title to right (RTL) or left depending on direction */
    margin-left: 24px;
}

.ns-demo-panel.ns-panel-orders {
    width: 100%;
}

.ns-demo-panel {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    overflow: hidden;
}

.ns-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ns-panel-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--ns-text);
    margin: 0;
}

.ns-btn-simulate {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: linear-gradient(135deg, var(--ns-primary) 0%, #ff8c4a 100%);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(251, 87, 8, 0.3);
}

.ns-btn-simulate:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(251, 87, 8, 0.5);
}

.ns-panel-actions {
    display: flex;
    gap: 12px;
}

.ns-btn-ai {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.ns-btn-ai:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.5);
}

/* AI Upload Zone */
.ns-ai-upload-zone {
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
    /* Fill remaining space */
    justify-content: center;
}

.ns-upload-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 40px 30px;
    border: 2px dashed rgba(251, 87, 8, 0.4);
    /* Orange dashed border */
    border-radius: 16px;
    background: rgba(251, 87, 8, 0.03);
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.ns-upload-box:hover,
.ns-upload-box.dragover {
    border-color: var(--ns-primary);
    background: rgba(251, 87, 8, 0.08);
    transform: scale(1.01);
}

.ns-upload-icon {
    color: var(--ns-primary);
    opacity: 0.9;
    transform: scale(1.2);
    margin-bottom: 8px;
}

.ns-upload-box h4 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
}

.ns-upload-box p {
    margin: 0;
    font-size: 1rem;
    color: var(--ns-muted);
}

.ns-btn-choose {
    padding: 12px 28px;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.ns-btn-choose:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.5);
}

.ns-upload-hint {
    font-size: 0.85rem;
    color: var(--ns-muted);
}

.ns-selected-file {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
}

.ns-file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    font-size: 1rem;
    font-weight: 500;
}

.ns-file-info svg {
    color: #60a5fa;
}

.ns-btn-remove {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: 8px;
    color: var(--ns-muted);
    font-size: 1.4rem;
    cursor: pointer;
}

.ns-btn-remove:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* Impressive & Flashing Parse Button */
.ns-btn-parse {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    margin-top: 10px;
    background: linear-gradient(135deg, var(--ns-primary) 0%, #ff8c4a 100%);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 1.2rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 0 20px rgba(251, 87, 8, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

/* Shine effect */
.ns-btn-parse::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: skewX(-20deg);
}

/* Active State Pulse */
.ns-btn-parse:not(:disabled) {
    animation: ns-btn-heartbeat 2s infinite ease-in-out;
}

.ns-btn-parse:not(:disabled)::after {
    animation: ns-shine 2.5s infinite ease-in-out;
}

.ns-btn-parse:hover:not(:disabled) {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 10px 30px rgba(251, 87, 8, 0.6);
    filter: brightness(1.1);
}

@keyframes ns-btn-heartbeat {
    0% {
        box-shadow: 0 0 15px rgba(251, 87, 8, 0.4);
    }

    50% {
        box-shadow: 0 0 30px rgba(251, 87, 8, 0.7);
    }

    100% {
        box-shadow: 0 0 15px rgba(251, 87, 8, 0.4);
    }
}

.ns-btn-parse:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: linear-gradient(135deg, #374151 0%, #4b5563 100%);
    box-shadow: none;
    animation: none;
}

.ns-btn-back {
    padding: 10px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--ns-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ns-btn-back:hover {
    border-color: var(--ns-primary);
    color: var(--ns-text);
}

/* AI Processing */
.ns-ai-processing {
    padding: 40px 20px;
    text-align: center;
}

.ns-ai-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 30px;
}

.ns-ai-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.ns-ai-node-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(139, 92, 246, 0.1);
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-radius: 14px;
    color: #8b5cf6;
    font-size: 0.85rem;
    font-weight: 700;
    transition: all 0.3s ease;
}

.ns-ai-node-icon.active {
    background: #8b5cf6;
    border-color: #8b5cf6;
    color: #fff;
    animation: aiPulse 1.5s infinite;
}

.ns-ai-node-icon.done {
    background: #22c55e;
    border-color: #22c55e;
    color: #fff;
}

@keyframes aiPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.4);
    }

    50% {
        box-shadow: 0 0 0 12px rgba(139, 92, 246, 0);
    }
}

.ns-ai-node span {
    font-size: 0.75rem;
    color: var(--ns-muted);
}

.ns-ai-connector {
    width: 40px;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}

.ns-ai-connector.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, #8b5cf6, transparent);
    animation: flowLine 1s infinite;
}

.ns-ai-connector.done {
    background: #22c55e;
}

.ns-ai-status {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--ns-text);
    margin-bottom: 16px;
}

.ns-ai-progress {
    width: 100%;
    max-width: 300px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin: 0 auto;
    overflow: hidden;
}

.ns-ai-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #8b5cf6, #a78bfa);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Confetti */
.ns-confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.ns-confetti {
    position: absolute;
    top: -10px;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    animation: confettiFall 3s ease-out forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Parse Result Modal */
.ns-parse-modal,
.ns-json-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.ns-parse-modal-card {
    position: relative;
    z-index: 1001;
    width: 100%;
    max-width: 700px;
    max-height: 85vh;
    background: linear-gradient(145deg, #1a2332 0%, #0f1620 100%);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(139, 92, 246, 0.15);
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.ns-parse-modal-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(139, 92, 246, 0.05) 100%);
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

.ns-parse-modal-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
    border-radius: 14px;
    color: #fff;
}

.ns-parse-modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--ns-text);
}

.ns-parse-modal-header p {
    margin: 4px 0 0;
    font-size: 0.9rem;
    color: var(--ns-muted);
}

.ns-parse-modal-header .ns-modal-close {
    margin-right: auto;
}

.ns-parse-modal-body {
    padding: 24px;
    max-height: 50vh;
    overflow-y: auto;
}

.ns-parsed-section {
    margin-bottom: 20px;
}

.ns-parsed-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #8b5cf6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

.ns-parsed-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.ns-parsed-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 12px 14px;
}

.ns-parsed-item.full-width {
    grid-column: span 2;
}

.ns-parsed-label {
    font-size: 0.75rem;
    color: var(--ns-muted);
    margin-bottom: 4px;
}

.ns-parsed-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ns-text);
}

.ns-parsed-value.highlight {
    color: #22c55e;
    font-size: 1.2rem;
}

.ns-parsed-items-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.ns-parsed-items-table th {
    text-align: right;
    padding: 10px 12px;
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
    font-weight: 600;
    font-size: 0.75rem;
}

.ns-parsed-items-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--ns-text);
}

.ns-parsed-items-table tr:last-child td {
    border-bottom: none;
}

.ns-parse-modal-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 24px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* JSON Modal */
.ns-json-modal-card {
    position: relative;
    z-index: 1001;
    width: 100%;
    max-width: 800px;
    max-height: 85vh;
    background: linear-gradient(145deg, #1a2332 0%, #0f1620 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
}

.ns-json-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ns-json-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--ns-text);
}

.ns-json-content {
    margin: 0;
    padding: 20px 24px;
    max-height: 55vh;
    overflow: auto;
    background: rgba(0, 0, 0, 0.2);
    font-family: 'Fira Code', 'Monaco', monospace;
    font-size: 0.8rem;
    line-height: 1.6;
    color: #a5d6ff;
    direction: ltr;
    text-align: left;
}

.ns-json-modal-footer {
    display: flex;
    justify-content: space-between;
    padding: 16px 24px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Order Detail Modal */
.ns-order-detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.ns-order-detail-card {
    position: relative;
    z-index: 1001;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    background: linear-gradient(145deg, #1a2332 0%, #0f1620 100%);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(34, 197, 94, 0.1);
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
}

.ns-order-detail-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15) 0%, rgba(34, 197, 94, 0.05) 100%);
    border-bottom: 1px solid rgba(34, 197, 94, 0.2);
}

.ns-order-detail-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    border-radius: 14px;
    color: #fff;
}

.ns-order-detail-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--ns-text);
}

.ns-order-detail-header p {
    margin: 4px 0 0;
    font-size: 0.9rem;
    color: var(--ns-muted);
}

.ns-order-detail-header .ns-modal-close {
    margin-right: auto;
}

.ns-order-detail-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

.ns-order-detail-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 24px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Detail Header Info */
.ns-detail-header-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(34, 197, 94, 0.03) 100%);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 12px;
    margin-bottom: 20px;
}

.ns-detail-doc-type {
    font-size: 1.1rem;
    font-weight: 700;
    color: #22c55e;
}

.ns-detail-doc-meta {
    display: flex;
    gap: 20px;
    font-size: 0.9rem;
    color: var(--ns-muted);
}

.ns-detail-doc-meta strong {
    color: var(--ns-text);
}

/* Parties Grid */
.ns-detail-parties {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.ns-detail-party {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px;
}

.ns-detail-party-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #8b5cf6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

.ns-detail-party-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ns-text);
    margin-bottom: 8px;
}

.ns-detail-field {
    font-size: 0.85rem;
    color: var(--ns-text);
    margin-bottom: 4px;
}

.ns-detail-field span {
    color: var(--ns-muted);
    margin-left: 4px;
}

.ns-detail-agent {
    font-size: 0.9rem;
    color: var(--ns-muted);
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    margin-bottom: 20px;
}

.ns-detail-agent span {
    color: var(--ns-muted);
}

/* Items Section */
.ns-detail-section {
    margin-bottom: 20px;
}

.ns-detail-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #3b82f6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.ns-detail-items-wrapper {
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

.ns-detail-items-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.ns-detail-items-table th {
    text-align: right;
    padding: 12px;
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    font-weight: 600;
    font-size: 0.75rem;
    white-space: nowrap;
}

.ns-detail-items-table td {
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--ns-text);
}

.ns-detail-items-table tr:last-child td {
    border-bottom: none;
}

.ns-detail-items-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Totals */
.ns-detail-totals {
    background: rgba(34, 197, 94, 0.05);
    border: 1px solid rgba(34, 197, 94, 0.15);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
}

.ns-detail-totals-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ns-detail-total-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--ns-text);
}

.ns-detail-total-row.total {
    font-size: 1.15rem;
    font-weight: 700;
    color: #22c55e;
    padding-top: 10px;
    margin-top: 8px;
    border-top: 1px solid rgba(34, 197, 94, 0.2);
}

/* Notes */
.ns-detail-notes {
    background: rgba(251, 191, 36, 0.05);
    border: 1px solid rgba(251, 191, 36, 0.15);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 20px;
}

.ns-detail-notes-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #fbbf24;
    margin-bottom: 8px;
}

.ns-detail-note {
    font-size: 0.9rem;
    color: var(--ns-text);
    line-height: 1.5;
}

/* Confidence */
.ns-detail-confidence {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--ns-muted);
}

.ns-confidence-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.ns-confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.ns-confidence-value {
    font-weight: 600;
    color: #22c55e;
}

/* View button style */
.ns-action-btn.view {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.ns-action-btn.view:hover {
    background: rgba(59, 130, 246, 0.25);
}

@media (max-width: 768px) {
    .ns-detail-parties {
        grid-template-columns: 1fr;
    }

    .ns-detail-header-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .ns-detail-doc-meta {
        flex-direction: column;
        gap: 4px;
    }

    .ns-order-detail-card {
        max-height: 95vh;
    }
}

/* Incoming Feed */
.ns-incoming-feed {
    height: 400px;
    overflow-y: auto;
    padding: 16px;
}

.ns-feed-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--ns-muted);
    text-align: center;
}

.ns-feed-empty svg {
    opacity: 0.3;
    margin-bottom: 16px;
}

.ns-incoming-card {
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    margin-bottom: 12px;
    animation: slideIn 0.4s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.ns-incoming-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.ns-incoming-source {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.75rem;
}

.ns-incoming-source.email {
    background: rgba(251, 87, 8, 0.15);
    color: var(--ns-primary);
}

.ns-incoming-source.whatsapp {
    background: rgba(37, 211, 102, 0.15);
    color: #25D366;
}

.ns-incoming-source.ai {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

.ns-incoming-info {
    flex: 1;
}

.ns-incoming-customer {
    font-weight: 600;
    color: var(--ns-text);
    font-size: 0.95rem;
}

.ns-incoming-time {
    font-size: 0.8rem;
    color: var(--ns-muted);
}

.ns-incoming-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.ns-incoming-amount {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ns-primary);
}

.ns-incoming-status {
    padding: 4px 10px;
    background: rgba(234, 179, 8, 0.15);
    border-radius: 20px;
    color: #eab308;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Filter Tabs */
.ns-filter-tabs {
    display: flex;
    gap: 8px;
}

.ns-filter-tab {
    padding: 6px 14px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--ns-muted);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ns-filter-tab:hover {
    border-color: var(--ns-primary);
    color: var(--ns-text);
}

.ns-filter-tab.active {
    background: var(--ns-primary);
    border-color: var(--ns-primary);
    color: #fff;
}

/* Orders Table */
.ns-orders-table-wrap {
    overflow-x: auto;
}

.ns-orders-table {
    width: 100%;
    border-collapse: collapse;
}

.ns-orders-table th,
.ns-orders-table td {
    padding: 14px 16px;
    text-align: right;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ns-orders-table th {
    background: rgba(255, 255, 255, 0.02);
    color: var(--ns-muted);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.ns-orders-table td {
    color: var(--ns-text);
    font-size: 0.9rem;
}

.ns-orders-table tbody tr {
    transition: background 0.2s ease;
}

.ns-orders-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.ns-orders-table tbody tr.new-row {
    animation: highlightRow 2s ease;
}

@keyframes highlightRow {
    0% {
        background: rgba(251, 87, 8, 0.2);
    }

    100% {
        background: transparent;
    }
}

.ns-source-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.ns-source-badge.email {
    background: rgba(251, 87, 8, 0.15);
    color: var(--ns-primary);
}

.ns-source-badge.whatsapp {
    background: rgba(37, 211, 102, 0.15);
    color: #25D366;
}

.ns-source-badge.ai {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

.ns-status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.ns-status-badge.pending {
    background: rgba(234, 179, 8, 0.15);
    color: #eab308;
}

.ns-status-badge.approved {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.ns-status-badge.erp {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

.ns-status-badge.shipping {
    background: rgba(236, 72, 153, 0.15);
    color: #ec4899;
}

.ns-status-badge.delivered {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.ns-action-btns {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.ns-action-btn {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--ns-text);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.ns-action-btn:hover {
    background: var(--ns-primary);
    border-color: var(--ns-primary);
    color: #fff;
}

.ns-action-btn.success {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.ns-action-btn.success:hover {
    background: #22c55e;
    color: #fff;
}

.ns-action-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Activity Log */
.ns-demo-log {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    overflow: hidden;
}

.ns-log-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ns-log-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ns-text);
    margin: 0;
}

.ns-btn-clear {
    padding: 4px 10px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: var(--ns-muted);
    font-size: 0.75rem;
    cursor: pointer;
}

.ns-log-feed {
    max-height: 150px;
    overflow-y: auto;
    padding: 12px 20px;
}

.ns-log-item {
    display: flex;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.85rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.ns-log-time {
    color: var(--ns-muted);
    font-family: monospace;
}

.ns-log-text {
    color: var(--ns-text);
}

/* Demo Features */
.ns-demo-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 40px;
}

.ns-demo-feature {
    padding: 28px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    text-align: center;
    transition: all 0.3s ease;
}

.ns-demo-feature:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(251, 87, 8, 0.2);
    transform: translateY(-4px);
}

.ns-demo-feature .ns-feature-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(251, 87, 8, 0.1);
    border-radius: 14px;
    color: var(--ns-primary);
    margin: 0 auto 18px;
}

.ns-demo-feature .ns-feature-icon.whatsapp {
    background: rgba(37, 211, 102, 0.1);
    color: #25D366;
}

.ns-demo-feature h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ns-text);
    margin: 0 0 10px 0;
}

.ns-demo-feature p {
    font-size: 0.9rem;
    color: var(--ns-muted);
    margin: 0;
    line-height: 1.5;
}

/* Demo CTA */
.ns-demo-cta {
    text-align: center;
    padding: 50px;
    background: linear-gradient(135deg, rgba(251, 87, 8, 0.08) 0%, rgba(251, 87, 8, 0.02) 100%);
    border: 1px solid rgba(251, 87, 8, 0.15);
    border-radius: 24px;
}

.ns-demo-cta h2 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--ns-text);
    margin: 0 0 12px 0;
}

.ns-demo-cta p {
    font-size: 1.1rem;
    color: var(--ns-muted);
    margin: 0 0 28px 0;
}

/* Modal */
.ns-action-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ns-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.ns-modal-card {
    position: relative;
    width: 90%;
    max-width: 500px;
    background: #1a1f2e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    overflow: hidden;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.ns-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ns-modal-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--ns-text);
    margin: 0;
}

.ns-modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 8px;
    color: var(--ns-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.ns-modal-body {
    padding: 24px;
}

.ns-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Modal Flow Animation */
.ns-modal-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 30px 0;
}

.ns-modal-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.ns-modal-node-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(251, 87, 8, 0.1);
    border: 2px solid rgba(251, 87, 8, 0.3);
    border-radius: 16px;
    color: var(--ns-primary);
    font-size: 0.9rem;
    font-weight: 700;
}

.ns-modal-node-icon.active {
    background: var(--ns-primary);
    color: #fff;
    animation: nodePulse 1s infinite;
}

@keyframes nodePulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(251, 87, 8, 0.4);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(251, 87, 8, 0);
    }
}

.ns-modal-node-text {
    font-size: 0.8rem;
    color: var(--ns-muted);
}

.ns-modal-connector {
    width: 60px;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.ns-modal-connector.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--ns-primary), transparent);
    animation: flowLine 1s infinite;
}

@keyframes flowLine {
    from {
        left: -100%;
    }

    to {
        left: 100%;
    }
}

.ns-modal-status {
    text-align: center;
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    margin-top: 20px;
}

.ns-modal-status-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ns-text);
}

/* Responsive */
@media (max-width: 992px) {
    .ns-demo-layout {
        grid-template-columns: 1fr;
    }

    .ns-demo-features {
        grid-template-columns: repeat(2, 1fr);
    }

    .ns-demo-channels {
        flex-wrap: wrap;
    }

    .ns-stats-row {
        gap: 30px;
    }
}

@media (max-width: 768px) {
    .ns-demo-hero {
        padding: 100px 0 60px;
    }

    .ns-demo-title {
        font-size: 2.2rem;
    }

    .ns-demo-features {
        grid-template-columns: 1fr;
    }

    .ns-stats-row {
        flex-wrap: wrap;
        gap: 20px;
    }

    .ns-panel-header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .ns-filter-tabs {
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* AI Result View (Split View) */
.ns-ai-result-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 480px;
    /* Ensure enough height */
    position: relative;
    padding: 0;
    overflow: hidden;
    background: var(--ns-bg);
    border-radius: 12px;
}

.ns-split-view {
    display: flex;
    flex-direction: row;
    height: 100%;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* PDF Side */
.ns-pdf-side {
    width: 40%;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    /* RTL border */
    min-width: 150px;
}

/* Fix border for LTR */
html[dir='ltr'] .ns-pdf-side {
    border-left: none;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.ns-pdf-preview-box {
    text-align: center;
    color: var(--ns-muted);
}

.ns-pdf-icon-lg {
    width: 64px;
    height: 64px;
    margin: 0 auto 12px;
    color: #ef4444;
    /* PDF Color */
    opacity: 0.8;
}

.ns-pdf-icon-lg svg {
    width: 100%;
    height: 100%;
}

.ns-pdf-name {
    font-size: 0.85rem;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 0 auto;
}

/* Data Side */
.ns-data-side {
    width: 60%;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.02);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    flex-grow: 1;
}

.ns-data-header {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.02);
}

.ns-data-header h4 {
    margin: 0;
    font-size: 0.95rem;
    color: var(--ns-text);
    font-weight: 600;
}

.ns-confidence-badge {
    font-size: 0.75rem;
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.ns-extracted-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* Actions */
.ns-result-actions {
    display: flex;
    gap: 12px;
    padding: 16px;
    justify-content: flex-end;
    background: rgba(255, 255, 255, 0.04);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.ns-btn-secondary {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--ns-muted);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.ns-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
    color: var(--ns-text);
}

/* Reuse parsed item styles from modal but adjusted */
.ns-ai-result-view .ns-parsed-grid {
    grid-template-columns: 1fr;
    /* Single column in narrow view */
    gap: 8px;
}

.ns-ai-result-view .ns-parsed-item {
    padding: 10px 12px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
}

.ns-ai-result-view .ns-parsed-value {
    font-size: 0.95rem;
}

.ns-ai-result-view .ns-parsed-items-table th {
    background: rgba(139, 92, 246, 0.1);
    color: #a78bfa;
    padding: 8px;
    font-size: 0.8rem;
}

.ns-ai-result-view .ns-parsed-items-table td {
    padding: 8px;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}


/* Real AI Badge Animation */
.ns-real-ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(251, 87, 8, 0.15);
    border: 1px solid var(--ns-primary);
    border-radius: 50px;
    color: var(--ns-primary);
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 0 15px rgba(251, 87, 8, 0.3);
    animation: ns-ai-pulse 2s infinite ease-in-out;
    position: relative;
    z-index: 10;
}

.ns-real-ai-badge::before {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    background: var(--ns-primary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--ns-primary);
    animation: ns-ai-blink 1s infinite alternate;
}

@keyframes ns-ai-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(251, 87, 8, 0.4);
        transform: scale(1);
    }

    50% {
        box-shadow: 0 0 20px 5px rgba(251, 87, 8, 0.2);
        transform: scale(1.02);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(251, 87, 8, 0.4);
        transform: scale(1);
    }
}

@keyframes ns-ai-blink {
    0% {
        opacity: 0.4;
    }

    100% {
        opacity: 1;
    }
}

/* Specific positioning for Hero */
.ns-demo-hero-badges {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.ns-demo-hero .ns-demo-badge {
    margin-bottom: 0;
    /* Override */
}

/* Contextual styling for Upload Zone */
.ns-upload-box {
    position: relative;
    /* For absolute positioning of badge if needed */
}

.ns-upload-ai-badge {
    position: absolute;
    top: -12px;
    right: 20px;
    font-size: 0.75rem;
    padding: 4px 10px;
    background: var(--ns-bg);
    /* Hide border behind */
    border-color: var(--ns-primary);
    /* Ensure orange border */
}

/* RTL adjustment */
[dir='rtl'] .ns-upload-ai-badge {
    right: auto;
    left: 20px;
}