:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --panel-2: #fbfbfc;
  --text: #16202a;
  --muted: #66727f;
  --line: #d5dce3;
  --accent: #1166cc;
  --accent-soft: #e9f2ff;
  --good: #127a4a;
  --warn: #9b6100;
  --danger: #b42318;
  --radius: 8px;
  --shadow: 0 10px 28px rgba(12, 28, 51, 0.08);
  --sidebar: 268px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
}

.sidebar {
  background: #122030;
  color: #eef3f9;
  padding: 20px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}

.brand h1 {
  margin: 0;
  font-size: 22px;
}

.brand p {
  margin: 6px 0 0;
  color: #b5c0cb;
}

.session-card {
  margin-top: 16px;
  padding: 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
}

.session-card strong,
.session-card span {
  display: block;
}

.session-card span {
  color: #b5c0cb;
}

.sidebar-section {
  margin-top: 24px;
}

.sidebar-section .nav-group + .nav-group {
  margin-top: 14px;
}

.sidebar-title {
  margin: 0 0 8px;
  font-size: 12px;
  color: #97a8b7;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.nav-group-toggle {
  width: 100%;
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #97a8b7;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-group-toggle::before {
  content: "▾";
  margin-right: 6px;
  color: #b5c0cb;
  transition: transform .16s ease;
}

.nav-group.collapsed .nav-group-toggle::before {
  transform: rotate(-90deg);
}

.nav-group-toggle span:first-child {
  margin-right: auto;
}

.nav-group-meta {
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: #dce6ef;
  text-align: center;
  letter-spacing: 0;
}

.nav-group-body {
  margin-top: 2px;
}

.nav-btn,
.ghost-btn,
.primary-btn,
.danger-btn {
  border-radius: 8px;
  border: 1px solid transparent;
  transition: .16s ease;
}

.nav-btn {
  display: block;
  width: 100%;
  text-align: left;
  margin-bottom: 6px;
  padding: 10px 12px;
  border-color: rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: inherit;
}

.nav-btn.active,
.nav-btn:hover {
  background: rgba(255,255,255,0.12);
}

.change-password-box {
  margin-bottom: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.04);
}

.change-password-box summary {
  padding: 10px 12px;
  cursor: pointer;
  color: #eef3f9;
}

.change-password-form {
  padding: 0 10px 10px;
  display: grid;
  gap: 8px;
}

.change-password-form input {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.08);
  color: #eef3f9;
}

.change-password-form input::placeholder {
  color: #b5c0cb;
}

.change-password-form button {
  width: 100%;
}

.content {
  padding: 24px;
  min-width: 0;
  position: relative;
}

.site-scope-badge {
  position: sticky;
  top: 12px;
  z-index: 20;
  margin-left: auto;
  margin-bottom: 12px;
  width: fit-content;
  max-width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,0.92);
  box-shadow: var(--shadow);
  color: var(--muted);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-scope-badge select {
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 600;
  padding: 0;
  min-width: 120px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.hero h2 {
  margin: 0;
  font-size: 28px;
}

.hero p {
  margin: 6px 0 0;
  color: var(--muted);
  max-width: 700px;
}

.page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, .95fr);
  gap: 16px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 0;
}

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

.panel-head h3 {
  margin: 0;
  font-size: 18px;
}

.inline-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  margin-left: 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  vertical-align: middle;
}

.panel-body { padding: 16px; }

.suggestion-card {
  border: 1px solid #bfd5f7;
  background: #f7fbff;
  border-radius: 8px;
  padding: 14px;
}

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

.suggestion-card-head h4 {
  margin: 0;
  font-size: 16px;
}

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

.suggestion-grid div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.suggestion-grid strong {
  font-size: 14px;
}

.suggestion-grid small {
  color: var(--muted);
}

.quote-assist-stack {
  display: grid;
  gap: 12px;
}

.quote-assist-list {
  display: grid;
  gap: 10px;
}

.quote-assist-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.quote-assist-card.compact {
  background: #f9fbff;
}

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

.quote-assist-meta {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  color: var(--muted);
  font-size: 13px;
}


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

.collapsible-panel summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.collapsible-panel summary::-webkit-details-marker {
  display: none;
}

.collapsible-summary {
  cursor: pointer;
  user-select: none;
}

.collapsible-summary::after {
  content: "展開";
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.collapsible-panel[open] .collapsible-summary::after {
  content: "收合";
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover {
  background: #f7fbff;
}

.group-row td {
  background: #f3f7fb;
  color: var(--muted);
  font-weight: 700;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 600;
  transition: .16s ease;
}

.filter-chip:hover {
  border-color: #bfd5f7;
  background: #eef6ff;
  color: var(--accent);
}

.filter-chip.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 18px rgba(17, 102, 204, 0.18);
}

.status-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.status-config-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  padding: 14px;
}

.status-config-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.status-config-card-head h4 {
  margin: 0;
  font-size: 16px;
}

.status-config-section + .status-config-section {
  margin-top: 14px;
}

.status-selected-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.status-selected-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 10px 12px;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.field.span-12 { grid-column: span 12; }
.field.span-6 { grid-column: span 6; }
.field.span-4 { grid-column: span 4; }
.field.span-3 { grid-column: span 3; }

.quote-tool-fields {
  align-items: start;
}

.inline-file-upload {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.inline-file-upload-name {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fafbfd;
  min-width: 0;
}

.inline-file-upload-name.has-file {
  border-style: solid;
  background: #f7f9fc;
}

.quote-tool-actions {
  margin-top: 8px;
}

.quote-tool-cost-summary {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  margin: 8px 0 14px;
}

.quote-tool-cost-card {
  min-height: 82px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}

.quote-tool-cost-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.quote-tool-cost-card strong {
  font-size: 22px;
  line-height: 1.15;
}

.quote-tool-cost-card small {
  color: var(--muted);
  font-size: 12px;
}

.quote-tool-cost-card input {
  width: 100%;
  min-width: 0;
  font-size: 20px;
  font-weight: 700;
  padding: 5px 7px;
}

.quote-tool-master-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 14px;
  margin: 10px 0 14px;
}

.quote-tool-master-form-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}

.quote-tool-bottom-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.quote-tool-output-row {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
}

.quote-tool-check-panel {
  border-radius: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
}

.quote-tool-check-error {
  background: #fff4f3;
  border-color: #f0c7c0;
}

.quote-tool-check-warn {
  background: #fff8ea;
  border-color: #efd8a6;
}

.quote-tool-check-title {
  font-weight: 700;
  margin-bottom: 8px;
}

.quote-tool-table-wrap {
  overflow: visible;
}

.quote-tool-table {
  min-width: 0;
  table-layout: fixed;
}

.quote-tool-table th,
.quote-tool-table td {
  padding: 8px 10px;
}

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

.quote-tool-table th:nth-child(2),
.quote-tool-table td:nth-child(2) {
  width: 17%;
}

.quote-tool-table th:nth-child(3),
.quote-tool-table td:nth-child(3) {
  width: 11%;
}

.quote-tool-table th:nth-child(4),
.quote-tool-table td:nth-child(4) {
  width: 15%;
}

.quote-tool-table th:nth-child(5),
.quote-tool-table td:nth-child(5),
.quote-tool-table th:nth-child(6),
.quote-tool-table td:nth-child(6) {
  width: 88px;
}

.quote-tool-table th:nth-child(7),
.quote-tool-table td:nth-child(7) {
  width: 110px;
}

.quote-tool-table th:nth-child(8),
.quote-tool-table td:nth-child(8) {
  width: 14%;
}

.quote-tool-table th:nth-child(9),
.quote-tool-table td:nth-child(9) {
  width: 14%;
}

.quote-tool-table th:nth-child(10),
.quote-tool-table td:nth-child(10) {
  width: 92px;
  text-align: center;
}

.quote-tool-table tbody tr {
  cursor: grab;
}

.quote-tool-table tbody tr.dragging {
  opacity: 0.55;
}

.quote-tool-table tbody tr.drag-over {
  background: #dff0ff;
  box-shadow: inset 0 2px 0 #1166cc, inset 0 -2px 0 #1166cc;
}

.quote-tool-table input {
  min-width: 0;
  width: 100%;
  padding: 8px 9px;
}

.quote-tool-table-b th,
.quote-tool-table-b td {
  padding: 7px 8px;
}

.quote-tool-section-row {
  cursor: default;
}

.quote-tool-section-row td {
  background: #f6f9fc;
  border-bottom-color: #d5dde7;
}

.quote-tool-section-label {
  font-weight: 800;
  color: #142033;
}

.quote-tool-section-label.lv1 {
  font-size: 15px;
}

.quote-tool-section-label.lv2 {
  padding-left: 18px;
  color: #425166;
}

.plain-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

.plain-list li {
  color: var(--text);
}

.empty-state {
  padding: 26px 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fafbfd;
  color: var(--muted);
  text-align: center;
}

.detail-note {
  min-height: 42px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fafbfd;
}

.field label,
.field .label {
  font-size: 12px;
  color: var(--muted);
}

.field input,
.field select,
.field textarea {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 6px;
  padding: 9px 10px;
  width: 100%;
}

.field textarea {
  min-height: 86px;
  resize: vertical;
}

.task-hint-card {
  border: 1px solid #bfd5f7;
  background: #eef6ff;
  border-radius: 8px;
  padding: 12px 14px;
}

.task-hint-title {
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 4px;
  font-weight: 700;
}

.task-hint-main {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.task-hint-sub {
  margin-top: 4px;
  color: var(--muted);
}

.primary-btn,
.ghost-btn,
.danger-btn {
  padding: 9px 14px;
}

.primary-btn {
  background: var(--accent);
  color: #fff;
}

.ghost-btn {
  background: #fff;
  border-color: var(--line);
  color: var(--text);
}

.ghost-btn.active-filter {
  background: var(--accent-soft);
  border-color: #bfd5f7;
  color: var(--accent);
}

.linkish-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.linkish-link:hover {
  color: #165bc6;
}

.danger-btn {
  background: #fff1f0;
  border-color: #f5c7c3;
  color: var(--danger);
}

.table-wrap {
  overflow: auto;
  width: 100%;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.projects-list-table {
  width: 100%;
  min-width: 100%;
  table-layout: auto;
}

.projects-list-panel,
.projects-list-panel .panel-body,
.projects-list-panel .table-wrap {
  width: 100%;
  max-width: 100%;
}

th, td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}

th {
  position: sticky;
  top: 0;
  background: var(--panel-2);
  font-size: 12px;
  color: var(--muted);
  z-index: 1;
}

th button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
}

tbody tr {
  background: #fff;
}

tbody tr:hover {
  background: #f9fbfd;
}

tbody tr.selected {
  background: #eef6ff;
}

tbody tr.flash-row {
  background: #fff4bf;
  box-shadow: inset 4px 0 0 #d39a00;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.project-status-inline-cell select {
  min-width: 96px;
  width: auto;
  max-width: 100%;
  padding-right: 8px;
  -webkit-appearance: none;
  appearance: none;
  background-image: none;
}

.project-order-inline-cell select {
  min-width: 0;
  width: 100%;
}

.device-project-inline-cell select {
  min-width: 220px;
}

.project-remarks-inline-cell input {
  min-width: 0;
  width: 100%;
}

.project-amount-inline-cell input {
  min-width: 0;
  width: 100%;
}

.project-face-count-inline-cell input {
  min-width: 72px;
}

.projects-list-table th,
.projects-list-table td {
  white-space: normal;
  word-break: break-word;
}

.projects-list-table .project-col-siteId {
  width: 10%;
}

.projects-list-table .project-col-projectName {
  width: 18%;
}

.projects-list-table .project-col-status {
  width: 8%;
}

.projects-list-table .project-col-hansenAmountUntaxed,
.projects-list-table .project-col-paulAmountUntaxed {
  white-space: nowrap;
  word-break: normal;
}

.projects-list-table .project-col-contactName,
.projects-list-table .project-col-managerUserId,
.projects-list-table .project-col-updatedAt,
.projects-list-table .project-col-orderCount,
.projects-list-table .project-col-frontendProgress,
.projects-list-table .project-col-backendProgress,
.projects-list-table .project-col-onlineProgress {
  width: 9%;
}

.projects-list-table th.project-col-contactName,
.projects-list-table td.project-col-contactName {
  padding-left: 36px;
}

.projects-list-table .project-col-number,
.projects-list-table .project-col-faceDeviceCount {
  width: 10%;
}

.projects-list-table .project-col-code,
.projects-list-table .project-col-orderNo {
  width: 14%;
}

.projects-list-table .project-col-remarks,
.projects-list-table .project-col-settlementProjectName,
.projects-list-table .project-col-nextStep,
.projects-list-table .project-col-missingInfo {
  width: 18%;
}

.projects-list-table .project-col-compact,
.projects-list-table .project-col-number {
  white-space: normal;
}

.projects-list-table td.project-col-hansenAmountUntaxed,
.projects-list-table td.project-col-paulAmountUntaxed {
  padding-left: 8px;
  padding-right: 8px;
}

.projects-list-table th:last-child,
.projects-list-table td:last-child {
  width: 132px;
}

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

.permission-check-cell {
  text-align: center;
  white-space: nowrap;
}

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

tbody tr.focus-project {
  background: #dff0ff;
  box-shadow: inset 4px 0 0 #1166cc;
  animation: project-focus-pulse 1.1s ease-in-out 2;
}

@keyframes project-focus-pulse {
  0% { background: #cfe8ff; }
  50% { background: #eef7ff; }
  100% { background: #dff0ff; }
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  white-space: nowrap;
}

.pill-toggle {
  border: none;
  cursor: pointer;
  font: inherit;
}

.pill.good { background: #e9f8ef; color: var(--good); }
.pill.warn { background: #fff5df; color: var(--warn); }
.pill.danger { background: #fff0ef; color: var(--danger); }

.stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.split-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.quote-upload-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: #fff;
}

.quote-upload-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.quote-upload-meta strong {
  font-size: 15px;
  color: var(--ink);
}

.quote-upload-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quote-upload-row {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.quote-upload-row:hover,
.quote-upload-row:focus-visible,
.quote-upload-row.dragover {
  border-color: #75a7f2;
  background: #f8fbff;
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.1);
  outline: none;
}

.quote-upload-row-label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 600;
}

.quote-upload-row-icon {
  font-size: 22px;
}

.quote-upload-row-main {
  min-width: 0;
}

.quote-upload-placeholder {
  padding: 14px 16px;
  border-radius: 10px;
  background: #f7f9fc;
  border: 1px dashed #d3deef;
}

.uploaded-inline-file {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  border-radius: 12px;
  background: #f7f9fc;
  padding: 10px 12px;
}

.inline-file-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  text-decoration: none;
}

.inline-file-icon {
  font-size: 20px;
  flex: 0 0 auto;
}

.inline-file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inline-file-remove {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #f0c8c3;
}

.quote-upload-add-btn {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 0;
  background: #bfbfbf;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
}

.quote-upload-add-btn:hover {
  background: #9aa4b2;
}

.settlement-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbff;
  padding: 14px;
}

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

.settlement-panel-head strong {
  color: var(--ink);
  font-size: 15px;
}

.settlement-grid {
  margin-top: 0;
}

.file-link-btn {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-remove-btn {
  border: 0;
  background: transparent;
  color: var(--danger);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

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

.notice {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
}

.notice.success {
  border-color: #b7e0c5;
  background: #f2fbf5;
  color: var(--good);
}

.notice.error {
  border-color: #f0beb9;
  background: #fff5f4;
  color: var(--danger);
}

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

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

.metric-card .label {
  color: var(--muted);
  font-size: 12px;
}

.metric-card strong {
  display: block;
  margin-top: 4px;
  font-size: 28px;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 24px;
}

.login-card h1 {
  margin: 0 0 8px;
  font-size: 28px;
}

.demo-users {
  margin-top: 12px;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fafbfd;
  font-size: 12px;
}

.table-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.order-icon-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.order-jump-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--accent);
  font-size: 14px;
}

.order-jump-btn:hover {
  background: var(--accent-soft);
  border-color: #bfd5f7;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-left: 6px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid #d8d7d1;
  background: linear-gradient(180deg, #fffdf8 0%, #f5f1e7 100%);
  color: #8d6a2f;
  box-shadow: 0 1px 1px rgba(15, 23, 42, 0.04);
  vertical-align: middle;
}

.icon-btn:hover {
  border-color: #c8b27a;
  background: linear-gradient(180deg, #fffefb 0%, #efe4c8 100%);
  color: #7b5a20;
}

.icon-btn .file-glyph {
  width: 14px;
  height: 14px;
  display: block;
}

.hidden { display: none !important; }

@media (max-width: 1024px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

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

  .quote-upload-inline {
    flex-direction: column;
    align-items: stretch;
  }

  .quote-upload-row {
    grid-template-columns: 1fr;
  }

  .settlement-panel-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .inline-file-upload {
    grid-template-columns: 1fr;
  }

  .quote-tool-output-row {
    grid-template-columns: 1fr;
  }

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

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

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

  .quote-tool-bottom-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .content {
    padding: 16px;
  }

  .site-scope-badge {
    top: 8px;
    margin-bottom: 10px;
    font-size: 12px;
  }

  .hero {
    display: block;
  }

  .hero h2 {
    font-size: 24px;
  }

  .field.span-6,
  .field.span-4,
  .field.span-3 {
    grid-column: span 12;
  }

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

  table {
    min-width: 0;
  }

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

  .table-wrap.mobile-cards thead {
    display: none;
  }

  .table-wrap.mobile-cards tr {
    border-bottom: 1px solid var(--line);
    padding: 8px 0;
  }

  .table-wrap.mobile-cards td {
    border: 0;
    padding: 6px 0;
  }
}
