/* ============================================
   AQM TRADE — Container Page Styles
   Navy (#0B1A3E) + Teal (#00897B) + Orange (#FF6F00)
   ============================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', 'Segoe UI', Arial, sans-serif; background: #f5f7f8; color: #1a1a1a; line-height: 1.6; }

/* ── Page Header (stats bar below nav) ── */
.page-header {
    background: #fff;
    padding: 20px 40px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    max-width: 1400px;
    margin: 0 auto;
}
.page-title { font-size: 20px; font-weight: 700; color: #0B1A3E; margin-bottom: 2px; }
.page-subtitle { font-size: 13px; color: #6b7280; }
.page-stats { display: flex; gap: 12px; flex-wrap: wrap; }
.stat-box {
    text-align: center;
    padding: 10px 18px;
    background: rgba(0,137,123,0.06);
    border-radius: 8px;
    border: 1px solid rgba(0,137,123,0.15);
}
.stat-value { font-size: 18px; font-weight: 800; color: #00897B; }
.stat-label { font-size: 10px; color: #6b7280; text-transform: uppercase; letter-spacing: 0.5px; }

/* ── Warning Banner ── */
.warning-banner {
    background: #fff8e1;
    border: 1px solid #ffcc02;
    border-left: 4px solid #FF6F00;
    border-radius: 8px;
    padding: 12px 20px;
    margin: 20px 40px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}
.warning-icon { font-size: 20px; }
.warning-text { font-size: 13px; color: #92400e; font-weight: 600; }

/* ── Main Layout ── */
.main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 40px;
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
}

/* ── Items Section ── */
.items-section {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    overflow: hidden;
    border: 1px solid #e5e7eb;
}
.items-header {
    background: #0B1A3E;
    padding: 14px 20px;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.items-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.clear-btn {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.clear-btn:hover {
    background: rgba(255,111,0,0.8);
    border-color: #FF6F00;
}

/* ── Container Cards ── */
.container-cards { padding: 15px; display: flex; flex-direction: column; gap: 12px; }

.container-card {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.container-card:hover {
    border-color: #00897B;
    box-shadow: 0 2px 12px rgba(0,137,123,0.1);
}
.container-card.missing-dims {
    border-color: #FF6F00;
    background: #fffbf5;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: #f8fafa;
    border-bottom: 1px solid #f0f0f0;
}
.card-image {
    width: 48px;
    height: 48px;
    background: #f0f0f0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}
.card-image img { width: 100%; height: 100%; object-fit: cover; }
.img-placeholder { font-size: 22px; }
.card-title { flex: 1; min-width: 0; }
.item-name {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #0B1A3E;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.item-sku { display: block; font-size: 10px; color: #9ca3af; margin-top: 2px; }

.card-body { padding: 12px 15px; display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; }
.card-body > label, .card-field > label, .card-dims > label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}
.card-field { min-width: 100px; }
.card-field--qty { min-width: 140px; }
.card-value { display: flex; align-items: baseline; gap: 4px; }
.card-dims { flex: 1; min-width: 200px; }

/* ── Quantity Controls ── */
.qty-control { display: flex; align-items: center; gap: 4px; }
.qty-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #d1d5db;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    color: #00897B;
    transition: all 0.15s;
}
.qty-btn:hover { background: #00897B; color: #fff; border-color: #00897B; }
.qty-input {
    width: 60px;
    height: 30px;
    text-align: center;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-weight: 700;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
}
.qty-input:focus { border-color: #00897B; outline: none; box-shadow: 0 0 0 2px rgba(0,137,123,0.15); }

/* ── Dimension Inputs ── */
.dim-inputs { display: flex; gap: 6px; align-items: flex-end; }
.input-group { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.dim-label { font-size: 9px; font-weight: 700; color: #9ca3af; text-transform: uppercase; }
.dim-input {
    width: 48px;
    height: 30px;
    text-align: center;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.15s;
}
.dim-input:focus { border-color: #00897B; outline: none; box-shadow: 0 0 0 2px rgba(0,137,123,0.15); }
.dim-input.missing { border-color: #FF6F00; background: #fff8f0; }
.dim-x { font-size: 12px; color: #bbb; padding-bottom: 6px; }

.boxes-count { font-size: 16px; font-weight: 800; color: #00897B; }
.boxes-calc { font-size: 10px; color: #6b7280; }

/* ── Card Footer Stats ── */
.card-footer { display: flex; gap: 0; border-top: 1px solid #f0f0f0; }
.card-stat { flex: 1; padding: 10px 15px; text-align: center; border-right: 1px solid #f0f0f0; }
.card-stat:last-child { border-right: none; }
.card-stat .stat-label { display: block; font-size: 9px; font-weight: 700; color: #9ca3af; text-transform: uppercase; margin-bottom: 2px; }
.item-cbm { font-size: 13px; font-weight: 700; color: #374151; }
.item-weight { font-size: 13px; font-weight: 600; color: #374151; }
.item-price { font-size: 14px; font-weight: 800; color: #FF6F00; }
.card-stat--price { background: #fffaf5; }

.remove-btn {
    background: none;
    border: none;
    color: #dc2626;
    cursor: pointer;
    font-size: 18px;
    padding: 6px;
    border-radius: 6px;
    transition: background 0.15s;
    flex-shrink: 0;
}
.remove-btn:hover { background: #fef2f2; }

/* ── Empty State ── */
.empty-container { text-align: center; padding: 60px 20px; color: #9ca3af; }
.empty-icon { font-size: 60px; margin-bottom: 15px; }
.empty-text { font-size: 16px; margin-bottom: 20px; color: #6b7280; }
.browse-btn {
    display: inline-block;
    padding: 12px 28px;
    background: #00897B;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    transition: background 0.2s;
}
.browse-btn:hover { background: #00796B; }

/* ── Right Panel ── */
.right-panel { display: flex; flex-direction: column; gap: 20px; }

.container-select {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    overflow: hidden;
    border: 1px solid #e5e7eb;
}
.panel-header { background: #0B1A3E; padding: 14px 20px; }
.panel-title { font-size: 12px; font-weight: 700; color: #fff; text-transform: uppercase; letter-spacing: 1px; }
.panel-content { padding: 15px; }

.container-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
}
.container-option:hover { border-color: #00897B; }
.container-option.selected { border-color: #00897B; background: rgba(0,137,123,0.05); }
.container-option input { display: none; }
.container-icon {
    width: 50px;
    height: 30px;
    background: linear-gradient(135deg, #FF8F00, #FF6F00);
    border-radius: 4px;
    position: relative;
}
.container-icon::after {
    content: '';
    position: absolute;
    right: -4px;
    top: 3px;
    bottom: 3px;
    width: 8px;
    background: #e65100;
    border-radius: 0 3px 3px 0;
}
.container-info { flex: 1; }
.container-name { font-size: 12px; font-weight: 700; color: #0B1A3E; }
.container-specs { font-size: 10px; color: #6b7280; }
.container-cost { font-size: 14px; font-weight: 700; color: #00897B; }

/* ── Summary Box ── */
.summary-box {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    overflow: hidden;
    border: 1px solid #e5e7eb;
}
.summary-content { padding: 15px; }
.summary-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #f3f4f6; font-size: 13px; }
.summary-row:last-child { border-bottom: none; }
.summary-row--landed { border-top: 2px solid #00897B; padding-top: 12px; margin-top: 6px; }
.summary-label { color: #6b7280; }
.summary-label--bold { font-weight: 700; color: #0B1A3E; }
.summary-value { font-weight: 600; color: #111827; }
.summary-value--primary { color: #00897B; }
.summary-total {
    background: #0B1A3E;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.total-label { font-size: 13px; color: rgba(255,255,255,0.7); font-weight: 500; }
.total-value { font-size: 22px; font-weight: 800; color: #fff; }

/* ── Fill Bar ── */
.fill-section { padding: 15px; background: #f8fafa; position: relative; }
.fill-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #00897B, #26A69A);
}
.fill-label { font-size: 11px; color: #6b7280; margin-bottom: 8px; display: flex; justify-content: space-between; font-weight: 600; }
.fill-bar { height: 10px; background: #e5e7eb; border-radius: 5px; overflow: hidden; }
.fill-progress { height: 100%; background: linear-gradient(90deg, #00897B, #26A69A); border-radius: 5px; transition: width 0.3s; }
.fill-progress.warning { background: linear-gradient(90deg, #FF6F00, #FF8F00); }
.fill-progress.danger { background: linear-gradient(90deg, #dc2626, #ef4444); }

/* ── Action Buttons ── */
.actions-box {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    padding: 20px;
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.action-btn {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.3px;
    transition: all 0.2s;
}
.btn-load {
    background: #FF6F00;
    color: #fff;
}
.btn-load:hover { background: #FF8F00; box-shadow: 0 4px 12px rgba(255,111,0,0.3); }
.btn-load:disabled { background: #d1d5db; cursor: not-allowed; }
.btn-quote { background: #00897B; color: #fff; }
.btn-quote:hover { background: #00796B; }
.btn-export { background: #0B1A3E; color: #fff; }
.btn-export:hover { background: #162a5a; }
.btn-export-pdf { background: #374151; color: #fff; }
.btn-export-pdf:hover { background: #4b5563; }

/* ── Freight Estimate Panel ── */
.freight-estimate {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    overflow: hidden;
    border: 1px solid #e5e7eb;
}
.freight-selects { display: flex; gap: 10px; margin-bottom: 14px; }
.freight-field { flex: 1; }
.freight-field label { display: block; font-size: 10px; font-weight: 700; color: #6b7280; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 5px; }
.freight-field select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 12px;
    font-family: 'Inter', sans-serif;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s;
}
.freight-field select:focus { border-color: #00897B; outline: none; box-shadow: 0 0 0 2px rgba(0,137,123,0.15); }

.freight-result { border-top: 1px solid #f0f0f0; padding-top: 12px; }
.freight-row { display: flex; justify-content: space-between; padding: 7px 0; font-size: 13px; }
.freight-row--transit { border-top: 1px dashed #e5e7eb; margin-top: 4px; padding-top: 10px; }
.freight-label { color: #6b7280; }
.freight-value { font-weight: 700; color: #111827; }

.freight-no-route {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: 12px;
    font-size: 12px;
    color: #92400e;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}
.freight-no-route a { color: #00897B; font-weight: 600; text-decoration: none; }
.freight-no-route a:hover { text-decoration: underline; }
.no-route-icon { font-size: 16px; }

/* ── Transit Timeline ── */
.transit-timeline {
    display: flex;
    align-items: flex-start;
    gap: 0;
    margin-top: 16px;
    padding: 14px 0 8px;
    border-top: 1px solid #f0f0f0;
    overflow-x: auto;
}
.timeline-step { display: flex; flex-direction: column; align-items: center; min-width: 48px; flex-shrink: 0; }
.timeline-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #d1d5db;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #d1d5db;
    margin-bottom: 6px;
}
.timeline-step--active .timeline-dot { background: #00897B; box-shadow: 0 0 0 2px #00897B; }
.timeline-label { font-size: 9px; font-weight: 700; color: #374151; text-align: center; text-transform: uppercase; letter-spacing: 0.3px; }
.timeline-sub { font-size: 8px; color: #6b7280; margin-top: 2px; text-align: center; }
.timeline-connector {
    flex: 1;
    min-width: 20px;
    height: 2px;
    background: #e5e7eb;
    margin-top: 5px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.timeline-days {
    position: absolute;
    top: 6px;
    font-size: 8px;
    color: #9ca3af;
    white-space: nowrap;
    background: #fff;
    padding: 0 3px;
}

/* ── Container Tracking Panel ── */
.tracking-panel {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    overflow: hidden;
    border: 1px solid #e5e7eb;
}
.panel-header--collapsible { cursor: pointer; display: flex; justify-content: space-between; align-items: center; user-select: none; }
.panel-toggle { font-size: 10px; color: rgba(255,255,255,0.7); transition: transform 0.2s; }
.panel-toggle.open { transform: rotate(180deg); }
.tracking-content { padding: 15px; }
.tracking-input-row { display: flex; gap: 8px; margin-bottom: 12px; }
.tracking-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.tracking-input:focus { border-color: #00897B; outline: none; box-shadow: 0 0 0 2px rgba(0,137,123,0.15); }
.tracking-input::placeholder { text-transform: none; letter-spacing: 0; }
.tracking-btn {
    padding: 10px 18px;
    background: #00897B;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: background 0.2s;
    white-space: nowrap;
}
.tracking-btn:hover { background: #00796B; }
.tracking-frame { border-radius: 8px; overflow: hidden; border: 1px solid #e5e7eb; }
.tracking-frame iframe { display: block; }
.tracking-footer { font-size: 10px; color: #9ca3af; text-align: center; margin-top: 10px; }

/* ── Toast ── */
.toast {
    position: fixed;
    bottom: 25px;
    right: 25px;
    padding: 14px 22px;
    background: #0B1A3E;
    color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    font-weight: 600;
    font-size: 13px;
    z-index: 10001;
    border-left: 4px solid #00897B;
}

/* ── Responsive ── */
@media (max-width: 1200px) {
    .main { grid-template-columns: 1fr; padding: 20px; }
}
@media (max-width: 900px) {
    .page-header { padding: 16px 20px; }
    .warning-banner { margin: 16px 20px 0; }
    .main { padding: 16px 20px; }
}
@media (max-width: 600px) {
    .card-body { flex-direction: column; }
    .card-dims { min-width: 0; }
    .card-footer { flex-wrap: wrap; }
    .card-stat { min-width: 33%; }
    .dim-input { width: 44px; }
    .page-stats { width: 100%; justify-content: center; }
    .page-header { padding: 14px 16px; }
    .main { padding: 14px 16px; gap: 16px; }
    .freight-selects { flex-direction: column; gap: 8px; }
    .transit-timeline { gap: 0; padding: 10px 0; }
    .timeline-step { min-width: 36px; }
    .timeline-label { font-size: 8px; }
    .tracking-frame iframe { height: 300px; }
}
