:root {
  --bg: #eef3f5;
  --surface: #ffffff;
  --line: #d9e0e6;
  --ink: #111827;
  --muted: #64748b;
  --brand: #0b766e;
  --brand-dark: #075c55;
  --brand-soft: #e7f5f2;
  --sidebar: #0f172a;
  --sidebar-muted: #94a3b8;
  --warn: #b45309;
  --danger: #b91c1c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.hidden {
  display: none !important;
}

.login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 26px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
}

.login-card h1 {
  margin: 0;
}

.login-error {
  min-height: 20px;
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
}

.shell {
  width: 100%;
  max-width: none;
  min-height: 100vh;
  margin: 0;
  padding: 18px 22px 22px 270px;
  display: block;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 14px 18px;
  gap: 18px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
  position: static;
}

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

.admin-info {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.eyebrow {
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  margin-top: 4px;
  font-size: 24px;
}

h2 {
  font-size: 20px;
}

h3 {
  margin-bottom: 14px;
  font-size: 16px;
}

p {
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 12px;
}

button {
  border: 0;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  min-height: 40px;
  padding: 0 16px;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: var(--brand-dark);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

button:disabled:hover {
  background: inherit;
}

button.ghost {
  background: #e8f5f2;
  color: var(--brand);
}

button.ghost.danger {
  background: #fff1f2;
  color: var(--danger);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 0;
}

.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  min-height: 74px;
}

.metric strong {
  display: block;
  font-size: 22px;
  margin-bottom: 4px;
}

.metric span,
.section-head span,
.meta {
  color: var(--muted);
  font-size: 13px;
}

.tabs {
  position: fixed;
  left: 18px;
  top: 18px;
  bottom: 18px;
  width: 230px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 18px 12px;
  border: 0;
  border-radius: 14px;
  background: var(--sidebar);
  box-shadow: 0 22px 52px rgba(15, 23, 42, 0.24);
  overflow-y: auto;
  z-index: 10;
}

.tabs::before {
  content: "Compute Agent";
  display: block;
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  padding: 2px 10px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.24);
  margin-bottom: 10px;
}

.tabs::after {
  content: "CRM Console";
  color: var(--sidebar-muted);
  font-size: 12px;
  font-weight: 700;
  padding: 12px 10px 2px;
  margin-top: auto;
}

.tab {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  min-height: 38px;
  padding: 0 12px;
  background: transparent;
  color: var(--sidebar-muted);
  border-radius: 8px;
  border: 1px solid transparent;
}

.tab.active {
  color: #fff;
  background: rgba(20, 184, 166, 0.18);
  border-color: rgba(45, 212, 191, 0.28);
}

.tab:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.06);
}

.dashboard-panel.active {
  display: grid;
  gap: 16px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.two {
  grid-template-columns: minmax(320px, 0.9fr) minmax(320px, 1.1fr);
}

.card,
.item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.panel .card,
.panel .item {
  background: #fff;
}

.form-card {
  display: grid;
  gap: 12px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

label {
  display: grid;
  gap: 6px;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 10px 11px;
  color: var(--ink);
  font: inherit;
  background: #fff;
}

.check-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.check-line input {
  width: auto;
}

textarea {
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
}

.list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.list-tools {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.list-tools label {
  width: min(520px, 100%);
}

.list-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-height: 32px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.pagination.single {
  justify-content: flex-start;
}

.pagination-info {
  color: var(--muted);
}

.pagination-actions {
  display: flex;
  gap: 8px;
}

.pagination-actions button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.list.compact {
  margin-top: 0;
}

.item-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.item-title {
  font-size: 16px;
  font-weight: 800;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef2f7;
  color: #334155;
  font-size: 12px;
  white-space: nowrap;
}

.status.warn {
  background: #fff7ed;
  color: var(--warn);
}

.status.ok {
  background: #e8f5f2;
  color: var(--brand);
}

.kv {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.kv span {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  color: #334155;
  padding: 6px 8px;
  font-size: 12px;
}

.review-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
  padding: 10px;
  border-radius: 6px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
}

.review-box span {
  color: var(--warn);
  font-size: 12px;
  line-height: 1.45;
}

.review-box.neutral {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.review-box.neutral span {
  color: #475569;
}

.evolution-table {
  display: grid;
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.evolution-table-row {
  display: grid;
  grid-template-columns:
    minmax(220px, 1.35fr)
    minmax(136px, 0.7fr)
    minmax(260px, 1.45fr)
    minmax(190px, 1fr)
    minmax(142px, 0.72fr)
    minmax(116px, 0.58fr);
  gap: 0;
  min-width: 1080px;
  border-top: 1px solid var(--line);
}

.evolution-table-row:first-child {
  border-top: 0;
}

.evolution-table-head {
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.evolution-table-head > div,
.evolution-cell {
  padding: 12px 14px;
  border-left: 1px solid var(--line);
}

.evolution-table-head > div:first-child,
.evolution-cell:first-child {
  border-left: 0;
}

.evolution-cell {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.evolution-cell strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}

.evolution-cell span,
.evolution-cell p {
  margin: 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.55;
}

.evolution-mobile-label {
  display: none;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 900;
}

.evolution-cell-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.evolution-advice-cell p {
  color: #334155;
}

.evolution-brief {
  display: block;
  overflow: visible;
}

.evolution-action-cell {
  align-content: center;
}

.evolution-status-cell {
  align-content: center;
}

.evolution-row-actions {
  display: grid;
  gap: 8px;
}

.evolution-review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.evolution-row-actions button,
.evolution-review-actions button,
.evolution-action-cell button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
  white-space: nowrap;
}

.evolution-detail-card {
  width: min(980px, 100%);
}

.evolution-detail-body {
  display: grid;
  gap: 14px;
}

.evolution-detail-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.evolution-detail-hero h3 {
  margin: 4px 0 8px;
}

.evolution-detail-hero p {
  margin: 0;
  color: #475569;
  line-height: 1.6;
}

.evolution-detail-section {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.evolution-detail-section h4 {
  margin: 0;
  color: #0f172a;
  font-size: 14px;
}

.evolution-detail-section strong {
  display: block;
  margin-bottom: 4px;
  color: #0f172a;
}

.evolution-detail-section span,
.evolution-detail-section p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.65;
}

.evolution-feedback-list {
  display: grid;
  gap: 10px;
}

.evolution-feedback-item {
  display: grid;
  gap: 4px;
  padding: 10px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.project-demand {
  border-left: 4px solid var(--brand);
}

.project-demand span {
  font-size: 13px;
  line-height: 1.6;
}

.project-solution-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}

.solution-section-title {
  color: #0f172a;
  font-size: 13px;
  font-weight: 800;
}

.solution-mini {
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fbfdff;
}

.project-quote-block {
  margin-top: 12px;
  background: #fff;
  border-color: #cbd5e1;
}

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

.quote-line-list {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

.quote-line-list.compact {
  gap: 8px;
  margin-top: 10px;
}

.quote-line {
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
}

.quote-line-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.quote-line-title {
  color: #0f172a;
  font-size: 14px;
  font-weight: 800;
}

.quote-line-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.quote-line-body span {
  min-height: 34px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f8fafc;
  color: #475569;
  font-size: 13px;
  line-height: 1.45;
}

.quote-line p {
  margin: 10px 0 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.55;
}

.project-card {
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.project-card:hover {
  border-color: #94a3b8;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.project-detail-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
}

.detail-actions {
  display: flex;
  gap: 8px;
}

.project-detail-card {
  border-color: #cbd5e1;
  padding: 18px;
  overflow: hidden;
}

.project-detail-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e2e8f0;
  min-width: 0;
}

.project-detail-title > div {
  min-width: 0;
}

.project-detail-sections {
  display: grid;
  margin-top: 14px;
  min-width: 0;
}

.project-detail-section {
  padding: 18px 0;
  border-top: 1px solid #e2e8f0;
  min-width: 0;
}

.project-detail-section-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.project-detail-section-head h3 {
  margin: 0;
  color: #0f172a;
  font-size: 16px;
  line-height: 1.3;
}

.project-detail-section-head p {
  margin: 3px 0 0;
  color: #64748b;
  font-size: 12px;
}

.project-detail-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 28px;
  border-radius: 6px;
  background: #e6f6f2;
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
}

.project-detail-text {
  margin: 0;
  color: #334155;
  font-size: 14px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.project-requirement-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.project-requirement-item {
  display: grid;
  gap: 6px;
  align-items: start;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.project-requirement-item span {
  display: block;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.project-requirement-item strong {
  display: block;
  color: #0f172a;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.project-detail-muted {
  margin: 10px 0 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.6;
}

.project-detail-kv {
  margin-top: 12px;
}

.project-detail-kv span,
.quote-summary-grid span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.project-detail-mainline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  min-width: 0;
}

.project-detail-mainline strong {
  color: #0f172a;
  font-size: 15px;
  line-height: 1.4;
  min-width: 0;
  overflow-wrap: anywhere;
}

.project-detail-table {
  display: grid;
  gap: 0;
  margin-top: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  min-width: 0;
}

.project-detail-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1.5fr) minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-top: 1px solid #e2e8f0;
  background: #fff;
  min-width: 0;
}

.project-detail-row:first-child {
  border-top: 0;
}

.project-detail-row span {
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
  min-width: 0;
  overflow-wrap: anywhere;
}

.project-detail-row strong {
  color: #0f172a;
  font-size: 13px;
  line-height: 1.45;
  min-width: 0;
  overflow-wrap: anywhere;
}

.quote-detail-row {
  grid-template-columns: 28px minmax(0, 1.6fr) minmax(0, 0.8fr) minmax(0, 0.75fr) minmax(0, 0.75fr) minmax(0, 0.55fr);
}

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

.project-profit-grid div {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.project-profit-grid span {
  color: #64748b;
  font-size: 12px;
}

.project-profit-grid strong {
  color: #0f172a;
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.project-hardware-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.project-hardware-grid div {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.project-hardware-grid span {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.project-hardware-grid strong {
  color: #0f172a;
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.project-hardware-grid p {
  margin: 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.solution-mini-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.solution-title {
  color: #0f172a;
  font-size: 14px;
  font-weight: 800;
}

.solution-mini p {
  margin: 10px 0 0;
  color: #475569;
  font-size: 13px;
  line-height: 1.55;
}

.backup-head {
  margin-top: 18px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.actions button {
  min-height: 32px;
  font-size: 12px;
}

.compact-actions {
  margin-top: 10px;
}

.supplier-console {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.supplier-directory {
  position: sticky;
  top: 18px;
}

.supplier-configs {
  display: grid;
  gap: 14px;
}

.resource-category-grid {
  display: grid;
  gap: 14px;
}

.resource-filter-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.resource-filter-row label {
  width: min(360px, 100%);
}

.resource-filter-row select,
.resource-filter-row input {
  min-height: 38px;
}

.resource-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.resource-tab {
  min-height: 36px;
  padding: 0 14px;
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  box-shadow: none;
}

.resource-tab.active {
  background: #fff;
  color: var(--brand);
  border-color: rgba(11, 118, 110, 0.24);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.06);
}

.resource-tab span {
  margin-left: 6px;
  font-size: 12px;
  font-weight: 800;
}

.resource-scope {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: -4px 0 14px;
  padding: 9px 12px;
  border: 1px solid rgba(11, 118, 110, 0.18);
  border-radius: 8px;
  background: #eefaf8;
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
}

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

.resource-tab-panel.active {
  display: block;
}

.resource-table {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.resource-table-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.9fr) minmax(190px, 1.25fr) minmax(260px, 1.7fr) minmax(145px, 0.9fr) minmax(88px, 0.55fr) minmax(118px, 0.7fr);
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-top: 1px solid #e2e8f0;
}

.resource-table-row:first-child {
  border-top: 0;
}

.resource-table-head {
  min-height: 36px;
  padding-top: 8px;
  padding-bottom: 8px;
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.server-db-table {
  overflow-x: auto;
}

.server-db-row {
  grid-template-columns:
    minmax(118px, 0.8fr)
    minmax(190px, 1.3fr)
    minmax(190px, 1.25fr)
    minmax(64px, 0.45fr)
    minmax(78px, 0.55fr)
    minmax(150px, 1fr)
    minmax(170px, 1.1fr)
    minmax(120px, 0.85fr)
    minmax(82px, 0.6fr)
    minmax(86px, 0.6fr)
    minmax(118px, 0.75fr);
  min-width: 1320px;
}

.crm-table {
  overflow-x: auto;
}

.customer-db-row {
  grid-template-columns:
    minmax(190px, 1.25fr)
    minmax(140px, 0.9fr)
    minmax(130px, 0.75fr)
    minmax(150px, 0.9fr)
    minmax(128px, 0.75fr)
    minmax(180px, 1fr)
    minmax(88px, 0.55fr)
    minmax(128px, 0.7fr);
  min-width: 1180px;
}

.project-db-row {
  grid-template-columns:
    minmax(210px, 1.3fr)
    minmax(170px, 1fr)
    minmax(170px, 1fr)
    minmax(108px, 0.65fr)
    minmax(170px, 1fr)
    minmax(92px, 0.55fr)
    minmax(145px, 0.85fr)
    minmax(118px, 0.65fr);
  min-width: 1200px;
}

.supplier-db-row {
  grid-template-columns:
    minmax(200px, 1.3fr)
    minmax(145px, 0.85fr)
    minmax(190px, 1.1fr)
    minmax(112px, 0.65fr)
    minmax(112px, 0.65fr)
    minmax(74px, 0.45fr)
    minmax(74px, 0.45fr)
    minmax(220px, 1.2fr);
  min-width: 1220px;
}

.log-db-row {
  grid-template-columns:
    minmax(170px, 0.9fr)
    minmax(150px, 0.7fr)
    minmax(260px, 1.35fr)
    minmax(320px, 1.65fr);
  min-width: 980px;
}

.evolution-db-row {
  grid-template-columns:
    minmax(220px, 1.3fr)
    minmax(150px, 0.8fr)
    minmax(260px, 1.45fr)
    minmax(210px, 1.1fr)
    minmax(86px, 0.55fr)
    minmax(220px, 1.1fr);
  min-width: 1150px;
}

.evolution-memory-row {
  grid-template-columns:
    minmax(240px, 1.35fr)
    minmax(180px, 0.9fr)
    minmax(150px, 0.75fr)
    minmax(260px, 1.35fr)
    minmax(86px, 0.55fr)
    minmax(128px, 0.7fr);
  min-width: 1120px;
}

.evolution-rule-row {
  grid-template-columns:
    minmax(240px, 1.3fr)
    minmax(210px, 1.1fr)
    minmax(170px, 0.85fr)
    minmax(210px, 1.05fr)
    minmax(86px, 0.55fr)
    minmax(190px, 0.95fr);
  min-width: 1120px;
}

.evolution-tabs {
  margin-top: 16px;
}

.evolution-tab-panels {
  margin-top: 12px;
}

.project-db-table .resource-table-row:not(.resource-table-head) {
  cursor: pointer;
}

.crm-table .resource-table-row:not(.resource-table-head):hover {
  background: #fbfdff;
}

.resource-cell {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.resource-cell strong {
  overflow: hidden;
  color: #0f172a;
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resource-cell span {
  overflow: hidden;
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resource-spec-cell span {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.resource-status-head,
.resource-action-head {
  display: flex;
  align-items: center;
}

.resource-status-head {
  justify-content: center;
}

.resource-action-head {
  justify-content: flex-end;
  padding-right: 4px;
}

.resource-status-cell {
  align-items: center;
  justify-items: center;
}

.resource-status-cell .status {
  min-height: 24px;
  padding: 0 10px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  font-weight: 800;
  line-height: 24px;
}

.resource-status-cell .status.ok {
  border-color: #b7eadc;
  background: #ecfdf5;
  color: #047857;
}

.resource-status-cell .status.warn {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #c2410c;
}

.log-message-cell strong,
.log-detail-cell span {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.evolution-db-table .resource-cell strong {
  white-space: normal;
}

.evolution-db-table .resource-action-cell span,
.evolution-memory-table .resource-action-cell span,
.evolution-rule-table .resource-action-cell span {
  overflow: hidden;
  color: #64748b;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resource-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.resource-action-cell {
  flex-wrap: nowrap;
  align-items: center;
  min-width: 0;
}

.resource-row-actions button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.resource-action-cell button {
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #0f766e;
  font-size: 12px;
  white-space: nowrap;
}

.resource-action-cell button:hover {
  border-color: #99f6e4;
  background: #f0fdfa;
}

.resource-action-cell button.ghost.danger {
  border-color: #fecdd3;
  background: #fff1f2;
  color: #b91c1c;
}

.resource-action-cell button.ghost.danger:hover {
  border-color: #fda4af;
  background: #ffe4e6;
}

.resource-empty {
  padding: 18px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  color: #64748b;
  background: #f8fafc;
  font-size: 13px;
}

.resource-category .mini-head {
  align-items: flex-start;
}

.resource-spec-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
}

.resource-spec-list span {
  color: #475569;
  font-size: 12px;
  line-height: 1.45;
}

.supplier-focus {
  background: #f8fafc;
}

.config-section {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

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

.mini-head h3 {
  margin-bottom: 0;
}

.mini-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.mini-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.mini-actions button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.supplier-row {
  width: 100%;
  min-height: auto;
  display: grid;
  gap: 4px;
  text-align: left;
  padding: 10px;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.supplier-row:hover,
.supplier-row.active {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: rgba(11, 118, 110, 0.28);
}

.supplier-row span {
  font-size: 14px;
  font-weight: 800;
}

.supplier-row small,
.empty-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

#supplierForm,
#supplierVendorForm,
#productForm {
  max-height: none;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  z-index: 100;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
}

.modal-card {
  position: relative;
  width: min(760px, 100%);
  max-height: calc(100vh - 44px);
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.32);
  padding: 18px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.modal-head h3 {
  margin-bottom: 0;
}

@media (max-width: 1180px) {
  .evolution-table {
    gap: 12px;
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .evolution-table-row {
    min-width: 0;
    grid-template-columns: minmax(0, 1.2fr) minmax(160px, 0.8fr) minmax(0, 1fr);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
  }

  .evolution-table-head {
    display: none;
  }

  .evolution-cell {
    border-left: 1px solid var(--line);
    border-top: 1px solid var(--line);
  }

  .evolution-cell:nth-child(1),
  .evolution-cell:nth-child(2),
  .evolution-cell:nth-child(3) {
    border-top: 0;
  }

  .evolution-cell:nth-child(3n + 1) {
    border-left: 0;
  }

  .evolution-mobile-label {
    display: block;
  }
}

@media (max-width: 860px) {
  .shell {
    padding: 14px;
    display: block;
  }

  .metrics,
  .grid.two,
  .form-row {
    grid-template-columns: 1fr;
  }

  .tabs {
    position: static;
    width: 100%;
    min-height: auto;
    flex-direction: row;
    overflow-x: auto;
    margin-bottom: 12px;
    border-radius: 10px;
  }

  .tabs::before,
  .tabs::after {
    display: none;
  }

  .tab {
    width: auto;
    white-space: nowrap;
  }

  .topbar {
    position: static;
    margin-bottom: 12px;
  }

  .metrics {
    margin-bottom: 12px;
  }

  .list-tools,
  .resource-filter-row,
  .pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .list-tools label,
  .resource-filter-row label {
    width: 100%;
  }

  .pagination-actions {
    width: 100%;
  }

  .pagination-actions button {
    flex: 1;
  }

  .panel.active,
  #suppliers.panel.active {
    display: block;
  }

  .supplier-console {
    grid-template-columns: 1fr;
  }

  .supplier-directory {
    position: static;
    max-height: none;
  }

  .project-detail-title,
  .project-detail-mainline,
  .project-detail-section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .project-requirement-list,
  .project-profit-grid,
  .project-hardware-grid,
  .quote-summary-grid {
    grid-template-columns: 1fr;
  }

  .project-requirement-item {
    grid-template-columns: 1fr;
  }

  .project-detail-row,
  .quote-detail-row,
  .evolution-table-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .evolution-table-head {
    display: none;
  }

  .evolution-cell {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .evolution-mobile-label {
    display: block;
  }

  .evolution-cell:first-child {
    border-top: 0;
  }

  .evolution-detail-hero {
    display: grid;
  }

  .resource-table-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .server-db-row {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .evolution-db-row {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .evolution-memory-row,
  .evolution-rule-row {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .resource-table-head {
    display: none;
  }

  .resource-row-actions {
    justify-content: flex-start;
  }
}
