/* ── Online siparişler: tek satırlı liste, sağda açık detay paneli; platform ve mağaza kontrolleri araç çubuğunda. ── */
.online-workspace.is-full-width { grid-template-columns: minmax(0, 1fr); }
.online-orders-panel { container-type: inline-size; min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-3) var(--page-gutter) var(--page-gutter); background: var(--color-bg); }
.online-page-toolbar { flex: none; min-height: var(--control-md); display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); }
.online-page-toolbar h1 { margin: 0 var(--space-2) 0 0; font-size: var(--text-xl); line-height: 28px; font-weight: var(--weight-semibold); letter-spacing: var(--tracking-tighter); white-space: nowrap; }
.online-page-toolbar .search-box { flex: 1 1 180px; width: auto; max-width: 320px; margin-left: auto; }

.online-platform-filter { position: relative; z-index: 12; }
.online-platform-filter-trigger, .online-channels-button { height: var(--control-md); display: inline-flex; align-items: center; gap: 8px; padding: 0 10px 0 12px; border: 1px solid var(--color-border-control); border-radius: var(--radius-md); background: var(--color-surface); color: var(--color-text); font-size: var(--text-sm); font-weight: var(--weight-medium); white-space: nowrap; }
.online-platform-filter-trigger:hover, .online-platform-filter-trigger[aria-expanded="true"], .online-channels-button:hover { border-color: var(--color-border-strong); background: var(--color-surface-hover); }
.online-platform-filter-trigger > svg, .online-channels-button > svg { color: var(--color-text-muted); }
.online-platform-filter-trigger > strong, .online-channels-button > strong { color: var(--color-text-muted); font-size: var(--text-sm); font-weight: var(--weight-regular); }
.online-channels-button > strong { padding-left: 8px; border-left: 1px solid var(--color-divider); }
.online-platform-filter-trigger > svg:last-child { transition: transform var(--duration-fast) var(--ease-standard); }
.online-platform-filter-trigger[aria-expanded="true"] > svg:last-child { transform: rotate(180deg); }
.online-platform-popover { position: absolute; top: calc(100% + 6px); left: 0; width: 320px; padding: 6px; border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-surface); box-shadow: var(--shadow-popover); }
.online-platform-popover-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 8px 10px; border-bottom: 1px solid var(--color-divider); }
.online-platform-popover-heading > div { min-width: 0; display: grid; gap: 2px; }
.online-platform-popover-heading strong { font-size: var(--text-sm); }
.online-platform-popover-heading span { color: var(--color-text-muted); font-size: var(--text-xs); }
.online-platform-popover-heading > button { min-height: var(--control-md); padding: 0 10px; border: 1px solid var(--color-border-control); border-radius: var(--radius-sm); background: var(--color-surface); color: var(--color-text); font-size: var(--text-xs); font-weight: var(--weight-medium); }
.online-platform-popover-heading > button.is-selected { border-color: var(--color-selected-border); background: var(--color-selected-bg); color: var(--color-selected-text); }
.online-platform-options { display: grid; gap: 2px; margin-top: 4px; }
.online-platform-options > button { min-height: 48px; display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 4px 8px; border-radius: var(--radius-sm); background: transparent; color: var(--color-text); text-align: left; }
.online-platform-options > button:hover { background: var(--color-surface-subtle); }
.online-platform-check { width: 20px; height: 20px; display: grid; place-items: center; border: 1.5px solid var(--color-border-strong); border-radius: 5px; background: var(--color-surface); color: var(--color-on-primary); }
.online-platform-options > button[aria-pressed="true"] .online-platform-check { border-color: var(--color-primary); background: var(--color-primary); }
.online-platform-option-name { min-width: 0; display: grid; gap: 2px; font-size: var(--text-sm); font-weight: var(--weight-medium); }
.online-platform-option-name small { display: flex; align-items: center; gap: 6px; color: var(--color-text-muted); font-size: var(--text-xs); font-weight: var(--weight-regular); }
.online-platform-options > button > b { color: var(--color-text-muted); font-size: var(--text-xs); font-weight: var(--weight-medium); text-align: right; }
.online-platform-popover > p { margin: 6px 8px 4px; color: var(--color-text-muted); font-size: var(--text-xs); }
.online-platform-state { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--color-text-disabled); }
.online-platform-state.is-active { background: var(--color-success-solid); }
.online-platform-state.is-passive { background: var(--color-warning-solid); }
.online-platform-state.is-error { background: var(--color-danger-solid); }

/* Otomasyon anahtarları: etiket + ortak anahtar; yönetici değilse soluk. */
.online-automation { display: flex; gap: var(--space-2); }
.online-automation button { height: var(--control-md); display: inline-flex; align-items: center; gap: 10px; padding: 0 10px 0 12px; border: 1px solid var(--color-border-control); border-radius: var(--radius-md); background: var(--color-surface); color: var(--color-text); font-size: var(--text-sm); font-weight: var(--weight-medium); white-space: nowrap; }
.online-automation button:hover:not(:disabled) { border-color: var(--color-border-strong); }
.online-automation button:disabled { opacity: 1; color: var(--color-text-muted); cursor: not-allowed; }
.online-automation button:disabled .switch { background: var(--color-divider); }
.online-automation button:disabled[aria-pressed="true"] .switch { background: var(--color-text-disabled); }

.online-status-filter { position: relative; flex: 0 0 176px; }
.online-status-filter select { width: 100%; height: var(--control-md); padding: 0 36px 0 12px; border: 1px solid var(--color-border-control); border-radius: var(--radius-md); background: var(--color-surface); color: var(--color-text); font-size: var(--text-sm); appearance: none; cursor: pointer; }
.online-status-filter select:hover { border-color: var(--color-border-strong); }
.online-status-filter select:focus-visible { outline: none; border-color: var(--color-focus); box-shadow: 0 0 0 3px rgb(46 107 87 / .16); }
.online-status-filter svg { position: absolute; top: 50%; right: 12px; color: var(--color-text-muted); transform: translateY(-50%); pointer-events: none; }

.online-orders-list { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); }
.online-list-head, .online-order-card { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(110px, .75fr) minmax(200px, 1.4fr) 64px 56px minmax(110px, .8fr) 100px; align-items: center; column-gap: var(--space-4); }
.online-list-head { flex: none; height: 36px; padding: 0 var(--space-4); border-bottom: 1px solid var(--color-border); background: var(--color-surface-subtle); color: var(--color-text-muted); font-size: var(--text-xs); font-weight: var(--weight-medium); }
.online-list-head span:nth-child(7) { text-align: right; }
.online-list-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.online-order-card { width: 100%; min-height: 64px; padding: 10px var(--space-4); border-bottom: 1px solid var(--color-divider); background: var(--color-surface); color: var(--color-text); text-align: left; }
.online-order-card:hover { background: var(--color-surface-hover); }
.online-order-card.is-selected { background: var(--color-selected-bg); box-shadow: inset 2px 0 var(--color-primary); }
.online-order-card:focus-visible { outline-offset: -2px; }
.online-order-card.is-rejected, .online-order-card.is-cancelled { color: var(--color-text-muted); }
.online-order-card > time { color: var(--color-text-muted); font-size: var(--text-sm); }
.online-order-id { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.online-order-id strong { font-size: var(--text-base); font-weight: var(--weight-semibold); }
.online-order-id small { overflow: hidden; color: var(--color-text-muted); font-size: var(--text-xs); text-overflow: ellipsis; white-space: nowrap; }
.online-customer { overflow: hidden; font-size: var(--text-sm); font-weight: var(--weight-medium); text-overflow: ellipsis; white-space: nowrap; }
.online-address { min-width: 0; display: -webkit-box; overflow: hidden; color: var(--color-text-muted); font-size: var(--text-xs); line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.online-item-count { color: var(--color-text-muted); font-size: var(--text-sm); white-space: nowrap; }
.online-row-status { display: inline-flex; align-items: center; gap: 7px; color: var(--color-text-secondary); font-size: var(--text-sm); white-space: nowrap; }
.online-status-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--color-warning-solid); }
.online-order-card.is-accepted .online-status-dot { background: var(--color-success-solid); }
.online-order-card:is(.is-rejected, .is-cancelled) .online-status-dot { background: var(--color-danger-solid); }
.online-order-card.is-new .online-row-status { color: var(--color-warning); font-weight: var(--weight-medium); }
.online-row-total { color: var(--color-text); font-size: var(--text-base); font-weight: var(--weight-semibold); text-align: right; white-space: nowrap; }
.online-empty { min-height: 180px; display: grid; place-items: center; margin: 0; color: var(--color-text-muted); font-size: var(--text-sm); }

/* Detay paneli: masa detayıyla aynı açık yüzey. */
.online-order-details { min-width: 0; min-height: 0; display: flex; flex-direction: column; padding: var(--space-3) var(--space-4) var(--space-4); border-left: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text); }
.online-detail-heading { min-height: 40px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.online-detail-heading > div { display: flex; align-items: center; gap: 8px; color: var(--color-text-muted); font-size: var(--text-sm); }
.online-detail-heading strong { height: 22px; display: inline-flex; align-items: center; padding: 0 8px; border-radius: var(--radius-xs); background: var(--color-surface-subtle); color: var(--color-text-secondary); font-size: var(--text-xs); font-weight: var(--weight-medium); }
.online-detail-heading .icon-button { margin-right: -8px; }
.online-order-details h2 { margin: 4px 0 0; font-size: var(--text-xl); line-height: 28px; font-weight: var(--weight-semibold); letter-spacing: var(--tracking-tighter); }
.online-order-reference { display: flex; align-items: center; gap: 6px; margin: 2px 0 var(--space-4); color: var(--color-text-muted); font-size: var(--text-xs); }
.online-order-reference strong { color: var(--color-text-secondary); font-weight: var(--weight-medium); }
.online-order-reference span:last-child { margin-left: auto; }
.online-detail-customer { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-top: var(--space-3); border-top: 1px solid var(--color-divider); }
.online-detail-customer strong { font-size: var(--text-md); }
.online-detail-customer span { color: var(--color-text-muted); font-size: var(--text-sm); }
.online-contact { display: grid; gap: 6px; margin-top: var(--space-2); color: var(--color-text-secondary); font-size: var(--text-sm); }
.online-contact span { display: flex; align-items: flex-start; gap: 8px; line-height: 1.45; }
.online-contact svg { margin-top: 2px; color: var(--color-text-muted); }
.online-note { margin-top: var(--space-3); padding: 8px 12px; border-radius: var(--radius-md); background: var(--color-warning-subtle); }
.online-note span { color: var(--color-warning); font-size: var(--text-xs); font-weight: var(--weight-medium); }
.online-note p { margin: 2px 0 0; color: var(--color-text); font-size: var(--text-sm); line-height: 1.45; }
.online-item-card { flex: 1; min-height: 0; display: flex; flex-direction: column; margin: var(--space-4) calc(-1 * var(--space-4)) 0; border-top: 1px solid var(--color-divider); }
.online-item-heading { flex: none; min-height: 44px; display: flex; align-items: center; justify-content: space-between; padding: 0 var(--space-4); border-bottom: 1px solid var(--color-divider); }
.online-item-heading strong { font-size: var(--text-sm); }
.online-item-heading span { color: var(--color-text-muted); font-size: var(--text-sm); }
.online-item-list { min-height: 0; overflow-y: auto; }
.online-item-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px var(--space-4); border-bottom: 1px solid var(--color-divider); font-size: var(--text-base); }
.online-item-row strong { font-weight: var(--weight-semibold); white-space: nowrap; }
.online-detail-footer { flex: none; display: flex; flex-direction: column; gap: var(--space-2); padding-top: var(--space-3); }
.preparation-select { min-height: var(--control-md); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 4px 0 12px; border: 1px solid var(--color-border-control); border-radius: var(--radius-md); background: var(--color-surface); }
.preparation-select span { color: var(--color-text-secondary); font-size: var(--text-sm); }
.preparation-select select { height: 40px; padding: 0 8px; border: 0; outline: 0; background: transparent; color: var(--color-text); font-size: var(--text-sm); font-weight: var(--weight-semibold); }
.preparation-select:focus-within { border-color: var(--color-focus); box-shadow: 0 0 0 3px rgb(46 107 87 / .16); }
.online-decision-buttons { display: grid; grid-template-columns: 1fr 1.6fr; gap: var(--space-2); }
.online-decision-buttons button { min-height: var(--control-lg); border-radius: var(--radius-md); font-size: var(--text-md); font-weight: var(--weight-semibold); }
.online-reject-button { border: 1px solid var(--color-danger-border); background: var(--color-surface); color: var(--color-danger); }
.online-reject-button:hover { background: var(--color-danger-subtle); }
.online-accept-button { display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--color-primary); color: var(--color-on-primary); }
.online-accept-button:hover:not(:disabled) { background: var(--color-primary-hover); }
.online-accept-button:disabled { opacity: 1; background: var(--color-surface-subtle); color: var(--color-text-disabled); }
.online-status-message { min-height: var(--control-md); display: grid; place-items: center; border-radius: var(--radius-md); background: var(--color-surface-subtle); color: var(--color-text-secondary); font-size: var(--text-sm); font-weight: var(--weight-medium); }
.online-status-message.is-accepted { background: var(--color-success-subtle); color: var(--color-success); }
.online-status-message:is(.is-rejected, .is-cancelled) { background: var(--color-danger-subtle); color: var(--color-danger); }
.online-cancel-button { width: 100%; min-height: var(--control-md); border-radius: var(--radius-md); background: transparent; color: var(--color-danger); font-size: var(--text-sm); font-weight: var(--weight-medium); }
.online-cancel-button:hover { background: var(--color-danger-subtle); }
.online-stock-warning { margin: 0; padding: 8px 10px; border: 1px solid var(--color-danger-border); border-radius: var(--radius-md); background: var(--color-danger-subtle); color: var(--color-danger); font-size: var(--text-xs); line-height: 1.4; }
.online-auto-issue { margin: 0; padding: 8px 10px; border: 1px solid var(--color-warning-border); border-radius: var(--radius-md); background: var(--color-warning-subtle); color: var(--color-warning); font-size: var(--text-xs); line-height: 1.4; }

/* Reddetme ve mağaza pencereleri */
.action-dialog.online-reject-dialog { width: min(520px, calc(100vw - 32px)); }
.online-reason-select { display: grid; gap: 6px; margin-top: var(--space-4); }
.online-reason-select span { color: var(--color-text-secondary); font-size: var(--text-sm); font-weight: var(--weight-medium); }
.online-reason-select select { height: var(--control-md); padding: 0 12px; border: 1px solid var(--color-border-control); border-radius: var(--radius-md); background: var(--color-surface); color: var(--color-text); font-size: var(--text-base); }
.online-confirm-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: var(--space-2); margin-top: var(--space-5); }
.online-confirm-actions button { min-height: 48px; border: 1px solid var(--color-border-control); border-radius: var(--radius-md); background: var(--color-surface); color: var(--color-text); font-weight: var(--weight-medium); }
.online-confirm-actions button:last-child { border-color: transparent; background: var(--color-danger-solid); color: var(--color-on-primary); font-weight: var(--weight-semibold); }
.action-dialog.online-channels-dialog { width: min(800px, calc(100vw - 32px)); }
.online-channel-overview { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0 0 var(--space-4); padding: var(--space-4); border-radius: var(--radius-md); background: var(--color-surface-subtle); }
.online-channel-overview > div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.online-channel-overview > div > span { display: flex; align-items: center; gap: 6px; color: var(--color-text-muted); font-size: var(--text-xs); font-weight: var(--weight-medium); }
.online-channel-overview strong { font-size: var(--text-xl); font-weight: var(--weight-semibold); }
.online-channel-overview small { color: var(--color-text-muted); font-size: var(--text-xs); line-height: 1.4; }
.online-channel-overview > button { min-width: 168px; min-height: var(--control-md); display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--color-border-control); border-radius: var(--radius-md); background: var(--color-surface); font-weight: var(--weight-semibold); }
.online-channel-overview > button.is-close { border-color: var(--color-danger-border); color: var(--color-danger); }
.online-channel-overview > button.is-open { border-color: transparent; background: var(--color-primary); color: var(--color-on-primary); }
.online-channel-overview > button:disabled { opacity: 1; border-color: var(--color-divider); background: var(--color-surface); color: var(--color-text-disabled); }
.online-channel-list { overflow: hidden; border: 1px solid var(--color-border); border-radius: var(--radius-md); }
.online-channel-row { min-height: 64px; display: grid; grid-template-columns: 36px minmax(140px, 1fr) minmax(170px, 1.2fr) 116px 120px; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--color-divider); }
.online-channel-row:last-child { border-bottom: 0; }
.online-channel-logo { width: 36px; height: 36px; display: grid; place-items: center; border-radius: var(--radius-md); background: var(--color-surface-subtle); color: var(--color-text-secondary); font-size: var(--text-xs); font-weight: var(--weight-semibold); }
.online-channel-identity, .online-channel-sync { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.online-channel-identity strong { font-size: var(--text-base); }
.online-channel-identity small, .online-channel-sync small { overflow: hidden; color: var(--color-text-muted); font-size: var(--text-xs); text-overflow: ellipsis; white-space: nowrap; }
.online-channel-sync > span { display: flex; align-items: center; gap: 6px; color: var(--color-success); font-size: var(--text-xs); }
.online-channel-sync > span.is-stale { color: var(--color-warning); }
.online-channel-status { display: flex; align-items: center; gap: 6px; color: var(--color-text-muted); font-size: var(--text-sm); font-weight: var(--weight-medium); white-space: nowrap; }
.online-channel-status.is-active { color: var(--color-success); }
.online-channel-status.is-error { color: var(--color-danger); }
.online-channel-row > button { min-height: var(--control-sm); padding: 0 12px; border: 1px solid var(--color-border-control); border-radius: var(--radius-md); background: var(--color-surface); color: var(--color-text); font-size: var(--text-sm); font-weight: var(--weight-medium); }
.online-channel-row.is-active > button { border-color: var(--color-danger-border); color: var(--color-danger); }
.online-channel-row > button.is-settings { border-color: var(--color-border-control); color: var(--color-text); }
.online-channel-row > button:disabled { opacity: 1; border-color: var(--color-divider); color: var(--color-text-disabled); cursor: not-allowed; }
.online-channel-empty { min-height: 110px; display: grid; place-items: center; margin: 0; color: var(--color-text-muted); }
.action-dialog p.online-channel-permission { margin: var(--space-3) 0 0; color: var(--color-text-muted); font-size: var(--text-xs); text-align: center; }

@container (max-width: 1050px) {
  .online-list-head, .online-order-card { grid-template-columns: minmax(130px, 1.1fr) minmax(110px, .85fr) minmax(140px, 1.2fr) 52px minmax(100px, .9fr) 92px; column-gap: 10px; }
  .online-list-head span:nth-child(4), .online-item-count { display: none; }
  .online-list-head span:nth-child(7) { text-align: right; }
}
@media (max-width: 760px) {
  .online-channel-overview { align-items: stretch; flex-direction: column; }
  .online-channel-overview > button { width: 100%; }
  .online-channel-row { grid-template-columns: 36px 1fr auto; }
  .online-channel-sync { grid-column: 2 / -1; }
  .online-channel-status { grid-column: 2; }
  .online-channel-row > button { grid-column: 3; }
}

/* Liste alanı detay açıldığında daralsa da fiyat ve aşama görünür kalır. */
@container (max-width: 760px) {
  .online-list-head { display: none; }
  .online-order-card { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding-block: 14px; }
  .online-order-id { grid-column: 1; grid-row: 1; }
  .online-row-total { grid-column: 2; grid-row: 1; }
  .online-customer { grid-column: 1; grid-row: 2; }
  .online-order-card > time { grid-column: 2; grid-row: 2; text-align: right; }
  .online-address { grid-column: 1; grid-row: 3; }
  .online-row-status { grid-column: 2; grid-row: 3; justify-self: end; }
}
.online-item-row > span { min-width: 0; overflow-wrap: anywhere; }
.online-item-row small { display: block; margin-top: 4px; color: var(--color-text-secondary); font-size: var(--text-xs); }
.online-item-row > strong { flex: none; white-space: nowrap; }
