:root {
  color-scheme: light dark;
  --bg: #eef2f5;
  --surface: #ffffff;
  --surface-soft: #f7f9fb;
  --surface-strong: #fbfcfd;
  --surface-raised: #ffffff;
  --field: #ffffff;
  --line: #d7dee6;
  --text: #17212b;
  --muted: #617080;
  --blue: #006cae;
  --blue-dark: #034f83;
  --corp: #37308f;
  --corp-soft: #eeedf8;
  --corp-shadow: rgba(55, 48, 143, 0.18);
  --cxc-admin-note-border: #e8e6f5;
  --cxc-admin-note-bg: #f3f1fb;
  --cxc-admin-note-text: #2d3138;
  --green: #1f8a58;
  --orange: #f58220;
  --commercial-state-pending: #8a4b00;
  --commercial-state-confirmed: #167344;
  --yellow: #ffd84d;
  --yellow-text: #4c3b00;
  --red: #d71920;
  --purple: #5544b8;
  --ink: #253546;
  --shadow: 0 18px 42px rgba(28, 45, 61, 0.13);
  --nav-bg: #edf2f6;
  --chip-bg: #eef2f5;
  --reply-bg: #f6f8fa;
  --modal-backdrop: rgba(13, 26, 38, 0.38);
  --badge-default-bg: #eef2f5;
  --badge-default-text: #405263;
  --badge-red-bg: #fee8ea;
  --priority-red-bg: #d71920;
  --badge-orange-bg: #fff0db;
  --priority-orange-bg: #f58220;
  --badge-yellow-bg: #fff6cf;
  --priority-yellow-bg: #ffd84d;
  --badge-blue-bg: #e1f0fa;
  --badge-green-bg: #e5f4ec;
  --priority-green-bg: #2fa66a;
  --badge-purple-bg: #eeeaff;
  --purchase-scale: 1;
  --pulse-speed: 1.8s;
  --workspace-space-1: 4px;
  --workspace-space-2: 8px;
  --workspace-space-3: 12px;
  --workspace-space-4: 16px;
  --workspace-control-height: 32px;
  --workspace-control-compact: 28px;
  --workspace-page-title: 17px;
  --workspace-section-title: 14px;
  --workspace-radius: 8px;
}

.integrity-reference-dialog {
  width: min(1040px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  border: 0;
  border-radius: 18px;
  padding: 0;
}
.integrity-reference-dialog > section { padding: 22px; }
.integrity-reference-dialog > section > header { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.integrity-reference-dialog h2, .integrity-reference-dialog h3 { margin: 0; }
.integrity-reference-body { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, .7fr); gap: 18px; margin-top: 18px; }
.integrity-reference-list { max-height: 58vh; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.integrity-reference-list table { width: 100%; border-collapse: collapse; }
.integrity-reference-list th, .integrity-reference-list td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; }
#integrityReferenceForm { display: grid; gap: 12px; align-content: start; padding: 16px; border: 1px solid var(--line); border-radius: 12px; }
#integrityReferenceForm label { display: grid; gap: 6px; }
#integrityReferenceForm footer { display: flex; justify-content: flex-end; gap: 8px; }
@media (max-width: 760px) {
  .integrity-reference-body { grid-template-columns: 1fr; }
  .integrity-reference-list { max-height: 36vh; }
}

/* Acciones comerciales · tabla operativa propia */
.commercial-actions-module {
  display: grid;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  color: var(--text);
}

#commercialActionsRecordsView,
#commercialActionsSchedulesView,
#commercialOfferFollowupView,
#commercialRejectedOffersView {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

#commercialOfferFollowupView { overflow: hidden; contain: inline-size; }
#commercialRejectedHistoryView { width: 100%; max-width: 100%; min-width: 0; overflow: hidden; contain: inline-size; }
#commercialRejectedHistoryView .commercial-actions-toolbar { grid-template-columns: minmax(150px, 220px) minmax(150px, 220px) max-content minmax(210px, 260px); justify-content: start; }
#commercialRejectedHistorySearch { min-height: 34px; border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; background: var(--field); color: var(--text); font: inherit; }
#commercialRejectedHistoryView .commercial-actions-search { min-width: 0; }
#commercialRejectedHistoryTableWrap { inline-size: 100%; max-inline-size: 100%; min-inline-size: 0; overflow: auto; }
@media (max-width: 1000px) {
  #commercialRejectedHistoryView .commercial-actions-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  #commercialRejectedHistoryView .commercial-actions-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #commercialRejectedHistoryQuery, #commercialRejectedHistoryView .commercial-actions-toolbar > label:last-child { grid-column: 1 / -1; }
}

#commercialOfferFollowupTableWrap { inline-size: 100%; max-inline-size: 100%; min-inline-size: 0; overflow: auto; }

.commercial-actions-viewbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border-bottom: 1px solid var(--line);
}

.commercial-actions-tabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 100%;
  min-width: 0;
}

.commercial-schedules-table-wrap:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}

.commercial-actions-viewbar button {
  border: 0;
  border-bottom: 2px solid var(--corp);
  padding: 7px 14px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

.commercial-actions-viewbar button[role="tab"]:not(.active) { border-bottom-color: transparent; }
.commercial-actions-viewbar-spacer { flex: 1 1 24px; min-width: 0; }
.commercial-actions-viewbar .primary-btn {
  border: 1px solid var(--corp);
  border-radius: 7px;
  background: var(--corp);
  color: #fff;
  box-shadow: 0 1px 2px rgb(27 43 65 / 14%);
  white-space: nowrap;
}
.commercial-actions-viewbar .ghost-btn {
  border: 1px solid #c8d7e5;
  border-radius: 7px;
  background: #fff;
  color: #0f5b91;
  box-shadow: 0 1px 2px rgb(27 43 65 / 10%);
  white-space: nowrap;
}
.commercial-actions-viewbar .ghost-btn:hover,
.commercial-actions-viewbar .ghost-btn:focus-visible {
  border-color: #8db2d0;
  background: #f5faff;
}

.commercial-briefing-view { display: grid; gap: 16px; padding: 18px 22px 28px; }
.commercial-briefing-header { display: flex; justify-content: space-between; gap: 16px; align-items: end; }
.commercial-briefing-header h2, .commercial-briefing-title h3 { margin: 3px 0 2px; }
.commercial-briefing-header p { margin: 0; color: var(--muted); }
.commercial-briefing-search { display: grid; grid-template-columns: minmax(180px, 260px) minmax(320px, 720px); gap: 14px; align-items: start; max-width: 1000px; }
.commercial-briefing-search label { position: relative; display: grid; gap: 5px; }
.commercial-briefing-client .commercial-suggestions { top: calc(100% - 2px); z-index: 24; }
.commercial-briefing-result { display: grid; gap: 16px; }
.commercial-briefing-result > section { padding: 16px; border: 1px solid #dbe2ea; border-radius: 12px; background: #fff; }
.commercial-briefing-result > section > h3 { margin: 0 0 12px; font-size: 14px; }
.commercial-briefing-title { display: flex; justify-content: space-between; gap: 18px; align-items: center; padding: 15px 17px; border-radius: 12px; background: #f3f1fb; border-left: 5px solid var(--corp); }
.commercial-briefing-title span { color: var(--corp); font-size: 12px; font-weight: 700; }
.commercial-briefing-metrics, .commercial-briefing-aging { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 9px; }
.commercial-briefing-metrics article { display: flex; justify-content: space-between; align-items: center; min-height: 52px; padding: 9px 12px; border-radius: 9px; }
.commercial-briefing-aging article { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid #dce3eb; border-radius: 9px; background: #f8fafc; }
.commercial-briefing-aging article.is-total { background: #fff3c9; border-color: #dfb13b; }
.commercial-briefing-aging span { color: var(--muted); font-size: 11px; }
.commercial-briefing-aging strong { font-size: 14px; }
.commercial-briefing-last { display: grid; gap: 10px; padding: 13px; border-radius: 10px; background: #f7f9fc; }
.commercial-briefing-last + .commercial-briefing-last { margin-top: 10px; }
.commercial-briefing-last header { display: flex; justify-content: space-between; gap: 12px; }
.commercial-briefing-last dl { display: flex; gap: 28px; margin: 0; }
.commercial-briefing-last dl div { display: grid; gap: 2px; }
.commercial-briefing-last dt { color: var(--muted); font-size: 11px; }
.commercial-briefing-last dd, .commercial-briefing-last p { margin: 0; white-space: pre-wrap; }
.commercial-briefing-offers { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
#commercialBriefingCxcLinks { grid-template-columns: minmax(0, 1fr); }
.commercial-briefing-offer { display: grid; gap: 7px; align-content: start; padding: 13px; border: 1px solid #d8e0e8; border-radius: 10px; background: #fbfcfe; }
.commercial-briefing-offer > header { display: flex; justify-content: space-between; gap: 10px; }
.commercial-briefing-offer > p, .commercial-briefing-linked p { margin: 0; white-space: pre-wrap; }
.commercial-briefing-linked { display: grid; gap: 7px; margin-top: 5px; padding-top: 9px; border-top: 1px solid #d8e0e8; }
.commercial-briefing-linked article { padding: 8px; border-radius: 7px; background: #eef3f8; }
.commercial-briefing-linked span, .commercial-briefing-offer small, .commercial-briefing-no-links { color: var(--muted); font-size: 11px; }
.commercial-briefing-empty { margin: 0; color: var(--muted); }

@media (max-width: 760px) {
  .commercial-briefing-search { grid-template-columns: 1fr; }
  .commercial-briefing-header { align-items: stretch; flex-direction: column; }
  .commercial-briefing-title { align-items: stretch; flex-direction: column; }
}
.commercial-actions-badge { display: inline-grid; min-width: 18px; height: 18px; place-items: center; margin-left: 4px; border-radius: 999px; background: var(--red); color: #fff; font-size: 10px; }

.workspace-date-input-wrap {
  position: relative;
  display: flex;
  min-width: 0;
  width: 100%;
}

.workspace-date-input-wrap > input[data-date-input] {
  width: 100%;
  padding-right: 38px;
}

.workspace-date-picker-btn {
  position: absolute;
  top: 50%;
  right: 4px;
  width: 30px;
  height: 30px;
  padding: 0;
  transform: translateY(-50%);
  border: 0;
  border-left: 1px solid #d5e0e9;
  border-radius: 0 6px 6px 0;
  background: #f7fafc;
  color: #0f5b91;
  font: inherit;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}

.workspace-date-picker-btn:hover,
.workspace-date-picker-btn:focus-visible { background: #eaf4fb; }

.workspace-native-date-picker {
  position: absolute;
  width: 1px;
  height: 1px;
  right: 0;
  bottom: 0;
  opacity: 0;
  pointer-events: none;
}

.workspace-date-popover {
  position: absolute;
  z-index: 40;
  top: calc(100% + 4px);
  left: 0;
  width: 238px;
  border: 1px solid #bccbd7;
  border-radius: 9px;
  padding: 8px;
  background: var(--surface-raised, #fff);
  color: var(--text, #17212b);
  box-shadow: 0 10px 28px rgb(21 43 61 / 24%);
}

.workspace-date-popover[hidden] { display: none; }
.workspace-date-popover-head { display: grid; grid-template-columns: 30px 1fr 30px; align-items: center; gap: 4px; margin-bottom: 5px; }
.workspace-date-popover-head strong { text-align: center; font-size: 13px; text-transform: lowercase; }
.workspace-date-popover-head button,
.workspace-date-popover-days button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.workspace-date-popover-head button { width: 30px; height: 28px; font-size: 20px; line-height: 1; }
.workspace-date-popover-weekdays,
.workspace-date-popover-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.workspace-date-popover-weekdays span { padding: 3px 0; color: var(--muted, #667684); text-align: center; font-size: 10px; font-weight: 700; }
.workspace-date-popover-days button { height: 27px; font-size: 12px; }
.workspace-date-popover-head button:hover,
.workspace-date-popover-days button:hover { background: #edf5fb; }
.workspace-date-popover-days button.outside { color: #a9b3bc; }
.workspace-date-popover-days button.selected { background: #dcecff; color: #0b5d96; font-weight: 800; }

.commercial-explained-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  opacity: 0;
  pointer-events: none;
}

.commercial-explained-picker { position: relative; min-width: 0; width: 100%; }

.commercial-explained-trigger {
  position: relative;
  width: 100%;
  min-height: 36px;
  padding: 7px 34px 7px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--field);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
}

.commercial-explained-trigger::after {
  content: "⌄";
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-54%);
}

.commercial-explained-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 3px);
  left: 0;
  min-width: 100%;
  width: max-content;
  max-width: 360px;
  padding: 5px;
  border: 1px solid #c8d7e5;
  border-radius: 9px;
  background: var(--surface-raised);
  box-shadow: 0 12px 28px rgb(27 43 65 / 22%);
}

.commercial-explained-menu > button {
  position: relative;
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  text-align: left;
  white-space: nowrap;
}

.commercial-explained-menu > button:hover,
.commercial-explained-menu > button:focus-visible,
.commercial-explained-menu > button.selected { background: #eaf4ff; color: #154f80; }

.commercial-explained-help {
  position: absolute;
  z-index: 2;
  left: calc(100% + 9px);
  top: 50%;
  display: none;
  width: 300px;
  padding: 9px 11px;
  transform: translateY(-50%);
  border: 1px solid #abc5dc;
  border-radius: 8px;
  background: #f7fbff;
  color: #29465f;
  box-shadow: 0 9px 24px rgb(27 43 65 / 18%);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  white-space: normal;
}

.commercial-explained-menu > button:hover .commercial-explained-help,
.commercial-explained-menu > button:focus-visible .commercial-explained-help { display: block; }

.commercial-suggestions button.official { background: #e9f8ee; color: #147a49; }
.commercial-suggestions button.official:hover { background: #d8f1e1; }

.commercial-source-pill {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}
.commercial-source-pill.native { color: #15578b; background: #e5f1fb; }
.commercial-source-pill.historical { color: #5f566e; background: #eeeaf4; }
.commercial-action-historical-row { background: #fcfbfe; }

.commercial-actions-module .commercial-actions-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1.6fr) repeat(6, minmax(125px, .7fr)) auto auto;
  gap: 8px;
  align-items: end;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.commercial-actions-exportbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  padding: 8px 0;
}

.commercial-actions-toolbar label {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.commercial-actions-toolbar input,
.commercial-actions-toolbar select {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px 8px;
  background: var(--field);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.commercial-actions-status.error { color: var(--red); }

.commercial-actions-table-wrap {
  position: relative;
  overflow: auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 210px;
  max-height: calc(100vh - 300px);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.commercial-actions-table { 
  width: 100%;
  min-width: 1870px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
}

.commercial-actions-table th,
.commercial-actions-table td {
  height: 24px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 4px 7px;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.commercial-actions-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-soft);
  color: var(--ink);
  font-weight: 700;
}

.commercial-action-records-table { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; }
.commercial-action-records-table th[data-record-column] { cursor: grab; user-select: none; }
.commercial-action-records-table th[data-record-column].is-dragging { cursor: grabbing; opacity: .55; }
.commercial-action-records-table th,
.commercial-action-records-table td { box-sizing: border-box; }
.commercial-action-records-table th.cxc-drop-before::before,
.commercial-action-records-table th.cxc-drop-after::after { content: ""; position: absolute; top: 0; bottom: 0; width: 4px; z-index: 8; background: #d4002a; pointer-events: none; }
.commercial-action-records-table th.cxc-drop-before::before { left: -2px; }
.commercial-action-records-table th.cxc-drop-after::after { right: -2px; }
.commercial-action-records-table a { color: var(--blue); font-weight: 700; }

.commercial-actions-table tbody tr:hover { background: var(--corp-soft); }
.commercial-action-view-row { cursor: pointer; }
.commercial-action-view-row:focus { outline: 2px solid var(--corp); outline-offset: -2px; background: var(--corp-soft); }

.commercial-actions-table button {
  min-height: 26px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--corp);
  font-size: 12px;
  font-weight: 700;
}

.commercial-action-row-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.commercial-actions-table .commercial-action-edit-btn.edited {
  border-color: #c8a74e;
  background: #fff5cf;
  color: #6d5617;
}

.commercial-actions-empty {
  padding: 45px 20px;
  color: var(--muted);
  text-align: center;
}

.commercial-actions-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding-right: 2px;
  color: var(--muted);
  font-size: 12px;
}

.commercial-action-detail-dialog {
  width: min(1040px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.commercial-action-detail-dialog::backdrop { background: rgba(13, 26, 38, .56); }

.commercial-action-detail-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  max-height: calc(100vh - 50px);
}

.commercial-action-detail-shell > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--line);
}

.commercial-action-detail-shell h2 { margin: 2px 0 4px; font-size: 18px; }

.commercial-action-detail-body {
  overflow: auto;
  padding: 16px 18px 20px;
}

.commercial-action-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.commercial-action-detail-grid article,
.commercial-action-detail-text {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px;
  background: var(--surface-soft);
}

.commercial-action-detail-grid span,
.commercial-action-detail-text span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.commercial-action-detail-grid strong { font-size: 13px; }

.commercial-action-detail-text { margin-top: 10px; }
.commercial-action-detail-text p { margin: 0; white-space: pre-wrap; line-height: 1.45; }

.commercial-detail-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.danger-btn { min-height: 34px; border: 1px solid var(--red); border-radius: 7px; padding: 6px 12px; background: transparent; color: var(--red); font: inherit; font-weight: 700; }

.commercial-action-form-dialog,
.commercial-action-review-dialog {
  width: min(1180px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.commercial-action-form-dialog { width: min(1540px, calc(100vw - 24px)); }
.commercial-action-form-dialog.compact { width: min(920px, calc(100vw - 36px)); }
.commercial-action-form-dialog::backdrop,
.commercial-action-review-dialog::backdrop { background: rgba(13, 26, 38, .6); }

.commercial-discard-dialog {
  width: min(430px, calc(100vw - 40px));
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}
.commercial-discard-dialog::backdrop { background: rgba(13, 26, 38, .3); }
.commercial-discard-dialog section { padding: 18px; }
.commercial-discard-dialog h2 { margin: 0; font-size: 17px; }
.commercial-discard-dialog p { margin: 12px 0 18px; color: var(--muted); line-height: 1.45; }
.commercial-discard-dialog footer { display: flex; justify-content: flex-end; gap: 8px; }

.commercial-action-form-dialog form { position: relative; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; max-height: calc(100vh - 38px); margin: 0; overflow: hidden; }
.commercial-dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 15px 18px 12px; border-bottom: 1px solid var(--line); }
.commercial-dialog-header h2 { margin: 0; font-size: 19px; }
.commercial-dialog-header p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.dialog-close { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); color: var(--text); font-size: 21px; }
.commercial-action-form-dialog .dialog-close {
  flex: 0 0 auto;
  width: max(32px, 1.524em);
  height: auto;
  min-height: max(32px, 1.524em);
  padding: 0;
  line-height: 1;
}
.commercial-action-form-dialog .workspace-date-picker-btn {
  width: max(30px, 1.765em);
  height: auto;
  min-height: max(30px, 1.765em);
}
.commercial-action-form-dialog .workspace-date-input-wrap > input[data-date-input] {
  padding-right: calc(2em + 12px);
}
.commercial-action-form-dialog .commercial-form-grid :is(input:not([type="checkbox"]), select):not(.commercial-explained-native) {
  height: auto;
  min-height: max(35px, calc(1.4em + 14px));
  line-height: 1.4;
}
.commercial-action-form-scroll { overflow: auto; padding: 14px 18px 18px; }
.commercial-form-section { margin-bottom: 14px; border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--surface-soft); }
.commercial-form-section h3 { margin: 0 0 10px; font-size: 14px; color: var(--corp); }
.commercial-form-section h4 { margin: 0 0 8px; font-size: 13px; }
.commercial-form-grid { display: grid; gap: 10px; }
.commercial-form-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.commercial-form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.commercial-form-grid label,
.commercial-action-form-scroll > label,
.commercial-form-section > label { display: grid; align-content: start; gap: 4px; color: var(--muted); font-size: 12px; }
.commercial-form-grid input,
.commercial-form-grid select,
.commercial-form-section textarea,
.commercial-action-form-scroll textarea,
.commercial-context-heading select,
.commercial-inline-editor input,
.commercial-inline-editor select { width: 100%; min-height: 35px; border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; background: var(--field); color: var(--text); font: inherit; font-size: 13px; }
.commercial-form-section textarea,
.commercial-action-form-scroll textarea { resize: vertical; line-height: 1.45; }
.commercial-form-grid small,
.commercial-form-section small { min-height: 15px; color: var(--muted); font-size: 11px; line-height: 1.3; }
.commercial-form-grid small.pending { color: var(--commercial-state-pending); }
.commercial-form-grid small.confirmed { color: var(--commercial-state-confirmed); }
.commercial-form-grid small.error { color: var(--red); font-weight: 700; }
:is(.commercial-actions-module, .commercial-action-form-dialog, .commercial-identity-validator-dialog, .commercial-visits-module, .commercial-performance-module, .commercial-performance-toolbar, .workshop-filter-toolbar) :is(input, select, textarea, .commercial-explained-trigger) {
  border-color: var(--muted);
}
.commercial-action-form-dialog label.commercial-field-invalid { color: var(--red); font-weight: 800; }
.commercial-action-form-dialog label.commercial-field-invalid > :is(input, select, textarea),
.commercial-action-form-dialog label.commercial-field-invalid > .commercial-explained-picker > .commercial-explained-trigger {
  border-color: var(--red) !important;
  box-shadow: 0 0 0 2px rgba(190, 24, 47, .18) !important;
  background: #fff7f8;
}
.commercial-dialog-footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 11px 18px; border-top: 1px solid var(--line); background: var(--surface); }
.commercial-dialog-footer .form-error { flex: 1; color: var(--red); font-size: 12px; }
.commercial-identity-field { position: relative; }
.commercial-identity-field > span { min-height: 14px; font-size: 10px; }
.commercial-identity-field > span.confirmed { color: var(--commercial-state-confirmed); }
.commercial-identity-field > span.pending { color: var(--commercial-state-pending); }
.commercial-pending-project-profile { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.commercial-project-profile-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.commercial-project-profile-heading h4 { margin: 0 0 3px; color: var(--corp); }
.commercial-project-profile-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.commercial-pending-project-profile.read-only .commercial-form-grid { opacity: .72; }
.commercial-pending-project-profile.read-only input:disabled,
.commercial-pending-project-profile.read-only select:disabled { background: #eef1f4; color: #596575; cursor: not-allowed; }
.commercial-inline-suggest { position: relative; display: block; width: 100%; }
.commercial-suggestions { position: absolute; z-index: 8; top: calc(100% - 12px); left: 0; right: 0; max-height: 245px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-raised); box-shadow: var(--shadow); }
.commercial-suggestions button { display: grid; width: 100%; gap: 2px; border: 0; border-bottom: 1px solid var(--line); padding: 8px 10px; background: transparent; color: var(--text); text-align: left; }
.commercial-suggestions button:hover { background: var(--corp-soft); }
.commercial-suggestions button.official { border-left: 4px solid var(--green); background: rgba(42, 157, 99, .08); color: #147a49; }
.commercial-suggestions button.official span,
.commercial-suggestions button.official .commercial-contact-details { color: #147a49; }
.commercial-suggestions button.observed { border-left: 4px solid #aeb7c2; background: #f2f4f7; color: #667386; }
.commercial-suggestions span,
.commercial-suggestions p { margin: 0; color: var(--muted); font-size: 11px; }
.commercial-suggestions .commercial-contact-details { color: #344b63; font-weight: 600; }
.commercial-suggestions p { padding: 10px; }
#commercialScheduleProjectSuggestions {
  right: auto;
  width: min(820px, calc(100vw - 96px));
  max-height: min(430px, calc(100vh - 280px));
}
.commercial-context-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.commercial-context-heading label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; }
.commercial-context-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.commercial-context-metrics article { display: grid; gap: 3px; border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: var(--surface); }
.commercial-context-metrics span { color: var(--muted); font-size: 11px; }
.commercial-context-metrics strong { font-size: 12px; }
.commercial-offer-summary-pills { display: flex; flex-wrap: wrap; gap: 5px; }
.commercial-offer-summary-pills .commercial-data-pill { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.commercial-offer-summary-pills .commercial-data-pill strong { font-size: inherit; }
.commercial-linked-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.commercial-linked-actions > button { display: inline-flex; align-items: center; gap: 7px; min-height: 35px; }
.commercial-linked-actions > small { flex: 1 1 280px; color: var(--muted); font-size: 11px; }
.commercial-linked-count { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; border-radius: 999px; padding: 0 7px; background: var(--surface-soft); color: var(--text); font-size: 11px; font-weight: 800; }
.commercial-linked-count.alert { background: #d9343a; color: #fff; box-shadow: 0 0 0 3px rgba(217, 52, 58, .14); }
.commercial-linked-drawer { position: absolute; z-index: 24; top: 0; right: 0; bottom: 0; display: grid; grid-template-rows: auto auto minmax(0, 1fr); width: min(760px, 48%); border-left: 1px solid var(--line); background: var(--surface); box-shadow: -15px 0 36px rgba(17, 35, 51, .22); overflow: hidden; }
.commercial-linked-drawer[hidden] { display: none; }
.commercial-linked-drawer > header { position: relative; z-index: 2; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); padding: 16px 18px; background: var(--surface-raised); }
.commercial-linked-drawer > header h3 { margin: 0; color: var(--ink); font-size: 16px; }
.commercial-linked-drawer > header p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.commercial-linked-drawer-bulk { position: relative; z-index: 2; grid-row: 2; padding: 10px 16px 8px; background: var(--surface); }
.commercial-linked-drawer-bulk[hidden] { display: none; }
.commercial-linked-drawer-bulk .commercial-add-all { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid #b9d0e3; border-radius: 7px; padding: 8px; background: #edf6fd; }
.commercial-linked-drawer-bulk .commercial-add-all > div { min-width: 0; }
.commercial-linked-drawer-bulk .commercial-add-all small { display: block; color: var(--muted); }
.commercial-linked-drawer > .commercial-context-list { min-height: 0; align-content: start; grid-auto-rows: max-content; max-height: none; overflow: auto; overscroll-behavior: contain; padding: 4px 16px 20px; }
.commercial-linked-drawer > #commercialActionOffers { grid-row: 3; }
.commercial-linked-drawer > #commercialActionCxc { grid-row: 2 / 4; }
.commercial-context-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.commercial-context-columns > article { border: 1px solid var(--line); border-radius: 9px; padding: 10px; background: var(--surface); }
.commercial-context-columns.commercial-qualification-columns { grid-template-columns: 1fr; }
.commercial-context-list { display: grid; gap: 5px; max-height: 190px; overflow: auto; }
.commercial-context-list label { display: flex; align-items: flex-start; gap: 7px; border-bottom: 1px solid var(--line); padding: 5px 2px; color: var(--text); font-size: 12px; }
.commercial-context-list label input { width: auto; margin-top: 3px; }
.commercial-context-list label.commercial-select-all { position: sticky; top: 0; z-index: 1; border: 1px solid #b9d0e3; border-radius: 7px; padding: 7px; background: #edf6fd; }
.commercial-context-list label span { display: grid; gap: 2px; }
.commercial-cxc-delegation { display:grid; gap:6px; border:1px solid var(--line); border-radius:9px; padding:9px; background:var(--surface); }
.commercial-cxc-delegation > header { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; padding-bottom:5px; border-bottom:1px solid var(--line); }
.commercial-cxc-delegation > header small,.commercial-cxc-invoice small { color:var(--muted); }
.commercial-cxc-invoice { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; padding:5px 0; }
.commercial-cxc-invoice > label { flex:1; border:0; padding:0; }
.commercial-cxc-invoice > button { flex:0 0 auto; }
.commercial-cxc-invoice > label > span { display:grid; gap:3px; }
.commercial-cxc-invoice > span { display:grid; gap:3px; min-width:0; }
.commercial-cxc-invoice-instruction { color:var(--text); font-size:1rem; line-height:1.35; }
.commercial-briefing-cxc-state { margin:0; padding:9px 11px; border-left:4px solid var(--success); border-radius:7px; background:#edf8f2; }
.commercial-cxc-summary { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:10px 12px; border-left:4px solid var(--success); border-radius:7px; background:#edf8f2; }
.commercial-cxc-group { overflow:hidden; border:1px solid var(--line); border-radius:9px; background:var(--surface); }
.commercial-cxc-group > header { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; padding:10px 12px; background:var(--surface-soft); }
.commercial-cxc-group > header > div { display:grid; gap:2px; }
.commercial-cxc-group > header > div:last-child { justify-items:end; }
.commercial-cxc-group small,.commercial-cxc-table-row > span:nth-child(2) { color:var(--muted); }
.commercial-cxc-instruction { margin:0; padding:10px 12px; border-top:1px solid var(--line); white-space:pre-wrap; }
.commercial-cxc-table { border-top:1px solid var(--line); }
.commercial-cxc-table-head,.commercial-cxc-table-row { display:grid; grid-template-columns:minmax(140px,1fr) minmax(110px,.65fr) minmax(120px,.55fr); align-items:center; gap:12px; padding:7px 12px; }
.commercial-cxc-table-head { color:var(--muted); background:var(--surface-soft); font-size:11px; font-weight:750; }
.commercial-cxc-table-row + .commercial-cxc-table-row { border-top:1px solid var(--line); }
.commercial-cxc-table-row[hidden] { display:none; }
.commercial-cxc-table-row > :last-child { text-align:right; font-variant-numeric:tabular-nums; }
.commercial-cxc-expand { width:100%; border:0; border-top:1px solid var(--line); padding:8px 12px; background:var(--surface-soft); color:var(--corp); font-weight:750; cursor:pointer; }
.commercial-cxc-readonly { margin:0; padding:7px 9px; border-radius:6px; background:#fff4d8; color:#755100; font-size:11px; }
.cxc-delegation-review-card { margin-top:12px; border:1px solid #d8ddea; border-radius:12px; overflow:hidden; background:#fff; }
.cxc-delegation-review-card > header { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:12px 14px; background:#f2f3f8; }
.cxc-delegation-review-card > header div { display:grid; gap:3px; }
.cxc-delegation-review-card > header small { color:#667085; }
.cxc-delegation-review-invoices { display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:8px; padding:12px; }
.cxc-delegation-review-invoices label { display:flex; align-items:flex-start; gap:9px; padding:10px; border:1px solid #dfe3ec; border-radius:9px; background:#fafbfc; }
.cxc-delegation-review-invoices label.is-managed { border-color:#6bb784; background:#eefaf2; }
.cxc-delegation-review-invoices label span { display:grid; gap:3px; }
.cxc-delegation-review-invoices label small { color:#667085; }
.cxc-delegation-review-card .cxc-review-actions { display:flex; justify-content:flex-end; flex-wrap:wrap; gap:8px; padding:0 12px 12px; }
.commercial-context-list .commercial-add-all,
.commercial-context-list .commercial-offer-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 8px 2px; color: var(--text); font-size: 12px; }
.commercial-context-list .commercial-add-all { align-items: center; border: 1px solid #b9d0e3; border-radius: 7px; padding: 8px; background: #edf6fd; }
.commercial-context-list .commercial-add-all > div,
.commercial-context-list .commercial-offer-row > div { min-width: 0; }
.commercial-context-list .commercial-offer-row .commercial-offer-actions { display: flex; flex: 0 0 auto; flex-direction: column; gap: 6px; }
.commercial-context-list .commercial-offer-project { display: block; margin-top: 4px; color: #244e6b; }
.commercial-context-list .commercial-offer-project.pending { color: #8a5a00; }
.commercial-context-list .commercial-add-all .ghost-btn,
.commercial-context-list .commercial-offer-row .ghost-btn { flex: 0 0 auto; min-height: 32px; padding: 5px 12px; }
.commercial-context-list .commercial-offer-request,
.commercial-context-list .commercial-offer-work { display: block; margin-top: 2px; white-space: normal; line-height: 1.3; }
.commercial-context-list .commercial-offer-request { color: var(--text); }
.commercial-context-list .commercial-offer-request.missing { color: var(--commercial-state-pending); }
.commercial-context-list .commercial-offer-date { margin-top: 1px; font-weight: 650; }
.commercial-context-list .commercial-offer-work { color: var(--muted); font-size: 11px; }
.commercial-context-list small { display: block; color: var(--muted); }
.commercial-context-list p { margin: 3px 0; color: var(--muted); font-size: 12px; }
.commercial-context-explanation { margin: -2px 0 9px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.commercial-known-fields { display: grid; gap: 10px; }
.commercial-known-group { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; border-top: 1px solid var(--line); padding-top: 8px; }
.commercial-known-group:first-child { border-top: 0; padding-top: 0; }
.commercial-known-group > h5,
.commercial-new-needs > h5 { grid-column: 1 / -1; margin: 0; color: var(--ink); font-size: 13px; }
.commercial-known-group > .commercial-context-explanation { grid-column: 1 / -1; margin: 0; }
.commercial-known-field { display: grid; align-content: start; gap: 4px; min-width: 0; color: var(--text); font-size: 12px; }
.commercial-known-field > span { font-weight: 700; }
.commercial-known-field > small { min-height: 28px; color: var(--muted); font-size: 11px; line-height: 1.3; }
.commercial-known-field input,
.commercial-known-field select,
.commercial-needs-decision select,
.commercial-main-needs-panel input { width: 100%; min-width: 0; min-height: 35px; border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; background: var(--field); color: var(--text); font: inherit; font-size: 13px; }
.commercial-percentage-input { display: grid; grid-template-columns: minmax(0, 1fr) 28px; align-items: center; gap: 5px; font-weight: 700; }
.commercial-percentage-input > span { text-align: center; }
.commercial-known-field.disabled { opacity: .58; }
.commercial-needs-decision { display: grid; grid-template-columns: minmax(170px, auto) minmax(130px, 1fr); align-items: center; gap: 8px; margin-top: 9px; color: var(--text); font-size: 12px; font-weight: 700; }
.commercial-main-needs-panel { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.commercial-main-needs-panel[hidden] { display: none; }
.commercial-existing-need,
.commercial-new-need { display: grid; grid-template-columns: minmax(260px, 1fr) auto; gap: 8px; align-items: end; border: 1px solid var(--line); border-radius: 8px; padding: 9px; background: var(--surface-soft); }
.commercial-existing-need + .commercial-existing-need,
.commercial-new-need + .commercial-new-need { margin-top: 7px; }
.commercial-existing-need label,
.commercial-new-need label { position: relative; display: grid; gap: 3px; min-width: 0; color: var(--muted); font-size: 12px; }
.commercial-action-form-dialog #commercialActionQualification .commercial-context-explanation { font-size: 12px; line-height: 1.4; }
.commercial-action-form-dialog #commercialActionQualification .commercial-known-field { font-size: 12px; }
.commercial-action-form-dialog #commercialActionQualification .commercial-context-list small { font-size: 11px; }
.commercial-new-needs { display: grid; gap: 7px; }
.commercial-need-suggestions { top: calc(100% + 2px); min-width: 310px; }
.commercial-inline-editor { display: grid; grid-template-columns: 1fr 1.7fr .7fr 32px; gap: 6px; margin-top: 7px; }
.commercial-inline-editor.need-row { grid-template-columns: 1fr 1.7fr 90px 32px; }
.commercial-inline-editor button { border: 1px solid var(--line); border-radius: 7px; background: var(--surface-soft); color: var(--red); }
.check-label { display: flex !important; align-items: center; align-self: end; min-height: 35px; }
.check-label input { width: auto; }
.commercial-multi-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.commercial-multi-tags[hidden] { display: none; }
.commercial-multi-tags > span { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 999px; padding: 3px 8px; background: var(--surface-soft); color: var(--text); font-size: 11px; }
.commercial-multi-tags > span > small { color: var(--muted); font-size: 10px; }
.commercial-multi-tags > span > button { border: 0; padding: 0; background: transparent; color: var(--red); font-size: 15px; line-height: 1; }
.commercial-multi-tags > small { color: var(--muted); font-size: 10px; }
.commercial-subcontractor-entry { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; align-items: center; }
.commercial-subcontractor-entry .ghost-btn { min-height: 34px; white-space: nowrap; }

@media (max-width: 820px) {
  .commercial-linked-drawer { width: 100%; }
}

.commercial-identity-validator-dialog {
  width: min(1540px, calc(100vw - 28px));
  height: min(900px, calc(100vh - 28px));
  max-height: calc(100vh - 28px);
  padding: 0;
  border: 0;
  border-radius: 16px;
  color: var(--text);
  background: var(--surface, #fff);
  overflow: hidden;
}
.commercial-identity-validator-dialog::backdrop { background: rgb(18 29 45 / 55%); }
.commercial-identity-validator-shell {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  height: 100%;
  min-height: 0;
}
.commercial-identity-validator-head,
.commercial-identity-validator-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
}
.commercial-identity-validator-head { border-bottom: 1px solid var(--line); }
.commercial-identity-validator-head h2 { margin: 1px 0 2px; font-size: 18px; }
.commercial-identity-validator-head p { margin: 0; color: var(--muted); font-size: 12px; }
.commercial-identity-validator-tabs {
  display: grid;
  grid-template-columns: repeat(5, max-content) minmax(12px, 1fr) max-content;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 6px 16px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.commercial-identity-validator-tabs button.active {
  color: var(--corp);
  border-color: var(--corp);
  background: color-mix(in srgb, var(--corp) 9%, var(--surface, #fff));
}
.commercial-identity-validator-tabs button span { margin-left: 4px; font-size: 11px; }
.commercial-identity-validator-empty { padding: 28px; color: var(--muted); font-size: 13px; }
.commercial-identity-validator-board {
  display: grid;
  grid-template-columns: minmax(260px, 30%) minmax(300px, 35%) minmax(300px, 35%);
  min-height: 0;
  overflow: hidden;
}
.commercial-identity-validator-board[hidden] { display: none; }
.commercial-identity-validator-column {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  padding: 10px;
  border-right: 1px solid var(--line);
  overflow: hidden;
}
.commercial-identity-validator-column:last-child { border-right: 0; }
.commercial-identity-validator-column:first-child {
  /* This column has three children: heading, scrolling list and pager. */
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.commercial-identity-validator-column > header { display: flex; align-items: center; gap: 7px; min-height: 28px; }
.commercial-identity-validator-column > header > span {
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  color: #fff;
  background: var(--corp);
  font-size: 11px;
  font-weight: 800;
}
.commercial-identity-validator-column h3 { margin: 0; font-size: 14px; }
.commercial-identity-validator-help,
.commercial-identity-validator-none { margin: 3px 0 7px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.commercial-identity-validator-context-note {
  margin: 3px 0 7px;
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--blue-dark);
  background: color-mix(in srgb, var(--blue) 8%, var(--surface, #fff));
  font-size: 10px;
  line-height: 1.35;
}
.commercial-identity-validator-list { min-height: 0; overflow: auto; }
.commercial-identity-validator-found {
  display: grid;
  width: 100%;
  min-height: 52px;
  gap: 1px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text);
  background: transparent;
  text-align: left;
}
.commercial-identity-validator-found + .commercial-identity-validator-found { margin-top: 3px; }
.commercial-identity-validator-found:hover { border-color: var(--line); background: var(--surface, #fff); }
.commercial-identity-validator-found.active {
  border-color: var(--corp);
  background: color-mix(in srgb, var(--corp) 9%, var(--surface, #fff));
}
.commercial-identity-validator-found strong { font-size: 13px; }
.commercial-identity-validator-found span,
.commercial-identity-validator-found small { color: var(--muted); font-size: 11px; line-height: 1.25; }
.commercial-identity-validator-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
}
.commercial-identity-validator-option + .commercial-identity-validator-option { margin-top: 4px; }
.commercial-identity-validator-option.selected { border-color: var(--corp); box-shadow: inset 2px 0 var(--corp); }
.commercial-identity-validator-option.official,
.commercial-identity-validator-option.potential {
  background: color-mix(in srgb, #159447 9%, var(--surface, #fff));
}
.commercial-identity-validator-option.provisional { background: color-mix(in srgb, #7a8490 7%, var(--surface, #fff)); }
.commercial-identity-validator-option > span { display: grid; gap: 1px; min-width: 0; }
.commercial-identity-validator-option strong {
  min-width: 0;
  overflow: visible;
  font-size: 12px;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}
.commercial-identity-validator-option small { color: var(--muted); font-size: 10px; line-height: 1.25; }
.commercial-identity-validator-contact-details {
  display: grid;
  gap: 1px;
  margin-top: 3px;
  min-width: 0;
}
.commercial-identity-validator-contact-details small {
  overflow-wrap: anywhere;
  white-space: normal;
}
.commercial-identity-validator-contact-details b { color: var(--text); font-weight: 700; }
.commercial-identity-validator-contact-details .match-reason {
  color: #126a35;
  font-weight: 650;
}
.commercial-identity-validator-status {
  padding: 2px 5px;
  border-radius: 999px;
  color: #4e5865;
  background: #e6e9ed;
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}
.commercial-identity-validator-status.official,
.commercial-identity-validator-status.potential { color: #126a35; background: #d9f2e2; }
.commercial-identity-validator-manual {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 6px;
  padding-top: 7px;
}
.commercial-identity-validator-manual label { display: grid; gap: 2px; color: var(--muted); font-size: 11px; }
.commercial-identity-validator-manual input { width: 100%; min-height: 30px; }
.commercial-identity-validator-pages {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-top: 7px;
}
.commercial-identity-validator-pages span { color: var(--muted); font-size: 11px; }
.commercial-identity-validator-footer { min-height: 48px; border-top: 1px solid var(--line); }
.commercial-identity-validator-footer p { margin: 0; color: var(--muted); font-size: 12px; }
.commercial-identity-validator-footer-actions { display: flex; align-items: center; gap: 8px; }
@media (max-width: 980px) {
  .commercial-identity-validator-board { grid-template-columns: minmax(220px, 30%) minmax(260px, 35%) minmax(260px, 35%); overflow-x: auto; }
  .commercial-identity-validator-column { min-width: 260px; }
}

.commercial-review-body { max-height: calc(100vh - 180px); overflow: auto; padding: 16px 18px; }
.commercial-review-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.commercial-review-grid article,
.commercial-review-body section { border: 1px solid var(--line); border-radius: 8px; padding: 9px; background: var(--surface-soft); }
.commercial-review-grid span { display: block; color: var(--muted); font-size: 11px; }
.commercial-review-body section { margin-top: 9px; }
.commercial-review-body section h3 { margin: 0 0 5px; font-size: 12px; }
.commercial-review-body section p { margin: 0; white-space: pre-wrap; font-size: 12px; }

.commercial-schedule-filter { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.commercial-schedule-filter button { min-height: 32px; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; background: var(--surface); color: var(--text); font: inherit; font-size: 12px; }
.commercial-schedule-filter button.active { border-color: var(--corp); background: var(--corp-soft); color: var(--corp); font-weight: 700; }
.commercial-schedule-filter span { margin-left: 4px; color: var(--muted); font-size: 12px; }
.commercial-schedule-counters { display: flex; gap: 8px; }
.commercial-schedule-counters span { border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px; background: var(--surface-soft); color: var(--muted); font-size: 11px; }
.commercial-schedules-table-wrap {
  align-self: start;
  height: fit-content;
  min-height: 0;
}
.commercial-schedules-table { min-width: 1885px; height: auto; }
.commercial-schedules-table tbody tr { height: 24px; }
.commercial-schedules-table th:nth-child(1) { width: 125px; }
.commercial-schedules-table th:nth-child(2) { width: 145px; }
.commercial-schedules-table th:nth-child(2),
.commercial-schedules-table td:nth-child(2) { overflow: visible; text-overflow: clip; }
.commercial-schedules-table th:nth-child(3) { width: 115px; }
.commercial-schedules-table th:nth-child(4) { width: 180px; }
.commercial-schedules-table th:nth-child(5) { width: 180px; }
.commercial-schedules-table th:nth-child(6) { width: 145px; }
.commercial-schedules-table th:nth-child(7) { width: 210px; }
.commercial-schedules-table th:nth-child(8) { width: 120px; }
.commercial-schedules-table th:nth-child(9) { width: 175px; }
.commercial-schedules-table th:nth-child(10) { width: 250px; }
.commercial-schedules-table th:nth-child(11) { width: 240px; }

.commercial-reprogram-dialog {
  width: min(680px, calc(100vw - 36px));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}
.commercial-reprogram-dialog::backdrop { background: rgba(13, 26, 38, .55); }
.commercial-reprogram-dialog form { margin: 0; }
.commercial-reprogram-body { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 10px; padding: 16px 18px; }
.commercial-reprogram-body label { display: grid; align-content: start; gap: 4px; color: var(--muted); font-size: 12px; }
.commercial-reprogram-body input[type="text"] { width: 100%; min-height: 35px; border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; background: var(--field); color: var(--text); font: inherit; font-size: 13px; }
.commercial-reprogram-body .commercial-reprogram-all-day { grid-column: 1 / -1; justify-self: start; }
.commercial-reprogram-body > p { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 11px; }

.commercial-followup-text { min-width: 360px; white-space: pre-wrap !important; line-height: 1.4; }

@media (max-width: 1180px) {
  .commercial-actions-module .commercial-actions-toolbar { grid-template-columns: minmax(220px, 1.6fr) repeat(3, minmax(115px, 1fr)); }
  .commercial-action-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .commercial-form-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .commercial-context-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .commercial-review-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .commercial-known-group,
  .commercial-main-needs-panel { grid-template-columns: 1fr; }
  .commercial-existing-need,
  .commercial-new-need { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

@media (max-width: 650px) {
  .commercial-form-grid.four,
  .commercial-form-grid.three { grid-template-columns: minmax(0, 1fr); }
}

/* Actividad comercial por empleado */
.commercial-visits-module {
  --commercial-report-header: #dfe7ee;
  --commercial-report-tracking: #edf4fa;
  --commercial-report-note: #fffceb;
  --commercial-report-note-title: #6b5d24;
  --commercial-report-muted: #53616f;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  color: var(--text);
}

.commercial-visits-toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
  gap: 10px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line, #d8dde5);
  border-radius: 14px;
  background: #fff;
}

.commercial-visits-toolbar label,
.commercial-smart-search {
  display: grid;
  gap: 5px;
  min-width: 0;
  font-size: 12px;
  color: #4c5668;
}

.commercial-visits-toolbar input,
.commercial-visits-toolbar select,
.commercial-smart-search input,
.commercial-smart-search select {
  width: 100%;
  min-width: 0;
}

.commercial-visits-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

#commercialVisitsImportReceipt { min-width: 0; max-width: 100%; }
#commercialVisitsImportReceipt .active-filter { display: block; overflow-wrap: anywhere; font-size: 13px; line-height: 1.5; padding: 12px; font-weight: normal; }
#commercialVisitsImportReceipt ul { max-height: 18rem; overflow: auto; padding-right: 1rem; }
#commercialVisitsImportReceipt pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.commercial-visits-status.error {
  color: #8f1f2b;
  border-color: #e5b4ba;
  background: #fff2f3;
}

.commercial-visits-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.commercial-visits-kpis article,
.commercial-visits-card {
  border: 1px solid var(--line, #d8dde5);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
}

.commercial-visits-kpis article {
  display: grid;
  gap: 5px;
  padding: 13px 15px;
}

.commercial-visits-kpis span {
  color: var(--muted);
  font-size: 13px;
}

.commercial-visits-kpis strong {
  color: var(--ink);
  font-size: 23px;
}

.commercial-visits-report-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.commercial-visits-card {
  min-width: 0;
  padding: 14px;
}

.commercial-visits-card h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.commercial-visits-detail-card { margin-top: 12px; }

.commercial-visits-table-wrap {
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.commercial-visits-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.commercial-visits-table-wrap th,
.commercial-visits-table-wrap td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.commercial-visits-table-wrap tr.commercial-summary-total td {
  background: var(--surface-soft);
  border-top: 2px solid #c7d1dc;
  font-weight: 700;
}

.commercial-monthly-table { min-width: 1480px; }
.commercial-monthly-table th,
.commercial-monthly-table td { padding-top: 13px; padding-bottom: 13px; text-align: center; vertical-align: middle; }
.commercial-monthly-table th { padding-top: 12px; padding-bottom: 12px; text-align: center; vertical-align: middle; }
.commercial-monthly-table .commercial-data-pill {
  box-sizing: border-box;
  width: 122px;
  min-width: 122px;
}
.commercial-client-activity-table th:not(:first-child),
.commercial-client-activity-table td:not(:first-child) { text-align: center; vertical-align: middle; }
.commercial-data-pill {
  display: inline-flex;
  min-width: 54px;
  max-width: 100%;
  align-items: center;
  justify-content: center;
  padding: 3px 12px;
  border-radius: 999px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}
.commercial-data-pill-client { color: #245a8d; background: #e7f1ff; }
.commercial-data-pill-non-client { color: #91423e; background: #fdebea; }
.commercial-data-pill-unidentified { color: #596273; background: #edf0f3; }
.commercial-data-pill-missing-client { color: #6b5a3f; background: #f6f1e8; }
.commercial-data-pill-accepted { color: #166c43; background: #def3e7; }
.commercial-data-pill-rejected { color: #a13f3a; background: #f9dddd; }
.commercial-data-pill-pending { color: #7a4a00; background: #fff0bd; }

.commercial-visits-table-wrap th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-soft);
  color: var(--text);
}

.commercial-visits-detail-table { min-width: 1420px; }
.commercial-visits-detail-table .commercial-client-cell { min-width: 200px; white-space: normal; }
.commercial-client-cell small { display: block; margin-top: 3px; color: #8a5260; }
.commercial-visits-detail-table .commercial-observation-cell { min-width: 280px; max-width: 420px; white-space: normal; }
.commercial-visits-note { color: var(--muted); font-size: 13px; line-height: 1.45; }
.commercial-visits-empty { padding: 52px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 14px; }

.commercial-client-report-list { display: grid; min-width: 0; gap: 34px; margin-top: 20px; }
.commercial-client-report-card { min-width: 0; max-width: 100%; overflow: hidden; padding: 0; border: 2px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 3px 10px rgb(32 49 68 / 5%); }
.commercial-client-report-head { display: grid; grid-template-columns: minmax(210px, .7fr) minmax(0, 2.3fr); gap: 18px; align-items: start; margin: 0; padding: 14px; border-bottom: 1px solid var(--line); background: var(--commercial-report-header); }
.commercial-client-report-head h3 { margin: 3px 0; font-size: 17px; }
.commercial-client-report-head p { margin: 0; color: var(--commercial-report-muted); font-size: 14px; }
.commercial-client-kind { color: var(--blue-dark); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.commercial-client-classification-reference { display: block; margin-top: 4px; color: #657184; font-size: 11px; line-height: 1.3; }
.commercial-client-classification { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; margin: 0; padding: 8px 14px; border-bottom: 1px solid #cbd7e2; font-size: 12px; line-height: 1.35; }
.commercial-client-classification strong { font-size: 12px; }
.commercial-client-classification-client { color: #245a8d; background: #e7f1ff; }
.commercial-client-classification-non_client { color: #91453f; background: #fbe8e6; }
.commercial-client-classification-unidentified { color: #566174; background: #eef1f5; }
.commercial-client-classification-missing_client { color: #765d17; background: #fff5d9; }
.commercial-client-classification-lifecycle { color: #43388d; background: #efedff; }
.commercial-client-stage-summary { border-width: 0 0 1px; border-radius: 0; }
.commercial-client-stage-summary table { min-width: 760px; }
.commercial-client-stage-divider th { background: #edf3fb; color: #284f78; text-align: left; padding: 7px 9px; }
.commercial-client-metrics { display: grid; min-width: 0; grid-template-columns: repeat(6, minmax(0, 1fr)); margin: 0; border: 0; border-radius: 8px; overflow: hidden; }
.commercial-client-metrics div { min-width: 0; padding: 6px 7px; border: 0; text-align: center; }
.commercial-client-metrics dt,
.commercial-client-tracking dt { color: var(--commercial-report-muted); font-size: 12px; }
.commercial-client-metrics dd { margin: 4px 0 0; color: var(--ink); font-size: 13px; font-weight: 700; line-height: 1.25; white-space: normal; }
.commercial-client-tracking { display: grid; grid-template-columns: repeat(3, minmax(130px, 1fr)); margin: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; overflow: hidden; background: var(--commercial-report-tracking); }
.commercial-client-tracking div { display: grid; gap: 4px; padding: 9px 11px; border-right: 1px solid var(--line); text-align: center; background: var(--commercial-report-tracking); }
.commercial-client-tracking div:last-child { border-right: 0; }
.commercial-client-tracking dd { margin: 0; color: var(--ink); font-size: 13px; font-weight: 700; }
.commercial-client-detail-table { min-width: 1450px; table-layout: fixed; }
.commercial-client-detail-table th:nth-child(1) { width: 6%; }
.commercial-client-detail-table th:nth-child(2) { width: 9%; }
.commercial-client-detail-table th:nth-child(3),
.commercial-client-detail-table th:nth-child(4) { width: 6%; }
.commercial-client-detail-table th:nth-child(5) { width: 7%; }
.commercial-client-detail-table th:nth-child(6) { width: 9%; }
.commercial-client-detail-table th:nth-child(7) { width: 7%; }
.commercial-client-detail-table th:nth-child(8) { width: 7%; }
.commercial-client-detail-table th:nth-child(9) { width: 16%; }
.commercial-client-detail-table th:nth-child(10) { width: 8%; }
.commercial-client-detail-table th:nth-child(11) { width: 19%; }
.commercial-stacked-cell { min-width: 170px; white-space: normal !important; }
.commercial-stacked-cell small { display: block; margin-top: 3px; color: var(--muted); }
.commercial-client-report-card > .commercial-visits-table-wrap,
.commercial-client-sequence .commercial-visits-table-wrap { border-radius: 0; border-right: 0; border-left: 0; }
.commercial-client-report-card > .commercial-visits-table-wrap { border-top: 0; border-bottom-color: #cbd7e2; }
.commercial-client-sequence { margin: 0; }
.commercial-client-sequence h4 { margin: 0; padding: 10px 10px 7px; border-top: 1px solid #cbd7e2; font-size: 14px; }
.commercial-client-detail-table th:nth-child(1),
.commercial-client-detail-table td:nth-child(1),
.commercial-client-detail-table th:nth-child(3),
.commercial-client-detail-table td:nth-child(3),
.commercial-client-detail-table th:nth-child(4),
.commercial-client-detail-table td:nth-child(4),
.commercial-client-detail-table th:nth-child(5),
.commercial-client-detail-table td:nth-child(5),
.commercial-client-detail-table th:nth-child(6),
.commercial-client-detail-table td:nth-child(6),
.commercial-client-detail-table th:nth-child(7),
.commercial-client-detail-table td:nth-child(7) { text-align: center; vertical-align: middle; }
.commercial-sequence-total th,
.commercial-sequence-total td { border-top: 2px solid var(--line); background: var(--surface-soft); font-weight: 800; }
.commercial-sequence-total th { text-align: right; }
.commercial-sequence-observation td { padding: 8px 11px 10px; color: var(--text); white-space: normal; background: var(--commercial-report-note); text-align: left !important; }
.commercial-sequence-observation strong,
.commercial-sequence-observation span { display: block; }
.commercial-sequence-observation strong { margin-bottom: 4px; color: var(--commercial-report-note-title); }
.commercial-sequence-observation span { font-weight: 400; line-height: 1.4; }
.commercial-identity-note { margin: 9px 2px 0; line-height: 1.55; }
.commercial-sequence-main td { border-bottom: 0; }

@media (max-width: 1180px) {
  .commercial-visits-toolbar { grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr)); }
  .commercial-visits-kpis { grid-template-columns: repeat(3, minmax(130px, 1fr)); }
  .commercial-visits-report-grid { grid-template-columns: 1fr; }
}

@media (prefers-color-scheme: dark) {
  .commercial-visits-module {
    --commercial-report-header: var(--surface-raised);
    --commercial-report-tracking: var(--surface-soft);
    --commercial-report-note: var(--badge-yellow-bg);
    --commercial-report-note-title: #ffe7a3;
    --commercial-report-muted: var(--muted);
  }
  :root {
    --bg: #101820;
    --surface: #17222c;
    --surface-soft: #1d2a35;
    --surface-strong: #131d26;
    --surface-raised: #1f2e3a;
    --field: #111b24;
    --line: #314251;
    --text: #edf3f8;
    --muted: #a9b6c2;
    --blue: #2f9fe0;
    --blue-dark: #67b7ea;
    --corp: #8d86ff;
    --corp-soft: #28264a;
    --corp-shadow: rgba(141, 134, 255, 0.24);
    --green: #62c58d;
    --orange: #ff9f3f;
    --commercial-state-pending: #ffb45c;
    --commercial-state-confirmed: #7cdda6;
    --yellow: #ffe066;
    --yellow-text: #302500;
    --red: #ff5a61;
    --purple: #aa9cff;
    --ink: #e4edf5;
    --shadow: 0 18px 42px rgba(0, 0, 0, 0.32);
    --nav-bg: #1b2833;
    --chip-bg: #263543;
    --reply-bg: #20303c;
    --modal-backdrop: rgba(0, 0, 0, 0.62);
    --badge-default-bg: #283746;
    --badge-default-text: #d6e0e8;
    --badge-red-bg: #4a232b;
    --priority-red-bg: #c92831;
    --badge-orange-bg: #49331d;
    --priority-orange-bg: #d96f18;
    --badge-yellow-bg: #4a3d17;
    --priority-yellow-bg: #d6b33a;
    --badge-blue-bg: #20384a;
    --badge-green-bg: #1d3d2e;
    --priority-green-bg: #2e875b;
    --badge-purple-bg: #302852;
  }
}

* { box-sizing: border-box; }

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 0;
  max-width: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, select, textarea { font: inherit; }

.workspace-version-badge {
  position: fixed;
  right: 14px;
  bottom: 12px;
  z-index: 80;
  min-width: 120px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  box-shadow: 0 10px 24px rgba(28, 45, 61, 0.12);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  pointer-events: none;
}

.workspace-version-badge[data-environment="prueba"] {
  border-color: #d9ad3f;
  background: #fff3cf;
  color: #6b4a00;
}

.workspace-version-badge[data-environment="produccion"] {
  border-color: #35af62;
  background: #e4f8eb;
  color: #146234;
}

.workspace-version-badge[data-environment="local"] {
  border-color: var(--line);
  background: var(--surface-raised);
  color: var(--muted);
}

.manual-refresh {
  display: none !important;
}

.module-refresh-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
  margin-left: auto;
  flex-wrap: wrap;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.15;
  white-space: nowrap;
}

.module-refresh-meta > button {
  border: 0;
  padding: 0;
  min-height: 24px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: inherit;
  cursor: pointer;
}
.module-refresh-meta > button:disabled { cursor: default; opacity: 1; }
.module-refresh-meta > button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.module-refresh-meta span + span,
.module-refresh-meta button + span {
  padding-left: 8px;
  border-left: 1px solid var(--line);
}

@media (max-width: 760px) {
  .module-refresh-meta {
    justify-self: start;
    white-space: normal;
  }
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 28px;
  overflow: auto;
  background: linear-gradient(180deg, #f7f8fa 0%, #eef2f5 100%);
}

.analysis-gate {
  width: min(720px, calc(100vw - 40px));
  display: flex;
  flex-direction: column;
  justify-items: center;
  align-items: center;
  justify-content: center;
  gap: 28px;
}

.analysis-gate-logo {
  width: min(420px, 58vw, 42vh);
  max-height: min(420px, 42vh);
  object-fit: contain;
  filter: drop-shadow(0 18px 28px rgba(28, 45, 61, 0.14));
}

.analysis-gate-fields {
  width: min(420px, calc(100vw - 44px));
  display: grid;
  gap: 12px;
}

.analysis-gate-fields label {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-weight: 560;
}

.analysis-gate-fields input {
  width: 100%;
  height: 40px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: #17212b;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.65);
}

.login-card {
  width: min(380px, calc(100vw - 34px));
  display: grid;
  gap: 12px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.global-announcement {
  position: relative;
  width: min(920px, calc(100vw - 48px));
  padding: 36px 54px 28px;
  border: 1px solid rgba(62, 119, 158, .24);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(247, 251, 253, .97) 0%, rgba(232, 243, 249, .96) 100%);
  box-shadow: 0 28px 80px rgba(17, 31, 48, .28);
  backdrop-filter: blur(18px);
  text-align: center;
  box-sizing: border-box;
  max-height: min(76dvh, 700px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.global-announcement-close { position:absolute; top:14px; right:16px; width:36px; height:36px; border:0; border-radius:50%; background:rgba(20,37,58,.08); color:#26384b; font-size:27px; cursor:pointer; }
.global-announcement h1 { margin: 4px 0 14px; color:#14263a; font-size:1.18rem; line-height:1.3; }
.global-announcement .eyebrow { font-size:.76rem; }
.global-announcement-message { margin:0 auto 18px; width:100%; max-width:800px; min-height:0; overflow-y:auto; overscroll-behavior:contain; white-space:pre-wrap; color:#293c50; font-family:"Trebuchet MS", Trebuchet, Arial, sans-serif; font-size:10pt; line-height:1.45; padding:2px 10px 10px; box-sizing:border-box; }
.global-announcement-message strong { color:#14263a; font-weight:700; }
.global-announcement > .primary-btn { flex:0 0 auto; align-self:center; }
@media (max-width: 640px) { .global-announcement { width:calc(100vw - 28px); padding:42px 22px 26px; max-height:calc(100dvh - 28px); } }
.security-announcement-panel { grid-column:1/-1; background:#fff; border:1px solid #dce4ea; border-radius:14px; padding:18px; }
.security-announcement-panel textarea { width:100%; box-sizing:border-box; margin-top:14px; resize:vertical; border:1px solid #cbd6df; border-radius:10px; padding:12px; font:inherit; line-height:1.45; }
.security-announcement-actions { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-top:12px; }

.login-logo {
  width: 82px;
  height: auto;
  object-fit: contain;
  justify-self: start;
  margin-bottom: 2px;
}

.login-card h1 {
  margin-bottom: 4px;
  font-weight: 600;
}

.login-card label {
  gap: 6px;
  font-weight: 520;
}

.login-card input {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--field);
  color: var(--text);
}

.login-error {
  margin: 0;
  padding: 9px 10px;
  border-radius: 7px;
  background: var(--badge-red-bg);
  color: var(--red);
  font-weight: 560;
}

.login-debug {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.topbar {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 5px 14px;
  background: var(--surface-strong);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 700;
  isolation: isolate;
}

.brand,
.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.brand-trigger {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  padding: 4px 8px 4px 4px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  transition: background 0.14s ease, box-shadow 0.14s ease;
}

.brand-trigger:hover,
.brand-trigger[aria-expanded="true"] {
  background: var(--corp-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--corp) 24%, transparent);
}

.brand-trigger:focus-visible {
  outline: 2px solid var(--corp);
  outline-offset: 2px;
}

.brand-copy {
  display: block;
  min-width: 0;
}

.brand-menu-indicator {
  width: 8px;
  height: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.16s ease;
}

.brand-trigger[aria-expanded="true"] .brand-menu-indicator {
  transform: rotate(225deg) translate(-1px, -1px);
}

.workspace-menu-search-shell {
  position: relative;
  flex: 0 1 400px;
  width: 400px;
  min-width: 240px;
}

.workspace-global-status {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
  min-width: 0;
}

.workspace-menu-search-input {
  width: 100%;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--field);
  color: var(--text);
  font: inherit;
}

.workspace-menu-search-input:focus {
  border-color: var(--corp);
  outline: 2px solid color-mix(in srgb, var(--corp) 20%, transparent);
}

.workspace-menu-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 1200;
  display: grid;
  gap: 3px;
  max-height: min(420px, calc(100vh - 78px));
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.2);
}

.workspace-menu-suggestions[hidden] {
  display: none;
}

.workspace-menu-suggestion {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  padding: 7px 10px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 520;
  text-align: left;
  cursor: pointer;
}

.workspace-menu-suggestion strong,
.workspace-menu-suggestion small {
  display: block;
}

.workspace-menu-suggestion small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

.workspace-menu-suggestion:hover,
.workspace-menu-suggestion:focus-visible,
.workspace-menu-suggestion.is-focused {
  outline: 0;
  background: var(--corp-soft);
  color: var(--corp);
}

body.workspace-menu-open {
  overflow: hidden;
}

body.workspace-menu-open .topbar {
  z-index: 1100;
}

.workspace-navigation-layer {
  position: fixed;
  inset: 52px 0 0;
  z-index: 1050;
  background: rgba(16, 24, 40, 0.2);
  backdrop-filter: blur(1px);
}

.workspace-navigation-layer[hidden] {
  display: none;
}

.workspace-navigation {
  width: min(360px, calc(100vw - 24px));
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface-strong);
  border-right: 1px solid var(--line);
  box-shadow: 18px 0 36px rgba(15, 23, 42, 0.18);
  animation: workspace-menu-enter 0.16s ease-out;
}

@keyframes workspace-menu-enter {
  from { transform: translateX(-14px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.workspace-navigation-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 16px 10px;
}

.workspace-navigation-head .eyebrow {
  margin: 0 0 2px;
}

.workspace-navigation-head h2 {
  margin: 0;
  font-size: 18px;
}

.workspace-menu-close {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-raised);
  color: var(--muted);
  font-size: 23px;
  line-height: 1;
  cursor: pointer;
}

.workspace-menu-close:hover {
  border-color: color-mix(in srgb, var(--corp) 45%, var(--line));
  color: var(--corp);
  background: var(--corp-soft);
}

.workspace-navigation-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}

.workspace-navigation-footer .user-chip {
  min-width: 0;
}

.workspace-navigation-footer .user-chip > span:last-child {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.workspace-navigation-footer .user-chip strong,
.workspace-navigation-footer .user-chip small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip > span:not(.user-avatar) {
  display: grid;
  gap: 1px;
  line-height: 1.12;
}

.user-chip small {
  display: block;
}

.user-actions {
  display: grid;
  gap: 5px;
  justify-items: stretch;
}

.header-build-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
  opacity: 0.7;
  text-align: center;
}

.logout-btn {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-raised);
  color: var(--muted);
  padding: 0 9px;
  font-weight: 560;
  cursor: pointer;
}

.logout-btn:hover {
  border-color: color-mix(in srgb, var(--corp) 45%, var(--line));
  color: var(--corp);
  background: var(--corp-soft);
}

.brand-logo {
  width: auto;
  height: 30px;
  max-width: 70px;
  object-fit: contain;
  border-radius: 0;
  background: transparent;
}

.brand-title { font-size: 15px; font-weight: 600; }

.brand-subtitle,
.user-chip small,
.eyebrow,
.detail-meta,
.ticket-card small {
  color: var(--muted);
  font-size: 11px;
}

.main-nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0 10px 14px;
  scrollbar-width: thin;
}

.nav-section {
  display: grid;
  gap: 3px;
  padding: 11px 6px;
  border-top: 1px solid var(--line);
}

.nav-section:first-child {
  border-top: 0;
  padding-top: 2px;
}

.nav-section[hidden] {
  display: none;
}

.nav-section h3 {
  margin: 0 8px 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 720;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-item {
  position: relative;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  width: 100%;
  min-height: 34px;
  padding: 7px 12px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  text-align: left;
  transition: background 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}

.nav-badge,
.ticket-unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--red);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 0 0 3px var(--badge-red-bg);
}

.nav-badge {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
}

.nav-item.active .nav-badge {
  box-shadow: 0 0 0 3px color-mix(in srgb, #ffffff 58%, var(--badge-red-bg));
}

.nav-item:hover {
  background: color-mix(in srgb, var(--corp) 18%, var(--surface));
  color: var(--corp);
  box-shadow: inset 0 0 0 1px rgba(55, 48, 143, 0.18);
}

.nav-item.active {
  color: #fff;
  background: var(--corp);
  box-shadow: 0 8px 16px var(--corp-shadow);
}

.module-subnav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  border-bottom: 1px solid #dfe2e8;
}

.commercial-subnav { margin: -4px 0 14px; }
.commercial-subnav[hidden] { display: none; }

.module-subnav button {
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  padding: 9px 13px;
  font: inherit;
  white-space: nowrap;
  cursor: pointer;
}

.module-subnav button:hover {
  color: var(--corp);
}

.module-subnav button.active {
  color: var(--corp);
  border-bottom-color: var(--corp);
  font-weight: 700;
}

.user-chip { justify-self: end; }

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 560;
}

.version-update-banner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-height: 34px;
  gap: 6px;
  padding: 0 12px;
  background: #fff3cd;
  color: #5a4500;
  border: 2px solid #d9b85f;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(217, 184, 95, 0.14);
  animation: updatePulse 1.8s ease-in-out infinite;
}

.version-update-icon {
  font-size: 16px;
  line-height: 1;
}

.version-update-banner:hover {
  background: #ffd666;
  border-color: #c28a00;
}

@keyframes updatePulse {
  0%, 100% {
    background: #fff3cd;
    border-color: #d9b85f;
    box-shadow: 0 0 0 1px rgba(217, 184, 95, 0.14);
  }
  50% {
    background: #ffd666;
    border-color: #c28a00;
    box-shadow: 0 0 0 5px rgba(255, 214, 102, 0.22);
  }
}

.workspace-shell {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 5px 16px 10px;
  overflow: hidden;
}

.module-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  min-height: 40px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  display: none;
  margin: 0;
  text-transform: uppercase;
  font-weight: 560;
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: var(--workspace-page-title); line-height: 1.3; font-weight: 680; }
h2 { margin-bottom: 4px; font-size: 16px; line-height: 1.35; font-weight: 650; }
h3 { font-size: var(--workspace-section-title); line-height: 1.35; }

.title-line {
  display: flex;
  align-items: center;
  gap: 9px;
}

.activity-badge,
.reply-alert {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-weight: 560;
}

.activity-badge {
  min-height: 24px;
  padding: 3px 9px;
  font-size: 11px;
  box-shadow: 0 0 0 2px var(--badge-red-bg);
  border: 0;
  cursor: pointer;
}

.activity-badge.empty {
  background: var(--chip-bg);
  color: var(--muted);
}

.activity-badge:not(.empty):hover,
.activity-badge.active {
  box-shadow: 0 0 0 3px var(--badge-red-bg), 0 8px 18px rgba(181, 29, 42, 0.16);
}

.module-actions,
.reply-actions,
.dialog-actions,
.detail-controls,
.board-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.module-filter-toolbar,
.board-toolbar {
  min-height: 40px;
  min-width: 0;
  flex-wrap: wrap;
  border-radius: var(--workspace-radius);
}

[data-screen-type] {
  min-width: 0;
  max-width: 100%;
}

.collapsible-section {
  position: relative;
}

.collapse-toggle {
  flex: 0 0 18px;
  display: inline-grid;
  place-items: center;
  align-self: center;
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--red) 42%, var(--line));
  border-radius: 5px;
  background: color-mix(in srgb, var(--red) 6%, var(--surface-raised));
  color: var(--red);
  cursor: pointer;
  box-shadow: none;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.collapse-toggle::before {
  content: "-";
  line-height: 1;
  transform: translateY(-1px);
}

.collapsible-section.is-collapsed .collapse-toggle {
  border-color: color-mix(in srgb, var(--green) 42%, var(--line));
  background: color-mix(in srgb, var(--green) 8%, var(--surface-raised));
  color: var(--green);
}

.collapsible-section.is-collapsed .collapse-toggle::before {
  content: "+";
  transform: none;
}

.collapse-toggle:hover,
.collapse-toggle:focus-visible {
  box-shadow: 0 0 0 2px color-mix(in srgb, currentColor 18%, transparent);
  outline: 0;
}

.collapsible-section > .collapse-toggle {
  display: none !important;
}

.module-collapse-toggle {
  margin: 0 8px 0 0;
}

.module-collapse-toggle[hidden] {
  display: none !important;
}

.module-collapse-toggle.is-collapsed {
  border-color: color-mix(in srgb, var(--green) 42%, var(--line));
  background: color-mix(in srgb, var(--green) 8%, var(--surface-raised));
  color: var(--green);
}

.module-collapse-toggle.is-collapsed::before {
  content: "+";
  transform: none;
}

.collapsible-section.is-collapsed,
.module-filter-toolbar.collapsible-section.is-collapsed,
.board-toolbar.collapsible-section.is-collapsed,
.summary-groups.collapsible-section.is-collapsed,
.purchase-summary.collapsible-section.is-collapsed {
  display: none !important;
}

.purchase-scale-control {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.purchase-scale-control select {
  width: 66px;
  height: 26px;
  padding: 0 6px;
  font-weight: 520;
}

.purchase-search {
  width: 100%;
  min-height: 26px;
  padding: 0;
}

.primary-btn,
.ghost-btn,
.small-btn,
.icon-btn {
  border: 1px solid transparent;
  border-radius: var(--workspace-radius);
  cursor: pointer;
  min-height: var(--workspace-control-height);
}

.primary-btn {
  background: linear-gradient(135deg, var(--corp), var(--blue));
  color: #fff;
  padding: 0 12px;
  font-weight: 580;
  box-shadow: 0 8px 18px var(--corp-shadow);
}

.ghost-btn,
.small-btn {
  background: var(--surface-raised);
  border-color: #c9d8e5;
  color: var(--blue-dark);
  padding: 0 10px;
}

.small-btn {
  min-height: var(--workspace-control-compact);
  font-size: 11px;
  background: var(--corp-soft);
  border-color: rgba(55, 48, 143, 0.22);
  color: var(--corp);
  font-weight: 560;
}

.ghost-btn:hover,
.small-btn:hover {
  border-color: var(--corp);
  box-shadow: 0 0 0 3px var(--corp-shadow);
}

.ghost-btn.active {
  border-color: var(--corp);
  background: var(--corp-soft);
  color: var(--corp);
}

.icon-btn {
  width: 32px;
  background: var(--chip-bg);
  color: var(--ink);
}

dialog {
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  border: 0;
  border-radius: 10px;
  padding: 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: var(--modal-backdrop);
  backdrop-filter: blur(1px);
}

.dialog-head {
  min-height: 52px;
  align-items: center;
}

.dialog-actions {
  margin-left: auto;
}

.dialog-actions:not(.compact) > :is(.form-error, .muted-note, [aria-live]):first-child {
  margin-right: auto;
}

.dialog-actions:not(.compact) > .danger-btn:first-child {
  margin-right: auto;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-raised);
  color: var(--ink);
}

.summary-groups {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 7px;
  margin-bottom: 7px;
}

.summary-groups.collapsible-section {
  grid-template-columns: 0.95fr 1.05fr;
  align-items: start;
}

.summary-groups.collapsible-section > .collapse-toggle {
  align-self: start;
  margin-top: 5px;
}

.summary-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  padding: 5px;
}

.summary-label {
  display: block;
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 560;
  text-transform: uppercase;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 1fr));
  gap: 5px;
}

.summary-strip.priorities {
  grid-template-columns: repeat(4, minmax(90px, 1fr));
}

.metric {
  --metric-color: var(--blue);
  appearance: none;
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  min-height: 27px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px 7px 3px 10px;
  box-shadow: 0 8px 20px rgba(28, 45, 61, 0.06);
  color: var(--text);
  cursor: pointer;
  overflow: hidden;
  text-align: left;
}

.metric::before,
.home-stat::before,
.purchase-metric::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--metric-color);
}

.metric span {
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 500;
}

.metric strong {
  color: color-mix(in srgb, var(--metric-color) 70%, var(--text));
  font-size: 13px;
  font-weight: 600;
}

.metric[data-scope="pending"],
.metric.metric-ticket-pending { --metric-color: var(--blue); }
.metric[data-scope="active"],
.metric.metric-ticket-active { --metric-color: var(--green); }
.metric.closed,
.metric.metric-ticket-closed { --metric-color: #7b8793; }
.metric.urgent { --metric-color: var(--red); }
.metric.high { --metric-color: var(--orange); }
.metric.medium { --metric-color: #c99a00; }
.metric.low { --metric-color: var(--green); }
.metric:hover,
.metric.active,
.metric.priority-active {
  border-color: color-mix(in srgb, var(--metric-color) 55%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--metric-color) 14%, transparent), 0 8px 20px rgba(28, 45, 61, 0.06);
}

.home-module {
  min-height: calc(100vh - 106px);
  display: grid;
  align-content: start;
  gap: 8px;
}

.home-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--corp) 8%, transparent), transparent 42%),
    var(--surface);
  box-shadow: 0 10px 24px rgba(28, 45, 61, 0.08);
}

.home-hero h2 {
  margin: 0 0 3px;
  font-size: 16px;
}

.home-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.home-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--corp-soft);
  color: var(--corp);
  font-weight: 560;
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: 8px;
}

.home-grid.single-column {
  grid-template-columns: minmax(0, 1fr);
}

.home-column {
  display: grid;
  align-content: start;
  gap: 8px;
}

.home-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 10px 10px 10px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 24px rgba(28, 45, 61, 0.07);
  overflow: hidden;
}

.home-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--blue);
}

.home-card.module-compras::before { background: var(--green); }
.home-card.module-taller::before { background: #006cae; }
.home-card.module-pedidos::before { background: var(--orange); }
.home-card.module-indicadores::before { background: var(--purple); }

.home-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.home-module-name,
.home-status {
  color: var(--muted);
  font-size: 10px;
  font-weight: 540;
  text-transform: uppercase;
}

.home-status {
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--chip-bg);
}

.home-card h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 580;
}

.home-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.26;
}

.home-stat-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.home-stat-section {
  display: grid;
  gap: 6px;
}

.home-stat-section + .home-stat-section {
  margin-top: 2px;
}

.home-stat-section-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 560;
  text-transform: uppercase;
}

.home-stat {
  --metric-color: var(--blue);
  position: relative;
  flex: 0 1 86px;
  min-height: 38px;
  padding: 6px 7px 6px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  overflow: hidden;
}

.home-stat strong {
  display: block;
  color: color-mix(in srgb, var(--metric-color) 72%, var(--text));
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  overflow-wrap: anywhere;
}
.home-card.module-cxc .home-stat { flex: 0 0 auto; min-width: 155px; }
.home-card.module-cxc .home-stat strong { white-space: nowrap; overflow-wrap: normal; font-size: 15px; }

.home-stat span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 560;
  text-transform: uppercase;
}

.home-stat.tone-red { --metric-color: var(--red); }
.home-stat.tone-corp { --metric-color: var(--corp); }
.home-stat.tone-blue { --metric-color: var(--blue); }
.home-stat.tone-cyan { --metric-color: #006cae; }
.home-stat.tone-green { --metric-color: var(--green); }
.home-stat.tone-gray { --metric-color: #7b8793; }
.home-stat.tone-muted { --metric-color: #7b8793; }
.home-stat.tone-neutral { --metric-color: #607080; }
.home-stat.tone-slate { --metric-color: #607d8b; }
.home-stat.tone-gold { --metric-color: #8a6f2a; }
.home-stat.tone-brown { --metric-color: #8a6f2a; }
.home-stat.tone-orange { --metric-color: var(--orange); }
.home-stat.tone-yellow { --metric-color: #c99a00; }
.home-stat.tone-indigo { --metric-color: #5c6bc0; }
.home-stat.tone-purple { --metric-color: #7b3ff2; }
.home-stat.tone-no-delivery { --metric-color: #546a7b; }
.home-stat.tone-ready { --metric-color: #00a651; }
.home-stat.tone-pink { --metric-color: #d0007f; }
.home-stat.tone-magenta { --metric-color: #d0007f; }

.home-stat.tone-magenta.has-items {
  border-color: color-mix(in srgb, #d0007f 56%, var(--line));
  background: #d0007f;
  color: #ffffff;
  animation: rentedMetricPulse var(--pulse-speed) ease-in-out infinite;
}

.home-stat.tone-magenta.has-items strong,
.home-stat.tone-magenta.has-items span {
  color: #ffffff;
}

.home-stat.vital-pulse {
  border-color: color-mix(in srgb, var(--metric-color) 42%, var(--line));
  background: color-mix(in srgb, var(--metric-color) 8%, var(--surface));
  animation: vitalMetricPulse var(--pulse-speed) ease-in-out infinite;
}

.home-stat.vital-pulse strong,
.home-stat.vital-pulse span {
  color: color-mix(in srgb, var(--metric-color) 82%, var(--text));
}

.home-open-btn {
  align-self: flex-start;
  margin-top: 2px;
}

.home-open-btn:disabled {
  opacity: 0.62;
  cursor: not-allowed;
}

.home-empty {
  grid-column: 1 / -1;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 560;
}

.communications-panel {
  display: grid;
  min-width: 0;
  max-width: 100%;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 24px rgba(28, 45, 61, 0.07);
}

.communications-module {
  display: grid;
  min-width: 0;
  max-width: 100%;
  gap: 10px;
}

.monthly-closure-toolbar label {
  min-width: 150px;
}

.monthly-closure-records {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 4px;
}

.monthly-closure-record {
  display: grid;
  gap: 2px;
  min-width: 168px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.monthly-closure-record strong,
.monthly-closure-record span,
.monthly-closure-record small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.monthly-closure-record span,
.monthly-closure-record small {
  color: var(--muted);
  font-size: 12px;
}

.monthly-closure-record.is-active {
  border-color: color-mix(in srgb, var(--corp) 48%, var(--line));
  background: color-mix(in srgb, var(--corp) 8%, var(--surface));
}

.monthly-closure-workspace {
  display: grid;
  gap: 10px;
}

.monthly-closure-month-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.monthly-closure-month-head h3 {
  margin: 0;
  font-size: 18px;
}

.monthly-closure-breadcrumb {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.monthly-closure-breadcrumb-left,
.monthly-closure-breadcrumb-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.monthly-closure-breadcrumb-right {
  margin-left: auto;
}

.monthly-closure-management-btn {
  background: linear-gradient(135deg, var(--corp), var(--blue));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 18px var(--corp-shadow);
}

.monthly-closure-management-btn:disabled {
  opacity: 0.7;
  cursor: wait;
}

.monthly-closure-breadcrumb-right.dragover {
  border-radius: 8px;
  box-shadow: 0 0 0 3px var(--corp-shadow);
  border-color: var(--corp);
  background: var(--corp-soft);
}

.monthly-closure-action-status {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 560;
}

.monthly-closure-action-status.is-error {
  border-color: rgba(245, 130, 32, 0.45);
  background: color-mix(in srgb, var(--orange) 8%, var(--surface));
  color: color-mix(in srgb, var(--orange) 72%, var(--text));
}

.monthly-closure-action-status.is-ok {
  border-color: rgba(31, 138, 88, 0.38);
  background: color-mix(in srgb, var(--green) 8%, var(--surface));
  color: color-mix(in srgb, var(--green) 72%, var(--text));
}

.monthly-closure-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.monthly-closure-folder-list {
  display: grid;
  gap: 8px;
}

.monthly-closure-folder {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.monthly-closure-folder:hover,
.monthly-closure-folder:focus-visible {
  border-color: color-mix(in srgb, var(--corp) 42%, var(--line));
  background: color-mix(in srgb, var(--corp) 5%, var(--surface));
}

.monthly-closure-folder-icon {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--corp) 12%, var(--surface));
  color: var(--corp);
  font-weight: 800;
}

.monthly-closure-folder strong,
.monthly-closure-folder small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.monthly-closure-folder small {
  margin-top: 2px;
  color: var(--muted);
}

.monthly-closure-folder em {
  color: var(--corp);
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.monthly-closure-step-tabs {
  display: flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.monthly-closure-step-tabs button {
  min-width: 96px;
  border: 0;
  border-radius: 6px;
  padding: 7px 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.monthly-closure-step-tabs button.is-active {
  background: var(--surface);
  color: var(--corp);
  box-shadow: 0 1px 4px rgba(26, 36, 52, 0.12);
}

.monthly-closure-section {
  display: grid;
  gap: 10px;
}

.monthly-closure-final {
  display: grid;
  gap: 10px;
}

.monthly-closure-final-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 8px;
}

.monthly-closure-final-grid article {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.monthly-closure-final-grid strong {
  font-size: 16px;
}

.monthly-closure-stats {
  grid-template-columns: repeat(4, minmax(140px, 1fr));
}

.monthly-closure-alert {
  border-color: rgba(198, 91, 26, 0.36);
  background: rgba(255, 247, 237, 0.85);
  color: #8a4c16;
}

.monthly-closure-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.monthly-closure-table th,
.monthly-closure-table td {
  white-space: nowrap;
}

.monthly-closure-table td:nth-child(n+2),
.monthly-closure-table th:nth-child(n+2) {
  text-align: right;
}

.monthly-closure-table td:first-child,
.monthly-closure-table th:first-child {
  text-align: left;
}

.monthly-closure-sales-table td:nth-child(-n+5),
.monthly-closure-sales-table th:nth-child(-n+5) {
  text-align: left;
}

.monthly-closure-forecast {
  display: grid;
  gap: 10px;
}

.monthly-closure-forecast-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.monthly-closure-forecast-summary span {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.monthly-closure-forecast-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  gap: 10px;
}

.monthly-closure-pending-client-table td:nth-child(-n+2),
.monthly-closure-pending-client-table th:nth-child(-n+2) {
  text-align: left;
}

.monthly-closure-total-row td {
  background: rgba(0, 108, 174, 0.08);
  font-weight: 760;
}

.monthly-closure-subhead {
  margin-top: 10px;
}

.monthly-closure-sales-group {
  display: grid;
  gap: 8px;
}

.monthly-closure-sales-group + .monthly-closure-sales-group {
  margin-top: 10px;
}

.monthly-closure-sales-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(0, 108, 174, 0.08);
}

.monthly-closure-pending-summary {
  display: grid;
  gap: 10px;
}

.monthly-closure-pending-group {
  display: grid;
  gap: 8px;
}

.monthly-closure-grand-total {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(0, 108, 174, 0.12);
  color: var(--ink);
}

.monthly-closure-table td span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.monthly-closure-abc-breakdown {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.monthly-closure-abc-wrap {
  overflow-x: auto;
}

.monthly-closure-abc-table {
  min-width: 1780px;
  table-layout: fixed;
  font-size: 12px;
}

.monthly-closure-abc-table th {
  height: 44px;
  white-space: normal;
  line-height: 1.15;
  text-align: center;
  vertical-align: bottom;
  overflow-wrap: normal;
  word-break: normal;
}

.monthly-closure-abc-table td:not(:first-child),
.monthly-closure-abc-table th:not(:first-child) {
  text-align: right;
}

.monthly-closure-abc-table th:first-child,
.monthly-closure-abc-table td:first-child {
  width: 150px;
}

.monthly-closure-abc-table th:nth-child(2),
.monthly-closure-abc-table td:nth-child(2) {
  width: 120px;
}

.monthly-closure-abc-table th:nth-child(n+3),
.monthly-closure-abc-table td:nth-child(n+3) {
  width: 132px;
}

.monthly-closure-title-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.monthly-closure-title-row h3 {
  margin: 0;
}

.monthly-closure-whatsapp-btn {
  border-color: rgba(31, 157, 85, 0.42);
  color: #14733b;
}

.monthly-closure-amount-link {
  appearance: none;
  border: 0;
  padding: 2px 4px;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 720;
  text-align: right;
  text-decoration: none;
  cursor: pointer;
}

.monthly-closure-amount-link:hover,
.monthly-closure-amount-link:focus-visible {
  color: var(--corp);
  background: rgba(0, 108, 174, 0.08);
  outline: none;
}

.monthly-closure-amount-link.is-active {
  color: var(--corp);
  background: rgba(0, 108, 174, 0.12);
  box-shadow: inset 0 0 0 1px rgba(0, 108, 174, 0.22);
}

body.monthly-closure-dialog-open {
  overflow: hidden;
}

.monthly-closure-breakdown-dialog {
  width: min(1480px, calc(100vw - 36px));
  max-height: min(820px, calc(100vh - 36px));
}

.monthly-closure-breakdown-dialog form {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: min(820px, calc(100vh - 36px));
}

.monthly-closure-dialog-head {
  align-items: start;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--line);
}

.monthly-closure-report-search {
  display: grid;
  gap: 4px;
  width: min(340px, 34vw);
  margin-left: auto;
}

.monthly-closure-report-search span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.monthly-closure-report-search input {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  color: var(--ink);
  font: inherit;
  background: #fff;
}

.monthly-closure-dialog-head h2 {
  margin: 4px 0 2px;
  font-size: 22px;
}

.monthly-closure-dialog-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.monthly-closure-breakdown-content {
  display: grid;
  gap: 12px;
  min-height: 0;
  overflow: auto;
  padding: 14px 20px;
}

.monthly-closure-smart-report {
  display: grid;
  gap: 18px;
  color: var(--ink);
}

.monthly-closure-smart-report-head {
  display: grid;
  gap: 10px;
}

.monthly-closure-smart-report-head-with-summary {
  grid-template-columns: minmax(260px, 1fr) minmax(620px, 0.95fr);
  align-items: start;
  gap: 18px;
}

.monthly-closure-smart-report-head h3 {
  margin: 0;
  font-size: 19px;
}

.monthly-closure-report-filter {
  justify-self: end;
  width: min(760px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.monthly-closure-abc-report-filter {
  width: min(960px, 100%);
}

.monthly-closure-abc-report-filter-scroll {
  overflow-x: auto;
}

.monthly-closure-abc-report-filter-table {
  min-width: 1440px;
  table-layout: fixed;
}

.monthly-closure-abc-report-filter-table th,
.monthly-closure-abc-report-filter-table td {
  padding: 5px 7px;
}

.monthly-closure-abc-report-filter-table th {
  height: 42px;
  white-space: normal;
  line-height: 1.12;
  vertical-align: bottom;
  overflow-wrap: normal;
  word-break: normal;
}

.monthly-closure-abc-report-filter-table th:first-child,
.monthly-closure-abc-report-filter-table td:first-child {
  width: 110px;
}

.monthly-closure-abc-report-filter-table th:nth-child(2),
.monthly-closure-abc-report-filter-table td:nth-child(2) {
  width: 105px;
}

.monthly-closure-abc-report-filter-table th:nth-child(n+3),
.monthly-closure-abc-report-filter-table td:nth-child(n+3) {
  width: 118px;
}

.monthly-closure-abc-detail-wrap {
  overflow-x: auto;
}

.monthly-closure-abc-detail-table {
  min-width: 2140px;
  table-layout: fixed;
  font-size: 11px;
}

.monthly-closure-abc-detail-table th,
.monthly-closure-abc-detail-table td {
  padding: 7px 8px;
  vertical-align: top;
}

.monthly-closure-abc-detail-table th {
  height: 52px;
  white-space: normal;
  line-height: 1.15;
  vertical-align: bottom;
  overflow-wrap: normal;
  word-break: normal;
}

.monthly-closure-abc-detail-table th:first-child,
.monthly-closure-abc-detail-table td:first-child {
  width: 58px;
}

.monthly-closure-abc-detail-table th:nth-child(2),
.monthly-closure-abc-detail-table td:nth-child(2) {
  width: 300px;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.2;
}

.monthly-closure-abc-detail-table td:nth-child(n+3) {
  width: 130px;
  white-space: nowrap;
  text-align: right;
}

.monthly-closure-abc-detail-table th:nth-child(n+3) {
  width: 130px;
  text-align: right;
}

.monthly-closure-report-filter-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  background: #f6f9fc;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.monthly-closure-report-filter-title strong {
  color: var(--ink);
  text-transform: none;
}

.monthly-closure-report-filter-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.monthly-closure-report-filter-table th,
.monthly-closure-report-filter-table td {
  padding: 6px 8px;
  border-top: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

.monthly-closure-report-filter-table th:first-child,
.monthly-closure-report-filter-table td:first-child {
  text-align: left;
  font-weight: 700;
}

.monthly-closure-report-filter-table th {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.monthly-closure-breakdown-content .monthly-closure-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f6f9fc;
  box-shadow: 0 1px 0 var(--line);
}

.monthly-closure-report-filter-table.monthly-closure-abc-report-filter-table th {
  height: 42px;
  white-space: normal;
  line-height: 1.12;
  vertical-align: bottom;
  overflow-wrap: normal;
  word-break: normal;
}

.monthly-closure-smart-client {
  display: grid;
  gap: 14px;
  padding-top: 2px;
}

.monthly-closure-smart-client h4 {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef4f9;
  font-size: 14px;
}

.monthly-closure-smart-delivery {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.monthly-closure-smart-delivery + .monthly-closure-smart-delivery {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.monthly-closure-smart-delivery-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: baseline;
}

.monthly-closure-smart-delivery-total,
.monthly-closure-smart-client-total,
.monthly-closure-smart-total {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  align-items: baseline;
}

.monthly-closure-smart-client-total {
  padding-top: 2px;
}

.monthly-closure-smart-total {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(0, 108, 174, 0.1);
  font-size: 15px;
}

.monthly-closure-breakdown-group {
  display: grid;
  gap: 8px;
}

.monthly-closure-breakdown-table {
  font-size: 12px;
}

.monthly-closure-breakdown-table th,
.monthly-closure-breakdown-table td {
  vertical-align: top;
}

.monthly-closure-breakdown-table td:nth-child(n+2),
.monthly-closure-breakdown-table th:nth-child(n+2) {
  text-align: left;
}

.monthly-closure-breakdown-table td:last-child,
.monthly-closure-breakdown-table th:last-child {
  text-align: right;
}

.monthly-closure-breakdown-dialog .dialog-actions {
  padding: 12px 20px 16px;
  border-top: 1px solid var(--line);
}

.monthly-closure-whatsapp-dialog {
  width: min(1180px, calc(100vw - 36px));
  max-height: min(900px, calc(100vh - 36px));
}

.monthly-closure-whatsapp-dialog form {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: min(900px, calc(100vh - 36px));
}

.monthly-closure-whatsapp-dialog .dialog-actions {
  justify-content: flex-start;
  gap: 10px;
  padding: 16px 20px 18px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.monthly-closure-whatsapp-content {
  display: grid;
  gap: 22px;
  min-height: 0;
  overflow: auto;
  padding: 18px 20px;
  background: #f4f6f8;
}

.monthly-closure-whatsapp-content section {
  display: grid;
  gap: 10px;
}

.monthly-closure-whatsapp-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.monthly-closure-whatsapp-section-head h3 {
  margin: 2px 0 0;
  font-size: 16px;
}

.monthly-closure-whatsapp-section-head small,
.monthly-closure-whatsapp-status {
  color: var(--muted);
  font-size: 12px;
}

.monthly-closure-whatsapp-card {
  justify-self: start;
  width: min(760px, 100%);
  overflow: hidden;
  border: 1px solid #cfd8e3;
  border-radius: 12px;
  background: #fff;
  color: #263548;
  box-shadow: 0 10px 28px rgba(20, 36, 56, 0.08);
}

.monthly-closure-whatsapp-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 11px;
  border-bottom: 1px solid #d6dee8;
}

.monthly-closure-whatsapp-card-head span {
  color: #657489;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.monthly-closure-whatsapp-card-head strong {
  font-size: 13px;
}

.monthly-closure-whatsapp-card table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  table-layout: auto;
}

.monthly-closure-whatsapp-card th,
.monthly-closure-whatsapp-card td {
  padding: 7px 9px;
  border-bottom: 1px solid #d6dee8;
  text-align: right;
  white-space: nowrap;
}

.monthly-closure-whatsapp-card th {
  background: #f7f9fb;
  color: #657489;
  font-size: 9px;
  text-transform: uppercase;
}

.monthly-closure-whatsapp-card th:first-child,
.monthly-closure-whatsapp-card td:first-child {
  width: 22%;
  text-align: left;
  font-weight: 750;
}

.monthly-closure-whatsapp-card tbody tr:last-child td {
  border-bottom: 0;
}

.monthly-closure-whatsapp-card tr.is-total td {
  background: #eaf1f8;
  font-weight: 800;
}

.monthly-closure-whatsapp-text {
  width: 100%;
  min-height: 330px;
  resize: vertical;
  border: 1px solid #c8d2de;
  border-radius: 10px;
  padding: 15px 16px;
  background: #fff;
  color: #17212b;
  font: 14px/1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.monthly-closure-whatsapp-text:focus {
  border-color: var(--corp);
  outline: 0;
  box-shadow: 0 0 0 3px var(--corp-shadow);
}

.monthly-closure-whatsapp-status {
  min-height: 18px;
  color: #14733b;
}

@media (max-width: 760px) {
  .monthly-closure-whatsapp-section-head {
    align-items: start;
    flex-direction: column;
    gap: 4px;
  }

  .monthly-closure-whatsapp-card {
    overflow: hidden;
  }

  .monthly-closure-whatsapp-card table {
    min-width: 0;
    font-size: 11px;
  }

  .monthly-closure-whatsapp-card th,
  .monthly-closure-whatsapp-card td {
    padding: 6px 5px;
  }
}

@media print {
  body.monthly-closure-print-active .topbar,
  body.monthly-closure-print-active .module-head,
  body.monthly-closure-print-active .workspace-version-badge,
  body.monthly-closure-print-active .workspace-shell > section,
  body.monthly-closure-print-active .workspace-shell > div {
    display: none !important;
  }

  body.monthly-closure-print-active {
    background: #fff;
  }

  body.monthly-closure-print-active .monthly-closure-breakdown-dialog {
    position: static;
    display: block;
    width: 100%;
    max-height: none;
    box-shadow: none;
    border-radius: 0;
  }

  body.monthly-closure-print-active .monthly-closure-breakdown-dialog form,
  body.monthly-closure-print-active .monthly-closure-breakdown-content {
    display: block;
    max-height: none;
    overflow: visible;
  }

  body.monthly-closure-print-active .monthly-closure-breakdown-dialog .dialog-actions,
  body.monthly-closure-print-active .monthly-closure-dialog-head .icon-btn {
    display: none !important;
  }

  body.monthly-closure-print-active .monthly-closure-table-wrap {
    overflow: visible;
    border: 0;
  }

  body.monthly-closure-print-active .monthly-closure-breakdown-table {
    width: 100%;
    font-size: 9px;
  }
}

@media (max-width: 980px) {
  .monthly-closure-smart-report-head-with-summary {
    grid-template-columns: 1fr;
  }

  .monthly-closure-report-filter {
    justify-self: stretch;
  }
}

.security-module {
  min-height: 0;
}

.security-layout {
  display: grid;
  grid-template-columns: minmax(480px, 1.1fr) minmax(360px, 0.9fr);
  gap: 14px;
  min-height: 0;
}

.security-device-layout {
  display: grid;
  grid-template-columns: minmax(520px, 1fr) minmax(420px, 0.9fr);
  gap: 14px;
  margin-top: 14px;
}

.security-purchase-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(360px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.security-offer-alerts-panel { grid-column:1 / -1; }
.security-offer-alerts-form { display:flex; align-items:end; gap:12px; margin:12px 0 8px; }
.security-offer-alerts-form label { display:grid; gap:6px; max-width:220px; font-weight:700; }
.security-offer-alerts-form input { width:100%; }

.security-users-panel,
.security-editor-panel,
.security-devices-panel {
  min-width: 0;
  min-height: 0;
}

.security-signature-panel { display: grid; gap: 8px; margin-top: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.security-signature-panel small { color: var(--muted); }
.security-email-signature { min-height: 112px; max-height: 260px; overflow: auto; padding: 12px; border: 1px solid var(--line-strong); border-radius: 7px; background: #fff; color: #17212b; outline: none; }
.security-email-signature:focus { border-color: var(--corp); box-shadow: 0 0 0 3px var(--corp-shadow); }
.security-email-signature:empty::before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; }
.security-email-signature img { max-width: 100%; height: auto; }

.security-table-wrap,
.security-permissions-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.security-table,
.security-permissions-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.security-table th,
.security-table td,
.security-permissions-table th,
.security-permissions-table td {
  border-bottom: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.security-table th,
.security-permissions-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.security-table tr[data-security-user] {
  cursor: pointer;
}

.security-table tr[data-security-user]:hover,
.security-table tr.selected {
  background: color-mix(in srgb, var(--corp) 9%, var(--surface));
}

.security-editor-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.security-devices-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.security-editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.security-device-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.security-document-form {
  display: grid;
  grid-template-columns: minmax(130px, 0.8fr) minmax(180px, 1fr) minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
}

.security-collection-panel {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.security-access-panel {
  display: grid;
  gap: 8px;
  margin: 12px 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.security-access-schedule {
  display: grid;
  gap: 6px;
}

.security-access-row {
  display: grid;
  grid-template-columns: minmax(86px, 0.45fr) minmax(86px, 0.45fr) minmax(280px, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.security-access-row label {
  display: grid;
  gap: 2px;
  font-size: 11px;
  color: var(--muted);
}

.security-access-row input {
  min-width: 0;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--field);
  color: var(--text);
  padding: 0 6px;
}

.security-access-days {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.security-access-day {
  display: inline-flex !important;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 4px !important;
  min-height: 28px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text) !important;
  font-weight: 560;
}

.security-access-remove {
  min-height: 30px;
  white-space: nowrap;
}

.security-collection-delegations {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.security-collection-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 12px;
  font-weight: 560;
}

.security-collection-check.all {
  border-color: color-mix(in srgb, var(--corp) 35%, var(--line));
}

.security-permission-delegations {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.security-permission-delegations.hidden {
  display: none;
}

.security-permission-delegations label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 12px;
  font-weight: 560;
}

.security-helper {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
}

.security-table input,
.security-table select {
  width: 100%;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--field);
  color: var(--text);
  padding: 0 8px;
}

.security-editor-grid label,
.security-editor-grid .security-field,
.security-device-form label,
.security-document-form label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.security-field-label { color: var(--muted); font-size: 12px; }
.security-inline-picker { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; align-items: stretch; }
.security-inline-picker .ghost-btn { min-height: 36px; white-space: nowrap; }
.security-offer-code-field,
.security-linked-commercials-field { position: relative; align-content: start; }
.security-multiselect { position: relative; min-width: 0; }
.security-multiselect-button {
  width: 100%; min-height: 36px; padding: 7px 34px 7px 10px; border: 1px solid var(--line);
  border-radius: 7px; background: var(--field); color: var(--muted); text-align: left; cursor: pointer;
}
.security-multiselect-button::after { content: "▾"; position: absolute; right: 11px; color: var(--muted); }
.security-multiselect-button.has-selection { color: var(--text); font-weight: 650; }
.security-multiselect-button[aria-expanded="true"] { border-color: var(--corp); box-shadow: 0 0 0 3px var(--corp-shadow); }
.security-multiselect-panel {
  position: absolute; z-index: 30; top: calc(100% + 5px); left: 0; width: min(520px, 92vw);
  padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-raised);
  box-shadow: 0 16px 38px rgba(23, 33, 43, .2);
}
.security-multiselect-all { display: flex !important; grid-template-columns: auto 1fr; align-items: start; gap: 9px !important; padding: 9px; border-radius: 8px; background: var(--corp-soft); color: var(--text) !important; }
.security-multiselect-all input { margin-top: 2px; }
.security-multiselect-all span { display: grid; gap: 2px; }
.security-multiselect-all small { color: var(--muted); font-weight: 400; }
.security-multiselect-search { width: 100%; margin-top: 8px; }
.security-multiselect-actions { display: flex; gap: 6px; margin: 8px 0; }
.security-multiselect-actions button { min-height: 28px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--corp); cursor: pointer; }
.security-multiselect-options { display: grid; gap: 3px; max-height: 250px; overflow: auto; padding-right: 3px; }
.security-multiselect-option { display: flex !important; grid-template-columns: auto 1fr; align-items: center; gap: 8px !important; min-height: 34px; padding: 5px 7px; border-radius: 7px; color: var(--text) !important; cursor: pointer; }
.security-multiselect-option:hover { background: var(--corp-soft); }
.security-multiselect-option.is-disabled { opacity: .55; cursor: default; }
.security-multiselect-empty { padding: 12px; color: var(--muted); text-align: center; }
.security-multiselect-chips { display: flex; flex-wrap: wrap; gap: 5px; min-height: 0; }
.security-multiselect-chip { min-height: 25px; padding: 3px 7px; border: 1px solid color-mix(in srgb, var(--corp) 35%, var(--line)); border-radius: 999px; background: var(--corp-soft); color: var(--corp); font-size: 11px; font-weight: 700; cursor: pointer; }
.security-multiselect-chip.is-all { cursor: default; }

.security-smart-employee-dialog {
  width: min(900px, calc(100vw - 28px));
  padding: 0;
  border: 0;
  border-radius: 13px;
  background: transparent;
}
.security-smart-employee-dialog form {
  padding: 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--corp) 22%, var(--line));
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(10, 24, 38, 0.24);
}
.security-smart-employee-dialog .dialog-head {
  align-items: flex-start;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-strong);
}
.security-smart-employee-dialog .dialog-head h3 { margin: 3px 0 6px; color: var(--text); font-size: 22px; }
.security-smart-employee-dialog .dialog-head p { margin: 0; color: var(--muted); font-size: 13px; }
.security-smart-catalog-field .ghost-btn { min-height: 38px; justify-self: stretch; }
.security-smart-catalog-section { display: grid; gap: 10px; padding: 16px 20px 4px; }
.security-smart-catalog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.security-smart-catalog-list { display: grid; max-height: 230px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--field); }
.security-smart-catalog-row { display: grid; grid-template-columns: minmax(190px, 1.5fr) minmax(90px, .7fr) minmax(110px, .8fr) 72px 58px; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 7px 10px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.security-smart-catalog-row:last-child { border-bottom: 0; }
.security-smart-catalog-row:hover { background: var(--corp-soft); }
.security-smart-catalog-row.is-inactive { color: var(--muted); background: var(--field); opacity: .72; }
.security-smart-catalog-row > span:first-child { display: grid; gap: 2px; min-width: 0; }
.security-smart-catalog-row small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.security-smart-catalog-edit { color: var(--corp); font-weight: 700; text-align: right; }
.security-smart-catalog-empty { padding: 18px; color: var(--muted); text-align: center; }
.security-smart-editor-head { display: flex; align-items: baseline; gap: 10px; margin: 16px 20px 0; padding-top: 14px; border-top: 1px solid var(--line); }
.security-smart-editor-head span { color: var(--muted); font-size: 12px; }
.security-smart-employee-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 14px; padding: 18px 20px 12px; }
.security-smart-employee-grid label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; }
.security-smart-employee-grid input,
.security-smart-employee-grid select { min-width: 0; min-height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--field); color: var(--text); }
.security-smart-employee-grid small { color: var(--muted); font-weight: 400; }
.security-smart-employee-grid .security-smart-actor-active { display: flex; align-items: center; align-self: end; min-height: 38px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.security-smart-employee-grid .security-smart-actor-active input { min-height: 0; }
.security-smart-employee-dialog .security-helper { margin: 0 20px; padding: 10px 12px; border-radius: 8px; background: var(--corp-soft); }
.security-smart-employee-dialog .dialog-actions { padding: 16px 20px 18px; }

@media (max-width: 760px) {
  .security-inline-picker { grid-template-columns: 1fr; }
  .security-smart-catalog-row { grid-template-columns: minmax(0, 1fr) auto; }
  .security-smart-catalog-row > span:nth-child(2),
  .security-smart-catalog-row > span:nth-child(3),
  .security-smart-catalog-row > span:nth-child(4) { display: none; }
  .security-smart-editor-head { align-items: flex-start; flex-direction: column; }
  .security-smart-employee-grid { grid-template-columns: 1fr; }
}

.security-editor-grid input,
.security-editor-grid select,
.security-device-form input,
.security-document-form input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 9px;
  background: var(--field);
  color: var(--text);
}

.security-editor-grid select {
  height: 34px;
  padding: 0 9px;
  line-height: normal;
}

.security-inheritance-field {
  grid-column: 1 / -1;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--corp) 30%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--corp) 5%, var(--surface));
}

.security-inheritance-field small {
  color: var(--muted);
  line-height: 1.35;
}

.security-active-toggle {
  align-self: end;
}

.security-permissions-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0 8px;
  color: var(--muted);
  font-size: 12px;
}

.security-permissions-head strong {
  color: var(--text);
}

.security-permissions-wrap {
  max-height: min(52vh, 520px);
}

.security-permissions-table td:nth-child(1),
.security-permissions-table td:nth-child(4) {
  width: 92px;
}

.security-permissions-table td:nth-child(3) span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.security-table td span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.security-permission-toggle,
.security-scope-toggle,
.security-document-toggle {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
  background: var(--surface-strong);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
}

.security-invite-dialog form {
  width: min(720px, calc(100vw - 28px));
  padding: 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--corp) 22%, var(--line));
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(10, 24, 38, 0.24);
}

.security-invite-head {
  align-items: flex-start;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-strong);
}

.security-invite-head h3 {
  margin: 3px 0 6px;
  color: var(--text);
  font-size: 22px;
}

.security-invite-head p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.security-invite-close {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 16px;
}

.security-invite-documents {
  display: grid;
  gap: 8px;
  max-height: min(48vh, 360px);
  overflow: auto;
  padding: 16px 20px 8px;
}

.security-invite-document {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.security-invite-document input {
  width: 18px;
  height: 18px;
  accent-color: var(--corp);
}

.security-invite-document span {
  display: grid;
  gap: 2px;
}

.security-invite-document small {
  color: var(--muted);
}

.security-invite-dialog .security-helper {
  margin: 4px 20px 0;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--blue) 24%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--blue) 9%, var(--surface));
}

.security-invite-dialog .dialog-actions {
  padding: 16px 20px 18px;
}

.security-scope-select {
  min-width: 128px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--text);
  font-size: 12px;
}

.communications-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.communications-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.communications-service-strip {
  min-height: 30px;
  align-items: center;
  padding: 2px 0 6px;
  border-bottom: 1px solid var(--line);
}

.mail-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.communications-panel .home-stat {
  min-height: 58px;
  padding-top: 7px;
  padding-bottom: 7px;
}

.communications-panel .home-stat strong {
  font-size: 15px;
}

.service-light-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 620;
}

.service-light-group > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.service-light {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 680;
  white-space: nowrap;
}

.service-light i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent);
}

.service-light.is-on {
  color: #10a35a;
}

.service-light.is-on i {
  background: #20d878;
  box-shadow:
    0 0 0 3px color-mix(in srgb, #20d878 22%, transparent),
    0 0 12px color-mix(in srgb, #20d878 55%, transparent);
  animation: servicePulse 1.8s ease-in-out infinite;
}

.service-light.is-off {
  color: var(--red);
}

@keyframes servicePulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow:
      0 0 0 3px color-mix(in srgb, #20d878 20%, transparent),
      0 0 10px color-mix(in srgb, #20d878 45%, transparent);
  }
  50% {
    transform: scale(1.18);
    box-shadow:
      0 0 0 5px color-mix(in srgb, #20d878 18%, transparent),
      0 0 18px color-mix(in srgb, #20d878 70%, transparent);
  }
}

.mail-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--muted);
  font-size: 11px;
  font-weight: 620;
  white-space: nowrap;
}

.mail-status.tone-green {
  background: var(--badge-green-bg);
  color: var(--green);
}

.mail-status.tone-red {
  background: var(--badge-red-bg);
  color: var(--red);
}

.mail-status.tone-blue {
  background: var(--badge-blue-bg);
  color: var(--blue);
}

.mail-status.tone-orange {
  background: var(--badge-orange-bg);
  color: var(--orange);
}

.mail-status-detail {
  display: block;
  max-width: 220px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.mail-error {
  padding: 9px 10px;
  border: 1px solid color-mix(in srgb, var(--red) 25%, var(--line));
  border-radius: 7px;
  background: var(--badge-red-bg);
  color: var(--red);
  font-weight: 560;
}

.mail-warning {
  padding: 9px 10px;
  border: 1px solid color-mix(in srgb, var(--orange) 28%, var(--line));
  border-radius: 7px;
  background: var(--badge-orange-bg);
  color: var(--orange);
  font-weight: 560;
}

.mail-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.documents-profile-board {
  display: grid;
  gap: 10px;
}

.documents-profile-table-wrap {
  background: var(--surface);
}

.documents-profile-table {
  min-width: 760px;
}

.documents-profile-row.enabled {
  cursor: pointer;
}

.documents-profile-row.enabled:hover,
.documents-profile-row.enabled:focus {
  background: color-mix(in srgb, var(--blue) 8%, var(--surface));
  outline: none;
}

.documents-profile-row.disabled {
  color: var(--muted);
  background: color-mix(in srgb, var(--surface-soft) 72%, var(--surface));
}

.documents-detail-toolbar {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 8px;
}

.documents-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 7px;
  margin: 10px 0;
}

.documents-summary-grid > div {
  min-height: 52px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.documents-summary-grid span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 620;
  text-transform: uppercase;
}

.documents-summary-grid strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 16px;
  font-weight: 720;
}

.documents-active-note {
  margin-bottom: 8px;
  padding: 9px 10px;
  border: 1px solid color-mix(in srgb, var(--green) 28%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--green) 10%, var(--surface));
  color: color-mix(in srgb, var(--green) 72%, var(--text));
  font-size: 12px;
  font-weight: 680;
}

.documents-empty-note {
  margin-bottom: 8px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--blue) 24%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--blue) 7%, var(--surface));
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
}

#documentsDetail {
  min-width: 0;
}

.documents-claims-table,
.mail-agent-table[data-po-table] {
  min-width: 1320px;
}

.mail-agent-table[data-po-table] button {
  min-width: max-content;
  overflow-wrap: normal;
  word-break: normal;
}

.mail-agent-table[data-po-table] td:nth-child(8) {
  min-width: 10em;
}

.documents-claims-table [data-po-frequency] {
  width: 6rem;
  min-height: 32px;
  padding: 4px 8px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.documents-claims-table [data-po-contact-editor] label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
}

.documents-claim-due {
  background: color-mix(in srgb, var(--green) 8%, var(--surface));
}

.documents-claim-waiting {
  color: color-mix(in srgb, var(--text) 76%, var(--muted));
}

.documents-claim-done-today {
  background: color-mix(in srgb, var(--blue) 8%, var(--surface));
  color: color-mix(in srgb, var(--text) 70%, var(--muted));
}

.documents-claim-select-cell {
  width: 54px;
  text-align: center;
}

.documents-claim-select-cell input {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
}

.documents-claim-invoice-cell {
  min-width: 94px;
  white-space: nowrap;
}

.documents-dtv-archive-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-width: 70px;
  min-height: 24px;
  margin-top: 7px;
  padding: 2px 10px;
  border: 1px solid color-mix(in srgb, var(--corp) 78%, var(--blue));
  border-radius: 999px;
  background: linear-gradient(135deg, var(--corp), var(--blue));
  color: #ffffff;
  box-shadow: 0 3px 8px color-mix(in srgb, var(--corp) 22%, transparent);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 720;
  line-height: 1;
  white-space: nowrap;
}

.documents-dtv-archive-btn:hover,
.documents-dtv-archive-btn:focus-visible {
  border-color: color-mix(in srgb, var(--corp) 72%, #ffffff);
  box-shadow: 0 0 0 3px var(--corp-shadow), 0 4px 10px color-mix(in srgb, var(--corp) 26%, transparent);
}

.documents-dtv-archive-btn:disabled {
  cursor: wait;
  opacity: 0.62;
}

.documents-claim-kind-cell {
  width: 88px;
  text-align: center;
}

.documents-claim-kind-cell input {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
}

.documents-bulk-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.documents-bulk-actions span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 620;
}

.documents-template-config {
  display: flex;
  min-height: calc(100vh - 250px);
  flex-direction: column;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.documents-template-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 10px;
  flex: 1;
  min-height: 0;
}

.documents-template-form {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  min-height: 0;
}

.documents-template-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.documents-template-title span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  text-transform: uppercase;
}

.documents-template-form label {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  text-transform: uppercase;
  min-height: 0;
}

.documents-template-form input,
.documents-template-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px;
  background: var(--surface-soft);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  line-height: 1.35;
  text-transform: none;
}

.forecast-toolbar {
  align-items: center;
  display: flex;
  gap: 12px;
}

.forecast-toolbar > .workspace-context-status {
  margin-right: auto;
}

.forecast-summary-grid {
  margin: 16px 0;
  max-width: 760px;
}

.forecast-chart-wrap,
.forecast-table-wrap {
  background: #fff;
  border: 1px solid #d7dce4;
  border-radius: 10px;
  margin-top: 16px;
  overflow: auto;
}

.forecast-chart {
  display: block;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 9px;
}

.forecast-grid-line {
  stroke: #d6d6d6;
  stroke-width: 1;
}

.forecast-legend {
  fill: #222;
  font-size: 10px;
  font-weight: 700;
}

.forecast-table {
  min-width: 100%;
  width: max-content;
}

.forecast-table th,
.forecast-table td {
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 12px;
  white-space: nowrap;
}

.forecast-table td:nth-child(3) {
  overflow: hidden;
  text-overflow: ellipsis;
}

.forecast-table th:nth-child(1),
.forecast-table td:nth-child(1) {
  left: 0;
  min-width: 82px;
  width: 82px;
}

.forecast-table th:nth-child(2),
.forecast-table td:nth-child(2) {
  left: 82px;
  min-width: 94px;
  width: 94px;
}

.forecast-table th:nth-child(3),
.forecast-table td:nth-child(3) {
  left: 176px;
  max-width: 280px;
  min-width: 280px;
  width: 280px;
}

.forecast-table th:nth-child(-n + 3),
.forecast-table td:nth-child(-n + 3) {
  background: #fff;
  box-shadow: 1px 0 0 #d7dce4;
  position: sticky;
  z-index: 2;
}

.forecast-table thead th:nth-child(-n + 3) {
  background: #eef3f8;
  z-index: 4;
}

.forecast-table tfoot th:nth-child(-n + 3) {
  background: #eef3f8;
  z-index: 3;
}

.forecast-table th:nth-child(3),
.forecast-table td:nth-child(3) {
  border-right: 2px solid #9fb1c4;
}

.forecast-table .positive {
  color: #008a3d;
}

.forecast-table .negative {
  color: #c00000;
}

.documents-template-form textarea {
  resize: vertical;
  min-height: 360px;
  height: 100%;
}

.maintenance-head {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.maintenance-hub-detail {
  display: grid;
  gap: 14px;
}

.maintenance-overview,
.maintenance-copy-overview,
.maintenance-live-scope {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.maintenance-overview-intro,
.maintenance-live-scope-head {
  padding: 16px 18px;
}

.maintenance-overview-intro h2,
.maintenance-live-scope-head h2,
.maintenance-copy-overview h3,
.maintenance-overview-card h3 {
  margin: 3px 0 5px;
}

.maintenance-overview-intro p,
.maintenance-copy-overview p,
.maintenance-overview-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.maintenance-overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 0 18px 18px;
}

.maintenance-overview-card {
  min-height: 176px;
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.maintenance-overview-card.is-active.scope-preview {
  border-color: #d6ad35;
  background: #fff7d8;
}

.maintenance-overview-card.is-active.scope-production {
  border-color: #d85656;
  background: #fdecec;
}

.maintenance-overview-card.scope-mac {
  border-color: #6d9fd1;
  background: #eaf3fc;
}

.maintenance-overview-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.maintenance-overview-card > strong {
  display: block;
  margin-top: 14px;
  color: var(--text);
  font-size: 12px;
}

.maintenance-copy-overview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 18px;
  border-color: #8a67ce;
  background: #f3effc;
}

.maintenance-copy-overview > strong {
  max-width: 420px;
  color: #563396;
  text-align: right;
}

.maintenance-live-scope > .maintenance-module-group {
  margin: 0 12px 12px;
}

@media (max-width: 980px) {
  .maintenance-overview-grid {
    grid-template-columns: 1fr;
  }

  .maintenance-copy-overview {
    align-items: flex-start;
    flex-direction: column;
  }

  .maintenance-copy-overview > strong {
    max-width: none;
    text-align: left;
  }
}

.maintenance-scope-banner {
  display: grid;
  gap: 3px;
  margin: 10px 12px 0;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
}

.maintenance-scope-banner strong {
  font-size: 13px;
}

.maintenance-scope-banner span {
  font-size: 12px;
  line-height: 1.35;
}

.maintenance-scope-banner.tone-preview {
  border-color: #d6ad35;
  background: #fff7d8;
  color: #654600;
}

.maintenance-scope-banner.tone-production {
  border-color: #d85656;
  background: #fdecec;
  color: #7c1f1f;
}

.maintenance-scope-banner.tone-local {
  border-color: #6d9fd1;
  background: #eaf3fc;
  color: #184f7a;
}

.maintenance-schedule-control {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.maintenance-schedule-control input[type="time"] {
  height: 30px;
  width: 94px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.maintenance-next-run {
  color: var(--muted);
  white-space: nowrap;
}

.maintenance-summary-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 7px;
}

.maintenance-summary-strip > div {
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.maintenance-summary-strip span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 620;
  text-transform: uppercase;
}

.maintenance-summary-strip strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 14px;
  font-weight: 680;
}

.maintenance-table-wrap .communications-detail-table {
  min-width: 1040px;
}

.mail-agent-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  background: var(--surface);
}

.communications-detail-table {
  min-width: 1500px;
}

.communications-module-groups {
  display: grid;
  gap: 8px;
}

.communications-module-group {
  position: relative;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.communication-schedule-general {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 2;
}

.communications-module-summary {
  padding-right: 168px;
}

.communication-schedule-individual {
  display: block;
  margin-top: 7px;
}

.communication-schedule-dialog {
  width: min(720px, calc(100vw - 28px));
  color: var(--text);
  background: var(--surface);
}

.communication-schedule-dialog form {
  margin: 0;
}

.communication-schedule-dialog .dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}

.communication-schedule-dialog .dialog-head h2 {
  margin: 3px 0 4px;
  font-size: 19px;
}

.communication-schedule-dialog .dialog-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.communication-schedule-body {
  display: grid;
  gap: 18px;
  padding: 20px;
}

.communication-schedule-body fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.communication-schedule-body legend {
  margin-bottom: 9px;
  font-size: 12px;
  font-weight: 700;
}

.communication-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(42px, 1fr));
  gap: 8px;
}

.communication-weekdays label {
  display: grid;
  place-items: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  font-weight: 700;
  cursor: pointer;
}

.communication-weekdays input {
  margin: 0 0 3px;
}

.communication-schedule-times {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.communication-schedule-times label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.communication-schedule-rules {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.communication-schedule-rules p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.communication-schedule-dialog .dialog-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding: 13px 20px;
  border-top: 1px solid var(--line);
}

.communication-schedule-dialog .form-error {
  flex: 1;
  color: var(--red);
  font-size: 12px;
}

@media (max-width: 680px) {
  .communication-schedule-times { grid-template-columns: 1fr; }
  .communication-weekdays { grid-template-columns: repeat(4, minmax(42px, 1fr)); }
}

.communications-module-group.tone-error {
  border-left: 4px solid var(--red);
}

.communications-module-group.tone-warning {
  border-left: 4px solid var(--orange);
}

.communications-module-group.tone-success {
  border-left: 4px solid var(--green);
}

.communications-module-group.tone-empty {
  border-left: 4px solid var(--muted);
}

.communications-module-summary {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: 28px minmax(180px, 1.2fr) repeat(4, minmax(110px, auto));
  align-items: center;
  gap: 10px;
  padding: 8px 168px 8px 12px;
  border: 0;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.communications-module-summary:hover {
  background: var(--surface-soft);
}

.communications-module-summary strong {
  font-size: 13px;
  font-weight: 700;
}

.communications-module-summary span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 620;
  white-space: nowrap;
}

.communications-module-caret {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text) !important;
  background: var(--surface-strong);
  font-size: 14px !important;
}

.communications-table-wrap {
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  border-radius: 0;
  max-height: none;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-gutter: stable both-edges;
  -webkit-overflow-scrolling: touch;
}

.communications-group-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: var(--surface-soft);
  box-shadow: inset 0 -1px 0 var(--line);
}

.maintenance-local-time {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-strong);
  color: var(--text);
  font-weight: 680;
  white-space: nowrap;
}

.data-import-ok {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--badge-green-bg);
  color: var(--green);
  font-weight: 700;
  white-space: nowrap;
}

.muted-cell {
  color: var(--muted);
}

.mail-agent-table th,
.mail-agent-table td {
  padding: 8px 9px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.mail-agent-table th {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 10px;
  font-weight: 620;
  text-transform: uppercase;
}

.mail-agent-table tr:last-child td {
  border-bottom: 0;
}

.mail-agent-table strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
}

.mail-agent-table td > span:not(.mail-status) {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.mail-agent-table td {
  overflow-wrap: anywhere;
}

.local-mail-table {
  margin-top: 2px;
}

.ticket-table-shell {
  height: calc(100vh - 192px);
  min-height: 510px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

@media (max-width: 1380px) {
  .purchase-summary,
  .purchase-summary-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .purchase-summary.collapsible-section,
  .workshop-summary.collapsible-section {
    grid-template-columns: minmax(0, 1fr);
  }

  .purchase-summary.collapsible-section .purchase-metric-group {
    grid-column: auto;
  }

  .purchase-phase-group,
  .purchase-time-group,
  .purchase-ready-row,
  .workshop-summary .purchase-metric-group {
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  }
}

@media (max-width: 980px) {
  .workshop-layout {
    grid-template-columns: 1fr;
  }

  .workshop-group-list {
    max-height: 270px;
  }

  .workshop-panel-head,
  .workshop-machine summary,
  .workshop-purchase-card header {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .workshop-panel-head {
    display: grid;
  }

  .workshop-purchase-card header {
    display: grid;
  }

  .workshop-panel-counters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .home-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.active-filter {
  min-height: 22px;
  padding: 4px 8px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 540;
  background: var(--surface);
}

.active-filter.is-working {
  border-bottom-color: rgba(0, 116, 188, 0.42);
  background: linear-gradient(
    90deg,
    rgba(218, 241, 255, 0.95) 0%,
    rgba(238, 250, 255, 0.98) 28%,
    rgba(209, 239, 221, 0.95) 52%,
    rgba(238, 250, 255, 0.98) 76%,
    rgba(218, 241, 255, 0.95) 100%
  );
  background-size: 220% 100%;
  color: var(--blue-dark);
  animation: workspaceWorkingPulse var(--pulse-speed) ease-in-out infinite;
}

button.is-working,
.primary-btn.is-working {
  box-shadow: 0 0 0 0 rgba(0, 116, 188, 0.36);
  animation: workspaceWorkingButtonPulse var(--pulse-speed) ease-in-out infinite;
}

@keyframes workspaceWorkingPulse {
  0%, 100% {
    background-position: 0% 50%;
    box-shadow: inset 0 0 0 1px rgba(0, 116, 188, 0.18);
  }
  50% {
    background-position: 100% 50%;
    box-shadow: inset 0 0 0 1px rgba(46, 173, 74, 0.26), 0 0 0 3px rgba(0, 116, 188, 0.07);
  }
}

@keyframes workspaceWorkingButtonPulse {
  0%, 100% {
    filter: saturate(1);
    box-shadow: 0 0 0 0 rgba(0, 116, 188, 0.34);
  }
  50% {
    filter: saturate(1.18);
    box-shadow: 0 0 0 5px rgba(0, 116, 188, 0.12);
  }
}

.active-filter.security-status-error {
  min-height: 34px;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--red) 42%, var(--line));
  border-radius: 8px;
  background: var(--badge-red-bg);
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
}

.purchase-status-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
  border-top: 0;
  background: var(--surface);
}

.purchase-status-main {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-status-main.is-stale {
  width: 100%;
  padding: 5px 8px;
  border: 1px solid color-mix(in srgb, var(--orange) 48%, var(--line));
  border-radius: 7px;
  background: color-mix(in srgb, var(--badge-orange-bg) 82%, var(--surface));
  color: color-mix(in srgb, var(--orange) 78%, var(--text));
  font-weight: 750;
}

.purchase-status-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex: 0 1 auto;
  min-width: 0;
}

.purchase-status-meta-item {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
  padding: 2px 6px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, var(--corp));
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface-raised) 80%, var(--corp-soft));
  color: var(--muted);
  white-space: nowrap;
}

.purchase-status-meta-item strong {
  color: color-mix(in srgb, var(--text) 74%, var(--corp));
  font-weight: 650;
}

.purchase-status-file {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-weight: 560;
}

.ticket-table-wrap {
  flex: 1;
  overflow: auto;
  scrollbar-gutter: stable both-edges;
  background: var(--surface-raised);
}

.purchase-tracking-shell {
  --purchase-text: color-mix(in srgb, var(--text) 86%, var(--muted));
  --purchase-strong: color-mix(in srgb, var(--text) 78%, var(--corp));
  --purchase-code: color-mix(in srgb, var(--corp) 78%, var(--text));
  --purchase-muted: color-mix(in srgb, var(--muted) 90%, var(--text));
  height: calc(100vh - 98px);
  min-height: 520px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.purchase-summary {
  display: grid;
  grid-template-columns: minmax(480px, 1.35fr) minmax(320px, 0.86fr) minmax(220px, 0.54fr);
  gap: 7px;
  margin-bottom: 7px;
  min-width: 0;
  transition: max-height 0.18s ease, opacity 0.18s ease, transform 0.18s ease;
}

body.purchase-compact .module-head,
body.purchase-compact .purchase-summary,
body.purchase-compact #purchaseActions,
body.purchase-compact #purchaseActiveFilter {
  max-height: 0;
  min-height: 0;
  height: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin: 0;
  border-width: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transform: translateY(-8px);
}

body.purchase-compact .workspace-shell {
  padding-top: 5px;
}

body.purchase-compact .purchase-tracking-shell {
  height: calc(100vh - 52px);
}

.purchase-summary.collapsible-section {
  grid-template-columns: minmax(480px, 1.35fr) minmax(320px, 0.86fr) minmax(220px, 0.54fr);
  align-items: start;
}

.purchase-summary.collapsible-section > .collapse-toggle {
  align-self: start;
  margin-top: 5px;
}

.workshop-summary.collapsible-section {
  grid-template-columns: minmax(0, 1fr);
}

.purchase-summary-main {
  display: contents;
}

.purchase-summary-secondary {
  display: contents;
}

@media (max-width: 1380px) {
  .purchase-summary.collapsible-section,
  .workshop-summary.collapsible-section {
    grid-template-columns: minmax(0, 1fr);
  }

  .purchase-summary.collapsible-section .purchase-metric-group {
    grid-column: auto;
  }
}

.purchase-metric-group {
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
}

.purchase-metric-group-label {
  display: block;
  width: auto;
  min-width: 0;
  margin: 0;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 620;
  text-transform: uppercase;
}

.purchase-metric {
  --metric-color: var(--corp);
  --metric-bg: var(--surface);
  position: relative;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  min-height: 27px;
  padding: 3px 7px 3px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  overflow: hidden;
}

.purchase-metric-group .purchase-metric {
  display: flex;
}

.purchase-phase-group {
  grid-template-columns: repeat(8, minmax(58px, 1fr));
}

.purchase-time-group {
  grid-template-columns: repeat(4, minmax(72px, 1fr));
}

.purchase-ready-row {
  grid-template-columns: repeat(2, minmax(82px, 1fr));
}

.purchase-metric-group-label {
  grid-column: 1 / -1;
}

.purchase-ready-row .purchase-metric {
  min-width: 0;
}

.purchase-metric.metric-today {
  min-width: 66px;
}

.purchase-metric span {
  min-width: 0;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 520;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-metric strong {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 600;
  color: color-mix(in srgb, var(--metric-color) 70%, var(--text));
}

.purchase-metric.active {
  border-color: color-mix(in srgb, var(--metric-color) 55%, var(--line));
  background: color-mix(in srgb, var(--metric-color) 15%, var(--surface));
  color: color-mix(in srgb, var(--metric-color) 75%, var(--text));
}

.purchase-metric.search-match:not(.active) {
  border-color: color-mix(in srgb, var(--metric-color) 70%, var(--line));
  background: color-mix(in srgb, var(--metric-color) 18%, var(--surface));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--metric-color) 16%, transparent);
}

.purchase-metric.search-match span,
.purchase-metric.search-match strong {
  color: color-mix(in srgb, var(--metric-color) 82%, var(--text));
}

.purchase-metric.metric-ready.has-ready-items {
  border-color: #00a651;
  background: #d9ffe8;
  color: #005c2d;
  animation: readyMetricPulse var(--pulse-speed) ease-in-out infinite;
}

.purchase-metric.metric-ready.has-ready-items span,
.purchase-metric.metric-ready.has-ready-items strong {
  color: #005c2d;
}

.purchase-metric.metric-rented.has-rented-items {
  border-color: #d0007f;
  background: #d0007f;
  color: #ffffff;
  animation: rentedMetricPulse var(--pulse-speed) ease-in-out infinite;
}

.purchase-metric.metric-rented.has-rented-items span,
.purchase-metric.metric-rented.has-rented-items strong {
  color: #ffffff;
}

.purchase-metric.vital-pulse {
  border-color: color-mix(in srgb, var(--metric-color) 46%, var(--line));
  background: color-mix(in srgb, var(--metric-color) 9%, var(--surface));
  animation: vitalMetricPulse var(--pulse-speed) ease-in-out infinite;
}

.purchase-metric.vital-pulse span,
.purchase-metric.vital-pulse strong {
  color: color-mix(in srgb, var(--metric-color) 82%, var(--text));
}

@keyframes readyMetricPulse {
  0%, 100% {
    background: #d9ffe8;
    box-shadow: 0 0 0 0 rgba(0, 166, 81, 0.28);
  }
  50% {
    background: #82f0ac;
    box-shadow: 0 0 0 4px rgba(0, 166, 81, 0.14);
  }
}

@keyframes rentedMetricPulse {
  0%, 100% {
    background: #d0007f;
    box-shadow: 0 0 0 0 rgba(208, 0, 127, 0.28);
  }
  50% {
    background: #b0006c;
    box-shadow: 0 0 0 4px rgba(208, 0, 127, 0.14);
  }
}

@keyframes vitalMetricPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--metric-color) 18%, transparent);
  }
  50% {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--metric-color) 10%, transparent);
  }
}

.purchase-tracking-shell.provider-filter-mode .purchase-metric.provider-filter-applies::after {
  content: "";
  position: absolute;
  right: 14px;
  bottom: -5px;
  left: 14px;
  height: 2px;
  border-radius: 999px;
  background: color-mix(in srgb, #d71920 64%, transparent);
}

.purchase-metric.metric-overdue { --metric-color: #d71920; }
.purchase-metric.metric-today { --metric-color: var(--corp); }
.purchase-metric.metric-soon { --metric-color: #2b79c2; }
.purchase-metric.metric-undated { --metric-color: #7b8793; }
.purchase-metric.metric-request { --metric-color: #607d8b; }
.purchase-metric.metric-prep { --metric-color: #8a6f2a; }
.purchase-metric.metric-approve { --metric-color: #cf7a12; }
.purchase-metric.metric-send { --metric-color: #5c6bc0; }
.purchase-metric.metric-payment { --metric-color: #7a4f2a; }
.purchase-metric.metric-receive { --metric-color: #006cae; }
.purchase-metric.metric-withdraw { --metric-color: #7b3ff2; }
.purchase-metric.metric-ready { --metric-color: #00a651; }
.purchase-metric.metric-no-delivery { --metric-color: #546a7b; }
.purchase-metric.metric-rented { --metric-color: #d0007f; }

.purchase-board {
  --purchase-scale: 1;
  --purchase-lane-width: calc(132px * var(--purchase-scale));
  --purchase-day-width: calc(138px * var(--purchase-scale));
  --purchase-card-font: clamp(8px, calc(12px * var(--purchase-scale)), 12px);
  --purchase-card-small-font: clamp(7px, calc(11px * var(--purchase-scale)), 11px);
  --purchase-card-title-font: clamp(8px, calc(13px * var(--purchase-scale)), 13px);
  --purchase-badge-font: clamp(7px, calc(10px * var(--purchase-scale)), 10px);
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: calc(7px * var(--purchase-scale));
  min-height: 0;
  min-width: 0;
  font-size: 13px;
}

.workshop-shell {
  height: calc(100vh - 115px);
  height: calc(100dvh - 115px);
  min-height: min(520px, calc(100dvh - 115px));
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
}

.workshop-summary {
  grid-template-columns: minmax(0, 1fr);
}

.workshop-summary .purchase-metric-group {
  grid-template-columns: repeat(auto-fit, minmax(min(104px, 100%), 1fr));
}

.workshop-metric-demanded { --metric-color: #006cae; }
.workshop-summary .purchase-metric span { color: var(--text); }
.workshop-metric-available { --metric-color: #12805c; }
.workshop-metric-revision { --metric-color: #cf7a12; }
.workshop-metric-rented { --metric-color: #d0007f; }
.workshop-metric-purchases { --metric-color: #5c6bc0; }

.workshop-filter-toolbar {
  flex: 0 0 auto;
  margin-bottom: 6px;
}

@media (max-width: 650px) {
  .workshop-shell { height: auto; overflow: visible; }
  .workshop-shell > :not(.workshop-board) { flex: 0 0 auto; }
}

.workshop-status-strip {
  margin-bottom: 7px;
}

.workshop-board {
  --workshop-scale: 1;
  --workshop-group-width: clamp(218px, calc(360px * var(--workshop-scale)), 430px);
  --workshop-date-width: clamp(84px, calc(132px * var(--workshop-scale)), 158px);
  --workshop-overdue-width: clamp(78px, calc(118px * var(--workshop-scale)), 142px);
  --workshop-today-width: clamp(86px, calc(132px * var(--workshop-scale)), 158px);
  --workshop-header-row-height: clamp(34px, calc(46px * var(--workshop-scale)), 54px);
  --workshop-row-height: clamp(42px, calc(68px * var(--workshop-scale)), 82px);
  --workshop-group-row-height: clamp(20px, calc(28px * var(--workshop-scale)), 32px);
  --workshop-delegation-row-height: clamp(42px, calc(68px * var(--workshop-scale)), 82px);
  --workshop-card-font: clamp(8px, calc(11px * var(--workshop-scale)), 12px);
  --workshop-small-font: clamp(7px, calc(9.5px * var(--workshop-scale)), 10px);
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.workshop-layout {
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(250px, 318px) minmax(0, 1fr);
  gap: 8px;
}

.workshop-group-list {
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
}

.workshop-group-card {
  position: relative;
  display: grid;
  gap: 3px;
  width: 100%;
  min-width: 0;
  padding: 6px 8px 6px 10px;
  border: 1px solid var(--line);
  border-left: 4px solid #006cae;
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.workshop-group-card strong,
.workshop-group-card span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workshop-group-card strong {
  font-size: var(--workshop-card-font);
  font-weight: 680;
}

.workshop-group-card > span {
  color: var(--muted);
  font-size: var(--workshop-small-font);
  font-weight: 560;
}

.workshop-group-card.active {
  border-color: color-mix(in srgb, #006cae 48%, var(--line));
  border-left-color: #006cae;
  background: color-mix(in srgb, #006cae 9%, var(--surface));
  box-shadow: 0 0 0 2px color-mix(in srgb, #006cae 12%, transparent);
}

.workshop-group-card.has-purchases {
  border-left-color: #5c6bc0;
}

.workshop-group-card.is-accessory {
  margin-left: 12px;
  width: calc(100% - 12px);
  border-left-color: #5c6bc0;
  background: color-mix(in srgb, #5c6bc0 5%, var(--surface));
}

.workshop-group-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 3px;
}

.workshop-group-stats em {
  display: grid;
  gap: 0;
  min-width: 0;
  padding: 2px 4px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface-muted) 82%, transparent);
  color: var(--text);
  font-size: var(--workshop-card-font);
  font-style: normal;
  font-weight: 660;
}

.workshop-group-stats small {
  min-width: 0;
  color: var(--muted);
  font-size: var(--workshop-small-font);
  font-weight: 560;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workshop-timeline-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(142px, auto) minmax(0, 1fr);
  gap: 8px;
}

.workshop-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
}

.workshop-panel-head h3 {
  margin: 2px 0 0;
  font-size: 15px;
  line-height: 1.2;
}

.workshop-panel-counters {
  display: grid;
  grid-template-columns: repeat(3, minmax(74px, 1fr));
  gap: 5px;
}

.workshop-panel-counters span {
  display: grid;
  gap: 1px;
  min-width: 0;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 680;
  text-align: right;
}

.workshop-panel-counters small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 560;
}

.workshop-timeline-scroll {
  min-width: 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
}

.workshop-timeline-grid {
  display: grid;
  grid-template-columns: repeat(var(--workshop-date-count), minmax(118px, 1fr));
  gap: 0;
  min-width: max-content;
}

.workshop-date-column {
  min-width: 118px;
  border-right: 1px solid var(--line);
}

.workshop-date-column:last-child {
  border-right: 0;
}

.workshop-date-column header {
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: clamp(12px, calc(13px * var(--workshop-scale)), 13px);
  font-weight: 760;
  text-align: center;
  white-space: nowrap;
}

.workshop-date-body {
  display: grid;
  place-items: start center;
  min-height: 84px;
  padding: 10px;
}

.workshop-unit-card {
  display: grid;
  place-items: center;
  gap: calc(2px * var(--workshop-scale));
  width: calc(74px * var(--workshop-scale));
  min-height: calc(36px * var(--workshop-scale));
  border: 1px solid color-mix(in srgb, #006cae 38%, var(--line));
  border-radius: calc(8px * var(--workshop-scale));
  background: color-mix(in srgb, #006cae 8%, var(--surface));
  color: #0b4f7a;
  cursor: pointer;
  padding: calc(3px * var(--workshop-scale)) calc(5px * var(--workshop-scale));
  box-sizing: border-box;
}

.workshop-unit-card.is-readonly {
  cursor: default;
}

.workshop-unit-card.can-open-clients:hover {
  border-color: color-mix(in srgb, #006cae 64%, var(--line));
  background: color-mix(in srgb, #006cae 13%, var(--surface));
  box-shadow: 0 0 0 2px color-mix(in srgb, #006cae 12%, transparent);
}

.workshop-unit-card strong {
  font-size: clamp(7px, calc(18px * var(--workshop-scale)), 18px);
  font-weight: 720;
  line-height: 1.12;
}

.workshop-unit-card span {
  color: color-mix(in srgb, #0b4f7a 76%, var(--muted));
  font-size: clamp(5px, calc(9.5px * var(--workshop-scale)), 9.5px);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.workshop-timeline-empty {
  padding: 18px;
  color: var(--muted);
  font-size: 12px;
}

.workshop-revision-panel {
  min-height: 0;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
}

.workshop-machine {
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.workshop-machine summary {
  display: grid;
  grid-template-columns: minmax(92px, 0.8fr) minmax(0, 1.4fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  cursor: pointer;
}

.workshop-machine summary strong,
.workshop-machine summary span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workshop-machine summary em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 620;
}

.workshop-purchase-list {
  display: grid;
  gap: 6px;
  padding: 0 8px 8px;
}

.workshop-purchase-card {
  display: grid;
  gap: 6px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface-muted) 70%, var(--surface));
}

.workshop-purchase-card.is-overdue {
  border-color: color-mix(in srgb, #d71920 42%, var(--line));
  background: color-mix(in srgb, #d71920 6%, var(--surface));
}

.workshop-purchase-card.is-overdue header strong {
  color: #d71920;
}

.workshop-purchase-card header {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  min-width: 0;
}

.workshop-purchase-card header strong,
.workshop-purchase-card header span,
.workshop-purchase-card p {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workshop-purchase-card header strong {
  color: #3949ab;
  font-size: 14px;
}

.workshop-purchase-card header span,
.workshop-purchase-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.workshop-purchase-items {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 12px;
}

.workshop-purchase-items col.qty {
  width: 11%;
}

.workshop-purchase-items col.code {
  width: 16%;
}

.workshop-purchase-items col.product {
  width: 57%;
}

.workshop-purchase-items col.date {
  width: 16%;
}

.workshop-purchase-items th,
.workshop-purchase-items td {
  padding: 5px 6px;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  overflow: hidden;
  text-overflow: ellipsis;
}

.workshop-purchase-items th {
  color: var(--muted);
  font-weight: 620;
}

.workshop-delegation-filters {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  min-height: 28px;
  padding: 3px 5px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-raised);
}

.purchase-delegation-pill {
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid #c9d8e5;
  border-radius: 6px;
  background: var(--surface);
  color: var(--blue-dark);
  font-size: 10.5px;
  font-weight: 650;
  cursor: pointer;
}

.purchase-delegation-pill.active {
  border-color: var(--corp);
  background: var(--corp-soft);
  color: var(--corp);
}

.workshop-matrix-layout {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}

.workshop-matrix-layout .workshop-timeline-panel {
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.workshop-matrix-layout .workshop-timeline-scroll {
  flex: 1 1 auto;
  height: 100%;
  max-height: none;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
  -webkit-overflow-scrolling: touch;
}

.workshop-matrix-grid {
  display: grid;
  width: 100%;
  min-width: max-content;
  grid-template-columns: minmax(var(--workshop-group-width), var(--workshop-group-width)) repeat(var(--workshop-date-count), minmax(var(--workshop-date-width), 1fr));
  grid-template-rows: var(--workshop-header-row-height);
  grid-auto-rows: var(--workshop-delegation-row-height);
}

.workshop-matrix-corner,
.workshop-matrix-date {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(6px * var(--workshop-scale));
  height: var(--workshop-header-row-height);
  min-height: 0;
  padding: clamp(2px, calc(4px * var(--workshop-scale)), 6px) clamp(6px, calc(8px * var(--workshop-scale)), 10px);
  border-right: 1px solid var(--line);
  border-bottom: 0;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: clamp(14px, calc(17px * var(--workshop-scale)), 19px);
  font-weight: 620;
  line-height: 1;
  text-align: center;
  box-sizing: border-box;
  box-shadow: inset 0 -1px 0 var(--line);
}

button.workshop-matrix-date {
  width: 100%;
  appearance: none;
  font: inherit;
  cursor: pointer;
}

.workshop-matrix-date.today {
  z-index: 9;
  color: #ffffff;
  background: var(--corp);
  box-shadow: inset 0 -3px 0 color-mix(in srgb, var(--red) 72%, #ffffff);
}

.workshop-matrix-date.overdue {
  color: color-mix(in srgb, var(--red) 76%, var(--text));
  background: var(--surface-raised);
}

.workshop-matrix-date.overdue::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 5px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--red) 18%, #ffffff);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--red) 34%, transparent);
}

.workshop-matrix-corner {
  left: 0;
  z-index: 10;
  display: grid;
  align-content: center;
  justify-content: start;
  gap: 1px;
  text-align: left;
}

.workshop-matrix-corner strong {
  color: var(--text);
  font-size: clamp(11px, calc(13px * var(--workshop-scale)), 14px);
  font-weight: 620;
  line-height: 1;
}

.workshop-matrix-corner span {
  color: var(--muted);
  font-size: clamp(9px, calc(11px * var(--workshop-scale)), 12px);
  line-height: 1;
}

.workshop-matrix-group {
  position: sticky;
  left: 0;
  z-index: 3;
  min-width: 0;
  padding: 4px 6px 4px 14px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface-raised);
  box-sizing: border-box;
  overflow: hidden;
}

.workshop-matrix-group .workshop-group-card {
  height: 100%;
  min-height: 0;
  box-shadow: none;
}

.workshop-matrix-cell {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 86px;
  min-height: var(--workshop-row-height);
  padding: 4px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  box-sizing: border-box;
  overflow: hidden;
}

.workshop-matrix-cell.is-empty {
  background: color-mix(in srgb, var(--surface-muted) 42%, var(--surface));
}

.workshop-group-band-cell.is-overdue-column,
.workshop-matrix-cell.is-overdue-column {
  background: color-mix(in srgb, var(--red) 4%, var(--surface));
}

.workshop-matrix-cell.collapsed-overdue {
  place-items: center;
  background: color-mix(in srgb, var(--red) 5%, var(--surface-raised));
}

.workshop-overdue-summary {
  display: grid;
  gap: 2px;
  align-items: center;
  justify-items: center;
  height: clamp(38px, calc(46px * var(--workshop-scale)), 56px);
  max-height: calc(var(--workshop-row-height) - 8px);
  width: 100%;
  max-width: clamp(82px, calc(96px * var(--workshop-scale)), 118px);
  padding: 3px 4px;
  border: 1px dashed color-mix(in srgb, var(--red) 34%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--red) 8%, var(--surface));
  color: color-mix(in srgb, var(--red) 70%, var(--text));
  cursor: pointer;
  font: inherit;
  box-sizing: border-box;
}

.workshop-overdue-summary strong {
  font-size: clamp(13px, calc(17px * var(--workshop-scale)), 18px);
  font-weight: 700;
  line-height: 1;
}

.workshop-overdue-summary span {
  font-size: var(--workshop-small-font);
  font-weight: 620;
  line-height: 1;
  white-space: nowrap;
}

.workshop-group-band-cell.is-today-column,
.workshop-matrix-cell.is-today-column {
  position: relative;
}

.workshop-group-band-cell.is-today-column::before,
.workshop-matrix-cell.is-today-column::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--today-progress, 50%);
  width: 1px;
  background: color-mix(in srgb, var(--red) 62%, transparent);
  box-shadow: 0 0 4px color-mix(in srgb, var(--red) 18%, transparent);
  pointer-events: none;
}

.workshop-matrix-cell.is-row-selected {
  background: color-mix(in srgb, #006cae 5%, var(--surface));
}

.workshop-matrix-group.is-row-selected {
  background: color-mix(in srgb, #006cae 7%, var(--surface-raised));
}

.workshop-group-band.is-dimmed,
.workshop-group-band-cell.is-dimmed,
.workshop-matrix-group.is-dimmed,
.workshop-matrix-cell.is-dimmed {
  opacity: 0.34;
  filter: grayscale(0.28);
}

.workshop-group-band.is-selected,
.workshop-group-band-cell.is-selected,
.workshop-matrix-group.is-row-selected,
.workshop-matrix-cell.is-row-selected {
  opacity: 1;
  filter: none;
}

.workshop-matrix-group.is-group-end,
.workshop-matrix-cell.is-group-end {
  border-bottom: 3px solid color-mix(in srgb, var(--corp) 34%, var(--line));
}

.workshop-group-band,
.workshop-group-band-cell {
  min-height: var(--workshop-group-row-height);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--corp-soft) 72%, var(--surface-raised));
  box-sizing: border-box;
  overflow: hidden;
}

.workshop-group-band {
  position: sticky;
  left: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 1px clamp(8px, calc(10px * var(--workshop-scale)), 12px);
  border-left: 4px solid color-mix(in srgb, var(--corp) 42%, transparent);
  cursor: pointer;
}

.workshop-group-band.is-accessory {
  padding-left: clamp(18px, calc(22px * var(--workshop-scale)), 28px);
  border-left-color: #5c6bc0;
  background: color-mix(in srgb, #5c6bc0 6%, var(--surface-raised));
}

.workshop-group-band.is-accessory strong::before {
  content: "> ";
  color: #5c6bc0;
  font-weight: 720;
}

.workshop-group-band strong,
.workshop-group-band span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workshop-group-band strong {
  font-size: clamp(10.5px, calc(12px * var(--workshop-scale)), 13px);
  font-weight: 560;
  line-height: 1;
}

.workshop-group-band span {
  color: var(--muted);
  font-size: clamp(8.5px, calc(10px * var(--workshop-scale)), 11px);
  font-weight: 540;
  line-height: 1;
}

.workshop-mini-action {
  min-height: 20px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--corp);
  font-size: var(--workshop-small-font);
  font-weight: 650;
}

.workshop-delegation-card {
  display: grid;
  grid-template-columns: minmax(clamp(66px, calc(78px * var(--workshop-scale)), 92px), 0.9fr) repeat(6, minmax(0, 0.64fr));
  align-items: stretch;
  gap: clamp(4px, calc(7px * var(--workshop-scale)), 8px);
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-width: 0;
  padding: clamp(5px, calc(7px * var(--workshop-scale)), 8px);
  border: 1px solid var(--line);
  border-left: max(3px, calc(4px * var(--workshop-scale))) solid #006cae;
  border-radius: clamp(6px, calc(7px * var(--workshop-scale)), 8px);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
  overflow: hidden;
}

.workshop-delegation-card.has-purchases {
  border-left-color: #d71920;
}

.workshop-delegation-card.is-revision-selected {
  border-color: color-mix(in srgb, var(--corp) 42%, var(--line));
  background: color-mix(in srgb, var(--corp-soft) 55%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--corp) 26%, transparent);
}

.workshop-delegation-card.is-demand-risk {
  border-left-color: #d71920;
  animation: workshopRiskPulse 1.35s ease-in-out infinite;
}

@keyframes workshopRiskPulse {
  0%, 100% {
    box-shadow: inset 0 0 0 1px color-mix(in srgb, #d71920 20%, transparent);
    background: color-mix(in srgb, #d71920 4%, var(--surface));
  }
  50% {
    box-shadow: inset 0 0 0 2px color-mix(in srgb, #d71920 42%, transparent), 0 0 0 2px color-mix(in srgb, #d71920 10%, transparent);
    background: color-mix(in srgb, #d71920 10%, var(--surface));
  }
}

.workshop-delegation-card strong,
.workshop-delegation-card span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: var(--workshop-small-font);
  font-weight: 680;
}

.workshop-delegation-card strong {
  align-self: center;
  font-size: clamp(8px, calc(10.5px * var(--workshop-scale)), 11px);
  line-height: 1;
  white-space: nowrap;
}

.workshop-delegation-card span {
  display: grid;
  align-content: center;
  gap: clamp(2px, calc(5px * var(--workshop-scale)), 6px);
  justify-items: center;
  text-align: center;
  max-width: 100%;
  min-height: 100%;
  padding: 0;
}

.workshop-delegation-card small {
  min-width: 0;
  max-width: 100%;
  color: var(--muted);
  font-size: clamp(7.5px, calc(9.8px * var(--workshop-scale)), 10.5px);
  font-weight: 700;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workshop-delegation-card b {
  display: block;
  max-width: 100%;
  color: var(--text);
  font-size: clamp(10px, calc(15px * var(--workshop-scale)), 16px);
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.workshop-delegation-card span:first-of-type small,
.workshop-delegation-card span:first-of-type b {
  color: color-mix(in srgb, var(--green) 75%, var(--text));
}

.danger-number,
.workshop-delegation-card b.danger-number {
  color: #d71920;
}

.workshop-delegation-card b.danger-number {
  color: color-mix(in srgb, var(--red) 75%, var(--text));
}

@media (prefers-reduced-motion: reduce) {
  .workshop-delegation-card.is-demand-risk,
  .workshop-summary .purchase-metric { animation: none; }
  .workshop-delegation-card.is-demand-risk {
    background: color-mix(in srgb, var(--red) 8%, var(--surface));
  }
}

.workshop-revision-overlay {
  position: fixed;
  inset: 0;
  margin: 0;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  border: 0;
  color: var(--text);
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.28);
}

.workshop-revision-overlay::backdrop { background: transparent; }

.workshop-revision-dialog {
  width: min(1180px, calc(100vw - 48px));
  max-height: min(780px, calc(100vh - 48px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  box-shadow: var(--shadow);
}

.workshop-revision-dialog > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.workshop-revision-dialog > header div {
  display: grid;
  gap: 2px;
}

.workshop-revision-dialog > header strong {
  font-size: 16px;
}

.workshop-revision-dialog > header span {
  color: var(--muted);
  font-size: 12px;
}

.workshop-revision-list {
  min-height: 0;
  overflow: auto;
}

.workshop-client-dialog {
  width: min(1420px, calc(100vw - 48px));
}

.workshop-client-table-wrap {
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.workshop-client-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 13px;
}

.workshop-client-table col.offer { width: 13%; }
.workshop-client-table col.client { width: 25%; }
.workshop-client-table col.date { width: 13%; }
.workshop-client-table col.qty { width: 10%; }
.workshop-client-table col.delegation { width: 12%; }
.workshop-client-table col.detail { width: 27%; }

.workshop-client-table th,
.workshop-client-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workshop-client-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
}

.workshop-client-table td {
  color: var(--text);
  font-size: 13px;
}

.workshop-machine.has-purchases {
  border-color: color-mix(in srgb, #d71920 45%, var(--line));
  box-shadow: inset 4px 0 0 #d71920;
}

.workshop-machine.has-purchases summary strong,
.workshop-machine.has-purchases summary em {
  color: color-mix(in srgb, var(--red) 75%, var(--text));
}

.workshop-overdue-panel {
  display: grid;
  gap: 5px;
  padding: 8px;
  border: 1px solid color-mix(in srgb, #d71920 45%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, #d71920 8%, var(--surface));
}

.workshop-overdue-panel h3 {
  margin: 0;
  color: color-mix(in srgb, var(--red) 75%, var(--text));
  font-size: 12px;
  text-transform: uppercase;
}

.workshop-overdue-card {
  display: grid;
  grid-template-columns: minmax(86px, 0.6fr) minmax(80px, 0.55fr) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 28px;
  padding: 5px 7px;
  border: 1px solid color-mix(in srgb, #d71920 28%, var(--line));
  border-radius: 7px;
  background: var(--surface);
  font-size: 11px;
}

.workshop-overdue-card strong,
.workshop-overdue-card em {
  color: color-mix(in srgb, var(--red) 75%, var(--text));
  font-style: normal;
}

.workshop-purchase-suppliers {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 6px 0 4px;
}

.workshop-purchase-suppliers span {
  display: inline-grid;
  gap: 1px;
  max-width: 260px;
  padding: 4px 7px;
  border: 1px solid color-mix(in srgb, var(--corp) 18%, var(--line));
  border-radius: 6px;
  background: color-mix(in srgb, var(--corp-soft) 44%, var(--surface));
  color: var(--text);
  font-size: 11px;
  line-height: 1.15;
}

.workshop-purchase-suppliers strong,
.workshop-purchase-suppliers em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workshop-purchase-suppliers strong {
  color: var(--corp);
  font-weight: 750;
}

.workshop-purchase-suppliers em {
  color: var(--muted);
  font-style: normal;
  font-weight: 650;
}

.purchase-main-board {
  flex: 1;
  width: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: clamp(calc(285px * var(--purchase-scale)), 22vw, calc(360px * var(--purchase-scale))) minmax(0, 1fr);
  gap: calc(7px * var(--purchase-scale));
  min-width: 0;
}

.purchase-previous-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 8px;
  min-height: 0;
  flex: 1;
}

.purchase-transit-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.purchase-transit-panel > header {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(12px * var(--purchase-scale));
  padding: calc(6px * var(--purchase-scale)) calc(9px * var(--purchase-scale));
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.purchase-transit-panel > header strong {
  display: block;
  font-size: 13px;
}

.purchase-transit-panel > header span,
.purchase-transit-panel > header small,
.purchase-timeline-note {
  color: var(--muted);
  font-size: 11px;
  font-weight: 520;
}

.purchase-timeline-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--line) 50%, transparent) 1px, transparent 1px) 0 0 / var(--purchase-day-width) 100%,
    var(--surface-raised);
}

.purchase-card-list,
.purchase-focus-list,
.purchase-provider-list,
.purchase-provider-board,
.purchase-ready-report-list {
  overscroll-behavior: contain;
}

.purchase-timeline-grid {
  display: grid;
  grid-template-rows: calc(30px * var(--purchase-scale)) auto;
  min-height: 100%;
  min-width: max-content;
  position: relative;
}

.purchase-timeline-corner,
.purchase-timeline-date,
.purchase-timeline-lane-label,
.purchase-timeline-cell {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.purchase-timeline-corner,
.purchase-timeline-date {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(6px * var(--purchase-scale));
  min-height: calc(30px * var(--purchase-scale));
  border: 0;
  background: var(--surface-soft);
  font-weight: 560;
  color: var(--muted);
  box-shadow: inset 0 -1px 0 var(--line);
}

.purchase-timeline-date strong {
  min-width: calc(20px * var(--purchase-scale));
  padding: calc(1px * var(--purchase-scale)) calc(6px * var(--purchase-scale));
  border-radius: 999px;
  background: var(--badge-blue-bg);
  color: var(--blue-dark);
  font-size: 11px;
  font-weight: 560;
}

.purchase-timeline-corner {
  left: 0;
  z-index: 4;
}

.purchase-timeline-date.today {
  color: #ffffff;
  background: var(--corp-soft);
  background: var(--corp);
  box-shadow: inset 0 -3px 0 color-mix(in srgb, var(--red) 72%, #ffffff);
}

.purchase-timeline-date.today span {
  color: #ffffff;
  font-weight: 600;
}

.purchase-timeline-date.today strong {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.purchase-overdue-toggle {
  width: 100%;
  cursor: pointer;
  appearance: none;
  font: inherit;
}

.purchase-overdue-toggle span {
  color: color-mix(in srgb, var(--red) 72%, var(--text));
}

.purchase-overdue-toggle strong {
  background: #ffe3e0;
  color: #a91419;
}

.purchase-timeline-lane-label {
  position: sticky;
  left: 0;
  z-index: 3;
  min-height: calc(330px * var(--purchase-scale));
  padding: calc(8px * var(--purchase-scale));
  background: var(--surface-soft);
}

.purchase-timeline-lane-label strong,
.purchase-timeline-lane-label span {
  display: block;
}

.purchase-timeline-lane-label span {
  width: fit-content;
  margin-top: calc(6px * var(--purchase-scale));
  padding: calc(2px * var(--purchase-scale)) calc(8px * var(--purchase-scale));
  border-radius: 999px;
  background: var(--badge-blue-bg);
  color: var(--blue-dark);
  font-weight: 600;
}

.purchase-timeline-cell {
  min-height: 100%;
  overflow: visible;
  display: grid;
  align-content: start;
  gap: calc(5px * var(--purchase-scale));
  padding: calc(6px * var(--purchase-scale));
}

.purchase-timeline-cell.collapsed-overdue {
  align-content: start;
  justify-content: stretch;
  background: color-mix(in srgb, var(--red) 5%, var(--surface-raised));
}

.purchase-overdue-summary {
  display: grid;
  gap: calc(3px * var(--purchase-scale));
  align-items: center;
  justify-items: center;
  min-height: calc(64px * var(--purchase-scale));
  border: 1px dashed color-mix(in srgb, var(--red) 34%, var(--line));
  border-radius: calc(8px * var(--purchase-scale));
  background: color-mix(in srgb, #ffe3e0 64%, var(--surface));
  color: color-mix(in srgb, var(--red) 70%, var(--text));
  cursor: pointer;
  font: inherit;
}

.purchase-overdue-summary strong {
  font-size: clamp(12px, calc(18px * var(--purchase-scale)), 18px);
  font-weight: 600;
}

.purchase-overdue-summary span {
  font-size: var(--purchase-card-small-font);
  font-weight: 560;
}

.purchase-today-marker {
  grid-row: 1 / -1;
  position: relative;
  z-index: 4;
  pointer-events: none;
}

.purchase-today-marker::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--today-progress, 50%);
  width: 1px;
  background: color-mix(in srgb, var(--red) 56%, transparent);
  box-shadow: 0 0 4px color-mix(in srgb, var(--red) 16%, transparent);
}

.purchase-timeline-block {
  min-width: calc(124px * var(--purchase-scale));
  border: 1px solid var(--line);
  border-left: max(2px, calc(4px * var(--purchase-scale))) solid var(--badge-default-text);
  border-radius: calc(7px * var(--purchase-scale));
  background: #eef8c9;
  color: #17212b;
  padding: calc(5px * var(--purchase-scale)) calc(7px * var(--purchase-scale));
  box-shadow: 0 1px 0 rgba(20, 35, 50, 0.04);
  font-size: var(--purchase-card-font);
}

.purchase-order-card {
  cursor: pointer;
}

.purchase-timeline-block-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(6px * var(--purchase-scale));
}

.purchase-transit-badge {
  flex: 0 0 auto;
  padding: calc(1px * var(--purchase-scale)) calc(6px * var(--purchase-scale));
  border-radius: 999px;
  font-size: var(--purchase-badge-font);
  font-style: normal;
  font-weight: 600;
}

.purchase-transit-badge.receive {
  background: #006cae;
  color: #ffffff;
}

.purchase-transit-badge.withdraw {
  background: #7b3ff2;
  color: #ffffff;
}

.purchase-transit-badge.ready {
  background: #00a651;
  color: #ffffff;
  animation: readyLabelPulse var(--pulse-speed) ease-in-out infinite;
}

.purchase-transit-badge.no-delivery {
  background: #546a7b;
  color: #ffffff;
}

.purchase-transit-badge.received {
  background: #d71920;
  color: #ffffff;
}

.purchase-transit-badge.rented {
  background: #d0007f;
  color: #ffffff;
}

.purchase-timeline-block.vencido { border-left-color: var(--red); background: #fff0ee; }
.purchase-timeline-block.hoy { border-left-color: var(--orange); background: #fff5df; }
.purchase-timeline-block.proximo { border-left-color: var(--blue); background: #eef8c9; }
.purchase-timeline-block.sin-fecha { border-left-color: var(--muted); background: var(--surface); }

.purchase-timeline-block.receive {
  border-left-color: #006cae;
  background: #e8f6ff;
  box-shadow: inset 0 0 0 1px rgba(0, 108, 174, 0.12), 0 1px 0 rgba(20, 35, 50, 0.04);
}

.purchase-timeline-block.withdraw {
  border-left-color: #7b3ff2;
  background: #fff1d6;
  box-shadow: inset 0 0 0 1px rgba(123, 63, 242, 0.16), 0 1px 0 rgba(20, 35, 50, 0.04);
}

.purchase-timeline-block.collection-ready {
  border-left-color: #00a651;
  background: #dcffe9;
  box-shadow: inset 0 0 0 1px rgba(0, 166, 81, 0.24), 0 1px 0 rgba(20, 35, 50, 0.04);
}

.purchase-timeline-block.no-delivery {
  border-left-color: #546a7b;
  background: #eef3f6;
  box-shadow: inset 0 0 0 1px rgba(84, 106, 123, 0.16), 0 1px 0 rgba(20, 35, 50, 0.04);
}

.purchase-timeline-block.vencido.receive,
.purchase-timeline-block.vencido.withdraw,
.purchase-timeline-block.vencido.no-delivery {
  border-left-color: #d71920;
  background: #ffe3e0;
  box-shadow: inset 0 0 0 1px rgba(215, 25, 32, 0.18), 0 1px 0 rgba(20, 35, 50, 0.04);
}

.purchase-timeline-block.vencido.collection-ready {
  border-left-color: #00a651;
  background: #d8ffe7;
  box-shadow: inset 0 0 0 1px rgba(0, 166, 81, 0.28), 0 1px 0 rgba(20, 35, 50, 0.04);
}

.purchase-timeline-block.rented-machine {
  border-left-color: #d0007f;
  background: #ffe1f2;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #d0007f 18%, transparent), 0 1px 0 rgba(20, 35, 50, 0.04);
}

.purchase-timeline-block.vencido.rented-machine {
  border-left-color: #d0007f;
  background: #ffd6eb;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #d0007f 20%, transparent), 0 1px 0 rgba(20, 35, 50, 0.04);
}

.purchase-timeline-block.collection-ready,
.purchase-timeline-block.vencido.collection-ready,
.purchase-timeline-block.rented-machine.collection-ready,
.purchase-timeline-block.vencido.rented-machine.collection-ready {
  border-left-color: #00a651;
  background: #d8ffe7;
  color: #0b2618;
  box-shadow: inset 0 0 0 1px rgba(0, 166, 81, 0.38), 0 0 16px rgba(0, 166, 81, 0.26);
  animation: readyOrderPulse var(--pulse-speed) ease-in-out infinite;
}

.purchase-timeline-block.collection-ready strong,
.purchase-timeline-block.collection-ready > span,
.purchase-timeline-block.collection-ready small {
  color: #10251a;
}

.purchase-timeline-block.received {
  border-left-color: #d71920;
  background: #ffe3e0;
  box-shadow: inset 0 0 0 1px rgba(215, 25, 32, 0.18), 0 0 12px rgba(215, 25, 32, 0.22);
  animation: received-order-pulse var(--pulse-speed) ease-in-out infinite;
}

.purchase-timeline-block strong,
.purchase-timeline-block span,
.purchase-timeline-block small {
  display: block;
}

.purchase-timeline-block .purchase-badge-row {
  display: flex;
  align-items: center;
  gap: calc(4px * var(--purchase-scale));
  max-width: none;
  margin-top: 0;
  overflow: visible;
  white-space: nowrap;
}

.purchase-timeline-block strong {
  color: #37308f;
  font-size: var(--purchase-card-font);
  font-weight: 600;
}

.purchase-timeline-block span {
  margin-top: calc(2px * var(--purchase-scale));
  max-width: calc(220px * var(--purchase-scale));
  overflow: hidden;
  white-space: normal;
  overflow-wrap: anywhere;
  font-weight: 560;
  font-size: var(--purchase-card-font);
  line-height: 1.18;
}

.purchase-timeline-block small {
  margin-top: calc(2px * var(--purchase-scale));
  color: #536271;
  font-size: var(--purchase-card-small-font);
  font-weight: 520;
}

.purchase-card-provider {
  display: block;
  margin: calc(2px * var(--purchase-scale)) 0 0;
  color: var(--purchase-muted);
  font-size: var(--purchase-card-small-font);
  font-weight: 560;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-timeline-empty,
.purchase-timeline-note {
  padding: 0 10px 8px;
}

.purchase-column {
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.purchase-column header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: calc(34px * var(--purchase-scale));
  padding: calc(7px * var(--purchase-scale)) calc(9px * var(--purchase-scale));
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
  font-weight: 560;
}

.purchase-column header strong {
  min-width: calc(24px * var(--purchase-scale));
  text-align: center;
  padding: calc(2px * var(--purchase-scale)) calc(6px * var(--purchase-scale));
  border-radius: 999px;
  background: var(--badge-blue-bg);
  color: var(--blue-dark);
}

.purchase-card-list {
  display: grid;
  align-content: start;
  gap: calc(6px * var(--purchase-scale));
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: calc(7px * var(--purchase-scale));
}

.purchase-card {
  border: 1px solid var(--line);
  border-left: max(2px, calc(4px * var(--purchase-scale))) solid var(--badge-default-text);
  border-radius: calc(8px * var(--purchase-scale));
  background: var(--surface-raised);
  padding: calc(7px * var(--purchase-scale));
  font-size: var(--purchase-card-font);
}

.purchase-request-card {
  padding: calc(6px * var(--purchase-scale)) calc(7px * var(--purchase-scale));
  cursor: pointer;
}

.purchase-card.vencido { border-left-color: var(--red); }
.purchase-card.hoy { border-left-color: var(--orange); }
.purchase-card.proximo { border-left-color: var(--blue); }
.purchase-card.sin-fecha { border-left-color: var(--muted); }
.purchase-card.sin-programacion { border-left-color: #7b8793; }
.purchase-card.solicitudes_pendientes { border-left-color: #607d8b; }
.purchase-card.pedidos_preparacion { border-left-color: #8a6f2a; }
.purchase-card.pendiente_aprobar { border-left-color: #cf7a12; }
.purchase-card.pendiente_enviar { border-left-color: #5c6bc0; }
.purchase-card.pendiente_pago { border-left-color: #7a4f2a; }
.purchase-card.pendiente_recibir { border-left-color: #006cae; }
.purchase-card.pendiente_retirar { border-left-color: #7b3ff2; }
.purchase-card.rented-machine {
  border-left-color: #d0007f;
  background: color-mix(in srgb, #d0007f 7%, var(--surface-raised));
}

.purchase-focus-panel .purchase-card.vencido,
.purchase-focus-panel .purchase-card.hoy,
.purchase-focus-panel .purchase-card.proximo,
.purchase-focus-panel .purchase-card.sin-fecha {
  border-left-color: inherit;
}

.purchase-focus-panel .purchase-card.pedidos_preparacion { border-left-color: #8a6f2a; }
.purchase-focus-panel .purchase-card.pendiente_aprobar { border-left-color: #cf7a12; }
.purchase-focus-panel .purchase-card.pendiente_enviar { border-left-color: #5c6bc0; }
.purchase-focus-panel .purchase-card.pendiente_pago { border-left-color: #7a4f2a; }

.purchase-card-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: calc(8px * var(--purchase-scale));
  align-items: center;
  min-width: 0;
}

.purchase-card-top strong {
  min-width: 0;
  font-size: var(--purchase-card-font);
  color: var(--corp);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-card-top span {
  padding: calc(2px * var(--purchase-scale)) calc(6px * var(--purchase-scale));
  border-radius: 999px;
  background: var(--badge-default-bg);
  color: var(--badge-default-text);
  font-size: var(--purchase-card-small-font);
  font-weight: 560;
}

.purchase-card-top .purchase-card-badges {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: calc(5px * var(--purchase-scale));
  padding: 0;
  background: transparent;
}

.purchase-card-top .purchase-card-badges > span {
  padding: calc(2px * var(--purchase-scale)) calc(6px * var(--purchase-scale));
  border-radius: 999px;
  background: var(--badge-default-bg);
  color: var(--badge-default-text);
}

.purchase-card-top .request-started-light {
  display: block;
  width: clamp(6px, calc(10px * var(--purchase-scale)), 10px);
  height: clamp(6px, calc(10px * var(--purchase-scale)), 10px);
  min-width: clamp(6px, calc(10px * var(--purchase-scale)), 10px);
  flex: 0 0 clamp(6px, calc(10px * var(--purchase-scale)), 10px);
  padding: 0;
  border: 1px solid color-mix(in srgb, #8cff00 74%, #ffffff);
  border-radius: 50%;
  background: #2af05a;
  box-shadow: 0 0 0 2px var(--badge-green-bg), 0 0 9px color-mix(in srgb, #48ff00 50%, transparent);
  animation: request-started-pulse var(--pulse-speed) ease-in-out infinite;
}

.purchase-card-top .request-light-stack {
  display: flex;
  gap: calc(5px * var(--purchase-scale));
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  min-width: 0;
  max-width: 100%;
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.purchase-card-top .request-light-stack .purchase-transit-badge {
  display: inline-flex;
  align-items: center;
  flex: 0 1 auto;
  min-height: calc(18px * var(--purchase-scale));
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-card-top .request-started-light.partial {
  border-color: color-mix(in srgb, #ffae00 74%, #ffffff);
  background: #ffae00;
  box-shadow: 0 0 0 2px #fff0cf, 0 0 9px color-mix(in srgb, #ffae00 52%, transparent);
  animation-name: request-partial-pulse;
}

.purchase-card-top .request-started-light.received {
  border-color: color-mix(in srgb, #ff3b30 76%, #ffffff);
  background: #ff3b30;
  box-shadow: 0 0 0 2px #ffe3e0, 0 0 9px color-mix(in srgb, #ff3b30 54%, transparent);
  animation-name: request-received-pulse;
}

.purchase-card-top .request-started-light.rented {
  border-color: color-mix(in srgb, #ff2ea6 72%, #ffffff);
  background: #ff2ea6;
  box-shadow: 0 0 0 2px #ffe2f3, 0 0 8px color-mix(in srgb, #ff2ea6 44%, transparent);
  animation-name: request-rented-pulse;
}

@keyframes request-started-pulse {
  0%, 100% {
    opacity: 0.7;
    transform: scale(0.92);
    background: var(--green);
    box-shadow: 0 0 0 2px var(--badge-green-bg), 0 0 5px color-mix(in srgb, var(--green) 38%, transparent);
  }
  50% {
    opacity: 0.9;
    transform: scale(1.08);
    background: #65ee24;
    box-shadow: 0 0 0 3px color-mix(in srgb, #65ee24 16%, transparent), 0 0 12px color-mix(in srgb, #65ee24 58%, transparent);
  }
}

@keyframes request-partial-pulse {
  0%, 100% {
    opacity: 0.7;
    transform: scale(0.92);
    background: #d78000;
    box-shadow: 0 0 0 2px #fff0cf, 0 0 5px color-mix(in srgb, #d78000 36%, transparent);
  }
  50% {
    opacity: 0.9;
    transform: scale(1.08);
    background: #f0b32b;
    box-shadow: 0 0 0 3px color-mix(in srgb, #f0b32b 16%, transparent), 0 0 12px color-mix(in srgb, #f0b32b 58%, transparent);
  }
}

@keyframes request-received-pulse {
  0%, 100% {
    opacity: 0.7;
    transform: scale(0.92);
    background: #d71920;
    box-shadow: 0 0 0 2px #ffe3e0, 0 0 5px rgba(215, 25, 32, 0.36);
  }
  50% {
    opacity: 0.9;
    transform: scale(1.08);
    background: #ef5148;
    box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.16), 0 0 12px rgba(255, 59, 48, 0.58);
  }
}

@keyframes request-rented-pulse {
  0%, 100% {
    opacity: 0.72;
    transform: scale(0.92);
    background: #d0007f;
    box-shadow: 0 0 0 2px #ffe2f3, 0 0 5px color-mix(in srgb, #d0007f 34%, transparent);
  }
  50% {
    opacity: 0.9;
    transform: scale(1.06);
    background: #ff2ea6;
    box-shadow: 0 0 0 3px color-mix(in srgb, #ff2ea6 14%, transparent), 0 0 11px color-mix(in srgb, #ff2ea6 46%, transparent);
  }
}

@keyframes received-order-pulse {
  0%, 100% {
    box-shadow: inset 0 0 0 1px rgba(215, 25, 32, 0.18), 0 0 6px rgba(215, 25, 32, 0.14);
  }
  50% {
    box-shadow: inset 0 0 0 1px rgba(215, 25, 32, 0.24), 0 0 16px rgba(215, 25, 32, 0.34);
  }
}

.purchase-title {
  margin: calc(4px * var(--purchase-scale)) 0;
  line-height: 1.25;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.purchase-request-card .purchase-title {
  -webkit-line-clamp: 2;
  margin: calc(5px * var(--purchase-scale)) 0 calc(4px * var(--purchase-scale));
  font-size: var(--purchase-card-title-font);
  line-height: 1.18;
}

.purchase-request-serial {
  margin: 0 0 calc(4px * var(--purchase-scale));
  color: var(--muted);
  font-size: var(--purchase-card-small-font);
  font-weight: 520;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.purchase-card dl {
  display: grid;
  gap: calc(3px * var(--purchase-scale));
  margin: 0;
}

.purchase-card dl div {
  display: grid;
  grid-template-columns: calc(52px * var(--purchase-scale)) minmax(0, 1fr);
  gap: calc(5px * var(--purchase-scale));
}

.purchase-card dt {
  color: var(--muted);
  font-weight: 520;
}

.purchase-card dd {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-detail,
.empty-stage {
  margin: calc(6px * var(--purchase-scale)) 0 0;
  color: var(--muted);
  font-size: var(--purchase-card-font);
  line-height: 1.3;
}

.purchase-tracking-shell .active-filter,
.purchase-tracking-shell .purchase-metric span,
.purchase-tracking-shell .purchase-transit-panel > header span,
.purchase-tracking-shell .purchase-transit-panel > header small,
.purchase-tracking-shell .purchase-timeline-note,
.purchase-tracking-shell .purchase-timeline-corner,
.purchase-tracking-shell .purchase-timeline-date,
.purchase-tracking-shell .purchase-card dt,
.purchase-tracking-shell .purchase-request-serial,
.purchase-tracking-shell .purchase-detail,
.purchase-tracking-shell .empty-stage {
  color: var(--purchase-muted);
  font-weight: 560;
}

.purchase-tracking-shell .purchase-metric strong,
.purchase-tracking-shell .purchase-transit-panel > header strong,
.purchase-tracking-shell .purchase-column header,
.purchase-tracking-shell .purchase-timeline-lane-label strong,
.purchase-tracking-shell .purchase-title,
.purchase-tracking-shell .purchase-card dd,
.purchase-tracking-shell .purchase-timeline-block span {
  color: var(--purchase-text);
  font-weight: 560;
}

.purchase-tracking-shell .purchase-column header strong,
.purchase-tracking-shell .purchase-card-top strong,
.purchase-tracking-shell .purchase-timeline-block strong {
  color: var(--purchase-code);
  font-weight: 600;
}

.purchase-tracking-shell .purchase-card-top span,
.purchase-tracking-shell .purchase-transit-badge,
.purchase-tracking-shell .purchase-timeline-lane-label span {
  font-weight: 560;
}

.purchase-tracking-shell .purchase-timeline-date.today,
.purchase-tracking-shell .purchase-timeline-date.today span,
.purchase-tracking-shell .purchase-timeline-date.today strong {
  color: #ffffff;
}

.purchase-tracking-shell .purchase-timeline-block strong {
  color: #37308f;
}

.purchase-tracking-shell .purchase-timeline-block span {
  color: #17212b;
}

.purchase-tracking-shell .purchase-timeline-block small {
  color: #536271;
}

.purchase-tracking-shell .purchase-timeline-block.vencido span,
.purchase-tracking-shell .purchase-timeline-block.received span,
.purchase-tracking-shell .purchase-timeline-block.rented-machine span {
  color: #17212b;
}

.purchase-focus-panel {
  flex: 1;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.purchase-focus-panel > header {
  min-height: 32px;
  padding: 5px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.purchase-focus-panel > header div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.purchase-focus-panel > header span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 520;
}

.small-btn {
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-raised);
  color: var(--muted);
  padding: 0 8px;
  font-weight: 540;
  cursor: pointer;
}

.purchase-focus-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(145px, calc(250px * var(--purchase-scale)), 250px), 1fr));
  align-content: start;
  gap: 7px;
  padding: 7px;
}

.purchase-provider-board {
  flex: 1;
  width: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.purchase-provider-board > header {
  min-height: calc(30px * var(--purchase-scale));
  padding: calc(5px * var(--purchase-scale)) calc(8px * var(--purchase-scale));
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.purchase-provider-board > header div {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.purchase-provider-board > header span {
  color: var(--muted);
  font-size: var(--purchase-card-small-font);
}

.purchase-provider-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: calc(8px * var(--purchase-scale));
  align-content: start;
  padding: calc(8px * var(--purchase-scale));
}

.purchase-provider-group {
  display: grid;
  gap: calc(7px * var(--purchase-scale));
  padding: calc(9px * var(--purchase-scale));
  border: 1px solid color-mix(in srgb, var(--corp) 18%, var(--line));
  border-radius: 8px;
  background: var(--surface-raised);
}

.purchase-provider-group > header {
  display: grid;
  grid-template-columns: minmax(calc(190px * var(--purchase-scale)), 1fr) auto;
  gap: calc(10px * var(--purchase-scale));
  align-items: start;
  margin: calc(-9px * var(--purchase-scale)) calc(-9px * var(--purchase-scale)) 0;
  padding: calc(8px * var(--purchase-scale)) calc(9px * var(--purchase-scale));
  border-bottom: 1px solid color-mix(in srgb, var(--corp) 28%, var(--line));
  border-radius: 8px 8px 0 0;
  background: color-mix(in srgb, var(--corp) 14%, var(--surface));
}

.purchase-provider-group > header strong {
  display: block;
  color: var(--text);
  font-size: var(--purchase-card-title-font);
}

.purchase-provider-group > header span,
.purchase-provider-group > header small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: var(--purchase-card-small-font);
}

.purchase-provider-counts {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: calc(5px * var(--purchase-scale));
}

.purchase-provider-counts span,
.purchase-provider-note-count {
  padding: calc(2px * var(--purchase-scale)) calc(6px * var(--purchase-scale));
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: var(--purchase-card-small-font);
  white-space: nowrap;
}

.purchase-provider-copy {
  min-height: calc(22px * var(--purchase-scale));
  padding: calc(3px * var(--purchase-scale)) calc(8px * var(--purchase-scale));
  border-color: color-mix(in srgb, var(--corp) 30%, var(--line));
  background: var(--surface);
  color: var(--corp);
  font-size: var(--purchase-card-small-font);
  font-weight: 650;
}

.purchase-provider-copy:disabled {
  opacity: 0.72;
}

.purchase-provider-ready-action {
  min-height: calc(22px * var(--purchase-scale));
  padding: calc(3px * var(--purchase-scale)) calc(8px * var(--purchase-scale));
  border-color: color-mix(in srgb, var(--green) 34%, var(--line));
  background: var(--surface);
  color: var(--green);
  font-size: var(--purchase-card-small-font);
  font-weight: 650;
  white-space: nowrap;
}

.purchase-provider-ready-action.active {
  background: color-mix(in srgb, var(--green) 13%, var(--surface));
  border-color: color-mix(in srgb, var(--green) 62%, var(--line));
}

.provider-copy-dialog form {
  width: min(420px, calc(100vw - 32px));
  padding: 14px;
  display: grid;
  gap: 12px;
}

.provider-copy-options {
  margin: 0;
  padding: 10px;
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
}

.provider-copy-options legend,
.provider-copy-hint {
  color: var(--muted);
  font-size: 12px;
}

.provider-copy-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 560;
}

.purchase-provider-items {
  display: grid;
  gap: calc(5px * var(--purchase-scale));
}

.purchase-provider-item {
  width: 100%;
  min-height: calc(30px * var(--purchase-scale));
  display: grid;
  gap: calc(6px * var(--purchase-scale));
  padding: 0;
  border: 1px solid color-mix(in srgb, #2b79c2 16%, var(--line));
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.purchase-provider-item-head {
  display: grid;
  grid-template-columns: calc(94px * var(--purchase-scale)) minmax(calc(150px * var(--purchase-scale)), 1fr) auto auto auto;
  gap: calc(8px * var(--purchase-scale));
  align-items: center;
  padding: calc(7px * var(--purchase-scale)) calc(8px * var(--purchase-scale));
  border-bottom: 1px solid color-mix(in srgb, #2b79c2 14%, var(--line));
  border-radius: 7px 7px 0 0;
  background: color-mix(in srgb, #2b79c2 7%, var(--surface));
}

.purchase-provider-item:hover {
  border-color: var(--corp);
  box-shadow: 0 0 0 2px var(--corp-shadow);
}

.purchase-provider-item.collection-ready {
  border-color: color-mix(in srgb, #00a651 46%, var(--line));
  box-shadow: inset 0 0 0 1px rgba(0, 166, 81, 0.18);
}

.purchase-provider-item.collection-ready .purchase-provider-item-head {
  background: color-mix(in srgb, #00a651 12%, var(--surface));
  border-bottom-color: color-mix(in srgb, #00a651 28%, var(--line));
}

.purchase-provider-code-ready {
  display: inline-flex;
  width: fit-content;
  padding: calc(2px * var(--purchase-scale)) calc(7px * var(--purchase-scale));
  border-radius: 999px;
  background: #d8ffe7;
  color: #005c2d;
  box-shadow: inset 0 0 0 1px rgba(0, 166, 81, 0.38);
  animation: readyCodePulse var(--pulse-speed) ease-in-out infinite;
}

.purchase-provider-ready {
  padding: calc(2px * var(--purchase-scale)) calc(7px * var(--purchase-scale));
  border-radius: 999px;
  background: #00a651;
  color: #ffffff;
  font-size: var(--purchase-card-small-font);
  font-weight: 650;
  white-space: nowrap;
}

@keyframes readyCodePulse {
  0%, 100% {
    background: #d8ffe7;
    box-shadow: inset 0 0 0 1px rgba(0, 166, 81, 0.38), 0 0 0 rgba(0, 166, 81, 0);
  }
  50% {
    background: #52f28f;
    box-shadow: inset 0 0 0 1px rgba(0, 166, 81, 0.62), 0 0 16px rgba(0, 230, 118, 0.42);
  }
}

@keyframes readyOrderPulse {
  0%, 100% {
    background: #ccffdf;
    box-shadow: inset 0 0 0 1px rgba(0, 166, 81, 0.42), 0 0 6px rgba(0, 166, 81, 0.2);
  }
  50% {
    background: #52f28f;
    box-shadow: inset 0 0 0 1px rgba(0, 166, 81, 0.62), 0 0 24px rgba(0, 230, 118, 0.48);
  }
}

@keyframes readyLabelPulse {
  0%, 100% {
    filter: brightness(1);
    box-shadow: 0 0 0 rgba(0, 166, 81, 0);
  }
  50% {
    filter: brightness(1.08);
    box-shadow: 0 0 10px rgba(0, 166, 81, 0.28);
  }
}

.purchase-provider-actions {
  display: flex;
  justify-content: flex-end;
  padding: 0 calc(8px * var(--purchase-scale)) calc(8px * var(--purchase-scale));
}

.purchase-ready-action.active {
  border-color: #00a651;
  background: color-mix(in srgb, #00a651 12%, var(--surface));
  color: #007a3c;
}

.purchase-provider-stage,
.purchase-provider-time,
.purchase-provider-date,
.purchase-provider-contact,
.purchase-provider-products {
  color: var(--muted);
  font-size: var(--purchase-card-small-font);
}

.purchase-provider-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: calc(5px * var(--purchase-scale));
  padding: calc(6px * var(--purchase-scale)) calc(8px * var(--purchase-scale)) 0;
}

.purchase-provider-chip {
  display: inline-flex;
  align-items: center;
  gap: calc(5px * var(--purchase-scale));
  min-height: calc(20px * var(--purchase-scale));
  padding: calc(2px * var(--purchase-scale)) calc(8px * var(--purchase-scale));
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--text);
  font-size: var(--purchase-card-small-font);
  font-weight: 590;
  line-height: 1;
}

.purchase-provider-meta small {
  color: color-mix(in srgb, currentColor 74%, white);
  font-size: clamp(6px, calc(8px * var(--purchase-scale)), 8px);
  font-weight: 560;
  text-transform: uppercase;
}

.purchase-provider-stage.solicitudes_pendientes { background: #607d8b; color: #ffffff; }
.purchase-provider-stage.pedidos_preparacion { background: #8a6f2a; color: #ffffff; }
.purchase-provider-stage.pendiente_aprobar { background: #cf7a12; color: #ffffff; }
.purchase-provider-stage.pendiente_enviar { background: #5c6bc0; color: #ffffff; }
.purchase-provider-stage.pendiente_pago { background: #7a4f2a; color: #ffffff; }
.purchase-provider-stage.pendiente_recibir { background: #006cae; color: #ffffff; }
.purchase-provider-stage.pendiente_retirar { background: #7b3ff2; color: #ffffff; }
.purchase-provider-stage.ready { background: #00a651; color: #ffffff; }
.purchase-provider-stage.no-delivery { background: #546a7b; color: #ffffff; }
.purchase-provider-time.vencido { background: #d71920; color: #ffffff; }
.purchase-provider-time.hoy { background: var(--corp); color: #ffffff; }
.purchase-provider-time.proximo { background: #2b79c2; color: #ffffff; }
.purchase-provider-time.sin-fecha,
.purchase-provider-time.sin-programacion { background: #7b8793; color: #ffffff; }
.purchase-provider-date { border: 1px solid var(--line); background: var(--surface); color: var(--muted); }
.purchase-provider-days {
  border: 1px solid #d7e0e8;
  background: #f7fafc;
  color: #425466;
}
.purchase-provider-days.overdue {
  border-color: #d71920;
  background: #d71920;
  color: #ffffff;
}
.purchase-provider-rented {
  background: #d0007f;
  color: #ffffff;
  animation: rentedMetricPulse var(--pulse-speed) ease-in-out infinite;
}

.purchase-provider-item strong {
  color: var(--corp);
  font-size: var(--purchase-card-font);
}

.purchase-provider-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--purchase-card-font);
}

.purchase-provider-contact {
  padding: 0 calc(8px * var(--purchase-scale));
}

.purchase-provider-product-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  border: 1px solid var(--line);
  border-radius: 0 0 7px 7px;
  overflow: hidden;
  background: var(--surface-raised);
}

.purchase-provider-product-table th,
.purchase-provider-product-table td {
  padding: calc(5px * var(--purchase-scale)) calc(7px * var(--purchase-scale));
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: var(--purchase-card-small-font);
}

.purchase-provider-product-table th {
  background: var(--surface);
  color: color-mix(in srgb, var(--muted) 88%, var(--text));
  text-transform: uppercase;
}

.purchase-provider-product-table th:nth-child(1),
.purchase-provider-product-table td:nth-child(1) {
  width: calc(58px * var(--purchase-scale));
  white-space: nowrap;
}

.purchase-provider-product-table th:nth-child(2),
.purchase-provider-product-table td:nth-child(2) {
  width: calc(92px * var(--purchase-scale));
  color: var(--corp);
  font-weight: 600;
}

.purchase-provider-product-table th:nth-child(3),
.purchase-provider-product-table td:nth-child(3) {
  width: calc(92px * var(--purchase-scale));
}

.purchase-provider-product-table th:nth-child(4),
.purchase-provider-product-table td:nth-child(4) {
  width: calc(120px * var(--purchase-scale));
}

.purchase-provider-product-table th:nth-child(5),
.purchase-provider-product-table td:nth-child(5) {
  width: auto;
}

.purchase-provider-product-table tr:last-child td {
  border-bottom: 0;
}

.purchase-provider-product-table th:last-child,
.purchase-provider-product-table td:last-child {
  border-right: 0;
}

.purchase-provider-no-products {
  margin: 0;
  color: var(--muted);
  font-size: var(--purchase-card-font);
}

.purchase-ready-report {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.purchase-ready-report-toolbar,
.purchase-ready-provider > header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.purchase-ready-report-toolbar {
  min-height: calc(34px * var(--purchase-scale));
  padding: calc(7px * var(--purchase-scale)) calc(9px * var(--purchase-scale));
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.purchase-tracking-shell.ready-report-mode .metric-ready.has-ready-items {
  animation: none;
  background: color-mix(in srgb, #00a651 28%, var(--surface));
  border-color: #00a651;
  box-shadow: inset 0 0 0 1px rgba(0, 166, 81, 0.38), 0 0 0 2px rgba(0, 166, 81, 0.13);
}

.purchase-tracking-shell.ready-report-mode .metric-ready.has-ready-items::after {
  content: "Reporte";
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #00a651;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
}

.purchase-ready-report-toolbar strong,
.purchase-ready-provider > header strong {
  display: block;
  color: var(--text);
  font-size: var(--purchase-card-title-font);
}

.purchase-ready-report-toolbar span,
.purchase-ready-provider > header span,
.purchase-ready-provider > header small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: var(--purchase-card-small-font);
}

.purchase-ready-report-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.purchase-ready-report-close {
  border-color: color-mix(in srgb, var(--corp) 35%, var(--line));
  color: var(--corp);
  font-weight: 700;
}

.purchase-ready-print-head {
  display: none;
}

.purchase-ready-report-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: calc(9px * var(--purchase-scale));
  padding: calc(9px * var(--purchase-scale));
}

.purchase-ready-provider {
  display: grid;
  gap: calc(7px * var(--purchase-scale));
  border: 1px solid color-mix(in srgb, #00a651 24%, var(--line));
  border-radius: 8px;
  background: var(--surface-raised);
  overflow: visible;
}

.purchase-ready-provider > header {
  padding: calc(8px * var(--purchase-scale)) calc(9px * var(--purchase-scale));
  border-bottom: 1px solid color-mix(in srgb, #00a651 28%, var(--line));
  background: color-mix(in srgb, #00a651 9%, var(--surface));
}

.purchase-ready-orders {
  display: grid;
  gap: calc(7px * var(--purchase-scale));
  padding: 0 calc(8px * var(--purchase-scale)) calc(8px * var(--purchase-scale));
}

.purchase-ready-order {
  --ready-order-pad-x: calc(8px * var(--purchase-scale));
  --ready-order-gap: calc(8px * var(--purchase-scale));
  --ready-select-col: clamp(38px, calc(44px * var(--purchase-scale)), 52px);
  --ready-code-col: clamp(112px, calc(130px * var(--purchase-scale)), 155px);
  --ready-lines-offset: calc(var(--ready-order-pad-x) + var(--ready-select-col) + var(--ready-order-gap) + var(--ready-code-col) + var(--ready-order-gap));
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  overflow: hidden;
}

.purchase-ready-order.selected {
  border-color: color-mix(in srgb, #00a651 34%, var(--line));
  background: color-mix(in srgb, #00a651 5%, var(--surface));
}

.purchase-ready-order > header {
  display: grid;
  grid-template-columns: var(--ready-select-col) var(--ready-code-col) minmax(0, 1fr);
  align-items: start;
  gap: var(--ready-order-gap);
  padding: calc(7px * var(--purchase-scale)) var(--ready-order-pad-x);
  background: color-mix(in srgb, var(--surface-soft) 72%, var(--surface));
}

.purchase-ready-order.selected > header {
  background: color-mix(in srgb, #00a651 9%, var(--surface));
}

.purchase-ready-order > header strong {
  color: var(--corp);
  font-size: clamp(12px, calc(13px * var(--purchase-scale)), 15px);
  overflow-wrap: anywhere;
}

.purchase-ready-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.purchase-ready-check input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.purchase-ready-order > header div span {
  display: block;
  color: var(--text);
  font-weight: 800;
  font-size: clamp(11px, calc(12px * var(--purchase-scale)), 14px);
  overflow-wrap: anywhere;
}

.purchase-ready-order > header div small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: clamp(10px, calc(11px * var(--purchase-scale)), 12px);
  overflow-wrap: anywhere;
}

.purchase-ready-lines {
  width: calc(100% - var(--ready-lines-offset) - var(--ready-order-pad-x));
  margin-left: var(--ready-lines-offset);
  border-collapse: collapse;
  table-layout: fixed;
}

.purchase-ready-lines th,
.purchase-ready-lines td {
  padding: calc(5px * var(--purchase-scale)) calc(7px * var(--purchase-scale));
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: clamp(10px, calc(11px * var(--purchase-scale)), 12px);
  overflow-wrap: anywhere;
}

.purchase-ready-lines th {
  background: var(--surface-soft);
  color: color-mix(in srgb, var(--muted) 88%, var(--text));
  text-transform: uppercase;
  white-space: nowrap;
}

.purchase-ready-lines th:first-child,
.purchase-ready-lines td:first-child {
  width: clamp(62px, calc(76px * var(--purchase-scale)), 92px);
  white-space: nowrap;
}

.purchase-ready-lines tbody tr:last-child td {
  border-bottom: 0;
}

.ticket-table {
  width: max(100%, 1390px);
  min-width: 1390px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.ticket-table col[data-col="code"] { width: 145px; }
.ticket-table col[data-col="title"] { width: 420px; }
.ticket-table col[data-col="module"] { width: 150px; }
.ticket-table col[data-col="owner"] { width: 180px; }
.ticket-table col[data-col="opened"] { width: 150px; }
.ticket-table col[data-col="status"] { width: 145px; }
.ticket-table col[data-col="priority"] { width: 145px; }
.ticket-table col[data-col="attachments"] { width: 75px; }
.ticket-table col[data-col="replies"] { width: 80px; }

.ticket-table th,
.ticket-table td {
  min-height: 30px;
  padding: 0 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.ticket-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 29px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  text-align: left;
  text-transform: uppercase;
}

.ticket-table th {
  padding-right: 14px;
}

.sort-head {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  cursor: pointer;
  text-align: left;
  text-transform: uppercase;
  font-weight: 600;
}

.sort-head.center { justify-content: center; }

.resize-handle {
  display: none;
}

.resize-handle:hover,
.resize-handle:active {
  background: color-mix(in srgb, var(--corp) 28%, transparent);
}

.sort-icons {
  color: #98a5b1;
  font-size: 8px;
  letter-spacing: -1px;
}

.sort-head.sorted .sort-icons {
  color: var(--blue-dark);
}

.sort-head.sorted[data-direction="asc"] .sort-icons::before,
.sort-head.sorted[data-direction="desc"] .sort-icons::after {
  color: var(--blue-dark);
}

.ticket-table th:nth-child(8),
.ticket-table th:nth-child(9) { text-align: center; }

.ticket-table td:nth-child(8),
.ticket-table td:nth-child(9) { text-align: center; color: var(--muted); }

.ticket-table tbody tr {
  background: var(--surface-raised);
  cursor: pointer;
}

.ticket-table tbody tr:hover {
  background: var(--surface-soft);
}

.ticket-table tbody tr.selected {
  background: rgba(0, 108, 174, 0.1);
}

.ticket-table tbody tr.closed {
  opacity: 0.62;
}

.ticket-table tbody tr[data-status="pendiente"] .code-cell { border-left: 4px solid var(--blue); }
.ticket-table tbody tr[data-status="iniciado"] .code-cell { border-left: 4px solid var(--green); }
.ticket-table tbody tr[data-status="cerrado"] .code-cell,
.ticket-table tbody tr[data-status="descartado"] .code-cell { border-left: 4px solid #7b8793; }
.ticket-table tbody tr .code-cell { border-left: 4px solid var(--ticket-status-color, transparent); }

.code-cell {
  color: var(--blue-dark);
  font-weight: 600;
  min-width: 145px;
  white-space: nowrap;
}

.ticket-table td.title-cell {
  font-weight: 560;
  padding-top: 4px;
  padding-bottom: 4px;
  white-space: normal;
  display: flex;
  align-items: center;
  gap: 8px;
}

.title-text {
  display: -webkit-box;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  line-height: 1.16;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.ticket-unread-badge {
  flex: 0 0 auto;
}

.unread-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  border: 1px solid rgba(255, 255, 255, 0.85);
}

.new-ticket-dot {
  width: 9px;
  height: 9px;
  display: inline-block;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 3px var(--badge-red-bg);
  vertical-align: 1px;
}

.reply-count {
  display: inline-flex;
  min-width: 24px;
  min-height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
}

.unread-reply-count {
  background: var(--red);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 0 0 3px var(--badge-red-bg);
}

.ticket-table tbody tr.unread {
  background: rgba(181, 29, 42, 0.06);
}

.ticket-table tbody tr.unread .title-cell {
  font-weight: 600;
}

.empty-row {
  height: 72px;
  text-align: center;
  color: var(--muted);
}

.ticket-layout {
  display: grid;
  grid-template-columns: minmax(330px, 34%) minmax(620px, 1fr);
  gap: 10px;
  height: calc(100vh - 158px);
  min-height: 540px;
}

.ticket-board,
.ticket-detail {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.board-toolbar {
  padding: 6px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.module-filter-toolbar {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  box-shadow: none;
}

.failures-filter-toolbar {
  display: grid;
  gap: 8px;
  align-items: stretch;
}

.failures-filter-row {
  display: grid;
  align-items: end;
  gap: 8px 10px;
}

.failures-filter-row-main {
  grid-template-columns: minmax(190px, 0.9fr) minmax(190px, 0.9fr) minmax(190px, 1.15fr) minmax(130px, 0.65fr) minmax(105px, 0.55fr);
}

.failures-filter-row-selectors {
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.25fr) minmax(180px, 1fr) minmax(220px, 1.25fr) auto auto auto;
}

.failures-filter-toolbar .primary-btn,
.failures-filter-toolbar .report-btn,
.failures-filter-toolbar .filter-clear-btn {
  min-height: 32px;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 650;
}

.failures-filter-toolbar .filter-clear-btn {
  border: 1px solid rgba(55, 48, 143, 0.26);
  border-radius: 7px;
  background: var(--surface-raised);
  color: var(--blue-dark);
  padding: 0 12px;
  cursor: pointer;
}

.failures-filter-toolbar .filter-clear-btn:hover,
.failures-filter-toolbar .filter-clear-btn:focus-visible {
  border-color: var(--corp);
  box-shadow: 0 0 0 3px var(--corp-shadow);
}

.failures-filter-toolbar .report-btn {
  border: 1px solid rgba(55, 48, 143, 0.38);
  border-radius: 7px;
  background: #fff;
  color: var(--corp);
  padding: 0 13px;
  cursor: pointer;
}

.failures-filter-toolbar .report-btn:hover:not(:disabled),
.failures-filter-toolbar .report-btn:focus-visible:not(:disabled) {
  border-color: var(--corp);
  box-shadow: 0 0 0 3px var(--corp-shadow);
}

.failures-filter-toolbar .report-btn:disabled {
  cursor: default;
  opacity: 0.58;
  color: var(--muted);
  border-color: var(--line);
  background: var(--surface-raised);
  box-shadow: none;
}

.failures-filter-toolbar label {
  display: grid;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.failure-date-control,
.failure-lookup-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px;
  align-items: center;
  height: 30px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--field);
  overflow: hidden;
}

.failure-lookup-control {
  grid-template-columns: minmax(0, 1fr) 46px;
}

.failure-date-control input,
.failure-lookup-control input {
  grid-column: 1;
  min-width: 0;
  width: 100%;
  height: 28px;
  border: 0;
  border-radius: 0;
  padding: 0 8px;
  background: transparent;
  color: var(--text);
  font-weight: 650;
}

.failure-date-control .icon-btn,
.failure-lookup-control .icon-btn {
  display: grid;
  place-items: center;
  grid-column: 2;
  position: relative;
  z-index: 2;
  width: 100%;
  height: 28px;
  min-width: 0;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  background: var(--corp-soft);
  color: var(--corp);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  padding: 0;
  text-align: center;
  opacity: 1;
}

.failure-date-control .icon-btn {
  background: #fff;
  color: var(--corp);
  box-shadow: inset 0 0 0 1px rgba(55, 48, 143, 0.12);
}

.failure-lookup-control .icon-btn {
  background: #fff;
  color: var(--corp);
  box-shadow: inset 0 0 0 1px rgba(55, 48, 143, 0.12);
}

.failure-lookup-control input[readonly] {
  cursor: pointer;
}

.failure-lookup-control:focus-within {
  border-color: rgba(55, 48, 143, 0.55);
  box-shadow: 0 0 0 3px var(--corp-shadow);
}

.native-date-picker {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 1180px) {
  .failures-filter-row-main,
  .failures-filter-row-selectors {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

.failure-calendar-popover {
  position: fixed;
  z-index: 1000;
  width: 232px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--text);
  box-shadow: var(--shadow);
}

.failure-calendar-popover header,
.failure-calendar-weekdays,
.failure-calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.failure-calendar-popover header {
  grid-template-columns: 28px 1fr 28px;
  align-items: center;
  margin-bottom: 6px;
}

.failure-calendar-popover header strong {
  text-align: center;
  font-size: 13px;
}

.failure-calendar-popover button {
  min-width: 0;
  height: 26px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-weight: 700;
}

.failure-calendar-popover button:hover,
.failure-calendar-popover button:focus-visible {
  background: var(--surface-soft);
  outline: 1px solid var(--blue);
}

.failure-calendar-weekdays {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-align: center;
}

.failure-calendar-days button.outside {
  color: color-mix(in srgb, var(--muted) 58%, transparent);
}

.failure-calendar-days button.today {
  color: var(--blue);
}

.failure-calendar-days button.selected {
  background: var(--blue);
  color: #fff;
}

.purchase-filter-toolbar {
  flex: 0 0 auto;
  flex-wrap: wrap;
  border-radius: 8px 8px 0 0;
  border-bottom: 1px solid var(--line);
}

.purchase-search-wrap {
  min-width: min(380px, 38vw);
}

.purchase-serial-search-wrap {
  flex: 0 1 180px;
  min-width: 140px;
}

.purchase-delegation-filter {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-raised);
  color: var(--muted);
  font-size: 10.5px;
  white-space: nowrap;
}

.purchase-delegation-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 20px;
  padding: 0 5px;
  border: 1px solid #c9d8e5;
  border-radius: 6px;
  background: var(--surface);
  color: var(--blue-dark);
  cursor: pointer;
}

.purchase-delegation-chip input {
  width: 12px;
  height: 12px;
  margin: 0;
  accent-color: var(--corp);
}

.purchase-delegation-chip:has(input:checked) {
  border-color: var(--corp);
  background: var(--corp-soft);
  color: var(--corp);
}

.search-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 7px;
  height: 26px;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  font-size: 10.5px;
}

.search-wrap input,
select,
textarea,
dialog input {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--field);
  color: var(--text);
}

.search-wrap input {
  border: 0;
  outline: 0;
  flex: 1;
  min-width: 120px;
  background: transparent;
}

select {
  height: 26px;
  padding: 0 7px;
}

.ticket-list {
  height: calc(100% - 51px);
  overflow: auto;
  padding: 8px;
}

.ticket-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  width: 100%;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  background: var(--surface-raised);
  border-radius: 8px;
  padding: 9px 10px;
  margin-bottom: 7px;
  cursor: pointer;
  text-align: left;
}

.ticket-card.active {
  border-color: #8bbfe0;
  box-shadow: 0 0 0 3px rgba(0, 108, 174, 0.13);
}

.ticket-card.closed { opacity: 0.68; }
.ticket-card[data-priority="urgente"] { border-left-color: var(--red); }
.ticket-card[data-priority="alta"] { border-left-color: var(--orange); }
.ticket-card[data-priority="baja"] { border-left-color: var(--green); }

.card-title {
  display: block;
  font-weight: 600;
  margin-bottom: 3px;
}

.badges {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: end;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 560;
  background: var(--badge-default-bg);
  color: var(--badge-default-text);
}

.badge.urgente { background: var(--priority-red-bg); color: #fff; }
.badge.cerrado, .badge.descartado { background: var(--chip-bg); color: var(--muted); }
.badge.alta { background: var(--priority-orange-bg); color: #fff; }
.badge.baja { background: var(--priority-green-bg); color: #fff; }
.badge.media { background: var(--priority-yellow-bg); color: var(--yellow-text); }
.badge.pendiente { background: var(--badge-blue-bg); color: var(--blue-dark); }
.badge.iniciado { background: var(--badge-green-bg); color: var(--green); }

.editable-cell {
  padding: 0 5px;
}

.grid-select {
  width: 100%;
  height: 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--badge-default-bg);
  color: var(--badge-default-text);
  font-size: 10px;
  font-weight: 560;
  cursor: pointer;
}

.status-grid-select,
.priority-grid-select {
  padding: 0 5px;
}

.grid-select.status-pendiente {
  background: var(--badge-blue-bg);
  color: var(--blue-dark);
}

.grid-select.status-iniciado {
  background: var(--badge-green-bg);
  color: var(--green);
}

.grid-select.priority-baja {
  background: var(--priority-green-bg);
  color: #fff;
}

.grid-select.priority-media {
  background: var(--priority-yellow-bg);
  color: var(--yellow-text);
}

.grid-select.status-cerrado,
.grid-select.status-descartado {
  background: var(--chip-bg);
  color: var(--muted);
}

.grid-select.priority-alta {
  background: var(--priority-orange-bg);
  color: #fff;
}

.grid-select.priority-urgente {
  background: var(--priority-red-bg);
  color: #fff;
}

.ticket-detail {
  display: flex;
  flex-direction: column;
}

.ticket-detail-dialog {
  width: min(1220px, calc(100vw - 54px));
  max-width: none;
}

.ticket-detail-dialog form {
  height: min(760px, calc(100vh - 54px));
  display: flex;
  flex-direction: column;
  background: var(--surface);
}

.ticket-requester-control {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11px;
  color: var(--muted);
}

.ticket-requester-control select {
  min-width: 180px;
}

.ticket-creator-note {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
}

.ticket-options-dialog {
  width: min(920px, calc(100vw - 44px));
  max-height: calc(100vh - 44px);
}

.ticket-options-dialog form {
  display: grid;
  gap: 14px;
  padding: 18px 20px 20px;
  background: var(--surface);
  overflow: auto;
}

.ticket-options-list {
  display: grid;
  gap: 8px;
  max-height: min(280px, 34vh);
  overflow: auto;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.ticket-option-row {
  display: grid;
  grid-template-columns: 42px minmax(120px, 1fr) minmax(190px, 1.4fr);
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-raised);
  color: var(--text);
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
}

.ticket-option-row.selected {
  border-color: var(--corp);
  box-shadow: 0 0 0 3px var(--corp-shadow);
}

.ticket-option-row small {
  color: var(--muted);
}

.ticket-option-swatch {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 11px;
  font-weight: 800;
}

.ticket-options-dialog .form-row {
  align-items: end;
  flex-wrap: wrap;
}

.ticket-options-dialog .ticket-option-new {
  min-height: 32px;
  padding-inline: 16px;
}

.ticket-options-dialog input[type="color"] {
  min-width: 82px;
  padding: 3px 8px;
}

.detail-top {
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.ticket-code {
  margin-bottom: 3px;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 600;
}

.detail-grid {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(390px, 1.15fr) minmax(390px, 1fr) minmax(210px, 0.55fr);
  gap: 9px;
  padding: 10px;
  min-height: 0;
  overflow: hidden;
  background: var(--surface-soft);
}

.detail-panel {
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  min-height: 0;
  overflow: auto;
}

.detail-panel.original { border-top: 4px solid var(--blue-dark); }

.message-body {
  font-size: 14px;
  line-height: 1.32;
}

.message-body p { margin-bottom: 8px; }

.message-text {
  white-space: pre-wrap;
}

.message-attachments {
  margin-top: 9px;
  padding: 8px;
  border: 1px solid color-mix(in srgb, var(--blue-dark) 24%, var(--line));
  border-radius: 7px;
  background: color-mix(in srgb, var(--badge-blue-bg) 55%, var(--surface));
}

.message-attachments-heading {
  display: block;
  margin: 0 0 6px;
  color: var(--blue-dark);
  font-size: 11px;
}

.message-attachments-items {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.message-attachments-items .editor-media,
.message-attachments-items .editor-doc {
  margin: 0;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.reply-list {
  flex: 1;
  display: grid;
  align-content: start;
  gap: 7px;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.replies-panel {
  display: flex;
  flex-direction: column;
}

.reply {
  position: relative;
  width: 100%;
  padding: 8px;
  background: var(--reply-bg);
  border-left: 3px solid #9cb4c7;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  border-radius: 7px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.reply:hover {
  box-shadow: 0 0 0 2px var(--corp-shadow);
}

.reply-main {
  display: block;
  width: 100%;
  cursor: pointer;
}

.reply-main:focus-visible {
  outline: 2px solid var(--corp);
  outline-offset: 3px;
  border-radius: 5px;
}

.reply-body {
  display: block;
}

.reply:not(.expanded) .reply-body .message-text {
  display: block;
  overflow: visible;
  white-space: pre-wrap;
}

.reply.expanded .reply-body .message-text {
  white-space: pre-wrap;
}

.reply.expanded {
  background: color-mix(in srgb, var(--reply-bg) 82%, var(--corp-soft));
  box-shadow: inset 0 0 0 1px rgba(55, 48, 143, 0.12);
}

.reply.unread-reply {
  border-left-color: var(--red);
  background: color-mix(in srgb, var(--badge-red-bg) 68%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--red) 22%, var(--line)), 0 0 0 2px color-mix(in srgb, var(--red) 8%, transparent);
}

.reply strong {
  display: block;
  font-size: 11px;
  margin-bottom: 3px;
}

.reply-alert {
  float: right;
  padding: 2px 7px;
  font-size: 10px;
  box-shadow: 0 0 0 2px var(--badge-red-bg);
}

.reply-file-indicator {
  display: inline-flex;
  margin-left: 7px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--corp-soft);
  color: var(--corp);
  font-size: 10px;
  font-weight: 600;
}

.reply-thread-indicator {
  display: inline-flex;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--badge-blue-bg);
  color: var(--blue-dark);
  font-size: 10px;
  font-weight: 600;
}

.reply-command-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin-top: 6px;
  padding-top: 5px;
  border-top: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

.reply-command-row > span {
  margin-right: auto;
}

.reply-link-btn {
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid rgba(55, 48, 143, 0.22);
  border-radius: 999px;
  background: var(--corp-soft);
  color: var(--corp);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
}

.comment-action-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.comment-edit-btn {
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid rgba(0, 108, 174, 0.25);
  border-radius: 6px;
  background: #eef7fc;
  color: var(--blue-dark);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.comment-edit-btn:hover:not(:disabled) {
  background: #dff0fa;
}

.comment-edit-btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.comment-edit-textarea {
  min-height: 170px;
  width: 100%;
  resize: vertical;
  padding: 12px;
  border: 1px solid #b8c5d8;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  line-height: 1.4;
  outline: none;
}

.comment-edit-textarea:focus {
  border-color: var(--corp);
  box-shadow: 0 0 0 3px rgba(0, 108, 174, 0.12);
}


.reply-link-btn:hover {
  border-color: var(--corp);
  box-shadow: 0 0 0 2px var(--corp-shadow);
}

.linked-replies {
  display: grid;
  gap: 6px;
  margin-top: 7px;
  padding-left: 12px;
  border-left: 2px solid var(--line);
}

.linked-replies .reply {
  padding: 7px;
  background: color-mix(in srgb, var(--reply-bg) 86%, var(--surface));
}

.inline-media-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 9px;
}

.inline-media-grid.compact { margin-top: 6px; }

.inline-media {
  width: 104px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-strong);
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  text-align: left;
}

.thumb {
  height: 44px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 600;
  background:
    linear-gradient(135deg, rgba(0, 108, 174, 0.96), rgba(39, 68, 91, 0.96)),
    repeating-linear-gradient(45deg, transparent 0 8px, rgba(255, 255, 255, 0.18) 8px 10px);
}

.inline-media span {
  display: block;
  padding: 5px;
  font-size: 10px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-box {
  width: 100%;
  flex-shrink: 0;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  background: transparent;
}

.reply-box textarea,
dialog textarea,
.message-editor {
  display: block;
  width: 100%;
  min-height: 68px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--field);
  color: var(--text);
  outline: 0;
  overflow: auto;
}

.message-editor:focus {
  border-color: #8bbfe0;
  box-shadow: 0 0 0 3px rgba(0, 108, 174, 0.13);
}

.message-editor.drag-over {
  border-color: var(--corp);
  background: var(--corp-soft);
  box-shadow: 0 0 0 3px var(--corp-shadow);
}

.failure-selection-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0;
}

.failure-selection-group {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.failure-selection-group strong {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.failure-selection-group span {
  display: block;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .failure-selection-summary {
    grid-template-columns: 1fr;
  }
}

.file-input {
  display: none;
}

.message-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
  font-weight: 500;
}

.message-editor.large {
  min-height: 310px;
}

.reply-actions {
  justify-content: space-between;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
}

.reply-buttons {
  display: flex;
  align-items: center;
  gap: 7px;
}

.editor-media {
  width: 118px;
  display: inline-block;
  margin: 8px 7px 3px 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-strong);
  overflow: hidden;
  cursor: pointer;
  vertical-align: top;
}

.editor-media span {
  display: block;
  padding: 5px;
  font-size: 10px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-media .thumb-image {
  display: block;
  width: 100%;
  height: 72px;
  object-fit: cover;
  background: var(--surface-soft);
}

.editor-doc {
  display: inline-flex;
  max-width: 230px;
  align-items: center;
  gap: 6px;
  margin: 8px 7px 3px 0;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  vertical-align: middle;
}

.editor-doc strong {
  color: var(--blue-dark);
  font-size: 10px;
}

.editor-doc span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-list {
  display: grid;
  gap: 7px;
}

.file-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  column-gap: 7px;
  align-items: center;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  padding: 7px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.file-item span,
.file-item img {
  grid-row: span 2;
  min-height: 34px;
  width: 42px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--blue-dark);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
}

.file-item img {
  object-fit: cover;
}

.file-item strong,
.file-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-item small {
  color: var(--muted);
}

.file-item.active {
  border-color: var(--corp);
  background: var(--corp-soft);
  box-shadow: 0 0 0 3px var(--corp-shadow);
}

dialog {
  position: relative;
  border: 0;
  outline: 0;
  border-radius: 10px;
  padding: 0;
  box-shadow: var(--shadow);
}

dialog::backdrop { background: var(--modal-backdrop); }

.workspace-busy-overlay {
  position: fixed;
  inset: auto 16px 16px auto;
  max-width: min(460px, calc(100vw - 32px));
  z-index: 9000;
  display: grid;
  gap: 6px;
  background: transparent;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
}

.workspace-busy-overlay.visible {
  opacity: 1;
  pointer-events: none;
}

.workspace-busy-overlay.inside-dialog {
  position: absolute;
  inset: auto 8px 8px auto;
  max-width: calc(100% - 16px);
  z-index: 20;
  border-radius: inherit;
}

.commercial-briefing-loading,
.commercial-offer-followup-loading { z-index: 9050; }
.workspace-busy-overlay[aria-hidden="true"] { display: none; }

.workspace-busy-card {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  min-width: 220px;
  min-height: 64px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 94%, white);
  box-shadow: var(--shadow);
  color: var(--text);
}

.workspace-busy-card strong {
  font-size: 14px;
  font-weight: 760;
}

.access-session-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: grid;
  place-items: center;
  background: rgba(13, 26, 38, 0.42);
  backdrop-filter: blur(3px);
}

.access-session-overlay[hidden] {
  display: none;
}

.access-session-card {
  width: min(420px, calc(100vw - 32px));
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--text);
  text-align: center;
}

.access-session-card h2 {
  margin: 0 0 10px;
  font-size: 22px;
  letter-spacing: 0;
}

.access-session-card p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.workspace-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid color-mix(in srgb, var(--corp) 18%, var(--line));
  border-top-color: var(--corp);
  border-radius: 50%;
  animation: workspace-spin 0.8s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .workspace-spinner { animation: none; }
  .workspace-busy-overlay { transition: none; }
}

button[data-busy="1"] {
  cursor: wait;
}

@keyframes workspace-spin {
  to { transform: rotate(360deg); }
}

.failure-lookup-dialog form {
  width: min(980px, calc(100vw - 70px));
  height: min(700px, calc(100vh - 70px));
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 10px;
  padding: 14px;
  background: var(--surface);
}

.failure-lookup-dialog {
  position: relative;
}

.failure-lookup-dialog #failureLookupSearch {
  height: 32px;
  padding: 0 10px;
}

.failure-lookup-table-wrap {
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
}

.failure-lookup-table tr {
  cursor: pointer;
}

.failure-lookup-table tr.selected td {
  background: color-mix(in srgb, var(--corp) 18%, var(--surface));
  color: var(--text);
  font-weight: 750;
}

.failure-lookup-dialog .dialog-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.failure-lookup-dialog .dialog-actions .muted-note {
  margin-right: auto;
}

.ticket-dialog form {
  width: min(980px, calc(100vw - 70px));
  min-height: min(640px, calc(100vh - 70px));
  padding: 16px 18px;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto auto;
  gap: 12px;
}

.purchase-request-dialog form {
  --purchase-detail-text: color-mix(in srgb, var(--text) 86%, var(--muted));
  --purchase-detail-code: color-mix(in srgb, var(--corp) 78%, var(--text));
  --purchase-detail-muted: color-mix(in srgb, var(--muted) 90%, var(--text));
  --purchase-detail-band: color-mix(in srgb, #2b79c2 9%, var(--surface));
  --purchase-notes-band: color-mix(in srgb, #546a7b 9%, var(--surface));
  width: min(1360px, calc(100vw - 56px));
  height: min(840px, calc(100vh - 56px));
  display: flex;
  flex-direction: column;
  padding: 0;
  background: var(--surface);
  overflow: hidden;
}

.workspace-breadcrumb {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  margin-bottom: 8px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.workspace-context-bar {
  display: flex;
  min-width: 0;
  min-height: 40px;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: var(--workspace-radius);
  background: var(--surface-soft);
}

.workspace-context-route {
  flex: 1 1 auto;
  min-height: 30px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.workspace-context-status {
  min-width: 0;
  flex: 1 1 auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 620;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-context-actions {
  flex: 0 0 auto;
  min-height: 30px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.workspace-context-actions label {
  grid-template-columns: auto minmax(130px, 230px);
  align-items: center;
  gap: 7px;
}

.workspace-breadcrumb ol {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.workspace-breadcrumb li {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.workspace-breadcrumb li + li::before {
  content: "/";
  margin-right: 4px;
  color: color-mix(in srgb, var(--muted) 55%, transparent);
}

.workspace-breadcrumb li[aria-current="page"] {
  color: var(--ink);
  font-weight: 750;
}

.workspace-back-btn {
  flex: 0 0 auto;
  min-height: 30px;
  border: 1px solid #c9d8e5;
  border-radius: 7px;
  padding: 0 10px;
  background: var(--surface-raised);
  color: var(--blue-dark);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.workspace-back-btn:hover,
.workspace-back-btn:focus-visible {
  border-color: var(--corp);
  outline: 0;
  box-shadow: 0 0 0 3px var(--corp-shadow);
}

.workspace-level-panel {
  min-width: 0;
}

.operations-detail-surface {
  display: grid;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface);
  box-shadow: 0 8px 22px rgba(28, 45, 61, 0.08);
}

.operations-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.operations-detail-head h2 {
  margin: 1px 0 3px;
  font-size: 16px;
}

.operations-detail-body {
  display: grid;
  gap: 12px;
  min-width: 0;
}

#operationsRecordRows tr {
  cursor: pointer;
}

#operationsRecordRows .operation-level-day-row {
  background: color-mix(in srgb, var(--corp) 14%, var(--surface));
}

#operationsRecordRows .operation-level-day-row td:first-child {
  border-left: 5px solid var(--corp);
}

#operationsRecordRows .operation-level-delegation-row {
  background: color-mix(in srgb, var(--blue) 8%, var(--surface));
}

#operationsRecordRows .operation-level-delegation-row td:first-child {
  border-left: 5px solid color-mix(in srgb, var(--corp) 55%, var(--blue));
}

#operationsRecordRows .operation-level-section-row {
  background: color-mix(in srgb, var(--green) 6%, var(--surface));
}

#operationsRecordRows .operation-level-section-row td:first-child {
  border-left: 5px solid color-mix(in srgb, var(--green) 70%, var(--surface));
}

#operationsActions {
  align-items: center;
}

#operationsActions label,
.operation-delegation-toolbar label {
  display: grid;
  gap: 4px;
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

#operationsRecordsPanel {
  gap: 0;
  padding: 0;
  overflow: hidden;
  box-shadow: none;
}

#operationsRecordsPanel > .security-permissions-head {
  min-height: 38px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
}

#operationsRecordsPanel > .security-table-wrap {
  border: 0;
  border-radius: 0;
}

.operation-delegation-toolbar,
.operation-section-toolbar {
  margin-bottom: 12px;
}

.operation-section-toolbar {
  align-items: center;
}

.operation-tree-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.selected-mini-btn {
  border-color: var(--corp);
  background: color-mix(in srgb, var(--corp) 12%, var(--surface));
  color: var(--corp);
}

.operation-demand-card {
  border: 1px solid color-mix(in srgb, var(--corp) 28%, var(--border));
  border-radius: 8px;
  padding: 0 10px 10px;
  display: grid;
  gap: 8px;
  background: color-mix(in srgb, var(--corp) 3%, var(--surface));
}

.operation-demand-card.is-accessory {
  border-left: 4px solid #5c6bc0;
  background: color-mix(in srgb, #5c6bc0 4%, var(--surface));
}

.operation-demand-head {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 12px;
  align-items: center;
  margin: 0 -10px;
  padding: 10px 14px;
  border-radius: 8px 8px 0 0;
  border-bottom: 1px solid color-mix(in srgb, var(--corp) 22%, var(--border));
  background: color-mix(in srgb, var(--corp) 12%, var(--surface));
}

.operation-demand-card.is-accessory .operation-demand-head {
  grid-template-columns: auto auto minmax(0, 1fr) auto auto;
  background: color-mix(in srgb, #5c6bc0 10%, var(--surface));
}

.operation-demand-head span {
  display: grid;
  gap: 2px;
  color: var(--text);
  font-weight: 700;
}

.operation-demand-head small {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.operation-revision-link {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  font-weight: 800;
  cursor: pointer;
}

.operation-revision-link.has-trace {
  color: var(--red);
}

.operation-revision-detail {
  border: 1px solid var(--blue);
  border-radius: 8px;
  padding: 10px;
  background: color-mix(in srgb, var(--blue) 5%, var(--surface));
}

.operation-revision-machines {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.operation-revision-machine {
  border: 1px solid #d8e1ee;
  border-radius: 8px;
  background: #fff;
}

.operation-revision-machine summary {
  cursor: pointer;
  display: grid;
  grid-template-columns: 120px minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
}

.operation-revision-machine summary em {
  color: var(--red);
  font-style: normal;
  font-weight: 700;
}

.operation-revision-machine-body {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px 32px;
}

.operation-purchase-card {
  display: grid;
  gap: 8px;
  border-left: 4px solid var(--corp);
  padding: 8px 10px;
  background: #f8fafc;
}

.operation-purchase-card header {
  display: grid;
  gap: 2px;
}

.operation-purchase-card header small {
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
}

.operation-purchase-card header strong {
  color: var(--corp);
  font-size: 16px;
}

.operation-purchase-card header span {
  font-weight: 700;
}

.operation-purchase-card header em,
.operation-linked-orders span {
  color: var(--muted);
  font-style: normal;
}

.operation-linked-orders {
  display: grid;
  gap: 3px;
}

.operation-supplier-panel {
  min-width: min(760px, 100%);
}

.operation-supplier-status-cell {
  width: 28px;
  text-align: center;
}

.operation-supplier-status {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #cbd5e1;
}

.operation-supplier-status.started {
  border: 1px solid color-mix(in srgb, #8cff00 74%, #ffffff);
  background: #2af05a;
  box-shadow: 0 0 0 2px #dcfce7, 0 0 9px color-mix(in srgb, #48ff00 50%, transparent);
  animation: request-started-pulse var(--pulse-speed) ease-in-out infinite;
}

.operation-supplier-status.ordered {
  border: 1px solid color-mix(in srgb, #ffae00 74%, #ffffff);
  background: #ffae00;
  box-shadow: 0 0 0 2px #fff0cf, 0 0 9px color-mix(in srgb, #ffae00 52%, transparent);
  animation: request-partial-pulse var(--pulse-speed) ease-in-out infinite;
}

.operation-supplier-order summary {
  cursor: pointer;
  color: var(--corp);
  font-weight: 700;
}

.operation-section-title {
  background: var(--corp);
  border: 1px solid var(--corp);
  border-radius: 8px;
  padding: 10px 12px;
  color: #fff;
}

.operation-section-title strong {
  color: #fff;
}

.operation-data-warning {
  display: grid;
  gap: 3px;
  margin: 8px 0;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, #d97706 58%, var(--line));
  border-left: 5px solid #d97706;
  border-radius: 8px;
  background: color-mix(in srgb, #f59e0b 14%, var(--surface));
  color: var(--text);
}

.operation-data-warning strong {
  color: color-mix(in srgb, #b45309 76%, var(--text));
}

.operation-data-warning span,
.operation-data-warning small {
  line-height: 1.35;
}

.operation-data-warning small {
  color: var(--muted);
}

.operations-detail-body .security-table-wrap {
  overflow-x: auto;
}

.operations-detail-body .security-table {
  min-width: max-content;
}

.operations-detail-body .security-table th,
.operations-detail-body .security-table td {
  white-space: nowrap;
  vertical-align: top;
}

.operations-detail-body .security-table td.operation-wide {
  white-space: normal;
  min-width: 260px;
  max-width: 520px;
  overflow-wrap: anywhere;
}

.operations-detail-body .security-table td.operation-machine {
  white-space: normal;
  min-width: 280px;
  max-width: 420px;
  line-height: 1.25;
}

.operations-detail-body .security-table td.operation-party {
  white-space: normal;
  min-width: 300px;
  max-width: 420px;
}

.operation-stack,
.operation-date-stack {
  display: grid;
  gap: 2px;
}

.operation-stack strong,
.operation-date-stack strong {
  font-weight: 600;
  color: var(--text);
}

.operation-stack small,
.operation-date-stack small {
  display: block;
  color: var(--muted);
  font-size: inherit;
  line-height: inherit;
}

.operation-demand-description {
  min-width: 280px;
}

.operations-detail-body .security-table td.operation-action-cell {
  position: sticky;
  right: 0;
  z-index: 2;
  background: var(--surface);
  box-shadow: -8px 0 12px rgba(15, 23, 42, 0.06);
}

.operation-notes-row td {
  background: transparent;
  white-space: normal !important;
}

.operation-notes-line {
  margin-left: 28px;
  padding-left: 12px;
  max-width: min(980px, calc(100vw - 180px));
}

.purchase-request-dialog .dialog-head {
  align-items: flex-start;
  padding: 12px 16px;
  border-bottom: 1px solid color-mix(in srgb, #2b79c2 18%, var(--line));
  background: linear-gradient(
    180deg,
    color-mix(in srgb, #2b79c2 12%, var(--surface)) 0%,
    color-mix(in srgb, #2b79c2 5%, var(--surface)) 100%
  );
}

.purchase-request-dialog .dialog-head > div {
  min-width: 0;
}

.purchase-request-dialog .purchase-detail-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.purchase-request-dialog #purchaseDetailReadyAction {
  min-height: 32px;
  padding: 5px 12px;
  font-size: 12px;
}

.purchase-request-dialog .dialog-head .icon-btn {
  width: 32px;
  min-width: 32px;
  min-height: 30px;
  height: 32px;
  padding: 0;
  border-radius: 7px;
  background: var(--chip-bg);
  border-color: transparent;
  color: var(--ink);
  font-size: 13px;
  line-height: 1;
  box-shadow: none;
}

.purchase-request-dialog .dialog-head .icon-btn:hover {
  border-color: var(--corp);
  color: var(--corp);
  box-shadow: 0 0 0 2px var(--corp-shadow);
}

.purchase-request-dialog #purchaseRequestCode {
  color: var(--purchase-detail-code);
  font-weight: 600;
  font-size: 12px;
}

.purchase-request-dialog #purchaseRequestTitle {
  color: var(--purchase-detail-text);
  font-weight: 600;
  font-size: 18px;
  line-height: 1.08;
}

.purchase-request-dialog .detail-meta {
  font-size: 11.5px;
  line-height: 1.2;
}

.purchase-request-dialog .detail-meta,
.purchase-request-dialog .purchase-request-orders-section h3,
.purchase-request-dialog .purchase-request-table th,
.purchase-request-dialog .purchase-request-order-table th {
  color: var(--purchase-detail-muted);
  font-weight: 560;
}

.purchase-request-dialog .purchase-request-table td,
.purchase-request-dialog .purchase-request-order-table td {
  color: var(--purchase-detail-text);
  font-weight: 560;
}

.purchase-detail-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(560px, 1fr);
  gap: 14px;
  padding: 12px 14px 14px;
  overflow: hidden;
}

.purchase-detail-main,
.purchase-detail-history {
  min-height: 0;
  display: grid;
  gap: 10px;
  align-content: start;
}

.purchase-detail-main {
  grid-template-rows: minmax(0, 1fr) auto;
  align-content: start;
  overflow: hidden;
  padding-right: 2px;
}

.purchase-detail-history {
  position: relative;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  align-content: stretch;
  overflow: visible;
}

.purchase-detail-history.supervisor-notes-expanded {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.82fr);
  gap: 12px;
}

.purchase-supervisor-notes-toggle {
  position: absolute;
  top: 12px;
  right: -15px;
  z-index: 3;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, #d4a62a 45%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, #fff4cf 72%, var(--surface));
  color: color-mix(in srgb, #8a6f2a 78%, var(--text));
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(20, 30, 45, 0.08);
}

.purchase-supervisor-notes-toggle[hidden] {
  display: none;
}

.purchase-request-items {
  min-height: 0;
  max-height: min(620px, calc(100vh - 270px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
}

.purchase-request-orders-section {
  display: grid;
  gap: 10px;
  min-height: 0;
}

.purchase-request-orders-section h3,
.purchase-notes-section h3,
.purchase-note-compose-section h3 {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.15;
  text-transform: uppercase;
}

.purchase-request-orders {
  max-height: min(300px, calc(100vh - 560px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
}

.purchase-request-order-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.purchase-request-order-table th,
.purchase-request-order-table td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.purchase-request-order-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.purchase-request-order-table th:first-child,
.purchase-request-order-table td:first-child {
  width: 42%;
}

.purchase-request-order-table th:last-child,
.purchase-request-order-table td:last-child {
  width: 112px;
  text-align: center;
}

.purchase-request-status {
  display: inline-flex;
  justify-content: center;
  min-width: 72px;
  padding: 2px 8px;
  border: 1px solid color-mix(in srgb, var(--muted) 28%, var(--line));
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
  font-size: 11px;
  font-weight: 650;
}

.purchase-request-status.pending {
  border-color: color-mix(in srgb, var(--red) 42%, var(--line));
  color: var(--red);
  background: color-mix(in srgb, var(--red) 8%, var(--surface));
}

.purchase-request-provider-status {
  display: flex;
  align-items: center;
  justify-content: center;
}

.purchase-request-provider-status .request-started-light {
  display: block;
  width: 11px;
  height: 11px;
  min-width: 11px;
  padding: 0;
  border-radius: 50%;
}

.purchase-request-order strong {
  color: var(--corp);
  font-size: 12px;
  white-space: nowrap;
}

.purchase-request-order-table td:nth-child(2) {
  color: var(--text);
  font-weight: 540;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.15;
}

.purchase-request-order .request-started-light.partial {
  border: 1px solid color-mix(in srgb, #ffae00 74%, #ffffff);
  background: #ffae00;
  box-shadow: 0 0 0 2px #fff0cf, 0 0 9px color-mix(in srgb, #ffae00 52%, transparent);
  animation: request-partial-pulse var(--pulse-speed) ease-in-out infinite;
}

.purchase-request-order .request-started-light.received {
  border: 1px solid color-mix(in srgb, #ff3b30 76%, #ffffff);
  background: #ff3b30;
  box-shadow: 0 0 0 2px #ffe3e0, 0 0 9px color-mix(in srgb, #ff3b30 54%, transparent);
  animation: request-received-pulse var(--pulse-speed) ease-in-out infinite;
}

.purchase-request-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.purchase-request-table .purchase-col-qty {
  width: 58px;
}

.purchase-request-table .purchase-col-code {
  width: 92px;
}

.purchase-request-table .purchase-col-warehouse {
  width: 78px;
}

.purchase-request-table .purchase-col-serial {
  width: 118px;
}

.purchase-request-table th,
.purchase-request-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 11.5px;
}

.purchase-request-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 10.5px;
  text-transform: uppercase;
}

.purchase-request-table td:first-child {
  white-space: nowrap;
  font-weight: 560;
}

.purchase-request-table td:last-child {
  color: var(--muted);
  font-weight: 520;
}

.purchase-product-code {
  color: var(--corp);
  font-weight: 600;
  white-space: nowrap;
}

.purchase-product-description {
  overflow-wrap: anywhere;
  line-height: 1.18;
}

.purchase-request-dialog .purchase-request-table td:first-child,
.purchase-request-dialog .purchase-request-table td:last-child,
.purchase-request-dialog .purchase-request-order-table td:nth-child(2) {
  font-weight: 540;
}

.purchase-request-dialog .purchase-product-code,
.purchase-request-dialog .purchase-request-order strong {
  color: var(--purchase-detail-code);
  font-weight: 560;
}

.purchase-request-dialog .purchase-product-description {
  color: var(--purchase-detail-text);
  font-weight: 520;
}

.purchase-transit-badge.notes {
  background: color-mix(in srgb, var(--corp) 12%, var(--surface));
  color: color-mix(in srgb, var(--corp) 84%, var(--text));
  border: 1px solid color-mix(in srgb, var(--corp) 24%, var(--line));
}

.purchase-notes-section {
  display: grid;
  gap: 7px;
  min-width: 0;
  min-height: 0;
  padding: 9px;
  border: 1px solid color-mix(in srgb, #546a7b 22%, var(--line));
  border-radius: 8px;
  background: var(--purchase-notes-band);
}

.purchase-note-compose-section {
  display: grid;
  gap: 8px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.purchase-shared-notes-section {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.purchase-supervisor-notes-section {
  grid-template-rows: auto minmax(0, 1fr) auto;
  border-color: color-mix(in srgb, #7f5a16 28%, var(--line));
  background: color-mix(in srgb, #fff4d6 72%, var(--surface));
}

.purchase-supervisor-notes-list {
  background: color-mix(in srgb, #fffaf0 68%, var(--surface-raised));
}

.purchase-supervisor-note-item {
  border-color: color-mix(in srgb, #c28a1d 26%, var(--line));
}

.purchase-supervisor-note-item header strong {
  color: #7a4c00;
}

.purchase-notes-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 22px;
  padding: 0 2px;
}

.purchase-notes-head span,
.purchase-note-actions span {
  color: var(--muted);
  font-size: 11px;
}

.purchase-notes-list {
  min-height: 0;
  max-height: none;
  overflow: auto;
  overscroll-behavior: contain;
  display: grid;
  align-content: start;
  align-items: start;
  grid-auto-rows: max-content;
  gap: 7px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
}

.purchase-note-item {
  display: grid;
  align-self: start;
  gap: 5px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.purchase-note-item header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
}

.purchase-note-item header strong {
  color: var(--text);
}

.purchase-note-item p {
  margin: 0;
  color: var(--text);
  font-size: 11.5px;
  line-height: 1.3;
  white-space: pre-wrap;
}

.purchase-note-files,
.purchase-note-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.purchase-note-thumb,
.purchase-note-file,
.purchase-note-draft-file {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  max-width: 170px;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--text);
  text-decoration: none;
  font-size: 10.5px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-note-thumb img,
.purchase-note-draft-file img {
  width: 24px;
  height: 24px;
  object-fit: cover;
  border-radius: 5px;
}

.purchase-note-draft-file {
  cursor: pointer;
}

.purchase-note-editor {
  display: grid;
  gap: 8px;
  min-height: 0;
}

.purchase-note-text {
  min-height: 118px;
  max-height: none;
  overflow: auto;
  font-size: 11.5px;
  line-height: 1.35;
}

.purchase-note-compose-section .purchase-note-text {
  min-height: 112px;
  max-height: 160px;
}

.purchase-supervisor-note-editor .purchase-note-text {
  min-height: 112px;
  max-height: 160px;
}

.purchase-note-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.purchase-supervisor-note-editor .primary-btn {
  min-height: 30px;
  padding-inline: 14px;
}

.dialog-head,
.form-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

label {
  display: grid;
  gap: 5px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 560;
}

dialog input,
dialog select {
  height: 32px;
  padding: 0 9px;
}

.form-row label { flex: 1; }

.new-ticket-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.new-ticket-tools > div:first-child {
  display: grid;
  gap: 4px;
}

.ticket-draft-status {
  color: var(--blue-dark);
  font-size: 11px;
  font-weight: 650;
}

.ticket-draft-status.is-pending,
.ticket-draft-status.is-error {
  color: #a44a12;
}

.ticket-draft-status.is-saved {
  color: #1f7a4f;
}

.ticket-draft-discard {
  color: #a12b36;
  border-color: rgba(161, 43, 54, 0.35);
  margin-right: auto;
}

.image-dialog form {
  width: min(780px, 86vw);
  padding: 16px;
}

.floating-close { float: right; }

.image-preview {
  clear: both;
  height: 380px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 42px;
  font-weight: 600;
  background:
    linear-gradient(135deg, rgba(0, 108, 174, 0.98), rgba(30, 54, 70, 0.98)),
    repeating-linear-gradient(45deg, transparent 0 14px, rgba(255, 255, 255, 0.18) 14px 18px);
}

.image-preview.has-image {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  padding: 10px;
}

.image-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
}

@media (max-width: 980px) {
  .workspace-menu-search-shell {
    flex: 0 1 400px;
    min-width: 0;
  }

  .communications-module-summary {
    grid-template-columns: 28px minmax(0, 1fr) repeat(2, minmax(76px, auto));
    padding-right: 12px;
  }

  .communications-module-summary span:last-child {
    grid-column: 2 / -1;
  }

  .communication-schedule-general {
    position: static;
    width: fit-content;
    margin: 0 12px 8px auto;
  }
}

@media (max-width: 520px) {
  .topbar {
    gap: 8px;
    padding-inline: 8px;
  }

  .brand-trigger {
    flex: 0 0 40px;
    width: 40px;
    padding: 4px;
    justify-content: center;
  }

  .brand-trigger .brand-copy,
  .brand-trigger .brand-menu-indicator {
    display: none;
  }

  .brand-logo {
    width: 30px;
    max-width: 30px;
  }

  .workspace-menu-search-shell {
    flex-basis: auto;
  }

  .workspace-global-status {
    margin-left: 0;
  }

  .version-update-banner {
    width: 36px;
    min-width: 36px;
    padding: 0;
  }

  .version-update-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .workspace-breadcrumb {
    align-items: flex-start;
  }

  .workspace-context-bar {
    flex-wrap: wrap;
    gap: 6px;
  }

  .workspace-context-route,
  .workspace-context-status {
    flex-basis: 100%;
  }

  .workspace-context-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .workspace-context-actions label {
    flex: 1 1 auto;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .communications-module-summary {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .communications-module-summary > span:not(.communications-module-caret) {
    grid-column: 2;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 9mm;
  }

  body.ready-report-active {
    min-width: 0;
    background: #ffffff;
    color: #111827;
    font-size: 9px;
  }

  body.ready-report-active .topbar,
  body.ready-report-active .module-heading,
  body.ready-report-active .purchase-summary,
  body.ready-report-active #purchaseActions,
  body.ready-report-active #purchaseActiveFilter,
  body.ready-report-active .purchase-ready-report-toolbar,
  body.ready-report-active .workspace-version-badge,
  body.ready-report-active dialog {
    display: none !important;
  }

  body.ready-report-active .app-shell,
  body.ready-report-active main,
  body.ready-report-active #purchaseModule,
  body.ready-report-active #purchaseBoard,
  body.ready-report-active .purchase-ready-report,
  body.ready-report-active .purchase-ready-report-list {
    display: block !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    background: #ffffff !important;
  }

  body.ready-report-active .purchase-ready-print-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 7px;
    padding: 0 0 5px;
    border-bottom: 1.5px solid #37308f;
    color: #111827;
    font-size: 9px;
  }

  body.ready-report-active .purchase-ready-order.not-selected {
    display: none !important;
  }

  body.ready-report-active .purchase-ready-provider.without-selection {
    display: none !important;
  }

  body.ready-report-active .purchase-ready-provider {
    break-inside: avoid;
    margin: 0 0 7px;
    border: 0;
    border-top: 1px solid #aab5c1;
    border-radius: 0;
    background: #ffffff;
  }

  body.ready-report-active .purchase-ready-provider > header {
    padding: 5px 0 4px;
    border-bottom: 1px solid #cfd7df;
    background: #ffffff !important;
  }

  body.ready-report-active .purchase-ready-provider > header strong {
    font-size: 9.5px;
  }

  body.ready-report-active .purchase-ready-provider > header span,
  body.ready-report-active .purchase-ready-provider > header small {
    font-size: 8.5px;
  }

  body.ready-report-active .purchase-ready-provider > header strong,
  body.ready-report-active .purchase-ready-order > header strong,
  body.ready-report-active .purchase-ready-order > header div span {
    color: #111827;
  }

  body.ready-report-active .purchase-ready-provider > header span,
  body.ready-report-active .purchase-ready-provider > header small,
  body.ready-report-active .purchase-ready-order > header div small {
    color: #374151;
  }

  body.ready-report-active .purchase-ready-orders {
    display: block;
    padding: 0;
    overflow: visible;
  }

  body.ready-report-active .purchase-ready-order {
    --ready-order-pad-x: 7px;
    --ready-order-gap: 7px;
    --ready-select-col: 0;
    --ready-code-col: 82px;
    --ready-lines-offset: calc(var(--ready-order-pad-x) + var(--ready-code-col) + var(--ready-order-gap));
    break-inside: avoid;
    margin: 0 0 2px;
    border: 0;
    border-radius: 0;
    background: #ffffff !important;
  }

  body.ready-report-active .purchase-ready-order + .purchase-ready-order {
    border-top: 1px solid #dce3ea;
  }

  body.ready-report-active .purchase-ready-order > header {
    display: grid;
    grid-template-columns: var(--ready-code-col) minmax(0, 1fr);
    gap: var(--ready-order-gap);
    padding: 4px var(--ready-order-pad-x) 2px;
    border-bottom: 0;
    background: #ffffff !important;
  }

  body.ready-report-active .purchase-ready-check {
    display: none;
  }

  body.ready-report-active .purchase-ready-order > header strong {
    color: #37308f;
    font-size: 9.5px;
  }

  body.ready-report-active .purchase-ready-order > header div span {
    font-size: 9.5px;
    line-height: 1.16;
  }

  body.ready-report-active .purchase-ready-order > header div small {
    font-size: 8.5px;
    line-height: 1.14;
  }

  body.ready-report-active .purchase-ready-lines {
    width: calc(100% - var(--ready-lines-offset) - var(--ready-order-pad-x));
    margin-left: var(--ready-lines-offset);
    border-collapse: collapse;
    table-layout: fixed;
  }

  body.ready-report-active .purchase-ready-lines thead {
    display: table-header-group;
  }

  body.ready-report-active .purchase-ready-lines th,
  body.ready-report-active .purchase-ready-lines td {
    padding: 2px 5px;
    border: 0;
    border-bottom: 1px solid #e5ebf1;
    color: #111827;
    font-size: 8.8px;
    line-height: 1.13;
    vertical-align: top;
  }

  body.ready-report-active .purchase-ready-lines th {
    border-top: 1px solid #d8e0e8;
    border-bottom: 1px solid #d8e0e8;
    background: #ffffff !important;
    text-align: left;
  }

  body.ready-report-active .purchase-ready-lines th:first-child,
  body.ready-report-active .purchase-ready-lines td:first-child {
    width: 38px;
    white-space: nowrap;
  }
}

.manuals-module {
  min-height: 0;
}

.manuals-shell {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: 14px;
  min-height: calc(100vh - 178px);
}

.manuals-index,
.manual-viewer {
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.manuals-index {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
}

.manuals-index h2,
.manual-header h2 {
  margin: 4px 0 6px;
  color: #1f2937;
  font-size: 22px;
  letter-spacing: 0;
}

.manuals-index p,
.manual-header p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.4;
}

.manual-list {
  display: grid;
  gap: 8px;
}

.manual-list-item {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 10px 11px;
  border: 1px solid #dce4ee;
  border-left: 4px solid #cbd5e1;
  border-radius: 7px;
  background: #f8fafc;
  color: #1f2937;
  text-align: left;
  cursor: pointer;
}

.manual-list-item.active {
  border-left-color: #37308f;
  background: #f3f2ff;
}

.manual-list-item strong {
  font-size: 13px;
}

.manual-list-item span,
.manual-security-note span {
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
}

.manual-security-note,
.manual-policy {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid #dbeafe;
  border-radius: 7px;
  background: #eff6ff;
  color: #1e3a8a;
}

.manual-security-note strong,
.manual-policy strong {
  font-size: 12px;
}

.manual-viewer {
  overflow: auto;
  padding: 22px 28px 32px;
  user-select: none;
}

.manual-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e2e8f0;
}

.manual-date {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
}

.manual-policy {
  margin: 14px 0 18px;
}

.manual-policy span {
  color: #1e40af;
  font-size: 12px;
}

.manual-section {
  padding: 14px 0;
  border-bottom: 1px solid #edf2f7;
}

.manual-section h3 {
  margin: 0 0 8px;
  color: #37308f;
  font-size: 16px;
}

.manual-section p,
.manual-section li {
  color: #334155;
  font-size: 13px;
  line-height: 1.55;
}

.manual-section ol,
.manual-section ul {
  margin: 8px 0 0 21px;
  padding: 0;
}

.manual-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.manual-grid div {
  display: grid;
  gap: 4px;
  padding: 11px;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  background: #f8fafc;
}

.manual-grid span {
  color: #64748b;
  font-size: 12px;
  line-height: 1.4;
}

.manual-figure {
  display: grid;
  gap: 8px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid #e0e7ff;
  border-radius: 8px;
  background: #f8fafc;
}

.manual-figure small {
  color: #64748b;
  font-size: 11px;
}

.manual-screen {
  overflow: hidden;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  background: #ffffff;
}

.manual-screen-bar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
}

.manual-screen-bar span {
  color: #64748b;
}

.manual-ui-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.manual-ui-summary span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  border-left: 4px solid #37308f;
  border-radius: 7px;
  background: #ffffff;
  color: #334155;
  font-size: 12px;
}

.manual-ui-summary-color {
  padding: 12px;
}

.phase-request { --phase: #4b5563; --phase-bg: #f1f5f9; }
.phase-prep { --phase: #8b5e34; --phase-bg: #fff7ed; }
.phase-approve { --phase: #f97316; --phase-bg: #ffedd5; }
.phase-send { --phase: #4f46e5; --phase-bg: #eef2ff; }
.phase-payment { --phase: #7a4f2a; --phase-bg: #f7eadb; }
.phase-receive { --phase: #0891b2; --phase-bg: #ecfeff; }
.phase-withdraw { --phase: #7c3aed; --phase-bg: #f3e8ff; }
.phase-ready { --phase: #16a34a; --phase-bg: #dcfce7; }
.phase-rented { --phase: #be185d; --phase-bg: #fce7f3; }

.manual-ui-summary-color span,
.manual-phase-map div {
  border-left-color: var(--phase);
  background: var(--phase-bg);
}

.manual-phase-map {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 10px;
}

.manual-phase-map div {
  display: grid;
  gap: 4px;
  padding: 10px 11px;
  border: 1px solid #e2e8f0;
  border-left: 5px solid var(--phase);
  border-radius: 7px;
}

.manual-phase-map strong {
  color: #1f2937;
  font-size: 13px;
}

.manual-phase-map span {
  color: #475569;
  font-size: 12px;
  line-height: 1.35;
}

.manual-ui-board {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 9px;
}

.manual-ui-side,
.manual-ui-timeline span,
.manual-provider-demo,
.manual-ready-demo {
  border: 1px solid #dbe3ee;
  border-radius: 7px;
  background: #ffffff;
}

.manual-ui-side {
  padding: 24px 10px;
  color: #475569;
  font-size: 12px;
  text-align: center;
}

.manual-ui-timeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.manual-ui-timeline span {
  min-height: 68px;
  padding: 8px;
  color: #475569;
  font-size: 12px;
}

.manual-timeline-shot {
  display: grid;
  grid-template-columns: 185px minmax(0, 1fr);
  gap: 10px;
}

.manual-timeline-shot aside,
.manual-timeline-shot section {
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  background: #ffffff;
}

.manual-timeline-shot aside {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 10px;
}

.manual-timeline-shot aside strong {
  color: #334155;
  font-size: 12px;
}

.manual-request-card {
  display: block;
  padding: 8px;
  border-left: 4px solid #64748b;
  border-radius: 6px;
  background: #f8fafc;
  color: #334155;
  font-size: 11px;
}

.manual-request-card.partial {
  border-left-color: #f59e0b;
  background: #fffbeb;
}

.manual-request-card.done-alert {
  border-left-color: #ef4444;
  background: #fef2f2;
}

.manual-timeline-shot section {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
}

.manual-time-column {
  min-height: 112px;
  padding: 8px;
  border-radius: 7px;
  background: #f8fafc;
}

.manual-time-column strong {
  display: block;
  margin-bottom: 8px;
  color: #334155;
  font-size: 12px;
}

.manual-time-column article {
  display: grid;
  gap: 4px;
  padding: 8px;
  border-radius: 7px;
  color: #ffffff;
  font-size: 11px;
}

.manual-time-column article small {
  color: rgba(255, 255, 255, 0.88);
  font-size: 10px;
}

.manual-time-column.overdue article { background: #ef4444; }
.manual-time-column.today article { background: #0891b2; }
.manual-time-column.soon article { background: #16a34a; }
.manual-time-column.nodate article { background: #64748b; }

.manual-callout {
  margin-top: 10px;
  padding: 10px 12px;
  border-left: 4px solid #37308f;
  border-radius: 7px;
  background: #f3f2ff;
  color: #312e81;
  font-size: 12px;
  line-height: 1.45;
}

.manual-provider-demo,
.manual-ready-demo {
  display: grid;
  gap: 8px;
  padding: 11px;
}

.manual-provider-demo header,
.manual-ready-demo header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #1f2937;
  font-size: 12px;
}

.manual-provider-demo header span,
.manual-ready-demo header span,
.manual-ready-demo p {
  color: #64748b;
}

.manual-provider-demo button,
.manual-ready-demo button {
  margin-right: 6px;
  padding: 5px 8px;
  border: 1px solid #d8dce8;
  border-radius: 6px;
  background: #f8fafc;
  color: #334155;
  font-size: 11px;
}

.manual-provider-demo article {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 9px;
  border-radius: 6px;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
}

.manual-provider-rich header {
  align-items: flex-start;
}

.manual-provider-rich header div:first-child {
  display: grid;
  gap: 3px;
}

.manual-provider-rich article {
  align-items: center;
}

.manual-provider-rich table,
.manual-ready-report-shot table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 7px;
  flex-basis: 100%;
}

.manual-provider-rich td,
.manual-ready-report-shot td {
  padding: 5px 6px;
  border-bottom: 1px solid #e5ebf1;
  color: #334155;
  font-size: 11px;
}

.chip-withdraw {
  padding: 3px 6px;
  border-radius: 999px;
  background: #f3e8ff;
  color: #6d28d9;
}

.manual-notes-shot {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.manual-notes-shot div {
  display: grid;
  gap: 5px;
  padding: 11px;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  background: #ffffff;
}

.manual-notes-shot strong {
  color: #1f2937;
  font-size: 12px;
}

.manual-notes-shot span,
.manual-notes-shot p {
  margin: 0;
  color: #64748b;
  font-size: 11px;
  line-height: 1.4;
}

.manual-ready-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.manual-ready-flow div {
  display: grid;
  gap: 8px;
  justify-items: center;
  min-height: 96px;
  padding: 12px 10px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: #f0fdf4;
  color: #166534;
  text-align: center;
}

.manual-ready-flow strong {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #16a34a;
  color: #ffffff;
}

.manual-ready-flow span {
  font-size: 12px;
  line-height: 1.35;
}

.manual-ready-report-shot table td:first-child {
  width: 28px;
  color: #16a34a;
  font-weight: 700;
}

.manual-empty {
  display: grid;
  gap: 6px;
  margin: 40px auto;
  max-width: 420px;
  padding: 20px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  text-align: center;
}

.operation-notes {
  display: grid;
  gap: 6px;
  min-width: 220px;
  max-width: min(980px, calc(100vw - 180px));
}

.operation-note {
  display: grid;
  gap: 2px;
  padding: 6px 8px;
  max-width: min(980px, calc(100vw - 180px));
  overflow-wrap: anywhere;
  border: 1px solid #f0e5ad;
  border-radius: 6px;
  background: #fffdf0;
}

.operation-note strong {
  color: #1f2937;
  font-size: 11px;
}

.operation-note span {
  color: #64748b;
  font-size: 11px;
}

.operation-note p {
  margin: 0;
  color: #111827;
  font-size: 12px;
  line-height: 1.35;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.operation-note-pin {
  justify-self: start;
  margin-top: 4px;
  border: 1px solid #d7c16b;
  border-radius: 6px;
  background: #fff8d7;
  color: #5f4a0c;
  padding: 3px 8px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.operation-note-pin:hover {
  background: #fff2b5;
}

.operation-note-pin.is-pinned {
  border-color: #2f7d52;
  background: #dff4e8;
  color: #14532d;
  font-weight: 700;
}

.operation-note-pin.is-pinned:hover {
  background: #c7ecd8;
}

.operation-note-report {
  justify-self: start;
  margin-top: 4px;
  border: 1px solid #94a3b8;
  border-radius: 6px;
  background: #f8fafc;
  color: #475569;
  padding: 3px 8px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.operation-note-report:hover {
  background: #eef2ff;
}

.operation-note-report.is-included {
  border-color: #382f8c;
  background: #ecebff;
  color: #2e2675;
  font-weight: 700;
}

.operation-note-rich {
  display: grid;
  gap: 8px;
  max-width: 100%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.operation-note-rich p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.operation-note-rich img {
  max-width: min(520px, 100%);
  border: 1px solid #cbd5e1;
  border-radius: 6px;
}

.operation-note-dialog-layer {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.45);
}

.operation-note-dialog {
  width: min(720px, 96vw);
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid #d7dfec;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
}

.operation-note-dialog h3 {
  margin: 0;
  font-size: 18px;
  color: var(--text);
}

.operation-note-editor {
  min-height: 180px;
  max-height: 420px;
  overflow: auto;
  padding: 12px;
  border: 1px solid #b8c5d8;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  line-height: 1.4;
  outline: none;
}

.operation-note-editor:focus {
  border-color: var(--corp);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--corp) 16%, transparent);
}

.operation-note-editor img {
  display: block;
  max-width: 100%;
  margin: 8px 0;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
}

.security-table tr.selected-row td {
  background: #eef2ff;
  box-shadow: inset 3px 0 0 #312783;
}

@media (max-width: 900px) {
  .manuals-shell {
    grid-template-columns: 1fr;
  }

  .manual-grid,
  .manual-ui-board,
  .manual-ui-timeline,
  .manual-phase-map,
  .manual-timeline-shot,
  .manual-timeline-shot section,
  .manual-notes-shot,
  .manual-ready-flow {
    grid-template-columns: 1fr;
  }

  .manual-header {
    flex-direction: column;
  }
}

@media print {
  body.manuals-active * {
    visibility: hidden !important;
  }

  body.manuals-active::before {
    content: "Contenido interno no imprimible desde GO Rentals Workspace.";
    visibility: visible !important;
    display: block;
    margin: 72px;
    color: #111827;
    font: 14pt Arial, sans-serif;
  }
}
.cxc-module { display: grid; gap: 14px; min-width: 0; }
.cxc-toolbar { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.cxc-toolbar input { min-width: 320px; flex: 1; }
.cxc-metrics { display: grid; grid-template-columns: repeat(5, minmax(145px, 1fr)); gap: 8px; }
.cxc-metrics article { background: #fff; border: 1px solid #dfe2e8; border-radius: 8px; padding: 9px 11px; display: grid; gap: 3px; }
.cxc-metrics span { color: #5f6572; font-size: 12px; }
.cxc-metrics strong { font-size: 20px; }
.cxc-metric-issue { border-color: #ef9a9a !important; animation: cxcPulseIssue 1.8s ease-in-out infinite; }
.cxc-metric-forecast { border-color: #86d39b !important; animation: cxcPulseForecast 1.8s ease-in-out infinite; }
.cxc-metric-quarantine { border-color: #e1ad32 !important; background: #fff8df !important; }
.cxc-metric-quarantine-active { animation: cxcPulseQuarantine 1.8s ease-in-out infinite; }
@keyframes cxcPulseIssue { 0%,100% { background:#fff; box-shadow: 0 0 0 0 rgba(205,34,48,0); } 50% { background:#ffe2e5; box-shadow: 0 0 0 5px rgba(205,34,48,.2); } }
@keyframes cxcPulseForecast { 0%,100% { background:#fff; box-shadow: 0 0 0 0 rgba(28,145,70,0); } 50% { background:#dff5e5; box-shadow: 0 0 0 5px rgba(28,145,70,.2); } }
@keyframes cxcPulseQuarantine { 0%,100% { background:#fff8df; box-shadow:0 0 0 0 rgba(225,173,50,0); } 50% { background:#ffe49a; box-shadow:0 0 0 5px rgba(225,173,50,.24); } }
@media (prefers-reduced-motion: reduce) { .cxc-metric-pulse,.cxc-metric-quarantine-active,.cxc-client-metric-quarantine-active,.cxc-client-metric-promise-active,.cxc-portfolio-table td.cxc-quarantine-cell { animation: none !important; } }
.cxc-table-wrap { max-width: 100%; overflow-x: auto; border: 1px solid #dfe2e8; border-radius: 8px; background: #fff; }
.cxc-table { border-collapse: separate; border-spacing: 0; min-width: 2680px; width: 100%; font-size: 12px; }
.cxc-table th, .cxc-table td { border-right: 1px solid #e6e8ed; border-bottom: 1px solid #e6e8ed; padding: 6px 8px; white-space: nowrap; text-align: right; }
.cxc-table th { position: sticky; top: 0; z-index: 3; background: #f0f1f5; color: #292d38; }
.cxc-portfolio-table th, .cxc-aging-table th[data-cxc-aging-column] { cursor: grab; user-select: none; }
.cxc-portfolio-table { table-layout: auto; }
.cxc-portfolio-table th, .cxc-portfolio-table td { position: relative; white-space: normal; overflow-wrap: anywhere; word-break: normal; vertical-align: top; }
.cxc-portfolio-table [data-cxc-col="third_party_code"], .cxc-portfolio-table [data-cxc-col="legal_name"] { text-align: left; }
.cxc-portfolio-table th { padding-right: 14px; }
.cxc-head-label { display: block; }
.cxc-floating-header { position: fixed; z-index: 690; overflow: hidden; border: 1px solid #dfe2e8; border-bottom: 0; background: #f0f1f5; box-shadow: 0 3px 8px rgba(17,24,39,.14); pointer-events: none; }
.cxc-floating-header .cxc-table { margin: 0; }
.cxc-floating-header .cxc-table th { position: static; }
.cxc-column-resizer { position: absolute; top: 0; right: -6px; bottom: 0; width: 13px; z-index: 6; cursor: ew-resize; }
.cxc-column-resizer::after { content: ""; position: absolute; top: 15%; bottom: 15%; left: 4px; width: 1px; background: #aeb5c2; }
.cxc-column-resizer:hover::after { width: 3px; background: #352e84; box-shadow: 0 0 0 2px rgba(53,46,132,.14); }
.cxc-column-resizing, .cxc-column-resizing * { cursor: ew-resize !important; user-select: none !important; }
.cxc-portfolio-table th.cxc-drop-before::before, .cxc-portfolio-table th.cxc-drop-after::after, .cxc-aging-table th.cxc-drop-before::before, .cxc-aging-table th.cxc-drop-after::after { content: ""; position: absolute; top: 0; bottom: 0; width: 4px; z-index: 8; background: #d4002a; box-shadow: 0 0 0 2px rgba(212,0,42,.18); pointer-events: none; }
.cxc-portfolio-table th.cxc-drop-before::before, .cxc-aging-table th.cxc-drop-before::before { left: -2px; }
.cxc-portfolio-table th.cxc-drop-after::after, .cxc-aging-table th.cxc-drop-after::after { right: -2px; }
.cxc-portfolio-table th:active, .cxc-aging-table th[data-cxc-aging-column]:active { cursor: grabbing; }
.cxc-portfolio-table th:hover, .cxc-aging-table th[data-cxc-aging-column]:hover { background: #e2e6ee; }
.cxc-sort-mark { margin-left: 6px; color: var(--corp, #d4002a); font-size: 10px; }
.cxc-portfolio-table td.cxc-issue-cell { color:#8e1320; animation:cxcPulseIssueCell 1.8s ease-in-out infinite; }
@keyframes cxcPulseIssueCell { 0%,100% { background:#fff0f1; } 50% { background:#f6a8af; } }
.cxc-portfolio-table td.cxc-quarantine-cell { color:#765000; animation:cxcPulseQuarantineCell 1.8s ease-in-out infinite; }
@keyframes cxcPulseQuarantineCell { 0%,100% { background:#fff8df; } 50% { background:#f7cf62; } }
@media (prefers-reduced-motion: reduce) { .cxc-portfolio-table td.cxc-issue-cell { animation:none; background:#ffd9dd; } }
.cxc-portfolio-table td.cxc-text-issue-cell { text-align: left; }
.cxc-portfolio-table .cxc-portfolio-total-row th { position: static; border-top: 2px solid #352e84; border-bottom: 0; background: #e8e7f2; color: #202435; font-weight: 800; text-align: right; vertical-align: middle; }
.cxc-portfolio-table .cxc-portfolio-total-row .cxc-portfolio-total-label { color: #352e84; text-align: left; text-transform: uppercase; letter-spacing: .03em; }
.cxc-zero-issue { display: block; width: 100%; color: #9a5b00; font-weight: 700; text-align: left; }
.cxc-zero-issue small { display: block; padding: 0; border-radius: 0; background: transparent; color: #7a4800; font-size: 10px; font-weight: 700; text-align: left; }
.cxc-table td:nth-child(1), .cxc-table td:nth-child(2), .cxc-table th:nth-child(1), .cxc-table th:nth-child(2) { text-align: left; }
.cxc-table tbody tr:hover td { background: #f7f6ff; }
.cxc-table .cxc-sticky { position: sticky; left: 0; z-index: 2; background: #fff; min-width: 82px; width: 82px; }
.cxc-table .cxc-sticky-name { position: sticky; left: 99px; z-index: 2; background: #fff; min-width: 300px; max-width: 360px; overflow: hidden; text-overflow: ellipsis; }
.cxc-table th.cxc-sticky, .cxc-table th.cxc-sticky-name { z-index: 4; background: #f0f1f5; }
.cxc-client-link { display: block; width: 100%; border: 0; background: none; color: #352e84; font: inherit; font-weight: 700; cursor: pointer; padding: 0; text-align: left; }
.cxc-client { display: grid; gap: 8px; }
.cxc-client-head { display: flex; align-items: end; justify-content: space-between; background: #352e84; color: #fff; border-radius: 8px; padding: 9px 14px; }
.cxc-client-head h2 { margin: 2px 0 0; font-size:18px; line-height:1.15; }
.cxc-client-head span { font-size:11px; }
.cxc-client-head > strong { font-size: 26px; }
.cxc-client-head-workspace { align-items: center; }
.cxc-client-head-actions { display: flex; align-items: center; gap: 14px; }
.cxc-client-head-actions > strong { font-size: 21px; white-space: nowrap; }
.cxc-client-metrics { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cxc-client-metrics article { min-width: 0; padding: 7px 8px; }
.cxc-client-metrics span,.cxc-client-metrics small { font-size:10px; }
.cxc-client-metrics strong { font-size: clamp(14px, 1.25vw, 18px); white-space: nowrap; }
.cxc-client-metrics small { line-height: 1.2; }
.cxc-client-metric-debt { border-color: #dfb13b !important; background: #fff3c9 !important; }
.cxc-client-metric-debt span, .cxc-client-metric-debt strong { color: #795400; }
.cxc-client-metric-clear { border-color: #dfe2e8 !important; background: #fff !important; }
.cxc-client-metric-clear span { color:#5f6572; }
.cxc-client-metric-clear strong { color:#202435; }
.cxc-client-metric-quarantine { border-color: #e1ad32 !important; background: #fff4c7 !important; }
.cxc-client-metric-quarantine-active { animation:cxcPulseQuarantine 1.8s ease-in-out infinite; }
.cxc-client-metric-quarantine span, .cxc-client-metric-quarantine strong { color: #765000; }
.cxc-client-metric-promise { border-color:#86d39b !important; background:#edf9f1 !important; }
.cxc-client-metric-promise span,.cxc-client-metric-promise strong { color:#176b35; }
.cxc-client-metric-promise-active { animation:cxcPulseForecast 1.8s ease-in-out infinite; }
.cxc-aging-table tbody tr[data-cxc-invoice-row] { cursor:pointer; }
.cxc-aging-table tbody tr.is-selected td { background:#e8e7f7 !important; box-shadow:inset 0 1px #756fc1,inset 0 -1px #756fc1; }
.cxc-quarantine-invoices .is-released { opacity:.62; text-decoration:line-through; background:#eef1f5; }
.cxc-quick-action-panel { position:fixed; z-index:1200; top:96px; right:34px; width:min(680px,calc(100vw - 40px)); max-height:calc(100vh - 120px); overflow:auto; display:grid; gap:12px; padding:14px; border:2px solid #352e84; border-radius:12px; background:#fff; box-shadow:0 18px 55px rgba(18,24,38,.35); }
.cxc-quick-action-panel.is-reviewing { top:18px; right:18px; width:min(1180px,calc(100vw - 36px)); max-height:calc(100vh - 36px); }
.cxc-quick-action-panel > header { display:flex; align-items:center; justify-content:space-between; margin:-14px -14px 0; padding:10px 14px; color:#fff; background:#352e84; cursor:move; user-select:none; }
.cxc-quick-action-panel > header > div { display:grid; gap:2px; }
.cxc-quick-header-actions { display:flex !important; grid-auto-flow:column; gap:6px !important; }
.cxc-quick-action-panel > header small { color:#e8e7ff; }
.cxc-quick-action-panel.is-collapsed { width:min(390px,calc(100vw - 40px)); overflow:hidden; padding-bottom:0; }
.cxc-quick-action-panel.is-collapsed > :not(header) { display:none !important; }
.cxc-quick-action-panel.is-collapsed [data-cxc-quick-collapse] { transform:rotate(180deg); }
.cxc-quick-editor { position:relative; }
.cxc-quick-action-panel textarea { width:100%; min-height:210px; resize:vertical; font-family:ui-monospace,SFMono-Regular,Menlo,monospace; line-height:1.45; }
.cxc-code-assist { position:absolute; z-index:8; left:8px; right:8px; top:calc(100% + 5px); display:grid; max-height:220px; overflow:auto; border:1px solid #aaa6da; border-radius:8px; background:#fff; box-shadow:0 10px 25px rgba(18,24,38,.2); }
.cxc-code-assist.is-above { top:auto; bottom:calc(100% + 5px); }
.cxc-code-assist[hidden] { display:none; }
.cxc-code-assist button { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:9px; padding:7px 9px; border:0; border-bottom:1px solid #ecebf6; background:#fff; text-align:left; cursor:pointer; }
.cxc-code-assist button:hover { background:#f2f0ff; }
.cxc-code-assist code { color:#352e84; font-weight:800; }
.cxc-code-assist small,.cxc-code-assist .cxc-assist-ghost { color:var(--muted); }
.cxc-quick-line-validation { min-height:18px; padding:4px 2px 0; color:#667085; font-size:11px; }
.cxc-quick-line-validation.is-error { color:#a40f22; font-weight:700; }
.cxc-quick-line-validation.is-warning { color:#8a5700; font-weight:700; }
.cxc-quick-line-validation.is-valid { color:#176b35; }
.cxc-quick-action-panel details { margin-top:8px; border:1px solid #d8dbe4; border-radius:7px; padding:7px 9px; }
.cxc-quick-help { padding-top:7px; color:#4b5563; font-size:12px; line-height:1.55; }
.cxc-quick-help code { color:#352e84; font-weight:800; }
.cxc-quick-meta { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; border-top:1px solid #dfe2e8; padding-top:10px; }
.cxc-quick-meta label { display:grid; gap:4px; font-weight:700; }
.cxc-quick-action-panel footer { display:flex; justify-content:flex-end; gap:8px; }
.cxc-quick-review-lines { display:grid; gap:8px; }
.cxc-quick-review-lines article { display:grid; gap:4px; padding:9px; border-left:4px solid #352e84; background:#f5f4fb; }
.cxc-quick-review-lines span { color:#5b6472; font-size:12px; }
.cxc-quick-review-lines p,.cxc-quick-general { white-space:pre-wrap; }
.cxc-quick-warning { padding:9px; border:1px solid #d9233f; border-radius:7px; color:#9e1026; background:#fff0f2; font-weight:700; }
.cxc-quick-dashboard { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.cxc-dashboard-card { overflow:hidden; border:1px solid #dfe2e8; border-radius:9px; background:#fff; }
.cxc-dashboard-card > header { display:flex; align-items:center; gap:7px; padding:8px 10px; background:#eef0f5; }
.cxc-dashboard-card > header span { padding:2px 6px; border-radius:5px; background:#fff; font-family:ui-monospace,monospace; font-weight:800; }
.cxc-dashboard-entry { display:grid; gap:5px; padding:9px 10px; }
.cxc-dashboard-entry + .cxc-dashboard-entry { border-top:1px solid #e7e9ee; }
.cxc-dashboard-entry p { margin:0; white-space:pre-wrap; }
.cxc-dashboard-entry small { color:var(--muted); }
.cxc-dashboard-total { color:#293242; font-size:12px; }
.cxc-dashboard-invoices { display:flex; flex-wrap:wrap; gap:4px; }
.cxc-dashboard-invoices span { padding:3px 6px; border-radius:999px; background:#fff; border:1px solid #dfe2e8; font-size:11px; }
.cxc-dashboard-quarantine { border-color:#e1ad32; background:#fff; }
.cxc-dashboard-quarantine > header { background:#fff4c7; }
.cxc-dashboard-promise { border-color:#59aa75; background:#fff; }
.cxc-dashboard-promise > header { background:#edf9f1; }
.cxc-dashboard-delegation { border-color:#7168be; background:#fff; }
.cxc-dashboard-delegation > header { background:#f4f2ff; }
.cxc-dashboard-release { background:#fff; }
.cxc-published-preview { margin-top:12px; padding:10px; border:1px solid #dfe2e8; border-radius:8px; background:#fff; }
.cxc-published-preview p { margin:6px 0 0; white-space:pre-wrap; }
.cxc-management-dashboard-dialog { width:min(900px,calc(100vw - 32px)); max-height:calc(100vh - 40px); border:0; border-radius:12px; padding:0; box-shadow:0 18px 55px rgba(18,24,38,.35); }
.cxc-management-dashboard-dialog > section { display:grid; gap:14px; padding:16px; }
.cxc-management-dashboard-dialog > section > header { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.cxc-management-dashboard-dialog h2,.cxc-management-dashboard-dialog p { margin:0; }
@media (max-width:760px) { .cxc-quick-action-panel { top:72px; right:10px; width:calc(100vw - 20px); } .cxc-quick-meta { grid-template-columns:1fr; } }
.cxc-client-metric-overdue, .cxc-client-metric-issue { border-color: #c91f32 !important; }
.cxc-client-metric-overdue, .cxc-client-metric-issue-active { animation: cxcClientMetricDanger 1.55s ease-in-out infinite; }
.cxc-client-metric-overdue span, .cxc-client-metric-overdue strong, .cxc-client-metric-issue span, .cxc-client-metric-issue strong { color: #a40f22; }
@keyframes cxcClientMetricDanger { 0%,100% { background:#fff0f1; box-shadow:0 0 0 0 rgba(201,31,50,0); } 50% { background:#f6a8af; box-shadow:0 0 0 4px rgba(201,31,50,.2); } }
@media (prefers-reduced-motion: reduce) { .cxc-client-metric-overdue, .cxc-client-metric-issue-active { animation:none; background:#ffd9dd; } }
.cxc-aging-detail { min-width: 0; }
.cxc-aging-detail { padding:9px 11px; }
.cxc-aging-detail .cxc-panel-title { display: grid; grid-template-columns: auto minmax(0,1fr) auto; justify-content: initial; margin-bottom: 6px; }
.cxc-aging-detail .cxc-panel-title h3 { font-size:15px; margin-bottom:2px; }
.cxc-aging-detail .cxc-panel-title p { color: var(--muted); font-size: 12px; }
.cxc-aging-detail .module-collapse-toggle { margin: 0; }
.cxc-aging-heading { min-width: 0; }
.cxc-aging-count { color: var(--muted); font-size: 12px; white-space: nowrap; }
.cxc-aging-tools { display: flex; align-items: center; gap: 10px; }
.cxc-aging-tools .primary-btn { white-space: nowrap; }
.cxc-selection-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 0 10px; padding: 9px 10px; border: 1px solid #dfe2e8; border-radius: 8px; background: #f7f6ff; }
.cxc-selection-actions > span { color: #51439a; font-size: 12px; font-weight: 700; }
.cxc-selection-actions > div { display: flex; flex-wrap: wrap; gap: 8px; }
.cxc-aging-table .cxc-aging-select { box-sizing: border-box; width: 52px; min-width: 52px; max-width: 52px; padding: 7px 8px; text-align: center; }
.cxc-aging-table .cxc-aging-select input { width: 16px; height: 16px; margin: 0; }
.cxc-aging-collapsed-summary { display: grid; grid-template-columns: repeat(9, minmax(96px,1fr)); border: 1px solid #dfe2e8; border-top: 2px solid #352e84; border-radius: 8px; overflow-x: auto; background: #f3f2fb; }
.cxc-aging-collapsed-summary[hidden], .cxc-aging-body[hidden] { display: none; }
.cxc-aging-collapsed-summary > div { display: grid; gap: 4px; min-width: 96px; padding: 9px 11px; border-right: 1px solid #e6e8ed; }
.cxc-aging-collapsed-summary > div:last-child { border-right: 0; }
.cxc-aging-collapsed-summary span { color: var(--muted); font-size: 12px; }
.cxc-aging-collapsed-summary strong { text-align: right; }
.cxc-aging-table { table-layout: fixed; }
.cxc-aging-table th, .cxc-aging-table td { padding: 7px 8px; vertical-align: top; }
.cxc-aging-table th { position: relative; padding-right: 14px; white-space: normal; overflow-wrap: anywhere; word-break: normal; text-align: left; }
.cxc-aging-table .cxc-aging-data { white-space: normal; overflow-wrap: anywhere; text-align: left; }
.cxc-aging-table .cxc-aging-text { white-space: normal; line-height: 1.35; text-align: left; overflow-wrap: anywhere; }
.cxc-aging-table .cxc-aging-amount { min-width: 92px; text-align: right; white-space: nowrap; }
.cxc-aging-table .cxc-aging-active { color: #352e84; font-weight: 700; background: #f7f6ff; }
.cxc-invoice-quarantine td { background: #fff9e8; }
.cxc-invoice-smart td { background: #fff0f1; }
.cxc-invoice-promise td { background:#edf9f1; }
.cxc-invoice-state { display: block; margin-top: 3px; font-size: 9px; font-weight: 800; line-height: 1.2; text-transform: uppercase; }
.cxc-invoice-state-quarantine { color: #8a5a00; }
.cxc-invoice-state-smart { color: #9f1626; }
.cxc-invoice-state-promise { color:#19733a; }
.cxc-aging-table tfoot th { border-top: 2px solid #352e84; background: #f3f2fb; font-weight: 800; }
.cxc-aging-floating-header .cxc-column-resizer { display: none; }
.cxc-aging-floating-grid { display: grid; align-items: stretch; background: #f0f1f5; will-change: transform; }
.cxc-aging-floating-cell { box-sizing: border-box; min-width: 0; padding: 7px 14px 7px 8px; border-right: 1px solid #e6e8ed; border-bottom: 1px solid #e6e8ed; color: #292d38; font-size: 12px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; text-align: left; }
.cxc-contact-grid small, .cxc-invoice-followup small, .cxc-legacy-action span { color: var(--muted); font-size: 12px; }
.cxc-client-managements { display:grid; grid-template-columns:minmax(0,1.55fr) minmax(320px,.75fr); gap:14px; align-items:start; }
.cxc-client-managements.has-incident-invoices { grid-template-columns:minmax(0,1.35fr) minmax(280px,.65fr) minmax(280px,.75fr); }
.cxc-client-classification { display:grid; gap:10px; }
.cxc-client-classification > article { overflow:hidden; border:1px solid #dfe2e8; border-radius:9px; background:#fff; }
.cxc-client-classification header { display:flex; align-items:center; gap:7px; padding:8px 10px; background:#eef0f5; }
.cxc-client-classification header span { padding:2px 6px; border-radius:5px; background:#fff; font-family:ui-monospace,monospace; font-weight:800; }
.cxc-client-classification article > div,.cxc-client-classification article > p { display:grid; gap:3px; margin:0; padding:9px 10px; }
.cxc-client-classification article > div + div { border-top:1px solid #e7e9ee; }
.cxc-client-classification small { color:var(--muted); }
.cxc-client-classification .cxc-classification-entry { gap:7px; }
.cxc-classification-entry-head { display:grid; gap:2px; }
.cxc-classification-entry > p { margin:0; line-height:1.35; }
.cxc-classification-invoices { display:grid; gap:4px; }
.cxc-classification-invoices > span { display:flex; align-items:baseline; justify-content:space-between; gap:8px; padding:4px 6px; border:1px solid rgba(65,72,92,.12); border-radius:6px; background:rgba(255,255,255,.68); }
.cxc-classification-invoices b { overflow-wrap:anywhere; }
.cxc-classification-invoices em { flex:0 0 auto; font-style:normal; font-weight:700; }
.cxc-classification-promise { border-color:#59aa75 !important; background:#fff !important; }
.cxc-classification-promise > header { background:#edf9f1; }
.cxc-classification-delegation { border-color:#7168be !important; background:#fff !important; }
.cxc-classification-delegation > header { background:#f4f2ff; }
.cxc-classification-quarantine { border-color:#e1ad32 !important; background:#fff !important; }
.cxc-classification-quarantine > header { background:#fff4c7; }
.cxc-classification-issue { border-color:#d65a68 !important; background:#fff !important; }
.cxc-classification-issue > header { background:#fff3f4; }
.cxc-private-note-button { position:relative; }
.cxc-private-note-button > span { position:absolute; top:-7px; right:-7px; display:grid; min-width:18px; height:18px; padding:0 4px; place-items:center; border:2px solid #fff; border-radius:999px; color:#fff; background:#d4002a; font-size:10px; font-weight:800; }
.cxc-private-note-panel [data-cxc-private-compose] { display:grid; gap:12px; }
.cxc-private-note-panel textarea { min-height:180px; }
.cxc-private-note-panel.is-compose-collapsed [data-cxc-private-compose] { display:none; }
.cxc-private-note-panel.is-compose-collapsed { max-height:calc(100vh - 120px); }
.cxc-private-history { display:grid; gap:7px; max-height:240px; overflow:auto; padding-top:8px; border-top:1px solid #e2e5eb; }
.cxc-private-history article { padding:8px; border-radius:7px; background:#f5f4fb; }
.cxc-private-history p { margin:4px 0 0; white-space:pre-wrap; }
.cxc-client-managements:has(.cxc-private-managements:not([open])) { grid-template-columns: minmax(0,1fr) 116px; }
.cxc-client-managements.has-incident-invoices:has(.cxc-private-managements:not([open])) { grid-template-columns: minmax(0,1.45fr) 116px minmax(260px,.75fr); }
.cxc-private-managements > summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 24px; color: var(--text); font-size: 13px; font-weight: 700; cursor: pointer; list-style: none; }
.cxc-private-managements > summary::-webkit-details-marker { display: none; }
.cxc-private-managements > summary::before { content: "+"; display: inline-grid; flex: 0 0 20px; width: 20px; height: 20px; place-items: center; border: 1px solid #9b8ed3; border-radius: 6px; color: #51439a; background: #f5f3ff; }
.cxc-private-managements[open] > summary::before { content: "−"; }
.cxc-private-managements > summary > span { min-width: 0; }
.cxc-private-managements > summary > strong { display: inline-grid; flex: 0 0 22px; min-width: 22px; height: 22px; padding: 0 5px; place-items: center; border-radius: 999px; color: #fff; background: #51439a; font-size: 11px; }
.cxc-private-managements:not([open]) > summary { display: grid; justify-items: center; justify-content: stretch; text-align: center; }
.cxc-private-managements:not([open]) > summary > span { font-size: 11px; line-height: 1.2; }
.cxc-private-managements[open] > summary { margin-bottom: 10px; }
.cxc-client-invoice-followup { margin-top: 14px; }
.cxc-client-secondary { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
.cxc-panel-title { display: flex; justify-content: space-between; gap: 14px; align-items: center; }
.cxc-panel-title h3, .cxc-panel-title p { margin: 0; }
.cxc-invoice-followup { max-height: 430px; overflow: auto; }
.cxc-invoice-followup article, .cxc-legacy-action { display: grid; grid-template-columns: minmax(100px,1fr) auto auto minmax(120px,1fr); gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid #eceef2; }
.cxc-invoice-followup small { grid-column: 1 / -1; }
.cxc-contact-grid { display: grid; grid-template-columns: repeat(2,minmax(180px,1fr)); gap: 8px; }
.cxc-contact-grid article { display: grid; gap: 3px; padding: 10px; border: 1px solid #e6e8ed; border-radius: 7px; }
.cxc-statement-draft-dialog { width: min(760px, calc(100vw - 32px)); color: var(--text); background: var(--surface); }
.cxc-statement-draft-shell { display: grid; max-height: min(760px, calc(100vh - 32px)); }
.cxc-statement-draft-shell > header, .cxc-statement-draft-shell > footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.cxc-statement-draft-shell > header h2, .cxc-statement-draft-shell > header p { margin: 0; }
.cxc-statement-draft-shell > header p { color: var(--muted); }
.cxc-statement-draft-shell > footer { justify-content: flex-end; border-top: 1px solid var(--line); border-bottom: 0; }
.cxc-statement-draft-content { padding: 18px; overflow: auto; }
.cxc-contact-selector label { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 10px; align-items: start; padding: 10px; border: 1px solid #e6e8ed; border-radius: 7px; cursor: pointer; }
.cxc-contact-selector label:has(input:checked) { border-color: var(--corp); background: var(--corp-soft); box-shadow: 0 0 0 2px var(--corp-shadow); }
.cxc-contact-selector label > span { display: grid; gap: 3px; min-width: 0; }
.cxc-contact-selector label small { color: var(--muted); font-size: 12px; }
.cxc-temporary-recipient { display: grid; gap: 6px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.cxc-temporary-recipient > span { font-weight: 700; }
.cxc-temporary-recipient input { width: min(100%, 440px); }
.cxc-temporary-recipient small { color: var(--muted); }
.cxc-structured-summary { display: grid; gap: 10px; }
.cxc-structured-summary > div { display: grid; grid-template-columns: 130px 1fr; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid #eceef2; }
.cxc-new-work > summary { cursor: pointer; font-weight: 700; }
.cxc-new-work[open] > summary { margin-bottom: 12px; }
.cxc-panel { background: #fff; border: 1px solid #dfe2e8; border-radius: 8px; padding: 14px; }
.cxc-panel h3 { margin: 0 0 10px; }
.cxc-contact, .cxc-issue { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) minmax(140px, .6fr); gap: 10px; padding: 7px 0; border-bottom: 1px solid #eceef2; }
.cxc-management-form { display: grid; grid-template-columns: repeat(3, minmax(160px, 1fr)); gap: 10px; align-items: end; }
.cxc-management-form label { display: grid; gap: 5px; }
.cxc-management-form .cxc-management-text { grid-column: 1 / -1; }
.cxc-management-form textarea { resize: vertical; }
.cxc-management { display: grid; gap: 5px; padding: 5px 0 7px; }
.cxc-management + .cxc-management { margin-top: 0; }
.cxc-management.is-commercial-action .cxc-management-copy > p,.cxc-management.is-commercial-action .cxc-management-note { border-color:#f2e9bd; background:#fffef9; }
.cxc-management > div { display: grid; gap: 3px; }
.cxc-management-copy > p { margin:0; padding:8px 10px; border:1px solid var(--cxc-admin-note-border); border-radius:8px; background:var(--cxc-admin-note-bg); box-shadow:0 1px 3px rgba(53,46,132,.035); color:var(--cxc-admin-note-text); font-size:13px; line-height:1.4; white-space:pre-wrap; }
.cxc-management-note { display:block; width:100%; margin:0; padding:8px 10px; border:1px solid var(--cxc-admin-note-border); border-radius:8px; background:var(--cxc-admin-note-bg); color:var(--cxc-admin-note-text); font:inherit; font-size:13px; line-height:1.4; text-align:left; white-space:normal; cursor:pointer; }
.cxc-management-note:hover { border-color:#8b82ce; box-shadow:0 0 0 2px rgba(83,72,160,.13); }
.cxc-management-note small { display:block; margin-top:7px; color:#5045a0; font-weight:700; }
.cxc-management-section,.cxc-management-free-text,.cxc-management-section-body { display:block; }
.cxc-management-section + .cxc-management-section,.cxc-management-free-text + .cxc-management-section { margin-top:10px; }
.cxc-management-free-text,.cxc-management-section-body { white-space:pre-wrap; }
.cxc-management-destination { display:block; margin:0; color:#51439a; font-weight:800; text-decoration:underline; text-decoration-thickness:2px; text-underline-offset:3px; }
.cxc-management-destination.is-promise { color:#18733c; }
.cxc-management-destination.is-delegation { color:#51439a; }
.cxc-management-destination.is-quarantine { color:#9a6500; }
.cxc-management-destination.is-general { color:#334155; }
.cxc-management-meta { grid-template-columns: minmax(0,1fr); gap: 2px !important; }
.cxc-management-meta > span { display: flex; gap: 4px; min-width: 0; align-items: baseline; }
.cxc-management-meta small { color: var(--muted); font-size: 11px; font-weight: 400; }
.cxc-management-meta small::after { content: ":"; }
.cxc-management-meta-value { min-width: 0; color: #667085; font-size: 11px; font-weight: 400; line-height: 1.3; overflow-wrap: anywhere; }
.cxc-management-copy { padding-top: 0; }
.cxc-management-edit-actions { display: grid; gap: 5px; margin-top: 10px; }
.cxc-management-edit-actions details > summary { color: #667085; font-size: 11px; cursor: pointer; }
.cxc-management-rewrite { display: grid; gap: 6px; margin-top: 6px; }
.cxc-incident-invoices article { display: grid; gap: 8px; padding: 10px 0; border-bottom: 1px solid #eceef2; }
.cxc-incident-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.cxc-incident-head span { text-align: right; white-space: nowrap; }
.cxc-incident-general .cxc-incident-head span { color:#9e1026; font-size:11px; font-weight:800; }
.cxc-incident-request { display: grid; gap: 7px; padding: 8px; border: 1px solid #f0d6d9; border-radius: 8px; background: #fffafa; }
.cxc-incident-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.cxc-incident-meta > span { display: flex; align-items: baseline; gap: 5px; min-width: 0; }
.cxc-incident-meta small, .cxc-incident-kind { color: var(--muted); font-size: 11px; }
.cxc-incident-meta small::after { content: ":"; }
.cxc-incident-meta strong { font-size: 12px; overflow-wrap: anywhere; }
.cxc-incident-kind { display: block; }
.cxc-incident-text { display: grid; gap: 3px; }
.cxc-incident-text > strong { color: #667085; font-size: 11px; font-weight: 600; }
.cxc-incident-text p { margin: 0; padding: 7px 8px; border-radius: 7px; background: #fff4c7; color: #2d3138; font-size: 12px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.cxc-incident-review p { background: #f4f1ff; }
.cxc-client-classification .cxc-incident-invoices > article { margin:0 9px; padding:9px 0; border-bottom:1px solid #f0d6d9; }
.cxc-client-classification .cxc-incident-invoices > article:last-child { border-bottom:0; }
.cxc-delegation-control-table tbody tr { cursor:pointer; }
.cxc-delegation-tab { position:relative; }
.cxc-delegation-tab [data-cxc-delegation-badge] { position:absolute; top:1px; right:1px; display:grid; min-width:17px; height:17px; padding:0 4px; place-items:center; border:2px solid #fff; border-radius:999px; color:#fff; background:#d4002a; font-size:9px; font-weight:800; }
.cxc-delegation-tab [data-cxc-delegation-badge][hidden] { display:none; }
.cxc-delegation-control-table tbody tr:hover { filter:brightness(.985); box-shadow:inset 3px 0 #51439a; }
.cxc-delegation-control-table tr.is-delegated td { background:#fff8df; }
.cxc-delegation-control-table tr.is-scheduled td { background:#eaf3ff; }
.cxc-delegation-control-table tr.is-closed td { color:#747a85; background:#f1f2f4; }
.cxc-delegation-detail-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; }
.cxc-delegation-detail-grid article { display:grid; gap:4px; padding:10px; border:1px solid #e0e3e8; border-radius:8px; background:#f7f8fa; }
.cxc-delegation-detail-grid small { color:var(--muted); }
.cxc-delegation-instruction,.cxc-commercial-action-summary { padding:10px; border:1px solid #dedcf2; border-radius:8px; background:#f8f7ff; }
.cxc-delegation-instruction p,.cxc-commercial-action-summary p { margin:5px 0 0; white-space:pre-wrap; }
@media (max-width:900px) { .cxc-client-managements { grid-template-columns:1fr; } .cxc-delegation-detail-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
.cxc-client-followup { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.cxc-mail { display: grid; grid-template-columns: minmax(220px,.35fr) 1fr auto; gap: 14px; padding: 10px 0; border-bottom: 1px solid #e6e8ed; }
.cxc-mail > div { display: grid; gap: 4px; }
.cxc-mail p { margin: 0; white-space: pre-wrap; }
.cxc-action-grid { display: grid; grid-template-columns: repeat(3,minmax(220px,1fr)); gap: 18px; }
.cxc-action-grid form { display: grid; gap: 8px; align-content: start; padding-right: 16px; border-right: 1px solid #e6e8ed; }
.cxc-action-grid form:last-child { border-right: 0; }
.cxc-action-grid label { display: grid; gap: 5px; }
.cxc-permission-note { display: grid; gap: 8px; align-content: start; padding: 10px 12px; border: 1px solid #d5b463; border-radius: 8px; color: #765000; background: #fff9e8; }
.cxc-permission-note h3, .cxc-permission-note p { margin: 0; }
.cxc-permission-note small { line-height: 1.4; }
.cxc-action-grid .form-error { min-height: 17px; color: #a40f22; font-size: 12px; font-weight: 700; line-height: 1.35; }
.workspace-toast { position: fixed; z-index: 2000; top: 18px; right: 18px; width: min(420px, calc(100vw - 36px)); padding: 12px 14px; border: 1px solid #9b8ed3; border-radius: 9px; color: #352e84; background: #f5f3ff; box-shadow: 0 12px 30px rgba(31,35,48,.22); font-size: 13px; font-weight: 700; line-height: 1.4; opacity: 0; pointer-events: none; transform: translateY(-10px); transition: opacity .16s ease, transform .16s ease; }
.workspace-toast.visible { opacity: 1; transform: translateY(0); }
.workspace-toast[data-type="success"] { border-color: #58b978; color: #176b35; background: #e7f7ec; }
.workspace-toast[data-type="error"] { border-color: #d9818b; color: #8f1523; background: #fff0f1; }
.cxc-list-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-bottom: 12px; }
.cxc-list-table th, .cxc-list-table td { border-bottom: 1px solid #e6e8ed; padding: 8px; text-align: left; vertical-align: top; }
.cxc-list-table th { background: #f0f1f5; }
.cxc-forecast-table { min-width: 1050px; }
.cxc-forecast-table th, .cxc-forecast-table td { white-space: normal; }
.cxc-forecast-table td:nth-child(2) { text-align: left; font-weight: 600; }
.cxc-forecast-table .number { text-align: right; }
.cxc-forecast-table .week-1 { background:#20dd36; }
.cxc-forecast-table .week-2 { background:#1594ea; }
.cxc-forecast-table .week-3 { background:#f8e21b; color:#111; }
.cxc-forecast-table .week-4 { background:#f58220; color:#111; }
.cxc-forecast-table .week-5 { background:#f51b22; color:#fff; }
.cxc-forecast-table .week-rest { background:#ef27dd; color:#111; }
.cxc-inbox-item { display: grid; grid-template-columns: minmax(220px,.35fr) 1fr minmax(220px,.3fr); gap: 14px; align-items: start; padding: 12px 0; border-bottom: 1px solid #e6e8ed; }
.cxc-inbox-item > div { display: grid; gap: 4px; }
.cxc-inbox-item p { margin: 0; white-space: pre-wrap; }
.cxc-inbox-item form { display: flex; gap: 6px; }
.cxc-inline-action { display: grid; grid-template-columns: minmax(150px,1fr) auto auto auto; gap: 5px; align-items: center; }
.cxc-review-actions { display: flex; gap: 5px; margin-top: 6px; }
.cxc-meeting-mode { display: grid; gap: 14px; }
.cxc-meeting-form { display: grid; grid-template-columns: minmax(220px,.45fr) minmax(280px,.55fr); gap: 12px; align-items: start; }
.cxc-meeting-form label { display: grid; gap: 5px; }
.cxc-meeting-form fieldset { grid-column: 1 / -1; border: 1px solid #dfe2e8; border-radius: 8px; padding: 10px; min-width: 0; }
.cxc-meeting-form legend { padding: 0 6px; font-weight: 700; }
.cxc-meeting-agenda { max-height: 460px; overflow: auto; display: grid; }
.cxc-meeting-client { display: grid !important; grid-template-columns: auto minmax(260px,1fr) auto; gap: 10px !important; align-items: center; padding: 9px 6px; border-bottom: 1px solid #eceef2; cursor: pointer; }
.cxc-meeting-client-main, .cxc-meeting-client-data { display: grid; gap: 3px; }
.cxc-meeting-client-data { text-align: right; }
.cxc-meeting-client small { color: var(--muted); }
.cxc-meeting-decision { min-width: 620px; display: grid; grid-template-columns: 1.1fr 1fr 1fr auto auto; gap: 5px; }
@media (max-width: 1150px) { .cxc-metrics { grid-template-columns: repeat(3, 1fr); } .cxc-client-managements, .cxc-client-managements.has-incident-invoices, .cxc-client-managements:has(.cxc-private-managements:not([open])), .cxc-client-managements.has-incident-invoices:has(.cxc-private-managements:not([open])), .cxc-client-secondary { grid-template-columns: 1fr; } .cxc-private-managements:not([open]) > summary { display: flex; justify-content: flex-start; text-align: left; } .cxc-client-head { align-items: flex-start; flex-wrap: wrap; } .cxc-client-head-actions { flex-wrap: wrap; } }
@media (max-width: 800px) { .cxc-metrics, .cxc-client-metrics, .cxc-aging-band { grid-template-columns: repeat(2, 1fr); } .cxc-toolbar input { min-width: 100%; } .cxc-selection-actions { align-items: stretch; flex-direction: column; } .cxc-action-grid { grid-template-columns: 1fr; } .cxc-action-grid form { padding: 0 0 14px; border-right: 0; border-bottom: 1px solid #e6e8ed; } .cxc-action-grid form:last-child { padding-bottom: 0; border-bottom: 0; } .cxc-meeting-form { grid-template-columns: 1fr; } .cxc-meeting-client { grid-template-columns: auto 1fr; } .cxc-meeting-client-data { grid-column: 2; text-align: left; } .cxc-client-head, .cxc-client-head-actions { align-items: flex-start; flex-direction: column; } }
/* Rendimiento comercial */
.commercial-performance-module { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; gap: 16px; }
.commercial-performance-module > * { min-width: 0; }
.commercial-performance-toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.commercial-performance-toolbar label { display: grid; gap: 5px; min-width: 135px; color: var(--muted); font-size: 12px; font-weight: 700; }
.commercial-performance-toolbar input, .commercial-performance-toolbar select { min-height: 38px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); padding: 7px 9px; color: var(--text); }
.commercial-kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(160px, 1fr)); gap: 12px; margin-top: 16px; }
.commercial-kpi-grid article { min-height: 118px; display: grid; align-content: start; gap: 4px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(145deg, var(--surface), var(--surface-soft)); box-shadow: 0 4px 16px rgb(29 56 75 / 6%); }
.commercial-kpi-has-help { position: relative; cursor: help; }
.commercial-help-mark { display: inline-grid; place-items: center; width: 17px; height: 17px; margin-left: 7px; border: 1px solid #8ba0ae; border-radius: 50%; color: #607785; font-size: 11px; }
.commercial-kpi-help { position: absolute; z-index: 30; top: calc(100% + 8px); left: 0; width: min(440px, 78vw); display: none; padding: 14px; border: 1px solid #bdcbd4; border-radius: 10px; color: var(--text); background: var(--surface); box-shadow: 0 12px 32px rgb(22 46 61 / 18%); font-size: 12px; line-height: 1.45; text-transform: none; letter-spacing: normal; }
.commercial-kpi-help p { margin: 7px 0; }
.commercial-kpi-help small { display: block; margin-top: 8px; color: var(--muted); }
.commercial-kpi-has-help:hover .commercial-kpi-help, .commercial-kpi-has-help:focus .commercial-kpi-help, .commercial-kpi-has-help:focus-within .commercial-kpi-help { display: block; }
.commercial-kpi-grid span, .commercial-panel header span { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.commercial-kpi-grid strong { color: var(--blue-dark); font-size: 28px; line-height: 1.1; }
.commercial-kpi-grid small { color: var(--muted); }
.commercial-chart-grid-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.commercial-chart-grid-layout.commercial-chart-single { grid-template-columns: minmax(0, 1fr); }
.commercial-panel { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 4px 16px rgb(29 56 75 / 5%); }
.commercial-panel header { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.commercial-panel h2 { margin: 3px 0 0; color: var(--text); font-size: 18px; }
.commercial-panel header small { max-width: 210px; color: var(--muted); text-align: right; }
.commercial-line-chart { width: 100%; min-height: 230px; overflow: visible; }
.commercial-line-chart text { fill: var(--muted); font-size: 11px; }
.commercial-chart-grid { stroke: var(--line); stroke-width: 1; }
.commercial-chart-series polyline { fill: none; stroke: var(--series-color); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.commercial-chart-series circle { fill: var(--surface); stroke: var(--series-color); stroke-width: 2.5; }
.commercial-chart-legend { display: flex; flex-wrap: wrap; gap: 12px; margin: 2px 0 4px 44px; color: var(--muted); font-size: 12px; }
.commercial-chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.commercial-chart-legend i { width: 10px; height: 10px; border-radius: 50%; background: var(--legend-color); }
.commercial-bar-list { display: grid; gap: 14px; padding: 18px 4px 8px; }
.commercial-bar-row { display: grid; grid-template-columns: 60px 1fr 36px; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.commercial-bar-row > div { height: 13px; overflow: hidden; border-radius: 10px; background: #edf1f4; }
.commercial-bar-row i { display: block; height: 100%; border-radius: inherit; background: var(--bar-color); }
.commercial-table-panel { margin-top: 14px; }
.commercial-people-section { display: grid; gap: 14px; margin-top: 14px; }
.commercial-section-heading { padding: 4px 2px; }
.commercial-section-heading > span { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.commercial-section-heading h2 { margin: 3px 0; font-size: 20px; }
.commercial-section-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.commercial-person-panel header > div > small { display: block; margin-top: 4px; color: var(--muted); }
.commercial-person-metrics { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.commercial-person-metrics span { padding: 7px 10px; border-radius: 8px; color: var(--muted); background: var(--surface-soft); font-size: 12px; }
.commercial-person-metrics b { color: var(--blue-dark); font-size: 15px; }
.commercial-person-metrics span > small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.commercial-person-metrics .commercial-rate-metric { color: #145c3d; background: #e9f7f0; border: 1px solid #bfe3d1; }
.commercial-person-metrics .commercial-rate-metric b { color: #145c3d; }
.commercial-person-metrics .commercial-rate-pending { color: #7a4a00; background: #fff4d8; border: 1px solid #ecd08d; }
.commercial-person-metrics .commercial-inherited-metric { color: #5f4a78; background: #f2ecf8; border: 1px solid #d9cae8; }
.commercial-person-metrics .commercial-rate-pending b,
.commercial-person-metrics .commercial-inherited-metric b { color: inherit; }
.commercial-person-help { position: relative; cursor: help; border: 1px dashed #9fb2bf; }
.commercial-person-help > i { position: absolute; z-index: 35; top: calc(100% + 7px); left: 0; width: min(360px, 75vw); display: none; padding: 10px 12px; border: 1px solid #bdcbd4; border-radius: 9px; color: var(--text); background: var(--surface); box-shadow: 0 10px 26px rgb(22 46 61 / 18%); font-style: normal; line-height: 1.4; }
.commercial-person-help:hover > i, .commercial-person-help:focus > i, .commercial-person-help:focus-within > i { display: block; }
.commercial-person-layout { display: grid; grid-template-columns: minmax(360px, .8fr) minmax(560px, 1.2fr); gap: 16px; align-items: start; }
.commercial-person-layout h3, .commercial-person-top h3 { margin: 0 0 6px; color: var(--text); font-size: 15px; }
.commercial-person-layout > div > small { display: block; margin-bottom: 3px; color: var(--muted); }
.commercial-person-delegations { margin-top: 14px; }
.commercial-person-top { margin-top: 16px; }
.commercial-delegation-breakdown { display: grid; gap: 3px; min-width: 260px; }
.commercial-delegation-breakdown span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.commercial-top-clients-table td:first-child { min-width: 220px; }
.commercial-reason-detail > td { padding: 0 10px 12px !important; background: var(--surface); }
.commercial-reason-detail details { padding: 8px 10px; border-left: 3px solid #d7e2e9; }
.commercial-reason-detail summary { cursor: pointer; color: var(--muted); font-weight: 700; }
.commercial-reason-detail table { margin-top: 8px; font-size: 12px; }
.commercial-table-wrap { overflow: auto; }
.commercial-table-wrap table { width: 100%; border-collapse: collapse; font-size: 13px; }
.commercial-table-wrap th { padding: 9px 10px; color: var(--muted); background: var(--surface-soft); text-align: left; white-space: nowrap; }
.commercial-table-wrap td { padding: 10px; border-top: 1px solid var(--line); vertical-align: top; }
.commercial-table-wrap td small, .commercial-reason-category { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.commercial-percent-cell { position: relative; min-width: 110px; overflow: hidden; border-radius: 6px; background: #edf2f5; }
.commercial-percent-cell i { position: absolute; inset: 0 auto 0 0; background: #f2c4c1; }
.commercial-percent-cell span { position: relative; display: block; padding: 4px 7px; color: #5f3330; font-weight: 700; }
.commercial-performance-empty { min-height: 220px; display: grid; place-content: center; gap: 8px; padding: 30px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); background: var(--surface); text-align: center; }
@media (max-width: 1100px) { .commercial-kpi-grid { grid-template-columns: repeat(2, minmax(150px, 1fr)); } .commercial-chart-grid-layout, .commercial-person-layout { grid-template-columns: 1fr; } }
@media (max-width: 650px) {
  .commercial-kpi-grid { grid-template-columns: minmax(0, 1fr); }
  .commercial-performance-toolbar label { flex: 1 1 100%; min-width: 0; }
  .commercial-performance-toolbar input, .commercial-performance-toolbar select { min-width: 0; max-width: 100%; width: 100%; }
  .commercial-performance-module h2, .commercial-performance-module summary { overflow-wrap: anywhere; }
}

.integrity-module { display: grid; gap: 18px; }
.integrity-management-cell { display: grid; gap: 5px; min-width: 190px; }
.integrity-management-cell small { color: var(--muted); line-height: 1.35; }
.integrity-manage-btn { width: fit-content; white-space: nowrap; }
.integrity-structure { min-width: 110px; }
.integrity-structure summary { color: var(--accent); cursor: pointer; font-weight: 700; white-space: nowrap; }
.integrity-structure[open] { min-width: 280px; max-width: 420px; }
.integrity-structure ul { margin: 6px 0 10px; padding-left: 18px; }
.integrity-structure li { margin: 3px 0; white-space: normal; }
.integrity-toolbar, .integrity-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.integrity-summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 10px; }
.integrity-summary-grid > div, .integrity-panel { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.integrity-summary-grid > div { padding: 14px; }
.integrity-summary-grid span { display: block; color: var(--muted); font-size: 12px; }
.integrity-summary-grid strong { display: block; margin-top: 4px; font-size: 22px; }
.integrity-panel { padding: 16px; }
.integrity-panel-head h2 { margin: 2px 0 0; }
.integrity-panel-head input { min-width: min(360px, 100%); }
.integrity-table-wrap { overflow: auto; margin-top: 14px; max-height: 58vh; }
.integrity-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.integrity-table th, .integrity-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.integrity-table th { position: sticky; top: 0; z-index: 1; background: var(--surface); }
.integrity-table code { font-size: 11px; white-space: nowrap; }
.integrity-finding-records { margin-top: 7px; color: var(--muted); }
.integrity-finding-records summary { cursor: pointer; color: var(--primary); font-weight: 700; }
.integrity-finding-records ol { margin: 7px 0 0; padding-left: 20px; }
.integrity-finding-records li + li { margin-top: 5px; }
.integrity-unclassified { background: #fff3d6; }
#commercialActionsModule {
  --offer-followup-amber: #f8df9a;
  --offer-followup-red: #ffd6d9;
  --offer-followup-blue: #cfe3ff;
  --offer-followup-blue-pulse: #9fc5ff;
  --offer-followup-green: #cfead8;
  --offer-followup-white: #ffffff;
  --offer-followup-blocked: #e5e7eb;
  --offer-followup-semantic-text: #243142;
}
.commercial-actions-table tr.is-smart-amber td { background:var(--offer-followup-amber); color:var(--offer-followup-semantic-text); }
.commercial-actions-table tr.is-smart-red td { background:var(--offer-followup-red); color:var(--offer-followup-semantic-text); }
.commercial-actions-table tr.is-smart-blue td { background:var(--offer-followup-blue); color:var(--offer-followup-semantic-text); }
.commercial-actions-table tr.is-smart-green td { background:var(--offer-followup-green); color:var(--offer-followup-semantic-text); }
.commercial-actions-table tr.is-smart-white td { background:var(--offer-followup-white); color:var(--offer-followup-semantic-text); }
.commercial-actions-table tr.is-smart-blocked td { background:var(--offer-followup-blocked); color:#6b7280; }
.commercial-actions-table tr.is-smart-blue.is-smart-claim-pulse td { animation:offer-smart-blue-claim-pulse 1.8s ease-in-out infinite; }
.commercial-actions-table tr.is-smart-amber.is-smart-claim-pulse td { animation:offer-smart-amber-overdue-pulse 1.8s ease-in-out infinite; }
@keyframes offer-smart-blue-claim-pulse { 0%,100% { background:var(--offer-followup-blue); } 50% { background:var(--offer-followup-blue-pulse); } }
@keyframes offer-smart-amber-overdue-pulse { 0%,100% { background:var(--offer-followup-amber); } 50% { background:#f2c94c; } }
.commercial-actions-table tr.is-exported td { background:#e5e7eb; color:#6b7280; cursor:not-allowed; }
.commercial-offer-followup-legend { display:flex; flex-wrap:wrap; gap:14px; margin:5px 0 8px; color:var(--muted); font-size:12px; }
.commercial-offer-followup-legend span { display:inline-flex; align-items:center; gap:6px; }
.commercial-offer-followup-legend i { width:12px; height:12px; border-radius:3px; border:1px solid var(--line); }
.commercial-offer-followup-legend i.amber { background:var(--offer-followup-amber); border-color:var(--offer-followup-amber); }
.commercial-offer-followup-legend i.red { background:var(--offer-followup-red); border-color:var(--offer-followup-red); }
.commercial-offer-followup-legend i.blue { background:var(--offer-followup-blue); border-color:var(--offer-followup-blue); }
.commercial-offer-followup-legend i.green { background:var(--offer-followup-green); border-color:var(--offer-followup-green); }
.commercial-offer-followup-legend i.white { background:var(--offer-followup-white); }
.commercial-offer-followup-legend i.blocked { background:var(--offer-followup-blocked); }
.commercial-offer-followup-legend i.pulse { animation:offer-smart-blue-claim-pulse 1.8s ease-in-out infinite; }
.commercial-offer-followup-legend i.amber-pulse { animation:offer-smart-amber-overdue-pulse 1.8s ease-in-out infinite; }
.commercial-offer-followup-phases { display:flex; align-items:stretch; flex-wrap:wrap; gap:8px; margin:0 0 8px; padding:8px; border:1px solid var(--line); border-radius:10px; background:var(--surface); }
.commercial-offer-phase-title { display:flex; align-items:center; padding:0 6px; color:var(--muted); font-size:11px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
.commercial-offer-phase { display:flex; align-items:center; justify-content:space-between; min-width:150px; gap:16px; padding:8px 12px; border:1px solid var(--line-strong); border-left:5px solid var(--muted); border-radius:8px; background:var(--surface); color:var(--text); cursor:pointer; }
.commercial-offer-phase strong { font-size:17px; }
.commercial-offer-phase.is-rejected { border-left-color:var(--offer-followup-red); }
.commercial-offer-phase.is-today { border-left-color:var(--offer-followup-green); }
.commercial-offer-phase.is-scheduled { border-left-color:var(--offer-followup-blue); }
.commercial-offer-phase.is-departure { border-left-color:var(--offer-followup-blue); }
.commercial-offer-phase.is-stale { border-left-color:var(--offer-followup-blue-pulse); }
.commercial-offer-phase.is-active { box-shadow:0 0 0 3px var(--corp-shadow); font-weight:800; }
.commercial-offer-phase.is-rejected.is-active { background:var(--offer-followup-red); border-color:var(--offer-followup-red); color:var(--offer-followup-semantic-text); }
.commercial-offer-phase.is-today.is-active { background:var(--offer-followup-green); border-color:var(--offer-followup-green); color:var(--offer-followup-semantic-text); }
.commercial-offer-phase.is-scheduled.is-active,
.commercial-offer-phase.is-departure.is-active { background:var(--offer-followup-blue); border-color:var(--offer-followup-blue); color:var(--offer-followup-semantic-text); }
.commercial-offer-phase.is-stale.is-active { background:var(--offer-followup-blue-pulse); border-color:var(--offer-followup-blue-pulse); color:var(--offer-followup-semantic-text); }
.commercial-actions-table tr.is-temporary td { background: #fef3c7; color: #78350f; }
.commercial-offer-followup-table { table-layout: fixed; width: max-content; border-collapse: separate; border-spacing: 0; }
.commercial-offer-followup-table th { position: sticky; top: 0; z-index: 9; }
.commercial-offer-followup-view .commercial-actions-table-wrap {
  max-height: var(--commercial-offer-followup-viewport-height, calc(100dvh - 220px));
  overflow: auto;
}
#commercialActionsModule.followup-table-scrolled .commercial-actions-viewbar,
#commercialActionsModule.followup-table-scrolled .commercial-offer-followup-phases,
#commercialActionsModule.followup-table-scrolled .commercial-offer-followup-toolbar,
#commercialActionsModule.followup-table-scrolled .commercial-offer-followup-legend { display: none; }
.commercial-actions-table tr.is-overdue-schedule td { animation: overdue-schedule-pulse 1.8s ease-in-out infinite; }
@keyframes overdue-schedule-pulse { 0%, 100% { background: #fff4f4; } 50% { background: #ffd9dc; } }
@media (prefers-reduced-motion: reduce) { .commercial-actions-table tr.is-overdue-schedule td { animation: none; background: #ffe3e5; } }
.commercial-offer-followup-table th[data-offer-followup-column] { cursor: grab; user-select: none; }
.commercial-offer-followup-table th[data-offer-followup-column].is-dragging { cursor: grabbing; opacity: .55; }
.commercial-offer-followup-table th,
.commercial-offer-followup-table td { box-sizing: border-box; }
.commercial-offer-column-head { display: flex; align-items: center; justify-content: flex-start; gap: 6px; min-width: 0; }
.commercial-offer-column-head .cxc-head-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.commercial-offer-column-grip { flex: 0 0 auto; color: var(--muted); font-size: 14px; letter-spacing: -3px; line-height: 1; }
.commercial-offer-followup-table th.cxc-drop-before::before,
.commercial-offer-followup-table th.cxc-drop-after::after { content: ""; position: absolute; top: 0; bottom: 0; width: 4px; z-index: 8; background: #d4002a; pointer-events: none; }
.commercial-offer-followup-table th.cxc-drop-before::before { left: -2px; }
.commercial-offer-followup-table th.cxc-drop-after::after { right: -2px; }
.commercial-offer-followup-table td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.commercial-offer-followup-toolbar { display: flex; align-items: end; gap: 8px; margin-bottom: 6px; }
.commercial-offer-followup-toolbar .commercial-actions-search { flex: 1 1 520px; max-width: 760px; }
.commercial-offer-followup-toolbar .commercial-actions-search input { width: 100%; }
.commercial-offer-followup-toolbar .ghost-btn { flex: 0 0 auto; }
.commercial-offer-columns-open { font-weight: 700; white-space: nowrap; }
.commercial-offer-columns-dialog { width: min(760px, calc(100vw - 32px)); max-width: 760px; padding: 0; border: 0; border-radius: 16px; overflow: hidden; background: var(--surface); box-shadow: 0 24px 80px rgb(15 23 42 / 35%); }
.commercial-offer-columns-dialog::backdrop { background: rgb(15 23 42 / 38%); backdrop-filter: blur(2px); }
.commercial-offer-columns-panel { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; max-height: min(760px, calc(100vh - 48px)); }
.commercial-offer-columns-panel > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 20px 22px 16px; border-bottom: 1px solid var(--line); }
.commercial-offer-columns-panel h2 { margin: 0; }
.commercial-offer-columns-panel header p { margin: 5px 0 0; color: var(--muted); }
.commercial-offer-columns-list { display: grid; gap: 8px; overflow: auto; padding: 14px 22px; background: var(--surface-soft); }
.commercial-offer-column-order-item { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto auto; align-items: center; gap: 12px; min-height: 58px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.commercial-offer-column-order-position { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--corp-soft); color: var(--corp); font-weight: 800; }
.commercial-offer-column-order-item strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.commercial-offer-column-order-position-select { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.commercial-offer-column-order-position-select select { width: 68px; min-height: 36px; padding: 4px 24px 4px 8px; }
.commercial-offer-column-order-actions { display: flex; gap: 6px; }
.commercial-offer-column-order-actions button { min-width: 108px; white-space: nowrap; }
.commercial-offer-columns-panel > footer { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); }
.commercial-offer-columns-status { flex: 1 1 auto; min-width: 0; color: var(--success); font-weight: 700; }
@media (max-width: 640px) {
  .commercial-offer-followup-toolbar { align-items: stretch; flex-wrap: wrap; }
  .commercial-offer-followup-toolbar .commercial-actions-search { flex-basis: 100%; }
  .commercial-offer-column-order-item { grid-template-columns: 34px minmax(0, 1fr) auto; }
  .commercial-offer-column-order-position-select { grid-column: 3; }
  .commercial-offer-column-order-actions { grid-column: 1 / -1; }
  .commercial-offer-column-order-actions button { flex: 1 1 0; min-width: 0; }
  .commercial-offer-columns-panel > footer { flex-wrap: wrap; }
  .commercial-offer-columns-status { flex-basis: 100%; }
}
.commercial-offer-horizontal-nav { display: grid; grid-template-columns: 38px minmax(0, 1fr) 38px; align-items: center; gap: 8px; width: 100%; margin: 0 0 6px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); }
.commercial-offer-horizontal-nav button { min-height: 28px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--corp); font-size: 22px; font-weight: 700; line-height: 1; cursor: pointer; }
.commercial-offer-horizontal-nav button:disabled { opacity: .38; cursor: default; }
.commercial-offer-horizontal-nav input[type="range"] { width: 100%; min-width: 0; accent-color: var(--corp); cursor: ew-resize; }
.commercial-offer-horizontal-nav.is-disabled { display: grid; }
.commercial-offer-followup-row { cursor: pointer; }
.commercial-offer-followup-row:hover td,
.commercial-offer-followup-row:focus-visible td { background: color-mix(in srgb, var(--corp-soft) 65%, var(--surface)); }
.commercial-offer-followup-row.is-smart-amber:hover td,
.commercial-offer-followup-row.is-smart-amber:focus-visible td { background:color-mix(in srgb, var(--offer-followup-amber) 92%, #000); color:var(--offer-followup-semantic-text); }
.commercial-offer-followup-row.is-smart-red:hover td,
.commercial-offer-followup-row.is-smart-red:focus-visible td { background:color-mix(in srgb, var(--offer-followup-red) 92%, #000); color:var(--offer-followup-semantic-text); }
.commercial-offer-followup-row.is-smart-blue:hover td,
.commercial-offer-followup-row.is-smart-blue:focus-visible td { background:color-mix(in srgb, var(--offer-followup-blue) 90%, #000); color:var(--offer-followup-semantic-text); }
.commercial-offer-followup-row.is-smart-green:hover td,
.commercial-offer-followup-row.is-smart-green:focus-visible td { background:color-mix(in srgb, var(--offer-followup-green) 90%, #000); color:var(--offer-followup-semantic-text); }
.commercial-offer-followup-row:focus-visible { outline: 2px solid var(--corp); outline-offset: -2px; }
.commercial-offer-followup-dialog { width: min(1180px, calc(100vw - 32px)); max-width: 1180px; padding: 0; border: 0; border-radius: 14px; }
.commercial-offer-followup-dialog form { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; max-height: min(900px, calc(100vh - 32px)); }
.commercial-offer-followup-dialog-scroll { overflow: auto; padding: 20px 24px 28px; }
.commercial-offer-followup-dialog-scroll > section + section { margin-top: 22px; }
.commercial-offer-preview-general { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.commercial-offer-preview-general article { min-width: 0; padding: 11px 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); }
.commercial-offer-preview-general span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 12px; font-weight: 700; }
.commercial-offer-preview-general strong { display: block; overflow-wrap: anywhere; }
.commercial-offer-preview-descriptions { display: grid; grid-template-columns: 1fr; gap: 14px; }
.commercial-offer-preview-descriptions article { min-width: 0; }
.commercial-offer-preview-text { min-height: 84px; padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-raised); color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.commercial-offer-followup-history { display:grid; gap:9px; }
.commercial-offer-followup-history > article { padding:11px 13px; border:1px solid var(--cxc-admin-note-border); border-radius:9px; background:var(--cxc-admin-note-bg); color:var(--cxc-admin-note-text); box-shadow:0 1px 3px rgba(53,46,132,.035); }
.commercial-offer-followup-history header { display:flex; justify-content:space-between; gap:12px; }
.commercial-offer-followup-history small { display:block; margin-top:3px; color:var(--muted); }
.commercial-offer-followup-history p { margin:7px 0 0; white-space:pre-wrap; overflow-wrap:anywhere; }
.commercial-offer-history-reason { width:fit-content; max-width:100%; margin-top:8px; padding:5px 8px; border-radius:7px; color:var(--corp); background:var(--surface); font-size:12px; font-weight:800; overflow-wrap:anywhere; }
.commercial-offer-history-reason.is-temporary { color:#8a5400; background:#fff4dc; }
.commercial-offer-history-reason.is-definitive { color:#9b1720; background:#fee8ea; }
.commercial-offer-followup-decision { padding: 16px; border: 1px solid var(--corp-soft); border-radius: 11px; background: color-mix(in srgb, var(--corp-soft) 36%, var(--surface)); }
.commercial-offer-followup-decision-grid { display: grid; grid-template-columns: minmax(280px, 1fr) auto; gap: 16px; align-items: end; }
.commercial-offer-followup-decision-grid label { display: grid; gap: 6px; }

@media (prefers-color-scheme: dark) {
  .commercial-actions-viewbar .primary-btn,
  .workshop-matrix-date.today { background: color-mix(in srgb, var(--corp) 65%, #000); color: #fff; }
  .commercial-identity-validator-tabs button.active { color: var(--text); }
  .workshop-summary .purchase-metric strong,
  .workshop-unit-card,
  .workshop-unit-card span { color: var(--text); }
}
.commercial-offer-temporary-reason { grid-column:1 / -1; padding:12px; border:1px solid #efc46c; border-radius:9px; background:#fff7e7; color:#704500; }
.commercial-offer-temporary-reason input:disabled { color:#704500; -webkit-text-fill-color:#704500; opacity:1; font-weight:800; background:#fffdf8; }
.commercial-offer-rejection-extra { display:grid; grid-template-columns:minmax(0, 1fr) minmax(220px, .55fr); gap:12px; align-items:end; margin-top:14px; padding:13px; border:1px solid var(--line); border-radius:9px; background:var(--surface); }
.commercial-offer-rejection-extra[hidden] { display:none; }
.commercial-offer-rejection-extra label { display:grid; gap:6px; }
.commercial-offer-rejection-details-panel { grid-template-rows:auto auto auto auto; overflow:visible; }
.commercial-offer-rejection-details-panel > div { display:grid; gap:12px; }
.commercial-offer-rejection-details-panel > div[hidden] { display:none; }
.commercial-offer-rejection-details-panel label { display:grid; gap:6px; }
.commercial-offer-reason-control { display:grid; grid-template-columns:minmax(0, 1fr) auto; gap:8px; }
.commercial-offer-reason-control .ghost-btn { white-space:nowrap; }
.commercial-offer-reason-picker { width:min(760px, calc(100vw - 40px)); max-width:760px; max-height:min(660px, calc(100vh - 64px)); padding:0; border:0; border-radius:16px; overflow:hidden; background:var(--surface); box-shadow:0 24px 80px rgb(15 23 42 / 35%); }
.commercial-offer-reason-picker::backdrop { background:rgb(15 23 42 / 38%); backdrop-filter:blur(2px); }
.commercial-offer-reason-picker-panel { display:grid; grid-template-rows:auto auto minmax(0, 1fr); gap:14px; max-height:min(660px, calc(100vh - 64px)); padding:20px; }
.commercial-offer-reason-picker-panel > header { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; }
.commercial-offer-reason-picker-panel h2 { margin:0; }
.commercial-offer-reason-picker-panel p { margin:4px 0 0; color:var(--muted); }
.commercial-offer-reason-picker-panel > input { width:100%; }
.commercial-offer-reason-results { min-height:240px; overflow:auto; border:1px solid var(--line); border-radius:10px; background:var(--surface); }
.commercial-offer-reason-results > button { display:grid; grid-template-columns:48px minmax(0, 1fr); gap:12px; width:100%; min-height:46px; padding:10px 14px; border:0; border-bottom:1px solid var(--line); background:var(--surface); color:var(--ink); text-align:left; cursor:pointer; }
.commercial-offer-reason-results > button:last-child { border-bottom:0; }
.commercial-offer-reason-results > button:hover,
.commercial-offer-reason-results > button:focus-visible { background:color-mix(in srgb, var(--corp-soft) 60%, white); outline:none; }
.commercial-offer-reason-results strong,
.commercial-offer-reason-results span { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; line-height:1.45; }
.commercial-offer-reason-results strong { color:var(--corp); }
.commercial-offer-reason-results .commercial-briefing-empty { margin:0; padding:18px; }
.commercial-offer-followup-editor { padding-top: 2px; border-top: 1px solid var(--line); }
.commercial-offer-followup-contact-grid { margin-top: 16px; }
.commercial-offer-followup-note { display: grid; gap: 6px; margin-top: 16px; }
.commercial-offer-followup-note textarea { width: 100%; resize: vertical; }
@media (max-width: 900px) {
  .commercial-offer-preview-general { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .commercial-offer-followup-decision-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .commercial-actions-table tr.is-smart-claim-pulse td,
  .commercial-offer-followup-legend i.pulse,
  .commercial-offer-followup-legend i.amber-pulse { animation:none; }
}

/* Administrative renewal states: labels convey the same meaning as colour. */
[data-po-table] .po-review-needed { background: color-mix(in srgb, var(--red) 12%, var(--surface)); }
[data-po-table] .po-offer-ready { background: color-mix(in srgb, #e5b800 18%, var(--surface)); }
[data-po-review-editor] label, [data-po-review-editor] button { display: block; margin-block: 8px; }
[data-po-review-editor] select { max-width: 280px; min-width: 180px; }
[data-po-table] td { min-width: 110px; }
[data-po-table] [data-po-review-status] { white-space: normal; }

[data-po-table] .primary-btn { margin-block: 6px; box-shadow: none; }
[data-po-table] .po-help { max-width: 24em; white-space: normal; margin: 6px 0; color: var(--muted); font-size: 12px; }
[data-po-table] [data-po-contact-editor] { min-width: 240px; max-width: 320px; }
[data-po-table] [data-po-contact-editor] summary { color: var(--blue-dark); font-weight: 600; cursor: pointer; padding-block: 8px; }
[data-po-table] .po-contact-panel { background: var(--badge-blue-bg); color: var(--text); border: 1px solid var(--line); border-radius: var(--workspace-radius); padding: 12px; }
[data-po-table] .po-contact-panel > label { display: block; }
[data-po-table] .po-contact-panel input[type="search"] { width: 100%; min-width: 0; min-height: var(--workspace-control-height); background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--workspace-radius); padding: 6px; }
[data-po-table] .po-contact-panel fieldset { border: 0; margin: 8px 0; padding: 0; min-width: 0; }
[data-po-table] .po-contact-list { max-height: 240px; overflow: auto; overscroll-behavior: contain; }
[data-po-table] .po-contact-list label { align-items: flex-start; padding: 8px; border-bottom: 1px solid var(--line); cursor: pointer; white-space: normal; }
[data-po-table] .po-contact-list label[hidden] { display: none; }
[data-po-table] .po-contact-list label:has(input:checked) { background: var(--surface); border-left: 3px solid var(--blue); }
[data-po-table] .po-contact-list input { flex: 0 0 auto; margin-top: 4px; }
[data-po-table] .po-contact-list span { overflow-wrap: anywhere; }
[data-po-table] .po-contact-list label > span { display: block; min-width: 0; }
[data-po-table] .po-recipients { max-height: 150px; overflow: auto; }
[data-po-table] .po-recipients > div { padding-bottom: 6px; }

.po-template-grid { grid-template-columns: minmax(0, 1fr); }
.po-template-form { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto; }
.po-template-form .documents-template-title, .po-template-global { grid-column: 1 / -1; }
.po-template-form fieldset { min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.po-template-form fieldset label { margin-block: 10px; }
.po-template-form legend { font-weight: 700; }
.po-template-form textarea { min-height: 180px; height: auto; }
[data-po-table] { width: 100%; min-width: 1620px; table-layout: fixed; }
[data-po-table] th:nth-child(1) { width: 72px; }
[data-po-table] th:nth-child(2) { width: 125px; }
[data-po-table] th:nth-child(3) { width: 250px; }
[data-po-table] > thead > tr > th:nth-child(4) { width: 100px; }
[data-po-table] > thead > tr > th:nth-child(5), [data-po-table] > thead > tr > th:nth-child(6), [data-po-table] > thead > tr > th:nth-child(7) { width: 125px; }
[data-po-table] > thead > tr > th:nth-child(8) { width: 165px; }
[data-po-table] > thead > tr > th:nth-child(9) { width: 250px; }
[data-po-table] > thead > tr > th:nth-child(10) { width: 255px; }
[data-po-table] details > summary { cursor: pointer; color: var(--blue-dark); padding-block: 8px; }
[data-po-table] [data-po-frequency] { width: 90px; }
[data-po-table] td:first-child { min-width: 0; }
.po-batch-result { white-space: pre-line; }
[data-po-table] .mail-status { white-space: normal; }
@media (max-width: 700px) { .po-template-form { grid-template-columns: minmax(0, 1fr); } }

@media (prefers-color-scheme: dark) {
  [data-po-table] .primary-btn { background: color-mix(in srgb, var(--corp) 65%, #000); color: #fff; }
}

/* Density is scoped to O.C.; DTV retains its own typography. */
[data-po-table] td, [data-po-table] td strong { font-size: 13px; line-height: 1.3; }
[data-po-table] td span, [data-po-table] summary, [data-po-table] label, [data-po-table] button { font-size: 12px; line-height: 1.3; }
[data-po-table] td { padding: 10px 8px; }
[data-po-table] .po-recipients { max-height: 110px; }
[data-po-table] [data-po-review-editor] label { display: flex; align-items: center; gap: 6px; }
[data-po-table] [data-po-offer-number] { width: 100%; min-width: 0; padding: 6px; font-size: 13px; }
[data-po-table] [data-po-review-editor] .primary-btn { padding: 6px 10px; }

/* O.C. compact controls and calendar states, independent from DTV. */
[data-po-table] .po-recipients strong, [data-po-table] .po-recipients span,
[data-po-table] .po-contact-list strong, [data-po-table] .po-contact-list span { font-size: 12px; line-height: 1.3; }
[data-po-table] [data-po-offer-number] { width: 150px; max-width: 100%; min-height: 28px; height: 28px; padding: 4px 6px; font-size: 12px; }
[data-po-table] [data-po-refresh-offer] { min-height: 28px; padding: 4px 8px; font-size: 12px; line-height: 1.2; }
[data-po-table] .po-calendar-waiting { background: var(--surface); }
[data-po-table] .po-sent-today { background: color-mix(in srgb, var(--muted) 16%, var(--surface)); color: var(--muted); }
@keyframes po-missing-mail { 0%,100% { background: color-mix(in srgb, var(--green) 10%, var(--surface)); } 50% { background: color-mix(in srgb, var(--red) 14%, var(--surface)); } }
[data-po-table] .po-missing-mail-pulse { animation: po-missing-mail 3s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { [data-po-table] .po-missing-mail-pulse { animation: none; background: color-mix(in srgb, var(--green) 10%, var(--surface)); border-left: 3px solid var(--red); } }
[data-po-contract-details] summary { white-space: nowrap; }
[data-po-table] .po-contract-breakdown { position: relative; width: min(900px, 75vw); max-height: 420px; overflow: auto; background: var(--surface); border: 1px solid var(--line); }
[data-po-table] .po-contract-breakdown table { width: 100%; table-layout: fixed; }
[data-po-table] .po-contract-breakdown th:nth-child(1) { width: 100px; }
[data-po-table] .po-contract-breakdown th:nth-child(2) { width: 160px; }
[data-po-table] .po-contract-breakdown th:nth-child(3) { width: 50%; }
[data-po-table] .po-contract-breakdown th:nth-child(4) { width: auto; }
[data-po-table] .po-contract-breakdown td { min-width: 0; white-space: normal; overflow-wrap: anywhere; vertical-align: top; }

[data-po-table] .po-contract-detail-row > td { padding: 0 8px 4px 80px; }
[data-po-table] .po-contract-breakdown { width: 100%; max-height: 420px; }
[data-po-table] [data-po-contract-details] summary { padding: 4px 0; }

[data-po-table] [data-po-save-offer] { min-height:28px; padding:4px 8px; font-size:12px; }

[data-po-table] [data-po-undo] { min-height:26px; padding:4px 6px; font-size:11px; margin-top:5px; }

/* Manual O.C.: contenido de lectura protegido, composición común de Manuales. */
.manual-oc-capture img { max-width: 100%; width: auto; max-height: 440px; object-fit: contain; justify-self: start; }
.manual-oc-capture figcaption { color: #6f7d91; font-size: 12px; }
.manual-oc-table { overflow-x: auto; }
.manual-oc-table table { border-collapse: collapse; width: 100%; margin: 12px 0; font-size: 13px; color: #243044; }
.manual-oc-table th, .manual-oc-table td { padding: 10px 12px; border-bottom: 1px solid #d9e2ef; text-align: left; }
.manual-oc-table th { background: #f2f6fb; color: #3a4860; }
.manual-section h4 { color: #34435a; font-size: 14px; margin: 18px 0 8px; }

/* Manual O.C.: examples share their functional colors, with reduced-motion fallback. */
.manual-oc-state-due { background: #eaf5ef; }
.manual-oc-state-waiting { background: #fff; }
.manual-oc-state-done { background: #e9edf1; }
.manual-oc-state-pulse { background: #eaf5ef; animation: manual-oc-pulse 2.8s ease-in-out infinite alternate; }
@keyframes manual-oc-pulse { from { background-color: #eaf5ef; } to { background-color: #fbe3e5; } }
@media (prefers-reduced-motion: reduce) { .manual-oc-state-pulse { animation: none; background: linear-gradient(90deg,#eaf5ef 50%,#fbe3e5 50%); } }
.manual-oc-notice { border-left: 4px solid #b48737; background: #fff7e8; padding: 14px 18px; margin: 12px 0 20px; border-radius: 6px; color: #594a30; }
.manual-oc-notice p { margin-bottom: 0; }
.manual-oc-message { padding: 14px 18px; background: #f5f7fa; border: 1px solid #d9e2ef; border-radius: 8px; font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; }
.manual-oc-templates img { max-height: none; width: 100%; }

/* O.C. headers stay visible within the operational table viewport. */
.po-table-scroll { max-height: min(65vh, 720px); overflow: auto; overscroll-behavior: contain; }
[data-po-table] > thead > tr > th { position: sticky; top: 0; z-index: 2; background: var(--surface); box-shadow: 0 1px 0 var(--line); }

.integrity-competitor-search { display:flex; gap:12px; align-items:end; margin-top:18px; }
.integrity-competitor-search label { display:grid; gap:6px; min-width:0; flex:1; }



#integrityCompetitorPanel { min-width:0; }
#integrityCompetitorPanel input[type=text] { width:180px; max-width:none; }
#integrityCompetitorPanel input[aria-invalid=true] { border:2px solid var(--red); background:color-mix(in srgb, var(--red) 8%, var(--surface)); box-shadow:0 0 0 2px color-mix(in srgb, var(--red) 18%, transparent); }
#integrityCompetitorPanel .integrity-row-actions, #integrityCompetitorPanel th:last-child { position:sticky; right:0; background:var(--surface); min-width:165px; }
#integrityCompetitorPanel .integrity-row-actions button { margin:3px; }

#integrityCompetitorPanel input:not([type=checkbox]) { min-height:var(--workspace-control-height); padding:6px 10px; border:1px solid var(--line); border-radius:var(--workspace-radius); background:var(--field); color:var(--text); font:inherit; box-sizing:border-box; }
#integrityCompetitorPanel input[aria-invalid=true] { border:2px solid var(--red); background:color-mix(in srgb, var(--red) 8%, var(--surface)); }
#integrityCompetitorPanel th, #integrityCompetitorPanel td { min-width:120px; }
#integrityCompetitorPanel th:first-child, #integrityCompetitorPanel td:first-child { min-width:185px; }
#integrityCompetitorPanel .integrity-row-actions { z-index:1; }
#integrityCompetitorPanel th:last-child { z-index:2; }

/* SMART prospects retain their shared code without claiming official status. */
.commercial-suggestions button.potential { background: #fff3cd; border-color: #c59b28; color: #654b00; }
.commercial-identity-field > span.potential { color: #876000; }
.commercial-identity-field > span.provisional { color: var(--text-muted, #64748b); }

.commercial-identity-validator-option.potential { background: #fff3cd; border-color: #c59b28; }
.commercial-identity-validator-status.potential { color: #654b00; background: #ffecae; }

.workshop-unquantified { flex: 0 0 auto; min-width: 0; }
.workshop-unquantified summary { cursor: pointer; font-weight: 600; }
.workshop-unquantified p { margin: 6px 0 10px; }
.workshop-unquantified-scroll { max-height: 220px; overflow: auto; overscroll-behavior: contain; }
.workshop-unquantified table { width: 100%; border-collapse: collapse; background: var(--panel, #fff); }
.workshop-unquantified th, .workshop-unquantified td { text-align: left; padding: 8px 12px; border-bottom: 1px solid #d8e1eb; vertical-align: top; }
.workshop-unquantified th { position: sticky; top: 0; background: #f3f6fa; }
.workshop-unquantified td { overflow-wrap: anywhere; }
.workshop-unquantified td:not(:nth-last-child(2)), .workshop-unquantified th { white-space: nowrap; overflow-wrap: normal; }
.workshop-unquantified td:nth-last-child(2) { min-width: 220px; }

/* Cargos a clientes: initial list structure, shared Workspace scale. */
.charges-module { min-width: 0; }
.charges-module[hidden] { display: none; }
.charges-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.charges-scroll-controls { display: flex; gap: 4px; margin: 8px 0; }
.charges-grid { max-width: 100%; overflow: auto; overscroll-behavior: contain; }
.charges-grid table { table-layout: fixed; width: 1490px; border-collapse: collapse; }
.charges-grid th, .charges-grid td { text-align: left; padding: 8px; border: 1px solid var(--line); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.charges-source { margin-top: 12px; overflow-wrap: anywhere; }
.charges-source p { margin: 8px 0; }

/* Charge evaluation uses the Workspace list/detail grammar and local scroll. */
.charges-module .charges-grid { max-height: 58vh; overscroll-behavior: contain; }
.charges-module .charges-grid th { position: sticky; top: 0; background: var(--surface, Canvas); z-index: 1; }
.charges-module .charges-detail { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); }
.charges-module .charges-detail-toolbar { flex: 0 0 auto; padding: 8px; border-bottom: 1px solid var(--line); }
.charges-module .charges-detail-body { flex: 1; min-height: 0; overflow: auto; padding: 8px; }
.charges-module [hidden] { display: none !important; }
.charges-module .charges-detail h3 { font-size: 17px; margin: 12px 0; }
.charges-module .charges-detail h4 { font-size: 14px; margin: 12px 0 8px; }
.charges-module .charges-detail .charges-grid table { table-layout: auto; width: 100%; min-width: 700px; }
.charges-module .charges-detail .charges-grid td { white-space: normal; overflow-wrap: anywhere; }
.charges-module .charges-concept-grid table { table-layout: fixed; width: 850px; }
.charges-module .charges-concept-grid th:nth-child(1) { width: 130px; }
.charges-module .charges-concept-grid th:nth-child(2) { width: 450px; }
.charges-module .charges-concept-grid th:nth-child(3) { width: 150px; }
.charges-module .charges-concept-grid th:nth-child(4) { width: 120px; }
.charges-module .charges-concept-grid input { width: 100%; min-width: 0; box-sizing: border-box; }
.charges-module .charges-times { display: flex; flex-wrap: wrap; gap: 16px; margin: 12px 0; }
.charges-module .charges-times label { display: grid; gap: 4px; }
.charges-module .charges-detail textarea { display: block; width: min(100%,700px); min-height: 64px; margin: 4px 0 12px; box-sizing: border-box; }
.charges-module .charges-detail input, .charges-module button { min-height: 28px; }
.charges-module .board-toolbar input { min-width: 0; max-width: 100%; }
.charges-module .board-toolbar > label { flex: 1; min-width: 0; }
.charges-module .board-toolbar > label input { box-sizing: border-box; }
.charges-module .board-toolbar { flex: 0 0 auto; }
.charges-module .charges-state[data-state="SOLICITADO"] { color: var(--warning-text, #9c5c00); font-weight: 600; }
.charges-module .charges-state[data-state="APROBADO"] { color: var(--success-text, #278348); font-weight: 600; }
.charges-module .charges-state[data-state="DENEGADO"] { color: var(--danger-text, #ba3345); font-weight: 600; }
.charges-module .charges-field-invalid { color: var(--red); }
.charges-module [aria-invalid="true"] {
  border: 2px solid var(--red);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--red) 18%, transparent);
  background: color-mix(in srgb, var(--red) 8%, var(--field));
}
.charges-module { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.charges-module > .charges-toolbar, .charges-module > .module-subnav, .charges-module > .active-filter { flex: 0 0 auto; }
.charges-module [data-charges-list] { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.charges-module [data-charges-list] > .charges-grid { flex: 1; min-height: 0; max-height: none; }
.charges-module .charges-detail { flex: 1; min-height: 0; max-height: none; overscroll-behavior: contain; }
.charges-module .charges-source { flex: 0 0 auto; max-height: 25vh; overflow: auto; }
.charges-module .charges-actions { justify-content: flex-end; gap: 8px; }

.charges-module summary { min-height: 28px; box-sizing: border-box; padding-block: 4px; }
@media (prefers-color-scheme: dark) { .charges-module .primary-btn { background: color-mix(in srgb, var(--corp) 65%, #000); color: #fff; } }

/* Optional RV evidence panel; typography and controls inherit Workspace. */
.charges-editor-pane { min-width:0; }
.charges-module .charges-detail-with-documents { display:grid; grid-template-columns:minmax(0,1.03fr) minmax(0,1fr); gap:16px; overflow:hidden; }
.charges-detail-with-documents > .charges-editor-pane { min-height:0; overflow:auto; padding-right:8px; overscroll-behavior:contain; }
.charges-detail-with-documents > .charges-document-panel { height:100%; min-height:0; min-width:0; align-self:stretch; }
.charges-rv-record { margin-top:12px; padding-left:8px; border-left:2px solid transparent; }
.charges-rv-record.is-selected { border-left-color:var(--corp); }
.charges-rv-record button[aria-pressed=true] { border-color:var(--corp); font-weight:700; }
.charges-document-panel { display:grid; grid-template-rows:auto auto auto minmax(0,1fr) auto; height:min(720px,calc(100dvh - 280px)); min-height:340px; box-sizing:border-box; border:1px solid var(--line); padding:12px; background:var(--surface); }
.charges-document-actions { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.charges-document-panel button { min-height:32px; }
.charges-document-panel [role=status] { margin:8px 0; overflow-wrap:anywhere; }
.charges-document-stage { min-height:0; overflow:auto; overscroll-behavior:contain; background:var(--field); padding:8px; box-sizing:border-box; }
.charges-document-panel:has(.charges-document-stage:empty) { height:auto; min-height:0; }
.charges-document-stage:empty { height:0; min-height:0; padding:0; }
.charges-document-stage canvas, .charges-document-stage img { display:block; max-width:none; margin:auto; }
.charges-document-thumbnails { display:flex; gap:8px; max-width:100%; overflow-x:auto; padding:8px 0; overscroll-behavior:contain; }
.charges-document-thumbnail { flex:0 0 112px; width:112px; white-space:normal; overflow-wrap:anywhere; display:flex; flex-direction:column; align-items:center; gap:4px; }
.charges-document-mini { display:flex; align-items:center; justify-content:center; height:100px; width:100px; overflow:hidden; }
.charges-document-mini canvas, .charges-document-mini img { max-width:100%; max-height:100%; object-fit:contain; }
.charges-document-thumbnail[aria-pressed=true] { border:2px solid var(--corp); }
@media (max-width:999px) {
  .charges-module .charges-detail-with-documents { grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(120px,2fr) minmax(280px,3fr); gap:8px; }
  .charges-detail-with-documents .charges-document-mini { height:56px; }
  .charges-detail-with-documents .charges-document-thumbnail { flex-basis:88px; width:88px; }
  .charges-detail-with-documents .charges-document-panel { padding:8px; }
}

/* RV source uses the existing Security card and controls. */
.security-rv-source-panel { grid-column:1 / -1; }
.security-rv-source-form { grid-template-columns:minmax(0,1fr); }
.security-rv-source-form input[type="text"] { width:100%; box-sizing:border-box; }
.security-rv-source-form label:has(input[type="checkbox"]) { display:flex;align-items:center;gap:8px; }
.security-rv-source-form input[type="checkbox"] { width:auto; }
@media (min-width:700px) {
 .security-rv-source-form { grid-template-columns:minmax(0,1fr) auto auto auto; }
 .security-rv-source-form label:first-child {grid-column:1 / -1;}
}

@media (max-width:800px) {
 .security-purchase-layout:has(.security-rv-source-panel) {grid-template-columns:minmax(0,1fr);}
}

.charges-document-panel [role=status]:empty { margin:0; }

@media (max-width:999px) {
 .charges-document-panel > .charges-document-actions { max-height:80px; overflow:auto; align-content:flex-start; }
}

.charges-document-panel > h4 { margin:0 0 8px; }
@media (max-width:999px) {
 .charges-detail-with-documents .charges-document-mini { height:40px; }
 .charges-document-thumbnail > span:last-child { max-width:100%; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
}

.rv-reader-download-nav { border-top: 1px solid var(--border, #ccd6e0); margin-top: 16px; padding-top: 16px; }
#rvReaderDownloadModule .security-document-form { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
#rvReaderDownloadModule .security-document-form label { flex: 0 1 auto; min-width: 0; max-width: 100%; }
#rvReaderDownloadModule select, #rvReaderDownloadModule .primary-btn { height: auto; min-height: var(--workspace-control-height); line-height: 1.4; padding: .4em .65em; max-width: 100%; }
#rvReaderDownloadModule .primary-btn { white-space: normal; }

/* One action bar for all three Documentos profiles. */
.documents-common-actions { flex-wrap: wrap; }
.documents-action-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin-left: auto; }
[data-document-operation-note]:not(:empty) { margin: 8px 0; color: var(--muted); }

[data-dtv-claim-row] > td:nth-child(5),
[data-dtv-claim-row] > td:nth-child(6),
[data-dtv-claim-row] > td:nth-child(7),
[data-forecast-claim-row] > td:nth-child(9),
[data-forecast-claim-row] > td:nth-child(10) { white-space: nowrap; }
[data-dtv-claim-row] > td:nth-child(9) { max-width: 300px; }
.documents-action-buttons > button:disabled { opacity: .55; cursor: not-allowed; }

.documents-forecast-table { min-width: 1380px; }
.documents-forecast-table td:nth-child(5),
.documents-forecast-table td:nth-child(6),
.documents-forecast-table td:last-child { white-space: nowrap; }
