:root {
  --brand: #1f6f5c;
  --brand-dark: #155244;
  --brand-soft: #e7f3ef;
  --ink: #172321;
  --muted: #6d7b78;
  --line: #dfe7e4;
  --surface: #ffffff;
  --canvas: #f3f6f5;
  --warning: #a76709;
  --warning-soft: #fff6df;
  --danger: #b42318;
  --success: #18794e;
  --shadow: 0 8px 28px rgba(24, 54, 47, 0.07);
}

* { box-sizing: border-box; }

body {
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  margin: 0;
}

button, input, select { font: inherit; }

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  background: #102b25;
  color: #d8e7e3;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 26px 18px;
  position: fixed;
  width: 238px;
  z-index: 10;
}

.brand {
  align-items: center;
  color: #fff;
  display: flex;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  align-items: center;
  background: #e1b561;
  border-radius: 10px;
  color: #17352e;
  display: flex;
  font-size: 14px;
  font-weight: 800;
  height: 42px;
  justify-content: center;
  letter-spacing: -1px;
  width: 42px;
}

.brand strong { display: block; font-size: 19px; letter-spacing: -0.3px; }
.brand small { color: #9eb8b1; display: block; font-size: 11px; margin-top: 1px; }

.main-nav { display: grid; gap: 6px; margin-top: 44px; }
.main-nav .nav-link {
  align-items: center;
  border-radius: 8px;
  color: #b9cdc8;
  display: flex;
  font-size: 14px;
  gap: 10px;
  padding: 11px 12px;
}
.main-nav .nav-link:hover, .main-nav .nav-link.active { background: rgba(255,255,255,.09); color: #fff; }
.nav-icon { font-size: 20px; line-height: 1; width: 22px; }
.subnav { border-left: 1px solid rgba(255,255,255,.16); display: grid; gap: 2px; margin: 4px 0 5px 23px; padding-left: 12px; }
.subnav a { border-radius: 5px; color: #91aaa4; font-size: 11px; padding: 5px 7px; text-decoration: none; }
.subnav a:hover { background: rgba(255,255,255,.07); color: #fff; }

.sidebar-foot {
  align-items: center;
  border-top: 1px solid rgba(255,255,255,.1);
  color: #9eb8b1;
  display: flex;
  font-size: 12px;
  gap: 8px;
  margin-top: auto;
  padding-top: 20px;
}
.api-dot { background: #a44; border-radius: 50%; height: 8px; width: 8px; }
.api-dot.online { background: #54ce91; box-shadow: 0 0 0 3px rgba(84,206,145,.14); }

.main-content { margin-left: 238px; max-width: 1700px; padding: 38px 46px 70px; width: calc(100% - 238px); }
.page-header, .section-head, .detail-title, .guides-head { align-items: center; display: flex; justify-content: space-between; gap: 24px; }
.page-header { margin-bottom: 26px; }
.page-header h1 { font-size: clamp(27px, 3vw, 36px); letter-spacing: -1px; margin: 2px 0 5px; }
.page-header p, .detail-title p { color: var(--muted); margin: 0; }

.eyebrow { color: var(--brand); font-size: 11px !important; font-weight: 800; letter-spacing: 1.2px; margin: 0; text-transform: uppercase; }
.btn-brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-brand:hover, .btn-brand:focus { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-outline-brand { border: 1px solid var(--brand); color: var(--brand); }
.btn-outline-brand:hover { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-dark); }

.upload-card {
  align-items: center;
  background: var(--surface);
  border: 1.5px dashed #a7c8bf;
  border-radius: 14px;
  box-shadow: var(--shadow);
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  justify-content: space-between;
  margin-bottom: 22px;
  min-height: 122px;
  padding: 24px 28px;
  transition: .2s ease;
}
.upload-card.drag-active { background: var(--brand-soft); border-color: var(--brand); transform: translateY(-2px); }
.upload-copy { align-items: center; display: flex; gap: 17px; }
.upload-copy h2 { font-size: 17px; margin: 0 0 5px; }
.upload-copy p { color: var(--muted); font-size: 13px; margin: 0; }
.upload-icon {
  align-items: center;
  background: var(--brand-soft);
  border-radius: 50%;
  color: var(--brand);
  display: flex;
  font-size: 26px;
  height: 52px;
  justify-content: center;
  width: 52px;
}
.upload-card form { display: flex; gap: 9px; }
.selected-file { align-items: center; border-top: 1px solid var(--line); display: flex; gap: 11px; padding-top: 15px; width: 100%; }
.selected-file > span:nth-child(2) { display: flex; flex: 1; flex-direction: column; font-size: 13px; }
.selected-file small { color: var(--muted); }
.file-type { background: #edf2ff; border-radius: 5px; color: #425ca8; font-size: 10px; font-weight: 800; padding: 7px 5px; }
.remove-file { background: none; border: 0; color: var(--muted); font-size: 22px; }
.upload-progress { align-items: center; color: var(--muted); display: flex; font-size: 12px; gap: 12px; width: 100%; }
.upload-progress .progress { flex: 1; height: 6px; }
.upload-progress .progress-bar { background-color: var(--brand); }

.toast-message { border-left: 4px solid; border-radius: 8px; margin-bottom: 20px; padding: 13px 16px; }
.toast-message.success { background: #eaf8f1; border-color: var(--success); color: #12643f; }
.toast-message.warning { background: var(--warning-soft); border-color: var(--warning); color: #7c4a05; }
.toast-message.danger { background: #fff0ee; border-color: var(--danger); color: var(--danger); }
.toast-message.info { background: #eaf3ff; border-color: #3478bd; color: #21588d; }

.workspace-card, .result-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}
.workspace-card { padding: 24px; }
.section-head { margin-bottom: 14px; }
.section-head h2, .detail-title h2 { font-size: 20px; margin: 3px 0 0; }

.lote-list-toolbar { align-items: end; display: flex; gap: 18px; justify-content: space-between; margin-bottom: 12px; }
.lote-view-tabs { background: #f3f6f5; border-radius: 8px; display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 3px; }
.lote-view-tabs button { background: transparent; border: 0; border-radius: 6px; color: var(--muted); font-size: 12px; font-weight: 700; padding: 7px 10px; }
.lote-view-tabs button.active { background: #fff; box-shadow: 0 1px 4px rgba(20,48,39,.12); color: var(--brand); }
.lote-view-tabs span { background: var(--brand-soft); border-radius: 999px; display: inline-block; font-size: 10px; margin-left: 4px; min-width: 20px; padding: 2px 5px; text-align: center; }
.lote-search { color: var(--muted); display: flex; flex-direction: column; font-size: 10px; gap: 3px; text-transform: uppercase; width: min(320px, 100%); }
.lotes-pagination { align-items: center; color: var(--muted); display: flex; font-size: 12px; gap: 8px; justify-content: flex-end; min-height: 38px; padding-top: 10px; }
.lotes-pagination .btn { min-width: 34px; }

.lotes-list { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.lote-row {
  align-items: center;
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: inherit;
  display: grid;
  gap: 18px;
  grid-template-columns: 42px minmax(180px, 2fr) repeat(5, minmax(86px, .7fr)) minmax(120px, auto) 20px;
  padding: 15px 16px;
  text-align: left;
  width: 100%;
}
.lote-row[role="button"] { cursor: pointer; }
.lote-row.removed { background: #fafafa; color: #65716d; }
.lote-row:last-child { border-bottom: 0; }
.lote-row:hover { background: #f8fbfa; }
.lote-file-icon { background: var(--brand-soft); border-radius: 7px; color: var(--brand); font-size: 9px; font-weight: 900; padding: 11px 5px; text-align: center; }
.lote-main, .lote-data { display: flex; flex-direction: column; min-width: 0; }
.lote-main strong { font-size: 14px; }
.lote-main small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lote-data { font-size: 13px; }
.lote-data small { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.lote-data.money { font-weight: 700; }
.lote-guide-type strong { color: var(--brand); font-size: 12px; }
.lote-pending .status-pill { margin-top: 3px; width: fit-content; }
.lote-row-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.row-arrow { color: var(--muted); font-size: 24px; }

@media (max-width: 900px) {
  .lote-list-toolbar { align-items: stretch; flex-direction: column; }
  .lote-search { width: 100%; }
}

.campaign-form { align-items: end; display: grid; gap: 14px; grid-template-columns: minmax(220px, 1fr) minmax(280px, 1.5fr) auto; }
.campaign-form label { color: var(--muted); display: flex; flex-direction: column; font-size: 10px; gap: 5px; text-transform: uppercase; }
.campaign-help { color: var(--muted); font-size: 12px; margin: 12px 0 0; }
.campaign-card { border: 1px solid var(--line); border-radius: 9px; margin-bottom: 12px; overflow: hidden; }
.campaign-card-head { align-items: center; display: grid; gap: 16px; grid-template-columns: minmax(190px, 2fr) minmax(220px, 1.4fr) auto; padding: 16px; }
.campaign-title { display: flex; flex-direction: column; min-width: 0; }
.campaign-title small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.campaign-progress { min-width: 0; }
.campaign-progress-copy { color: var(--muted); display: flex; font-size: 11px; justify-content: space-between; margin-bottom: 5px; }
.campaign-progress .progress { height: 8px; }
.campaign-progress .progress-bar { background: var(--brand); }
.campaign-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.campaign-details { background: #f8faf9; border-top: 1px solid var(--line); padding: 14px 16px; }
.campaign-files { font-size: 12px; width: 100%; }
.campaign-files th, .campaign-files td { border-bottom: 1px solid var(--line); padding: 7px 8px; text-align: left; }
.campaign-files th { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.campaign-danger-note { color: var(--danger); font-size: 11px; margin-top: 8px; }

@media (max-width: 900px) {
  .campaign-form, .campaign-card-head { grid-template-columns: 1fr; }
  .campaign-actions { justify-content: flex-start; }
}

.status-pill { border-radius: 999px; display: inline-block; font-size: 11px; font-weight: 700; padding: 5px 9px; white-space: nowrap; }
.status-pill.success { background: #e4f5ed; color: var(--success); }
.status-pill.warning { background: var(--warning-soft); color: var(--warning); }

.result-card { border-left: 4px solid; margin-bottom: 22px; padding: 20px 24px; }
.result-success { border-left-color: var(--success); }
.result-warning { border-left-color: var(--warning); }
.result-title { align-items: center; display: flex; gap: 14px; }
.result-title h2 { font-size: 17px; margin: 2px 0; }
.result-title p:last-child { color: var(--muted); font-size: 12px; margin: 0; }
.result-icon { align-items: center; background: var(--brand-soft); border-radius: 50%; color: var(--brand); display: flex; font-size: 19px; font-weight: 800; height: 42px; justify-content: center; width: 42px; }
.result-warning .result-icon { background: var(--warning-soft); color: var(--warning); }
.result-metrics { display: grid; gap: 10px; grid-template-columns: repeat(5, 1fr); margin-top: 18px; }
.result-metric { background: #f6f8f7; border-radius: 7px; display: flex; flex-direction: column; padding: 10px 12px; }
.result-metric span { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.result-metric strong { font-size: 14px; margin-top: 2px; }
.result-metric.success strong { color: var(--success); }
.result-metric.danger strong { color: var(--danger); }
.import-issues { border-top: 1px solid var(--line); font-size: 12px; margin-top: 15px; padding-top: 12px; }
.import-issues summary { color: var(--brand); cursor: pointer; font-weight: 700; }
.import-issues ul { margin: 10px 0 0; padding-left: 20px; }
.import-issues li { margin: 5px 0; }

.lote-detail { scroll-margin-top: 20px; }
.back-button { background: none; border: 0; color: var(--brand); font-size: 12px; font-weight: 700; padding: 0; }
.metadata-grid, .modal-summary { border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(6, 1fr); margin-top: 20px; padding: 14px 0; }
.meta-item { border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 0 15px; }
.meta-item:first-child { padding-left: 0; }
.meta-item:last-child { border-right: 0; }
.meta-item span { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.meta-item strong { font-size: 13px; margin-top: 3px; overflow-wrap: anywhere; }

.metrics-grid { display: grid; gap: 12px; grid-template-columns: repeat(5, 1fr); margin: 22px 0 30px; }
.xsd-panel { align-items: flex-start; border: 1px solid; border-radius: 9px; display: flex; gap: 12px; margin-top: 18px; padding: 13px 15px; }
.xsd-panel.success { background: #f0faf5; border-color: #b9e0cd; color: var(--success); }
.xsd-panel.warning { background: var(--warning-soft); border-color: #eed59c; color: #754707; }
.xsd-panel-icon { align-items: center; background: rgba(255,255,255,.75); border-radius: 50%; display: flex; flex: 0 0 28px; font-weight: 800; height: 28px; justify-content: center; }
.xsd-panel p { color: inherit; font-size: 12px; margin: 2px 0 0; opacity: .86; }
.xsd-issues { border-top: 1px solid rgba(117,71,7,.2); margin-top: 9px; padding-top: 8px; }
.xsd-issues summary { cursor: pointer; font-size: 12px; font-weight: 700; }
.xsd-issues ol { margin: 10px 0 0; max-height: 280px; overflow: auto; padding-left: 23px; }
.xsd-issues li { font-size: 11px; margin-bottom: 9px; }
.xsd-issues li > span { margin-left: 8px; opacity: .75; }
.xsd-issues li p { overflow-wrap: anywhere; }
.xsd-guide-link { background: #fff; border: 1px solid currentColor; border-radius: 999px; color: inherit; cursor: pointer; font-size: 10px; font-weight: 700; margin-left: 8px; padding: 2px 8px; }
.xsd-guide-link:hover { background: rgba(117,71,7,.08); }
.structural-repair { border-bottom: 1px solid var(--line); padding: 14px 0; }
.structural-repair-panel { background: #f7faf9; border: 1px solid var(--line); border-radius: 9px; padding: 14px; }
.structural-repair-head { align-items: flex-start; display: flex; gap: 16px; justify-content: space-between; margin-bottom: 12px; }
.structural-repair-head p { color: var(--muted); font-size: 12px; margin: 3px 0 0; }
.structural-repair-table td:first-child { min-width: 260px; }
.structural-repair-table td small { color: var(--muted); display: block; font-size: 10px; max-width: 360px; }
.structural-repair-table input { min-width: 120px; }
.structural-repair-actions { align-items: center; display: flex; gap: 12px; justify-content: flex-end; }
.structural-repair-actions span { color: var(--muted); font-size: 11px; }
.structural-repair-actions span.error { color: var(--danger); }
.metric-card { align-items: center; border: 1px solid var(--line); border-radius: 9px; display: flex; gap: 11px; padding: 14px; }
.metric-card > span:last-child { display: flex; flex-direction: column; }
.metric-card small { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.metric-card strong { font-size: 16px; margin-top: 2px; }
.metric-icon { align-items: center; background: #eff3f2; border-radius: 8px; color: #61706d; display: flex; font-size: 14px; font-weight: 800; height: 35px; justify-content: center; width: 35px; }
.metric-icon.ok { background: #e4f5ed; color: var(--success); }
.metric-icon.alert { background: var(--warning-soft); color: var(--warning); }
.metric-icon.money { background: #eef1ff; color: #4d5ea9; font-size: 10px; }

.guides-head { margin-bottom: 13px; }
.guides-head h3 { font-size: 18px; margin: 2px 0 0; }
.guides-head > span { color: var(--muted); font-size: 12px; }
.filter-bar { display: grid; gap: 10px; grid-template-columns: minmax(260px, 1fr) 190px 190px; margin-bottom: 14px; }
.filter-bar .form-select, .search-field { border: 1px solid var(--line); border-radius: 7px; font-size: 12px; min-height: 39px; }
.search-field { align-items: center; display: flex; gap: 7px; padding: 0 11px; }
.search-field span { color: var(--muted); font-size: 20px; }
.search-field input { border: 0; outline: 0; width: 100%; }

.guides-table-wrap { border: 1px solid var(--line); border-radius: 8px; }
.guides-table { border-collapse: collapse; font-size: 12px; min-width: 1180px; width: 100%; }
.guides-table th { background: #f2f5f4; color: #56635f; font-size: 10px; letter-spacing: .25px; padding: 10px 11px; text-transform: uppercase; white-space: nowrap; }
.guides-table td { border-top: 1px solid var(--line); padding: 11px; vertical-align: middle; }
.guides-table tbody tr:hover { background: #f9fbfa; }
.order-cell { color: var(--muted); text-align: center; width: 54px; }
.guide-type { color: var(--brand); font-weight: 700; text-transform: uppercase; }
.primary-cell { display: block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.money-cell { font-weight: 700; text-align: right; white-space: nowrap; }
.icon-button { background: #f2f6f5; border: 0; border-radius: 6px; color: var(--brand); font-size: 20px; height: 30px; line-height: 1; width: 30px; }
.icon-button:hover { background: var(--brand-soft); }

.empty-state { color: var(--muted); padding: 36px 20px; text-align: center; }
.empty-state.compact { padding: 20px; }
.empty-state.error { color: var(--danger); }

.modal-content { border: 0; border-radius: 12px; box-shadow: 0 18px 60px rgba(0,0,0,.18); }
.modal-header { padding: 20px 24px; }
.modal-body { padding: 22px 24px 32px; }
.analysis-alert { border-radius: 8px; margin-bottom: 18px; padding: 12px 14px; }
.analysis-alert.warning { background: var(--warning-soft); color: #754707; }
.analysis-alert.success { background: #e8f7f0; color: var(--success); }
.analysis-alert div { margin-top: 6px; }
.analysis-alert span { background: rgba(255,255,255,.65); border-radius: 999px; display: inline-block; font-size: 11px; margin: 2px 4px 2px 0; padding: 3px 8px; }
.modal-summary { grid-template-columns: repeat(4, 1fr); margin: 0 0 22px; }
.detail-sections { display: grid; gap: 15px; grid-template-columns: repeat(3, 1fr); }
.detail-sections section { border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
.detail-sections h3, .modal-table-section h3 { font-size: 14px; margin: 0 0 10px; }
.detail-line { display: flex; font-size: 12px; justify-content: space-between; padding: 4px 0; }
.detail-line span { color: var(--muted); }
.detail-line strong { text-align: right; }
.modal-table-section { margin-top: 25px; }
.modal-table-title { align-items: center; display: flex; justify-content: space-between; margin-bottom: 10px; }
.modal-table-title h3 { margin-bottom: 0; }
.analysis-group-card { border: 1px solid var(--line); border-radius: 9px; padding: 14px 15px 8px; }
.analysis-group-card + .analysis-group-card { margin-top: 14px; }
.analysis-group-card > h3 { color: var(--brand-dark); }
.analysis-group-empty { background: #f8faf9; border-radius: 6px; color: var(--muted); font-size: 11px; margin-bottom: 7px; padding: 14px; }
.modal-table-section .table { font-size: 12px; }
.modal-table-section tr.procedure-invalid > td { background: #fff8e8; }
.modal-table-section tr.procedure-invalid > td:first-child { border-left: 3px solid var(--warning); }
.team-toggle-cell { padding-left: 5px !important; padding-right: 3px !important; width: 60px; }
.team-cell-actions { align-items: center; display: flex; gap: 4px; }
.team-toggle { align-items: center; background: var(--brand-soft); border: 1px solid #bad9d0; border-radius: 5px; color: var(--brand); display: inline-flex; font-size: 16px; font-weight: 700; height: 25px; justify-content: center; line-height: 1; padding: 0; width: 25px; }
.team-toggle:hover { background: var(--brand); color: #fff; }
.team-toggle[aria-expanded="true"] { background: var(--brand); color: #fff; }
.team-edit-toggle { align-items: center; background: #fff; border: 1px solid #bad9d0; border-radius: 5px; color: var(--brand); display: inline-flex; font-size: 13px; height: 25px; justify-content: center; line-height: 1; padding: 0; width: 25px; }
.team-edit-toggle:hover { background: var(--brand-soft); }
.procedure-team-row > td { background: #f5f9f8 !important; border-top: 0; padding-bottom: 12px; padding-top: 0; }
.procedure-team-row > .team-edit-cell { padding-left: 5px; padding-top: 12px; vertical-align: top; }
.procedure-team-panel { border-left: 3px solid var(--brand); padding: 10px 12px; }
.procedure-team-title { align-items: center; display: flex; justify-content: space-between; margin-bottom: 7px; }
.procedure-team-title strong { color: var(--brand-dark); font-size: 12px; }
.procedure-team-title span { color: var(--muted); font-size: 10px; }
.team-table { border-collapse: collapse; font-size: 11px; width: 100%; }
.team-table th { color: var(--muted); font-size: 9px; padding: 5px 7px; text-transform: uppercase; }
.team-table td { background: transparent !important; border-top: 1px solid var(--line); padding: 6px 7px; }
.detail-actions { align-items: flex-end; display: flex; flex-direction: column; gap: 10px; }
.export-alert { align-items: center; border: 1px solid; border-radius: 8px; display: flex; gap: 14px; margin: 16px 0; padding: 12px 14px; }
.export-alert strong { font-size: 12px; }
.export-alert span { color: inherit; flex: 1; font-family: ui-monospace, monospace; font-size: 10px; }
.export-alert.success { background: #e8f7f0; border-color: #b9e0cd; color: var(--success); }
.export-alert.warning { background: var(--warning-soft); border-color: #eed59c; color: #754707; }
.export-alert.danger { background: #fff0f0; border-color: #e8b9b9; color: var(--danger); }
.validation-actions { align-items: center; display: flex; flex-direction: column; gap: 2px; }
.validation-actions .btn-link, .modal-table-section td > .btn-link { color: var(--brand); font-size: 10px; padding: 2px; text-decoration: none; }
.correction-row > td { background: #f4f8f7 !important; padding: 12px !important; }
.correction-form { align-items: end; display: grid; gap: 10px; grid-template-columns: repeat(5, minmax(110px, 1fr)); }
.correction-form label { display: flex; flex-direction: column; gap: 4px; }
.correction-form label.wide { grid-column: span 2; }
.correction-form label > span { color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.correction-form input { font-size: 11px; }
.correction-buttons { align-items: center; display: flex; gap: 9px; min-height: 31px; }
.procedure-team-editor { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 13px; }
.procedure-team-editor-head, .procedure-team-editor-actions { align-items: center; display: flex; justify-content: space-between; }
.procedure-team-editor-head > div { display: flex; flex-direction: column; }
.procedure-team-editor-head strong { color: var(--brand-dark); font-size: 11px; }
.procedure-team-editor-head small { color: var(--muted); font-size: 9px; }
.correction-team-member { align-items: end; display: grid; gap: 9px; grid-template-columns: minmax(360px, 2fr) minmax(230px, 1fr) 34px; margin-top: 9px; }
.correction-team-member label { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.correction-team-member label > span { color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.procedure-team-editor-actions { justify-content: flex-start; gap: 9px; margin-top: 11px; }
.correction-team-message { color: var(--success); font-size: 10px; }
.correction-team-message.error { color: var(--danger); }
.correction-message { color: var(--success); font-size: 10px; }
.correction-message.error { color: var(--danger); }
.guide-correction { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 18px; padding: 11px 13px; }
.guide-correction > summary { color: var(--brand); cursor: pointer; font-size: 11px; font-weight: 700; }
.guide-correction-grid { display: grid; gap: 14px; margin-top: 12px; }
.guide-correction-grid .correction-form { border-top: 1px solid var(--line); padding-top: 12px; }
.new-guide-item-panel { background: #f4f8f7; border: 1px solid var(--line); border-radius: 8px; margin: 10px 0 14px; padding: 13px; }
.new-guide-item-grid { align-items: end; display: grid; gap: 10px; grid-template-columns: repeat(8, minmax(105px, 1fr)); }
.new-guide-item-grid label { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.new-guide-item-grid label > span, .new-guide-item-total > span { color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.new-guide-item-grid .item-field { grid-column: span 2; }
.new-guide-item-total { display: flex; flex-direction: column; gap: 6px; padding-bottom: 5px; }
.new-guide-item-total strong { color: var(--brand-dark); font-size: 12px; }
.new-guide-item-actions { align-items: center; display: flex; gap: 9px; margin-top: 12px; }
.new-guide-item-message { color: var(--success); font-size: 10px; }
.new-guide-item-message.error { color: var(--danger); }

.terminology-summary { display: grid; gap: 12px; grid-template-columns: minmax(300px, 2fr) repeat(3, minmax(150px, 1fr)); margin-bottom: 22px; }
.publication-card { background: #fff; border: 1px solid var(--line); border-radius: 9px; display: flex; flex-direction: column; justify-content: center; min-height: 92px; padding: 16px 18px; }
.publication-card.main { align-items: center; flex-direction: row; gap: 13px; justify-content: flex-start; }
.publication-card.main > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.publication-card small { color: var(--muted); font-size: 9px; letter-spacing: .35px; text-transform: uppercase; }
.publication-card strong { font-size: 13px; margin-top: 3px; overflow-wrap: anywhere; }
.publication-card em { color: var(--muted); font-size: 10px; font-style: normal; margin-top: 3px; }
.publication-card.metric strong { color: var(--brand-dark); font-size: 25px; }
.publication-card.hash strong { color: var(--success); }
.publication-icon { align-items: center; background: var(--brand-soft); border-radius: 9px; color: var(--brand); display: flex; flex: 0 0 48px; font-size: 10px; font-weight: 800; height: 48px; justify-content: center; }
.terminology-filters { align-items: end; display: grid; gap: 12px; grid-template-columns: minmax(250px, 1.2fr) minmax(280px, 1.5fr) 170px auto; margin: 18px 0 13px; }
.terminology-filters label { display: flex; flex-direction: column; gap: 5px; }
.terminology-filters label > span { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.terminology-filters .form-control, .terminology-filters .form-select { border-color: var(--line); font-size: 12px; min-height: 39px; }
.terminology-status { color: var(--muted); font-size: 11px; min-height: 27px; padding: 4px 1px 8px; }
.terminology-table-wrap { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.terminology-table { border-collapse: collapse; font-size: 12px; min-width: 1000px; width: 100%; }
.terminology-table th { background: #f2f5f4; color: #56635f; font-size: 9px; letter-spacing: .25px; padding: 10px 12px; text-transform: uppercase; white-space: nowrap; }
.terminology-table td { border-top: 1px solid var(--line); padding: 11px 12px; vertical-align: middle; }
.terminology-table tbody tr:hover { background: #f9fbfa; }
.terminology-table td:nth-child(n+3) { white-space: nowrap; }
.term-code { background: #edf5f2; border-radius: 5px; color: var(--brand-dark); display: inline-block; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; font-weight: 700; padding: 4px 7px; }
.status-pill.neutral { background: #edf0ef; color: #61706d; }
.terminology-pagination { align-items: center; color: var(--muted); display: flex; font-size: 11px; justify-content: space-between; min-height: 52px; padding-top: 12px; }
.terminology-pagination > div { display: flex; gap: 7px; }
.professionals-filters { grid-template-columns: minmax(320px, 1.8fr) minmax(220px, .8fr) auto; }
.rules-editor { margin-bottom: 20px; }
.rule-form-grid { display: grid; gap: 13px; grid-template-columns: repeat(4, minmax(160px, 1fr)); margin-top: 16px; }
.rule-form-grid label { display: flex; flex-direction: column; gap: 5px; }
.rule-form-grid label > span { color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.rule-form-grid .span-2 { grid-column: span 2; }
.rule-form-grid .span-4 { grid-column: span 4; }
.rule-active { align-items: center; flex-direction: row !important; padding-top: 25px; }
.rules-table { min-width: 1250px; }
.rules-table td small { color: var(--muted); display: block; font-size: 9px; margin-top: 3px; }
.rules-table td:nth-child(5) { max-width: 320px; white-space: normal; }
.rule-actions { display: flex; gap: 5px; }
.matmed-filters { grid-template-columns: minmax(220px, .7fr) minmax(360px, 2fr) auto; }
.matmed-table { min-width: 1450px; }
.matmed-table td:nth-child(3) { min-width: 290px; white-space: normal; }
.matmed-table td:nth-child(3) small { color: var(--muted); display: block; font-size: 9px; margin-top: 4px; }
.matmed-table td:nth-child(4), .matmed-table td:nth-child(5) { max-width: 260px; overflow-wrap: anywhere; white-space: normal; }
.procedure-catalog-filters { grid-template-columns: minmax(360px, 1fr) auto; }
.procedures-catalog-table { min-width: 1250px; }
.procedures-catalog-table td:nth-child(3), .procedures-catalog-table td:nth-child(4) { max-width: 420px; overflow-wrap: anywhere; white-space: normal; }
.daily-rates-table { min-width: 1050px; }
.daily-rates-table th:first-child, .daily-rates-table td:first-child { padding-left: 10px; padding-right: 4px; width: 38px; }
.daily-rates-table td:nth-child(5) { max-width: 480px; overflow-wrap: anywhere; white-space: normal; }
.daily-rate-toggle { align-items: center; background: var(--brand-soft); border: 1px solid #b9dbd0; border-radius: 5px; color: var(--brand); display: inline-flex; font-size: 15px; font-weight: 700; height: 25px; justify-content: center; line-height: 1; padding: 0; width: 25px; }
.daily-rate-toggle:hover, .daily-rate-toggle[aria-expanded="true"] { background: var(--brand); color: #fff; }
.daily-rate-detail-row:hover { background: transparent !important; }
.daily-rate-detail-row td { background: #f5faf8; border-top: 0; padding-bottom: 14px; padding-top: 2px; }
.daily-rate-detail { border-left: 3px solid var(--brand); padding: 10px 14px; }
.daily-rate-detail small { color: var(--brand-dark); display: block; font-size: 9px; font-weight: 800; letter-spacing: .25px; margin-bottom: 5px; text-transform: uppercase; }
.daily-rate-detail p { color: var(--ink); line-height: 1.5; margin: 0; overflow-wrap: anywhere; white-space: normal; }
.audit-filters { align-items: end; display: grid; gap: 12px; grid-template-columns: minmax(380px, 2fr) repeat(3, minmax(150px, .7fr)); }
.audit-presets-card { margin-bottom: 22px; }
.audit-opportunity-note { color: var(--muted); font-size: 11px; margin-bottom: 16px; }
.audit-presets-grid { display: grid; gap: 12px; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.audit-preset { background: var(--surface-soft); border: 1px solid var(--line); border-radius: 10px; display: flex; flex-direction: column; min-height: 250px; padding: 15px; }
.audit-preset.revenue { border-top: 3px solid var(--brand); }
.audit-preset.context { border-top: 3px solid #c58b21; }
.audit-preset > div:first-child { align-items: center; color: var(--muted); display: flex; justify-content: space-between; }
.audit-preset-number { color: var(--brand); font-size: 10px; font-weight: 800; }
.audit-preset h3 { font-size: 15px; margin: 12px 0 7px; }
.audit-preset p { color: var(--muted); flex: 1; font-size: 11px; line-height: 1.45; }
.audit-preset-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0 13px; }
.audit-preset-tags span { background: #fff; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 9px; padding: 3px 7px; }
.audit-result-filters { align-items: end; display: grid; gap: 10px; grid-template-columns: 240px 220px minmax(220px, 1fr); margin-bottom: 12px; }
.audit-result-filters label { display: grid; gap: 5px; }
.audit-result-filters label > span { color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.audit-active-preset { align-items: center; background: var(--brand-soft); border: 1px solid #b9ded4; border-radius: 8px; display: flex; justify-content: space-between; min-height: 38px; padding: 7px 11px; }
.audit-active-preset strong { color: var(--brand-dark); font-size: 11px; }
.audit-active-preset span { color: var(--muted); font-size: 10px; }
.hybrid-audit-card { margin-bottom: 22px; }
.hybrid-saved-head, .hybrid-result-head { align-items: center; display: flex; justify-content: space-between; margin-bottom: 10px; }
.hybrid-saved-head h3, .hybrid-result-head h3 { font-size: 12px; margin: 0; }
.hybrid-saved-head small { color: var(--muted); font-size: 9px; }
.hybrid-saved-head-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.hybrid-saved-cards { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 16px; }
.hybrid-saved-card { background: var(--surface-soft); border: 1px solid var(--line); border-radius: 9px; display: flex; flex-direction: column; min-width: 0; padding: 13px; }
.hybrid-saved-card-head { align-items: center; display: flex; gap: 9px; }
.hybrid-saved-card-head h3 { font-size: 12px; margin: 0; }
.hybrid-saved-card-head small { color: var(--muted); font-size: 9px; }
.hybrid-saved-card > p { color: var(--muted); flex: 1; font-size: 10px; margin: 9px 0; }
.hybrid-card-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.hybrid-editing-card { margin-bottom: 14px; }
.hybrid-editing-card > div { align-items: center; display: flex; gap: 6px; }
.hybrid-editing-card > div:first-child { align-items: flex-start; flex-direction: column; }
.hybrid-audit-form { align-items: end; display: grid; gap: 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.hybrid-audit-form > label { display: grid; gap: 5px; min-width: 0; }
.hybrid-audit-form > label > span { color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.hybrid-item-control { display: grid; gap: 6px; grid-template-columns: 135px minmax(0, 1fr); }
.hybrid-form-actions { display: flex; gap: 8px; justify-content: flex-end; }
.hybrid-results { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 18px; }
.hybrid-facets { display: grid; gap: 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 14px; }
.hybrid-facet { background: var(--surface-soft); border: 1px solid var(--line); border-radius: 9px; min-width: 0; padding: 13px; }
.hybrid-facet h3, .hybrid-guides h3 { font-size: 12px; margin: 0 0 10px; }
.hybrid-facet > div { align-items: center; border-top: 1px solid var(--line); display: flex; font-size: 10px; gap: 8px; justify-content: space-between; padding: 6px 0; }
.hybrid-facet > div span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hybrid-facet > div strong { color: var(--brand-dark); flex: 0 0 auto; }
.hybrid-facet small, .hybrid-guides h3 small { color: var(--muted); font-size: 9px; font-weight: 400; }
.hybrid-guides { margin-top: 20px; }
.hybrid-guides table { font-size: 10px; }
.anesthesia-evidence-cell { display: grid; gap: 4px; min-width: 190px; }
.anesthesia-evidence-cell .status-pill { justify-self: start; }
.anesthesia-evidence-cell small { color: var(--muted); font-size: 9px; line-height: 1.35; }
.anesthetic-medications { display: grid; gap: 5px; min-width: 220px; }
.anesthetic-medications > div { display: grid; }
.anesthetic-medications strong { color: var(--brand-dark); font-size: 9px; }
.anesthetic-medications small { color: var(--muted); font-size: 8px; line-height: 1.3; }
.hybrid-card-criteria { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 12px; }
.hybrid-card-criteria > small, .form-label-small { color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.audit-filters label { display: grid; gap: 6px; }
.audit-filters label > span { color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.audit-checkbox { align-items: center !important; display: flex !important; min-height: 38px; }
.audit-checkbox span { font-size: 11px !important; text-transform: none !important; }
.audit-table { min-width: 1500px; }
.audit-table td:nth-child(3) { max-width: 340px; white-space: normal; }
.audit-table td:nth-child(3) small, #audit-candidates td small { color: var(--muted); display: block; margin-top: 3px; }
.audit-actions { display: flex; gap: 5px; white-space: nowrap; }
.audit-candidates-card { margin-top: 22px; }
.audit-pattern-note { color: var(--muted); font-size: 11px; }
.pattern-source { background: var(--surface-soft); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 18px; padding: 12px 14px; }
.pattern-source strong, .pattern-source small { display: block; }
.pattern-form-grid { display: grid; gap: 12px; grid-template-columns: repeat(4, minmax(150px, 1fr)); }
.pattern-form-grid label { display: grid; gap: 5px; }
.pattern-form-grid label > span, .equivalent-item-row label > span { color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.pattern-form-grid .wide { grid-column: span 2; }
.pattern-equivalents { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 15px; }
.equivalent-item-row { align-items: end; display: grid; gap: 10px; grid-template-columns: 110px 180px minmax(280px, 1fr) auto; margin-top: 8px; }
.equivalent-item-row label { display: grid; gap: 4px; }
.pattern-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.professionals-table { min-width: 1050px; }
.professionals-table .form-control { border-color: var(--line); font-size: 11px; min-width: 105px; }
.professionals-table .form-control:disabled { background: transparent; border-color: transparent; color: var(--ink); opacity: 1; padding-left: 0; }
.professionals-table .form-select:disabled { background-color: transparent; background-image: none; border-color: transparent; color: var(--ink); opacity: 1; padding-left: 0; }
.professionals-table tr.editing { background: #f4faf8; }
.professionals-table tr.editing .form-control, .professionals-table tr.editing .form-select { background-color: #fff; border-color: #9fc8bd; padding-left: .5rem; }
.professionals-table .professional-name { min-width: 210px; }
.professionals-table .uf-input { min-width: 55px; width: 55px; }
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--surface-soft); }
.auth-card { width: min(430px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 32px; box-shadow: 0 18px 50px rgba(16, 54, 45, .10); }
.auth-brand { color: var(--ink); margin-bottom: 28px; }
.auth-form, .account-content { display: grid; gap: 16px; }
.auth-form label, .account-content label { display: grid; gap: 6px; }
.auth-form label span, .account-content label > span { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.auth-card-wide { width: min(720px, 100%); }
.auth-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.auth-span-2 { grid-column: 1 / -1; }
.auth-form label small { color: var(--muted); font-size: 11px; }
.auth-check { align-items: center; display: flex !important; grid-template-columns: auto 1fr; }
.auth-check span { text-transform: none !important; }
.auth-secondary { align-items: center; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: center; margin-top: 22px; padding-top: 18px; }
@media (max-width: 620px) {
  .auth-form-grid { grid-template-columns: 1fr; }
  .auth-span-2 { grid-column: auto; }
}
.account-page { width: min(820px, calc(100% - 32px)); margin: 40px auto; }
.account-page-wide { width: min(1120px, calc(100% - 32px)); }
.account-workspace { max-width: 1320px; width: 100%; }
.account-summary { display: grid; margin-bottom: 8px; }
.account-summary strong { font-size: 20px; }.account-summary span { color: var(--muted); }
.company-profile-form { display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.company-profile-form label { display: grid; gap: 5px; }
.company-profile-form label > span { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.company-profile-form .span-2 { grid-column: span 2; }
.profile-group-title { border-bottom: 1px solid var(--line); color: var(--brand); font-size: 14px; font-weight: 800; grid-column: 1 / -1; margin: 10px 0 0; padding-bottom: 8px; text-transform: uppercase; }
.profile-form-actions { align-items: center; display: flex; gap: 15px; grid-column: 1 / -1; }
.profile-form-actions small { color: var(--muted); }
.operator-link-section { border-top: 1px solid var(--line); padding-top: 20px; }
.operator-link-section h3 { font-size: 17px; margin-bottom: 4px; }
.operator-link-section p { color: var(--muted); font-size: 13px; }
.operator-code-cell { align-items: center; display: flex; gap: 8px; min-width: 280px; }
.company-user-form { align-items: end; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 9px; display: grid; gap: 12px; grid-template-columns: 1.2fr 1.2fr 1fr 1fr; padding: 16px; }
.company-user-form label { display: grid; gap: 5px; }
.company-user-form label > span { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.company-user-form label small { color: var(--muted); font-size: 9px; }
.company-user-form-actions { display: flex; gap: 8px; grid-column: 1 / -1; }
.role-help { display: flex; flex-wrap: wrap; gap: 8px; }
.role-help span { background: var(--surface-soft); border-radius: 6px; color: var(--muted); font-size: 10px; padding: 6px 8px; }
.company-users-table td { vertical-align: middle; }
.company-users-table td:first-child strong, .company-users-table td:first-child small { display: block; }
.company-users-table td:first-child small { color: var(--muted); }
.own-catalog-form { align-items: end; display: grid; gap: 12px; grid-template-columns: 160px minmax(260px,2fr) 170px 170px; }
.own-catalog-form label { display: grid; gap: 5px; }
.own-catalog-form label > span { color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.own-catalog-form .wide { grid-column: span 2; }
.own-form-actions { display: flex; gap: 8px; grid-column: 1 / -1; }
.own-catalog-filters { grid-template-columns: minmax(280px,2fr) 190px 170px auto; }
.own-catalog-table { min-width: 1050px; }
.own-catalog-table td small { color: var(--muted); display: block; font-size: 9px; margin-top: 3px; }
.own-catalog-detail { background: var(--surface-soft); border-left: 3px solid var(--brand); padding: 12px; }
@media (max-width: 900px) { .company-user-form { grid-template-columns: 1fr 1fr; } }
@media (max-width: 900px) { .company-profile-form { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .company-user-form { grid-template-columns: 1fr; } .company-user-form-actions { grid-column: auto; } }
@media (max-width: 620px) { .company-profile-form { grid-template-columns: 1fr; } .company-profile-form .span-2, .profile-form-actions { grid-column: auto; } }
.admin-page { width: min(1180px, calc(100% - 32px)); }
.admin-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; align-items: end; }
.professional-term { display: flex; flex-direction: column; gap: 4px; min-width: 125px; }
.professional-term a { color: var(--muted); display: block; font-size: 9px; line-height: 1.2; max-width: 190px; overflow: hidden; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.professional-term.valid a { color: var(--success); }
.professional-term.invalid .form-control { background: #fff8f7; border-color: #d99b94; }
.professional-term.invalid a { color: var(--danger); }
.tiss-combo { position: relative; }
.tiss-combo-control { display: flex; min-width: 125px; }
.tiss-combo-control .form-control { border-radius: .25rem 0 0 .25rem; min-width: 0; }
.tiss-combo-toggle { background: #fff; border: 1px solid #9fc8bd; border-left: 0; border-radius: 0 .25rem .25rem 0; color: var(--brand); min-width: 28px; }
.tiss-combo-toggle:disabled { background: transparent; border-color: transparent; visibility: hidden; }
.tiss-combo-menu { background: #fff; border: 1px solid var(--line); border-radius: 7px; box-shadow: 0 12px 30px rgba(24,54,47,.18); max-height: 300px; overflow-y: auto; padding: 5px; position: fixed; z-index: 1080; }
.tiss-combo-option { align-items: flex-start; background: #fff; border: 0; border-radius: 5px; color: var(--ink); display: flex; gap: 9px; padding: 8px 9px; text-align: left; width: 100%; }
.tiss-combo-option:hover, .tiss-combo-option:focus { background: var(--brand-soft); outline: 0; }
.tiss-combo-option strong { color: var(--brand-dark); flex: 0 0 52px; font-family: ui-monospace, monospace; font-size: 10px; }
.tiss-combo-option span { font-size: 11px; white-space: normal; }
.tiss-combo-option.empty, .tiss-combo-empty { color: var(--muted); font-size: 11px; padding: 8px 9px; }
.professional-actions { align-items: center; display: flex; gap: 5px; }
.billing-section { scroll-margin-top: 18px; }
.billing-workspace-tabs { margin-bottom: 18px; }
.billing-workspace-tabs .nav-link { align-items: center; display: inline-flex; gap: 8px; }
.billing-tab-count { background: #edf1f0; border-radius: 999px; color: var(--muted); font-size: 9px; font-weight: 800; min-width: 22px; padding: 2px 6px; text-align: center; }
.billing-workspace-tabs .nav-link.active .billing-tab-count { background: var(--brand-soft); color: var(--brand); }
.billing-form { background: #f8fbfa; border: 1px solid var(--line); border-radius: 9px; margin: 17px 0 22px; padding: 20px; }
.billing-form-grid { display: grid; gap: 13px; grid-template-columns: repeat(4, minmax(150px, 1fr)); }
.billing-form-grid .span-2 { grid-column: span 2; }
.billing-form label, .procedure-row label { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.billing-form label > span, .procedure-row label > span { color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.billing-form .form-control, .billing-form .form-select { border-color: var(--line); font-size: 12px; min-height: 38px; }
.billing-form fieldset { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 16px; }
.billing-form legend { color: var(--brand-dark); float: none; font-size: 12px; font-weight: 800; margin: 0; width: auto; }
.fieldset-head { align-items: center; display: flex; justify-content: space-between; margin-bottom: 11px; }
.fieldset-head-actions { align-items: center; display: flex; gap: 8px; }
.procedure-row { align-items: end; background: #fff; border: 1px solid var(--line); border-radius: 7px; display: grid; gap: 9px; grid-template-columns: 125px 100px 100px 75px 125px minmax(220px, 1fr) 90px 120px 28px; margin-bottom: 8px; padding: 11px; }
.procedure-row .wide { min-width: 200px; }
.remove-procedure { background: none; border: 0; color: var(--danger); font-size: 20px; height: 36px; }
.procedure-team { align-self: stretch; background: #f8fbfa; border-radius: 6px; grid-column: 1 / -1; padding: 10px; }
.procedure-team-head { align-items: center; display: flex; justify-content: space-between; }
.procedure-team-head strong { color: var(--brand-dark); font-size: 11px; }
.team-member-row { align-items: end; display: grid; gap: 9px; grid-template-columns: minmax(300px, 2fr) minmax(220px, 1fr) 34px; margin-top: 8px; }
.team-member-row .tiss-combo-control { min-width: 0; }
.team-member-row .remove-team-member { height: 38px; }
.guide-items-table-wrap { border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; }
.guide-items-table { border-collapse: separate; border-spacing: 0; font-size: 11px; min-width: 1180px; width: 100%; }
.guide-items-table th { background: #f2f5f4; color: #56635f; font-size: 9px; letter-spacing: .25px; padding: 9px 8px; text-transform: uppercase; white-space: nowrap; }
.guide-items-table td { background: #fff; border-top: 1px solid var(--line); padding: 8px; vertical-align: middle; }
.guide-items-table th:first-child { width: 38%; }
.guide-items-table th:nth-child(2) { width: 125px; }
.guide-items-table th:nth-child(3) { width: 125px; }
.guide-items-table th:nth-child(4) { width: 165px; }
.guide-items-table th:nth-child(5) { width: 90px; }
.guide-items-table th:nth-child(6) { width: 110px; }
.guide-items-table th:nth-child(7) { width: 105px; }
.guide-items-table .form-control, .guide-items-table .form-select { font-size: 11px; min-height: 35px; }
.guide-item-row .item-catalog-combo, .guide-item-row .item-catalog-search { min-width: 0; }
.guide-item-total { font-weight: 700; text-align: right; white-space: nowrap; }
.guide-items-table .empty-state-row td { color: var(--muted); padding: 24px; text-align: center; }
.guide-items-table tfoot td { background: #f8fbfa; color: var(--muted); font-size: 10px; font-weight: 700; }
.guide-items-table tfoot td:nth-child(6), .guide-items-table tfoot td:nth-child(7) { color: var(--brand-dark); text-align: right; }
.billing-items-actions { align-items: center; display: flex; gap: 12px; justify-content: flex-end; margin-top: 12px; }
.billing-items-actions span { color: var(--brand-dark); font-size: 11px; font-weight: 700; }
.billing-form-actions { display: flex; gap: 9px; justify-content: flex-end; margin-top: 20px; }
.billing-list { margin-top: 15px; }
.billing-table { min-width: 900px; }
.billing-table td small { color: var(--muted); display: block; font-size: 9px; margin-top: 2px; }
.guide-selector { max-height: 300px; overflow-y: auto; }
.guide-option { align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; display: flex !important; flex-direction: row !important; gap: 10px !important; margin: 7px 0; padding: 10px 12px; }
.guide-option > span { display: flex; flex-direction: column; }
.guide-option strong { font-size: 12px; }
.guide-option small { color: var(--muted); font-size: 10px; }

@media (max-width: 1150px) {
  .sidebar { width: 200px; }
  .main-content { margin-left: 200px; padding: 30px 26px 60px; width: calc(100% - 200px); }
  .result-metrics, .metrics-grid { grid-template-columns: repeat(3, 1fr); }
  .lote-row { grid-template-columns: 42px minmax(160px, 2fr) repeat(4, .7fr) auto 20px; }
  .lote-row .lote-data:not(.money):not(.lote-pending):not(.lote-guide-type) { display: none; }
  .metadata-grid { grid-template-columns: repeat(3, 1fr); row-gap: 18px; }
  .meta-item:nth-child(3) { border-right: 0; }
  .terminology-summary { grid-template-columns: repeat(2, 1fr); }
  .terminology-filters { grid-template-columns: 1fr 1fr; }
  .billing-form-grid { grid-template-columns: repeat(2, 1fr); }
  .rule-form-grid { grid-template-columns: repeat(2, 1fr); }
  .rule-form-grid .span-4 { grid-column: span 2; }
  .procedure-row { grid-template-columns: repeat(4, minmax(100px, 1fr)); }
  .procedure-row .wide { grid-column: span 2; }
  .new-guide-item-grid { grid-template-columns: repeat(4, minmax(105px, 1fr)); }
  .audit-presets-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .audit-result-filters { grid-template-columns: 1fr 1fr; }
  .audit-active-preset { grid-column: span 2; }
  .hybrid-audit-form, .hybrid-facets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hybrid-saved-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { min-height: auto; padding: 14px 18px; position: static; width: 100%; }
  .brand small, .main-nav, .sidebar-foot { display: none; }
  .main-content { margin-left: 0; padding: 24px 15px 50px; width: 100%; }
  .page-header { align-items: flex-start; }
  .page-header p:not(.eyebrow) { display: none; }
  .page-header .btn { font-size: 12px; }
  .upload-card { align-items: stretch; padding: 20px; }
  .upload-card form { width: 100%; }
  .upload-card form .btn { flex: 1; }
  .workspace-card { padding: 17px; }
  .lote-row { grid-template-columns: 38px 1fr auto 16px; gap: 11px; }
  .lote-data, .lote-row .status-pill { display: none; }
  .result-metrics, .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .metadata-grid { grid-template-columns: repeat(2, 1fr); }
  .meta-item { border-right: 0; padding: 0 10px; }
  .filter-bar { grid-template-columns: 1fr; }
  .detail-sections { grid-template-columns: 1fr; }
  .new-guide-item-grid { grid-template-columns: 1fr 1fr; }
  .new-guide-item-grid .item-field { grid-column: span 2; }
  .modal-summary { grid-template-columns: repeat(2, 1fr); }
  .terminology-summary, .terminology-filters { grid-template-columns: 1fr; }
  .detail-actions { align-items: flex-start; }
  .export-alert { align-items: flex-start; flex-direction: column; }
  .correction-form { grid-template-columns: 1fr 1fr; }
  .correction-form label.wide { grid-column: span 2; }
  .billing-form-grid, .procedure-row { grid-template-columns: 1fr 1fr; }
  .procedure-row .wide { grid-column: span 2; }
  .rule-form-grid { grid-template-columns: 1fr; }
  .rule-form-grid .span-2, .rule-form-grid .span-4 { grid-column: span 1; }
  .audit-presets-grid, .audit-result-filters { grid-template-columns: 1fr; }
  .audit-active-preset { align-items: flex-start; flex-direction: column; grid-column: span 1; }
  .hybrid-audit-form, .hybrid-facets { grid-template-columns: 1fr; }
  .hybrid-saved-cards { grid-template-columns: 1fr; }
  .hybrid-item-control { grid-template-columns: 115px minmax(0, 1fr); }
  .hybrid-form-actions { justify-content: stretch; }
  .hybrid-form-actions .btn { flex: 1; }
}
.operator-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem 1.5rem; border: 1px solid var(--line); border-radius: .65rem; padding: 1rem; }
.operator-options legend { float: none; width: auto; margin: 0 0 .5rem; padding: 0 .35rem; color: var(--brand-dark); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.operator-options label { display: flex; align-items: center; gap: .55rem; color: var(--ink); }
.operator-notes { display: grid; gap: .4rem; }
@media (max-width: 760px) { .operator-options { grid-template-columns: 1fr; } }
