/* BBG Service Window */
:root {
  --bg: #f4f5f7;
  --card: #fff;
  --ink: #1b1d22;
  --muted: #6b7280;
  --line: #e5e7eb;
  --side: #15171c;
  --side-ink: #c9ccd3;
  --accent: #f26b1d;
  --accent-dark: #d4560c;
  --accent-soft: #fff1e8;
  --ok: #16a34a;
  --ok-soft: #e8f7ee;
  --warn: #b45309;
  --warn-soft: #fff7e0;
  --bad: #dc2626;
  --bad-soft: #fdecec;
  --info-soft: #eaf2ff;
  --wa: #1fa855;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  font-size: 15px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); line-height: 1.5; }
a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
code { background: #f1f2f4; padding: 1px 5px; border-radius: 4px; font-size: .9em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.accent { color: var(--accent-dark); }
.text-danger { color: var(--bad); font-weight: 600; }
[hidden] { display: none !important; }

/* ---------- forms ---------- */
label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; font-weight: 600; color: #374151; margin-bottom: 12px; }
input, select, textarea {
  font: inherit; font-weight: 400; color: var(--ink);
  border: 1px solid #d1d5db; border-radius: 8px; padding: 9px 11px; background: #fff; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(242, 107, 29, .18); }
input:disabled { background: #f3f4f6; color: var(--muted); }
textarea { resize: vertical; }
.hint { font-weight: 400; font-size: .8rem; color: var(--muted); }
.hint.ok { color: var(--ok); font-weight: 600; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; margin: 0; }
label.check input { width: auto; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.form-card { max-width: 880px; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.inline-form input { flex: 1; min-width: 160px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600; font-size: .9rem; padding: 9px 16px; border-radius: 8px;
  border: 1px solid transparent; cursor: pointer; text-decoration: none !important; white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost { background: #fff; border-color: #d1d5db; color: var(--ink); }
.btn-ghost:hover { border-color: #9ca3af; }
.btn-danger { background: var(--bad); color: #fff; }
.btn-wa { background: var(--wa); color: #fff; }
.btn-wa:hover { background: #178a45; }
.btn-sm { padding: 6px 11px; font-size: .82rem; }
.btn-lg { padding: 12px 20px; font-size: 1rem; }
.btn-block { width: 100%; }

/* ---------- alerts / badges ---------- */
.alert { padding: 11px 14px; border-radius: 8px; margin-bottom: 14px; font-size: .9rem; border: 1px solid transparent; }
.alert-success { background: var(--ok-soft); color: #166534; border-color: #bbe5c9; }
.alert-error { background: var(--bad-soft); color: #991b1b; border-color: #f5c2c2; }
.alert-warning { background: var(--warn-soft); color: #92400e; border-color: #f4dfa1; }
.alert-info { background: var(--info-soft); color: #1e40af; border-color: #c9dbff; }
.badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; vertical-align: middle; white-space: nowrap; }
.badge-stage { background: var(--accent-soft); color: var(--accent-dark); }
.badge-closed { background: var(--ok-soft); color: #166534; }
.badge-cancelled { background: #eceef1; color: #4b5563; }
.badge-prio-high { background: var(--warn-soft); color: var(--warn); }
.badge-prio-urgent { background: var(--bad-soft); color: var(--bad); }
.pill { font-size: .72rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: .03em; }
.pill-done { background: var(--ok-soft); color: #166534; }
.pill-current { background: var(--accent); color: #fff; }
.pill-pending { background: #eceef1; color: #6b7280; }
.pill-skipped { background: #eceef1; color: #6b7280; }
.pill-cancelled { background: var(--bad-soft); color: var(--bad); }
.stars { color: #f59e0b; letter-spacing: 1px; }
.stars .off { color: #d1d5db; }

/* ---------- app shell ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 236px; background: var(--side); color: var(--side-ink); position: fixed; inset: 0 auto 0 0;
  display: flex; flex-direction: column; z-index: 20; transition: transform .2s;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 22px; color: #fff; text-decoration: none !important; }
.brand span { display: flex; flex-direction: column; line-height: 1.15; font-size: 1.05rem; }
.brand small { color: #9aa0aa; font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; }
.brand-logo { display: block; height: auto; background: #fff; border-radius: 10px; padding: 6px 10px; box-sizing: content-box; }
.sidebar .brand { flex-direction: column; align-items: flex-start; gap: 8px; }
.sidebar .brand-logo { width: 150px; }
.brand .brand-sub { color: #9aa0aa; font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; padding-left: 2px; }
.public-top .brand-logo { width: 104px; padding: 4px 8px; border-radius: 8px; }
.sidebar nav { display: flex; flex-direction: column; padding: 0 10px; gap: 2px; flex: 1; }
.sidebar nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 8px; color: var(--side-ink); font-weight: 500; text-decoration: none; }
.sidebar nav a:hover { background: #22252c; color: #fff; }
.sidebar nav a.active { background: var(--accent); color: #fff; }
.sidebar-foot { padding: 16px 18px; font-size: .82rem; border-top: 1px solid #262931; }
.sidebar-foot a { color: #9aa0aa; }
.main { flex: 1; margin-left: 236px; min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: 16px; padding: 12px 28px; background: #fff;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10;
}
.topbar h1 { font-size: 1.15rem; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-search { flex: 1; max-width: 420px; margin-left: auto; }
.top-search input { background: #f4f5f7; border-color: transparent; }
.user { display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-dark); display: grid; place-items: center; font-weight: 700; }
.menu-btn { display: none; background: none; border: 0; font-size: 1.4rem; cursor: pointer; }
.content { padding: 24px 28px 60px; max-width: 1320px; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px; }
.card-head { margin-bottom: 14px; }
.card-head.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-head h2 { display: flex; align-items: center; gap: 10px; }
.section-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 20px 0 10px; }
.empty { padding: 30px; text-align: center; color: var(--muted); }

/* ---------- dashboard ---------- */
.welcome { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.welcome h2 { font-size: 1.4rem; margin: 0; }
.welcome p { margin: 2px 0 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 8px; }
.kpi { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; display: flex; flex-direction: column; color: var(--ink); text-decoration: none !important; }
.kpi-label { font-size: .78rem; color: var(--muted); font-weight: 600; }
.kpi-val { font-size: 1.55rem; font-weight: 800; letter-spacing: -.01em; }
.kpi-sub { font-size: .75rem; color: var(--muted); }
.kpi-alert { background: var(--bad-soft); }
.kpi-alert .kpi-val { color: var(--bad); }
.pipeline { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.pipe {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; color: var(--ink);
  display: flex; flex-direction: column; gap: 4px; text-decoration: none !important; border-top: 4px solid var(--accent);
  position: relative; transition: transform .12s;
}
.pipe:hover { transform: translateY(-2px); }
.pipe-n { font-size: .72rem; font-weight: 800; color: var(--muted); }
.pipe-label { font-size: .85rem; font-weight: 600; min-height: 2.5em; }
.pipe-count { font-size: 1.8rem; font-weight: 800; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -20px; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 20px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 20px; border-bottom: 1px solid #f0f1f3; vertical-align: top; }
.table tr[data-href] { cursor: pointer; }
.table tbody tr:hover { background: #fafafa; }
.table tr.inactive td { opacity: .55; }
.table td.actions { display: flex; gap: 6px; justify-content: flex-end; }
.table td.actions form { margin: 0; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; padding: 14px; }
.filters input { flex: 1; min-width: 220px; }
.filters select { width: auto; }
.pager { display: flex; gap: 16px; justify-content: center; padding-top: 14px; font-size: .9rem; }

/* ---------- ticket page ---------- */
.ticket-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.ticket-no { font-size: 1.5rem; font-weight: 800; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ticket-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.ticket-side .card { padding: 16px; }
.ticket-side h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ticket-side p { margin: 0 0 10px; }
.ticket-side select, .ticket-side .inline-form select { width: 100%; }

.stepper { list-style: none; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); padding: 16px 12px; margin: 0 0 18px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
.step { position: relative; text-align: center; }
.step a { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--muted); text-decoration: none !important; font-size: .76rem; font-weight: 600; padding: 0 4px; }
.step::before { content: ""; position: absolute; top: 15px; left: -50%; width: 100%; height: 3px; background: var(--line); z-index: 0; }
.step:first-child::before { display: none; }
.step .dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 2px solid #d1d5db; font-weight: 800; z-index: 1; position: relative; }
.step-done::before, .step-current::before, .step-skipped::before { background: var(--accent); }
.step-done .dot { background: var(--accent); border-color: var(--accent); color: #fff; }
.step-done a { color: var(--ink); }
.step-current .dot { border-color: var(--accent); color: var(--accent-dark); box-shadow: 0 0 0 5px var(--accent-soft); }
.step-current a { color: var(--accent-dark); }
.step-skipped .dot { background: #eceef1; border-color: #d1d5db; color: #9ca3af; }
.step-cancelled .dot { border-color: var(--bad); color: var(--bad); }

.stage-card { border-left: 4px solid transparent; scroll-margin-top: 80px; }
.stage-card.stage-current { border-left-color: var(--accent); }
.stage-card.stage-done { border-left-color: var(--ok); }
.stage-card.stage-pending, .stage-card.stage-skipped { padding: 14px 20px; }
.stage-card.stage-pending .stage-head, .stage-card.stage-skipped .stage-head { margin-bottom: 4px; }
.stage-card.stage-pending h2, .stage-card.stage-skipped h2 { color: var(--muted); font-size: 1rem; }
.stage-card.stage-pending p, .stage-card.stage-skipped p { margin: 0; font-size: .85rem; }
.stage-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.stage-head h2 { display: flex; align-items: center; gap: 10px; margin: 0; }
.step-num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-dark); font-size: .8rem; font-weight: 800; flex: none; }
.stage-done .step-num { background: var(--ok-soft); color: var(--ok); }
.dl { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; margin: 0 0 10px; font-size: .9rem; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; word-break: break-word; }
.quote { background: #f8f8fa; border-left: 3px solid #d1d5db; padding: 8px 12px; margin-bottom: 14px; font-style: italic; color: #4b5563; }
details > summary { cursor: pointer; font-weight: 600; font-size: .85rem; color: var(--accent-dark); margin: 6px 0; }
details.edit, details.skip, details.optional { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 6px; }
details.edit[open] { background: #fafafa; margin: 10px -20px -20px; padding: 6px 20px 20px; border-radius: 0 0 var(--radius) var(--radius); }
details.skip summary { color: var(--muted); }
.danger-link { color: var(--bad) !important; }
.photos { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.photos img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }

.notify-box { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 8px 0 14px; background: #fcfcfd; }
.notify-head { font-weight: 700; font-size: .85rem; margin-bottom: 8px; }
.notify-box textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; background: #fff; }
.notify-channels { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 10px; font-size: .88rem; }
.notify-box .hint { margin: 8px 0 0; }
.notif-list { list-style: none; padding: 0; margin: 6px 0; font-size: .88rem; }
.notif-list li { padding: 6px 0; border-bottom: 1px solid #f0f1f3; }
.notif-list pre { white-space: pre-wrap; background: #f8f8fa; padding: 10px; border-radius: 8px; font-size: .8rem; }
.chan { font-size: .7rem; font-weight: 800; padding: 2px 7px; border-radius: 5px; text-transform: uppercase; }
.chan-whatsapp { background: #e3f6ea; color: #15803d; }
.chan-email { background: var(--info-soft); color: #1d4ed8; }

.timeline { list-style: none; padding: 0; margin: 12px 0 0; font-size: .85rem; max-height: 520px; overflow: auto; }
.timeline li { padding: 8px 0 8px 14px; border-left: 2px solid var(--line); position: relative; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 13px; width: 8px; height: 8px; border-radius: 50%; background: #d1d5db; }
.timeline li.tl-completed::before { background: var(--ok); }
.timeline li.tl-note::before { background: var(--accent); }
.timeline li.tl-cancelled::before { background: var(--bad); }
.tl-note { background: #f8f8fa; padding: 6px 8px; border-radius: 6px; margin: 4px 0; white-space: pre-wrap; }
.note-form textarea { margin-bottom: 6px; }

.star-input { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; }
.star-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star-input label { font-size: 1.8rem; color: #d1d5db; cursor: pointer; margin: 0; line-height: 1; transition: color .1s; }
.star-input label:hover, .star-input label:hover ~ label, .star-input input:checked ~ label { color: #f59e0b; }
.star-input input:focus-visible + label { outline: 2px solid var(--accent); border-radius: 4px; }
.star-input.big label { font-size: 2.8rem; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(circle at 30% 20%, #2a2d35, #111317); padding: 20px; }
.auth-card { width: 100%; max-width: 380px; background: #fff; border-radius: 16px; padding: 32px; box-shadow: 0 20px 50px rgba(0, 0, 0, .35); }
.auth-card h1 { font-size: 1.4rem; margin: 14px 0 2px; }
.auth-card > p { margin-top: 0; }
.auth-logo { display: block; width: 170px; height: auto; }

/* ---------- public pages ---------- */
.public { background: #f4f5f7; min-height: 100vh; display: flex; flex-direction: column; }
.public-top { background: var(--side); padding: 6px 20px; }
.public-top .brand { padding: 10px 0; }
.public-main { flex: 1; width: 100%; max-width: 620px; margin: 0 auto; padding: 28px 16px; }
.public-card { background: #fff; border-radius: 16px; box-shadow: var(--shadow); padding: 26px; margin-bottom: 18px; }
.public-card h1 { font-size: 1.4rem; }
.track-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; }
.track-form .btn { margin-bottom: 12px; height: 41px; }
.track-head { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.vtrack { list-style: none; padding: 0; margin: 0 0 16px; }
.vtrack li { display: flex; gap: 14px; padding: 0 0 18px; position: relative; }
.vtrack li::before { content: ""; position: absolute; left: 8px; top: 20px; bottom: 0; width: 2px; background: var(--line); }
.vtrack li:last-child::before { display: none; }
.vtrack .dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #d1d5db; background: #fff; flex: none; margin-top: 2px; z-index: 1; }
.vtrack .v-done .dot { background: var(--accent); border-color: var(--accent); }
.vtrack .v-done::before { background: var(--accent); }
.vtrack .v-current .dot { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.vtrack .v-pending { color: var(--muted); }
.review-card { text-align: center; }
.review-card form { text-align: left; }
.review-card .star-input { display: flex; justify-content: center; margin: 10px 0 18px; }
.public-foot { text-align: center; padding: 20px; font-size: .85rem; color: #4b5563; }

/* ---------- job card print ---------- */
.print { background: #e5e7eb; padding: 20px; }
.print-actions { max-width: 800px; margin: 0 auto 12px; text-align: right; }
.jobcard { background: #fff; max-width: 800px; margin: 0 auto; padding: 32px; font-size: 13px; }
.jobcard header { display: flex; justify-content: space-between; border-bottom: 3px solid var(--accent); padding-bottom: 14px; margin-bottom: 16px; }
.jobcard .brand { color: var(--ink); padding: 0; align-items: flex-start; }
.jobcard .right { text-align: right; }
.jobcard h1 { font-size: 1rem; letter-spacing: .1em; margin: 0; }
.jc-no { font-size: 1.4rem; font-weight: 800; color: var(--accent-dark); }
table.jc { width: 100%; border-collapse: collapse; }
table.jc th, table.jc td { border: 1px solid #d1d5db; padding: 7px 9px; text-align: left; vertical-align: top; }
table.jc th { background: #f8f8fa; width: 16%; font-weight: 600; }
.jc-track { background: var(--accent-soft); padding: 8px 12px; border-radius: 6px; }
.jc-terms { color: #4b5563; font-size: 12px; padding-left: 18px; }
.sign { display: flex; justify-content: space-between; margin-top: 60px; }
.sign div { border-top: 1px solid #9ca3af; padding-top: 6px; width: 40%; text-align: center; }
@media print {
  .print { background: #fff; padding: 0; }
  .print-actions { display: none; }
  .jobcard { padding: 0; max-width: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .pipeline { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ticket-layout { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); }
  .nav-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .4); }
  .main { margin-left: 0; }
  .menu-btn { display: block; }
  .topbar { padding: 10px 14px; flex-wrap: wrap; }
  .top-search { order: 5; max-width: none; flex-basis: 100%; }
  .uname { display: none; }
  .content { padding: 16px 14px 60px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stepper { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 14px; }
  .step:nth-child(5)::before { display: none; }
  .dl { grid-template-columns: 110px 1fr; }
  .track-form, .track-head { grid-template-columns: 1fr; }
  .track-form .btn { margin: 0; }
}

/* ---------- catalogue ---------- */
.catalog-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.head-actions form { margin: 0; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 18px; }
.product-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; color: var(--ink); text-decoration: none !important; display: flex; flex-direction: column; transition: transform .12s, box-shadow .12s; }
.product-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(16, 24, 40, .12); }
.product-card.inactive { opacity: .55; }
.pc-img { aspect-ratio: 1; background: #f7f7f8; position: relative; }
.pc-img img { width: 100%; height: 100%; object-fit: contain; }
.pc-flag { position: absolute; top: 8px; left: 8px; background: #374151; color: #fff; font-size: .68rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; }
.pc-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.pc-cat { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.pc-name { font-weight: 700; font-size: .9rem; line-height: 1.3; }
.pc-meta, .pc-stats { display: flex; gap: 8px; flex-wrap: wrap; font-size: .78rem; color: var(--muted); }
.pc-meta span:last-child { color: var(--ink); font-weight: 600; }
.pc-stats { margin-top: auto; padding-top: 6px; }
.pc-stats span { background: #f3f4f6; padding: 1px 7px; border-radius: 5px; }
.pc-stats .hot { background: var(--accent-soft); color: var(--accent-dark); }
.product-hero { display: grid; grid-template-columns: 220px 1fr; gap: 20px; }
.hero-img img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #f7f7f8; border-radius: 10px; border: 1px solid var(--line); }
.file-btn { display: inline-block; cursor: pointer; color: var(--accent-dark); font-size: .82rem; margin: 6px 0 0; }
.file-btn input { display: none; }
.desc-text { white-space: pre-line; color: #374151; font-size: .88rem; max-height: 260px; overflow: auto; }
.gallery { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.gallery img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.v-thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; }
.span-2 { grid-column: 1 / -1; }
.product-preview { display: flex; gap: 12px; align-items: center; padding: 10px; border: 1px dashed var(--line); border-radius: 10px; margin: -4px 0 12px; }
.product-preview img { width: 64px; height: 64px; object-fit: contain; background: #f7f7f8; border-radius: 8px; }

/* ---------- attachments ---------- */
.files { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.file { position: relative; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.file-thumb { display: grid; place-items: center; aspect-ratio: 4 / 3; background: #f7f7f8; text-decoration: none !important; }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-thumb span { font-size: 2rem; }
.file-meta { padding: 6px 8px; display: flex; flex-direction: column; }
.file-meta a { font-size: .82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.file-del { position: absolute; top: 4px; right: 4px; margin: 0; }
.link-btn { background: rgba(0, 0, 0, .55); color: #fff; border: 0; width: 22px; height: 22px; border-radius: 50%; cursor: pointer; line-height: 1; font-size: 15px; }
.file:not(:hover) .file-del { opacity: 0; }
.attach-form { margin-top: 10px; }
.ticket-side .files { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.product-side .ps-top { display: flex; gap: 10px; align-items: flex-start; color: var(--ink); text-decoration: none !important; }
.product-side .ps-top img { width: 72px; height: 72px; object-fit: contain; background: #f7f7f8; border-radius: 8px; border: 1px solid var(--line); flex: none; }
.product-side .ps-top span { display: flex; flex-direction: column; gap: 2px; }
.ps-meta { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; color: var(--muted); }
.ps-links { display: flex; gap: 12px; flex-wrap: wrap; align-items: baseline; font-size: .85rem; }
.ps-links details { flex-basis: 100%; }
.mt { margin-top: 16px; }
@media (max-width: 860px) {
  .product-hero { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- product picker ---------- */
.picker-box { position: relative; }
.picker-box input { padding-right: 34px; }
.picker-clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: #eceef1; color: #4b5563; width: 24px; height: 24px; border-radius: 50%; cursor: pointer; font-size: 16px; line-height: 1; }
.picker-results {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); max-height: 380px; overflow-y: auto;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(16, 24, 40, .18); padding: 4px;
}
.pr-item { display: flex; gap: 12px; align-items: center; padding: 7px 9px; border-radius: 8px; cursor: pointer; font-weight: 400; }
.pr-item.active, .pr-item:hover { background: var(--accent-soft); }
.pr-item img { width: 44px; height: 44px; object-fit: contain; background: #f7f7f8; border-radius: 6px; flex: none; }
.pr-text { min-width: 0; }
.pr-name { font-weight: 700; font-size: .9rem; color: var(--ink); }
.pr-sub { font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr-sub code { font-size: .78rem; }
.pr-empty { padding: 12px; color: var(--muted); font-size: .88rem; font-weight: 400; }
.picker-selected { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin: -2px 0 14px; background: #fcfcfd; }
.ps-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 6px; }
.ps-head img { width: 84px; height: 84px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 10px; flex: none; }
.ps-variant { margin: 4px 0; display: flex; gap: 8px; align-items: center; }
.ps-variant code { font-size: .85rem; background: var(--accent-soft); color: var(--accent-dark); padding: 2px 8px; border-radius: 6px; }
.attr-row { display: grid; grid-template-columns: 130px 1fr; gap: 10px; align-items: start; padding: 8px 0; border-top: 1px solid #f0f1f3; }
.attr-name { font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding-top: 7px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: inherit; font-size: .85rem; padding: 6px 12px; border-radius: 999px; border: 1px solid #d1d5db; background: #fff; cursor: pointer; color: var(--ink); }
.chip:hover { border-color: var(--accent); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.chip.na { color: #b8bcc4; border-style: dashed; }
@media (max-width: 860px) { .attr-row { grid-template-columns: 1fr; gap: 4px; } }

/* ---------- product service summary ---------- */
.svc-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 4px 0 12px; }
.svc-stats div { background: #f7f7f8; border-radius: 10px; padding: 10px; font-size: .75rem; color: var(--muted); font-weight: 600; }
.svc-stats span { display: block; font-size: 1.3rem; font-weight: 800; color: var(--ink); }
.svc-stats .hot { background: var(--accent-soft); }
.svc-stats .hot span { color: var(--accent-dark); }
.top-issues { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.top-issues .pill { text-transform: none; letter-spacing: 0; font-size: .78rem; }
details.variants > summary { list-style: none; display: flex; align-items: center; gap: 8px; color: var(--ink); }
details.variants > summary::before { content: '▸'; color: var(--muted); }
details.variants[open] > summary::before { content: '▾'; }
details.variants > summary h3 { margin: 0; }
details.variants[open] > summary { margin-bottom: 12px; }
.product-hero { grid-template-columns: 180px 1fr; }
@media (max-width: 860px) { .svc-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.nowrap { white-space: nowrap; }
