/**
 * TCB Voyage Estimator — Styles
 * Theme: White background with dark navy header bars and gold/amber accents
 * Matches The Charter Box Freight Rate Converter & Laytime Calculator style
 */

/* ============================================
   CSS CUSTOM PROPERTIES
   ============================================ */
:root {
    --tcb-ve-bg-page: #ffffff;
    --tcb-ve-bg-card: #ffffff;
    --tcb-ve-bg-header: #1B2A4A;
    --tcb-ve-bg-input: #ffffff;
    --tcb-ve-bg-input-hover: #fafafa;
    --tcb-ve-border: #d1d5db;
    --tcb-ve-border-focus: #d4a843;
    --tcb-ve-text-primary: #1a1a2e;
    --tcb-ve-text-secondary: #4a5568;
    --tcb-ve-text-muted: #9ca3af;
    --tcb-ve-text-on-dark: #ffffff;
    --tcb-ve-accent: #d4a843;
    --tcb-ve-accent-hover: #c49a38;
    --tcb-ve-accent-glow: rgba(212, 168, 67, 0.15);
    --tcb-ve-accent-bg: rgba(212, 168, 67, 0.06);
    --tcb-ve-positive: #059669;
    --tcb-ve-negative: #dc2626;
    --tcb-ve-radius: 8px;
    --tcb-ve-radius-sm: 4px;
    --tcb-ve-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --tcb-ve-shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.12);
    --tcb-ve-transition: 0.2s ease;
    --tcb-ve-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
}

/* ============================================
   BASE WRAPPER
   ============================================ */
.tcb-ve-wrapper {
    font-family: var(--tcb-ve-font);
    color: var(--tcb-ve-text-primary);
    background: var(--tcb-ve-bg-page);
    line-height: 1.5;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

.tcb-ve-wrapper *,
.tcb-ve-wrapper *::before,
.tcb-ve-wrapper *::after {
    box-sizing: border-box;
}

/* ============================================
   STICKY HEADER BAR
   ============================================ */
.tcb-ve-header {
    background: var(--tcb-ve-bg-header);
    color: #ffffff;
    padding: 16px 24px;
    border-radius: 8px 8px 0 0;
    margin-bottom: 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.tcb-ve-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.tcb-ve-header-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #ffffff;
}

.tcb-ve-header-title span {
    font-weight: 400;
    opacity: 0.85;
}

/* Share social icons */
.tcb-ve-share-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tcb-ve-share-label {
    font-size: 12px;
    color: #888;
    font-weight: 500;
}

.tcb-ve-share-social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: transform 0.2s, opacity 0.2s;
}

.tcb-ve-share-social:hover {
    transform: scale(1.1);
    opacity: 0.85;
}

.tcb-ve-share-linkedin { background: #0A66C2; }
.tcb-ve-share-facebook { background: #1877F2; }
.tcb-ve-share-x { background: #000000; }

/* Header action buttons */
.tcb-ve-header-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.tcb-ve-hdr-btn {
    background: rgba(255,255,255,0.15);
    color: #ffffff;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    font-family: var(--tcb-ve-font);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    line-height: 1.4;
}

.tcb-ve-hdr-btn:hover {
    background: rgba(255,255,255,0.25);
    color: #ffffff;
    text-decoration: none;
}

/* Currency row in results panel */
.tcb-ve-currency-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: var(--tcb-ve-bg-header);
    border-bottom: 1px solid var(--tcb-ve-border);
    white-space: nowrap;
    overflow-x: auto;
}

.tcb-ve-currency-select {
    background: rgba(255,255,255,0.12);
    color: #ffffff;
    border: 1px solid rgba(255,255,255,0.25);
    padding: 3px 22px 3px 8px;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--tcb-ve-font);
    border-radius: 4px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%23fff'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    line-height: 1.4;
    flex-shrink: 0;
    width: auto;
}

.tcb-ve-currency-select:hover {
    background: rgba(255,255,255,0.22);
}

.tcb-ve-currency-select option {
    background: #1a2a44;
    color: #ffffff;
}

.tcb-ve-fx-info {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: rgba(255,255,255,0.6);
    min-width: 0;
}

#tcb-ve-fx-rate-text {
    overflow: hidden;
    text-overflow: ellipsis;
}

#tcb-ve-fx-auto-badge {
    background: rgba(76, 175, 80, 0.25);
    color: #4caf50;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.tcb-ve-fx-edit-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.45);
    cursor: pointer;
    font-size: 13px;
    padding: 1px 3px;
    border-radius: 3px;
    transition: color 0.2s;
    line-height: 1;
    flex-shrink: 0;
}

.tcb-ve-fx-edit-btn:hover {
    color: var(--tcb-ve-accent);
}

.tcb-ve-fx-override-input {
    width: 72px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(212,168,67,0.5);
    color: #fff;
    border-radius: 4px;
    padding: 2px 5px;
    font-size: 12px;
    font-family: var(--tcb-ve-font);
    flex-shrink: 0;
}

.tcb-ve-hdr-btn-report {
    background: transparent;
    border: 1.5px solid #5b6b7d;
    color: #5b6b7d;
}

.tcb-ve-hdr-btn-report:hover {
    background: #5b6b7d;
    color: #ffffff;
}

.tcb-ve-hdr-btn-guide {
    background: transparent;
    border: 1px solid #2CA6A4;
    color: #2CA6A4;
}

.tcb-ve-hdr-btn-guide:hover {
    background: #2CA6A4;
    color: #ffffff;
}

/* WP admin bar offset for sticky header */
.admin-bar .tcb-ve-header {
    top: 32px;
}

@media (max-width: 782px) {
    .admin-bar .tcb-ve-header {
        top: 46px;
    }
}

@media (max-width: 768px) {
    .tcb-ve-header {
        border-radius: 0;
        padding: 12px 16px;
    }

    .tcb-ve-header-top {
        flex-wrap: wrap;
    }
}

@media (max-width: 600px) {
    .tcb-ve-header-actions {
        width: 100%;
    }

    .tcb-ve-header-actions .tcb-ve-hdr-btn {
        flex: 1;
        text-align: center;
        justify-content: center;
    }

    .tcb-ve-share-group {
        width: 100%;
        justify-content: flex-end;
    }
}

/* ============================================
   LAYOUT — INPUT + RESULTS SIDE BY SIDE
   ============================================ */
.tcb-ve-layout {
    display: grid;
    grid-template-columns: 1fr 480px;
    gap: 24px;
    align-items: start;
}

@media (max-width: 1024px) {
    .tcb-ve-layout {
        grid-template-columns: 1fr;
    }
}

.tcb-ve-inputs {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ============================================
   ACCORDION SECTIONS
   ============================================ */
.tcb-ve-section {
    background: var(--tcb-ve-bg-card);
    border: 1px solid var(--tcb-ve-border);
    border-radius: var(--tcb-ve-radius);
    overflow: hidden;
    box-shadow: var(--tcb-ve-shadow);
}

.tcb-ve-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 20px;
    background: var(--tcb-ve-bg-header);
    border: none;
    color: var(--tcb-ve-text-on-dark);
    cursor: pointer;
    transition: background var(--tcb-ve-transition);
}

.tcb-ve-section-header:hover {
    background: #0d1e35;
}

.tcb-ve-section-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--tcb-ve-text-on-dark);
}

.tcb-ve-toggle-icon::after {
    content: "\25BC";
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    transition: transform var(--tcb-ve-transition);
    display: inline-block;
}

.tcb-ve-section[data-expanded="false"] .tcb-ve-toggle-icon::after {
    transform: rotate(-90deg);
}

.tcb-ve-section-body {
    padding: 16px 20px 20px;
    background: var(--tcb-ve-bg-card);
}

.tcb-ve-section-body[hidden] {
    display: none;
}

/* ============================================
   FORM FIELDS
   ============================================ */
.tcb-ve-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.tcb-ve-field label {
    font-size: 13px;
    font-weight: 500;
    color: var(--tcb-ve-text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.tcb-ve-input-unit {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--tcb-ve-border);
    border-radius: var(--tcb-ve-radius-sm);
    overflow: hidden;
    transition: border-color var(--tcb-ve-transition);
    background: var(--tcb-ve-bg-input);
}

.tcb-ve-input-unit:focus-within {
    border-color: var(--tcb-ve-border-focus);
    box-shadow: 0 0 0 2px var(--tcb-ve-accent-glow);
}

.tcb-ve-input-unit input {
    flex: 1;
    padding: 8px 10px;
    background: transparent;
    color: var(--tcb-ve-text-primary);
    border: none;
    font-size: 14px;
    min-width: 0;
    outline: none;
}

.tcb-ve-input-unit input::placeholder {
    color: var(--tcb-ve-text-muted);
}

.tcb-ve-unit {
    display: flex;
    align-items: center;
    padding: 0 10px;
    background: #f3f4f6;
    color: var(--tcb-ve-text-muted);
    font-size: 12px;
    white-space: nowrap;
    border-left: 1px solid var(--tcb-ve-border);
}

/* Standalone inputs and selects */
.tcb-ve-field input[type="text"],
.tcb-ve-field select {
    padding: 8px 10px;
    background: var(--tcb-ve-bg-input);
    color: var(--tcb-ve-text-primary);
    border: 1px solid var(--tcb-ve-border);
    border-radius: var(--tcb-ve-radius-sm);
    font-size: 14px;
    outline: none;
    transition: border-color var(--tcb-ve-transition);
}

.tcb-ve-field input[type="text"]:focus,
.tcb-ve-field select:focus {
    border-color: var(--tcb-ve-border-focus);
    box-shadow: 0 0 0 2px var(--tcb-ve-accent-glow);
}

.tcb-ve-field select {
    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='%234a5568' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

/* Row layouts */
.tcb-ve-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.tcb-ve-row-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

@media (max-width: 600px) {
    .tcb-ve-row,
    .tcb-ve-row-3 {
        grid-template-columns: 1fr;
    }
}

.tcb-ve-sub-heading {
    margin: 12px 0 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--tcb-ve-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tcb-ve-sub-heading:first-child {
    margin-top: 0;
}

/* ============================================
   TOOLTIP  (matches Laytime Calculator)
   ============================================ */
.tcb-ve-tooltip-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: help;
}

.tcb-ve-tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--tcb-ve-accent-glow);
    color: var(--tcb-ve-accent);
    font-size: 11px;
    font-weight: 600;
    font-style: normal;
    line-height: 1;
    flex-shrink: 0;
}

.tcb-ve-tooltip-text {
    display: none;
    position: fixed;
    background: var(--tcb-ve-bg-header);
    color: var(--tcb-ve-text-on-dark);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.5;
    font-weight: 400;
    font-style: normal;
    text-transform: none;
    letter-spacing: 0;
    white-space: normal;
    width: 300px;
    max-width: calc(100vw - 32px);
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    pointer-events: none;
}

.tcb-ve-tooltip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--tcb-ve-bg-header);
}

.tcb-ve-tooltip-text.tip-below::after {
    top: auto;
    bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: var(--tcb-ve-bg-header);
}

.tcb-ve-tooltip-trigger:hover .tcb-ve-tooltip-text,
.tcb-ve-tooltip-trigger:focus-within .tcb-ve-tooltip-text,
.tcb-ve-tooltip-text.active {
    display: block;
}

@media (max-width: 768px) {
    .tcb-ve-tooltip-text {
        bottom: 16px;
        left: 16px !important;
        right: 16px;
        top: auto !important;
        transform: none !important;
        width: auto;
        max-width: none;
        z-index: 10001;
    }

    .tcb-ve-tooltip-text::after {
        display: none;
    }
}

/* ============================================
   VOYAGE LEG ROWS
   ============================================ */
.tcb-ve-leg {
    background: #f9fafb;
    border: 1px solid var(--tcb-ve-border);
    border-radius: var(--tcb-ve-radius-sm);
    padding: 12px;
    margin-bottom: 10px;
}

.tcb-ve-leg-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.tcb-ve-leg-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--tcb-ve-bg-header);
}

.tcb-ve-leg-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tcb-ve-leg-type-toggle {
    display: flex;
    border: 1px solid var(--tcb-ve-border);
    border-radius: var(--tcb-ve-radius-sm);
    overflow: hidden;
}

.tcb-ve-leg-type-toggle button {
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 500;
    background: transparent;
    color: var(--tcb-ve-text-secondary);
    border: none;
    cursor: pointer;
    transition: all var(--tcb-ve-transition);
}

.tcb-ve-leg-type-toggle button.active {
    background: var(--tcb-ve-accent);
    color: #fff;
}

.tcb-ve-leg-remove {
    background: transparent;
    border: 1px solid var(--tcb-ve-border);
    color: var(--tcb-ve-negative);
    border-radius: var(--tcb-ve-radius-sm);
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all var(--tcb-ve-transition);
}

.tcb-ve-leg-remove:hover {
    background: var(--tcb-ve-negative);
    color: #fff;
}

.tcb-ve-leg-fields {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 100px;
    gap: 10px;
}

@media (max-width: 700px) {
    .tcb-ve-leg-fields {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .tcb-ve-leg-fields {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   CARGO PARCELS
   ============================================ */
.tcb-ve-parcel {
    background: #f9fafb;
    border: 1px solid var(--tcb-ve-border);
    border-radius: var(--tcb-ve-radius-sm);
    padding: 12px;
    margin-bottom: 10px;
}

.tcb-ve-parcel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.tcb-ve-parcel-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--tcb-ve-bg-header);
}

.tcb-ve-parcel-remove {
    background: transparent;
    border: 1px solid var(--tcb-ve-border);
    color: var(--tcb-ve-negative);
    border-radius: var(--tcb-ve-radius-sm);
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all var(--tcb-ve-transition);
}

.tcb-ve-parcel-remove:hover {
    background: var(--tcb-ve-negative);
    color: #fff;
}

.tcb-ve-parcel-fields {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 10px;
}

@media (max-width: 700px) {
    .tcb-ve-parcel-fields {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .tcb-ve-parcel-fields {
        grid-template-columns: 1fr;
    }
}

.tcb-ve-parcel-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
}

.tcb-ve-parcel-validation {
    font-size: 12px;
    color: var(--tcb-ve-text-secondary);
}

.tcb-ve-parcel-validation.tcb-ve-parcel-warn {
    color: var(--tcb-ve-negative);
    font-weight: 500;
}

/* ============================================
   BUTTONS
   ============================================ */
.tcb-ve-btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: var(--tcb-ve-radius-sm);
    cursor: pointer;
    transition: all var(--tcb-ve-transition);
}

.tcb-ve-btn-primary {
    background: var(--tcb-ve-accent);
    color: #fff;
}

.tcb-ve-btn-primary:hover {
    background: var(--tcb-ve-accent-hover);
    box-shadow: 0 2px 10px var(--tcb-ve-accent-glow);
}

.tcb-ve-btn-secondary {
    background: transparent;
    color: var(--tcb-ve-text-secondary);
    border: 1px solid var(--tcb-ve-border);
}

.tcb-ve-btn-secondary:hover {
    border-color: var(--tcb-ve-text-secondary);
    color: var(--tcb-ve-text-primary);
    background: #f9fafb;
}

.tcb-ve-btn-accent {
    background: transparent;
    color: var(--tcb-ve-accent);
    border: 1px solid var(--tcb-ve-accent);
}

.tcb-ve-btn-accent:hover {
    background: var(--tcb-ve-accent);
    color: #fff;
}

/* (Action buttons moved to header) */

/* ============================================
   RESULTS PANEL
   ============================================ */
.tcb-ve-results {
    background: var(--tcb-ve-bg-card);
    border: 1px solid var(--tcb-ve-border);
    border-radius: var(--tcb-ve-radius);
    overflow: hidden;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    box-shadow: var(--tcb-ve-shadow-lg);
}

@media (max-width: 1024px) {
    .tcb-ve-results {
        position: static;
        max-height: none;
    }
}

.tcb-ve-results-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--tcb-ve-text-on-dark);
    background: var(--tcb-ve-bg-header);
    margin: 0;
    padding: 14px 20px;
}

/* TCE Hero Display */
.tcb-ve-results-hero {
    text-align: center;
    padding: 20px;
    margin: 16px 16px 0;
    background: var(--tcb-ve-accent-bg);
    border: 1px solid rgba(212, 168, 67, 0.2);
    border-radius: var(--tcb-ve-radius);
}

.tcb-ve-tce-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.tcb-ve-tce-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--tcb-ve-accent);
}

.tcb-ve-tce-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--tcb-ve-text-primary);
    line-height: 1.1;
}

.tcb-ve-tce-unit {
    font-size: 13px;
    color: var(--tcb-ve-text-muted);
}

/* Results Grid */
.tcb-ve-results-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0 16px;
    margin-bottom: 8px;
}

.tcb-ve-result-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.tcb-ve-result-label {
    font-size: 13px;
    color: var(--tcb-ve-text-secondary);
    min-width: 0;
}

.tcb-ve-result-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--tcb-ve-text-primary);
    text-align: right;
    white-space: nowrap;
    flex-shrink: 0;
}

.tcb-ve-result-highlight .tcb-ve-result-label,
.tcb-ve-result-highlight .tcb-ve-result-value {
    font-weight: 700;
}

.tcb-ve-result-positive {
    color: var(--tcb-ve-positive) !important;
}

.tcb-ve-result-negative {
    color: var(--tcb-ve-negative) !important;
}

/* ============================================
   BREAKDOWN TABLE
   ============================================ */
.tcb-ve-breakdown {
    margin: 8px 16px 16px;
    padding-top: 12px;
    border-top: 1px solid var(--tcb-ve-border);
}

.tcb-ve-breakdown h4 {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--tcb-ve-bg-header);
}

.tcb-ve-breakdown-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.tcb-ve-breakdown-table th:first-child,
.tcb-ve-breakdown-table td:first-child {
    width: 50%;
}

.tcb-ve-breakdown-table th:last-child,
.tcb-ve-breakdown-table td:last-child {
    width: 50%;
}

.tcb-ve-breakdown-table th {
    padding: 6px 0;
    text-align: left;
    color: var(--tcb-ve-text-muted);
    font-weight: 500;
    border-bottom: 1px solid var(--tcb-ve-border);
}

.tcb-ve-breakdown-table td {
    padding: 5px 8px 5px 0;
    color: var(--tcb-ve-text-secondary);
    white-space: nowrap;
}

.tcb-ve-text-right {
    text-align: right !important;
}

.tcb-ve-bd-total td {
    border-top: 1px solid var(--tcb-ve-border);
    color: var(--tcb-ve-text-primary);
}

.tcb-ve-bd-spacer td {
    padding: 4px 0;
}

.tcb-ve-bd-result td {
    color: var(--tcb-ve-accent-hover);
    font-weight: 600;
    border-top: 1px solid var(--tcb-ve-border);
}

/* ============================================
   SENSITIVITY ANALYSIS
   ============================================ */
.tcb-ve-sensitivity table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.tcb-ve-sensitivity th,
.tcb-ve-sensitivity td {
    padding: 6px 10px;
    text-align: center;
    border: 1px solid var(--tcb-ve-border);
}

.tcb-ve-sensitivity th {
    background: var(--tcb-ve-bg-header);
    color: var(--tcb-ve-text-on-dark);
    font-weight: 600;
}

.tcb-ve-sensitivity td {
    color: var(--tcb-ve-text-secondary);
}

.tcb-ve-sensitivity .tcb-ve-sens-base {
    background: var(--tcb-ve-accent-glow);
    font-weight: 600;
    color: var(--tcb-ve-text-primary);
}

/* ============================================
   PORT AUTOCOMPLETE DROPDOWN
   ============================================ */
.tcb-ve-port-field {
    position: relative;
}

.tcb-ve-port-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 200;
    background: #ffffff;
    border: 1px solid var(--tcb-ve-border-focus);
    border-top: none;
    border-radius: 0 0 var(--tcb-ve-radius-sm) var(--tcb-ve-radius-sm);
    max-height: 240px;
    overflow-y: auto;
    box-shadow: var(--tcb-ve-shadow-lg);
}

.tcb-ve-port-option {
    padding: 8px 10px;
    font-size: 13px;
    color: var(--tcb-ve-text-secondary);
    cursor: pointer;
    transition: background var(--tcb-ve-transition);
    border-bottom: 1px solid #f0f0f0;
}

.tcb-ve-port-option:last-child {
    border-bottom: none;
}

.tcb-ve-port-option:hover,
.tcb-ve-port-option-active {
    background: #f3f4f6;
    color: var(--tcb-ve-text-primary);
}

.tcb-ve-port-option .tcb-ve-port-code {
    color: var(--tcb-ve-accent);
    font-weight: 600;
    font-size: 11px;
    margin-left: 4px;
}

.tcb-ve-port-option .tcb-ve-port-country {
    color: var(--tcb-ve-text-muted);
    font-size: 12px;
}

/* Bunker last-updated label */
.tcb-ve-bunker-updated {
    font-size: 11px;
    color: var(--tcb-ve-text-muted);
    margin-top: 2px;
}

/* Auto-distance badge */
.tcb-ve-auto-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--tcb-ve-accent);
    margin-top: 2px;
    opacity: 0.85;
}

.tcb-ve-auto-badge::before {
    content: "\2248";
    font-size: 13px;
}

/* Distance note */
.tcb-ve-distance-note {
    font-size: 11px;
    color: var(--tcb-ve-text-muted);
    font-style: italic;
    margin-top: 8px;
    padding: 6px 10px;
    background: #f9fafb;
    border-radius: var(--tcb-ve-radius-sm);
    border-left: 2px solid var(--tcb-ve-border);
}

/* Port dropdown scrollbar */
.tcb-ve-port-dropdown::-webkit-scrollbar {
    width: 5px;
}

.tcb-ve-port-dropdown::-webkit-scrollbar-track {
    background: #fafafa;
}

.tcb-ve-port-dropdown::-webkit-scrollbar-thumb {
    background: var(--tcb-ve-border);
    border-radius: 3px;
}

/* ============================================
   LOGIN GATE MODAL
   ============================================ */
.tcb-ve-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tcb-ve-modal {
    background: #ffffff;
    border-radius: var(--tcb-ve-radius);
    padding: 32px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.tcb-ve-modal h3 {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 700;
    color: var(--tcb-ve-bg-header);
}

.tcb-ve-modal p {
    margin: 0 0 24px;
    font-size: 14px;
    color: var(--tcb-ve-text-secondary);
    line-height: 1.5;
}

.tcb-ve-modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tcb-ve-modal-buttons .tcb-ve-btn {
    width: 100%;
    padding: 12px;
    font-size: 15px;
}

.tcb-ve-modal-cancel {
    background: transparent;
    border: none;
    color: var(--tcb-ve-text-muted);
    font-size: 13px;
    cursor: pointer;
    margin-top: 8px;
    padding: 4px;
}

.tcb-ve-modal-cancel:hover {
    color: var(--tcb-ve-text-secondary);
}

/* ============================================
   REPORT ISSUE MODAL
   ============================================ */
.tcb-ve-report-profile {
    background: #f5f7fa;
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 0.92em;
    line-height: 1.6;
}

.tcb-ve-report-profile strong {
    display: inline-block;
    min-width: 50px;
}

.tcb-ve-report-input {
    display: block;
    width: 100%;
    padding: 8px 10px;
    margin-top: 4px;
    margin-bottom: 12px;
    border: 1px solid var(--tcb-ve-border);
    border-radius: var(--tcb-ve-radius-sm);
    font-size: 14px;
    font-family: inherit;
    background: var(--tcb-ve-bg-input);
    color: var(--tcb-ve-text-primary);
    box-sizing: border-box;
}

.tcb-ve-report-input:focus {
    outline: none;
    border-color: var(--tcb-ve-border-focus);
    box-shadow: 0 0 0 2px var(--tcb-ve-accent-glow);
}

.tcb-ve-report-desc {
    min-height: 120px;
    resize: vertical;
}

.tcb-ve-required {
    font-weight: 600;
    font-size: 13px;
    color: var(--tcb-ve-text-primary);
}

.tcb-ve-required::after {
    content: ' *';
    color: var(--tcb-ve-negative);
}

.tcb-ve-report-error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: var(--tcb-ve-radius-sm);
    padding: 8px 12px;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--tcb-ve-negative);
}

/* ============================================
   SAVE / LOAD MODAL
   ============================================ */
.tcb-ve-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.tcb-ve-modal {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 520px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 24px;
}

.tcb-ve-modal h3 {
    margin: 0 0 16px;
    font-size: 18px;
    color: var(--tcb-ve-bg-header);
}

.tcb-ve-modal-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--tcb-ve-bg-header);
    margin-bottom: 6px;
}

.tcb-ve-modal-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--tcb-ve-border);
    border-radius: 4px;
    font-size: 14px;
    font-family: var(--tcb-ve-font);
    margin-bottom: 16px;
    box-sizing: border-box;
}

.tcb-ve-modal-input:focus {
    outline: none;
    border-color: var(--tcb-ve-accent);
    box-shadow: 0 0 0 2px var(--tcb-ve-accent-glow);
}

.tcb-ve-modal-error {
    background: #fff1f1;
    color: #D64045;
    font-size: 13px;
    padding: 8px 12px;
    border-radius: 4px;
    margin-bottom: 8px;
}

.tcb-ve-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}

.tcb-ve-modal-btn {
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--tcb-ve-font);
    cursor: pointer;
    border: 1px solid var(--tcb-ve-border);
    background: #fff;
    color: var(--tcb-ve-bg-header);
    transition: background 0.15s;
}

.tcb-ve-modal-btn:hover {
    background: var(--tcb-ve-accent);
    color: #fff;
    border-color: var(--tcb-ve-accent);
}

.tcb-ve-modal-btn-accent {
    background: var(--tcb-ve-accent);
    color: #fff;
    border-color: var(--tcb-ve-accent);
}

.tcb-ve-modal-btn-accent:hover {
    background: var(--tcb-ve-accent-hover);
    border-color: var(--tcb-ve-accent-hover);
}

.tcb-ve-modal-btn-cancel {
    background: transparent;
    color: var(--tcb-ve-text-muted);
}

.tcb-ve-modal-btn-cancel:hover {
    background: var(--tcb-ve-accent);
    color: #fff;
    border-color: var(--tcb-ve-accent);
}

.tcb-ve-muted {
    color: var(--tcb-ve-text-muted);
    font-size: 14px;
    text-align: center;
}

/* Load list */
.tcb-ve-load-list {
    max-height: 400px;
    overflow-y: auto;
    margin: 0 -4px;
    padding: 0 4px;
}

.tcb-ve-load-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--tcb-ve-border);
    border-radius: 6px;
    margin-bottom: 8px;
    transition: background 0.15s;
}

.tcb-ve-load-item:hover {
    background: #f8f9fa;
}

.tcb-ve-load-item-info {
    flex: 1;
    min-width: 0;
}

.tcb-ve-load-item-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--tcb-ve-bg-header);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tcb-ve-load-item-meta {
    font-size: 12px;
    color: var(--tcb-ve-text-muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tcb-ve-load-item-date {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

.tcb-ve-load-item-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.tcb-ve-load-btn {
    background: var(--tcb-ve-accent);
    color: #fff;
    padding: 6px 14px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 12px;
    border: none;
    cursor: pointer;
    transition: background 0.15s;
}

.tcb-ve-load-btn:hover {
    background: var(--tcb-ve-accent-hover);
}

.tcb-ve-delete-btn {
    background: transparent;
    color: #D64045;
    border: 1px solid #D64045;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    line-height: 1;
}

.tcb-ve-delete-btn:hover {
    background: #D64045;
    color: #fff;
}

.tcb-ve-load-count {
    text-align: center;
    font-size: 12px;
    color: var(--tcb-ve-text-muted);
    margin-top: 8px;
}

/* Save limit count */
.tcb-ve-save-count {
    font-size: 13px;
    color: var(--tcb-ve-navy, #0a1628);
    padding: 6px 10px;
    background: #f0f4f8;
    border-radius: 4px;
    margin-bottom: 10px;
    font-weight: 500;
}
.tcb-ve-save-count-orange, .tcb-ve-save-count-orange span { color: #e67e22; background: #fef6e8; }
.tcb-ve-save-count-red, .tcb-ve-save-count-red span { color: #D64045; background: #fff1f1; font-weight: 600; }

/* Toast notice */
.tcb-ve-notice {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--tcb-ve-bg-header);
    color: #fff;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 13px;
    z-index: 10001;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
}

.tcb-ve-notice-show {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    body * {
        visibility: hidden;
    }

    .tcb-ve-wrapper,
    .tcb-ve-wrapper * {
        visibility: visible;
    }

    .tcb-ve-wrapper {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        max-width: 100%;
        padding: 20px;
        color: #000;
        background: #fff;
    }

    .tcb-ve-layout {
        display: block;
    }

    .tcb-ve-inputs {
        display: none;
    }

    .tcb-ve-results {
        position: static;
        max-height: none;
        background: #fff;
        border-color: #ccc;
        color: #000;
        width: 100%;
        box-shadow: none;
    }

    .tcb-ve-results-title {
        background: #1B2A4A;
        color: #fff;
    }

    .tcb-ve-results-hero {
        border-color: #d4a843;
    }

    .tcb-ve-bd-result td {
        color: #b8860b;
    }

    .tcb-ve-header {
        display: none;
    }
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */
.tcb-ve-results::-webkit-scrollbar {
    width: 6px;
}

.tcb-ve-results::-webkit-scrollbar-track {
    background: #f9fafb;
}

.tcb-ve-results::-webkit-scrollbar-thumb {
    background: var(--tcb-ve-border);
    border-radius: 3px;
}

/* ============================================
   NUMBER INPUT SPINNERS — HIDE
   ============================================ */
.tcb-ve-wrapper input[type="number"]::-webkit-outer-spin-button,
.tcb-ve-wrapper input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.tcb-ve-wrapper input[type="number"] {
    -moz-appearance: textfield;
}

/* ============================================
   PRINT HEADER & FOOTER
   ============================================ */
.tcb-ve-print-header,
.tcb-ve-print-footer {
    display: none;
}

/* ============================================
   CANAL TRANSIT
   ============================================ */
.tcb-ve-canal-hint {
    display: block;
    font-size: 12px;
    color: #1e40af;
    background: #eff6ff;
    border: 1px solid #93c5fd;
    border-radius: var(--tcb-ve-radius-sm);
    padding: 8px 12px;
    margin-bottom: 12px;
    line-height: 1.5;
}

.tcb-ve-canal-disclaimer {
    margin-top: 12px;
    padding: 10px 12px;
    background: #fffbeb;
    border: 1px solid #f59e0b;
    border-radius: var(--tcb-ve-radius-sm);
    font-size: 12px;
    color: #92400e;
    line-height: 1.4;
}

/* ============================================
   ECA FUEL SWITCHING
   ============================================ */
.tcb-ve-eca-hint {
    display: block;
    font-size: 12px;
    color: #065f46;
    background: #ecfdf5;
    border: 1px solid #6ee7b7;
    border-radius: var(--tcb-ve-radius-sm);
    padding: 8px 12px;
    margin-bottom: 12px;
    line-height: 1.5;
}

.tcb-ve-eca-summary {
    margin-top: 12px;
    padding: 10px 12px;
    background: #f0f4f8;
    border: 1px solid var(--tcb-ve-border);
    border-radius: var(--tcb-ve-radius-sm);
}

.tcb-ve-eca-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 13px;
    color: var(--tcb-ve-text-secondary);
}

.tcb-ve-eca-row strong {
    color: var(--tcb-ve-text-primary);
}

.tcb-ve-eca-highlight {
    border-top: 1px solid var(--tcb-ve-border);
    margin-top: 4px;
    padding-top: 6px;
    font-weight: 600;
}

.tcb-ve-eca-highlight strong {
    color: var(--tcb-ve-negative);
}

.tcb-ve-scrubber-note {
    margin-top: 10px;
    padding: 10px 12px;
    background: #f5f5f5;
    border: 1px solid var(--tcb-ve-border);
    border-radius: var(--tcb-ve-radius-sm);
    font-size: 13px;
    color: var(--tcb-ve-text-secondary);
    font-style: italic;
}

.tcb-ve-eca-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    color: #065f46;
    background: #d1fae5;
    border: 1px solid #6ee7b7;
    border-radius: 3px;
    padding: 1px 6px;
    margin-left: 8px;
    vertical-align: middle;
}

/* ============================================
   EU ETS SUMMARY (in-section)
   ============================================ */
.tcb-ve-ets-summary {
    margin-top: 12px;
    padding: 10px 12px;
    background: #f0f4f8;
    border: 1px solid var(--tcb-ve-border);
    border-radius: var(--tcb-ve-radius-sm);
}

.tcb-ve-ets-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 13px;
    color: var(--tcb-ve-text-secondary);
}

.tcb-ve-ets-row strong {
    color: var(--tcb-ve-text-primary);
}

.tcb-ve-ets-highlight {
    border-top: 1px solid var(--tcb-ve-border);
    margin-top: 4px;
    padding-top: 6px;
    font-weight: 600;
}

.tcb-ve-ets-highlight strong {
    color: var(--tcb-ve-negative);
}

.tcb-ve-ets-auto-label {
    display: block;
    font-size: 11px;
    color: var(--tcb-ve-text-muted);
    margin-top: 2px;
}

/* ============================================
   TC HIRE COMPARISON CARD
   ============================================ */
.tcb-ve-tc-card {
    margin: 8px 16px 16px;
    padding: 14px;
    background: #f9fafb;
    border: 1px solid var(--tcb-ve-border);
    border-radius: var(--tcb-ve-radius-sm);
}

.tcb-ve-tc-card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--tcb-ve-bg-header);
    margin: 0 0 10px;
    text-align: center;
}

.tcb-ve-tc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-bottom: 10px;
}

.tcb-ve-tc-table th {
    background: var(--tcb-ve-bg-header);
    color: #fff;
    padding: 6px 8px;
    font-weight: 600;
    font-size: 12px;
    text-align: center;
}

.tcb-ve-tc-table th:first-child {
    text-align: left;
}

.tcb-ve-tc-table td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--tcb-ve-border);
    text-align: center;
}

.tcb-ve-tc-table td:first-child {
    text-align: left;
    font-weight: 500;
    color: var(--tcb-ve-text-secondary);
}

.tcb-ve-tc-winner {
    background: #e8f5e9;
    color: #2e7d32;
    font-weight: 700;
}

.tcb-ve-tc-recommendation {
    text-align: center;
    padding: 8px;
    border-radius: var(--tcb-ve-radius-sm);
    font-size: 13px;
    margin-bottom: 8px;
}

.tcb-ve-tc-rec-voyage {
    background: #e3f2fd;
    color: #1565c0;
}

.tcb-ve-tc-rec-tc {
    background: #e8f5e9;
    color: #2e7d32;
}

.tcb-ve-tc-breakeven {
    text-align: center;
    font-size: 12px;
    color: var(--tcb-ve-text-muted);
}

/* ============================================
   COMPARISON PANEL
   ============================================ */
.tcb-ve-comparison {
    margin: 8px 16px 16px;
    padding-top: 12px;
    border-top: 1px solid var(--tcb-ve-border);
}

.tcb-ve-comparison-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.tcb-ve-comparison-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--tcb-ve-bg-header);
}

.tcb-ve-comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.tcb-ve-comparison-table th {
    padding: 6px 4px;
    text-align: left;
    color: var(--tcb-ve-text-muted);
    font-weight: 500;
    border-bottom: 1px solid var(--tcb-ve-border);
    font-size: 11px;
}

.tcb-ve-comparison-table th:nth-child(n+2) {
    text-align: right;
}

.tcb-ve-comparison-table td {
    padding: 4px;
    color: var(--tcb-ve-text-secondary);
}

.tcb-ve-comparison-table td:nth-child(n+2) {
    text-align: right;
    font-weight: 600;
}

.tcb-ve-diff-positive {
    color: var(--tcb-ve-positive) !important;
}

.tcb-ve-diff-negative {
    color: var(--tcb-ve-negative) !important;
}

/* ============================================
   SHARE BUTTON FEEDBACK
   ============================================ */
.tcb-ve-btn-copied {
    background: var(--tcb-ve-positive) !important;
    color: #fff !important;
    border-color: var(--tcb-ve-positive) !important;
}

/* ============================================
   SHARE POPUP
   ============================================ */
.tcb-ve-share-url {
    width: 100%;
    padding: 10px;
    font-size: 12px;
    font-family: monospace;
    border: 1px solid var(--tcb-ve-border);
    border-radius: var(--tcb-ve-radius-sm);
    background: #f9fafb;
    color: var(--tcb-ve-text-primary);
    resize: none;
    margin-bottom: 16px;
    word-break: break-all;
}

.tcb-ve-share-url:focus {
    outline: none;
    border-color: var(--tcb-ve-border-focus);
    box-shadow: 0 0 0 2px var(--tcb-ve-accent-glow);
}

.tcb-ve-btn-whatsapp {
    background: #25D366;
    color: #fff;
    border: none;
}

.tcb-ve-btn-whatsapp:hover {
    background: #1da851;
}

/* ============================================
   SHARE BANNER
   ============================================ */
.tcb-ve-share-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    margin-bottom: 16px;
    background: var(--tcb-ve-accent-bg);
    border: 1px solid rgba(212, 168, 67, 0.3);
    border-radius: var(--tcb-ve-radius);
    font-size: 13px;
    color: var(--tcb-ve-text-secondary);
}

.tcb-ve-share-banner-close {
    background: transparent;
    border: none;
    font-size: 18px;
    color: var(--tcb-ve-text-muted);
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.tcb-ve-share-banner-close:hover {
    color: var(--tcb-ve-text-primary);
}

@media print {
    .tcb-ve-share-banner {
        display: none !important;
    }
}

/* ============================================
   PRINT STYLES (EXTENDED)
   ============================================ */
@media print {
    .tcb-ve-print-header {
        display: block;
        text-align: center;
        margin-bottom: 16px;
        padding-bottom: 12px;
        border-bottom: 2px solid #d4a843;
    }

    .tcb-ve-print-header h1 {
        margin: 0;
        font-size: 22px;
        color: #0a1628;
        font-weight: 700;
    }

    .tcb-ve-print-footer {
        display: block;
        text-align: center;
        margin-top: 20px;
        padding-top: 10px;
        border-top: 1px solid #ddd;
    }

    .tcb-ve-print-footer p {
        font-size: 11px;
        color: #999;
        margin: 0;
    }

    .tcb-ve-comparison {
        display: none !important;
    }
}
