:root {
  --bg: #f3f5f1;
  --ink: #18201c;
  --muted: #647067;
  --line: #d7ddd3;
  --paper: #fffdf7;
  --paper-2: #eef3ea;
  --green: #0f7c46;
  --green-2: #dff1e5;
  --amber: #b47705;
  --amber-2: #fff0c9;
  --red: #b6382f;
  --blue: #2867b2;
  --shadow: 0 18px 45px rgba(31, 44, 35, 0.12);
}

* { box-sizing: border-box; }

.hidden {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "Segoe UI", sans-serif;
}

button, input, select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: #17231c;
  color: #f7fbf2;
  padding: 24px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 28px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: #d9f2c7;
  color: #17231c;
  font-weight: 800;
  border-radius: 8px;
}

.brand h1 {
  margin: 0;
  font-size: 18px;
}

.brand p, .summary-panel p, .panel-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

.sidebar .brand p {
  color: #b7c3b9;
}

.file-drop {
  display: block;
  padding: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  margin-bottom: 20px;
  cursor: pointer;
}

.file-drop span, .file-drop strong {
  display: block;
}

.file-drop strong {
  margin-top: 6px;
  color: #d9f2c7;
  font-size: 13px;
}

.file-drop input {
  display: none;
}

.nav-group {
  display: grid;
  gap: 10px;
  margin-bottom: 24px;
}

.nav-item, .secondary, .primary, .danger {
  min-height: 40px;
  border-radius: 8px;
  padding: 0 14px;
}

.nav-item {
  text-align: left;
  color: #e6eee8;
  background: transparent;
  min-height: 54px;
  display: grid;
  align-content: center;
  gap: 7px;
}

.nav-item.active, .nav-item:hover {
  background: #2b3b30;
}

.filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  line-height: 1;
}

.filter-row strong {
  font-size: 17px;
  color: #f4f8ef;
}

.filter-meter {
  height: 6px;
  border-radius: 999px;
  background: rgba(231, 236, 226, 0.13);
  overflow: hidden;
}

.filter-meter i {
  display: block;
  height: 100%;
  min-width: 4px;
  border-radius: inherit;
  background: var(--filter-color, #cfe9bf);
  transition: width 0.2s ease;
}

.side-actions {
  display: grid;
  gap: 10px;
  padding-bottom: 18px;
}

.primary {
  background: var(--green);
  color: white;
}

.secondary {
  background: #e7ece2;
  color: var(--ink);
}

.danger {
  background: rgba(182, 56, 47, 0.14);
  color: #ffd8d4;
}

.small {
  min-height: 34px;
}

.full-width {
  width: 100%;
  margin-bottom: 16px;
}

.main {
  padding: 28px 28px 48px;
  min-width: 0;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(280px, 520px) auto;
  align-items: end;
  gap: 18px;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green);
  font-weight: 700;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: 30px;
}

.search-wrap {
  width: 100%;
}

.top-actions {
  display: flex;
  justify-content: flex-end;
}

.top-actions button {
  min-width: 132px;
}

.search-wrap input, .date-mode input, .range-panel input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 8px;
  padding: 0 12px;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.kpi {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.kpi span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.kpi strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

.kpi:nth-last-child(-n + 2) {
  background: #f7fbf2;
  border-color: rgba(15, 124, 70, 0.24);
}

.kpi:nth-last-child(-n + 2) strong {
  font-size: 22px;
  color: var(--green);
  white-space: nowrap;
}

.range-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px 180px auto;
  align-items: end;
  gap: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 18px;
}

.range-title {
  display: grid;
  gap: 4px;
}

.range-title strong {
  font-size: 15px;
}

.range-title span, .range-panel label, .date-mode label {
  color: var(--muted);
  font-size: 12px;
}

.range-panel label, .date-mode label {
  display: grid;
  gap: 5px;
}

.summary-panel, .table-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  overflow: hidden;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.panel-head.compact {
  align-items: center;
  padding: 14px 18px;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.pager button, .pager select, .pager label {
  flex: 0 0 auto;
}

.pager p {
  margin: 0 8px 0 0;
  color: var(--muted);
}

.pager label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.pager select {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  color: var(--ink);
  padding: 0 8px;
}

.panel-head h3 {
  margin: 0;
  font-size: 18px;
}

.date-mode {
  display: flex;
  align-items: end;
  gap: 8px;
}

.company-chip {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--green-2);
  color: var(--green);
  font-weight: 700;
  white-space: nowrap;
}

.company-manual {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.company-manual select {
  width: 260px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--green-2);
  color: var(--green);
  font-weight: 700;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.date-mode label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.table-wrap, .summary-table-wrap {
  overflow: auto;
}

.table-wrap {
  scrollbar-gutter: stable;
}

.table-scroll-proxy {
  position: fixed;
  left: 300px;
  right: 28px;
  bottom: 0;
  z-index: 20;
  height: 18px;
  overflow-x: auto;
  overflow-y: hidden;
  background: linear-gradient(180deg, rgba(255, 253, 247, 0.72), var(--paper));
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 -8px 24px rgba(31, 44, 35, 0.12);
}

.table-scroll-proxy-inner {
  height: 1px;
}

.summary-visual {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(380px, 1.35fr);
  gap: 18px;
  padding: 18px;
  align-items: stretch;
}

.progress-stack {
  display: grid;
  gap: 14px;
  align-content: center;
  padding: 8px 0;
}

.progress-row {
  display: grid;
  gap: 7px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.progress-track {
  height: 12px;
  background: #e5e9e1;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
}

.progress-fill.budget { background: var(--green); }
.progress-fill.construction { background: #d89b10; }
.progress-fill.acceptance { background: var(--red); }
.progress-fill.settlement { background: var(--blue); }

.bar-chart {
  height: 178px;
  display: grid;
  grid-template-columns: repeat(4, minmax(68px, 1fr));
  align-items: stretch;
  gap: 18px;
  padding: 10px 16px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(#f1f5ee 1px, transparent 1px) 0 0 / 100% 25%;
  overflow: hidden;
}

.bar-item {
  display: grid;
  grid-template-rows: 22px 104px 28px;
  justify-items: center;
  align-items: end;
  gap: 4px;
  min-width: 0;
}

.bar {
  width: min(54px, 70%);
  min-height: 4px;
  border-radius: 7px 7px 0 0;
  background: var(--blue);
}

.bar.budget { background: var(--green); }
.bar.construction { background: #d89b10; }
.bar.acceptance { background: var(--red); }
.bar.settlement { background: var(--blue); }

.bar-value {
  font-weight: 800;
}

.bar-label {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  white-space: normal;
  line-height: 1.2;
  align-self: start;
}

.table-panel {
  margin-top: 16px;
  padding-bottom: 18px;
}

.danger-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 24px;
  padding: 14px 16px;
  border: 1px solid rgba(182, 56, 47, 0.28);
  border-radius: 8px;
  background: rgba(182, 56, 47, 0.06);
}

.danger-panel div {
  display: grid;
  gap: 4px;
}

.danger-panel strong {
  color: var(--red);
}

.danger-panel span {
  color: var(--muted);
  font-size: 13px;
}

.danger-panel .danger {
  color: #fff;
  background: var(--red);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  border-bottom: 1px solid var(--line);
  padding: 7px 10px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
  font-size: 13px;
}

th {
  position: sticky;
  top: 0;
  background: #edf3ea;
  z-index: 1;
  font-weight: 700;
}

#ordersTable {
  table-layout: fixed;
  min-width: 1160px;
}

#ordersTable th {
  position: sticky;
  overflow: visible;
}

.resize-handle {
  position: absolute;
  top: 0;
  right: -3px;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  z-index: 3;
}

.resize-handle::after {
  content: "";
  position: absolute;
  top: 7px;
  bottom: 7px;
  left: 3px;
  width: 1px;
  background: transparent;
}

#ordersTable th:hover .resize-handle::after {
  background: var(--green);
}

td.title-cell {
  white-space: normal;
  line-height: 1.35;
}

.money-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: #334037;
}

.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-weight: 700;
}

.done {
  background: var(--green-2);
  color: var(--green);
}

.todo {
  background: var(--amber-2);
  color: var(--amber);
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-start;
}

.mobile-detail-row {
  display: none;
}

.mobile-detail-box {
  background: #f6faf3;
  border: 1px solid #e2eadf;
  border-radius: 8px;
  padding: 10px 12px;
  display: grid;
  gap: 6px;
}

.mobile-detail-box p {
  margin: 0;
  color: #33423a;
  line-height: 1.4;
}

.complete-btn, .void-btn, .return-btn, .restore-btn, .delete-btn, .final-btn {
  height: 28px;
  padding: 0 9px;
  border-radius: 7px;
  background: #e8efe5;
  color: var(--ink);
}

#ordersTable th[data-col="actions"],
#ordersTable td.actions-cell {
  position: sticky;
  right: 0;
  z-index: 4;
  background: var(--paper);
  box-shadow: -10px 0 18px rgba(31, 44, 35, 0.08);
}

#ordersTable th[data-col="actions"] {
  z-index: 5;
  background: #edf3ea;
}

.complete-btn.is-done,
.final-btn.is-done {
  background: var(--green);
  color: white;
}

.void-btn {
  background: rgba(182, 56, 47, 0.12);
  color: var(--red);
}

.return-btn {
  background: rgba(180, 119, 5, 0.15);
  color: var(--amber);
}

.final-btn {
  background: rgba(40, 103, 178, 0.13);
  color: var(--blue);
}


.delete-btn {
  background: #2d2119;
  color: #fff;
}

.ignored-badge {
  height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 700;
}

.ignored-badge.is-returned {
  background: rgba(180, 119, 5, 0.15);
  color: var(--amber);
}

.ignored-badge.is-voided {
  background: rgba(182, 56, 47, 0.12);
  color: var(--red);
}

.manual-dialog {
  width: min(720px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.manual-dialog::backdrop {
  background: rgba(16, 24, 20, 0.35);
}

.manual-dialog form {
  padding: 22px;
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.dialog-head h3 {
  margin: 0;
  font-size: 20px;
}

.icon-close {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: #eef3ea;
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
}

.manual-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.manual-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.manual-grid .full {
  grid-column: 1 / -1;
}

.manual-grid input,
.manual-grid textarea {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  background: white;
  color: var(--ink);
}

.manual-grid textarea {
  min-height: 180px;
  padding: 10px;
  resize: vertical;
  line-height: 1.45;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.date-input {
  width: 128px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 8px;
  background: white;
}

.empty-state {
  display: grid;
  place-items: center;
  text-align: center;
  min-height: 360px;
  padding: 42px;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  border-radius: 8px;
  background: var(--green-2);
  color: var(--green);
  font-weight: 900;
  margin-bottom: 16px;
}

.empty-state p {
  max-width: 560px;
  color: var(--muted);
}

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    max-height: none;
    overflow: visible;
  }
  .brand { margin-bottom: 18px; }
  .file-drop { margin-bottom: 14px; }
  .nav-group { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 16px; }
  .side-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .range-panel { grid-template-columns: 1fr 1fr; }
  .range-title { grid-column: 1 / -1; }
  .topbar { grid-template-columns: 1fr; align-items: stretch; }
  .top-actions { justify-content: stretch; }
  .top-actions button { width: 100%; }
  .search-wrap { width: 100%; }
  .summary-visual { grid-template-columns: 1fr; }
  .panel-head { align-items: flex-start; flex-direction: column; }
  .table-scroll-proxy {
    left: 12px;
    right: 12px;
  }
}

@media (max-width: 720px) {
  .sidebar { padding: 18px 14px; }
  .main { padding: 18px 12px 36px; }
  .brand h1 { font-size: 17px; }
  h2 { font-size: 24px; }
  .file-drop { padding: 14px; }
  .nav-group { grid-template-columns: 1fr; gap: 8px; }
  .nav-item { min-height: 46px; }
  .side-actions { grid-template-columns: 1fr; gap: 8px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { min-height: 78px; padding: 14px; }
  .range-panel { grid-template-columns: 1fr; }
  .summary-panel, .table-panel { border-radius: 8px; }
  .danger-panel {
    display: grid;
    align-items: stretch;
  }
  .summary-visual { padding: 12px; }
  .bar-chart {
    gap: 8px;
    padding: 10px 8px 12px;
    overflow-x: auto;
  }
  .bar-item { min-width: 58px; }
  .panel-head.compact {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 12px;
  }
  .panel-head.compact h3 { margin: 0; }
  .pager {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    align-items: center;
  }
  .pager #rowCount {
    grid-column: 1 / -1;
    margin: 0;
  }
  .pager label {
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .pager label select { flex: 1 1 auto; }
  .pager #pageSelect,
  .pager #prevPageBtn,
  .pager #nextPageBtn { width: 100%; }
  #ordersTable { font-size: 13px; }
  .date-input { width: 112px; }
  .row-actions {
    min-width: 214px;
    gap: 5px;
  }
  .row-actions button,
  .row-actions .ignored-badge {
    min-height: 32px;
    padding: 0 10px;
    font-size: 14px;
  }

  #ordersTable col[data-col="seq"] { width: 54px !important; }
  #ordersTable col[data-col="arrivedAt"] { width: 112px !important; }
  #ordersTable col[data-col="title"] { width: 220px !important; }
  #ordersTable col[data-col="actions"] { width: 220px !important; }

  #ordersTable th[data-col="code"],
  #ordersTable th[data-col="budgetDate"],
  #ordersTable th[data-col="constructionDate"],
  #ordersTable th[data-col="acceptanceDate"],
  #ordersTable th[data-col="constructionDuration"],
  #ordersTable td.col-code,
  #ordersTable td.col-budgetDate,
  #ordersTable td.col-constructionDate,
  #ordersTable td.col-acceptanceDate,
  #ordersTable td.col-constructionDuration {
    display: none;
  }

  #ordersTable th[data-col="seq"],
  #ordersTable td.col-seq {
    width: 54px;
    min-width: 54px;
    text-align: center;
    padding-left: 8px;
    padding-right: 8px;
  }

  #ordersTable th[data-col="arrivedAt"],
  #ordersTable td.col-arrivedAt {
    width: 112px;
    min-width: 112px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #ordersTable td.col-title {
    min-width: 220px;
    max-width: 220px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
  }

  #ordersTable td.col-actions {
    min-width: 220px;
  }

  .mobile-detail-row.is-open {
    display: table-row;
  }

  .order-row.is-expanded td {
    border-bottom-color: transparent;
  }
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(15, 124, 70, 0.08), transparent 42%),
    var(--bg);
}

.login-panel {
  width: min(420px, 100%);
  display: grid;
  gap: 16px;
  padding: 30px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-panel h1 {
  margin: 0 0 4px;
  font-size: 30px;
}

.login-panel label,
.overview-range label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.login-panel input,
.overview-range input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: white;
  color: var(--ink);
}

.login-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #17231c;
  color: #d9f2c7;
  font-size: 22px;
  font-weight: 800;
}

.login-error {
  min-height: 20px;
  margin: 0;
  color: var(--red);
  font-size: 13px;
}

.login-hint {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 8px;
  background: var(--paper-2);
  color: var(--muted);
  font-size: 13px;
}

.overview-view {
  min-height: 100vh;
  padding: 28px;
}

.overview-top {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.overview-top h1 {
  margin: 0;
  font-size: 32px;
}

.overview-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.overview-range {
  display: flex;
  align-items: end;
  gap: 12px;
  padding: 16px;
  margin-bottom: 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.overview-totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metric-tile,
.overview-panel,
.profile-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(31, 44, 35, 0.08);
}

.metric-tile {
  display: grid;
  gap: 8px;
  padding: 15px;
}

.metric-tile span,
.profile-money-grid,
.rank-item span {
  color: var(--muted);
  font-size: 13px;
}

.metric-tile strong {
  font-size: 24px;
}

.profile-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.profile-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  text-align: left;
  color: var(--ink);
}

.profile-card:hover {
  border-color: rgba(15, 124, 70, 0.45);
  transform: translateY(-1px);
}

.profile-card-head,
.rank-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.profile-card-head strong {
  font-size: 18px;
}

.profile-card-head span {
  font-size: 16px;
  color: var(--ink);
}

.profile-money-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.profile-money-grid span {
  display: grid;
  gap: 4px;
  padding: 10px;
  border-radius: 8px;
  background: var(--paper-2);
}

.profile-money-grid strong {
  color: var(--ink);
  font-size: 16px;
}

.profile-gauges {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.mini-gauge {
  display: grid;
  justify-items: center;
  gap: 4px;
}

.mini-gauge i {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--paper) 0 53%, transparent 54%),
    conic-gradient(var(--gauge-color) calc(var(--value) * 1%), #e7ece2 0);
  box-shadow: inset 0 0 0 1px rgba(24, 32, 28, 0.04);
}

.mini-gauge strong {
  margin-top: -43px;
  min-height: 20px;
  font-size: 13px;
}

.mini-gauge span {
  margin-top: 20px;
  color: var(--muted);
  font-size: 12px;
}

.status-stack {
  display: grid;
  gap: 8px;
}

.status-track {
  display: flex;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7ece2;
}

.status-track i {
  min-width: 0;
}

.status-track .todo-budget,
.status-legend .todo-budget::before { background: #d9a92f; }
.status-track .todo-construction,
.status-legend .todo-construction::before { background: #b47705; }
.status-track .todo-acceptance,
.status-legend .todo-acceptance::before { background: #2867b2; }
.status-track .done,
.status-legend .done::before { background: #0f7c46; }
.status-track .ignored,
.status-legend .ignored::before { background: #9b6a42; }

.status-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 10px;
  color: var(--muted);
  font-size: 12px;
}

.status-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.status-legend span::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.rate-panel {
  margin-bottom: 18px;
}

.overview-panel {
  padding: 18px;
}

.rate-compare,
.rank-list {
  display: grid;
  gap: 8px;
}

.rate-matrix-head,
.rate-matrix-row {
  display: grid;
  grid-template-columns: 96px repeat(3, minmax(130px, 1fr));
  align-items: center;
  gap: 8px;
}

.rate-matrix-head {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.rate-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--ink);
  background: color-mix(in srgb, var(--cell-color) calc(18% + var(--value) * 0.45%), white);
  border: 1px solid color-mix(in srgb, var(--cell-color) calc(25% + var(--value) * 0.35%), var(--line));
}

.rate-cell.budget { --cell-color: #0f7c46; }
.rate-cell.construction { --cell-color: #b47705; }
.rate-cell.acceptance { --cell-color: #2867b2; }
.rate-cell.zero { background: #edf1e9; color: var(--muted); }

.rate-cell strong {
  font-size: 18px;
}

.rate-cell span {
  font-size: 12px;
  font-weight: 700;
}

.rate-bar.acceptance i,
.amount-row i.settlement {
  background: #dbe9fa;
}

.rate-bar span,
.rate-bar em,
.amount-row span,
.amount-row em {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 8px;
  font-style: normal;
  font-size: 12px;
}

.rate-bar em,
.amount-row em {
  float: right;
  font-weight: 800;
}

.amount-row {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 8px;
  align-items: center;
}

.amount-row strong {
  grid-row: span 2;
}

.rank-item {
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffef9;
}

.rank-item strong {
  min-width: 180px;
}

.rank-item em {
  font-style: normal;
  font-weight: 800;
}

.empty-overview {
  padding: 18px;
  color: var(--muted);
  background: var(--paper-2);
  border-radius: 8px;
}

.account-panel {
  margin-top: 18px;
}

.account-matrix {
  display: grid;
  gap: 8px;
  overflow-x: auto;
}

.account-row {
  display: grid;
  grid-template-columns: 160px repeat(6, minmax(90px, 1fr));
  gap: 8px;
  align-items: center;
  min-width: 780px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffef9;
}

.account-head {
  background: var(--paper-2);
  color: var(--muted);
  font-size: 13px;
}

.account-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-weight: 500;
}

.permission-check {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  border-radius: 8px;
  background: var(--paper-2);
  font-size: 13px;
}

@media (max-width: 1180px) {
  .overview-totals { grid-template-columns: repeat(4, minmax(120px, 1fr)); }
  .profile-cards { grid-template-columns: repeat(2, minmax(260px, 1fr)); }
}

@media (max-width: 760px) {
  .overview-view { padding: 16px; }
  .overview-top,
  .overview-range,
  .overview-user { align-items: stretch; flex-direction: column; }
  .overview-totals,
  .profile-cards { grid-template-columns: 1fr; }
  .rate-matrix-head { display: none; }
  .rate-matrix-row { grid-template-columns: 1fr; }
  .rate-matrix-row strong { font-size: 16px; }
  .rank-item { display: grid; }
  .rank-item strong { min-width: 0; }
}



