:root {
  --boss-red: #e11d2e;
  --boss-red-hover: #c41122;
  --boss-pink: #fb7185;
  --boss-ink: #111827;
  --boss-muted: #6b7280;
  --boss-line: #e8eaed;
  --boss-wash: #fff;
  --bg: #fff;
  --panel: #fff;
  --panel-2: #fff;
  --panel-3: #f9fafb;
  --surface: #fff;
  --surface-2: #f9fafb;
  --border: #e8eaed;
  --border-2: #e5e7eb;
  --text: #111827;
  --text-2: #6b7280;
  --text-3: #9ca3af;
  --accent: #e11d2e;
}

html,
body,
body.bg-electrolux-dark,
body.bg-gray-50,
body.bg-\[\#0f172a\] {
  background-color: #fff !important;
  color: var(--boss-ink) !important;
}

/* Customer Figma "Homepage 11": the frame's linear-gradient(#DC2626 -> #000)
   under Rectangle 71, Figma's own BOSS wordmark image tiled at 10% opacity
   (see img/boss-watermark.svg). Fixed so the fade spans the viewport, not the
   full scroll height, and the pattern lines up with the frame's top-left. */
.boss-watermark,
body.boss-watermark {
  background-color: #000 !important;
  background-image:
    url("../img/boss-watermark.svg?v=20261016d"),
    linear-gradient(180deg, #dc2626 0%, #000 100%);
  background-repeat: repeat, no-repeat;
  background-attachment: fixed, fixed;
}
html:has(body.boss-watermark) {
  background-color: #000 !important;
}

.boss-login {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.boss-card {
  width: 100%;
  max-width: 26rem;
  background: #fff;
  border-radius: 1.25rem;
  box-shadow: 0 20px 50px rgba(17, 24, 39, 0.12);
  padding: 2.25rem 2rem 1.75rem;
}

.boss-card h1,
.boss-card h2 {
  margin: 0;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--boss-ink);
  letter-spacing: -0.02em;
}

.boss-card .boss-sub {
  margin: 0.5rem 0 1.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--boss-muted);
}

.boss-field {
  position: relative;
  margin-bottom: 0.75rem;
}

.boss-field .material-symbols-outlined {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.15rem;
  color: #9ca3af;
  pointer-events: none;
}

.boss-field .boss-field-rule {
  position: absolute;
  left: 2.35rem;
  top: 50%;
  width: 1px;
  height: 1.1rem;
  background: #e5e7eb;
  transform: translateY(-50%);
  pointer-events: none;
}

.boss-field .boss-eye {
  position: absolute;
  /* #136: the icon stays the same size and position; the invisible tap box
     around it grows to the WCAG 2.5.8 AA minimum (was ~19x19px). Nothing is
     drawn at the button's own edges, so this has no visual effect. */
  right: 0.25rem;
  top: 50%;
  width: 2.5rem;
  height: 2.5rem;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: none;
  color: #9ca3af;
  cursor: pointer;
}

.boss-field .boss-eye .material-symbols-outlined {
  position: static;
  left: auto;
  top: auto;
  transform: none;
  font-size: 1.2rem;
  pointer-events: none;
}

.boss-field input,
.boss-field select {
  width: 100%;
  height: 3rem;
  border: 1px solid var(--boss-line);
  border-radius: 9999px;
  padding: 0 1rem 0 2.85rem;
  font-size: 0.9rem;
  color: var(--boss-ink);
  background: #fff;
  outline: none;
}

.boss-field:has(.boss-eye) input {
  padding-right: 2.6rem;
}

.boss-field input:focus,
.boss-field select:focus {
  border-color: var(--boss-red);
  box-shadow: 0 0 0 3px rgba(225, 29, 46, 0.12);
}

.boss-field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%239ca3af' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 6l3.5 4 3.5-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.4rem;
}

.boss-btn {
  width: 100%;
  height: 3rem;
  margin-top: 0.5rem;
  border: 0;
  border-radius: 9999px;
  background: var(--boss-red);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(225, 29, 46, 0.28);
}

.boss-btn:hover {
  background: var(--boss-red-hover);
}

.boss-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

button.boss-help {
  background: none;
  border: 0;
  width: 100%;
  cursor: pointer;
  font: inherit;
}

.boss-help {
  display: block;
  margin-top: 0.35rem;
  /* #136: padding instead of a taller margin-top keeps the same visual gap
     above the link while growing its own tap height past the text line height
     alone (was ~19px) to the WCAG 2.5.8 AA minimum. */
  padding: 0.7rem 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--boss-muted);
  text-decoration: underline;
}

.boss-error {
  color: var(--boss-red);
  font-size: 0.8rem;
  text-align: center;
  margin: 0.5rem 0 0;
}

header,
header.bg-electrolux-blue,
header.bg-electrolux-blue\/95,
header.bg-gradient-to-b,
.topbar {
  background: #fff !important;
  border-bottom: 1px solid var(--boss-line) !important;
  color: var(--boss-ink) !important;
}

header .text-white,
header .text-gray-300,
.topbar .title {
  color: var(--boss-ink) !important;
}

header .text-gray-400 {
  color: var(--boss-muted) !important;
}

.bg-accent-teal {
  background-color: var(--boss-red) !important;
}

.text-accent-teal {
  color: var(--boss-red) !important;
}

.bg-accent-teal\/10 {
  background-color: rgba(225, 29, 46, 0.1) !important;
}

.border-accent-teal\/20 {
  border-color: rgba(225, 29, 46, 0.2) !important;
}

.boss-nav-wrap {
  background: #111827;
}
.boss-nav-link,
.boss-nav > a,
.boss-nav > span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #d1d5db !important;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.35rem 0.7rem;
  border-radius: 0.5rem;
  white-space: nowrap;
  text-decoration: none;
}
.boss-nav a:hover {
  color: #fff !important;
}
.boss-nav .boss-nav-active,
.boss-nav span.boss-nav-active {
  color: var(--boss-red) !important;
  font-weight: 700;
}

/* Staff header: one dark bar under the Organisation banner. Links scroll
   sideways on narrow screens; identity and account actions stay pinned right. */
.boss-staff-header {
  position: sticky;
  top: var(--org-banner-h, 0px);
  z-index: 40;
  /* Opt out of the global white `header` rule above (it drew a light line under the bar). */
  background: transparent !important;
  border-bottom: 0 !important;
}
.boss-nav-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
}
.boss-nav-scroll {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  align-items: center;
  gap: 0.25rem;
  padding: 0.4rem 28px 0.4rem 0;
  overflow-x: auto;
  scrollbar-width: none;
  /* Fade the trailing 28px so a clipped row reads as "scroll for more". The 28px
     right padding above keeps the last link out of the fade at full scroll;
     change both together. */
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
}
.boss-nav-scroll::-webkit-scrollbar {
  display: none;
}
.boss-nav-tools {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.375rem;
}
.boss-nav-tools .hidden {
  display: none !important;
}
.boss-org-name {
  max-width: 160px;
  overflow: hidden;
  color: #e5e7eb;
  font-size: 0.75rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* The banner is the organisation mark, so the nav does not repeat a name. */
body:has([data-organisation-banner]) .boss-org-name {
  display: none !important;
}
.boss-role-pill {
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: var(--boss-red);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.boss-scope-text {
  display: block;
  max-width: 160px;
  overflow: hidden;
  color: #d1d5db;
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.boss-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: #d1d5db;
  cursor: pointer;
}
.boss-icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
#logout-btn.boss-icon-btn:hover {
  color: var(--boss-pink);
}
.boss-icon-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 1px;
}
/* Inset: the scrolling row clips anything drawn outside a link. */
.boss-nav-scroll a:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -2px;
}
/* Phones: hide the Organisation name and the Supervisor 2 / filter scope so the
   links keep their width; the role pill still shows the signed-in role. */
@media (max-width: 639px) {
  .boss-org-name,
  .boss-scope-text {
    display: none !important;
  }
  .boss-nav-scroll {
    gap: 0;
  }
  .boss-nav > a,
  .boss-nav > span {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
}

.glass-card {
  background: #fff;
  border: 1px solid var(--boss-line) !important;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
  border-radius: 1rem;
}
.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.pipeline-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid transparent;
}
.pipeline-icon--target { background: linear-gradient(135deg, #eff6ff, #fff); color: #011e41; border-color: #dbeafe; }
.pipeline-icon--sellout { background: linear-gradient(135deg, #ecfdf5, #fff); color: #059669; border-color: #d1fae5; }
.pipeline-icon--map { background: linear-gradient(135deg, #fff7ed, #fff); color: #d97706; border-color: #fed7aa; }
.pipeline-icon--commission { background: linear-gradient(135deg, #f5f3ff, #fff); color: #7c3aed; border-color: #ddd6fe; }
.pipeline-icon--shop { background: linear-gradient(135deg, #ecfeff, #fff); color: #0e7490; border-color: #a5f3fc; }
.pipeline-icon--focus { background: linear-gradient(135deg, #fdf2f8, #fff); color: #db2777; border-color: #fbcfe8; }

#hero-section {
  background: transparent !important;
  border: 0 !important;
}
#hero-section.hidden {
  display: none !important;
}
.boss-hero {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: #111827 !important;
  color: #fff !important;
  border: 0 !important;
  border-radius: 1.25rem;
  padding: 1.25rem 1.75rem;
  width: min(100%, 29rem);
  min-width: 0;
  box-sizing: border-box;
  box-shadow: none;
}
.boss-hero p,
.boss-hero #hero-pct,
.boss-hero #hero-target,
.boss-hero #hero-current {
  color: #fff !important;
  background: none !important;
  -webkit-text-fill-color: #fff;
}
#hero-pct {
  font-size: 2.75rem !important;
  font-weight: 800 !important;
  letter-spacing: -0.04em;
  line-height: 1;
  color: #fff !important;
  -webkit-text-fill-color: #fff;
  margin: 0;
  flex: 0 0 auto;
}
.boss-hero-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 0.75rem;
  width: 100%;
  min-width: 0;
}
.boss-hero-stats {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr);
  align-items: stretch;
  column-gap: 1rem;
  width: 100%;
  min-width: 0;
}
.boss-hero-stat {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.boss-hero-label,
.boss-hero-value {
  margin: 0;
  white-space: nowrap;
}
.boss-hero-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.6;
}
.boss-hero-value {
  font-size: 0.95rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-family: "Segoe UI", "Leelawadee UI", "Noto Sans Thai", Tahoma, sans-serif;
}
.boss-hero-divider {
  width: 1px;
  align-self: stretch;
  background: rgba(255, 255, 255, 0.22);
}

@media (max-width: 639px) {
  .boss-hero {
    padding: 1rem 1.25rem;
  }
  #hero-pct {
    font-size: 2.5rem !important;
  }
  .boss-hero-stats {
    column-gap: 0.75rem;
  }
  .boss-hero-value {
    font-size: 0.8rem;
  }
}

#overall-section { display: none !important; }

#kpi-section .boss-kpi {
  background: #fff;
  border: 1px solid var(--boss-line);
  border-radius: 1rem;
  padding: 0.9rem 1rem;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
}
#kpi-section .boss-kpi .material-symbols-outlined {
  color: var(--boss-red);
}

#export-btn,
.pipeline-btn {
  background: var(--boss-red) !important;
  color: #fff !important;
  border: 0 !important;
  border-radius: 9999px !important;
  box-shadow: none !important;
}
#export-feedback-btn {
  background: #fff !important;
  color: #111827 !important;
  border: 1px solid var(--boss-line) !important;
  border-radius: 9999px !important;
}

#time-progress-bar {
  background: #fff !important;
  border: 1px solid var(--boss-line) !important;
  border-radius: 0.75rem;
  color: #6b7280 !important;
  padding: 0.5rem 0.75rem !important;
  box-shadow: none;
}
#time-progress-bar .text-white,
#time-progress-bar .text-gray-300 {
  color: #111827 !important;
}
#time-progress-bar .bg-gray-700\/60 {
  background: #e5e7eb !important;
}
#time-progress-bar .bg-accent-teal {
  background: var(--boss-red) !important;
}

#insight-pane h3,
#insight-pane .text-gray-300,
#insight-pane .text-white,
#insight-pane .text-gray-200,
#insight-pane-v2 .text-white,
#insight-pane-v2 .text-gray-300 {
  color: #111827 !important;
}
#filter-pane {
  background: #fff !important;
  border: 1px solid var(--boss-line) !important;
  border-radius: 1rem !important;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
  color: #111827;
}
#insight-pane .bg-white\/5,
#insight-pane .card-select,
#insight-pane-v2 > div {
  background: #fff !important;
  border: 1px solid var(--boss-line) !important;
  border-radius: 1rem !important;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
  color: #111827;
}
#insight-pane .bg-gray-700 {
  background: #e5e7eb !important;
}

#empty-message,
#empty-state p {
  color: #6b7280 !important;
}

.card-select:hover {
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.08) !important;
}

.boss-pct {
  color: var(--boss-red) !important;
}

.bg-white\/5,
.bg-white\/10 {
  background: #fff !important;
  border-color: var(--boss-line) !important;
}

body.boss-watermark .text-white,
body.boss-watermark .text-gray-100,
body.boss-watermark .text-gray-200,
body.boss-watermark .text-blue-100,
body.boss-watermark .hover\:text-white:hover {
  color: var(--boss-ink) !important;
}
body.boss-watermark .text-gray-300,
body.boss-watermark .text-gray-400,
body.boss-watermark .text-gray-500,
body.boss-watermark .text-blue-200,
body.boss-watermark .text-blue-300,
body.boss-watermark .text-slate-300,
body.boss-watermark .text-slate-400,
body.boss-watermark .text-indigo-200,
body.boss-watermark .text-amber-200 {
  color: var(--boss-muted) !important;
}
body.boss-watermark .placeholder-gray-400::placeholder,
body.boss-watermark .placeholder-gray-500::placeholder {
  color: #9ca3af;
}
body.boss-watermark :is(
  .text-white.bg-accent-teal,
  .text-white.bg-green-500,
  .text-white.bg-green-600,
  .text-white.bg-red-500,
  .text-white.bg-red-600,
  .text-white.bg-emerald-500,
  .text-white.bg-emerald-600,
  .text-white.bg-gray-600,
  .text-white.from-accent-teal,
  .text-white.from-emerald-500,
  .text-white.from-amber-400,
  .text-white.from-orange-500,
  .text-white.bg-gradient-to-r,
  .boss-btn,
  .pipeline-btn,
  #export-btn,
  .bg-gradient-to-br .text-white,
  nav .text-white,
  .boss-hero,
  .boss-hero .text-white,
  .boss-hero .text-gray-300,
  .boss-hero .text-gray-400
) {
  color: #fff !important;
}
body.boss-watermark nav .text-gray-400,
body.boss-watermark nav .text-gray-500,
#sr-search-overlay .text-gray-300,
#sr-search-overlay .text-gray-500,
#announce-overlay .text-gray-400 {
  color: #d1d5db !important;
}
#sr-search-overlay .text-white,
#announce-overlay .text-white,
#announce-overlay .text-gray-200 {
  color: #fff !important;
}

/* Text that sits straight on the red/black background, outside any card,
   is white. 90% white fell to ~4.2:1 where a watermark letter crosses the
   brightest red under the header. Text inside a white card keeps the ink
   colours above. */
body.boss-watermark :is(
  .page-head h1,
  .boss-on-bg h1,
  .boss-on-bg h2,
  .section-label,
  .headline,
  .st-group-title
),
body.boss-watermark #insight-pane h3.section-label {
  color: #fff !important;
}
/* Drill-down headings (จังหวัด, Supervisor, PCs, Store Focus) sit straight on
   the red/black background, so they are white. Colour only; size unchanged. */
body.boss-watermark #insight-pane h3.drill-head {
  color: #fff !important;
}
/* Class weight only (0,3,2): it beats the .text-gray-* and hover:text-white
   remaps above but loses to the white-surface reset below, so the same label
   inside a white panel turns grey again. An id inside this :is() would lift
   the whole list to id weight and paint those labels white on white, so
   id-based targets get the rule after it. */
body.boss-watermark :is(
  .page-head p,
  .boss-on-bg p,
  .toolbar .fld > label,
  .fld-label,
  .chips-label,
  .result-line,
  .summary-note,
  .legend,
  .st-group-lede,
  .section-label + .material-symbols-outlined,
  .inbox-tab:not(.tab-active),
  .section-label + .text-xs,
  .section-label ~ p.text-xs,
  .sd-head .back-link,
  .sd-head h1,
  .sd-head .meta,
  .sd-head .fld > label
) {
  color: #fff !important;
}
body.boss-watermark #more-filters-label,
body.boss-watermark #more-filters .fld > label,
body.boss-watermark #activity-block > div:first-child > .material-symbols-outlined,
body.boss-watermark #loading > span {
  color: #fff !important;
}
/* hover:text-white is remapped to ink above; inactive inbox tabs stay white. */
body.boss-watermark .inbox-tab:not(.tab-active):hover {
  color: #fff !important;
}
/* The inbox's active tab was sky blue (#38bdf8), about 3.2:1 on the red. */
body.boss-watermark .inbox-tab.tab-active {
  border-bottom-color: #fff;
  color: #fff !important;
}
/* Translucent cards would tint pink over the red; keep them solid white. */
body.boss-watermark :is(.glass-card, .link-tile) {
  background: #fff;
}
body.boss-watermark :is(.desktop-tab, .st-nav-item):not(.is-active) {
  color: #fff;
}
/* Analytics error box was a red tint for a dark page; make it a white card. */
body.boss-watermark #error-state > div {
  background: #fff;
}
body.boss-watermark :is(.desktop-tab, .st-nav-item):not(.is-active):hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
/* Settings nav sits on the red, where its BOSS-red focus ring was 1.5:1. */
body.boss-watermark #tab-settings .st-nav-item:focus-visible {
  outline-color: #fff;
}
/* Back to ink/grey inside white surfaces. [id=] keeps this at class weight. */
body.boss-watermark :is(.bg-white, .glass-card, .panel, .card, .st-card, .state, .boss-card, aside, [role="dialog"], [id="filter-pane"]) :is(
  .section-label,
  .headline,
  .page-head p,
  .boss-on-bg p,
  .fld-label,
  .toolbar .fld > label,
  .chips-label,
  .result-line,
  .summary-note,
  .legend,
  .section-label + .text-xs,
  .section-label ~ p.text-xs
) {
  color: #6b7280 !important;
}

/* Decorative emoji before a heading; the text carries the meaning. */
.emo { display: inline-block; margin-right: .4em; font-style: normal; font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif; }

/* ── Team Overview shop list (.so-*) ─────────────────────────────────────────
   One flat card per shop. Pace colours (green / amber / red) appear only on the
   achievement figure and the bars, and always beside a Thai word, so colour is
   never the only signal. BOSS red is kept for keyboard focus and the rank-1
   number. Text stays 12px or larger and every control is 44px on touch. */
.so-list { display: grid; gap: 0.375rem; margin: 0; padding: 0; list-style: none; }

/* Title row for the shop list. Same white rounded card as a shop row, so the
   count and the time note are not gray text on the red watermark. */
.so-band {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "icon title search"
    "icon note search";
  align-items: center;
  column-gap: 0.5rem;
  background: #fff;
  border: 1px solid var(--boss-line);
  border-radius: 0.75rem;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
  color: var(--boss-ink);
}
.so-band .so-band-icon { grid-area: icon; }
.so-band h3 { grid-area: title; margin: 0; color: var(--boss-ink); }
.so-band .so-legend { grid-area: note; margin: 0; }
.so-band .so-search {
  grid-area: search;
  align-self: center;
  background: #f3f4f6;
  border: 1px solid var(--boss-line);
  border-radius: 0.5rem;
}
.so-pace-note {
  grid-column: 1 / -1;
  margin: 0 0 0.25rem;
  font-size: 0.75rem;
  color: var(--boss-muted);
}

/* Same white rounded card as a shop row. The chart canvas is transparent, so
   without this the red watermark runs through the names and the bars. */
.so-chart {
  position: relative;
  box-sizing: content-box;
  background: #fff;
  border: 1px solid var(--boss-line);
  border-radius: 0.75rem;
  padding: 0.75rem 0.75rem 0.5rem;
  margin-bottom: 0.75rem;
}

.so-row {
  --so-ok: #15803d;
  --so-risk: #b45309;
  --so-behind: #b91c1c;
  --so-none: #6b7280;
  background: #fff;
  border: 1px solid var(--boss-line);
  border-radius: 0.75rem;
  padding: 0.5rem 0.75rem 0.25rem;
  color: var(--boss-ink);
  cursor: pointer;
}
.so-row:hover { border-color: #c9ced6; }
.so-row[data-nolink] { cursor: default; }

.so-head { display: flex; align-items: center; gap: 0.625rem; }
.so-rank {
  flex: 0 0 2rem;
  text-align: right;
  font-size: 0.9375rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--boss-muted);
}
.so-rank[data-podium] { color: var(--boss-ink); font-weight: 800; }
.so-logo {
  flex: 0 0 1.75rem;
  width: 1.75rem;
  height: 1.75rem;
  object-fit: contain;
  border: 1px solid var(--boss-line);
  border-radius: 0.375rem;
  padding: 2px;
  background: #fff;
}
.so-id { flex: 1 1 auto; min-width: 0; }
.so-name {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.so-meta { margin: 0; font-size: 0.75rem; line-height: 1.4; color: var(--boss-muted); }

.so-ach { flex: 0 0 auto; text-align: right; line-height: 1.15; }
.so-ach strong {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.so-ach span { font-size: 0.75rem; font-weight: 600; }
.so-ach small { font-size: 0.75rem; color: var(--boss-muted); }
.so-ach small::before { content: " · "; }
.so-ach[data-pace="ok"] { color: var(--so-ok); }
.so-ach[data-pace="risk"] { color: var(--so-risk); }
.so-ach[data-pace="behind"] { color: var(--so-behind); }
.so-ach[data-pace="none"] { color: var(--so-none); }

.so-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1rem;
  margin: 0.25rem 0 0.125rem 2.625rem;
}
.so-money { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin: 0; }
.so-money div { display: flex; align-items: baseline; gap: 0.375rem; }
.so-money dt { font-size: 0.75rem; color: var(--boss-muted); }
.so-money dd.so-muted { font-weight: 500; color: var(--boss-muted); }
.so-money dd { margin: 0; font-size: 0.875rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.so-acts { display: flex; align-items: center; gap: 0.25rem; margin-left: auto; }

.so-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-height: 1.75rem;
  padding: 0 0.5rem;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--boss-ink);
  background: #fff;
  border: 1px solid var(--boss-line);
  border-radius: 0.5rem;
  text-decoration: none;
  cursor: pointer;
}
.so-btn:hover { border-color: var(--boss-ink); }
.so-btn .material-symbols-outlined { font-size: 1.125rem; }
.so-btn-vacant { color: var(--so-behind); font-weight: 500; }

.so-row :is(.so-btn, .so-fb):focus-visible,
.so-pop a:focus-visible {
  outline: 2px solid var(--boss-red);
  outline-offset: 2px;
}

.so-cats { display: grid; gap: 0; margin: 0 0 0 2.625rem; padding: 0; list-style: none; }
.so-cat {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr) 2.75rem 10.5rem 3rem;
  align-items: center;
  column-gap: 0.5rem;
  padding: 0;
}
.so-cat[data-dim] { opacity: 0.5; }
.so-cat-name { font-size: 0.8125rem; font-weight: 600; }
.so-bar { position: relative; height: 0.375rem; background: #e5e7eb; border-radius: 0.25rem; }
.so-fill { height: 100%; border-radius: 0.25rem; background: var(--so-none); }
.so-fill[data-pace="ok"] { background: var(--so-ok); }
.so-fill[data-pace="risk"] { background: var(--so-risk); }
.so-fill[data-pace="behind"] { background: var(--so-behind); }
.so-mark {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 2px;
  margin-left: -1px;
  background: var(--boss-ink);
}
.so-cat-pct { font-size: 0.8125rem; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.so-gap { grid-column: 4; grid-row: 1; margin: 0; font-size: 0.75rem; text-align: right; color: var(--boss-muted); }
.so-gap[data-met] { color: var(--so-ok); }

.so-fb {
  grid-column: 5;
  grid-row: 1;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.125rem;
  min-width: 1.75rem;
  min-height: 1.75rem;
  padding: 0 0.125rem;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--boss-muted);
  background: transparent;
  border: 0;
  border-radius: 0.5rem;
  cursor: pointer;
}
.so-fb .material-symbols-outlined { font-size: 1.125rem; }
.so-fb:hover { background: #f3f4f6; color: var(--boss-ink); }
.so-fb.has-fb { color: var(--boss-ink); }
.so-fb-n {
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.25rem;
  font-size: 0.75rem;
  line-height: 1.25rem;
  text-align: center;
  color: #fff;
  background: var(--boss-ink);
  border-radius: 0.625rem;
}
.so-fb-total { font-size: 0.75rem; font-weight: 600; color: var(--boss-ink); }
.so-fb-total[hidden] { display: none; }
.so-fb.is-open { background: #f3f4f6; color: var(--boss-ink); }

.so-panel { grid-column: 1 / -1; margin: 0.25rem 0 0.5rem; display: grid; gap: 0.5rem; }
.so-panel.hidden { display: none; }

.so-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.375rem; margin-bottom: 0.5rem; }
.so-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--boss-ink);
  background: #f3f4f6;
  border: 1px solid var(--boss-line);
  border-radius: 0.375rem;
}
.so-chip b { font-variant-numeric: tabular-nums; }
.so-chips-total { margin-left: auto; font-size: 0.75rem; color: var(--boss-muted); }

.so-pop {
  position: fixed;
  z-index: 300;
  min-width: 10rem;
  max-width: 14rem;
  padding: 0.25rem;
  background: #fff;
  border: 1px solid var(--boss-line);
  border-radius: 0.75rem;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.14);
  color: var(--boss-ink);
}
.so-pop-title { padding: 0.25rem 0.5rem; font-size: 0.75rem; color: var(--boss-muted); }
.so-pop a,
.so-pop-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.25rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.8125rem;
  color: var(--boss-ink);
  text-decoration: none;
  border-radius: 0.5rem;
}
.so-pop a:hover { background: #f3f4f6; }
.so-pop-item[data-vacant] { color: var(--so-behind); }
.so-pop small { display: block; font-size: 0.75rem; color: var(--boss-muted); }
.so-pop-empty { padding: 0.5rem; font-size: 0.8125rem; color: var(--boss-muted); }

.so-legend { font-size: 0.75rem; color: var(--boss-muted); }
.so-mark-key {
  display: inline-block;
  width: 2px;
  height: 0.75rem;
  margin: 0 0.25rem -0.125rem;
  background: var(--boss-ink);
}

@media (max-width: 640px) {
  .so-row { padding: 0.75rem 0.75rem 0.5rem; }
  .so-sub, .so-cats { margin-left: 0; }
  .so-cat { grid-template-columns: 3.75rem minmax(0, 1fr) 2.75rem 3.5rem; padding: 0.125rem 0; }
  .so-gap { grid-column: 2 / 4; grid-row: auto; }
  .so-fb { grid-column: 4; }
  .so-ach span, .so-ach small { display: block; }
  .so-ach small::before { content: none; }
  .so-acts { margin-left: 0; width: 100%; }
  .so-acts > * { flex: 1 1 0; justify-content: center; }
}
@media (pointer: coarse) {
  .so-btn { min-height: 2.75rem; }
  .so-fb { min-width: 2.75rem; min-height: 2.75rem; }
  .so-pop a, .so-pop-item { min-height: 2.75rem; }
}

/* ── Feedback panel inside a shop row (.so-fb*) ──────────────────────────────
   All entries are listed at once. The factor is a neutral chip (its name is the
   signal); colour is reserved for the three work states, always with the word.
   Text is 13px or larger and every action is a labelled button. */
.so-fbbox {
  border: 1px solid var(--boss-line);
  border-radius: 0.75rem;
  padding: 0.75rem;
  background: #fff;
}
.so-fbbox-h {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  font-weight: 700;
}
.so-fbbox-h .material-symbols-outlined { font-size: 1.25rem; color: var(--boss-muted); }
.so-fbbox-loading { font-size: 0.75rem; font-weight: 400; color: var(--boss-muted); }
.so-fbbox-loading.hidden { display: none; }

.so-fblist { display: grid; gap: 0.5rem; }
.so-fbcard {
  border: 1px solid var(--boss-line);
  border-radius: 0.5rem;
  padding: 0.625rem 0.75rem;
  background: var(--panel-3);
}
.so-fbcard-h { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; }
.so-fbtype {
  padding: 0.125rem 0.5rem;
  font-size: 0.8125rem;
  font-weight: 700;
  background: #fff;
  border: 1px solid var(--boss-line);
  border-radius: 0.375rem;
}
.so-status {
  padding: 0.125rem 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: 0.375rem;
  color: var(--boss-muted);
  background: #f3f4f6;
}
.so-status[data-s="new"] { color: #92400e; background: #fef3c7; }
.so-status[data-s="in_progress"] { color: #1e40af; background: #dbeafe; }
.so-status[data-s="done"] { color: #166534; background: #dcfce7; }
.so-fbmeta { margin-left: auto; font-size: 0.75rem; color: var(--boss-muted); }
.so-fbtext { margin: 0.375rem 0 0; font-size: 0.875rem; line-height: 1.5; overflow-wrap: anywhere; }
.so-fbk { color: var(--boss-muted); }
.so-fbimg { margin-top: 0.5rem; }
.so-fbthumb {
  width: 4.5rem;
  height: 4.5rem;
  object-fit: cover;
  border: 1px solid var(--boss-line);
  border-radius: 0.5rem;
  cursor: zoom-in;
}
.so-fbphotos { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.so-fbphotos:not(:empty) ~ .so-fbhint { display: none; }
.so-reply-view {
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
  background: #fff;
  border: 1px solid var(--boss-line);
  border-radius: 0.5rem;
}
.so-reply-view .so-fbmeta { margin: 0 0 0.125rem; }
.so-fbacts { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem; margin-top: 0.5rem; }
.so-btn-danger { margin-left: auto; color: var(--so-behind, #b91c1c); }
.so-btn-danger:hover { border-color: #b91c1c; }
.so-btn-primary { color: #fff; background: var(--boss-ink); border-color: var(--boss-ink); }
.so-btn-primary:hover { background: #000; border-color: #000; }
.so-supact { display: grid; gap: 0.5rem; margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px solid var(--boss-line); }
.so-supact.hidden { display: none; }
.so-pills { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem; font-size: 0.8125rem; }
.so-pill {
  min-height: 2rem;
  padding: 0 0.75rem;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--boss-ink);
  background: #fff;
  border: 1px solid var(--boss-line);
  border-radius: 0.375rem;
  cursor: pointer;
}
.so-pill:hover { border-color: var(--boss-ink); }
.so-pill.is-on { color: #fff; background: var(--boss-ink); border-color: var(--boss-ink); }
.so-reply {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--boss-ink);
  background: #fff;
  border: 1px solid var(--boss-line);
  border-radius: 0.5rem;
  resize: vertical;
}
.so-reply::placeholder { color: var(--boss-muted); }
.so-fbnote { margin: 0; font-size: 0.8125rem; color: var(--boss-muted); }
.so-fbnote[data-error] { color: #b91c1c; }
.so-fbhint { margin-top: 0.25rem; }

.so-row :is(.so-pill, .so-reply):focus-visible { outline: 2px solid var(--boss-red); outline-offset: 2px; }

@media (max-width: 640px) {
  .so-fbmeta { margin-left: 0; width: 100%; }
  .so-fbacts > .so-btn { flex: 1 1 auto; justify-content: center; }
}
@media (pointer: coarse) {
  .so-pill { min-height: 2.75rem; }
}
