/* ============================================================
   АСТ Світлотехніка — AI-консультант Manager UI v2.0
   ============================================================ */
:root {
  --color-primary:       #1a1f6e;
  --color-purple:        #4a3fbf;
  --color-purple-hover:  #6c5ce7;
  --color-bg:            #f8f8f6;
  --color-surface:       #ffffff;
  --color-border:        #e8e8ec;
  --color-text:          #2d2d3a;
  --color-text-muted:    #6b6b7a;
  --color-success:       #2e7d52;
  --color-success-bg:    #e8f5ee;
  --color-warning:       #c47b2b;
  --color-warning-bg:    #fef3e2;
  --color-error:         #c0392b;
  --color-error-bg:      #fdecea;
  --color-info:          #1a6ea0;
  --color-info-bg:       #e6f2fa;
  --color-tag-bg:        #e8e8f4;
  --color-tag-text:      #4a3fbf;
  --color-input-border:  #c8c8d4;
  --color-input-focus:   #4a3fbf;
  --radius-sm:           4px;
  --radius-md:           6px;
  --radius-lg:           8px;
  --font-main:           'IBM Plex Sans', sans-serif;
  --font-mono:           'IBM Plex Mono', monospace;
  --sp-xs: 4px;
  --sp-sm: 8px;
  --sp-md: 16px;
  --sp-lg: 24px;
  --sp-xl: 40px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  min-height: 100vh;
}
button, input, select, textarea { font-family: inherit; }
.container { max-width: 1480px; margin: 0 auto; padding: 0 32px; }
[hidden] { display: none !important; }

.header {
  background: var(--color-primary);
  color: white;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(26,31,110,0.25);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.header-brand { display: flex; align-items: center; gap: var(--sp-md); }
.header-logo { flex-shrink: 0; opacity: 0.9; }
.header-text { display: flex; flex-direction: column; gap: 1px; }
.header-company { font-size: 17px; font-weight: 700; line-height: 1; letter-spacing: 0.2px; }
.header-subtitle { font-size: 11px; font-weight: 400; opacity: 0.62; line-height: 1; letter-spacing: 0.3px; }
.header-status { display: flex; align-items: center; gap: var(--sp-sm); }
.status-badge { display: flex; align-items: center; gap: 6px; font-size: 12px; background: rgba(255,255,255,0.12); padding: 4px 10px; border-radius: 20px; font-weight: 500; white-space: nowrap; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #aaa; flex-shrink: 0; }
.status-dot.connected { background: #4caf82; }
.status-dot.mock { background: #f0c040; }
.status-dot.error { background: #e55; }
.status-dot.checking { background: #9ea6ff; }
.mode-badge { font-size: 11px; background: rgba(255,255,255,0.15); padding: 3px 8px; border-radius: 3px; font-weight: 500; letter-spacing: 0.2px; }

.btn-icon { background: none; border: none; color: rgba(255,255,255,0.75); cursor: pointer; padding: 6px; border-radius: var(--radius-sm); display: inline-flex; align-items: center; justify-content: center; transition: color 0.15s, background 0.15s; }
.btn-icon:hover { color: white; background: rgba(255,255,255,0.12); }
.btn-icon.dark { color: var(--color-text-muted); }
.btn-icon.dark:hover { color: var(--color-error); background: var(--color-error-bg); }

.settings-panel { background: var(--color-surface); border-bottom: 1px solid var(--color-border); padding: var(--sp-md) 0; animation: slideDown 0.18s ease; }
.settings-inner { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-md); }
.settings-inner h4 { width: 100%; font-size: 14px; font-weight: 700; color: var(--color-primary); }
.settings-row { display: flex; align-items: center; gap: var(--sp-sm); }
.settings-row label { font-size: 13px; color: var(--color-text-muted); white-space: nowrap; }
.settings-row input, .settings-row select { height: 34px; border: 1px solid var(--color-input-border); border-radius: var(--radius-sm); padding: 0 10px; color: var(--color-text); background: white; }
.settings-row-wide input { width: 330px; }
.settings-actions { display: flex; gap: var(--sp-sm); margin-left: auto; }

.workspace {
  display: grid;
  grid-template-columns: minmax(620px, 1fr) 520px;
  gap: var(--sp-lg);
  padding-top: var(--sp-lg);
  padding-bottom: var(--sp-lg);
  min-height: calc(100vh - 100px);
}
.search-workzone { display: flex; flex-direction: column; gap: var(--sp-md); min-width: 0; }
.search-panel, .selection-panel, .section-results, .clarification-block, .error-block {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}
.search-panel { padding: 18px 20px; }
.search-panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-md); margin-bottom: var(--sp-md); }
.search-panel-heading h1 { font-size: 24px; font-weight: 700; color: var(--color-primary); line-height: 1.2; }
.search-panel-heading p { font-size: 13px; color: var(--color-text-muted); margin-top: 4px; }

.bulk-upload-btn { display: inline-flex; align-items: center; gap: 7px; border: 1.5px solid var(--color-purple); color: var(--color-purple); background: white; border-radius: var(--radius-sm); padding: 8px 12px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.bulk-upload-btn:hover { background: rgba(74,63,191,0.07); }

.search-command-row { display: grid; grid-template-columns: minmax(260px, 1fr) auto auto auto; gap: var(--sp-sm); align-items: stretch; }
.search-input-wrap { display: flex; align-items: center; height: 46px; background: white; border: 1.5px solid var(--color-input-border); border-radius: var(--radius-md); overflow: hidden; }
.search-input-wrap:focus-within { border-color: var(--color-input-focus); box-shadow: 0 0 0 3px rgba(74,63,191,0.10); }
.search-icon { margin: 0 12px; color: var(--color-text-muted); flex-shrink: 0; }
.search-input { width: 100%; height: 100%; border: none; outline: none; font-size: 15px; color: var(--color-text); padding-right: 8px; }
.search-input::placeholder { color: var(--color-text-muted); }
.search-clear-btn {
  width: 30px; height: 30px; margin-right: 8px; border: none; border-radius: 999px;
  background: #eef1f7; color: var(--color-text-muted); font-size: 20px; line-height: 1; cursor: pointer;
}
.search-clear-btn:hover { background: #dfe5f0; color: var(--color-text); }
.error-primary-detail { display: block; margin-top: 4px; font-weight: 500; color: var(--color-danger, #b42318); }

.search-action { height: 46px; }
.toggle-action { height: 46px; border-radius: var(--radius-sm); padding: 0 16px; border: 1.5px solid var(--color-input-border); background: white; color: var(--color-text); font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.toggle-action.active { background: var(--color-success-bg); border-color: var(--color-success); color: var(--color-success); }

.btn-primary, .btn-secondary, .btn-neutral, .btn-danger {
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn-primary { background: var(--color-purple); color: white; border: none; text-transform: uppercase; letter-spacing: 0.25px; }
.btn-primary:hover { background: var(--color-purple-hover); }
.btn-secondary { background: transparent; color: var(--color-purple); border: 1.5px solid var(--color-purple); }
.btn-secondary:hover { background: rgba(74,63,191,0.07); }
.btn-neutral { background: white; color: var(--color-text); border: 1px solid var(--color-border); }
.btn-neutral:hover { border-color: var(--color-purple); color: var(--color-purple); }
.btn-danger { background: var(--color-error-bg); color: var(--color-error); border: 1px solid rgba(192,57,43,0.24); }
.btn-danger:hover { background: #f9dcd8; }
.btn-text { background: none; border: none; color: var(--color-purple); font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: underline; }
.btn-sm { font-size: 13px !important; padding: 6px 12px !important; text-transform: none !important; letter-spacing: 0 !important; }
.btn-full { width: 100%; }

.clarification-block { padding: var(--sp-md) 20px; border-left: 4px solid var(--color-purple); background: rgba(74,63,191,0.04); animation: fadeIn 0.2s ease; }
.clarification-header { display: flex; align-items: center; gap: var(--sp-sm); margin-bottom: var(--sp-sm); }
.clarification-title { font-size: 14px; font-weight: 700; color: var(--color-primary); flex: 1; }
.clarification-message { font-size: 14px; color: var(--color-text); margin-bottom: var(--sp-md); }
.clarification-questions { display: flex; flex-direction: column; gap: var(--sp-md); }
.clarification-q-text { font-size: 14px; font-weight: 600; margin-bottom: var(--sp-sm); }
.clarification-options { display: flex; flex-wrap: wrap; gap: var(--sp-sm); }
.option-chip { background: white; border: 1.5px solid var(--color-border); color: var(--color-text); border-radius: 20px; padding: 5px 14px; font-size: 13px; cursor: pointer; }
.option-chip.selected, .option-chip:hover { background: var(--color-purple); border-color: var(--color-purple); color: white; }
.clarification-actions { margin-top: var(--sp-md); display: flex; justify-content: flex-end; }

.error-block { padding: var(--sp-md) 20px; border-left: 4px solid var(--color-error); background: var(--color-error-bg); animation: fadeIn 0.2s ease; }
.error-header { color: var(--color-error); font-weight: 700; margin-bottom: var(--sp-sm); }
.error-actions { display: flex; gap: var(--sp-sm); flex-wrap: wrap; }
.error-details { margin-top: var(--sp-sm); background: rgba(0,0,0,0.04); border-radius: var(--radius-sm); padding: var(--sp-sm); font-family: var(--font-mono); font-size: 12px; white-space: pre-wrap; word-break: break-word; max-height: 180px; overflow: auto; }

.section-results { padding: 0; overflow: hidden; animation: fadeIn 0.25s ease; }
.results-header { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-sm); padding: var(--sp-md) 20px; border-bottom: 1px solid var(--color-border); }
.results-meta { display: flex; align-items: center; gap: var(--sp-sm); }
.results-count { font-size: 16px; font-weight: 700; color: var(--color-primary); }
.results-mode-badge { font-size: 11px; font-weight: 700; background: var(--color-tag-bg); color: var(--color-tag-text); padding: 3px 8px; border-radius: 3px; text-transform: uppercase; letter-spacing: 0.3px; }
.results-mode-badge.mock { background: #fff3cd; color: #856404; }
.table-wrapper { overflow: auto; max-height: calc(100vh - 235px); }
.results-table { width: 100%; border-collapse: collapse; background: var(--color-surface); font-size: 13px; }
.results-table thead { position: sticky; top: 0; z-index: 3; }
.results-table thead tr:first-child { background: var(--color-primary); color: white; }
.results-table th { padding: 10px 10px; text-align: left; font-size: 12px; font-weight: 700; white-space: nowrap; }
.results-table td { padding: 9px 10px; border-bottom: 1px solid var(--color-border); vertical-align: middle; }
.results-table tbody tr:hover { background: rgba(74,63,191,0.03); }
.filter-row { background: #f3f3f7; }
.filter-row th { padding: 6px 8px; }
.column-filter { width: 100%; height: 28px; border: 1px solid var(--color-input-border); border-radius: var(--radius-sm); padding: 0 7px; font-size: 12px; color: var(--color-text); outline: none; }
.column-filter:focus { border-color: var(--color-purple); }
.td-num { color: var(--color-text-muted); text-align: center; width: 32px; }
.td-sku { font-family: var(--font-mono); color: var(--color-primary); font-weight: 600; white-space: nowrap; }
.td-name { font-weight: 600; min-width: 190px; }
.td-brand, .td-supplier, .td-currency { color: var(--color-text-muted); white-space: nowrap; }
.td-price { font-weight: 700; white-space: nowrap; }
.qty-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; padding: 3px 7px; border-radius: 3px; font-size: 12px; font-weight: 700; }
.qty-ok { background: var(--color-success-bg); color: var(--color-success); }
.qty-low { background: var(--color-warning-bg); color: var(--color-warning); }
.qty-zero { background: var(--color-error-bg); color: var(--color-error); }
.comment-tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 3px; text-transform: uppercase; letter-spacing: 0.25px; }
.comment-exact { background: var(--color-success-bg); color: var(--color-success); }
.comment-analog { background: var(--color-info-bg); color: var(--color-info); }
.comment-cheaper { background: var(--color-warning-bg); color: var(--color-warning); }
.comment-missing { background: var(--color-error-bg); color: var(--color-error); }
.comment-manager { background: var(--color-tag-bg); color: var(--color-tag-text); }
.btn-add-row { background: transparent; border: 1.5px solid var(--color-purple); color: var(--color-purple); border-radius: var(--radius-sm); padding: 5px 10px; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.btn-add-row:hover { background: rgba(74,63,191,0.08); }
.not-found { padding: var(--sp-xl); color: var(--color-text-muted); text-align: center; }
.results-cards { display: none; }

.selection-panel {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 100px);
  max-height: calc(100vh - 100px);
  position: sticky;
  top: 76px;
  overflow: hidden;
}
.selection-header { background: var(--color-primary); color: white; padding: var(--sp-md) 18px; display: flex; align-items: center; justify-content: space-between; }
.selection-header h2 { font-size: 17px; line-height: 1.2; }
.selection-header span { display: block; font-size: 12px; opacity: 0.68; margin-top: 2px; }
.order-fields { padding: var(--sp-md); display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-sm); border-bottom: 1px solid var(--color-border); }
.order-fields label { display: flex; flex-direction: column; gap: 4px; }
.order-fields span { font-size: 12px; color: var(--color-text-muted); font-weight: 600; }
.order-fields input { height: 34px; border: 1.5px solid var(--color-input-border); border-radius: var(--radius-sm); padding: 0 9px; font-size: 13px; color: var(--color-text); outline: none; }
.order-fields input:focus { border-color: var(--color-purple); box-shadow: 0 0 0 3px rgba(74,63,191,0.09); }
.discount-field { grid-column: 1 / -1; }
.discount-row { display: grid; grid-template-columns: 1fr auto; gap: var(--sp-sm); }
.selection-tools { padding: 10px var(--sp-md); border-bottom: 1px solid var(--color-border); }
.selected-table-wrap { flex: 1; overflow: auto; background: white; }
.selected-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.selected-table thead { position: sticky; top: 0; z-index: 2; background: #f3f3f7; }
.selected-table th { padding: 8px 7px; text-align: left; color: var(--color-primary); font-weight: 700; border-bottom: 1px solid var(--color-border); }
.selected-table td { padding: 7px; border-bottom: 1px solid var(--color-border); vertical-align: top; }
.selected-sku { font-family: var(--font-mono); color: var(--color-primary); font-weight: 700; display: block; margin-bottom: 2px; }
.selected-name { font-weight: 600; display: block; line-height: 1.25; }
.selected-meta { color: var(--color-text-muted); display: block; margin-top: 2px; }
.selected-table input[type="number"] { width: 52px; height: 28px; border: 1px solid var(--color-input-border); border-radius: var(--radius-sm); text-align: center; font-size: 12px; font-weight: 700; }
.selected-price { font-weight: 700; white-space: nowrap; }
.comment-row td { background: #fbfbfd; }
.comment-input { width: 100%; min-height: 58px; border: 1px dashed var(--color-input-border); border-radius: var(--radius-sm); padding: 8px; resize: vertical; font-size: 13px; color: var(--color-text); }
.row-remove { background: none; border: none; color: var(--color-text-muted); cursor: pointer; padding: 3px; }
.row-remove:hover { color: var(--color-error); }
.selection-actions { padding: var(--sp-md); display: flex; flex-direction: column; gap: var(--sp-sm); border-top: 1px solid var(--color-border); background: #fbfbfd; }
.dropdown { position: relative; }
.dropdown-menu { position: absolute; left: 0; right: 0; bottom: calc(100% + 4px); background: white; border: 1px solid var(--color-border); border-radius: var(--radius-md); box-shadow: 0 8px 24px rgba(0,0,0,0.14); overflow: hidden; z-index: 20; }
.dropdown-menu button { width: 100%; text-align: left; background: white; border: none; padding: 10px 12px; cursor: pointer; font-size: 13px; color: var(--color-text); }
.dropdown-menu button:hover { background: rgba(74,63,191,0.06); color: var(--color-purple); }
.status-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--sp-sm); }
.log-panel { border-top: 1px solid var(--color-border); padding: 10px var(--sp-md); max-height: 105px; overflow: auto; background: white; }
.log-title { font-size: 12px; font-weight: 700; color: var(--color-primary); margin-bottom: 5px; }
.log-list { display: flex; flex-direction: column; gap: 4px; }
.log-item { font-size: 11px; color: var(--color-text-muted); }
.log-item strong { color: var(--color-text); }

.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 500; display: flex; align-items: center; justify-content: center; padding: var(--sp-md); animation: fadeIn 0.2s ease; }
.modal { background: var(--color-surface); border-radius: var(--radius-lg); width: 100%; max-width: 860px; max-height: 90vh; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,0.3); display: flex; flex-direction: column; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-md) 20px; border-bottom: 1px solid var(--color-border); }
.modal-header h3 { font-size: 17px; color: var(--color-primary); }
.modal-note { padding: 10px 20px; background: var(--color-info-bg); color: var(--color-info); font-size: 13px; }
.excel-preview { padding: var(--sp-md) 20px; overflow: auto; }
.excel-preview table { width: 100%; border-collapse: collapse; font-size: 13px; }
.excel-preview th, .excel-preview td { border: 1px solid #d0d0d8; padding: 6px 8px; text-align: left; }
.excel-preview th { background: var(--color-primary); color: white; }
.modal-actions { display: flex; justify-content: flex-end; gap: var(--sp-sm); padding: var(--sp-md) 20px; border-top: 1px solid var(--color-border); }

.loading-overlay { position: fixed; inset: 0; background: rgba(248,248,246,0.8); z-index: 300; display: flex; align-items: center; justify-content: center; }
.loading-spinner { display: flex; flex-direction: column; align-items: center; gap: var(--sp-md); }
.spinner-ring { width: 44px; height: 44px; border: 3px solid var(--color-border); border-top-color: var(--color-purple); border-radius: 50%; animation: spin 0.7s linear infinite; }
.loading-text { font-size: 14px; color: var(--color-text-muted); font-weight: 600; }
.footer { background: var(--color-primary); color: rgba(255,255,255,0.55); padding: 12px 0; font-size: 12px; }
.footer-inner { display: flex; gap: var(--sp-md); flex-wrap: wrap; }
.footer-sep { opacity: 0.3; }

.mock-banner { background: #fff8e1; border: 1px solid #f0c040; border-left: 4px solid #f0c040; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 8px 16px; font-size: 13px; color: #856404; font-weight: 600; display: flex; align-items: center; gap: 8px; margin: var(--sp-md) 20px 0; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1180px) {
  .workspace { grid-template-columns: 1fr; }
  .selection-panel { position: static; min-height: 680px; max-height: none; }
}
@media (max-width: 760px) {
  .container { padding: 0 14px; }
  .header-inner { height: auto; min-height: 60px; padding: 10px 14px; align-items: flex-start; }
  .header-status { flex-wrap: wrap; justify-content: flex-end; }
  .workspace { padding-top: var(--sp-md); }
  .search-command-row { grid-template-columns: 1fr; }
  .search-panel-heading { flex-direction: column; }
  .order-fields { grid-template-columns: 1fr; }
  .status-grid { grid-template-columns: 1fr; }
  .table-wrapper { max-height: none; }
}

/* ============================================================
   Manager UI v2.1 — компактний робочий режим
   ============================================================ */
.workspace {
  grid-template-columns: minmax(0, 1fr) minmax(390px, 30vw);
  gap: 12px;
  padding-left: 18px;
  padding-right: 18px;
}
.search-workzone { min-width: 0; overflow: hidden; }
.search-panel { padding: 12px 14px; }
.search-panel-heading { margin-bottom: 8px; align-items: center; }
.search-panel-heading h1 { font-size: 20px; }
.search-panel-heading p { display: none; }
.bulk-upload-btn { padding: 6px 10px; font-size: 12px; }
.search-command-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}
.search-input-wrap { height: 42px; }
.search-input { font-size: 14px; }
.search-actions-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.search-action, .toggle-action { height: 34px; padding-top: 0; padding-bottom: 0; }
.toggle-action { padding-left: 12px; padding-right: 12px; }

.section-results { position: relative; }
.results-header { padding: 8px 12px; }
.results-count { font-size: 14px; }
.table-wrapper { max-height: calc(100vh - 190px); overflow: auto; }
.results-table {
  table-layout: fixed;
  width: 100%;
  min-width: 860px;
  font-size: 12px;
}
.results-table th { padding: 7px 5px; font-size: 11px; }
.results-table td {
  padding: 6px 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.results-table th:nth-child(1), .results-table td:nth-child(1) { width: 32px; }
.results-table th:nth-child(2), .results-table td:nth-child(2) { width: 92px; }
.results-table th:nth-child(3), .results-table td:nth-child(3) { width: 28%; }
.results-table th:nth-child(4), .results-table td:nth-child(4) { width: 82px; }
.results-table th:nth-child(5), .results-table td:nth-child(5) { width: 100px; }
.results-table th:nth-child(6), .results-table td:nth-child(6) { width: 64px; text-align: center; }
.results-table th:nth-child(7), .results-table td:nth-child(7) { width: 70px; }
.results-table th:nth-child(8), .results-table td:nth-child(8) { width: 52px; }
.results-table th:nth-child(9), .results-table td:nth-child(9) { width: 76px; }
.results-table th:nth-child(10), .results-table td:nth-child(10) { width: 62px; }
.td-name { min-width: 0; }
.qty-badge { min-width: 28px; padding: 2px 5px; }
.comment-tag { font-size: 10px; padding: 2px 5px; }
.btn-add-row { padding: 3px 7px; font-size: 11px; }
.filter-row { display: none; }
.th-filter-btn {
  margin-left: 4px;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(255,255,255,0.45);
  background: rgba(255,255,255,0.12);
  color: white;
  border-radius: 3px;
  cursor: pointer;
  font-size: 11px;
  line-height: 16px;
}
.th-filter-btn:hover,
.th-filter-btn.active { background: white; color: var(--color-primary); }
.filter-mark {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 3px;
  border-radius: 50%;
  background: transparent;
  vertical-align: middle;
}
.filter-mark.active { background: #f0c040; }
.filter-popover {
  position: absolute;
  z-index: 40;
  width: 240px;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 28px rgba(0,0,0,0.18);
  padding: 10px;
}
.filter-popover-title { font-size: 12px; font-weight: 700; color: var(--color-primary); margin-bottom: 6px; }
.filter-popover input {
  width: 100%;
  height: 32px;
  border: 1.5px solid var(--color-input-border);
  border-radius: var(--radius-sm);
  padding: 0 9px;
  font-size: 13px;
  outline: none;
}
.filter-popover input:focus { border-color: var(--color-purple); }
.filter-popover-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }

.selection-panel {
  height: calc(100vh - 84px);
  min-height: calc(100vh - 84px);
  max-height: calc(100vh - 84px);
  top: 72px;
}
.selection-header {
  padding: 8px 12px;
  min-height: 46px;
  flex: 0 0 auto;
}
.selection-header h2 { font-size: 15px; }
.selection-header span { font-size: 11px; margin-top: 0; }
.order-fields {
  padding: 7px 8px;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  flex: 0 0 auto;
}
.order-fields span { font-size: 10px; }
.order-fields input { height: 28px; font-size: 12px; padding: 0 7px; }
.discount-row { grid-template-columns: 1fr 64px; gap: 5px; }
.discount-row .btn-sm { padding-left: 6px !important; padding-right: 6px !important; }
.selection-tools { padding: 6px 8px; flex: 0 0 auto; }
.selected-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
.selected-table { table-layout: fixed; font-size: 11px; }
.selected-table th { padding: 6px 5px; }
.selected-table td { padding: 5px; }
.selected-table th:nth-child(1), .selected-table td:nth-child(1) { width: auto; }
.selected-table th:nth-child(2), .selected-table td:nth-child(2) { width: 48px; }
.selected-table th:nth-child(3), .selected-table td:nth-child(3) { width: 72px; }
.selected-table th:nth-child(4), .selected-table td:nth-child(4) { width: 44px; }
.selected-table th:nth-child(5), .selected-table td:nth-child(5) { width: 26px; }
.selected-sku { font-size: 11px; }
.selected-name { line-height: 1.15; }
.selected-meta { display: none; }
.selected-table input[type="number"] { width: 42px; height: 24px; font-size: 11px; }
.comment-input { min-height: 36px; font-size: 12px; padding: 5px; }
.order-total {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-top: 1px solid var(--color-border);
  background: #f3f3f7;
}
.order-total span { font-size: 12px; color: var(--color-text-muted); font-weight: 700; }
.order-total strong { font-size: 15px; color: var(--color-primary); white-space: nowrap; }
.selection-actions { padding: 8px; gap: 6px; flex: 0 0 auto; }
.selection-actions .btn-primary,
.selection-actions .btn-secondary,
.selection-actions .btn-neutral,
.selection-actions .btn-danger { min-height: 30px; padding-top: 6px; padding-bottom: 6px; font-size: 12px; }
.status-grid { gap: 6px; }
.log-panel { max-height: 56px; padding: 6px 8px; flex: 0 0 auto; }
.log-title { display: none; }
.log-item { font-size: 10px; }

@media (max-width: 1180px) {
  .workspace { grid-template-columns: 1fr; padding-left: 14px; padding-right: 14px; }
  .selection-panel { position: static; height: 70vh; min-height: 560px; max-height: 760px; }
}

/* ============================================================
   Manager UI v2.2 — compact order panel, dropdown filters, editable discounts
   ============================================================ */
.workspace {
  grid-template-columns: minmax(0, 1fr) minmax(430px, 32vw);
  gap: 10px;
}
.search-workzone { min-width: 0; }
.results-table {
  table-layout: fixed;
  min-width: 1080px;
}
.results-table td {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.25;
}
.results-table th:nth-child(1), .results-table td:nth-child(1) { width: 32px; }
.results-table th:nth-child(2), .results-table td:nth-child(2) { width: 160px; }
.results-table th:nth-child(3), .results-table td:nth-child(3) { width: 360px; }
.results-table th:nth-child(4), .results-table td:nth-child(4) { width: 82px; }
.results-table th:nth-child(5), .results-table td:nth-child(5) { width: 92px; }
.results-table th:nth-child(6), .results-table td:nth-child(6) { width: 54px; text-align: center; }
.results-table th:nth-child(7), .results-table td:nth-child(7) { width: 72px; }
.results-table th:nth-child(8), .results-table td:nth-child(8) { width: 44px; }
.results-table th:nth-child(9), .results-table td:nth-child(9) { width: 76px; }
.results-table th:nth-child(10), .results-table td:nth-child(10) { width: 58px; }
.td-sku { white-space: normal; word-break: break-word; overflow-wrap: anywhere; }
.td-name { min-width: 0; white-space: normal; overflow-wrap: anywhere; }
.td-brand, .td-supplier, .td-currency, .td-price { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.filter-popover { width: 280px; max-height: 360px; overflow: hidden; }
.filter-options {
  max-height: 270px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.filter-option {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: #f8f8fb;
  color: var(--color-text);
  border-radius: var(--radius-sm);
  padding: 7px 8px;
  font-size: 12px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.filter-option:hover,
.filter-option.active {
  border-color: var(--color-purple);
  color: var(--color-purple);
  background: rgba(74,63,191,0.06);
}
.filter-empty { font-size: 12px; color: var(--color-text-muted); padding: 8px; }
.filter-popover-actions { display: flex; margin-top: 8px; }
.filter-popover-actions .btn-secondary { width: 100%; }
.filter-popover input { display: none; }
.selection-panel {
  height: calc(100vh - 78px);
  min-height: calc(100vh - 78px);
  max-height: calc(100vh - 78px);
  top: 68px;
}
.selection-header {
  min-height: 34px;
  padding: 6px 10px;
  flex: 0 0 auto;
}
.selection-header h2 { font-size: 14px; }
.order-fields {
  padding: 5px 7px;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  flex: 0 0 auto;
}
.order-fields span { font-size: 10px; line-height: 1; }
.order-fields input { height: 25px; font-size: 12px; }
.discount-field { grid-column: auto; }
.discount-row { grid-template-columns: minmax(54px, 1fr) 58px; }
.discount-row input { width: 100%; }
.discount-row .btn-sm { padding-left: 5px !important; padding-right: 5px !important; font-size: 11px !important; }
.selection-tools { padding: 5px 7px; }
.selected-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
}
.selected-table { table-layout: fixed; font-size: 11px; }
.selected-table th:nth-child(1), .selected-table td:nth-child(1) { width: auto; }
.selected-table th:nth-child(2), .selected-table td:nth-child(2) { width: 44px; }
.selected-table th:nth-child(3), .selected-table td:nth-child(3) { width: 72px; }
.selected-table th:nth-child(4), .selected-table td:nth-child(4) { width: 54px; }
.selected-table th:nth-child(5), .selected-table td:nth-child(5) { width: 58px; }
.selected-table td { vertical-align: top; }
.selected-sku { white-space: normal; overflow-wrap: anywhere; }
.selected-name { white-space: normal; overflow-wrap: anywhere; }
.selected-table input[type="number"] { width: 100%; min-width: 38px; height: 23px; }
.selected-price { white-space: normal; overflow-wrap: anywhere; }
.row-tools { display: flex; gap: 2px; align-items: center; justify-content: flex-end; }
.row-move,
.row-remove {
  width: 17px;
  height: 21px;
  border: 1px solid var(--color-border);
  border-radius: 3px;
  background: white;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  font-size: 11px;
}
.row-move:hover { color: var(--color-purple); border-color: var(--color-purple); }
.row-remove:hover { color: var(--color-error); border-color: var(--color-error); }
.order-total {
  padding: 5px 8px;
  min-height: 30px;
  flex: 0 0 auto;
}
.order-total span { font-size: 11px; }
.order-total strong { font-size: 14px; }
.selection-actions {
  padding: 6px;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 4px;
  flex-wrap: nowrap;
  overflow: visible;
}
.selection-actions .dropdown { flex: 0 0 50px; }
.selection-actions .action-compact {
  min-height: 28px !important;
  height: 28px;
  padding: 4px 6px !important;
  font-size: 10.5px !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  white-space: nowrap;
}
.selection-actions > .action-compact { flex: 1 1 auto; min-width: 0; }
.selection-actions .dropdown-menu {
  min-width: 220px;
  left: auto;
  right: 0;
  bottom: calc(100% + 4px);
}
.log-panel { display: none !important; }
@media (max-width: 1180px) {
  .workspace { grid-template-columns: 1fr; }
  .selection-panel { position: static; height: 70vh; min-height: 540px; max-height: 760px; }
}

/* ============================================================
   Manager UI v2.3 — no horizontal scroll, supplier filter, clear filter X
   ============================================================ */
.section-results {
  overflow: visible !important;
  position: relative;
  z-index: 5;
}
.table-wrapper {
  overflow-x: hidden !important;
  overflow-y: auto;
  max-width: 100%;
}
.results-table {
  width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed;
  font-size: 11.2px;
}
.results-table th {
  padding: 5px 3px !important;
  white-space: normal;
  line-height: 1.1;
}
.results-table td {
  padding: 5px 3px !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  line-height: 1.18;
}
.th-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 17px 6px;
  align-items: center;
  gap: 2px;
  min-width: 0;
}
.th-inner > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.th-filter-btn {
  width: 17px !important;
  height: 17px !important;
  margin-left: 0 !important;
  padding: 0 !important;
  line-height: 15px !important;
  flex: 0 0 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.filter-mark { margin-left: 0 !important; }
.results-table th:nth-child(1), .results-table td:nth-child(1) { width: 3%; }
.results-table th:nth-child(2), .results-table td:nth-child(2) { width: 15%; }
.results-table th:nth-child(3), .results-table td:nth-child(3) { width: 34%; }
.results-table th:nth-child(4), .results-table td:nth-child(4) { width: 8%; }
.results-table th:nth-child(5), .results-table td:nth-child(5) { width: 10%; }
.results-table th:nth-child(6), .results-table td:nth-child(6) { width: 5%; text-align: center; }
.results-table th:nth-child(7), .results-table td:nth-child(7) { width: 7%; }
.results-table th:nth-child(8), .results-table td:nth-child(8) { width: 4%; }
.results-table th:nth-child(9), .results-table td:nth-child(9) { width: 10%; }
.results-table th:nth-child(10), .results-table td:nth-child(10) { width: 4%; text-align: center; }
.td-sku {
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-size: 11px;
}
.td-name {
  white-space: normal !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
  min-width: 0 !important;
  font-size: 11.6px;
}
.td-brand, .td-supplier, .td-price, .td-currency {
  white-space: normal !important;
  overflow-wrap: anywhere;
  text-overflow: clip !important;
}
.comment-tag {
  font-size: 9px !important;
  padding: 1px 3px !important;
  line-height: 1.15;
  white-space: normal;
}
.qty-badge { min-width: 20px !important; padding: 1px 3px !important; font-size: 10px; }
.btn-add-row {
  width: 22px !important;
  height: 22px !important;
  padding: 0 !important;
  border-radius: 50%;
  font-size: 16px !important;
  line-height: 18px;
  font-weight: 800;
}
.filter-popover {
  z-index: 900 !important;
}
.filter-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.filter-popover-title {
  margin-bottom: 0 !important;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.filter-clear-x {
  width: 22px;
  height: 22px;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  background: white;
  color: var(--color-error);
  font-size: 16px;
  line-height: 18px;
  cursor: pointer;
  flex: 0 0 auto;
}
.filter-clear-x:hover {
  background: var(--color-error-bg);
  border-color: var(--color-error);
}
.selection-panel {
  overflow: visible !important;
  position: sticky;
  z-index: 20;
}
.selected-table-wrap {
  overflow: auto;
}
.selection-actions {
  position: relative;
  z-index: 50;
}
.selection-actions .dropdown { position: relative; z-index: 60; }
.selection-actions .dropdown-menu {
  z-index: 9999 !important;
  box-shadow: 0 12px 34px rgba(0,0,0,0.24) !important;
}


/* ============================================================
   Manager UI v2.6 — visible KP menu, duplicate products with comments
   ============================================================ */
.selection-actions .dropdown-menu {
  width: 340px !important;
  min-width: 340px !important;
  max-width: min(340px, calc(100vw - 28px));
  left: 0 !important;
  right: auto !important;
  bottom: calc(100% + 8px) !important;
  overflow: visible !important;
  padding: 4px !important;
}
.selection-actions .dropdown-menu button {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  line-height: 1.25 !important;
  min-height: 34px;
  padding: 8px 10px !important;
}
.selection-actions .dropdown {
  overflow: visible !important;
}


/* ============================================================
   Manager UI v2.7 — SQL logs, feedback modal, bulk upload review
   ============================================================ */
.feedback-modal {
  max-width: 720px;
}
.feedback-summary {
  background: #f3f4f8;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.45;
  margin-bottom: 12px;
}
.feedback-grid {
  display: grid;
  gap: 10px;
}
.feedback-grid label {
  display: grid;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
}
.feedback-grid select,
.feedback-grid textarea {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  background: #fff;
}
.checkbox-line {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 8px !important;
  font-weight: 500 !important;
}
.checkbox-line input {
  width: auto;
}
.bulk-modal {
  width: min(1180px, calc(100vw - 28px));
  max-width: 1180px;
  max-height: calc(100vh - 42px);
}
.bulk-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.bulk-stat {
  border: 1px solid var(--color-border);
  background: #f7f8fb;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 600;
}
.bulk-source-preview {
  border: 1px solid var(--color-border);
  background: #fffceb;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
  font-size: 12px;
  min-height: 36px;
}
.bulk-table-wrap {
  max-height: 58vh;
  overflow: auto;
  border: 1px solid var(--color-border);
  border-radius: 10px;
}
.bulk-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.bulk-table th,
.bulk-table td {
  border-bottom: 1px solid var(--color-border);
  padding: 6px 7px;
  vertical-align: top;
}
.bulk-table th {
  position: sticky;
  top: 0;
  background: #f3f4f8;
  z-index: 2;
  text-align: left;
}
.bulk-table select {
  width: 100%;
  max-width: 280px;
}
.bulk-original,
.bulk-recognized {
  max-width: 260px;
  white-space: normal;
  overflow-wrap: anywhere;
}
.bulk-status {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 700;
  background: #eef1f7;
}
.bulk-status.found_exact { background: #e9f7ef; color: #12683a; }
.bulk-status.variants { background: #fff7df; color: #7a5200; }
.bulk-status.not_found,
.bulk-status.unrecognized,
.bulk-status.search_error { background: #fdecec; color: #9b1c1c; }
.bulk-status.recognized_not_searched { background: #edf2ff; color: #24409a; }

/* v2.9 — SQL orders + product admin */
.selection-tools-wide {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.order-search-modal {
  width: min(1120px, 96vw);
  max-height: 90vh;
}

.order-search-filters {
  display: grid;
  grid-template-columns: 1.3fr 1fr 150px 150px 140px auto;
  gap: 10px;
  align-items: end;
  padding: 12px 0;
}

.order-search-filters label,
.admin-filters label,
.admin-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.order-search-filters input,
.order-search-filters select,
.admin-filters input,
.admin-filters select,
.admin-form-grid input,
.admin-form-grid select,
.feedback-grid select,
.feedback-grid textarea,
.feedback-grid input {
  height: 32px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0 9px;
  font: inherit;
  background: #fff;
  color: var(--color-text);
}

.feedback-grid textarea,
.admin-form-grid textarea {
  min-height: 72px;
  padding: 8px 9px;
  resize: vertical;
}

.order-search-table-wrap,
.admin-table-wrap {
  max-height: 52vh;
  overflow: auto;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: #fff;
}

.order-search-table,
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.order-search-table th,
.order-search-table td,
.admin-table th,
.admin-table td {
  border-bottom: 1px solid var(--color-border);
  padding: 7px 8px;
  text-align: left;
  vertical-align: top;
}

.order-search-table th,
.admin-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f4f5fa;
  color: var(--color-navy);
  font-weight: 700;
}

.order-search-actions-cell {
  white-space: nowrap;
}

.admin-page {
  background: #f3f4f8;
}

.admin-header-inner {
  max-width: 1440px;
}

.product-admin-layout {
  max-width: 1440px;
  padding-top: 18px;
  padding-bottom: 30px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-panel {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  padding: 14px;
}

.admin-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.admin-panel-head h1,
.admin-panel-head h2 {
  margin: 0;
  color: var(--color-navy);
}

.admin-panel-head h1 {
  font-size: 20px;
}

.admin-panel-head h2 {
  font-size: 16px;
}

.admin-panel-head p,
.admin-note {
  margin: 4px 0 0;
  color: var(--color-text-muted);
  font-size: 12px;
}

.admin-filters {
  display: grid;
  grid-template-columns: 150px 150px 1fr 1.5fr;
  gap: 10px;
  margin-bottom: 10px;
}

.admin-grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.admin-form-grid {
  display: grid;
  gap: 10px;
}

.admin-query-cell {
  max-width: 360px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-error-cell {
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef0f8;
  color: var(--color-navy);
  font-weight: 700;
  font-size: 11px;
}

.admin-status.fixed,
.admin-status.sent_to_n8n {
  background: #e6f6ec;
  color: #16723d;
}

.admin-status.rejected,
.admin-status.n8n_error {
  background: #fdecec;
  color: #9b1c1c;
}

.admin-status.scheduled,
.admin-status.needs_rule,
.admin-status.needs_attributes,
.admin-status.pending_n8n_config {
  background: #fff6da;
  color: #7a5500;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 3000;
  max-width: 520px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--color-navy);
  color: #fff;
  box-shadow: var(--shadow-lg);
  font-weight: 600;
}

@media (max-width: 1100px) {
  .admin-grid-two,
  .admin-filters,
  .order-search-filters {
    grid-template-columns: 1fr 1fr;
  }
}

/* v3.0 — product admin interface refinements */
.admin-v3-page {
  background: #f4f6fb;
  color: #20243a;
}

.admin-v3-header {
  position: sticky;
  top: 0;
  z-index: 80;
}

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-v3-layout {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 16px;
  padding-bottom: 24px;
}

.admin-hero-panel {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid rgba(26, 31, 110, 0.10);
  border-radius: 18px;
  background: linear-gradient(135deg, #ffffff 0%, #f6f7ff 100%);
  box-shadow: 0 14px 36px rgba(26, 31, 110, 0.08);
}

.admin-hero-panel h1 {
  margin: 0 0 6px;
  font-size: 25px;
  color: var(--color-navy, #1a1f6e);
}

.admin-hero-panel p {
  margin: 0;
  color: #5c637d;
  max-width: 820px;
  line-height: 1.4;
}

.admin-hero-meta {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-hero-meta label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 210px;
  font-size: 12px;
  color: #5c637d;
}

.admin-hero-meta input {
  height: 34px;
  border: 1px solid #d9deec;
  border-radius: 10px;
  padding: 0 10px;
  font: inherit;
}

.admin-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px;
  background: #ffffff;
  border: 1px solid rgba(26, 31, 110, 0.10);
  border-radius: 16px;
  box-shadow: 0 8px 22px rgba(26, 31, 110, 0.06);
}

.admin-tab {
  height: 36px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0 14px;
  background: #f3f5fb;
  color: #333a58;
  font-weight: 700;
  cursor: pointer;
}

.admin-tab:hover {
  border-color: rgba(74, 63, 191, 0.22);
  background: #eef0ff;
}

.admin-tab.active {
  background: linear-gradient(135deg, #1a1f6e, #4a3fbf);
  color: #ffffff;
}

.admin-tab-panel {
  display: none;
}

.admin-tab-panel.active {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
}

.metric-card {
  min-height: 76px;
  padding: 12px 14px;
  border-radius: 15px;
  background: #ffffff;
  border: 1px solid rgba(26, 31, 110, 0.09);
  box-shadow: 0 8px 22px rgba(26, 31, 110, 0.05);
}

.metric-card span {
  display: block;
  font-size: 12px;
  color: #67708e;
  margin-bottom: 8px;
}

.metric-card strong {
  display: block;
  font-size: 26px;
  line-height: 1;
  color: var(--color-navy, #1a1f6e);
}

.admin-panel {
  border-radius: 18px;
}

.admin-panel-head {
  gap: 12px;
}

.admin-panel-head h2 {
  font-size: 19px;
}

.admin-filters-compact {
  grid-template-columns: 170px 170px minmax(180px, 220px) minmax(260px, 1fr) auto;
  align-items: end;
}

.admin-filters-compact .wide-filter {
  min-width: 260px;
}

.admin-feedback-table-wrap {
  max-height: 56vh;
}

.admin-feedback-table th:nth-child(1),
.admin-feedback-table td:nth-child(1) { width: 56px; }
.admin-feedback-table th:nth-child(2),
.admin-feedback-table td:nth-child(2) { width: 138px; }
.admin-feedback-table th:nth-child(3),
.admin-feedback-table td:nth-child(3) { width: 120px; }
.admin-feedback-table th:nth-child(4),
.admin-feedback-table td:nth-child(4) { width: 100px; }
.admin-feedback-table th:nth-child(7),
.admin-feedback-table td:nth-child(7) { width: 54px; text-align: right; }
.admin-feedback-table th:nth-child(8),
.admin-feedback-table td:nth-child(8) { width: 132px; }
.admin-feedback-table th:nth-child(9),
.admin-feedback-table td:nth-child(9) { width: 92px; }

.admin-query-cell {
  min-width: 280px;
  white-space: normal !important;
  line-height: 1.25;
}

.admin-warning-block {
  padding: 12px 14px;
  border: 1px solid #ead9a1;
  border-radius: 14px;
  background: #fff8dc;
  color: #5d4c16;
  margin: 4px 0 14px;
  line-height: 1.45;
}

.admin-warning-block code {
  font-family: "IBM Plex Mono", monospace;
  color: #1a1f6e;
  background: rgba(255,255,255,0.72);
  padding: 1px 4px;
  border-radius: 5px;
}

.admin-form-grid-three {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.admin-actions-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.admin-note {
  color: #68708b;
  font-size: 13px;
}

.admin-import-table th:nth-child(1),
.admin-import-table td:nth-child(1) { width: 54px; }
.admin-import-table th:nth-child(2),
.admin-import-table td:nth-child(2) { width: 138px; }
.admin-import-table th:nth-child(4),
.admin-import-table td:nth-child(4) { width: 130px; }
.admin-import-table th:nth-child(5),
.admin-import-table td:nth-child(5) { width: 80px; }
.admin-import-table th:nth-child(6),
.admin-import-table td:nth-child(6) { width: 98px; }
.admin-import-table th:nth-child(7),
.admin-import-table td:nth-child(7) { width: 132px; }
.admin-import-table th:nth-child(8),
.admin-import-table td:nth-child(8) { width: 138px; }

.admin-file-cell,
.admin-error-cell {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-system-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 12px;
  margin: 10px 0 14px;
}

.system-card {
  padding: 14px;
  border: 1px solid #e0e4f0;
  border-radius: 14px;
  background: #fbfcff;
}

.system-card span {
  display: block;
  font-size: 12px;
  color: #65708d;
  margin-bottom: 6px;
}

.system-card strong {
  display: block;
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  color: #1d2441;
  overflow-wrap: anywhere;
}

.admin-feedback-modal {
  width: min(920px, 96vw);
}

.feedback-grid-v3 {
  grid-template-columns: repeat(3, minmax(160px, 1fr));
}

.feedback-grid-v3 .full-span {
  grid-column: 1 / -1;
}

.feedback-summary {
  line-height: 1.45;
  color: #30364f;
}

.summary-line,
.summary-query {
  margin-bottom: 7px;
}

.summary-query {
  padding: 8px 10px;
  border-radius: 10px;
  background: #f2f4fb;
}

.admin-details {
  margin-top: 8px;
  border: 1px solid #dfe4f2;
  border-radius: 10px;
  padding: 8px 10px;
  background: #fbfcff;
}

.admin-details summary {
  cursor: pointer;
  font-weight: 700;
  color: #1a1f6e;
}

.admin-details pre {
  max-height: 180px;
  overflow: auto;
  margin: 8px 0 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  white-space: pre-wrap;
}

.admin-status.queued,
.admin-status.in_review {
  background: #eef0ff;
  color: #302685;
}

.admin-status.n8n_error,
.admin-status.import_problem {
  background: #ffe8e6;
  color: #9a251c;
}

.admin-status.pending_n8n_config {
  background: #fff4ce;
  color: #735600;
}

@media (max-width: 1100px) {
  .admin-hero-panel {
    align-items: stretch;
    flex-direction: column;
  }
  .admin-hero-meta {
    justify-content: flex-start;
  }
  .admin-metrics {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }
  .admin-filters-compact,
  .admin-form-grid-three,
  .admin-system-grid {
    grid-template-columns: 1fr;
  }
}

/* Product admin v3.1 — controlled search governance */
.admin-v31-page .admin-tabs {
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.admin-v31-page .admin-tab {
  white-space: nowrap;
}
.admin-v31-page .metric-card-button {
  border: 1px solid var(--color-border);
  text-align: left;
  cursor: pointer;
  width: 100%;
  font: inherit;
}
.admin-v31-page .metric-card-button:hover {
  border-color: var(--color-primary);
  transform: translateY(-1px);
}
.admin-process-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.process-card {
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: #fff;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 96px;
}
.process-card strong {
  color: var(--color-navy);
}
.process-card span {
  color: var(--color-muted);
  font-size: 13px;
  line-height: 1.35;
}
.admin-columns-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 14px;
}
.compact-panel {
  margin-top: 14px;
}
.admin-row-actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
}
.btn-xs {
  min-height: 24px;
  padding: 3px 7px;
  border-radius: 7px;
  font-size: 11px;
}
.admin-governance-box {
  border: 1px solid var(--color-border);
  background: #f7f8fb;
  border-radius: 14px;
  padding: 10px 12px;
  margin: 10px 0 12px;
}
.admin-governance-box h4 {
  margin: 0 0 3px;
  color: var(--color-navy);
}
.admin-governance-box p {
  margin: 0;
  font-size: 12px;
  color: var(--color-muted);
}
.admin-inline-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.admin-analysis-pre {
  max-height: 260px;
  overflow: auto;
  margin: 8px 0 0;
  padding: 10px;
  background: #101426;
  color: #e7edf7;
  border-radius: 10px;
  font-size: 12px;
  white-space: pre-wrap;
}
.admin-wide-modal {
  width: min(1040px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  overflow: auto;
}
.admin-rules-table td,
.admin-feedback-table td,
.admin-import-table td {
  vertical-align: top;
}
.admin-rules-table td:nth-child(3),
.admin-rules-table td:nth-child(4),
.admin-rules-table td:nth-child(5) {
  max-width: 260px;
  white-space: normal;
  line-height: 1.25;
}
.admin-v31-page code {
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  font-size: 12px;
}
.admin-v31-page details pre {
  max-height: 220px;
  overflow: auto;
  background: #f5f6fa;
  padding: 8px;
  border-radius: 8px;
  white-space: pre-wrap;
}
@media (max-width: 1100px) {
  .admin-process-grid,
  .admin-columns-2 {
    grid-template-columns: 1fr;
  }
  .admin-inline-actions {
    justify-content: flex-start;
  }
}

/* Product admin v3.2/v1.0.3 UX — readable governance analysis and visible rule tests */
.feedback-analysis-box { font-size: 13px; line-height: 1.45; color: #2f354f; }
.analysis-readable h4 { margin: 12px 0 6px; color: var(--color-navy, #1a1f6e); }
.analysis-readable p { margin: 6px 0; }
.analysis-product-card { border: 1px solid #dfe4f2; border-radius: 12px; background: #fff; padding: 10px; margin: 8px 0; }
.analysis-mini-grid { display: grid; grid-template-columns: repeat(3, minmax(120px, 1fr)); gap: 4px 10px; margin-top: 6px; color: #4d5570; }
.analysis-missing { margin-top: 6px; color: #5d4c16; }
.analysis-patch-group { border-left: 3px solid #4a3fbf; padding-left: 10px; margin: 8px 0; }
.analysis-patch-group ul { margin: 6px 0 0 18px; padding: 0; }
.muted-text { color: #68708b; font-size: 12px; }
.danger-text { color: #a6261d; font-weight: 700; }
.rule-test-content { padding: 14px 18px; overflow: auto; }
.rule-test-details { margin: 10px 14px; }
.rule-test-table-wrap { max-height: 320px; }
.admin-patches-table td:nth-child(3) { min-width: 260px; }
.admin-patches-table td:nth-child(4) { min-width: 280px; }
.admin-patches-table td:nth-child(5) { min-width: 220px; }
.admin-patches-table span code { margin-right: 2px; }
.full-span { grid-column: 1 / -1; }
@media (max-width: 900px) { .analysis-mini-grid { grid-template-columns: 1fr; } }

.admin-check-filter { display:flex; align-items:center; gap:6px; align-self:end; min-height:38px; font-size:13px; color: var(--color-text); }
.admin-check-filter input { width:16px; height:16px; }

/* Product dictionary v3.7 */
.dictionary-workspace {
  display: grid;
  grid-template-columns: minmax(260px, 24%) minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  min-height: 540px;
}
.dictionary-groups-card,
.dictionary-editor-card {
  border: 1px solid var(--line-soft, #dfe5ee);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}
.dictionary-card-head,
.dictionary-selected-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft, #dfe5ee);
}
.dictionary-card-head h3,
.dictionary-selected-head h3 { margin: 0; }
.dictionary-card-head span,
.dictionary-selected-head p { color: var(--muted, #6b7280); font-size: 13px; margin: 4px 0 0; }
.dictionary-group-list {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 660px;
  overflow: auto;
}
.dictionary-group-btn {
  width: 100%;
  text-align: left;
  border: 1px solid #dfe5ee;
  background: #f8fafc;
  color: #1f2937;
  border-radius: 11px;
  padding: 10px 11px;
  cursor: pointer;
}
.dictionary-group-btn.active {
  background: #e7f0ff;
  border-color: #7aa7e8;
  box-shadow: inset 3px 0 0 #1f5c9e;
}
.dictionary-group-btn strong { display: block; font-size: 14px; }
.dictionary-group-btn small { display: block; color: #667085; margin-top: 3px; font-size: 12px; }
.dictionary-test-query { min-width: 360px; max-width: 520px; flex: 0 0 42%; }
.dictionary-test-query input { width: 100%; }
.dictionary-add-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 150px 140px 130px;
  gap: 10px;
  align-items: end;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft, #dfe5ee);
}
.dictionary-add-row input,
.dictionary-add-row select { width: 100%; }
.dictionary-note-block {
  margin: 12px 16px 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #cfe1ff;
  background: #f3f7ff;
  color: #24415f;
  font-size: 13px;
}
.dictionary-synonyms-wrap {
  margin: 12px 16px 16px;
  max-height: 420px;
}
.dictionary-synonym-cell { font-weight: 650; }
.dictionary-results-wrap {
  max-height: 520px;
}
.dictionary-results-table td:nth-child(4),
.dictionary-results-table td:nth-child(8) {
  min-width: 260px;
}
.dictionary-empty {
  color: #6b7280;
  padding: 12px;
  line-height: 1.45;
}
.tested-action {
  background: #e8f2ff !important;
  color: #174f8f !important;
  border-color: #b8d3f4 !important;
}
.dictionary-process-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.54);
}
.dictionary-process-overlay[hidden] { display: none !important; }
.dictionary-process-card {
  width: min(530px, 92vw);
  background: #fff;
  border-radius: 20px;
  padding: 28px;
  text-align: center;
  box-shadow: 0 24px 80px rgba(0,0,0,.28);
  border: 1px solid rgba(255,255,255,.5);
}
.dictionary-process-logo {
  width: 82px;
  height: 82px;
  margin: 0 auto 10px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 24px;
  color: #102640;
  background: linear-gradient(135deg, #f5a623 0%, #ffffff 48%, #1e5aa8 100%);
  box-shadow: 0 10px 30px rgba(30,90,168,.24);
}
.dictionary-process-clock {
  display: inline-block;
  font-size: 34px;
  animation: dictionarySpin 1.35s linear infinite;
}
.dictionary-process-dino {
  font-size: 44px;
  line-height: 1;
  margin: 8px 0;
  animation: dictionaryDinoWalk .9s ease-in-out infinite alternate;
}
.dictionary-process-card h2 { margin: 8px 0 6px; }
.dictionary-process-card p { margin: 0; color: #6b7280; }
.dictionary-process-bar {
  height: 8px;
  margin-top: 16px;
  border-radius: 999px;
  overflow: hidden;
  background: #e5eaf2;
}
.dictionary-process-bar span {
  display: block;
  height: 100%;
  width: 42%;
  border-radius: 999px;
  background: #1f5c9e;
  animation: dictionaryProgress 1.2s ease-in-out infinite;
}
@keyframes dictionarySpin { to { transform: rotate(360deg); } }
@keyframes dictionaryDinoWalk { from { transform: translateX(-8px) rotate(-3deg); } to { transform: translateX(8px) rotate(3deg); } }
@keyframes dictionaryProgress { 0% { margin-left: -44%; } 100% { margin-left: 104%; } }

@media (max-width: 980px) {
  .dictionary-workspace { grid-template-columns: 1fr; }
  .dictionary-selected-head { flex-direction: column; }
  .dictionary-test-query { min-width: 0; max-width: none; width: 100%; flex: auto; }
  .dictionary-add-row { grid-template-columns: 1fr; }
}


/* ============================================================
   v3.10 — governance UI, словники, тести, атрибути, manager polish
   ============================================================ */
.header-brand-image {
  display: block;
  width: 270px;
  max-width: 34vw;
  height: 48px;
  object-fit: contain;
  object-position: left center;
}
.header-subtitle-inline {
  display: block;
  max-width: 290px;
  line-height: 1.15;
}
.clear-workspace-action {
  border-color: rgba(192, 57, 43, .35);
  color: #9d2f25;
}
.clear-workspace-action:hover {
  border-color: #c0392b;
  color: #c0392b;
  background: #fff2f0;
}

.excel-preview table {
  border-collapse: collapse;
  width: 100%;
}
.excel-preview th,
.excel-preview td {
  border: 1px solid #7a7a7a;
  padding: 6px 8px;
  vertical-align: top;
}
.excel-preview th {
  background: #ececf4;
  font-weight: 700;
}

.dictionary-conflict-box {
  margin: 10px 0 14px;
  border: 1px solid #e0a39d;
  border-left: 4px solid #c0392b;
  border-radius: 7px;
  padding: 10px 12px;
  background: #fff1ef;
  color: #7b241c;
  font-size: 13px;
  line-height: 1.45;
}
.dictionary-conflict-box strong { display: block; margin-bottom: 4px; }
.dictionary-conflict-box ul { margin: 6px 0 0 18px; }
.dictionary-conflict-box code { color: #522; }

.admin-status.excluded {
  background: #fff0ef;
  color: #a12d24;
  border-color: #efc0bb;
}
.admin-status.deleted {
  background: #f1f2f4;
  color: #69707d;
  border-color: #d9dde3;
}
.btn-exclude {
  color: #a12d24 !important;
  border-color: #e0a39d !important;
}
.btn-exclude:hover {
  color: #fff !important;
  background: #b4382d !important;
}

.feedback-created-rules {
  margin-top: 16px;
  border-top: 1px solid var(--color-border);
  padding-top: 14px;
}
.feedback-created-rules h4 { margin-bottom: 4px; }
.feedback-rules-table td:nth-child(3),
.feedback-rules-table td:nth-child(4),
.feedback-rules-table td:nth-child(5) {
  max-width: 260px;
  white-space: normal;
}

.dictionary-process-card {
  width: min(480px, 92vw);
}
.ast-loader {
  position: relative;
  width: 118px;
  height: 118px;
  margin: 2px auto 18px;
  display: grid;
  place-items: center;
}
.ast-loader img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  position: relative;
  z-index: 3;
  animation: astLogoCounterRotate 1.8s linear infinite;
}
.ast-loader-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}
.ast-loader-ring-outer {
  border: 8px solid transparent;
  border-top-color: #2a214a;
  border-right-color: #2a214a;
  border-bottom-color: rgba(42, 33, 74, .22);
  animation: astOuterClockwise 1.25s linear infinite;
}
.ast-loader-ring-inner {
  inset: 17px;
  border: 7px solid transparent;
  border-left-color: #5d537b;
  border-bottom-color: #5d537b;
  border-top-color: rgba(93, 83, 123, .18);
  animation: astInnerCounterClockwise .95s linear infinite;
}
@keyframes astOuterClockwise {
  to { transform: rotate(360deg); }
}
@keyframes astInnerCounterClockwise {
  to { transform: rotate(-360deg); }
}
@keyframes astLogoCounterRotate {
  to { transform: rotate(-360deg); }
}

@media (max-width: 900px) {
  .header-brand-image { width: 210px; max-width: 48vw; }
  .header-subtitle-inline { display: none; }
}

.dictionary-add-row { grid-template-columns: minmax(240px, 1fr) 150px 145px 120px 190px; }

/* ===== UI v3.10 approved governance additions ===== */
.value-help {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,.34);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  cursor: help;
  outline: none;
}
.value-help-popover {
  position: absolute;
  z-index: 1200;
  top: calc(100% + 10px);
  right: 0;
  width: min(360px, 80vw);
  padding: 12px 14px;
  border-radius: 12px;
  background: #17174f;
  color: #fff;
  box-shadow: 0 16px 38px rgba(20,20,65,.28);
  font-weight: 600;
  line-height: 1.45;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: .16s ease;
  pointer-events: none;
}
.value-help-popover::before {
  content: "";
  position: absolute;
  right: 18px;
  bottom: 100%;
  border: 7px solid transparent;
  border-bottom-color: #17174f;
}
.value-help:hover .value-help-popover,
.value-help:focus .value-help-popover,
.value-help:focus-within .value-help-popover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.dictionary-toolbar label {
  min-width: 210px;
  margin: 0;
}
.dictionary-toolbar label span {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  color: var(--muted, #667085);
}
.dictionary-add-row label small {
  display: block;
  max-width: 300px;
  margin-top: 5px;
  color: var(--muted, #667085);
  line-height: 1.35;
}
.table-action-select {
  min-width: 148px;
  max-width: 190px;
  padding: 7px 30px 7px 9px;
  border: 1px solid #c9cce0;
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
  color: #24245f;
}
.entity-type-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: #ecebfd;
  color: #37357d;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.feedback-proposal-editor {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #d9daea;
  border-radius: 14px;
  background: #fbfbff;
}
.feedback-proposal-editor h4 {
  margin: 0 0 12px;
}
.test-table-filters {
  margin: 10px 0 12px;
  align-items: end;
}
.test-table-filters label {
  min-width: 170px;
}
.rule-test-table-wrap td:nth-child(4),
.dictionary-results-wrap td:nth-child(4) {
  min-width: 260px;
}
.rule-test-table-wrap td:nth-child(8),
.dictionary-results-wrap td:nth-child(8) {
  max-width: 420px;
  white-space: normal;
  overflow-wrap: anywhere;
}
#manualPatchProductPreview details {
  margin-top: 8px;
}
#adminToast {
  cursor: pointer;
}
@media (max-width: 900px) {
  .dictionary-toolbar { align-items: stretch; }
  .dictionary-toolbar label { width: 100%; }
  .value-help-popover { right: auto; left: 0; }
  .value-help-popover::before { right: auto; left: 18px; }
}


/* ===== Product Admin v3.10.1 review fixes ===== */
.admin-header-actions .value-help { display: none !important; }

.admin-feedback-modal {
  width: min(1040px, calc(100vw - 32px));
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
  display: block;
  scrollbar-gutter: stable;
}
.admin-feedback-modal .modal-header {
  position: sticky;
  top: 0;
  z-index: 12;
  background: #fff;
  border-bottom: 1px solid #e1e5ef;
}
.admin-feedback-modal .modal-actions {
  position: sticky;
  bottom: 0;
  z-index: 12;
  margin-top: 14px;
  background: #fff;
  border-top: 1px solid #e1e5ef;
  padding-top: 12px;
  padding-bottom: 4px;
}
.feedback-action-first {
  margin: 10px 0 12px;
  padding: 12px;
  border: 2px solid #5b4bd8;
  border-radius: 12px;
  background: #f7f5ff;
}
.feedback-action-first label { display: grid; gap: 6px; font-weight: 700; color: #20205e; }
.feedback-action-first select { width: min(440px, 100%); min-height: 42px; border: 1px solid #8b82df; border-radius: 9px; padding: 8px 10px; background: #fff; font: inherit; }

.governance-table { table-layout: fixed; width: 100%; min-width: 1120px; }
.governance-table th, .governance-table td { box-sizing: border-box; vertical-align: top; overflow-wrap: anywhere; }
.governance-table .col-id { width: 52px; }
.governance-table .col-type { width: 104px; }
.governance-table .col-status { width: 118px; }
.governance-table .col-name { width: 190px; }
.governance-table .col-scope { width: 180px; }
.governance-rules-table .col-trigger { width: 190px; }
.governance-table .col-effect { width: 250px; }
.governance-table .col-brand { width: 140px; }
.governance-table .col-actions { width: 172px; }
.governance-table thead th { position: sticky; top: 0; z-index: 3; background: #f2f3f8; }
.governance-table .table-action-select { width: 100%; min-width: 0; max-width: none; }

.dictionary-toolbar { align-items: flex-end; }
.dictionary-select-label { min-width: 250px !important; }
.dictionary-select-label select { min-height: 38px; }
.dictionary-load-state { align-self: center; max-width: 230px; font-size: 12px; color: #667085; line-height: 1.3; }

.match-mode-field { position: relative; min-width: 150px; }
.field-label-row { display: flex !important; align-items: center; justify-content: space-between; gap: 6px; }
.field-help-icon {
  width: 20px; height: 20px; padding: 0; border: 1px solid #9aa2bd; border-radius: 50%;
  background: #fff; color: #3b3d70; font-size: 12px; font-weight: 800; cursor: help; position: relative;
}
.field-help-icon::after {
  content: attr(data-tooltip); position: absolute; z-index: 80; left: 50%; bottom: calc(100% + 9px);
  transform: translateX(-50%) translateY(4px); width: 290px; padding: 9px 11px; border-radius: 9px;
  background: #17174f; color: #fff; font-weight: 500; line-height: 1.35; opacity: 0; visibility: hidden; pointer-events: none;
  box-shadow: 0 12px 28px rgba(23,23,79,.24); transition: .14s ease;
}
.field-help-icon:hover::after, .field-help-icon:focus::after { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.visually-hidden-select { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; opacity: 0 !important; pointer-events: none !important; }
.custom-select-down { position: relative; width: 100%; }
.custom-select-trigger { width: 100%; min-height: 38px; padding: 7px 30px 7px 10px; text-align: left; border: 1px solid #c9cce0; border-radius: 8px; background: #fff; color: #25265e; font: inherit; cursor: pointer; }
.custom-select-trigger::after { content: "▾"; position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
.custom-select-menu { position: absolute; z-index: 90; top: calc(100% + 5px); left: 0; right: 0; padding: 5px; border: 1px solid #c9cce0; border-radius: 9px; background: #fff; box-shadow: 0 12px 28px rgba(32,34,75,.18); }
.custom-select-menu[hidden] { display: none !important; }
.custom-select-menu button { width: 100%; padding: 8px 9px; text-align: left; border: 0; border-radius: 7px; background: transparent; color: #25265e; font: inherit; cursor: pointer; }
.custom-select-menu button:hover, .custom-select-menu button[aria-selected="true"] { background: #eeedff; }
.dictionary-add-row label small, #dictionaryMatchModeHelp, .dictionary-note-block { display: none !important; }

.test-filter-table thead { position: sticky; top: 0; z-index: 6; }
.test-filter-table thead tr:first-child th { background: #eef0f7; }
.test-filter-table .column-filter-row th { background: #f8f9fc; padding: 5px 4px; }
.test-filter-table .column-filter-row select { width: 100%; min-width: 95px; padding: 6px 22px 6px 7px; border: 1px solid #c9cce0; border-radius: 7px; background: #fff; font-size: 11px; }
.dictionary-results-wrap { max-height: 520px; overflow: auto; }

.dictionary-create-modal { width: min(680px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; }
.dictionary-create-grid { display: grid; grid-template-columns: repeat(2, minmax(220px, 1fr)); gap: 12px; padding: 4px 0 10px; }
.dictionary-create-grid label { display: grid; gap: 5px; font-size: 12px; font-weight: 650; }
.dictionary-create-grid .full-span { grid-column: 1 / -1; }
.dictionary-create-grid input, .dictionary-create-grid textarea { width: 100%; border: 1px solid #c9cce0; border-radius: 8px; padding: 9px 10px; font: inherit; }

@media (max-width: 760px) {
  .dictionary-create-grid { grid-template-columns: 1fr; }
  .dictionary-create-grid .full-span { grid-column: auto; }
  .dictionary-load-state { width: 100%; max-width: none; }
  .admin-feedback-modal { width: calc(100vw - 12px); max-height: calc(100vh - 12px); }
}

.dictionary-editor-card { overflow: visible !important; position: relative; }
.dictionary-workspace, .dictionary-panel { overflow: visible; }
