﻿:root {
  color-scheme: light;
  --bg: #eef3fb;
  --panel: #ffffff;
  --panel-soft: #f7f9fe;
  --ink: #25223f;
  --muted: #7f8aa3;
  --line: #e5ebf5;
  --accent: #57c9c4;
  --accent-strong: #1f9d98;
  --nav: #ffffff;
  --nav-active: #25223f;
  --warm: #ff9f8f;
  --blue: #6da9e8;
  --shadow: 0 22px 55px rgba(42, 55, 92, .10);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif; color: var(--ink); background: var(--bg); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.login-shell { position: fixed; inset: 0; display: none; place-items: center; padding: 24px; background: radial-gradient(circle at top, rgba(87, 201, 196, .25), transparent 34%), linear-gradient(135deg, rgba(37, 34, 63, .92), rgba(24, 37, 73, .88)); z-index: 50; }
.login-shell.is-visible { display: grid; }
.login-card { width: min(460px, 100%); background: rgba(255,255,255,.96); border: 1px solid rgba(255,255,255,.92); border-radius: 28px; box-shadow: 0 24px 60px rgba(12, 19, 43, .28); padding: 26px; display: grid; gap: 18px; }
.login-copy { margin: 10px 0 0; color: var(--muted); line-height: 1.7; }
.login-form { padding: 0; box-shadow: none; border: 0; background: transparent; }
.login-error { min-height: 20px; margin: 0; color: #d15b53; font-weight: 800; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 132px 1fr; gap: 0; padding: 16px; }
.sidebar { background: var(--nav); color: var(--ink); padding: 18px 12px; display: flex; flex-direction: column; gap: 20px; border-radius: 28px; box-shadow: var(--shadow); align-items: center; }
.brand { display: grid; place-items: center; gap: 8px; text-align: center; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 16px; background: linear-gradient(135deg, var(--accent), #b4ece9); color: #112e38; font-weight: 900; }
.brand h1 { margin: 0; font-size: 12px; }
.brand p { display: none; }
.nav-tabs { display: grid; gap: 10px; width: 100%; }
.nav-button { border: 0; background: transparent; color: var(--muted); text-align: center; padding: 13px 10px; border-radius: 18px; font-size: 16px; font-weight: 800; line-height: 1.35; min-width: 100px; }
.nav-button.active, .nav-button:hover { background: var(--nav-active); color: #fff; box-shadow: 0 10px 24px rgba(37, 34, 63, .22); }
.storage-card { margin-top: auto; border: 1px solid var(--line); padding: 12px 8px; border-radius: 18px; display: grid; gap: 4px; color: var(--muted); text-align: center; font-size: 11px; }
.storage-card strong { color: var(--ink); font-size: 12px; }
.workspace { min-width: 0; padding: 12px 12px 22px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 22px; background: rgba(255,255,255,.58); border: 1px solid rgba(255,255,255,.78); border-radius: 26px; padding: 16px 18px; backdrop-filter: blur(18px); }
.eyebrow { margin: 0 0 5px; color: var(--accent-strong); font-weight: 900; font-size: 12px; text-transform: uppercase; }
h2, h3 { margin: 0; letter-spacing: 0; }
h2 { font-size: 28px; }
h3 { font-size: 18px; }
.topbar-actions, .form-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.session-chip { min-height: 40px; padding: 8px 12px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255,255,255,.82); display: grid; gap: 2px; }
.session-chip strong { font-size: 13px; }
.session-chip span { color: var(--muted); font-size: 12px; font-weight: 800; }
.primary-button, .secondary-button, .ghost-button { border-radius: 16px; min-height: 40px; padding: 0 16px; font-weight: 800; }
.primary-button { border: 0; background: var(--accent); color: #073231; box-shadow: 0 14px 26px rgba(87, 201, 196, .32); }
.primary-button:hover { background: #73d8d3; }
.secondary-button { background: #fff; border: 1px solid var(--line); color: var(--ink); display: inline-grid; place-items: center; }
.ghost-button { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.hidden-file, .view { display: none; }
.view.active { display: block; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 16px; }
.section-head p { margin: 8px 0 0; color: var(--muted); }
.search-input { width: min(320px, 100%); border: 1px solid var(--line); border-radius: 16px; padding: 11px 14px; background: #fff; }
.product-head { align-items: flex-start; }
.product-tools, .order-tools { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; max-width: 1100px; }
.filter-select { min-height: 42px; min-width: 150px; border: 1px solid var(--line); border-radius: 16px; padding: 0 12px; background: #fff; color: var(--ink); }
.segmented-control, .subnav-tabs { display: inline-flex; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: #fff; margin-bottom: 18px; box-shadow: 0 12px 30px rgba(42, 55, 92, .06); }
.segment-button, .subnav-button { min-height: 42px; border: 0; border-right: 1px solid var(--line); padding: 0 18px; background: #fff; color: var(--muted); font-weight: 900; }
.segment-button:last-child, .subnav-button:last-child { border-right: 0; }
.segment-button.active, .subnav-button.active { background: var(--nav-active); color: #fff; }
.order-panel, .product-panel, .quote-panel, .shipping-panel, .finance-panel, .payment-panel, .receipt-panel, .user-panel { display: none; }
.order-panel.active, .product-panel.active, .quote-panel.active, .shipping-panel.active, .finance-panel.active, .payment-panel.active, .receipt-panel.active, .user-panel.active { display: block; }
.compact-head { margin-top: 4px; }
.detail-heading { margin-top: 18px; }
.hidden-helper { display: none; }
.compact-segmented { margin-bottom: 0; }
.compact-segmented .segment-button { min-height: 40px; padding: 0 14px; }
.order-overview-layout { display: grid; gap: 18px; }
.order-overview-layout.is-stacked .order-list-panel { max-height: 610px; overflow: auto; }
.order-overview-layout.is-split { grid-template-columns: minmax(460px, .95fr) minmax(420px, 1.05fr); align-items: start; }
.order-overview-layout.is-split .order-list-panel,
.order-overview-layout.is-split .order-detail-panel { max-height: calc(100vh - 300px); min-height: 360px; overflow: auto; }
.order-overview-layout.is-split .detail-heading { margin-top: 0; }
.order-list-panel table { min-width: 1100px; }
.order-detail-panel table { min-width: 980px; }
.selected-row td { background: #eefdfb; }
tr[data-order-row] { cursor: pointer; }
.danger-text { color: #d15b53; }
.order-head { align-items: flex-start; }
.status-select { min-height: 34px; border: 1px solid var(--line); border-radius: 12px; padding: 0 8px; background: #fff; color: var(--ink); font-weight: 800; }
.status-select.status-pending { background: #f3f5f9; border-color: #cbd5e1; color: #475569; }
.status-select.status-ordered { background: #fff3bf; border-color: #f59e0b; color: #8a5a00; }
.status-select.status-shipped { background: #dbeafe; border-color: #60a5fa; color: #1d4ed8; }
.status-select.booking-pending { background: #fff7ed; border-color: #fb923c; color: #c2410c; }
.status-select.booking-booked { background: #ecfeff; border-color: #22d3ee; color: #0e7490; }
.status-select.booking-shipped { background: #dcfce7; border-color: #86efac; color: #15803d; }
.status-select.release-pending { background: #e0f2fe; border-color: #7dd3fc; color: #0369a1; }
.status-select.release-upcoming { background: #fff7ed; border-color: #fb923c; color: #c2410c; }
.status-select.release-done { background: #dcfce7; border-color: #86efac; color: #15803d; }
.status-select.payment-empty { background: #f8fafc; border-color: #cbd5e1; color: #64748b; }
.status-select.payment-collect-due { background: #fff7ed; border-color: #fb923c; color: #c2410c; }
.status-select.payment-collect-done { background: #dcfce7; border-color: #86efac; color: #15803d; }
.status-select.payment-pay-due { background: #fef3c7; border-color: #f59e0b; color: #92400e; }
.status-select.payment-pay-done { background: #dbeafe; border-color: #60a5fa; color: #1d4ed8; }
.status-select.invoice-pack-pending { background: #f8fafc; border-color: #cbd5e1; color: #475569; }
.status-select.invoice-pack-sent { background: #ecfeff; border-color: #22d3ee; color: #0e7490; }
.status-select.invoice-pack-release { background: #fff7ed; border-color: #fb923c; color: #c2410c; }
.status-select.invoice-pack-over { background: #dcfce7; border-color: #86efac; color: #15803d; }
.status-select.payment-request-empty { background: #f8fafc; border-color: #cbd5e1; color: #64748b; }
.status-select.payment-request-due { background: #fff7ed; border-color: #fb923c; color: #c2410c; }
.status-select.payment-request-applied { background: #ecfeff; border-color: #22d3ee; color: #0e7490; }
.status-select.payment-request-paid { background: #dcfce7; border-color: #86efac; color: #15803d; }
.clearance-reminder-button.clearance-pending { background: #fff7ed; border-color: #fb923c; color: #c2410c; }
.clearance-reminder-button.clearance-reminded { background: #dcfce7; border-color: #86efac; color: #15803d; }
.credit-insurance-badge { display: inline-grid; place-items: center; min-height: 30px; border-radius: 999px; padding: 0 12px; font-weight: 900; border: 1px solid var(--line); white-space: nowrap; }
.credit-insurance-badge.is-pending { background: #fff7ed; border-color: #fb923c; color: #c2410c; }
.credit-insurance-badge.is-purchased { background: #dcfce7; border-color: #86efac; color: #15803d; }
.order-check, .product-check, #selectAllOrders, #selectAllProducts { width: 16px; height: 16px; }
#productCategoriesPanel .entry-form { margin-bottom: 18px; }
#productCategoryTable td:nth-child(2) { font-weight: 900; color: var(--accent-strong); }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric-group-card { border: 1px solid rgba(255,255,255,.92); border-radius: 24px; box-shadow: var(--shadow); padding: 14px; background: linear-gradient(135deg, #ffffff, #f6fbff); }
.metric-group-card.metric-group-sales { background: linear-gradient(135deg, #f7fbff, #edf6ff); border-color: #cfe4ff; }
.metric-group-card.metric-group-receivable { background: linear-gradient(135deg, #f5fffc, #e8fbf9); border-color: #bdeee5; }
.metric-group-card.metric-group-payable { background: linear-gradient(135deg, #fffaf0, #fff3d8); border-color: #fde68a; }
.metric-group-card.metric-group-customer { background: linear-gradient(135deg, #fff, #f8fafc); border-color: #e2e8f0; }
.metric-group-head { color: var(--ink); font-weight: 900; font-size: 15px; margin: 2px 4px 12px; }
.metric-group-items { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.metric-card { background: var(--panel); border: 1px solid rgba(255,255,255,.92); border-radius: 22px; box-shadow: var(--shadow); padding: 18px; display: grid; gap: 8px; position: relative; overflow: hidden; }
.metric-card::after { content: ""; position: absolute; width: 82px; height: 82px; right: -24px; top: -28px; border-radius: 50%; background: rgba(87, 201, 196, .18); }
.metric-card span { color: var(--muted); font-weight: 800; font-size: 13px; }
.metric-card strong { font-size: 24px; color: var(--ink); position: relative; z-index: 1; }
.metric-card small { color: var(--muted); font-size: 12px; font-weight: 800; position: relative; z-index: 1; }
.metric-icon { width: 34px; height: 34px; border-radius: 13px; display: grid; place-items: center; background: #e8fbf9; color: var(--accent-strong); font-style: normal; font-weight: 900; box-shadow: inset 0 0 0 1px rgba(87, 201, 196, .22); position: relative; z-index: 1; }
.metric-card.metric-ordered { background: #f7fbff; border-color: #cfe4ff; }
.metric-card.metric-ordered::after { background: rgba(96, 165, 250, .22); }
.metric-card.metric-ordered span { color: #315c99; }
.metric-card.metric-shipped { background: #f5fffc; border-color: #bdeee5; }
.metric-card.metric-shipped::after { background: rgba(87, 201, 196, .24); }
.metric-card.metric-shipped span { color: #08786f; }
.todo-summary { display: grid; gap: 18px; }
.todo-group { background: var(--panel); border: 1px solid rgba(255,255,255,.92); border-radius: 24px; box-shadow: var(--shadow); padding: 18px; }
.todo-group-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.todo-group-head h4 { margin: 0; font-size: 17px; }
.todo-group-head p { margin: 0; color: var(--muted); font-weight: 800; font-size: 13px; }
.todo-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.todo-card { border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(135deg, #fff, #f7fbff); min-height: 130px; padding: 18px; display: grid; align-content: space-between; gap: 8px; cursor: pointer; transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.todo-card:hover { transform: translateY(-2px); border-color: rgba(87, 201, 196, .65); box-shadow: 0 18px 36px rgba(42, 55, 92, .12); }
.todo-card span { color: #3b4662; font-weight: 900; }
.todo-card strong { font-size: 34px; color: var(--accent-strong); line-height: 1; }
.todo-card small { color: var(--muted); font-weight: 700; line-height: 1.45; }
.empty-todo { grid-column: 1 / -1; border: 1px dashed var(--line); border-radius: 18px; padding: 22px; color: var(--muted); background: var(--panel-soft); text-align: center; font-weight: 800; }
.finance-grid { margin-bottom: 18px; }
.finance-visual-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, .85fr) minmax(280px, .9fr); gap: 18px; margin-bottom: 18px; }
.visual-card { background: #fff; border: 1px solid rgba(255,255,255,.92); border-radius: 24px; box-shadow: var(--shadow); padding: 18px; min-height: 300px; }
.visual-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.visual-head p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.visual-head span { border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 12px; padding: 7px 10px; }
.line-chart, .bar-chart { min-height: 230px; position: relative; }
.line-chart svg, .bar-chart svg { width: 100%; height: 220px; overflow: visible; }
.chart-grid { fill: none; stroke: #edf1f8; stroke-width: .8; }
.line-sales, .line-profit { fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.line-sales { stroke: var(--accent); }
.line-profit { stroke: var(--blue); }
.line-chart text, .bar-chart text { fill: var(--muted); font-size: 3px; }
.bar-orders { fill: var(--accent); }
.bar-value { fill: var(--ink); font-weight: 900; }
.chart-legend { display: flex; gap: 14px; color: var(--muted); font-size: 12px; font-weight: 800; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i, .donut-legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.legend-sales { background: var(--accent); }
.legend-profit { background: var(--blue); }
.legend-orders { background: var(--accent); }
.donut-wrap { display: grid; grid-template-columns: 170px 1fr; gap: 16px; align-items: center; min-height: 220px; }
.donut-chart svg { width: 170px; height: 170px; transform: rotate(-90deg); }
.donut-chart text { transform: rotate(90deg); transform-origin: center; font-size: 6px; font-weight: 900; fill: var(--ink); }
.donut-segment { fill: none; stroke-width: 7; stroke-linecap: round; }
.donut-legend { display: grid; gap: 12px; }
.donut-legend div { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.donut-legend strong { color: var(--ink); }
.chart-empty { min-height: 220px; display: grid; place-items: center; color: var(--muted); background: var(--panel-soft); border-radius: 18px; }
.payment-subnav { margin-bottom: 14px; }
.receipt-type-subnav, .receipt-panel-subnav { margin-bottom: 14px; }
.receipt-order-panel { max-height: 420px; overflow: auto; }
.invoice-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.shipping-table-stack { height: calc(100vh - 250px); min-height: 620px; display: grid; grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.shipping-table-section { min-height: 0; display: grid; grid-template-rows: auto auto minmax(0, 1fr); }
.shipping-table-section .section-head { margin-bottom: 8px; }
.shipping-filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.shipping-table-section .shipping-filter-bar { margin-bottom: 8px; }
.shipping-filter-bar .search-input { width: min(340px, 100%); }
.shipping-filter-bar.compact-filter-bar .search-input { width: min(300px, 100%); }
.shipping-scroll-panel { min-height: 0; overflow: auto; }
.shipping-scroll-panel table { min-width: 1280px; }
.shipping-scroll-panel th { top: 0; z-index: 2; }
.shipping-scroll-panel .shipping-date-input { width: 138px; min-width: 138px; }
.shipping-scroll-panel th:nth-child(8),
.shipping-scroll-panel td:nth-child(8),
.shipping-scroll-panel th:nth-child(9),
.shipping-scroll-panel td:nth-child(9),
.shipping-scroll-panel th:nth-child(11),
.shipping-scroll-panel td:nth-child(11),
.shipping-scroll-panel th:nth-child(12),
.shipping-scroll-panel td:nth-child(12) { min-width: 160px; }
.shipping-scroll-panel th:nth-child(3),
.shipping-scroll-panel td:nth-child(3) { position: sticky; left: 0; z-index: 3; background: #fff; box-shadow: 1px 0 0 var(--line); }
.shipping-scroll-panel th:nth-child(3) { z-index: 4; background: var(--panel-soft); }
#shippingShippedTable { min-width: 1080px; }
.invoice-detail-actions { justify-content: flex-end; margin-top: 12px; }
.profit-layout { display: grid; gap: 22px; }
.profit-order-panel { min-height: 260px; max-height: 46vh; overflow: auto; }
.profit-order-panel table { min-width: 900px; }
.profit-order-panel th, .profit-order-panel td { padding: 17px 18px; font-size: 15px; }
.profit-product-panel { max-height: 360px; overflow: auto; }
.profit-product-panel table { min-width: 760px; }
.small-input { width: 92px; border: 1px solid var(--line); border-radius: 12px; padding: 8px; }
.compact-button { min-height: 34px; padding: 0 10px; }
.content-grid.two-column { display: grid; grid-template-columns: minmax(280px, 420px) minmax(0, 1fr); gap: 18px; align-items: start; }
.entry-form, .table-panel, .placeholder-view { background: var(--panel); border: 1px solid rgba(255,255,255,.92); border-radius: 24px; box-shadow: var(--shadow); }
.entry-form { padding: 20px; display: grid; gap: 14px; }
.entry-form label { display: grid; gap: 6px; color: #3b4662; font-weight: 800; font-size: 13px; }
.entry-form select[multiple] { min-height: 112px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 16px; background: #fff; color: var(--ink); }
.entry-form .photo-paste-field { display: grid; gap: 10px; color: #3b4662; font-weight: 800; font-size: 13px; }
.entry-form label:has(:required)::after, .required-title::after { content: " *"; color: #d15b53; font-weight: 900; }
.entry-form input, .entry-form textarea, .entry-form select { width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; color: var(--ink); background: #fff; font-weight: 400; }
.inline-price-input { width: 92px; border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; color: var(--ink); background: #fff; font-weight: 700; }
.entry-form textarea { resize: vertical; }
.product-form, .order-form { grid-template-columns: repeat(4, minmax(160px, 1fr)); margin-bottom: 18px; }
.dimension-group { display: grid; grid-template-columns: 1fr repeat(3, minmax(62px, .7fr)); gap: 8px; align-items: end; }
.dimension-group span { font-weight: 800; color: #3b4662; font-size: 13px; align-self: center; }
.full-row { grid-column: 1 / -1; }
.table-panel { overflow: auto; }
.product-list-panel { height: calc(100vh - 350px); min-height: 320px; }
.product-list-panel th { z-index: 4; }
table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 640px; }
.wide-table table { min-width: 1540px; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; font-size: 14px; }
th { background: var(--panel-soft); color: #46536d; position: sticky; top: 0; z-index: 1; font-size: 12px; text-transform: uppercase; }
td { color: #31384d; }
.pending-invoice-amount { color: #d15b53; font-weight: 900; }
tr:last-child td { border-bottom: 0; }
tr[data-product-row] { cursor: context-menu; }
.editable-cell { cursor: text; position: relative; min-width: 120px; }
.editable-cell:hover { background: #eefdfb; box-shadow: inset 0 0 0 1px rgba(87, 201, 196, .36); }
.editable-cell.is-editing { padding: 6px; background: #fff; box-shadow: inset 0 0 0 2px var(--accent); }
.inline-editor { width: 100%; min-width: 150px; border: 1px solid var(--accent); border-radius: 10px; padding: 8px; color: var(--ink); background: #fff; }
textarea.inline-editor { min-height: 92px; resize: vertical; }
.row-actions { display: flex; gap: 8px; }
.icon-button { border: 1px solid var(--line); background: #fff; min-width: 34px; min-height: 34px; border-radius: 12px; }
.icon-button.danger { color: #d15b53; }
.product-photo { width: 88px; height: 68px; border-radius: 14px; object-fit: contain; background: #fff; border: 1px solid var(--line); padding: 4px; }
.photo-paste-field { gap: 10px; }
.photo-paste-zone { min-height: 112px; border: 1px dashed #9fb0cf; border-radius: 18px; background: #f4f8fd; color: var(--muted); display: flex; align-items: center; justify-content: center; text-align: center; padding: 12px; cursor: text; background-size: contain; background-position: center; background-repeat: no-repeat; }
.photo-paste-zone.has-image { color: transparent; border-style: solid; background-color: #fff; }
.photo-paste-zone:focus { outline: 3px solid rgba(80, 194, 202, .28); border-color: var(--accent); }
.empty-row { color: var(--muted); text-align: center; padding: 28px; }
.product-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; margin-bottom: 18px; }
.product-pagination { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 2px 4px; color: var(--muted); }
.pagination-actions { display: flex; align-items: center; gap: 12px; }
.pagination-actions strong { color: var(--ink); white-space: nowrap; }
.pagination-jump { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); white-space: nowrap; }
.pagination-jump input { width: 72px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.pagination-actions button:disabled { opacity: .45; cursor: default; }
.pagination-summary { white-space: nowrap; }
.product-card { background: #fff; border: 1px solid rgba(255,255,255,.92); border-radius: 24px; overflow: hidden; box-shadow: var(--shadow); cursor: pointer; display: grid; grid-template-rows: 220px auto; }
.product-card:focus-visible { outline: 3px solid rgba(87, 201, 196, .35); outline-offset: 3px; }
.product-card-image { background: #fff; display: grid; place-items: center; color: var(--muted); font-weight: 900; font-size: 12px; padding: 10px; }
.product-card-image img { width: 100%; height: 100%; object-fit: contain; }
.product-card-body { padding: 14px; display: grid; gap: 7px; min-height: 112px; }
.product-card-body strong { font-size: 15px; }
.product-card-body span { color: #3e4750; line-height: 1.35; }
.product-card-body em { color: var(--accent-strong); font-style: normal; font-weight: 900; margin-top: auto; }
.empty-gallery { grid-column: 1 / -1; background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 28px; color: var(--muted); text-align: center; }
.is-hidden { display: none !important; }
.product-dialog { width: min(920px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: 24px; padding: 0; color: var(--ink); box-shadow: var(--shadow); }
.product-dialog::backdrop { background: rgba(35, 43, 65, .38); }
.update-overlay { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: rgba(35, 43, 65, .38); }
.update-card { width: min(560px, calc(100vw - 32px)); background: #fff; border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); overflow: hidden; }
.update-dialog-body { grid-template-columns: 1fr; }
.update-card .placeholder-view { padding: 0; max-width: none; }
.update-card .dialog-actions { justify-content: flex-end; }
.dialog-head { padding: 18px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; align-items: start; }
.dialog-head p { margin: 6px 0 0; color: var(--muted); }
.dialog-body { padding: 18px; display: grid; grid-template-columns: minmax(240px, 340px) 1fr; gap: 18px; }
.detail-photo { min-height: 260px; background: #eef2f7; border: 1px solid var(--line); border-radius: 18px; display: grid; place-items: center; color: var(--muted); font-weight: 900; }
.detail-photo img { width: 100%; height: 100%; object-fit: contain; border-radius: 18px; }
.detail-list { margin: 0; display: grid; grid-template-columns: 150px 1fr; gap: 0; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.detail-list dt, .detail-list dd { margin: 0; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.detail-list dt { background: var(--panel-soft); font-weight: 900; color: #46536d; }
.detail-list dd { background: #fff; white-space: normal; }
.detail-list dt:last-of-type, .detail-list dd:last-of-type { border-bottom: 0; }
.dialog-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
.placeholder-view { padding: 28px; max-width: 720px; }
.placeholder-view p { color: var(--muted); line-height: 1.8; }
.option-panel { border: 1px solid var(--line); border-radius: 18px; padding: 12px; display: flex; gap: 12px 18px; flex-wrap: wrap; }
.option-panel legend { padding: 0 6px; color: #3b4662; font-weight: 800; font-size: 13px; }
.option-panel label { display: inline-flex; align-items: center; gap: 7px; font-weight: 500; }
.option-panel input { width: auto; }
.order-products { display: grid; gap: 10px; }
.mini-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.mini-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.product-picker { max-height: 390px; overflow: auto; }
.product-picker table { min-width: 920px; }
.product-picker input[type="number"] { width: 86px; }
input[readonly] { background: #f3f6fb; color: var(--muted); }
@media (max-width: 1180px) { .finance-visual-grid { grid-template-columns: 1fr; } }
@media (max-width: 980px) {
  .login-card { padding: 22px; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { align-items: stretch; }
  .nav-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-grid.two-column, .product-form, .order-form, .dialog-body, .invoice-columns { grid-template-columns: 1fr; }
  .order-overview-layout.is-split { grid-template-columns: 1fr; }
  .order-overview-layout.is-split .detail-heading { margin-top: 18px; }
  .dimension-group { grid-template-columns: 1fr repeat(3, minmax(58px, 1fr)); }
  .product-tools, .order-tools { justify-content: flex-start; }
  .donut-wrap { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .login-shell { padding: 14px; }
  .app-shell { padding: 10px; }
  .workspace, .sidebar { padding: 14px; }
  .topbar, .section-head { align-items: stretch; flex-direction: column; }
  .topbar-actions { width: 100%; }
  .secondary-button { flex: 1; }
  .nav-tabs { grid-template-columns: 1fr; }
  .product-pagination { align-items: stretch; flex-direction: column; }
  .pagination-actions { justify-content: space-between; }
}


.invoice-order-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
  margin: 0 0 14px;
}
.invoice-order-fields label {
  display: grid;
  gap: 6px;
  color: #46536d;
  font-size: 12px;
  font-weight: 900;
}
.invoice-order-fields input {
  width: 100%;
}
@media (max-width: 980px) {
  .invoice-order-fields { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .invoice-order-fields { grid-template-columns: 1fr; }
}

.quote-layout { align-items: start; }
.quote-form { margin-bottom: 16px; }
.quote-picker table { min-width: 760px; }
.quote-detail-panel table { min-width: 1760px; }
.quote-detail-panel .small-input { width: 96px; }
.quote-overview-layout { display: grid; grid-template-columns: minmax(360px, .75fr) minmax(520px, 1.25fr); gap: 16px; align-items: start; }
.quote-list-panel, .quote-overview-detail-panel { max-height: calc(100vh - 390px); min-height: 320px; overflow: auto; }
.quote-overview-detail { min-width: 0; }
.quote-overview-detail-panel table { min-width: 1320px; }
.quote-overview-detail-panel .small-input { width: 110px; }
