@font-face { font-family: "PriceGen Sukhumvit"; src: local("SukhumvitSet-Text"), local("Sukhumvit Set Text"); font-weight: 400; font-display: swap; }
@font-face { font-family: "PriceGen Sukhumvit"; src: local("SukhumvitSet-Medium"), local("Sukhumvit Set Medium"); font-weight: 500; font-display: swap; }
@font-face { font-family: "PriceGen Sukhumvit"; src: local("SukhumvitSet-SemiBold"), local("Sukhumvit Set Semi Bold"); font-weight: 600; font-display: swap; }
@font-face { font-family: "PriceGen Sukhumvit"; src: local("SukhumvitSet-Bold"), local("Sukhumvit Set Bold"); font-weight: 700 900; font-display: swap; }
:root {
  color-scheme: dark;
  --bg: #101313; --surface: #1c2223; --surface-soft: #293233; --border: #354242;
  --ink: #edf2f1; --muted: #a4b2b8; --accent: #287f72; --accent-dark: #83d5bd;
  --accent-light: #24483f; --danger: #f4a49e; --danger-soft: #3b2526;
  --radius: 24px; --radius-sm: 14px;
  font-family: "PriceGen Sukhumvit", "Sukhumvit Set", -apple-system, BlinkMacSystemFont, "Noto Sans Thai", "Segoe UI", sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
[hidden], .editor-panel, .edit-item { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body { margin: 0; min-height: 100dvh; background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.55; font-variant-numeric: tabular-nums; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
button:disabled { opacity: .5; cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--accent-dark); outline-offset: 3px; }
h1, h2, h3, p { margin-top: 0; }
h2 { margin-bottom: 14px; font-size: 20px; font-weight: 600; letter-spacing: -.02em; line-height: 1.4; }
.eyebrow { margin: 0 0 5px; font-size: 11px; font-weight: 600; letter-spacing: .08em; color: var(--accent-dark); }
.section-description { color: var(--muted); font-size: 13px; margin: -5px 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; left: 12px; top: -80px; padding: 12px 18px; z-index: 10; border-radius: 12px; background: var(--accent); }
.skip-link:focus { top: 10px; }
.app-header { background: #14191c; position: sticky; top: 0; z-index: 5; border-bottom: 1px solid #273033; }
.header-inner { display: flex; align-items: center; gap: 20px; justify-content: space-between; padding: 14px 20px; }
.brand-lockup { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-logo { width: 42px; height: 42px; object-fit: contain; border-radius: 10px; }
.app-header h1 { font-size: 26px; line-height: 1.15; margin: 0; font-weight: 600; letter-spacing: -.03em; }
.app-header .eyebrow { font-size: 9px; letter-spacing: .13em; }
.header-nav { display: flex; gap: 8px; }
.nav-link { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 18px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); font-weight: 600; font-size: 13px; }
.nav-link:hover { background: var(--accent-light); }
#quoteBadge { background: var(--accent-light); color: var(--accent-dark); border-radius: 8px; min-width: 22px; text-align: center; padding: 0 5px; }
.layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(280px, .8fr); align-items: start; gap: 14px; padding: 14px; width: 100%; }
.layout > *, .widget > *, .quote-workspace > *, .copy-panel > * { min-width: 0; }
.widget, .dialog-inner { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.quote-workspace, .copy-panel { display: grid; gap: 14px; align-content: start; }
.inventory-panel { min-width: 0; }
.section-title-row { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-title-row h2 { margin-bottom: 8px; }
.section-title-row .ghost-button { flex-shrink: 0; }
.toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.toolbar .search-field { flex: 1 1 190px; min-width: 0; }
.toolbar > label:not(.search-field) { flex: 1 1 130px; min-width: 0; }
#backCategoriesButton { flex: 1 1 130px; }
label { display: grid; gap: 6px; min-width: 0; }
label > span, .date-field > label { color: var(--muted); font-size: 12px; font-weight: 500; }
input, select, textarea { width: 100%; min-width: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 11px 12px; color: var(--ink); background: var(--surface-soft); min-height: 44px; outline-offset: 2px; }
input::placeholder, textarea::placeholder { color: #9aa9ad; opacity: 1; }
input[type="radio"] { width: 16px; height: 16px; min-height: 0; accent-color: var(--accent-dark); flex: none; }
textarea { resize: vertical; }
.search-wrap { position: relative; }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-wrap input { padding-left: 34px; }
.summary-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
.summary-cell { padding: 12px; min-width: 0; border: 1px solid var(--border); background: var(--surface-soft); border-radius: 18px; }
.summary-cell > svg { display: none; }
.summary-cell strong { display: block; font-size: 22px; font-weight: 600; line-height: 1.3; }
.summary-cell span { font-size: 11px; color: var(--muted); }
.category-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 10px; }
.category-tile { min-height: 120px; display: flex; flex-direction: column; align-items: start; justify-content: space-between; text-align: left; gap: 7px; padding: 15px; color: var(--ink); background: var(--surface-soft); border: 1px solid var(--border); border-radius: 18px; transition: border-color .18s, background .18s, transform .18s; }
.category-tile:hover { background: var(--accent-light); border-color: var(--accent-dark); transform: translateY(-2px); }
.category-tile:active { transform: translateY(0); }
.category-tile strong { font-size: 14px; font-weight: 600; }
.category-tile small { color: var(--muted); font-size: 10px; }
.category-icon { color: var(--accent-dark); width: 25px; height: 25px; }
.category-icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.equipment-list { display: grid; gap: 10px; }
.equipment-card { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; align-items: center; gap: 12px; position: relative; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 18px; padding: 12px; transition: background .18s, border-color .18s; }
.equipment-card:hover { border-color: #637d79; }
.equipment-card.is-selected { border-color: var(--accent-dark); background: var(--accent-light); }
.selected-check { display: none; }
.thumb { width: 58px; height: 58px; border-radius: 12px; overflow: hidden; display: grid; place-items: center; background: #354343; color: var(--accent-dark); font-size: 13px; font-weight: 600; }
.thumb img { width: 100%; height: 100%; object-fit: contain; background: #edf2f1; }
.equipment-info { min-width: 0; }
.item-topline h3 { font-size: 14px; line-height: 1.35; margin: 0; overflow-wrap: anywhere; font-weight: 600; }
.category-chip { display: inline-block; margin-top: 4px; font-size: 10px; color: var(--accent-dark); }
.item-meta, .item-notes { font-size: 11px; margin: 4px 0 0; color: var(--muted); }
.item-notes { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-notes:empty { display: none; }
.item-actions { display: flex; gap: 8px; }
.primary-button, .secondary-button, .ghost-button, .danger-button, .icon-button, .file-button, .text-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 9px 14px; border-radius: 14px; border: 1px solid var(--border); font-weight: 600; font-size: 13px; color: var(--ink); background: var(--surface-soft); transition: background .18s, border-color .18s, transform .12s; }
.primary-button { background: var(--accent); border-color: var(--accent); color: #fff; }
.primary-button:hover { background: #329381; }
.secondary-button:hover, .icon-button:hover, .file-button:hover { background: #354342; }
.ghost-button { color: var(--muted); border-color: transparent; background: transparent; }
.ghost-button:hover { color: var(--ink); background: var(--surface-soft); }
.danger-button { background: var(--danger-soft); color: var(--danger); border-color: #684044; }
button:active:not(:disabled) { transform: scale(.98); }
.wide { width: 100%; }
.job-details, .two-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.span-2 { grid-column: 1 / -1; }
.selected-items { display: grid; gap: 10px; max-height: 49dvh; overflow: auto; scrollbar-width: thin; padding: 2px; }
.selected-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 16px; padding: 12px; }
.selected-row-info strong { display: block; font-weight: 600; font-size: 13px; overflow-wrap: anywhere; }
.selected-row-info small { font-size: 11px; color: var(--muted); }
.stepper { display: flex; align-items: center; border: 1px solid #526361; border-radius: 12px; overflow: hidden; }
.stepper-btn { border: 0; background: transparent; color: var(--ink); width: 32px; height: 36px; }
.stepper-btn:hover { background: var(--accent-light); }
.stepper-value { min-width: 25px; text-align: center; font-size: 12px; }
.selected-row-line-total { color: var(--accent-dark); font-size: 13px; font-weight: 600; }
.remove-btn { justify-self: end; width: 32px; height: 32px; border-radius: 10px; border: 0; color: var(--muted); background: transparent; font-size: 20px; }
.remove-btn:hover { background: var(--danger-soft); color: var(--danger); }
.empty-state { color: var(--muted); border: 1px dashed #526361; background: #202829; border-radius: 16px; padding: 28px 18px; text-align: center; font-size: 13px; }
summary { cursor: pointer; font-size: 13px; font-weight: 500; }
.contact-widget > summary { font-size: 17px; font-weight: 600; }
.contact-widget > summary span { display: block; color: var(--muted); font-size: 11px; margin: 4px 0 0 18px; }
.client-block { min-width: 0; border: 0; padding: 16px 0 0; margin: 0; }
.client-block legend { color: var(--muted); font-size: 12px; padding: 0; margin-top: 16px; }
.client-type { display: flex; gap: 8px; margin-bottom: 14px; }
.client-type-option { display: flex; flex: 1; align-items: center; gap: 8px; padding: 10px; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 12px; cursor: pointer; }
.client-type-option:has(input:checked) { background: var(--accent-light); border-color: #578f7d; }
.client-type-option span { color: var(--ink); font-size: 11px; }
#productionFields { margin-top: 12px; }
.totals-display { margin: 16px 0; }
.totals-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin: 9px 0; color: var(--muted); font-size: 13px; }
.discount-value { color: var(--accent-dark); }
.grand-row { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 14px; align-items: baseline; color: var(--ink); }
.grand-row strong { color: var(--accent-dark); font-size: clamp(21px, 2vw, 30px); font-weight: 600; }
.empty-pricing { color: var(--muted); font-size: 13px; padding: 12px; background: var(--surface-soft); border-radius: 12px; }
.discount-details, .text-preview { border-top: 1px solid var(--border); padding-top: 14px; }
.discount-note { font-size: 12px; line-height: 1.8; color: var(--muted); margin: 12px 0 0; }
.text-output-label { margin-top: 12px; }
#copyOutput { font-size: 12px; line-height: 1.7; }
.copy-status { color: var(--accent-dark); font-size: 12px; margin: 10px 0; min-height: 18px; }
.date-field { display: grid; align-content: start; gap: 6px; min-width: 0; }
.date-trigger { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 44px; background: var(--surface-soft); color: var(--ink); border: 1px solid var(--border); border-radius: 14px; padding: 11px 12px; text-align: left; }
.date-trigger span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.date-trigger svg { flex: none; stroke: var(--accent-dark); stroke-width: 1.5; stroke-linecap: round; }
.date-trigger[aria-expanded="true"] { border-color: var(--accent-dark); }
.date-dialog { position: fixed; inset: auto; margin: 0; width: min(324px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto; background: var(--surface); color: var(--ink); border: 1px solid #58736c; border-radius: 20px; padding: 14px; box-shadow: 0 18px 55px #06100dbb; }
.date-dialog::backdrop { background: transparent; }
.date-picker-header { display: grid; grid-template-columns: 34px minmax(0, 1fr) 34px; gap: 8px; align-items: center; margin-bottom: 12px; }
.date-picker-header h2 { text-align: center; font-size: 16px; margin: 0; }
.date-picker-header button, .date-picker-footer button { background: var(--surface-soft); border: 1px solid var(--border); color: var(--ink); border-radius: 10px; min-height: 34px; }
.date-weekdays, .date-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.date-weekdays { text-align: center; color: var(--muted); font-size: 10px; margin-bottom: 6px; }
.date-day { min-height: 34px; border-radius: 10px; border: 1px solid transparent; background: var(--surface-soft); color: var(--ink); padding: 4px; font-size: 12px; }
.date-day.is-outside { color: #90a29e; background: transparent; }
.date-day[aria-current="date"] { border-color: #719c8f; }
.date-day[aria-pressed="true"] { background: var(--accent); color: #fff; }
.date-day:hover { background: var(--accent-light); }
.date-picker-footer { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 12px; font-size: 12px; }
.category-dialog, .confirm-dialog { border: 0; padding: 0; background: transparent; color: var(--ink); max-width: min(520px, calc(100vw - 24px)); }
dialog::backdrop { background: #050b0ba8; }
.dialog-actions { display: flex; gap: 10px; }
@media (min-width: 1440px) {
  .inventory-panel { position: sticky; top: 94px; max-height: calc(100dvh - 108px); overflow: auto; scrollbar-width: thin; }
  .copy-panel { position: sticky; top: 94px; }
}
@media (max-width: 1199px) {
  .layout { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
  .inventory-panel { grid-column: 1; grid-row: 1 / span 2; }
  .quote-workspace, .copy-panel { grid-column: 2; }
  .equipment-card { grid-template-columns: 52px minmax(0, 1fr); }
  .item-actions { grid-column: 1 / -1; }
  .item-actions .add-to-list { width: 100%; }
}
@media (max-width: 760px) {
  .header-inner { padding: 12px; gap: 12px; }
  .header-nav { gap: 6px; }
  .nav-link { padding: 8px 10px; font-size: 12px; }
  .app-header h1 { font-size: 22px; }
  .brand-logo { width: 34px; height: 34px; }
  .brand-lockup { gap: 8px; }
  .app-header .eyebrow { font-size: 8px; letter-spacing: .04em; }
  .layout { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 12px; }
  .inventory-panel, .quote-workspace, .copy-panel { grid-column: 1; grid-row: auto; }
  .widget { padding: 16px; border-radius: 22px; }
  .equipment-card { grid-template-columns: 58px minmax(0, 1fr) auto; }
  .item-actions { grid-column: auto; }
  .selected-items { max-height: none; }
}
@media (max-width: 420px) {
  .header-nav .nav-link:first-child { display: none; }
  .equipment-card { grid-template-columns: 48px minmax(0, 1fr); }
  .thumb { width: 48px; height: 48px; }
  .item-actions { grid-column: 1 / -1; }
  .job-details { grid-template-columns: minmax(0, 1fr); }
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
