:root {
  --bg: #0b1120;
  --surface: #111827;
  --surface-2: #182235;
  --surface-3: #22304a;
  --border: #29364c;
  --text: #e8eef8;
  --muted: #91a0b7;
  --primary: #3b82f6;
  --primary-strong: #2563eb;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #38bdf8;
  --purple: #8b5cf6;
  --radius: 14px;
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 254px; padding: 22px 16px;
  background: var(--surface); border-right: 1px solid var(--border); display: flex;
  flex-direction: column; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 22px; }
.brand-mark {
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px;
  background: linear-gradient(145deg, var(--primary), #22d3ee); color: white; font-weight: 800;
}
.brand strong { display: block; font-size: 1.02rem; }
.brand small { color: var(--muted); }
.nav { display: grid; gap: 6px; }
.nav a { color: var(--muted); padding: 11px 12px; border-radius: 10px; font-weight: 600; }
.nav a:hover, .nav a.active { color: white; background: rgba(59, 130, 246, .16); }
.sidebar-footer { margin-top: auto; padding: 16px 8px 0; border-top: 1px solid var(--border); }
.org-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-name { color: var(--muted); font-size: .84rem; margin: 4px 0 12px; }
.link-button { background: none; border: 0; color: var(--muted); padding: 0; cursor: pointer; }
.link-button:hover { color: white; }

.main { margin-left: 254px; min-height: 100vh; }
.topbar { height: 70px; display: flex; align-items: center; padding: 0 28px; border-bottom: 1px solid var(--border); }
.topbar-title { color: var(--muted); font-size: .9rem; }
.content { padding: 28px; max-width: 1500px; margin: 0 auto; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-header h1 { margin: 0 0 6px; font-size: clamp(1.5rem, 2vw, 2rem); }
.page-header p { margin: 0; color: var(--muted); }

.grid { display: grid; gap: 18px; }
.grid-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card { background: linear-gradient(180deg, rgba(255, 255, 255, .018), rgba(255, 255, 255, 0)), var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.eyebrow { display: inline-flex; margin-bottom: 7px; color: #93c5fd; font-size: .72rem; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
.stat-label { color: var(--muted); font-size: .85rem; font-weight: 650; }
.stat-value { font-size: 2rem; font-weight: 800; margin-top: 13px; }
.stat-money { font-size: clamp(1.05rem, 1.7vw, 1.45rem); }
.stat-accent { width: 34px; height: 4px; border-radius: 9px; background: var(--primary); margin-top: 14px; }
.stat-success { background: var(--success); }
.stat-danger { background: var(--danger); }
.stat-warning { background: var(--warning); }
.stat-card { position: relative; overflow: hidden; }
.stat-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--primary); opacity: .75; }
.stat-card-danger::before { background: var(--danger); }
.stat-card-success::before { background: var(--success); }
.stat-card-money::before { background: var(--purple); }
.section-title { margin: 0 0 16px; font-size: 1rem; }
.section-spaced { margin-top: 18px; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.section-heading h2 { margin: 0; font-size: 1.05rem; }
.section-heading p { margin: 4px 0 0; color: var(--muted); font-size: .9rem; }
.section-heading-inline { margin-bottom: 16px; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 9px 15px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; font-weight: 700; }
.btn-primary { color: white; background: var(--primary); }
.btn-primary:hover { background: var(--primary-strong); }
.btn-secondary { color: var(--text); border-color: var(--border); background: var(--surface-2); }
.btn-secondary:hover { background: var(--surface-3); }
.btn-danger { color: #fecaca; border-color: rgba(239, 68, 68, .35); background: rgba(239, 68, 68, .12); }
.btn-small { min-height: 34px; padding: 6px 10px; font-size: .82rem; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.search-bar { margin-bottom: 18px; }
.search-bar input { width: min(460px, 100%); }
input, select, textarea {
  width: 100%; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59, 130, 246, .18); }
input[type="checkbox"] { width: auto; }
label { display: block; font-weight: 700; margin-bottom: 7px; }
.field { margin-bottom: 18px; }
.helptext { display: block; color: var(--muted); font-size: .8rem; margin-top: 6px; }
.errorlist { color: #fca5a5; margin: 6px 0; padding-left: 20px; }
.form-card { max-width: 920px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.span-2 { grid-column: 1 / -1; }
.profile-page-header { max-width: 1120px; }
.profile-form { display: grid; gap: 18px; max-width: 1120px; }
.profile-form-section { padding: clamp(20px, 3vw, 30px); }
.profile-section-heading { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 24px; }
.profile-section-heading h2 { margin: 0 0 4px; font-size: 1.12rem; }
.profile-section-heading p { margin: 0; color: var(--muted); line-height: 1.5; }
.profile-section-number { display: grid; place-items: center; flex: 0 0 36px; height: 36px; border-radius: 10px; background: rgba(59, 130, 246, .16); color: #bfdbfe; font-size: .8rem; font-weight: 800; }
.profile-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 22px; }
.profile-field-grid .field { min-width: 0; margin: 0; }
.profile-field-full { grid-column: 1 / -1; }
.profile-field-grid label:not(.profile-status-field label) { margin-bottom: 8px; }
.profile-field-grid textarea { min-height: 94px; resize: vertical; }
.profile-choice-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.profile-choice-fieldset + .profile-choice-fieldset { margin-top: 24px; }
.profile-choice-fieldset legend { padding: 0; font-weight: 800; font-size: .95rem; }
.profile-choice-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 3px 0 14px; }
.profile-choice-heading .helptext { margin: 0; }
.profile-choice-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.profile-choice-tools output { color: #bfdbfe; font-size: .78rem; font-weight: 800; white-space: nowrap; }
.profile-choice-tools button { padding: 3px 0; color: #93c5fd; background: transparent; border: 0; cursor: pointer; font-size: .8rem; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.profile-choice-tools button:hover { color: white; }
.profile-choice-tools button:focus-visible { outline: 2px solid #93c5fd; outline-offset: 3px; border-radius: 3px; }
.profile-choice-fieldset .checkbox-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 9px; }
.profile-choice-fieldset .modality-options { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.profile-choice-fieldset .checkbox-options > div { min-width: 0; }
.profile-choice-fieldset .checkbox-options label { display: flex; align-items: center; gap: 10px; height: 100%; min-height: 48px; margin: 0; padding: 10px 12px; border: 1px solid #34435a; border-radius: 10px; background: rgba(11, 17, 32, .32); color: var(--text); cursor: pointer; font-size: .89rem; font-weight: 650; line-height: 1.35; overflow-wrap: anywhere; transition: border-color .15s, background-color .15s, box-shadow .15s; }
.profile-choice-fieldset .checkbox-options label:hover { border-color: #6884a7; background: rgba(59, 130, 246, .08); }
.profile-choice-fieldset .checkbox-options input[type="checkbox"] { appearance: auto; width: 18px; height: 18px; min-width: 18px; margin: 0; padding: 0; border: 0; flex: 0 0 18px; accent-color: #3b82f6; cursor: pointer; }
.profile-choice-fieldset .checkbox-options label:has(input:checked),
.profile-choice-fieldset .checkbox-options label.is-selected { border-color: #60a5fa; background: rgba(59, 130, 246, .22); box-shadow: inset 3px 0 0 #60a5fa; color: #fff; }
.profile-choice-fieldset .checkbox-options label:has(input:focus-visible) { outline: 2px solid #93c5fd; outline-offset: 2px; }
.profile-location-cities { max-width: 650px; margin: 24px 0; }
.profile-location-cities textarea { min-height: 76px; resize: vertical; }
.profile-status-field { display: flex; align-items: end; }
.profile-status-field label { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; margin: 0; padding: 10px 13px; border: 1px solid var(--border); border-radius: 10px; background: rgba(11, 17, 32, .32); cursor: pointer; }
.profile-status-field input[type="checkbox"] { appearance: auto; width: 18px; height: 18px; min-width: 18px; margin: 0; padding: 0; accent-color: #3b82f6; }
.profile-status-field strong, .profile-status-field small { display: block; }
.profile-status-field small { margin-top: 2px; color: var(--muted); font-size: .75rem; font-weight: 400; }
.profile-form-actions { position: sticky; bottom: 12px; z-index: 5; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; padding: 14px 18px; border: 1px solid #3c4b64; border-radius: 13px; background: #1b2940; box-shadow: 0 14px 35px rgba(0, 0, 0, .36); }
.profile-form-actions p { margin: 0; color: var(--muted); font-size: .82rem; }
@media (max-width: 760px) {
  .profile-page-header { flex-direction: column; }
  .profile-field-grid { grid-template-columns: minmax(0, 1fr); }
  .profile-field-full { grid-column: auto; }
  .profile-choice-fieldset .checkbox-options { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); }
  .profile-choice-fieldset .modality-options { grid-template-columns: minmax(0, 1fr); }
  .profile-choice-fieldset .checkbox-options label { min-height: 46px; }
  .profile-form-actions { position: static; }
  .profile-form-actions .actions { width: 100%; }
  .profile-form-actions .btn { flex: 1; }
}
.tag-editor { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; min-height: 46px; padding: 7px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.tag-editor:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59, 130, 246, .18); }
.tag-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 6px 8px; border-radius: 999px; background: rgba(59, 130, 246, .16); color: #bfdbfe; overflow-wrap: anywhere; }
.tag-editor-negative .tag-chip { background: rgba(239, 68, 68, .14); color: #fecaca; }
.tag-chip button { border: 0; padding: 0 2px; color: inherit; background: transparent; cursor: pointer; font-size: 1rem; }
input.tag-editor-input { flex: 1 1 220px; min-width: 140px; border: 0; padding: 5px; background: transparent; box-shadow: none; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; background: var(--surface-2); }
th { color: var(--muted); text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
th, td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(59, 130, 246, .06); }
.sort-link { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); }
.sort-link:hover, .sort-link.active { color: var(--text); }
.sort-link span { color: #93c5fd; font-size: .8rem; }
.opportunity-table table { min-width: 1180px; }
.opportunity-table th, .opportunity-table td { padding: 10px 11px; font-size: .9rem; }
.opportunity-table th:last-child,
.opportunity-table td:last-child {
  position: sticky;
  right: 0;
  z-index: 2;
  min-width: 112px;
  background: linear-gradient(90deg, rgba(24, 34, 53, .86), var(--surface-2) 22%);
  box-shadow: -10px 0 14px rgba(11, 17, 32, .22);
}
.opportunity-table th:last-child { z-index: 3; }
.opportunity-table tbody tr:hover td:last-child {
  background: linear-gradient(90deg, rgba(31, 47, 76, .86), #1f2f4c 22%);
}
.opportunity-table .btn-small { white-space: nowrap; }
.opportunity-summary-cell { min-width: 230px; max-width: 360px; }
.clamp-2 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.nowrap { white-space: nowrap; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border: 1px solid transparent; border-radius: 999px; font-size: .74rem; font-weight: 750; background: var(--surface-3); color: #c7d2fe; }
.badge-strong { box-shadow: 0 0 0 1px rgba(255, 255, 255, .04), 0 8px 20px rgba(0, 0, 0, .18); }
.badge-success { color: #bbf7d0; border-color: rgba(34, 197, 94, .34); background: rgba(34, 197, 94, .18); }
.badge-warning { color: #fed7aa; border-color: rgba(245, 158, 11, .42); background: rgba(245, 158, 11, .20); }
.badge-danger { color: #fecaca; border-color: rgba(239, 68, 68, .42); background: rgba(239, 68, 68, .20); }
.badge-neutral { color: #cbd5e1; border-color: rgba(148, 163, 184, .24); background: rgba(148, 163, 184, .12); }
.badge-keyword-positive { color: #93c5fd; background: rgba(59, 130, 246, .13); }
.badge-keyword-negative { color: #fca5a5; background: rgba(239, 68, 68, .11); }
.muted { color: var(--muted); }
.empty-state { text-align: center; padding: 50px 20px; color: var(--muted); }
.pagination { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.pagination-status { color: var(--muted); font-size: .84rem; font-weight: 800; padding: 0 4px; }
.pagination-pages { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.pagination-page,
.pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted);
  background: var(--surface-2);
  font-size: .84rem;
  font-weight: 850;
}
.pagination-page:hover,
.pagination-page.active {
  color: #dbeafe;
  border-color: rgba(96, 165, 250, .48);
  background: rgba(59, 130, 246, .18);
}
.pagination-ellipsis { border-color: transparent; background: transparent; }
.filter-grid { display: grid; grid-template-columns: 2fr 1.2fr 1.2fr .5fr .7fr auto; gap: 12px; align-items: end; }
.filter-action { padding-bottom: 1px; }
.collected-filter-grid { grid-template-columns: 2fr 1fr .45fr 1fr 1fr 1fr auto auto; }
.bid-filter-grid { grid-template-columns: 2fr 1fr 1fr 1fr 1fr auto auto; }
.document-filter-grid { grid-template-columns: 2fr 1.4fr 1.1fr auto auto; }
.checkbox-inline { display: flex; align-items: end; padding-bottom: 9px; }
.checkbox-inline label { display: flex; align-items: center; gap: 7px; margin: 0; white-space: nowrap; }
.checkbox-inline input { width: auto; }
.table-subtitle { margin-top: 4px; font-size: .8rem; }
.score { color: #93c5fd; font-size: 1.15rem; }
.score-card { min-width: 100px; text-align: center; padding: 12px 18px; border: 1px solid var(--border); background: var(--surface-2); border-radius: var(--radius); }
.score-card span { display: block; color: var(--muted); font-size: .75rem; text-transform: uppercase; }
.score-card strong { display: block; font-size: 2rem; color: #93c5fd; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 18px; }
.detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.detail-list div { border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.detail-list dt { color: var(--muted); font-size: .76rem; text-transform: uppercase; }
.detail-list dd { margin: 4px 0 0; }
.body-copy { color: #cbd5e1; line-height: 1.65; white-space: pre-line; }
.reason { padding: 9px 0; border-bottom: 1px solid var(--border); }
.profile-analysis { padding: 12px 0; border-bottom: 1px solid var(--border); }
.profile-analysis:last-child { border-bottom: 0; }
.document-list { display: grid; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.document-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 15px; border-bottom: 1px solid var(--border); }
.document-row:last-child { border-bottom: 0; }
.document-summary-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 18px; }
.summary-card {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 92px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.summary-card:hover { transform: translateY(-1px); border-color: rgba(147, 197, 253, .34); background: var(--surface-3); }
.summary-card strong { display: block; font-size: 1.7rem; line-height: 1; }
.summary-card small { display: block; margin-top: 6px; color: var(--muted); font-weight: 750; }
.summary-icon, .metric-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-weight: 900;
}
.summary-danger { border-color: rgba(239, 68, 68, .32); background: linear-gradient(135deg, rgba(239, 68, 68, .14), rgba(239, 68, 68, .04)), var(--surface-2); }
.summary-danger .summary-icon { color: #fecaca; background: rgba(239, 68, 68, .22); }
.summary-warning { border-color: rgba(245, 158, 11, .34); background: linear-gradient(135deg, rgba(245, 158, 11, .14), rgba(245, 158, 11, .04)), var(--surface-2); }
.summary-warning .summary-icon { color: #fed7aa; background: rgba(245, 158, 11, .22); }
.summary-success { border-color: rgba(34, 197, 94, .30); background: linear-gradient(135deg, rgba(34, 197, 94, .12), rgba(34, 197, 94, .035)), var(--surface-2); }
.summary-success .summary-icon { color: #bbf7d0; background: rgba(34, 197, 94, .20); }
.summary-neutral .summary-icon { color: #cbd5e1; background: rgba(148, 163, 184, .14); }
.document-table tr { transition: background .15s ease, box-shadow .15s ease; }
.document-table .row-danger { background: linear-gradient(90deg, rgba(239, 68, 68, .10), rgba(239, 68, 68, .025) 38%), var(--surface-2); box-shadow: inset 3px 0 0 var(--danger); }
.document-table .row-warning { background: linear-gradient(90deg, rgba(245, 158, 11, .10), rgba(245, 158, 11, .025) 38%), var(--surface-2); box-shadow: inset 3px 0 0 var(--warning); }
.document-table .row-muted { opacity: .68; }
.validation-code { font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; color: #dbeafe; }

.message { padding: 12px 14px; margin-bottom: 18px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); }
.message.success { border-color: rgba(34, 197, 94, .35); color: #bbf7d0; }
.message.error { border-color: rgba(239, 68, 68, .35); color: #fecaca; }
.alert { padding: 12px 14px; margin: 16px 0; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); line-height: 1.5; }
.alert-info { border-color: rgba(59, 130, 246, .35); color: #bfdbfe; background: rgba(59, 130, 246, .08); }
.alert-success { border-color: rgba(34, 197, 94, .35); color: #bbf7d0; background: rgba(34, 197, 94, .08); }
.alert-warning { border-color: rgba(245, 158, 11, .35); color: #fde68a; background: rgba(245, 158, 11, .08); }
.sync-status { display: flex; align-items: center; gap: 10px; }
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(191, 219, 254, .35);
  border-top-color: #60a5fa;
  border-radius: 999px;
  animation: spin .75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.chat-message { padding: 14px 0; border-bottom: 1px solid var(--border); }
.chat-message:last-child { border-bottom: 0; }
.chat-message p { line-height: 1.55; white-space: pre-line; }
.chat-message-action { border-left: 3px solid var(--danger); padding-left: 12px; }

.alert-popup {
  position: sticky;
  top: 12px;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(239, 68, 68, .45);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(239, 68, 68, .18), rgba(245, 158, 11, .10)), var(--surface-2);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .26);
}
.alert-popup p { margin: 4px 0 0; color: #fecaca; }
.compact-list { margin: 8px 0 0; padding-left: 18px; color: #fee2e2; }
.compact-list li { margin-top: 3px; }

.dashboard-header { align-items: center; }
.dashboard-health {
  min-width: 150px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  background: var(--surface-2);
}
.dashboard-health span { display: block; font-size: 2rem; font-weight: 900; line-height: 1; }
.dashboard-health small { display: block; margin-top: 6px; color: var(--muted); font-weight: 750; }
.dashboard-health-danger { border-color: rgba(239, 68, 68, .38); background: linear-gradient(135deg, rgba(239, 68, 68, .16), rgba(245, 158, 11, .08)), var(--surface-2); }
.dashboard-health-danger span { color: #fecaca; }
.dashboard-health-ok { border-color: rgba(34, 197, 94, .32); background: linear-gradient(135deg, rgba(34, 197, 94, .12), rgba(56, 189, 248, .05)), var(--surface-2); }
.dashboard-health-ok span { color: #bbf7d0; }
.dashboard-section { margin-top: 20px; }
.priority-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric-card {
  display: flex;
  gap: 14px;
  min-height: 150px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.metric-card p { margin: 8px 0 0; color: var(--muted); font-size: .84rem; line-height: 1.45; }
.metric-card:hover { border-color: rgba(147, 197, 253, .34); background: var(--surface-3); }
.metric-danger { border-color: rgba(239, 68, 68, .32); background: linear-gradient(135deg, rgba(239, 68, 68, .13), rgba(239, 68, 68, .035)), var(--surface-2); }
.metric-danger .metric-icon { color: #fecaca; background: rgba(239, 68, 68, .22); }
.metric-warning { border-color: rgba(245, 158, 11, .34); background: linear-gradient(135deg, rgba(245, 158, 11, .13), rgba(245, 158, 11, .035)), var(--surface-2); }
.metric-warning .metric-icon { color: #fed7aa; background: rgba(245, 158, 11, .22); }
.dashboard-two-columns { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(320px, .8fr); gap: 20px; align-items: start; }
.compact-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.attention-list { display: grid; gap: 10px; }
.attention-item {
  display: flex;
  gap: 11px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(17, 24, 39, .56);
}
.attention-item strong { display: block; }
.attention-item p { margin: 4px 0 0; color: var(--muted); font-size: .84rem; line-height: 1.45; }
.status-dot { width: 10px; height: 10px; margin-top: 5px; border-radius: 999px; background: var(--primary); box-shadow: 0 0 0 5px rgba(59, 130, 246, .10); }
.attention-danger { border-color: rgba(239, 68, 68, .30); }
.attention-danger .status-dot { background: var(--danger); box-shadow: 0 0 0 5px rgba(239, 68, 68, .12); }
.attention-warning { border-color: rgba(245, 158, 11, .30); }
.attention-warning .status-dot { background: var(--warning); box-shadow: 0 0 0 5px rgba(245, 158, 11, .12); }
.compact-empty { padding: 24px 12px; }

.kanban-board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(280px, 320px);
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 12px;
}
.kanban-column {
  min-height: 340px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(17, 24, 39, .72);
}
.kanban-column-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(17, 24, 39, .95);
  border-radius: var(--radius) var(--radius) 0 0;
}
.kanban-cards { display: grid; gap: 12px; padding: 12px; }
.bid-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}
.bid-card-critical { border-color: rgba(239, 68, 68, .55); box-shadow: inset 3px 0 0 var(--danger); }
.bid-card-warning { border-color: rgba(245, 158, 11, .45); box-shadow: inset 3px 0 0 var(--warning); }
.bid-card-top { justify-content: space-between; }
.bid-card-title { margin: 0; color: #cbd5e1; line-height: 1.45; }
.bid-card-meta { display: grid; gap: 4px; color: var(--muted); font-size: .82rem; }
.bid-card-message {
  padding: 10px;
  border-radius: 10px;
  background: rgba(11, 17, 32, .55);
  border: 1px solid var(--border);
}
.bid-card-message p { margin: 5px 0; color: #cbd5e1; line-height: 1.45; }
.bid-card-message small { color: var(--muted); }
.bid-card-actions { margin-top: 2px; }
.kanban-empty { padding: 16px 4px; color: var(--muted); font-size: .88rem; text-align: center; }

.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr; }
.auth-visual { padding: 60px; display: flex; flex-direction: column; justify-content: center; background: radial-gradient(circle at 20% 20%, #1d4ed8 0, transparent 38%), var(--surface); }
.auth-visual h1 { font-size: clamp(2.3rem, 5vw, 4.6rem); line-height: 1; max-width: 700px; margin: 22px 0; }
.auth-visual p { color: #bfdbfe; max-width: 600px; font-size: 1.05rem; }
.auth-panel { display: grid; place-items: center; padding: 30px; }
.auth-card { width: min(430px, 100%); }
.auth-card h2 { margin: 0 0 8px; }
.auth-card > p { color: var(--muted); margin: 0 0 24px; }
.auth-card .btn { width: 100%; }

.htmx-indicator { display: none; color: var(--muted); margin-left: 8px; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: inline; }

@media (max-width: 1050px) {
  .grid-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .priority-grid, .document-summary-grid, .compact-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-two-columns { grid-template-columns: 1fr; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .filter-grid, .collected-filter-grid, .bid-filter-grid, .document-filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .sidebar { position: static; width: 100%; min-height: auto; }
  .sidebar-footer { margin-top: 18px; }
  .main { margin-left: 0; }
  .topbar { display: none; }
  .content { padding: 20px 14px; }
  .page-header { flex-direction: column; }
  .grid-stats, .form-grid, .priority-grid, .document-summary-grid, .compact-stats { grid-template-columns: 1fr; }
  .filter-grid, .collected-filter-grid, .bid-filter-grid, .document-filter-grid, .detail-grid, .detail-list { grid-template-columns: 1fr; }
  .dashboard-header { align-items: flex-start; }
  .dashboard-health { width: 100%; text-align: left; }
  .section-heading { flex-direction: column; gap: 6px; }
  .alert-popup { position: static; flex-direction: column; align-items: flex-start; }
  .kanban-board { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: 1fr; overflow-x: visible; }
  .span-2 { grid-column: auto; }
  .document-row { align-items: flex-start; flex-direction: column; }
  .responsive-table { overflow: visible; border: 0; }
  .responsive-table table, .responsive-table thead, .responsive-table tbody, .responsive-table tr, .responsive-table th, .responsive-table td { display: block; width: 100%; }
  .responsive-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .responsive-table table { background: transparent; }
  .opportunity-table table { min-width: 0; }
  .opportunity-table th:last-child,
  .opportunity-table td:last-child {
    position: static;
    min-width: 0;
    background: transparent;
    box-shadow: none;
  }
  .responsive-table tbody { display: grid; gap: 12px; }
  .responsive-table tr { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); overflow: hidden; }
  .responsive-table td { display: grid; grid-template-columns: minmax(96px, 36%) minmax(0, 1fr); gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
  .responsive-table td:last-child { border-bottom: 0; }
  .responsive-table td::before { content: attr(data-label); color: var(--muted); font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
  .responsive-table td.opportunity-summary-cell { display: block; max-width: none; min-width: 0; }
  .responsive-table td.opportunity-summary-cell::before { display: block; margin-bottom: 6px; }
  .responsive-table .actions { justify-content: flex-start; }
  .responsive-table .nowrap { white-space: normal; }
}

/* UX refresh: fluxo operacional de oportunidades, documentos e propostas */
:root {
  --focus-ring: 0 0 0 3px rgba(96, 165, 250, .26);
  --shadow-soft: 0 18px 50px rgba(0, 0, 0, .20);
}

body {
  background:
    radial-gradient(circle at 88% 0%, rgba(59, 130, 246, .12), transparent 28rem),
    radial-gradient(circle at 0% 18%, rgba(56, 189, 248, .08), transparent 24rem),
    var(--bg);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.sidebar {
  box-shadow: 18px 0 50px rgba(0, 0, 0, .15);
}

.brand {
  border-radius: 16px;
}

.brand:hover {
  background: rgba(255, 255, 255, .035);
}

.nav a {
  display: flex;
  align-items: center;
  min-height: 42px;
  border: 1px solid transparent;
}

.nav a.active {
  border-color: rgba(147, 197, 253, .18);
  box-shadow: inset 3px 0 0 var(--primary);
}

.main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 12;
  background: rgba(11, 17, 32, .76);
  backdrop-filter: blur(16px);
}

.content {
  width: 100%;
}

.page-header {
  padding-bottom: 4px;
}

.page-header h1 {
  letter-spacing: -.03em;
}

.card,
.table-wrap,
.table-wrapper,
.dashboard-health,
.metric-card,
.summary-card,
.kanban-column {
  box-shadow: var(--shadow-soft);
}

.card {
  overflow-wrap: anywhere;
}

.btn {
  line-height: 1.15;
  transition: transform .12s ease, background .12s ease, border-color .12s ease, box-shadow .12s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  box-shadow: 0 10px 24px rgba(37, 99, 235, .26);
}

.btn-danger {
  box-shadow: 0 10px 24px rgba(239, 68, 68, .10);
}

.filter-grid {
  position: relative;
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  align-items: end;
}

.filter-grid > div:first-child {
  grid-column: span 2;
}

.filter-action .btn,
.filter-action button {
  width: 100%;
}

.table-wrap,
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.table-wrapper table {
  min-width: 920px;
}

th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: rgba(24, 34, 53, .98);
  backdrop-filter: blur(10px);
}

tbody tr {
  transition: background .12s ease, box-shadow .12s ease;
}

tbody tr:hover {
  box-shadow: inset 3px 0 0 rgba(96, 165, 250, .65);
}

.opportunity-table {
  scrollbar-color: var(--surface-3) var(--surface);
}

.opportunity-table table {
  min-width: 1320px;
}

.opportunity-table td[data-label="Portal"],
.opportunity-table td[data-label="Perfil"],
.opportunity-table td[data-label="Situação"],
.opportunity-table td[data-label="Qualificação"] {
  max-width: 180px;
}

.opportunity-summary-cell strong {
  display: inline-block;
  margin-bottom: 3px;
  color: #eff6ff;
}

.score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 34px;
  border-radius: 12px;
  background: rgba(59, 130, 246, .14);
}

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

.summary-grid div {
  min-height: 92px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(17, 24, 39, .48);
}

.summary-grid dt {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.summary-grid dd {
  margin: 8px 0 0;
  font-weight: 800;
  line-height: 1.35;
}

.proposal-summary-card {
  border-color: rgba(96, 165, 250, .26);
}

.proposal-workbench {
  margin-top: 18px;
}

.proposal-table table {
  min-width: 1180px;
}

.proposal-table td[data-label="Descrição"] {
  min-width: 320px;
  line-height: 1.45;
}

.proposal-table input,
.proposal-table textarea {
  min-width: 150px;
  background: rgba(11, 17, 32, .78);
}

.proposal-table textarea {
  min-height: 42px;
  resize: vertical;
}

.proposal-actions {
  position: sticky;
  bottom: 12px;
  z-index: 8;
  margin: 18px -4px -4px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(17, 24, 39, .92);
  backdrop-filter: blur(14px);
  box-shadow: 0 -14px 40px rgba(0, 0, 0, .22);
}

.detail-list dd,
.summary-grid dd,
.table-subtitle,
.body-copy {
  overflow-wrap: anywhere;
}

.document-list,
.attention-list,
.kanban-cards {
  min-width: 0;
}

.badge {
  line-height: 1.15;
  text-align: center;
}

.field-errors,
.errorlist {
  color: #fecaca;
  font-size: .86rem;
}

@media (max-width: 1180px) {
  .content {
    padding: 24px 20px;
  }

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

/* UX correction: oportunidade como card operacional, não planilha comprimida */
.sort-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 0;
}

.sort-toolbar > span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 850;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.sort-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(17, 24, 39, .56);
  font-size: .84rem;
  font-weight: 800;
}

.sort-pill:hover,
.sort-pill.active {
  color: #dbeafe;
  border-color: rgba(96, 165, 250, .45);
  background: rgba(59, 130, 246, .16);
}

.opportunity-card-list {
  display: grid;
  gap: 14px;
  margin-top: 8px;
}

.opportunity-card {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .022), rgba(255, 255, 255, 0)), var(--surface-2);
  box-shadow: var(--shadow-soft);
}

.opportunity-card:hover {
  border-color: rgba(96, 165, 250, .34);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .24), inset 3px 0 0 rgba(96, 165, 250, .68);
}

.opportunity-card-score {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 6px;
  min-height: 100%;
  padding: 18px 12px;
  border-right: 1px solid var(--border);
  background: rgba(59, 130, 246, .08);
}

.opportunity-card-score span {
  color: var(--muted);
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.opportunity-card-score strong {
  color: #93c5fd;
  font-size: 1.9rem;
  line-height: 1;
}

.collected-card .opportunity-card-score strong {
  max-width: 86px;
  color: #dbeafe;
  font-size: .86rem;
  line-height: 1.25;
  text-align: center;
  overflow-wrap: anywhere;
}

.opportunity-card-main {
  min-width: 0;
  padding: 18px;
}

.opportunity-card-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
}

.opportunity-card h2 {
  margin: 0 0 5px;
  color: #f8fafc;
  font-size: clamp(1rem, 1.35vw, 1.25rem);
  letter-spacing: -.02em;
}

.opportunity-card p {
  margin: 0;
}

.opportunity-card-description {
  max-width: 920px;
  margin: 6px 0 7px !important;
  color: #cbd5e1;
  line-height: 1.45;
}

.opportunity-card-actions {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  flex-direction: column;
  gap: 8px;
  min-width: 190px;
}

.opportunity-card-actions form {
  width: 100%;
}

.opportunity-card-actions .btn,
.opportunity-card-actions button {
  width: 100%;
}

.opportunity-card-reject {
  width: 100%;
}

.opportunity-card-reject summary {
  width: 100%;
  list-style: none;
}

.opportunity-card-reject summary::-webkit-details-marker {
  display: none;
}

.opportunity-card-reject form {
  display: grid;
  gap: 8px;
  width: min(270px, 100%);
  margin-top: 10px;
}

.opportunity-card-reject label {
  margin: 0;
  font-size: .78rem;
}

.opportunity-card-reject input {
  min-width: 0;
  padding: 8px 10px;
  font-size: .82rem;
}

.opportunity-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.opportunity-card-grid > div {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(41, 54, 76, .72);
  border-radius: 12px;
  background: rgba(11, 17, 32, .34);
}

.opportunity-card-grid span:not(.badge) {
  display: block;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.opportunity-card-grid strong {
  display: block;
  margin-top: 5px;
  color: #e2e8f0;
  font-size: .92rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.procurement-detail-grid {
  grid-template-columns: minmax(0, 3.4fr) minmax(270px, .95fr);
  align-items: start;
}

.procurement-detail-grid > .card,
.procurement-detail-grid > section.card {
  min-width: 0;
}

.procurement-detail-grid > aside {
  position: sticky;
  top: 88px;
  align-self: start;
}

.procurement-detail-grid .detail-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.detail-object-title {
  max-width: 980px;
  margin-top: 8px !important;
  color: #dbeafe !important;
  font-size: .98rem;
  line-height: 1.5;
}

.item-table table {
  min-width: 1080px;
  table-layout: fixed;
}

.item-table th,
.item-table td {
  vertical-align: middle;
}

.item-table th {
  white-space: normal;
  line-height: 1.2;
}

.item-table th:nth-child(1),
.item-table td:nth-child(1) {
  width: 58px;
  text-align: center;
}

.item-table th:nth-child(2),
.item-table td:nth-child(2) {
  width: 52%;
}

.item-table th:nth-child(3),
.item-table td:nth-child(3),
.item-table th:nth-child(4),
.item-table td:nth-child(4) {
  width: 108px;
}

.item-table th:nth-child(5),
.item-table td:nth-child(5),
.item-table th:nth-child(6),
.item-table td:nth-child(6) {
  width: 150px;
}

.item-description-clamp {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  color: #e2e8f0;
  line-height: 1.48;
  cursor: help;
}

.item-description-clamp:hover {
  -webkit-line-clamp: unset;
  overflow: visible;
  color: #f8fafc;
}

.document-list {
  background: rgba(11, 17, 32, .32);
}

.document-row {
  align-items: flex-start;
}

@media (max-width: 1200px) {
  .opportunity-card-grid {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }

  .procurement-detail-grid,
  .procurement-detail-grid .detail-list {
    grid-template-columns: 1fr 1fr;
  }

  .procurement-detail-grid > aside {
    position: static;
  }
}

@media (max-width: 860px) {
  .opportunity-card {
    grid-template-columns: 1fr;
  }

  .opportunity-card-score {
    display: flex;
    justify-content: space-between;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .opportunity-card-header {
    grid-template-columns: 1fr;
  }

  .opportunity-card-actions {
    align-items: stretch;
    width: 100%;
    min-width: 0;
  }

  .opportunity-card-grid,
  .procurement-detail-grid,
  .procurement-detail-grid .detail-list {
    grid-template-columns: 1fr;
  }

  .sort-toolbar {
    align-items: stretch;
  }

  .sort-toolbar > span {
    width: 100%;
  }

  .sort-pill {
    flex: 1 1 auto;
    justify-content: center;
  }
}

@media (max-width: 900px) {
  .sidebar {
    position: static;
    width: 100%;
    min-height: auto;
    padding: 14px;
  }

  .brand {
    padding: 4px 4px 12px;
  }

  .nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .nav a {
    justify-content: center;
    padding: 10px 8px;
    text-align: center;
    font-size: .84rem;
  }

  .sidebar-footer {
    margin-top: 14px;
  }

  .main {
    margin-left: 0;
  }

  .topbar {
    display: none;
  }

  .filter-grid > div:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  body {
    background: var(--bg);
  }

  .content {
    padding: 18px 12px 28px;
  }

  .page-header {
    gap: 12px;
    margin-bottom: 16px;
  }

  .page-header .actions,
  .actions {
    width: 100%;
  }

  .page-header .btn,
  .actions .btn,
  .actions button {
    flex: 1 1 auto;
  }

  .nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x mandatory;
  }

  .nav a {
    flex: 0 0 auto;
    min-width: 116px;
    scroll-snap-align: start;
  }

  .card {
    padding: 16px;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .table-wrapper {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .table-wrapper table,
  .table-wrapper thead,
  .table-wrapper tbody,
  .table-wrapper tr,
  .table-wrapper th,
  .table-wrapper td {
    display: block;
    width: 100%;
  }

  .table-wrapper thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .table-wrapper table {
    min-width: 0;
    background: transparent;
  }

  .table-wrapper tbody {
    display: grid;
    gap: 12px;
  }

  .table-wrapper tr {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
    overflow: hidden;
  }

  .table-wrapper td {
    display: grid;
    grid-template-columns: minmax(96px, 36%) minmax(0, 1fr);
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
  }

  .table-wrapper td:last-child {
    border-bottom: 0;
  }

  .table-wrapper td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
  }

  .proposal-table td[data-label="Descrição"],
  .table-wrapper td[data-label="Observações"] {
    display: block;
  }

  .proposal-table td[data-label="Descrição"]::before,
  .table-wrapper td[data-label="Observações"]::before {
    display: block;
    margin-bottom: 7px;
  }

  .proposal-table input,
  .proposal-table textarea {
    min-width: 0;
  }

  .proposal-actions {
    bottom: 8px;
    flex-direction: column;
  }

  .proposal-actions .btn,
  .proposal-actions button {
    width: 100%;
  }
}
.pca-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.pca-filters label { display: grid; gap: 6px; font-size: .82rem; font-weight: 750; }
.pca-filters input, .pca-filters select { width: 100%; min-width: 0; }
.pca-filter-actions { display: flex; align-items: end; gap: 8px; flex-wrap: wrap; }
.pca-summary { margin: 14px 0; color: var(--muted); font-size: .86rem; }
.pca-card-list { display: grid; gap: 14px; }
.pca-card { min-width: 0; }
.pca-card-top, .pca-card-footer { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.pca-card-top h2 { margin: 7px 0; font-size: 1.08rem; line-height: 1.4; }
.pca-card-top h2 a { color: inherit; text-decoration: none; }
.pca-card-top h2 a:hover { color: var(--primary); }
.pca-card-top .eyebrow { color: var(--muted); font-size: .78rem; }
.pca-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 16px 0; }
.pca-metrics > div { display: grid; gap: 4px; min-width: 0; padding: 11px; border: 1px solid var(--border); border-radius: 10px; }
.pca-metrics span { color: var(--muted); text-transform: uppercase; font-size: .68rem; letter-spacing: .04em; }
.pca-metrics strong { overflow-wrap: anywhere; font-size: .9rem; }
.pca-card-footer { align-items: center; color: var(--muted); font-size: .8rem; }
.pca-runs { margin-top: 22px; }
.pca-detail-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(270px, 1fr); align-items: start; gap: 18px; }
.pca-detail-main, .pca-detail-aside { display: grid; gap: 18px; min-width: 0; }
.pca-caution { padding: 10px 12px; border-left: 3px solid var(--warning); background: rgba(245, 158, 11, .09); border-radius: 6px; }
.pca-detail-aside form p { display: grid; gap: 5px; }
.pca-detail-aside input, .pca-detail-aside select, .pca-detail-aside textarea { width: 100%; min-width: 0; }
.pca-watch-form { display: grid; gap: 18px; }
.pca-watch-form .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.pca-watch-form .form-grid > div { display: grid; gap: 6px; min-width: 0; }
.pca-watch-form small { color: var(--muted); }
.pca-year-options { border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; }
.pca-year-options legend { font-weight: 700; padding: 0 5px; }
.pca-year-options > div { display: flex; flex-wrap: wrap; gap: 16px; }
.pca-year-options label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.pca-year-options input[type="checkbox"] { width: 18px; height: 18px; margin: 0; accent-color: var(--primary); }
@media (max-width: 1000px) { .pca-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pca-detail-grid { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .pca-filters, .pca-metrics, .pca-watch-form .form-grid { grid-template-columns: 1fr; } .pca-card-top, .pca-card-footer { flex-direction: column; } }
