/* ==========================================================================
   PetroCore Trade Operations Forms - UI/UX Modern Design System
   (Purchase Receipt, Sales Dispatch, Direct Delivery)
   ========================================================================== */

/* Hero Banner & Sticky Action Bar */
.trade-form-hero {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 0.75rem;
    padding: 1.25rem 1.75rem;
    color: #fff;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.15), 0 8px 10px -6px rgba(15, 23, 42, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.trade-form-hero .hero-badge {
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-radius: 9999px;
}

.trade-form-hero .badge-inbound {
    background: rgba(56, 189, 248, 0.2);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.trade-form-hero .badge-outbound {
    background: rgba(74, 222, 128, 0.2);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.3);
}

.trade-form-hero .badge-direct {
    background: rgba(168, 85, 247, 0.2);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.trade-quick-chip {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.5rem;
    padding: 0.4rem 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #e2e8f0;
}

.trade-quick-chip .chip-label {
    color: #94a3b8;
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 600;
}

.trade-quick-chip .chip-value {
    font-weight: 700;
    color: #fff;
}

/* Section Anchor Stepper */
.trade-stepper-bar {
    display: flex;
    gap: 0.5rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 0.5rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    white-space: nowrap;
}

.trade-step-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.85rem;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
    background: transparent;
    border: none;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.trade-step-item:hover {
    color: #0f172a;
    background: #e2e8f0;
}

.trade-step-item.active {
    background: #fff;
    color: #0284c7;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    font-weight: 700;
}

.trade-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 50%;
    background: #e2e8f0;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 700;
}

.trade-step-item.active .trade-step-number {
    background: #0284c7;
    color: #fff;
}

/* Card Styling */
.trade-section-card {
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    background: #fff;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
    margin-bottom: 1.5rem;
}

.trade-section-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
}

.trade-section-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    background: #fafafa;
    border-top-left-radius: 0.75rem;
    border-top-right-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.trade-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.trade-section-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    background: #e0f2fe;
    color: #0284c7;
    font-size: 1rem;
}

/* Settlement Basis Segmented Toggle */
.basis-toggle-container {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 0.6rem;
    padding: 0.25rem;
    display: inline-flex;
    gap: 0.25rem;
    width: 100%;
}

.basis-toggle-btn {
    flex: 1;
    padding: 0.6rem 0.85rem;
    border-radius: 0.45rem;
    border: none;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    background: transparent;
    color: #64748b;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.basis-toggle-btn:hover {
    color: #0f172a;
    background: rgba(255, 255, 255, 0.6);
}

.basis-toggle-btn.active {
    background: #fff;
    color: #0284c7;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(2, 132, 199, 0.2);
}

.basis-toggle-btn .sub-text {
    font-size: 0.68rem;
    color: #94a3b8;
    margin-top: 0.15rem;
}

.basis-toggle-btn.active .sub-text {
    color: #0284c7;
}

/* Weighbridge Matrix Console */
.weighbridge-console {
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    overflow: hidden;
}

.weighbridge-header {
    background: #e2e8f0;
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #475569;
}

.weighbridge-cell {
    padding: 1rem;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.weighbridge-cell.is-basis {
    background: #f0f9ff;
    border: 2px solid #38bdf8;
    border-radius: 0.5rem;
    position: relative;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.basis-indicator-badge {
    position: absolute;
    top: -0.65rem;
    right: 0.75rem;
    background: #0284c7;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(2, 132, 199, 0.3);
}

.loss-pill {
    padding: 0.4rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.loss-pill.danger {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.loss-pill.zero {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.loss-pill.gain {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

/* Dual Currency Financial Cards */
.financial-ledger-card {
    border-radius: 0.75rem;
    padding: 1.25rem;
    border: 1px solid #e2e8f0;
    position: relative;
    overflow: hidden;
}

.financial-ledger-card.usd-card {
    background: linear-gradient(180deg, #f0f9ff 0%, #ffffff 100%);
    border-color: #bae6fd;
}

.financial-ledger-card.iqd-card {
    background: linear-gradient(180deg, #fffbeb 0%, #ffffff 100%);
    border-color: #fde68a;
}

.financial-stat-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.75rem;
    text-align: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.financial-stat-box:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.06);
}

.financial-stat-box .stat-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.25rem;
}

.financial-stat-box .stat-value {
    font-size: 1rem;
    font-weight: 800;
    display: block;
}

.financial-stat-box .stat-sub {
    font-size: 0.7rem;
    color: #94a3b8;
    margin-top: 0.15rem;
    display: block;
}

/* Sticky Executive Summary Sidebar */
.sticky-summary-card {
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.sticky-summary-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #fff;
    padding: 1.25rem;
}

.big-total-display {
    font-size: 1.75rem;
    font-weight: 800;
    color: #38bdf8;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-top: 0.25rem;
}

.summary-breakdown-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px dashed #e2e8f0;
    font-size: 0.8rem;
}

.summary-breakdown-row:last-child {
    border-bottom: none;
}

.summary-breakdown-row .label {
    color: #64748b;
    font-weight: 500;
}

.summary-breakdown-row .val {
    font-weight: 700;
    color: #1e293b;
}

/* Primary Button Styling */
.btn-save-glow {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    border: none;
    color: #ffffff;
    font-weight: 700;
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
    transition: all 0.2s ease;
}

.btn-save-glow:hover:not(:disabled) {
    background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(2, 132, 199, 0.45);
    color: #ffffff;
}

.btn-save-glow:active:not(:disabled) {
    transform: translateY(0);
}

/* Info Banner for Contract */
.contract-insight-banner {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 0.5rem;
    padding: 0.6rem 0.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78rem;
    color: #166534;
    margin-top: 0.5rem;
}

/* Custom Checkbox Toggle Card */
.feature-toggle-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.65rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.2s ease;
}

.feature-toggle-card:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.feature-toggle-card.active {
    background: #f0fdf4;
    border-color: #86efac;
}

/* Responsive tweaks */
@media (max-width: 991px) {
    .trade-form-hero {
        padding: 1rem;
    }
    .big-total-display {
        font-size: 1.4rem;
    }
}
