/* X-10: the customer portal page. BiteBoard templates/UI/Client_Orders.html (its <style> block) the tracking under each line is
   portal_tracking.css. The page
   stands alone (no hopper.css), so every colour is written out as BiteBoard had it. */
:root {
    --bite-cyan: #3AC9E3;
    --bite-cyan-dark: #2db3cc;
    --bite-pink: #E67EAD;
    --bite-text: #162447;
    --bite-muted: #6b7280;
    --bite-label: #9ca3af;
    --bite-border: #e5e7eb;
    --bite-surface: #f8f9fa;
    --bite-radius: 10px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: auto; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #fff;
    min-height: 100vh;
    color: var(--bite-text);
    padding: 8px 0 28px;
    -webkit-font-smoothing: antialiased;
}
html.co-embed,
html.co-embed body {
    min-height: 0 !important;
    height: auto !important;
}
html.co-embed body {
    padding: 0 0 12px;
    overflow: hidden;
}
#bite-client-portal { display: block; }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }
html.co-embed .wrap { padding-top: 0; }

/* Tabs — scoped names to avoid Shopify theme clashes */
.co-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--bite-border);
}
.co-tab-btn {
    appearance: none;
    border: none;
    background: transparent;
    padding: 14px 20px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--bite-muted);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    font-family: inherit;
    transition: color 0.15s, border-color 0.15s;
    text-decoration: none;
    display: inline-block;
}
.co-tab-btn:hover { color: var(--bite-text); }
.co-tab-btn.co-tab-active {
    color: var(--bite-text);
    font-weight: 600;
    border-bottom-color: var(--bite-cyan);
}
.co-tab-btn.co-logout-tab {
    color: #c45c7a;
    margin-left: auto;
}
.co-tab-btn.co-logout-tab:hover { color: var(--bite-pink); }

.co-tab-panel { display: none !important; }
.co-tab-panel.co-tab-active { display: block !important; }
.co-tab-panel[hidden] { display: none !important; }

/* Card container */
.co-card {
    background: #fff;
    border: 1px solid var(--bite-border);
    border-radius: var(--bite-radius);
    box-shadow: 0 1px 4px rgba(22, 36, 71, 0.06);
    overflow: hidden;
}

/* Profile — all classes scoped under .co-portal-profile */
.co-portal-profile { padding: 24px 28px 28px; }
.co-portal-profile .co-section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--bite-text);
    margin-bottom: 20px;
}
.co-portal-profile .co-profile-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 20px;
}
.co-portal-profile .co-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.co-portal-profile .co-field.co-full { grid-column: 1 / -1; }
.co-portal-profile .co-field label {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--bite-label);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.co-portal-profile .co-field label .req { color: #dc2626; margin-left: 2px; }
.co-portal-profile .co-field input.co-field-invalid {
    border-color: #fca5a5;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}
.co-portal-profile .co-field input[readonly] {
    background: #f3f4f6;
    color: #6b7280;
    cursor: not-allowed;
}
.co-company-locked-hint {
    font-size: 0.78rem;
    color: #6b7280;
    margin-top: 4px;
}
.co-portal-profile .co-field input,
.co-portal-profile .co-field textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--bite-border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--bite-text);
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.co-portal-profile .co-field input::placeholder,
.co-portal-profile .co-field textarea::placeholder { color: #c4c9d4; font-weight: 400; }
.co-portal-profile .co-field input:focus,
.co-portal-profile .co-field textarea:focus {
    outline: none;
    border-color: var(--bite-cyan);
    box-shadow: 0 0 0 3px rgba(58, 201, 227, 0.18);
}
.co-portal-profile .co-field textarea { min-height: 100px; resize: vertical; line-height: 1.5; }
.co-portal-profile .co-form-footer {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 6px;
    padding-top: 8px;
}
.co-portal-profile .co-btn-save {
    padding: 13px 32px;
    background: var(--bite-cyan);
    color: #fff;
    border: none;
    border-radius: var(--bite-radius);
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}
.co-portal-profile .co-btn-save:hover { background: var(--bite-cyan-dark); }
.co-portal-profile .co-btn-save:active { transform: scale(0.98); }
.co-portal-profile .co-btn-save:disabled { opacity: 0.65; cursor: not-allowed; transform: none; }
.co-portal-profile .co-save-msg { font-size: 0.875rem; font-weight: 500; }
.co-portal-profile .co-save-msg.ok { color: #059669; }
.co-portal-profile .co-save-msg.err { color: #dc2626; }

/* My orders / Company orders switch (customers in a company only) */
.co-scope-switch { display: inline-flex; gap: 2px; padding: 3px; margin: 0 0 12px; border-radius: 999px;
    background: #f3f4f6; border: 1px solid #e5e7eb; }
.co-scope-switch a { padding: 7px 16px; border-radius: 999px; font-size: 0.82rem; font-weight: 600;
    color: var(--bite-text); text-decoration: none; white-space: nowrap; }
.co-scope-switch a:hover { background: #fff; }
.co-scope-switch a.active { background: var(--bite-pink); color: #fff; }
.orders-wrap td.order-placed-by { color: #4b5563; white-space: nowrap; }

/* Orders — match staff Orders page */
.orders-wrap {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}
.orders-wrap .list-card-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.orders-wrap table { width: 100%; border-collapse: collapse; min-width: 520px; font-size: 0.86rem; }
.orders-wrap th {
    text-align: left;
    font-size: 0.7rem;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 12px 16px;
    border-bottom: 1px solid #eef0f3;
    background: #f8fafc;
    white-space: nowrap;
}
.orders-wrap th.order-col-total,
.orders-wrap td.order-col-total {
    text-align: right;
    width: 1%;
    white-space: nowrap;
    padding-right: 24px;
}
.orders-wrap td {
    padding: 11px 16px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
    color: #1f2937;
}
.orders-wrap tbody tr.data-row { cursor: pointer; }
.orders-wrap tbody tr.data-row:hover { background: #f9fafb; }
.orders-wrap tbody tr.data-row.expanded { background: #eef2ff; }
.orders-wrap tr.details-row { display: none; }
.orders-wrap tr.details-row.open { display: table-row; }
.orders-wrap tr.details-row td {
    padding: 0 !important;
    background: #f8fafc !important;
    border-bottom: 1px solid #e5e7eb;
}
.orders-wrap .order-chevron {
    font-size: 0.65rem;
    color: #6b7280;
    margin-left: 6px;
    transition: transform 0.2s;
}
.orders-wrap tr.data-row.expanded .order-chevron { transform: rotate(180deg); }
.orders-wrap .order-date { color: #6b7280; }
.orders-wrap .details-inner { padding: 16px 18px 18px; }
.orders-wrap .detail-section { margin-bottom: 16px; }
.orders-wrap .detail-section:last-child { margin-bottom: 0; }
.orders-wrap .detail-section h4 {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #9ca3af;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e5e7eb;
}
.orders-wrap .detail-empty { font-size: 0.85rem; color: #9ca3af; font-style: italic; }
.orders-wrap .detail-line { padding: 14px 0 10px; border-bottom: 1px solid #eef0f3; }
.orders-wrap .detail-line:last-child { border-bottom: none; }
.orders-wrap .detail-section-fees .detail-line-fee,
.orders-wrap .detail-section-extra-costs .detail-line-cost {
    padding: 3px 0;
    border-bottom: none;
}
.orders-wrap .detail-section-fees h4 {
    margin-bottom: 6px;
}
.orders-wrap .line-fee-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    font-size: 0.86rem;
}
.orders-wrap .line-fee-row .line-title {
    font-weight: 600;
    color: #111827;
    min-width: 0;
}
.orders-wrap .line-fee-row .line-price {
    font-weight: 600;
    white-space: nowrap;
    color: #111827;
    flex-shrink: 0;
}
.orders-wrap .order-summary-total {
    padding-top: 12px;
    margin-top: 6px;
    margin-bottom: 20px;
    border-top: 1px solid var(--bite-border);
}
.orders-wrap .order-summary-total .detail-line-cost {
    padding: 3px 0;
    border-bottom: none;
}
.orders-wrap .order-summary-total .order-net-total {
    margin-top: 0;
}
.orders-wrap .order-summary-total .order-net-total .line-title,
.orders-wrap .order-summary-total .order-net-total .line-price {
    font-weight: 700;
    font-size: 0.92rem;
}
.orders-wrap .order-summary-total .order-grand-total {
    margin-top: 4px;
}
.orders-wrap .line-main { font-size: 0.86rem; }
.orders-wrap .line-details { min-width: 0; }
.orders-wrap .line-sku {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    letter-spacing: 0.02em;
    margin-bottom: 2px;
}
.orders-wrap .line-title { font-weight: 600; color: #111827; display: block; }
.orders-wrap .line-price-row { display: flex; justify-content: flex-end; margin: 6px 0 10px; }
.orders-wrap .line-price { font-weight: 600; white-space: nowrap; color: #111827; font-size: 0.86rem; }
.orders-wrap .line-meta { font-size: 0.8rem; color: #6b7280; margin-top: 3px; }
.orders-wrap .line-dates {
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 2px 14px;
}
.orders-wrap .line-dates li { font-size: 0.8rem; color: #374151; line-height: 1.4; }
.orders-wrap .line-dates strong { font-weight: 600; color: #111827; }
.orders-wrap .line-props {
    list-style: none;
    margin: 8px 0 0;
    padding: 8px 0 0;
    border-top: 1px dashed #e5e7eb;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0;
}
.orders-wrap .line-props li { font-size: 0.8rem; color: #374151; padding: 0; line-height: 1.4; }
.orders-wrap .line-props li:not(:last-child)::after {
    content: '·';
    color: #9ca3af;
    font-weight: 600;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0 0.65em;
    vertical-align: middle;
}
.orders-wrap .line-props li strong { font-weight: 600; color: #6b7280; }
.orders-wrap .order-info-note {
    font-size: 0.86rem;
    line-height: 1.55;
    color: #374151;
    white-space: pre-wrap;
    margin-bottom: 8px;
}
.orders-wrap .info-kv { font-size: 0.8rem; color: #374151; padding: 3px 0; line-height: 1.45; }
.orders-wrap .info-kv strong { font-weight: 600; color: #6b7280; }
.orders-wrap .order-info-panel {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px 18px 18px;
}
.orders-wrap .order-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 18px;
}
.orders-wrap .order-info-top-dates {
    display: grid;
    grid-template-columns: repeat(var(--top-date-cols, 2), minmax(0, 1fr));
    gap: 14px 18px;
    align-items: start;
}
.orders-wrap .order-info-top-dates .order-info-field {
    min-width: 0;
}
.orders-wrap .order-info-top-dates .order-info-field label {
    font-size: 0.65rem;
    line-height: 1.35;
    word-break: break-word;
}
.orders-wrap .order-info-top-dates .order-info-value,
.orders-wrap .order-info-top-dates textarea {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
.orders-wrap .order-info-group { margin-bottom: 16px; }
.orders-wrap .order-info-group:last-child { margin-bottom: 0; }
.orders-wrap .order-info-group-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #9ca3af;
    margin: 0 0 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e5e7eb;
}
.orders-wrap .order-info-group + .order-info-group .order-info-group-title { margin-top: 4px; }
.orders-wrap .order-info-group.has-separator {
    border-top: 1px solid #e5e7eb;
    padding-top: 16px;
    margin-top: 16px;
}
.orders-wrap .order-info-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.orders-wrap .order-info-field.full-width { grid-column: 1 / -1; }
.orders-wrap .order-info-field label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.orders-wrap .order-info-value {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 11px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.86rem;
    line-height: 1.45;
    background: #f9fafb;
    color: #374151;
    white-space: pre-wrap;
    min-height: 2.5rem;
}
.orders-wrap .order-status-label-slot {
    font-size: 0.84rem;
    color: #374151;
    white-space: nowrap;
}
.orders-wrap .order-info-value.empty { color: #9ca3af; font-style: italic; }
.orders-wrap .order-info-value.order-address-value {
    min-height: unset;
    height: auto;
    overflow: visible;
    word-break: break-word;
}
.orders-wrap .order-addresses-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 18px;
    align-items: start;
}
.orders-wrap .order-addresses-grid .order-info-field:nth-child(3) {
    grid-column: 1 / -1;
    max-width: 320px;
}
.orders-wrap .order-addresses-grid .order-info-field { min-width: 0; }
.orders-wrap .order-info-value.payment-value {
    white-space: nowrap;
    min-height: unset;
    width: fit-content;
    max-width: 100%;
    font-weight: 600;
}

/* Empty / error states */
.state-msg {
    padding: 40px 24px;
    text-align: center;
    color: var(--bite-muted);
    font-size: 0.9375rem;
    line-height: 1.5;
}
.state-msg i {
    display: block;
    font-size: 2rem;
    color: var(--bite-cyan);
    margin-bottom: 12px;
    opacity: 0.7;
}
.state-msg.error {
    color: #991b1b;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--bite-radius);
}
.state-msg.error i { color: #dc2626; opacity: 1; }

@media (max-width: 640px) {
    .co-portal-profile .co-profile-form { grid-template-columns: 1fr; }
    .co-portal-profile { padding: 18px 16px 22px; }
    .orders-wrap table { min-width: 100%; }
    .co-tabs { flex-wrap: wrap; }
    .co-tab-btn.co-logout-tab { margin-left: 0; }
    .co-tab-btn { padding: 12px 14px; font-size: 0.875rem; }
    .co-portal-profile .co-btn-save { width: 100%; }
    .co-portal-profile .co-form-footer { flex-direction: column; align-items: stretch; }
    .orders-wrap .order-info-grid { grid-template-columns: 1fr; }
    .orders-wrap .order-addresses-grid { grid-template-columns: 1fr; }
    .orders-wrap .order-info-top-dates {
        grid-template-columns: repeat(var(--top-date-cols, 2), minmax(88px, 1fr));
        overflow-x: auto;
    }
}
    

