:root {
  --bg: #f7f7f5;
  --bg-deep: #ecece8;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-strong: rgba(255, 255, 255, 0.98);
  --line: rgba(89, 90, 94, 0.12);
  --text: #2a2c31;
  --muted: #72757d;
  --accent: #f26a1b;
  --accent-2: #d94b27;
  --accent-soft: rgba(242, 106, 27, 0.08);
  --accent-deep: #4a4d54;
  --danger: #b44536;
  --shadow: 0 18px 44px rgba(27, 31, 35, 0.08);
  --radius: 20px;
}

.finance-ledger-grid,
.finance-statement-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.finance-ledger-panel {
  min-width: 0;
}

.finance-statement-card {
  padding: 16px;
  border: 1px solid rgba(89, 90, 94, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
}

.finance-statement-card h4 {
  margin: 3px 0 14px;
  color: var(--text);
  font-size: 20px;
}

.finance-statement-lines {
  display: grid;
  gap: 8px;
}

.finance-statement-lines div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid rgba(89, 90, 94, 0.08);
  border-radius: 8px;
  background: rgba(250, 250, 249, 0.74);
}

.finance-statement-lines span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.finance-statement-lines strong {
  color: var(--text);
  font-size: 14px;
  white-space: nowrap;
}

.finance-balance-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 260px));
  gap: 14px;
  margin: 14px 0 18px;
  align-items: end;
}

.finance-month-link {
  padding: 6px 10px;
}

.finance-balance-type {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.finance-balance-type.income {
  color: #256b43;
  background: rgba(37, 107, 67, 0.1);
}

.finance-balance-type.expense {
  color: #9f3d2e;
  background: rgba(185, 67, 46, 0.1);
}

body[data-theme="sand"] {
  --bg: #f6f1ea;
  --bg-deep: #e8ddd0;
  --panel: rgba(255, 251, 247, 0.92);
  --panel-strong: rgba(255, 252, 249, 0.98);
  --line: rgba(104, 90, 73, 0.12);
  --text: #312c28;
  --muted: #7d7067;
  --accent: #cf6b2d;
  --accent-2: #b8572e;
  --accent-soft: rgba(207, 107, 45, 0.1);
  --accent-deep: #5b4f45;
}

body[data-theme="graphite"] {
  --bg: #f1f2f4;
  --bg-deep: #e4e7eb;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-strong: rgba(255, 255, 255, 0.98);
  --line: rgba(59, 67, 77, 0.13);
  --text: #20252b;
  --muted: #64707d;
  --accent: #e26d2f;
  --accent-2: #c95732;
  --accent-soft: rgba(226, 109, 47, 0.08);
  --accent-deep: #33404c;
}

body[data-theme="blue"] {
  --bg: #eef4fb;
  --bg-deep: #dfe9f6;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-strong: rgba(255, 255, 255, 0.98);
  --line: rgba(55, 94, 140, 0.14);
  --text: #1f2b38;
  --muted: #627487;
  --accent: #2f6db8;
  --accent-2: #1f5ca8;
  --accent-soft: rgba(47, 109, 184, 0.1);
  --accent-deep: #284768;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(242, 106, 27, 0.08), transparent 26%),
    radial-gradient(circle at right, rgba(217, 75, 39, 0.08), transparent 24%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  overflow-x: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
}

.ambient,
.ambient-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.ambient-a {
  inset: -10rem auto auto -8rem;
  width: 28rem;
  height: 28rem;
  border-radius: 50%;
  background: rgba(242, 106, 27, 0.1);
  filter: blur(30px);
}

.ambient-b {
  inset: auto -9rem 6rem auto;
  width: 26rem;
  height: 26rem;
  border-radius: 50%;
  background: rgba(217, 75, 39, 0.08);
  filter: blur(34px);
}

.ambient-grid {
  background-image:
    linear-gradient(rgba(43, 35, 24, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(43, 35, 24, 0.035) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: 0.55;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.35));
}

#app {
  position: relative;
  z-index: 1;
}

.login-shell,
.shell {
  width: min(1440px, calc(100vw - 30px));
  margin: 0 auto;
  padding: 22px 0 34px;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  align-items: center;
  grid-template-columns: minmax(320px, 760px);
  justify-content: center;
  align-content: center;
  gap: 18px;
}

.login-panel,
.panel,
.topbar-card,
.metric-card,
.record-card,
.attachment-card,
.detail-block,
.highlight-box,
.timeline-item,
.pipeline-row,
.fatal,
.brand-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero-panel {
  padding: 32px;
  background:
    linear-gradient(135deg, rgba(250, 250, 249, 0.98) 0%, rgba(245, 245, 243, 0.95) 100%);
  color: var(--text);
  position: relative;
}

.hero-logo {
  display: block;
  width: 90%;
  height: auto;
  margin: 0 auto 14px;
  background: transparent;
  border-radius: 0;
  padding: 0;
  border: none;
}

.hero-panel p {
  color: var(--muted);
  line-height: 1.65;
  max-width: 520px;
}

.form-panel {
  padding: 30px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(250,250,249,0.96));
  display: grid;
  justify-items: center;
  text-align: center;
}

.eyebrow,
.card-label {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}

.hero-panel .eyebrow {
  color: var(--accent);
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(34px, 5vw, 58px);
  line-height: 0.96;
  margin-bottom: 14px;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(24px, 4vw, 36px);
}

h3 {
  font-size: 24px;
}

.login-hint {
  margin-top: 16px;
  color: var(--muted);
  line-height: 1.7;
  text-align: center;
  width: 100%;
  max-width: 700px;
}

.form-panel .stack {
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
}

.form-panel label {
  width: 100%;
  text-align: left;
}

.shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 22px;
}

.shell.split-resizable {
  grid-template-columns: minmax(220px, 280px) 12px minmax(720px, 1fr);
  align-items: start;
}

.sidebar {
  display: grid;
  gap: 18px;
  align-content: start;
  min-width: 0;
}

.brand-card,
.panel,
.topbar-card {
  padding: 22px;
}

.panel {
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(249,249,248,0.94));
}

.brand-card h1 {
  font-size: 24px;
  line-height: 1.16;
  margin: 4px 0;
}

.brand-logo {
  display: block;
  width: 100%;
  max-width: 220px;
  height: auto;
  margin-bottom: 14px;
}

.brand-card p {
  color: var(--muted);
  line-height: 1.7;
}

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

.nav-group {
  display: grid;
  gap: 8px;
}

.subnav-list {
  display: none;
  gap: 6px;
  padding-left: 18px;
}

.nav-group.expanded .subnav-list {
  display: grid;
}

.subnav-btn {
  text-align: left;
  background: transparent;
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 600;
  position: relative;
}

.subnav-btn::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 50%;
  width: 6px;
  height: 6px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: rgba(89, 90, 94, 0.3);
}

.subnav-btn.active {
  color: var(--accent-deep);
  background: rgba(242, 106, 27, 0.06);
  border-color: rgba(242, 106, 27, 0.08);
}

.subnav-btn.active::before {
  background: var(--accent);
}

.nav-btn,
button {
  border: none;
  cursor: pointer;
  border-radius: 16px;
  padding: 12px 16px;
  transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  padding: 12px 16px;
  border: 1px solid rgba(89, 90, 94, 0.14);
  color: var(--text);
  text-decoration: none;
  background: transparent;
  font: inherit;
}

.nav-btn {
  text-align: left;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(89, 90, 94, 0.1);
  color: var(--text);
  font-weight: 600;
}

.nav-btn.active {
  background: linear-gradient(135deg, rgba(242, 106, 27, 0.98), rgba(217, 75, 39, 0.94));
  color: #fff;
  box-shadow: 0 14px 26px rgba(242, 106, 27, 0.22);
}

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

button.primary {
  background: linear-gradient(135deg, #f26a1b, #d94b27);
  color: white;
  box-shadow: 0 12px 24px rgba(242, 106, 27, 0.22);
}

button.secondary {
  background: rgba(242, 106, 27, 0.08);
  color: var(--accent);
}

button.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(89, 90, 94, 0.14);
}

.back-arrow-button {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 2px;
  width: 82px;
  min-width: 82px;
  height: 62px;
  padding: 6px 8px;
  border: 1px solid rgba(232, 95, 35, 0.16);
  border-radius: 18px;
  background: rgba(255, 248, 242, 0.9);
  color: var(--accent-deep);
  box-shadow: 0 8px 18px rgba(43, 35, 24, 0.06);
}

.back-arrow-button span {
  font-size: 34px;
  line-height: 0.82;
  font-weight: 700;
}

.back-arrow-button small {
  color: #7c7069;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}

.back-arrow-button:hover {
  border-color: rgba(232, 95, 35, 0.28);
  background: #fff3ea;
  box-shadow: 0 12px 22px rgba(232, 95, 35, 0.12);
}

button.full {
  width: 100%;
}

.sidebar-foot {
  display: grid;
  gap: 12px;
}

.user-chip {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(89, 90, 94, 0.1);
}

.user-chip span,
.record-meta,
.timeline-item span,
.login-hint,
.detail-block p,
.highlight-box p {
  color: var(--muted);
}

.main-panel {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.topbar-card {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(250,250,249,0.92));
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.page-accent {
  display: inline-block;
  width: 4px;
  height: 46px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(242, 106, 27, 0.72), rgba(217, 75, 39, 0.56));
  box-shadow: 0 0 0 1px rgba(242, 106, 27, 0.06);
  flex: 0 0 auto;
}

.page-accent-inline {
  height: 38px;
  margin-bottom: 10px;
}

.page-accent-hero {
  position: absolute;
  left: 34px;
  top: 92px;
  height: 72px;
}

.topbar-logo {
  width: 150px;
  max-width: 28vw;
  height: auto;
  display: block;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(89, 90, 94, 0.1);
}

.lang-switch.compact {
  width: fit-content;
}

.lang-switch button {
  min-width: 52px;
  padding: 8px 14px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.lang-switch button.active {
  background: linear-gradient(135deg, rgba(242, 106, 27, 0.98), rgba(217, 75, 39, 0.94));
  color: white;
}

.language-settings-panel {
  gap: 18px;
}

.language-settings-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding: 18px 20px;
  border: 1px solid rgba(89, 90, 94, 0.1);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(250, 247, 243, 0.9));
}

.language-settings-head h4 {
  margin: 0 0 8px;
  font-size: 1.06rem;
  letter-spacing: 0.02em;
}

.language-option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.language-option-card {
  display: grid;
  gap: 14px;
  padding: 20px;
  border-radius: 24px;
  border: 1px solid rgba(89, 90, 94, 0.1);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.language-option-card.active {
  border-color: rgba(242, 106, 27, 0.26);
  background: linear-gradient(180deg, rgba(255, 249, 245, 0.98), rgba(255, 255, 255, 0.92));
}

.language-option-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.language-option-code {
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.language-option-card h5 {
  margin: 0;
  font-size: 1.15rem;
}

.language-option-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.language-option-badge {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(246, 239, 234, 0.95);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.language-settings-note {
  padding: 0 2px;
}

.login-topbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 18px;
}

.topbar-meta {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
  min-width: 0;
}

.topbar-meta div,
.topbar-rate-field {
  min-width: 110px;
}

.topbar-user-chip {
  min-width: 132px;
  margin-left: 0;
  margin-right: auto;
}

.topbar-user-chip strong {
  margin-right: 8px;
}

.topbar-meta span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.topbar-rate-field {
  display: grid;
  gap: 3px;
  justify-items: end;
  text-align: right;
}

.topbar-rate-field input {
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 24px;
  line-height: 1;
  font-weight: 800;
  color: var(--text);
  width: 100%;
  max-width: 140px;
  text-align: right;
}

.topbar-rate-field input:focus {
  outline: none;
  box-shadow: none;
}

.exchange-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  width: 100%;
}

.exchange-card {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
}

.exchange-card span,
.exchange-card small {
  color: var(--muted);
}

.exchange-card span {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.exchange-card input {
  min-width: 0;
}

.content-grid,
.stack {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.settings-signature {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
  border: 1px solid rgba(218, 219, 223, 0.95);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(249, 247, 244, 0.92));
}

.settings-signature-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: #666;
  font-size: 13px;
}

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

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

.metric-grid-wide {
  align-items: stretch;
}

.metric-card {
  padding: 20px;
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.metric-card strong {
  display: block;
  margin-top: 10px;
  font-size: 32px;
  letter-spacing: -0.03em;
}

.metric-card p {
  margin: 12px 0 0;
  line-height: 1.7;
}

.dashboard-insight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.insight-card {
  padding: 18px;
  border: 1px solid rgba(89, 90, 94, 0.1);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(248,248,246,0.92));
}

.insight-card.accent {
  background: linear-gradient(135deg, rgba(242, 106, 27, 0.98), rgba(217, 75, 39, 0.94));
  color: white;
  box-shadow: 0 14px 28px rgba(242, 106, 27, 0.18);
}

.insight-card span {
  display: block;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.insight-card.accent span,
.insight-card.accent p {
  color: rgba(255,255,255,0.86);
}

.insight-card strong {
  display: block;
  margin-top: 10px;
  font-size: 30px;
  letter-spacing: -0.03em;
}

.insight-card p {
  margin: 10px 0 0;
  line-height: 1.6;
  color: #666;
}

.dashboard-chart {
  padding: 18px;
  border: 1px solid rgba(89, 90, 94, 0.1);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(248,248,246,0.92));
  margin-bottom: 18px;
}

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

.dashboard-bars {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.dashboard-bar-col {
  display: grid;
  gap: 8px;
  text-align: center;
}

.dashboard-bar-wrap {
  height: 160px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(242,106,27,0.06), rgba(217,75,39,0.1));
  padding: 10px;
}

.dashboard-bar {
  width: 100%;
  border-radius: 12px 12px 6px 6px;
  background: linear-gradient(180deg, rgba(242,106,27,0.92), rgba(217,75,39,0.92));
  min-height: 16px;
}

.dashboard-bar-col strong {
  font-size: 13px;
}

.dashboard-bar-col span {
  font-size: 12px;
  color: var(--muted);
}

.dashboard-kpis {
  display: grid;
  gap: 12px;
}

.panel .dashboard-kpis {
  display: none;
}

.dashboard-kpi-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid rgba(89, 90, 94, 0.1);
  border-radius: 16px;
  background: rgba(255,255,255,0.82);
}

.dashboard-people-schedule {
  padding: 20px;
}

.dashboard-people-count {
  display: inline-flex;
  min-width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
}

.dashboard-people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.dashboard-people-card {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid rgba(89, 90, 94, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease, background 0.16s ease;
}

.dashboard-people-card:hover,
.dashboard-people-card:focus-visible {
  border-color: rgba(229, 92, 37, 0.26);
  background: rgba(255, 250, 246, 0.94);
  box-shadow: 0 10px 22px rgba(78, 68, 58, 0.08);
  outline: none;
}

.dashboard-people-card.active {
  border-color: rgba(229, 92, 37, 0.44);
  background: rgba(255, 246, 238, 0.98);
  box-shadow: 0 12px 26px rgba(229, 92, 37, 0.12);
}

.dashboard-people-card strong {
  color: var(--text);
  font-size: 14px;
}

.dashboard-people-card span,
.dashboard-people-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.dashboard-person-detail {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(229, 92, 37, 0.14);
  border-radius: 14px;
  background: rgba(255, 250, 246, 0.72);
}

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

.dashboard-person-detail-head strong {
  color: var(--text);
  font-size: 15px;
}

.dashboard-person-detail-head span,
.dashboard-person-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(229, 92, 37, 0.1);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.dashboard-person-timeline {
  display: grid;
  gap: 8px;
}

.dashboard-person-schedule-row {
  display: grid;
  grid-template-columns: minmax(108px, 0.35fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(89, 90, 94, 0.09);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
}

.dashboard-person-schedule-row strong,
.dashboard-person-schedule-row h4 {
  margin: 0;
  color: var(--text);
  font-size: 13px;
}

.dashboard-person-schedule-row span,
.dashboard-person-schedule-row p {
  display: block;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.two-col,
.split-main,
.detail-grid {
  display: grid;
  gap: 18px;
}

.two-col {
  grid-template-columns: 1.05fr 0.95fr;
}

.split-main {
  grid-template-columns: 1.05fr 0.95fr;
}

.split-resizable {
  grid-template-columns: minmax(320px, 1.05fr) 12px minmax(320px, 0.95fr);
  align-items: start;
}

.split-resizable .panel {
  min-width: 0;
}

.split-resizer {
  width: 12px;
  cursor: col-resize;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(242, 106, 27, 0.08), rgba(217, 75, 39, 0.08));
  position: relative;
}

.shell-resizer::before {
  height: 96px;
}

.split-resizer::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 72px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(242, 106, 27, 0.55), rgba(217, 75, 39, 0.55));
}

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

.section-head,
.record-top,
.items-header,
.table-actions,
.totals-box,
.pipeline-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.section-head.compact {
  margin-bottom: 0;
}

.record-list,
.timeline,
.pipeline-list,
.attachment-gallery {
  display: grid;
  gap: 12px;
}

.record-card,
.attachment-card,
.detail-block,
.timeline-item,
.pipeline-row,
.highlight-box {
  padding: 16px 18px;
}

.record-card {
  cursor: pointer;
}

.record-card.active {
  border-color: rgba(242, 106, 27, 0.2);
  background: rgba(255, 248, 244, 0.98);
}

.record-card h4 {
  margin-bottom: 8px;
}

.record-top span {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(242, 106, 27, 0.08);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.record-actions-inline {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.record-card-tools {
  display: grid;
  justify-items: end;
  gap: 8px;
}

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

.action-grid-balanced {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(72px, max-content));
  justify-content: flex-start;
  align-items: start;
  gap: 8px;
}

.record-card-action {
  min-height: 32px;
  padding: 5px 10px;
  font-size: 12px;
}

.maintenance-brand-card {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 10px 4px 2px;
}

.maintenance-brand-card img {
  width: min(360px, 100%);
  max-width: 100%;
  display: block;
}

.maintenance-brand-card h3 {
  margin-bottom: 8px;
}

.maintenance-brand-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.maintenance-brand-card-compact {
  padding-bottom: 18px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.maintenance-brand-card-compact img {
  width: min(280px, 100%);
}

.maintenance-query-grid {
  margin-top: 12px;
}

.detail-block p {
  margin-bottom: 10px;
  line-height: 1.7;
}

.bullet-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  display: grid;
  gap: 8px;
}

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

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

.sales-order-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 14px;
}

.sales-order-grid .span-2 {
  grid-column: span 2;
}

.sales-order-textareas {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
}

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

.paired-textareas .span-2 {
  grid-column: span 2;
}

.sales-order-textareas .span-2 {
  grid-column: span 2;
}

label {
  display: grid;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(89, 90, 94, 0.14);
  background: rgba(255, 255, 255, 0.98);
  color: var(--text);
  padding: 12px 14px;
}

textarea {
  min-height: 90px;
  resize: vertical;
  line-height: 1.7;
}

.sales-order-compact textarea {
  min-height: 58px;
}

.sales-order-compact textarea[name="billingAddress"],
.sales-order-compact textarea[name="shippingAddress"],
.sales-order-compact textarea[name="notes"] {
  min-height: 46px;
}

.project-compact-textareas textarea[name="billingAddress"],
.project-compact-textareas textarea[name="siteAddress"],
.project-compact-textareas textarea[name="notes"] {
  min-height: 46px;
}

.hover-preview-textareas textarea {
  overflow: auto;
  transition: min-height 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.hover-preview-textareas textarea:hover,
.hover-preview-textareas textarea:focus {
  min-height: 110px;
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(43, 35, 24, 0.08);
  position: relative;
  z-index: 4;
}

.sales-order-compact label {
  gap: 6px;
}

.sales-order-compact input,
.sales-order-compact select,
.sales-order-compact textarea {
  padding: 10px 12px;
}

.sales-order-compact .section-head {
  margin-bottom: 6px;
}

.sales-order-compact .items-header {
  margin-top: 4px;
}

.document-item-import {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 360px) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  margin-bottom: 14px;
  border: 1px solid rgba(229, 92, 37, 0.18);
  border-radius: 8px;
  background: rgba(229, 92, 37, 0.045);
}

.document-item-import[data-clipboard-import] {
  cursor: text;
  position: relative;
}

.document-item-import[data-clipboard-import]:focus-within,
.document-item-import[data-clipboard-import]:focus {
  border-color: rgba(229, 92, 37, 0.46);
  box-shadow: 0 0 0 4px rgba(229, 92, 37, 0.09);
  outline: none;
}

.document-item-import[data-clipboard-import]::after {
  content: "点击此处后可 Ctrl+V 粘贴截图";
  position: absolute;
  right: 14px;
  bottom: -22px;
  color: var(--muted);
  font-size: 11px;
  pointer-events: none;
}

.document-item-import strong {
  display: block;
  color: var(--text);
}

.document-item-import span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.document-item-import input[type="file"] {
  min-height: 40px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.8);
}

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

.document-import-actions button {
  white-space: nowrap;
}

.document-attachment-strip {
  padding: 10px 12px 12px;
  border: 1px solid rgba(89, 90, 94, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
}

.document-attachment-strip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.document-attachment-strip-head strong {
  color: var(--text);
  font-size: 13px;
}

.document-attachment-strip-head span {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(229, 92, 37, 0.1);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 900;
}

.items-header {
  padding: 2px 0 10px;
}

.items-header .actions-row {
  gap: 10px;
}

.items-header .actions-row .ghost {
  background: rgba(255, 248, 242, 0.86);
  border-color: rgba(232, 95, 35, 0.16);
  color: #4b4f58;
}

.items-header .actions-row .ghost:hover {
  color: #d85220;
  box-shadow: 0 10px 18px rgba(232, 95, 35, 0.1);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(242, 106, 27, 0.35);
  box-shadow: 0 0 0 4px rgba(242, 106, 27, 0.08);
}

.date-picker-wrap {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
}

.date-picker-text {
  min-width: 0;
  padding-right: 58px;
  font-variant-numeric: tabular-nums;
}

.date-picker-native {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 46px;
  max-width: 46px;
  height: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  border-left: 1px solid rgba(89, 90, 94, 0.1);
  border-radius: 0 13px 13px 0;
  background: transparent;
  color: transparent;
  font-size: 0;
  text-indent: -9999px;
  box-shadow: none;
  color-scheme: light;
  overflow: hidden;
}

.date-picker-native::-webkit-datetime-edit,
.date-picker-native::-webkit-date-and-time-value {
  display: none;
}

.date-picker-native::-webkit-calendar-picker-indicator {
  width: 18px;
  height: 18px;
  margin: 0 12px 0 0;
  cursor: pointer;
  opacity: 0.72;
}

.date-picker-native:hover::-webkit-calendar-picker-indicator,
.date-picker-native:focus::-webkit-calendar-picker-indicator {
  opacity: 1;
}

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

.project-detail-collapsed {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 72px;
  padding: 16px 18px;
  border: 1px dashed rgba(232, 95, 35, 0.24);
  border-radius: 16px;
  background: rgba(255, 248, 242, 0.68);
  color: var(--muted);
}

.project-detail-collapsed strong {
  color: var(--text);
}

.solution-panel {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(232, 95, 35, 0.14);
  border-radius: 18px;
  background: rgba(255, 252, 249, 0.82);
}

.solution-count {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  color: #d85725;
  background: rgba(232, 95, 35, 0.08);
  font-size: 12px;
  font-weight: 800;
}

.solution-version-list {
  display: grid;
  gap: 10px;
}

.solution-version-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(34, 34, 34, 0.08);
  border-radius: 14px;
  background: #fff;
}

.solution-version-head,
.solution-version-head > div,
.solution-file-list {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.solution-version-head {
  justify-content: space-between;
  color: #727780;
  font-size: 12px;
}

.solution-version-head strong {
  color: #30343a;
  font-size: 14px;
}

.solution-version-tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  color: #df5b25;
  background: rgba(232, 95, 35, 0.09);
  font-weight: 900;
}

.solution-version-body {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.solution-version-body div {
  min-width: 0;
}

.solution-version-body span {
  display: block;
  margin-bottom: 5px;
  color: #7a8089;
  font-size: 12px;
  font-weight: 800;
}

.solution-version-body p {
  margin: 0;
  color: #3b4048;
  line-height: 1.55;
  white-space: pre-wrap;
}

.solution-file-list {
  padding-top: 2px;
}

.solution-file-list a {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.solution-form {
  display: grid;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid rgba(34, 34, 34, 0.08);
}

.solution-form-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.solution-form-title span {
  display: block;
  margin-bottom: 4px;
  color: #df5b25;
  font-size: 12px;
  font-weight: 900;
}

.solution-form-title strong {
  color: #2f333a;
}

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

.solution-reference-prompt,
.solution-reference-active {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
}

.solution-reference-prompt {
  border: 1px solid rgba(232, 95, 35, 0.18);
  background: rgba(255, 246, 239, 0.78);
}

.solution-reference-active {
  border: 1px solid rgba(69, 144, 94, 0.18);
  background: rgba(238, 250, 242, 0.8);
}

.solution-reference-prompt strong,
.solution-reference-active strong {
  color: #343840;
}

.solution-reference-prompt p,
.solution-reference-active p {
  margin: 4px 0 0;
  color: #747a83;
  font-size: 13px;
}

.attachment-card a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.document-attachment-panel {
  padding: 12px 14px;
  border: 1px solid rgba(89, 90, 94, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
}

.document-attachment-panel .section-head {
  margin-bottom: 10px;
}

.purchase-attachment-panel {
  display: grid;
  gap: 10px;
  border-color: rgba(229, 92, 37, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 250, 246, 0.82));
}

.purchase-attachment-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.purchase-attachment-head h4 {
  margin: 2px 0 0;
}

.purchase-attachment-head > span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-align: right;
}

.document-attachment-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.8fr);
  gap: 12px;
}

.purchase-attachment-grid {
  grid-template-columns: minmax(320px, 1.15fr) minmax(280px, 0.85fr);
  align-items: end;
}

.document-attachment-grid input[type="file"] {
  padding: 11px 14px;
  min-height: 46px;
}

.document-attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 0;
}

.document-attachment-list a,
.document-attachment-list .muted {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid rgba(89, 90, 94, 0.12);
  border-radius: 13px;
  background: rgba(250, 250, 249, 0.92);
  color: var(--text);
  text-decoration: none;
}

.document-attachment-list span {
  color: var(--muted);
  font-size: 12px;
}

.items-table {
  --items-grid-columns: 88px minmax(170px, 1.45fr) minmax(190px, 1.55fr) minmax(260px, 2.2fr) 96px 120px 126px 68px;
  --items-table-min-width: 1360px;
  display: grid;
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid rgba(232, 95, 35, 0.18);
  border-radius: 8px;
  background: #fffdfb;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.items-table-head,
.items-row {
  display: grid;
  grid-template-columns: var(--items-grid-columns);
  align-items: stretch;
  min-width: var(--items-table-min-width);
}

.items-table-sales .items-table-head,
.items-row-sales {
  grid-template-columns: var(--items-grid-columns);
}

.items-table-head {
  color: #6f5f55;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: linear-gradient(180deg, #fff8f2 0%, #fff3ea 100%);
  border-bottom: 1px solid rgba(232, 95, 35, 0.2);
}

.items-table-head > span,
.items-row > input,
.items-row > .line-total,
.items-row > button {
  min-width: 0;
  width: 100%;
  height: 52px;
  min-height: 52px;
  margin: 0;
  border: 0;
  border-left: 1px solid rgba(203, 171, 145, 0.3);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: none;
  line-height: 1.2;
}

.items-table-head > span:first-child,
.items-row > input:first-child {
  border-left: 0;
}

.items-table-head > span {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  font-weight: 800;
  white-space: nowrap;
}

.items-row {
  border-bottom: 1px solid rgba(203, 171, 145, 0.26);
  background: #fff;
  transition: background 0.16s ease;
}

.items-row:last-child {
  border-bottom: 0;
}

.items-row:hover {
  background: #fffaf6;
}

.items-row > input {
  padding: 0 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #333842;
}

.items-row > input:focus {
  background: #fff;
  border-color: rgba(203, 171, 145, 0.3);
  box-shadow: inset 0 0 0 2px rgba(242, 106, 27, 0.18);
}

.line-total {
  padding: 0 12px;
  display: flex;
  align-items: center;
  overflow: hidden;
  white-space: nowrap;
  color: #2f343c;
  font-weight: 700;
  background: rgba(255, 248, 242, 0.64);
}

.items-row > button.ghost {
  min-width: 0;
  padding: 0 10px;
  color: #c84f1e;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: none;
  background: rgba(255, 248, 242, 0.64);
}

.items-row > button.ghost:hover {
  transform: none;
  color: #fff;
  background: #e85f23;
}

.construction-cost-scroll {
  overflow: auto;
  max-height: min(68vh, 720px);
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.construction-cost-table {
  min-width: 2600px;
  table-layout: fixed;
}

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

.construction-cost-table th:nth-child(1),
.construction-cost-table td:nth-child(1) { width: 130px; }
.construction-cost-table th:nth-child(2),
.construction-cost-table td:nth-child(2) { width: 190px; }
.construction-cost-table th:nth-child(3),
.construction-cost-table td:nth-child(3) { width: 190px; }
.construction-cost-table th:nth-child(4),
.construction-cost-table td:nth-child(4) { width: 170px; }
.construction-cost-table th:nth-child(5),
.construction-cost-table td:nth-child(5) { width: 150px; }
.construction-cost-table th:nth-child(6),
.construction-cost-table td:nth-child(6) { width: 190px; }
.construction-cost-table th:nth-child(7),
.construction-cost-table td:nth-child(7) { width: 150px; }
.construction-cost-table th:nth-child(8),
.construction-cost-table td:nth-child(8) { width: 190px; }
.construction-cost-table th:nth-child(11),
.construction-cost-table td:nth-child(11) { width: 240px; }
.construction-cost-table th:nth-child(21),
.construction-cost-table td:nth-child(21) { width: 220px; }

.construction-cost-table input,
.construction-cost-table textarea,
.construction-cost-table select {
  width: 100%;
  height: 42px;
  min-height: 42px;
  max-height: 42px;
  border-radius: 0;
  padding: 8px 10px;
  box-shadow: none;
  line-height: 1.35;
  display: block;
}

.construction-cost-table textarea {
  resize: none;
  overflow: auto;
}

.construction-cost-table [data-construction-total] {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  white-space: nowrap;
}

.construction-save-btn {
  min-height: 42px;
  border-radius: 8px;
  padding: 8px 14px;
  white-space: nowrap;
}

.construction-cost-cards {
  display: grid;
  gap: 18px;
}

.construction-cost-card {
  border: 1px solid rgba(232, 95, 35, 0.16);
  border-radius: 10px;
  padding: 18px;
  background: #fff;
}

.construction-cost-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(203, 171, 145, 0.28);
}

.construction-cost-card-head span,
.construction-cost-total span {
  color: #e85f23;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.construction-cost-card-head h4 {
  margin: 4px 0;
  font-size: 20px;
  line-height: 1.25;
}

.construction-cost-card-head p {
  margin: 0;
  color: #737b88;
}

.construction-cost-total {
  min-width: 180px;
  text-align: right;
}

.construction-cost-total strong {
  display: block;
  margin-top: 5px;
  color: #d85220;
  font-size: 22px;
}

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

.cost-detail-section {
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid rgba(190, 197, 208, 0.45);
  border-radius: 8px;
  background: #fffdfb;
}

.cost-section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(232, 95, 35, 0.16);
  background: #fff8f2;
}

.cost-section-title h5 {
  margin: 0;
  font-size: 15px;
}

.cost-detail-table {
  overflow-x: auto;
}

.cost-detail-head,
.cost-detail-row {
  display: grid;
  grid-template-columns: var(--cost-columns);
  min-width: 900px;
}

.cost-detail-head span {
  display: flex;
  position: relative;
  min-height: 42px;
  align-items: center;
  padding: 0 10px;
  border-right: 1px solid rgba(203, 171, 145, 0.28);
  color: #6f5f55;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.cost-detail-header-cell {
  padding-right: 18px;
}

.cost-column-resizer {
  position: absolute;
  top: 0;
  right: -5px;
  z-index: 3;
  width: 10px;
  min-width: 0;
  height: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  cursor: col-resize;
  touch-action: none;
}

.cost-column-resizer::after {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(232, 95, 35, 0.18);
  opacity: 0;
}

.cost-column-resizer:hover::after,
.cost-column-resizer:focus-visible::after,
.is-resizing-cost-column .cost-column-resizer::after {
  opacity: 1;
}

.is-resizing-cost-column {
  cursor: col-resize;
  user-select: none;
}

.cost-detail-row {
  border-top: 1px solid rgba(203, 171, 145, 0.22);
}

.cost-detail-row > input,
.cost-detail-row > span,
.cost-detail-row > button {
  min-height: 44px;
  border: 0;
  border-right: 1px solid rgba(203, 171, 145, 0.24);
  border-radius: 0;
  box-shadow: none;
}

.cost-detail-row > input {
  padding: 0 10px;
  background: #fff;
}

.cost-detail-row > span {
  display: flex;
  align-items: center;
  background: #fff;
}

.cost-detail-row .date-picker-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  width: 100%;
  height: 100%;
}

.cost-detail-row .date-picker-text {
  min-height: 44px;
  padding-right: 8px;
  border: 0;
  border-right: 1px solid rgba(203, 171, 145, 0.2);
  border-radius: 0;
  box-shadow: none;
}

.cost-detail-row .date-picker-native {
  position: static;
  width: 42px;
  max-width: 42px;
  height: 44px;
  border-left: 0;
  border-radius: 0;
}

.cost-detail-row .date-picker-native::-webkit-calendar-picker-indicator {
  margin: 0 10px 0 0;
}

.cost-line-remove {
  color: #c84f1e;
  background: #fff8f2;
}

.construction-total-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.construction-dashboard {
  gap: 16px;
}

.construction-cost-main-panel {
  overflow: hidden;
}

.compact-select-label {
  min-width: 280px;
  max-width: 420px;
}

.compact-select-label select {
  margin-top: 6px;
}

.construction-project-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-top: 12px;
  padding: 16px;
  border: 1px solid rgba(232, 95, 35, 0.16);
  border-radius: 8px;
  background: #fff8f2;
}

.construction-project-head span,
.construction-project-row span {
  color: #6f7680;
  font-size: 12px;
  font-weight: 800;
}

.construction-project-head h4 {
  margin: 4px 0;
  font-size: 20px;
}

.construction-project-head p,
.construction-project-row p {
  margin: 0;
  color: #69707b;
}

.construction-project-meta {
  display: grid;
  min-width: 260px;
  gap: 8px;
  align-content: center;
}

.construction-project-meta span {
  padding: 8px 10px;
  border: 1px solid rgba(190, 197, 208, 0.38);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.cost-total-box {
  border: 1px solid rgba(232, 95, 35, 0.16);
  border-radius: 8px;
  padding: 12px;
  background: #fff8f2;
}

.cost-total-box span {
  display: block;
  color: #737b88;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.cost-total-box strong {
  display: block;
  margin-top: 6px;
  color: #2f343c;
  font-size: 15px;
}

.cost-total-box small {
  display: block;
  margin-top: 6px;
  overflow: hidden;
  color: #747b86;
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cost-total-box.all strong {
  color: #d85220;
  font-size: 18px;
}

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

.construction-cost-section {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(190, 197, 208, 0.38);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
}

.construction-cost-section h4 {
  margin: 0 0 10px;
  font-size: 16px;
}

.compact-table-scroll {
  max-height: 320px;
}

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

.construction-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.construction-mini-grid > div {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(190, 197, 208, 0.34);
  border-radius: 8px;
  background: #fff;
}

.construction-mini-grid strong {
  display: block;
  margin-bottom: 6px;
}

.construction-mini-grid p {
  margin: 0;
  color: #69707b;
  line-height: 1.45;
}

.construction-project-list {
  display: grid;
  gap: 10px;
}

.construction-project-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.8fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(190, 197, 208, 0.42);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.construction-project-row.active {
  border-color: rgba(232, 95, 35, 0.45);
  background: #fff8f2;
  box-shadow: inset 3px 0 0 rgba(232, 95, 35, 0.86);
}

.construction-project-row strong {
  display: block;
  margin: 4px 0;
  font-size: 15px;
}

.construction-project-row-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-content: center;
}

.construction-project-row-stats span {
  padding: 7px 8px;
  border: 1px solid rgba(190, 197, 208, 0.34);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: #59616d;
}

.construction-record-panel {
  overflow: hidden;
}

.construction-record-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 14px 0;
  padding: 14px 16px;
  border: 1px solid rgba(232, 95, 35, 0.16);
  border-radius: 8px;
  background: #fff8f2;
}

.construction-record-head span {
  display: block;
  color: #6f7680;
  font-size: 12px;
  font-weight: 800;
}

.construction-record-head strong {
  display: block;
  margin-top: 4px;
  color: #2f343c;
  font-size: 18px;
}

.construction-record-head p {
  margin: 4px 0 0;
  color: #69707b;
}

.construction-record-count {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid rgba(242, 106, 27, 0.16);
  border-radius: 999px;
  color: #d45625;
  background: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  font-weight: 800;
}

.construction-record-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex: 0 0 auto;
}

.construction-record-actions [data-generate-construction-report] {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(232, 95, 35, 0.28);
  background: linear-gradient(135deg, #ff7a22 0%, #e85f23 52%, #d94b27 100%);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 12px 22px rgba(232, 95, 35, 0.24);
}

.construction-record-actions [data-generate-construction-report]::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.34), transparent 42%);
  pointer-events: none;
}

.construction-record-actions [data-generate-construction-report]:hover {
  border-color: rgba(232, 95, 35, 0.42);
  box-shadow: 0 16px 28px rgba(232, 95, 35, 0.3);
}

.construction-record-form {
  margin: 14px 0 18px;
  padding: 16px;
  border: 1px solid rgba(190, 197, 208, 0.32);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
}

.construction-form-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.construction-form-title h4 {
  margin: 2px 0 0;
  font-size: 18px;
}

.construction-record-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.construction-record-notes {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
}

.construction-upload-row {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.1fr);
  gap: 12px;
  margin-top: 12px;
  align-items: end;
}

.construction-upload-box {
  min-height: 76px;
  justify-content: center;
  border: 1px dashed rgba(232, 95, 35, 0.34);
  background: #fff8f2;
}

.construction-upload-box:focus,
.construction-upload-box:focus-within,
.construction-upload-box.pasted {
  outline: 2px solid rgba(232, 95, 35, 0.2);
  border-color: rgba(232, 95, 35, 0.72);
  background: #fff3e8;
}

.construction-upload-box span {
  color: #d45625;
  font-weight: 800;
}

.construction-record-table table {
  min-width: 1120px;
}

.construction-record-table .mini-action {
  margin-left: 10px;
  white-space: nowrap;
  font-weight: 900;
}

.contractor-info-panel {
  overflow: hidden;
}

.contractor-overview {
  margin: 14px 0 18px;
  padding: 16px;
  border: 1px solid rgba(190, 197, 208, 0.32);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
}

.contractor-overview-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.contractor-overview-head h4 {
  margin: 2px 0 0;
  color: #2f343c;
  font-size: 20px;
}

.contractor-overview-head > span {
  color: #d45625;
  font-size: 13px;
  font-weight: 900;
}

.contractor-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.contractor-card {
  display: grid;
  gap: 12px;
  width: 100%;
  min-height: 160px;
  padding: 16px;
  border: 1px solid rgba(190, 197, 208, 0.36);
  border-radius: 8px;
  background: #fff;
  color: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(48, 41, 32, 0.04);
}

.contractor-card:hover,
.contractor-card.active {
  border-color: rgba(232, 95, 35, 0.48);
  background: #fff8f2;
  box-shadow: inset 3px 0 0 rgba(232, 95, 35, 0.86), 0 12px 26px rgba(232, 95, 35, 0.08);
}

.contractor-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.contractor-card-top strong {
  display: block;
  color: #2f343c;
  font-size: 17px;
}

.contractor-card-top span {
  display: block;
  margin-top: 4px;
  color: #69707b;
  font-size: 12px;
  font-weight: 800;
}

.contractor-card-top em {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 999px;
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
}

.contractor-card-top em.valid {
  color: #23643d;
  background: #eaf8ef;
}

.contractor-card-top em.pending {
  color: #7c5a0d;
  background: #fff8df;
}

.contractor-card-top em.risk {
  color: #9f3412;
  background: #fff1e8;
}

.contractor-card-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.contractor-card-meta span {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid rgba(190, 197, 208, 0.26);
  border-radius: 8px;
  background: rgba(250, 249, 247, 0.92);
  color: #69707b;
  font-size: 12px;
  font-weight: 800;
}

.contractor-card-meta strong {
  display: block;
  margin-top: 3px;
  color: #2f343c;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contractor-card p {
  margin: 0;
  color: #69707b;
  font-size: 13px;
  line-height: 1.5;
}

.contractor-overview-empty {
  margin: 14px 0 18px;
  padding: 18px;
  border: 1px dashed rgba(232, 95, 35, 0.28);
  border-radius: 8px;
  background: #fff8f2;
  color: #69707b;
  font-weight: 700;
}

.contractor-project-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.9fr);
  gap: 14px;
  margin: 14px 0;
  padding: 14px 16px;
  border: 1px solid rgba(232, 95, 35, 0.16);
  border-radius: 8px;
  background: #fff8f2;
}

.contractor-project-strip span {
  display: block;
  color: #6f7680;
  font-size: 12px;
  font-weight: 800;
}

.contractor-project-strip strong {
  display: block;
  margin-top: 4px;
  color: #2f343c;
  font-size: 18px;
}

.contractor-project-strip p {
  margin: 4px 0 0;
  color: #69707b;
}

.contractor-section {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid rgba(190, 197, 208, 0.36);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.contractor-section h4 {
  margin: 0 0 12px;
  color: #2f343c;
  font-size: 16px;
}

.contractor-section .compact-head {
  margin-bottom: 10px;
}

.contractor-section .compact-head p {
  margin: 4px 0 0;
  color: #69707b;
}

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

.contractor-file-table {
  overflow-x: auto;
  border: 1px solid rgba(190, 197, 208, 0.36);
  border-radius: 8px;
}

.contractor-file-head,
.contractor-file-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.25fr) minmax(120px, 0.8fr) minmax(170px, 1fr) minmax(170px, 1fr) minmax(180px, 1fr);
  min-width: 880px;
}

.contractor-file-head span {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 10px;
  border-right: 1px solid rgba(203, 171, 145, 0.28);
  background: #fff8f2;
  color: #6f5f55;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.contractor-file-row {
  border-top: 1px solid rgba(203, 171, 145, 0.22);
}

.contractor-file-row > input,
.contractor-file-row > .date-picker-wrap {
  min-height: 44px;
  border: 0;
  border-right: 1px solid rgba(203, 171, 145, 0.24);
  border-radius: 0;
  box-shadow: none;
}

.contractor-file-row > input {
  padding: 0 10px;
}

.contractor-file-row .date-picker-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  width: 100%;
  height: 100%;
}

.contractor-file-row .date-picker-text,
.contractor-file-row .date-picker-native {
  border-radius: 0;
  box-shadow: none;
}

.contractor-upload-box {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1fr);
  gap: 12px;
  align-items: end;
  margin-top: 12px;
  padding: 12px;
  border: 1px dashed rgba(232, 95, 35, 0.28);
  border-radius: 8px;
  background: #fff8f2;
}

.contractor-upload-box p {
  margin: 0;
  color: #69707b;
  line-height: 1.45;
}

.construction-remarks {
  display: block;
  margin-top: 14px;
}

@media (max-width: 1100px) {
  .construction-summary-grid,
  .construction-total-grid,
  .construction-section-grid,
  .construction-breakdown-grid,
  .construction-mini-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .construction-cost-card-head {
    flex-direction: column;
  }

  .construction-project-head,
  .construction-project-row,
  .contractor-project-strip {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

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

  .construction-cost-total {
    text-align: left;
  }
}

.project-operation-scroll {
  overflow: auto;
  max-height: min(68vh, 720px);
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.project-operation-table {
  min-width: 1800px;
  table-layout: fixed;
}

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

.project-operation-table th:nth-child(1),
.project-operation-table td:nth-child(1) { width: 130px; }
.project-operation-table th:nth-child(2),
.project-operation-table td:nth-child(2) { width: 210px; }

.project-operation-table input,
.project-operation-table textarea,
.project-operation-table select {
  width: 100%;
  height: 42px;
  min-height: 42px;
  max-height: 42px;
  border-radius: 0;
  padding: 8px 10px;
  box-shadow: none;
  line-height: 1.35;
  display: block;
}

.project-operation-table textarea {
  resize: none;
  overflow: auto;
}

.project-operation-table [data-operation-amount] {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  white-space: nowrap;
}

.project-operation-table tr[data-project-card] {
  cursor: pointer;
}

.project-operation-table tr.active-row td {
  background: #fff6ef;
}

.won-projects-table th,
.won-projects-table td {
  white-space: nowrap;
}

.won-record-panel,
.won-detail-panel {
  overflow: hidden;
}

.won-record-list {
  display: grid;
  gap: 0;
  border: 1px solid rgba(190, 197, 208, 0.55);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.won-record-head,
.won-record-row {
  display: grid;
  grid-template-columns: minmax(210px, 1.5fr) minmax(190px, 1.25fr) minmax(150px, 0.9fr) minmax(135px, 0.8fr) minmax(110px, 0.7fr);
  align-items: center;
  column-gap: 18px;
  min-width: 0;
}

.won-record-head {
  min-height: 42px;
  padding: 0 14px;
  background: #f7f8fa;
  color: #737b88;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(190, 197, 208, 0.5);
}

.won-record-row {
  width: 100%;
  min-height: 58px;
  padding: 9px 14px;
  border: 0;
  border-bottom: 1px solid rgba(190, 197, 208, 0.38);
  background: #fff;
  color: #2b3038;
  text-align: left;
  cursor: pointer;
}

.won-record-row:last-child {
  border-bottom: 0;
}

.won-record-row:hover,
.won-record-row.active {
  background: #fff7f0;
}

.won-record-row span,
.won-record-head span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.won-record-row strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.won-record-row small {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #737b88;
  font-size: 12px;
}

.won-detail-clean {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid rgba(190, 197, 208, 0.55);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.won-detail-line {
  min-height: 68px;
  padding: 14px 16px;
  border-right: 1px solid rgba(190, 197, 208, 0.42);
  border-bottom: 1px solid rgba(190, 197, 208, 0.42);
}

.won-detail-line:nth-child(3n) {
  border-right: 0;
}

.won-detail-line span {
  display: block;
  margin-bottom: 8px;
  color: #737b88;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.won-detail-line strong {
  display: block;
  color: #2b3038;
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.task-handover-panel {
  overflow: hidden;
}

.task-view-switch {
  display: inline-flex;
  border: 1px solid rgba(190, 197, 208, 0.62);
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
}

.task-view-tab {
  border: 0;
  padding: 7px 14px;
  font-weight: 700;
  font-size: 13px;
  color: #5f6672;
  background: transparent;
}

.task-view-tab + .task-view-tab {
  border-left: 1px solid rgba(190, 197, 208, 0.62);
}

.task-view-tab.active {
  background: var(--accent-soft);
  color: #e85f23;
}

.task-view-tab:hover {
  background: rgba(232, 95, 35, 0.08);
}

.task-create-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.task-create-form .span-2 {
  grid-column: span 2;
}

.task-create-form button {
  align-self: end;
}

.task-board {
  display: grid;
  gap: 14px;
}

.task-card {
  border: 1px solid rgba(190, 197, 208, 0.58);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.task-card-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.task-number {
  display: inline-flex;
  margin-bottom: 6px;
  color: #e85f23;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.task-stage-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin: 0 0 6px 8px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.task-stage-badge.initiation {
  border: 1px solid rgba(232, 95, 35, 0.2);
  background: rgba(232, 95, 35, 0.08);
  color: #cf5420;
}

.task-stage-badge.confirmed {
  border: 1px solid rgba(39, 103, 177, 0.2);
  background: rgba(39, 103, 177, 0.08);
  color: #2767b1;
}

.task-card h4 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
  color: #2b3038;
}

.task-card p {
  margin: 6px 0 0;
  color: #6f7682;
}

.task-status {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 6px 10px;
  background: #f3f4f6;
  color: #5f6672;
  font-size: 12px;
  font-weight: 800;
}

.task-status.in-progress {
  background: #eaf4ff;
  color: #2468a6;
}

.task-status.completed {
  background: #eaf8ef;
  color: #237a43;
}

.task-status.passed {
  background: #fff3e9;
  color: #c14d13;
}

.task-ledger-dashboard {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.task-ledger-dashboard-stacked {
  grid-template-columns: 1fr;
  gap: 12px;
}

.task-ledger-section {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 30px rgba(27, 31, 35, 0.04);
  overflow: hidden;
}

.task-ledger-section.completed-section {
  grid-column: 1 / -1;
}

.task-calendar-panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 12px 30px rgba(27, 31, 35, 0.04);
  overflow: hidden;
}

.task-calendar-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
}

.task-calendar-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.task-calendar-title {
  min-width: 92px;
  margin: 0 8px 0 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
}

.task-calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
}

.task-calendar-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid rgba(89, 90, 94, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  font-weight: 800;
}

.task-calendar-legend-item i {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--person-color, var(--accent));
}

.task-calendar-weekdays,
.task-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.task-calendar-weekdays span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.task-calendar-day {
  min-height: 116px;
  border: 1px solid rgba(89, 90, 94, 0.1);
  border-radius: 12px;
  padding: 7px;
  background: rgba(255, 255, 255, 0.82);
}

.task-calendar-day.has-items {
  border-color: rgba(232, 95, 35, 0.24);
  background: rgba(255, 248, 242, 0.76);
}

.task-calendar-day.has-holiday {
  background: linear-gradient(180deg, rgba(255, 248, 242, 0.88), rgba(255, 255, 255, 0.86));
}

.task-calendar-day.empty-day {
  visibility: hidden;
}

.task-calendar-date-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
}

.task-calendar-date {
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 900;
}

.task-calendar-holidays {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 3px;
  min-width: 0;
}

.calendar-holiday-tag {
  max-width: 86px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid rgba(232, 95, 35, 0.16);
  background: rgba(232, 95, 35, 0.08);
  color: #c95020;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.35;
}

.calendar-holiday-tag.cn {
  border-color: rgba(89, 90, 94, 0.12);
  background: rgba(89, 90, 94, 0.06);
  color: #646b76;
}

.task-calendar-items {
  display: grid;
  gap: 5px;
  margin-top: 6px;
}

.task-calendar-item {
  display: grid;
  gap: 2px;
  padding: 6px 6px 6px 9px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--person-color, var(--accent)) 10%, #fff);
  border: 1px solid color-mix(in srgb, var(--person-color, var(--accent)) 28%, rgba(89, 90, 94, 0.08));
  border-left: 4px solid var(--person-color, var(--accent));
  font-size: 11px;
}

.task-calendar-item.outing {
  background: color-mix(in srgb, var(--person-color, var(--accent)) 14%, #fff);
}

.task-calendar-item.stage-confirmed {
  box-shadow: inset 0 0 0 1px rgba(39, 103, 177, 0.12);
}

.task-calendar-item.stage-initiation {
  box-shadow: inset 0 0 0 1px rgba(232, 95, 35, 0.1);
}

.task-calendar-item.done {
  opacity: 0.62;
}

.task-calendar-item strong {
  color: var(--text);
}

.task-calendar-item span,
.task-calendar-item small {
  color: var(--muted);
  line-height: 1.3;
}

.task-calendar-items em {
  color: var(--accent);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.task-calendar-users {
  display: none;
  border: 1px solid rgba(89, 90, 94, 0.1);
  border-radius: 14px;
  padding: 12px;
  background: rgba(250, 250, 249, 0.88);
}

.task-calendar-users h5 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 14px;
}

.task-calendar-user-row {
  display: grid;
  gap: 4px;
  padding: 10px 0;
  border-top: 1px solid rgba(89, 90, 94, 0.08);
}

.task-calendar-user-row:first-of-type {
  border-top: 0;
}

.task-calendar-user-row strong {
  color: var(--text);
  font-size: 13px;
}

.task-calendar-user-row span {
  color: var(--muted);
  font-size: 12px;
}

.task-ledger-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 248, 242, 0.96), rgba(250, 250, 249, 0.94));
}

.task-ledger-section-head h4 {
  margin: 0;
  font-size: 17px;
  color: var(--text);
}

.task-ledger-section-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.task-ledger-section-head > strong {
  display: inline-flex;
  min-width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
}

.task-ledger-list {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.all-task-card-dashboard {
  display: grid;
  gap: 16px;
}

.all-task-card-section {
  overflow: hidden;
  border: 1px solid rgba(89, 90, 94, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
}

.all-task-card-section.completed {
  border-color: rgba(35, 122, 67, 0.16);
}

.all-task-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 248, 242, 0.96), rgba(250, 250, 249, 0.9));
}

.all-task-card-section.completed .all-task-card-head {
  background: linear-gradient(180deg, rgba(240, 250, 244, 0.96), rgba(250, 250, 249, 0.9));
}

.all-task-card-head h4 {
  margin: 0;
  color: var(--text);
  font-size: 17px;
}

.all-task-card-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.all-task-card-head > strong {
  display: inline-flex;
  min-width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
}

.all-task-card-section.completed .all-task-card-head > strong {
  background: #237a43;
}

.all-task-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 12px;
  padding: 14px;
}

.all-task-mini-card {
  min-width: 0;
  cursor: pointer;
  border: 1px solid rgba(89, 90, 94, 0.12);
  border-radius: 14px;
  padding: 13px;
  background: #fff;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.all-task-mini-card:hover,
.all-task-mini-card:focus-visible {
  border-color: rgba(232, 95, 35, 0.36);
  box-shadow: 0 12px 24px rgba(32, 34, 38, 0.08);
  outline: none;
  transform: translateY(-1px);
}

.all-task-mini-card.completed {
  border-color: rgba(35, 122, 67, 0.18);
  background: rgba(250, 255, 252, 0.96);
}

.all-task-mini-card.active {
  grid-column: span 2;
  border-color: rgba(232, 95, 35, 0.38);
  background: rgba(255, 250, 246, 0.98);
}

.all-task-mini-card.completed.active {
  border-color: rgba(35, 122, 67, 0.28);
  background: rgba(248, 255, 251, 0.98);
}

.all-task-mini-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.all-task-mini-card h4 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  line-height: 1.3;
  word-break: break-word;
}

.all-task-mini-card p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.all-task-mini-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.all-task-mini-meta span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.all-task-card-hint {
  display: inline-flex;
  margin-top: 11px;
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 800;
}

.all-task-mini-detail {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(89, 90, 94, 0.1);
}

.all-task-mini-detail .task-ledger-meta {
  margin-top: 0;
}

@media (max-width: 780px) {
  .all-task-mini-card.active {
    grid-column: span 1;
  }

  .all-task-card-grid,
  .all-task-mini-meta {
    grid-template-columns: 1fr;
  }
}

.task-ledger-card {
  border: 1px solid rgba(89, 90, 94, 0.12);
  border-radius: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.9);
}

.task-ledger-card.completed {
  border-color: rgba(35, 122, 67, 0.2);
  background: rgba(250, 255, 252, 0.92);
}

.task-ledger-card .task-number {
  margin-bottom: 4px;
}

.task-completed-notice {
  margin-top: 10px;
  padding: 9px 11px;
  border: 1px solid rgba(35, 122, 67, 0.18);
  border-radius: 10px;
  background: #eaf8ef;
  color: #237a43;
  font-size: 13px;
  font-weight: 800;
}

.task-workflow-box {
  display: grid;
  gap: 5px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(232, 95, 35, 0.14);
  border-radius: 10px;
  background: rgba(255, 248, 242, 0.72);
}

.task-workflow-box strong {
  color: var(--accent-deep);
  font-size: 13px;
}

.task-workflow-box span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.task-ledger-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.task-ledger-main h4 {
  margin: 0;
  font-size: 17px;
  line-height: 1.25;
  color: var(--text);
}

.task-ledger-main p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.task-compact-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.task-compact-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.task-expanded-desc {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  background: rgba(242, 106, 27, 0.06);
  border-radius: 10px;
  color: var(--text);
}

.task-ledger-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  margin-top: 13px;
}

.task-ledger-meta span {
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
}

.task-ledger-meta strong {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.work-log-dashboard {
  display: grid;
  gap: 16px;
}

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

.work-log-stat {
  min-height: 86px;
  padding: 14px 16px;
  border: 1px solid rgba(232, 95, 35, 0.16);
  border-radius: 14px;
  background: rgba(255, 250, 247, 0.88);
}

.work-log-stat span {
  display: block;
  color: #717783;
  font-size: 12px;
  font-weight: 800;
}

.work-log-stat strong {
  display: block;
  margin-top: 6px;
  color: #2b3038;
  font-size: 22px;
  line-height: 1.1;
}

.work-log-stat p {
  margin: 6px 0 0;
  color: #7a808a;
  font-size: 12px;
}

.work-log-list {
  display: grid;
  gap: 10px;
}

.work-log-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(280px, 1.4fr);
  gap: 14px;
  align-items: center;
  padding: 13px 15px;
  border: 1px solid rgba(89, 90, 94, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
}

.work-log-form {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(180px, 0.65fr) auto;
  gap: 10px;
  align-items: end;
  padding-top: 10px;
  border-top: 1px solid rgba(89, 90, 94, 0.1);
}

.work-log-form textarea {
  min-height: 74px;
  resize: vertical;
}

.work-log-form select[multiple] {
  min-height: 74px;
  padding: 8px;
}

.work-log-form button {
  min-width: 88px;
  min-height: 40px;
}

.work-log-readonly {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(89, 90, 94, 0.1);
}

.work-log-readonly span {
  min-width: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(246, 247, 249, 0.84);
  color: var(--text);
  line-height: 1.45;
  word-break: break-word;
}

.work-log-readonly strong {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.work-log-row strong {
  display: block;
  color: #2b3038;
}

.work-log-row p {
  margin: 4px 0 0;
  color: #717783;
}

.work-log-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.work-log-meta span {
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(246, 247, 249, 0.95);
  color: #5f6672;
  font-size: 12px;
  font-weight: 700;
}

.task-row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(89, 90, 94, 0.1);
}

.site-outing-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(360px, 1.05fr);
  gap: 16px;
  align-items: start;
}

.site-outing-layout-resizable {
  grid-template-columns: minmax(320px, var(--site-outing-left, 48%)) 12px minmax(360px, 1fr);
  gap: 8px;
}

.site-outing-resizer {
  align-self: stretch;
  min-height: 180px;
  border-radius: 999px;
  cursor: col-resize;
  position: relative;
}

.site-outing-resizer::before {
  content: "";
  position: absolute;
  inset: 12px 4px;
  border-radius: 999px;
  background: rgba(232, 95, 35, 0.16);
  transition: background 0.15s ease, transform 0.15s ease;
}

.site-outing-resizer:hover::before,
.site-outing-resizer.is-dragging::before {
  background: rgba(232, 95, 35, 0.34);
  transform: scaleX(1.3);
}

.site-outing-panel,
.site-outing-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 30px rgba(27, 31, 35, 0.04);
  overflow: hidden;
}

.site-outing-form {
  padding: 16px;
}

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

.site-outing-form-grid .span-2 {
  grid-column: 1 / -1;
}

.site-outing-form .primary {
  width: 100%;
  margin-top: 14px;
}

.site-outing-list {
  display: grid;
  gap: 12px;
  padding: 14px;
  max-height: 680px;
  overflow: auto;
}

.site-outing-card {
  padding: 14px;
  box-shadow: none;
}

.site-outing-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.site-outing-card-head h4 {
  margin: 4px 0 2px;
  font-size: 17px;
  line-height: 1.25;
}

.site-outing-card-head p {
  margin: 0;
  color: var(--muted);
}

.outing-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #f4f5f7;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.outing-status.arrived {
  background: #eef7ff;
  color: #23608f;
}

.outing-status.completed {
  background: #eaf8ef;
  color: #237a43;
}

.outing-status.cancelled {
  background: #f3f4f6;
  color: #777;
}

.site-outing-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  margin-top: 13px;
}

.site-outing-meta span {
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
}

.site-outing-meta .span-2 {
  grid-column: 1 / -1;
}

.site-outing-meta strong {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.site-outing-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(89, 90, 94, 0.1);
}

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

.project-init-stat {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(250, 250, 249, 0.86));
}

.project-init-stat span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.project-init-stat strong {
  display: block;
  margin-top: 5px;
  color: var(--accent-deep);
  font-size: 22px;
  line-height: 1;
}

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

.project-stats-summary div {
  padding: 14px 16px;
  border: 1px solid rgba(232, 95, 35, 0.14);
  border-radius: 14px;
  background: rgba(255, 248, 242, 0.76);
}

.project-stats-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.project-stats-summary strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: 24px;
  line-height: 1;
}

.project-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.project-stats-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  overflow: hidden;
}

.project-stats-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 248, 242, 0.96), rgba(250, 250, 249, 0.94));
}

.project-stats-head h4 {
  margin: 0;
  color: var(--text);
  font-size: 17px;
}

.project-stats-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.project-stats-head > strong,
.project-stats-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
}

.project-stats-list {
  display: grid;
  gap: 12px;
  padding: 14px;
  max-height: 680px;
  overflow: auto;
}

.project-stats-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) auto minmax(170px, 1fr) minmax(130px, 0.8fr);
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid rgba(89, 90, 94, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
}

.project-stats-row.staff-row {
  grid-template-columns: minmax(140px, 0.8fr) minmax(240px, 1.6fr) minmax(120px, 0.6fr);
}

.project-stats-row-main span {
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 900;
}

.project-stats-row-main h5 {
  margin: 5px 0;
  color: var(--text);
  font-size: 15px;
}

.project-stats-row-main p,
.project-stats-detail p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.project-stats-detail {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.project-stats-detail.span-2 {
  grid-column: span 1;
}

.project-stats-detail > strong {
  color: var(--text);
  font-size: 12px;
}

.project-stats-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.project-stats-chips span {
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(232, 95, 35, 0.1);
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 800;
}

.project-stats-project-list {
  display: grid;
  gap: 8px;
}

.project-stats-project-list p {
  display: grid;
  gap: 3px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(250, 250, 249, 0.92);
}

.project-stats-project-list strong {
  color: var(--text);
}

.project-stats-project-list span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.project-init-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-bottom: 14px;
}

.project-init-queue {
  display: grid;
  gap: 12px;
  max-height: 620px;
  overflow: auto;
  padding-right: 4px;
}

.project-init-card {
  border: 1px solid rgba(89, 90, 94, 0.12);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.project-init-card:hover,
.project-init-card.active {
  border-color: rgba(242, 106, 27, 0.34);
  background: rgba(255, 248, 242, 0.9);
}

.project-init-card.active {
  box-shadow: inset 3px 0 0 var(--accent);
}

.project-init-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.project-init-card-top strong {
  color: var(--accent-deep);
  font-size: 13px;
}

.project-init-card-top h4 {
  margin: 5px 0 0;
  font-size: 17px;
  line-height: 1.25;
}

.project-init-card-top span,
.project-bound-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--accent-soft);
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 800;
}

.project-init-card-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.project-init-card-actions button {
  min-height: 30px;
  padding: 6px 10px;
}

.project-init-card p {
  margin: 8px 0 0;
  color: var(--text);
}

.project-init-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.project-init-task-counts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.project-init-task-counts span {
  border: 1px solid rgba(89, 90, 94, 0.1);
  border-radius: 10px;
  padding: 7px 8px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

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

.init-detail-block {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  border: 1px solid rgba(89, 90, 94, 0.1);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 26px rgba(27, 31, 35, 0.035);
}

.init-detail-block.span-2 {
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.init-detail-block h4 {
  grid-column: 1 / -1;
  margin: 0 0 10px;
  font-size: 15px;
}

.init-detail-block p {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 4px;
  width: auto;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  min-width: 0;
  overflow-wrap: anywhere;
}

.init-detail-block p strong {
  color: var(--text);
  white-space: nowrap;
}

.init-detail-block:nth-child(2) p:first-of-type,
.init-detail-block:nth-child(2) p:nth-of-type(4) {
  grid-column: 1 / -1;
}

.init-detail-block:nth-child(2) p {
  min-width: 0;
}

.init-detail-block.span-2 p {
  width: auto;
}

.init-attachment-block {
  display: block;
  margin-top: 12px;
}

.init-attachment-block p {
  width: auto;
  margin-bottom: 0;
}

.task-project-lock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(242, 106, 27, 0.18);
  border-radius: 14px;
  background: rgba(242, 106, 27, 0.07);
}

.task-project-lock strong {
  color: var(--accent-2);
}

.task-project-lock span {
  color: var(--text);
  font-weight: 700;
  text-align: right;
}

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

.task-meta-grid span {
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid rgba(190, 197, 208, 0.45);
  border-radius: 8px;
  color: #2b3038;
}

.task-meta-grid strong {
  display: block;
  margin-bottom: 5px;
  color: #7a808a;
  font-size: 11px;
  text-transform: uppercase;
}

.task-desc {
  margin-top: 12px !important;
  padding: 10px 12px;
  border-left: 3px solid #e85f23;
  background: #fff8f2;
}

.task-actions,
.task-pass-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.task-pass-form {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) minmax(140px, 0.9fr) minmax(130px, 0.8fr) minmax(130px, 0.8fr) minmax(110px, 0.7fr) minmax(170px, 1fr) auto;
    align-items: end;
}

.task-history {
  margin-top: 14px;
  border-top: 1px solid rgba(190, 197, 208, 0.5);
  padding-top: 10px;
}

.task-history summary {
  cursor: pointer;
  font-weight: 800;
}

.task-history-line {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f8f9fb;
}

.task-history-line span {
  display: block;
  margin-top: 4px;
  color: #858b95;
  font-size: 12px;
}

@media (max-width: 1100px) {
  .won-record-head,
  .won-record-row {
    grid-template-columns: minmax(180px, 1.4fr) minmax(160px, 1fr) minmax(130px, 0.8fr);
  }

  .won-record-head span:nth-child(n+4),
  .won-record-row > span:nth-child(n+4) {
    display: none;
  }

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

  .won-detail-line:nth-child(3n) {
    border-right: 1px solid rgba(190, 197, 208, 0.42);
  }

  .won-detail-line:nth-child(2n) {
    border-right: 0;
  }
}

.project-operation-save-btn {
  min-height: 42px;
  border-radius: 8px;
  padding: 8px 14px;
  white-space: nowrap;
}

.project-operation-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  white-space: nowrap;
}

.project-operation-actions button {
  min-height: 42px;
  border-radius: 8px;
  padding: 8px 14px;
}

.project-operation-delete-btn {
  color: var(--danger);
  border-color: rgba(199, 63, 42, 0.28);
  background: rgba(255, 255, 255, 0.96);
}

.project-stats-filter {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(180px, 1.2fr) minmax(150px, 0.9fr) minmax(150px, 0.9fr) auto;
  gap: 14px;
  align-items: end;
  padding: 14px;
  margin: 0 0 18px;
  border: 1px solid rgba(242, 106, 27, 0.12);
  border-radius: 16px;
  background: rgba(255, 250, 246, 0.74);
}

.project-stats-filter label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.project-stats-filter input {
  min-height: 42px;
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--text);
}

.project-stats-filter-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  white-space: nowrap;
}

.project-stats-filter-actions button {
  min-height: 42px;
  border-radius: 12px;
  padding: 10px 16px;
}

.project-inline-attachment {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(242, 106, 27, 0.12);
  border-radius: 16px;
  background: rgba(255, 250, 246, 0.72);
}

.project-inline-attachment .section-head {
  margin-bottom: 0;
}

.project-inline-attachment label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

.project-inline-attachment input[type="file"] {
  min-height: 52px;
  padding: 12px;
}

.project-inline-attachment-note {
  padding: 0;
  text-align: left;
  background: transparent;
}

#projectAttachmentForm,
.attachment-gallery {
  display: none;
}

.init-attachment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.project-initiation-attachment-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 1.2fr) auto;
  gap: 12px;
  align-items: end;
  margin: 12px 0 14px;
}

.project-initiation-attachment-form label {
  display: grid;
  gap: 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.project-initiation-attachment-form input[type="file"] {
  min-height: 46px;
  padding: 10px;
}

.project-initiation-attachment-form button {
  min-height: 46px;
  white-space: nowrap;
}

.project-opportunity-count {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid rgba(242, 106, 27, 0.16);
  border-radius: 999px;
  color: #d45625;
  background: rgba(255, 248, 243, 0.86);
  font-size: 13px;
  font-weight: 800;
}

.project-opportunity-stack {
  display: grid;
  gap: 16px;
}

.project-opportunity-form-panel,
.project-opportunity-list-panel {
  width: 100%;
}

.project-opportunity-stack .project-opportunity-grid {
  max-height: none;
  overflow: visible;
  padding: 2px 0;
}

.project-opportunity-grid {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 260px);
  overflow-y: auto;
  padding: 2px 6px 2px 0;
}

.project-opportunity-filter {
  display: grid;
  grid-template-columns: 1.1fr 1.1fr minmax(138px, 0.8fr) minmax(138px, 0.8fr) auto;
  gap: 10px;
  align-items: end;
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid rgba(242, 106, 27, 0.12);
  border-radius: 16px;
  background: rgba(255, 250, 246, 0.68);
}

.project-opportunity-filter label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #5f5a55;
  font-size: 12px;
  font-weight: 800;
}

.project-opportunity-filter input {
  min-height: 40px;
  border-radius: 12px;
}

.project-opportunity-filter-actions {
  display: flex;
  gap: 8px;
}

.project-opportunity-filter-actions button {
  min-height: 40px;
  border-radius: 12px;
  padding: 9px 14px;
  white-space: nowrap;
}

.project-opportunity-card {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(223, 218, 212, 0.94);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 28px rgba(44, 38, 32, 0.045);
}

.project-opportunity-card.active {
  border-color: rgba(242, 106, 27, 0.28);
  background: rgba(255, 252, 249, 0.98);
}

.project-opportunity-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(320px, 2fr) auto;
  gap: 14px;
  align-items: center;
}

.project-opportunity-number {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.project-opportunity-card h4 {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.25;
}

.project-opportunity-quick {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px 10px;
  color: var(--muted);
  font-size: 13px;
}

.project-opportunity-quick span,
.project-opportunity-detail span {
  display: grid;
  gap: 3px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.project-opportunity-quick strong,
.project-opportunity-detail strong {
  color: #5f5a55;
  font-size: 11px;
}

.project-opportunity-detail {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px 14px;
  padding: 12px;
  border-radius: 12px;
  color: var(--muted);
  background: rgba(248, 244, 239, 0.78);
  font-size: 13px;
}

.project-opportunity-detail .span-2 {
  grid-column: span 2;
}

.project-opportunity-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
}

.project-opportunity-actions button {
  min-height: 38px;
  border-radius: 12px;
  padding: 8px 12px;
  white-space: nowrap;
}

.confirmed-project-workbench {
  display: grid;
  gap: 16px;
}

.confirmed-project-hero {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(520px, 1.8fr) auto;
  gap: 18px;
  align-items: center;
  padding: 22px 26px;
  border: 1px solid rgba(226, 220, 214, 0.88);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 48px rgba(44, 38, 32, 0.08);
}

.confirmed-project-hero h2 {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 30px;
  line-height: 1.12;
}

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

.confirmed-project-metric {
  display: grid;
  gap: 6px;
  min-height: 78px;
  padding: 13px 14px;
  border: 1px solid rgba(232, 95, 35, 0.13);
  border-radius: 14px;
  background: rgba(255, 250, 246, 0.76);
}

.confirmed-project-metric span,
.confirmed-project-key span,
.confirmed-project-card-grid strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.confirmed-project-metric strong {
  color: var(--ink);
  font-size: 26px;
  line-height: 1;
}

.confirmed-project-board {
  display: grid;
  grid-template-columns: minmax(320px, 0.82fr) minmax(520px, 1.4fr);
  gap: 16px;
  align-items: start;
}

.confirmed-project-list {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 300px);
  overflow-y: auto;
  padding: 2px 6px 2px 0;
}

.confirmed-project-card {
  display: grid;
  gap: 9px;
  padding: 14px;
  border: 1px solid rgba(223, 218, 212, 0.94);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.confirmed-project-card:hover {
  transform: translateY(-1px);
  border-color: rgba(232, 95, 35, 0.22);
}

.confirmed-project-card.active {
  border-color: rgba(232, 95, 35, 0.38);
  background: rgba(255, 251, 247, 0.98);
  box-shadow: inset 4px 0 0 rgba(232, 95, 35, 0.88);
}

.confirmed-project-card-top,
.confirmed-project-focus-head,
.confirmed-project-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.confirmed-project-card-top span {
  color: #d85725;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.03em;
}

.confirmed-project-card-top strong {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  color: #d85725;
  background: rgba(232, 95, 35, 0.08);
  font-size: 12px;
}

.confirmed-project-card h4 {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.25;
}

.confirmed-project-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

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

.confirmed-project-card-grid span,
.confirmed-project-key,
.confirmed-project-info-grid > div {
  display: grid;
  gap: 4px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.confirmed-project-focus {
  display: grid;
  gap: 16px;
}

.confirmed-project-focus-head {
  align-items: flex-start;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(226, 220, 214, 0.72);
}

.confirmed-project-focus-head span {
  color: #d85725;
  font-size: 13px;
  font-weight: 900;
}

.confirmed-project-focus-head h3 {
  margin: 5px 0 4px;
  color: var(--ink);
  font-size: 26px;
  line-height: 1.18;
}

.confirmed-project-focus-head p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.confirmed-project-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

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

.confirmed-project-key {
  min-height: 86px;
  padding: 14px;
  border: 1px solid rgba(232, 95, 35, 0.14);
  border-radius: 14px;
  background: rgba(255, 250, 246, 0.72);
}

.confirmed-project-key strong {
  color: var(--ink);
  font-size: 17px;
  line-height: 1.25;
}

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

.confirmed-project-info-grid > div {
  padding: 15px;
  border: 1px solid rgba(226, 220, 214, 0.78);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.confirmed-project-info-grid h4 {
  margin: 0 0 5px;
  color: var(--ink);
  font-size: 15px;
}

.confirmed-project-info-grid p {
  margin: 3px 0;
  color: var(--muted);
  line-height: 1.5;
}

.confirmed-project-form-panel {
  border-color: rgba(232, 95, 35, 0.18);
}

.confirmed-project-form {
  display: grid;
  gap: 14px;
}

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

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

.confirmed-project-form label {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.confirmed-project-form input,
.confirmed-project-form textarea {
  border-radius: 14px;
}

.confirmed-project-lower-panel .solution-panel {
  margin-top: 0;
}

.confirmed-project-empty {
  display: grid;
  place-items: center;
  min-height: 260px;
  color: var(--muted);
  font-weight: 800;
}

.project-delivery-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.project-delivery-summary span,
.project-delivery-status {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 12px;
  border: 1px solid rgba(232, 95, 35, 0.14);
  border-radius: 999px;
  color: var(--accent);
  background: rgba(255, 248, 242, 0.86);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.project-delivery-list {
  display: grid;
  gap: 10px;
}

.project-delivery-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid rgba(232, 95, 35, 0.12);
  border-radius: 14px;
  background: rgba(255, 248, 242, 0.58);
}

.project-delivery-search input {
  width: 100%;
}

.project-delivery-card {
  padding: 14px 16px;
  border: 1px solid rgba(223, 218, 212, 0.94);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 22px rgba(44, 38, 32, 0.035);
}

.project-delivery-main {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(89, 90, 94, 0.1);
}

.project-delivery-number {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.project-delivery-main h4 {
  margin: 4px 0 3px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.25;
}

.project-delivery-owner-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0 6px;
  padding: 5px 10px;
  border: 1px solid rgba(232, 95, 35, 0.18);
  border-radius: 999px;
  background: rgba(255, 248, 242, 0.94);
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.project-delivery-owner-badge strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.project-delivery-return {
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.project-delivery-main p {
  margin: 0;
  color: var(--muted);
}

.project-delivery-side {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 220px;
}

.project-delivery-directory-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px 14px;
  align-items: start;
  margin-top: 10px;
}

.project-delivery-directory-grid span {
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.project-delivery-directory-grid strong {
  display: block;
  margin-bottom: 2px;
  color: #5f5a55;
  font-size: 11px;
  font-weight: 800;
}

.project-delivery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px 18px;
  margin-top: 14px;
}

.project-delivery-grid span {
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.project-delivery-grid strong {
  display: block;
  margin-bottom: 3px;
  color: #5f5a55;
  font-size: 11px;
  font-weight: 800;
}

.project-delivery-grid .span-2 {
  grid-column: span 2;
}

.project-delivery-edit-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 12px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(232, 95, 35, 0.12);
  border-radius: 12px;
  background: rgba(255, 248, 242, 0.48);
}

.project-delivery-edit-form label {
  min-width: 0;
}

.project-delivery-edit-form .span-2 {
  grid-column: span 2;
}

.project-delivery-edit-form button {
  align-self: end;
  min-height: 42px;
}

.project-delivery-attachments {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.project-delivery-file {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(223, 218, 212, 0.92);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  text-decoration: none;
}

.project-delivery-file img,
.project-delivery-file .file-chip {
  width: 54px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  background: rgba(232, 95, 35, 0.1);
}

.project-delivery-file .file-chip {
  display: grid;
  place-items: center;
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
}

.project-delivery-file strong,
.project-delivery-file small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-delivery-file small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 980px) {
  .project-delivery-directory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-delivery-edit-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-delivery-main {
    align-items: flex-start;
    flex-direction: column;
  }

  .project-delivery-side {
    justify-content: flex-start;
    min-width: 0;
  }
}

@media (max-width: 620px) {
  .project-delivery-search,
  .project-delivery-directory-grid,
  .project-delivery-edit-form,
  .project-initiation-attachment-form {
    grid-template-columns: 1fr;
  }

  .project-delivery-edit-form .span-2 {
    grid-column: auto;
  }

  .dashboard-person-detail-head,
  .dashboard-person-schedule-row {
    align-items: flex-start;
    grid-template-columns: 1fr;
  }

  .dashboard-person-status {
    width: fit-content;
  }
}

.totals-box {
  padding: 16px 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,248,243,0.95), rgba(255,252,249,0.98));
  border: 1px solid rgba(242, 106, 27, 0.12);
}

.totals-box > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.totals-box span {
  color: var(--muted);
  margin-right: 8px;
}

.totals-box-deposit {
  gap: 14px;
}

.deposit-percent-input {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  margin-right: 10px;
}

.deposit-percent-input input {
  width: 90px;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(89, 90, 94, 0.14);
  background: rgba(255, 255, 255, 0.96);
  text-align: right;
  font: inherit;
}

.deposit-percent-input em {
  font-style: normal;
  color: var(--muted);
  font-weight: 700;
}

.table-scroll {
  overflow: auto;
  max-height: min(68vh, 720px);
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.table-scroll thead th,
.construction-cost-scroll thead th,
.project-operation-scroll thead th,
.receipt-table-scroll thead th,
.customer-ledger-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 6;
  background: var(--panel-strong);
  box-shadow: 0 1px 0 rgba(89, 90, 94, 0.1);
}

.report-center-panel {
  gap: 18px;
}

.report-table-scroll {
  border: 1px solid rgba(89, 90, 94, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.84);
}

.report-summary-table {
  min-width: 1320px;
}

.report-summary-table th {
  white-space: nowrap;
}

.report-summary-table td {
  vertical-align: top;
}

.report-summary-table td:nth-child(4),
.report-summary-table td:nth-child(5) {
  white-space: nowrap;
  font-weight: 800;
}

.project-report-dashboard {
  display: grid;
  grid-template-columns: minmax(280px, 1.1fr) repeat(2, minmax(240px, 1fr));
  gap: 16px;
}

.summary-report-dashboard {
  display: grid;
  grid-template-columns: minmax(320px, 1.2fr) repeat(2, minmax(240px, 1fr));
  gap: 16px;
}

.project-report-card,
.project-report-project {
  border: 1px solid rgba(89, 90, 94, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 14px 34px rgba(48, 41, 32, 0.06);
}

.project-report-card {
  padding: 18px;
}

.project-report-focus {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 246, 239, 0.94));
}

.project-report-card-head,
.project-report-project-head,
.project-report-progress-line > div {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.project-report-card-head span,
.project-report-progress-line span,
.project-report-detail span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.project-report-card-head strong {
  color: var(--ink);
  font-size: 34px;
  line-height: 1;
}

.report-progress {
  width: 100%;
  height: 10px;
  margin: 14px 0 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(89, 90, 94, 0.11);
}

.report-progress span {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: linear-gradient(90deg, #e85f23, #d94b27);
}

.project-report-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.project-report-stats span,
.project-report-mini-grid span {
  padding: 10px;
  border: 1px solid rgba(89, 90, 94, 0.1);
  border-radius: 8px;
  background: rgba(250, 249, 247, 0.92);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

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

.report-distribution-row > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  font-size: 13px;
}

.report-distribution-row .report-progress {
  height: 8px;
  margin-top: 8px;
}

.project-report-watch {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.project-report-watch > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(89, 90, 94, 0.1);
}

.project-report-watch > div:last-child {
  border-bottom: 0;
}

.project-report-watch span {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.project-report-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 16px;
}

.summary-report-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 16px;
}

.project-report-project {
  padding: 18px;
}

.project-report-project h4 {
  margin: 6px 0;
  font-size: 20px;
  line-height: 1.35;
}

.project-report-project p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.project-report-project-head > div > span {
  color: #d94b27;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.project-health {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
  border: 1px solid rgba(89, 90, 94, 0.12);
}

.project-health.risk {
  color: #9f3412;
  background: #fff1e8;
  border-color: #ffd5bf;
}

.project-health.active {
  color: #7c5a0d;
  background: #fff8df;
  border-color: #f4dda2;
}

.project-health.done {
  color: #23643d;
  background: #eaf8ef;
  border-color: #c6ebd2;
}

.project-health.normal {
  color: #53606d;
  background: #f4f6f7;
}

.project-report-progress-line {
  margin-top: 16px;
}

.project-report-progress-line strong {
  font-size: 18px;
}

.project-report-mini-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0;
}

.project-report-mini-grid strong {
  display: block;
  color: var(--ink);
  font-size: 17px;
}

.project-report-detail {
  display: grid;
  gap: 6px;
}

.project-report-detail p + span {
  margin-top: 8px;
}

.summary-report-project {
  display: grid;
  gap: 14px;
}

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

.summary-money-grid span {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(89, 90, 94, 0.1);
  border-radius: 8px;
  background: rgba(250, 249, 247, 0.92);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.summary-money-grid strong {
  display: block;
  color: var(--ink);
  font-size: 16px;
  white-space: nowrap;
}

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

.summary-doc-grid span {
  min-width: 0;
  min-height: 64px;
  padding: 10px;
  border: 1px solid rgba(232, 95, 35, 0.12);
  border-radius: 8px;
  background: #fff8f2;
  color: #69707b;
  font-size: 13px;
  line-height: 1.45;
  overflow: hidden;
}

.summary-doc-grid strong {
  display: block;
  color: #d94b27;
  font-size: 11px;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.table-scroll table.resizable-table {
  table-layout: fixed;
  width: max-content;
  min-width: 100%;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 10px;
  border-bottom: 1px solid rgba(79, 63, 41, 0.1);
  text-align: left;
  vertical-align: top;
  min-width: 0;
}

.table-cell-two-line {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  width: fit-content;
  max-width: 28ch;
  max-height: 2.8em;
  line-height: 1.4;
  overflow: hidden;
  white-space: normal;
  word-break: normal;
  overflow-wrap: anywhere;
  hyphens: auto;
}

.staff-display-cell {
  display: inline-grid;
  gap: 2px;
  max-width: 12ch;
  min-width: 0;
  line-height: 1.35;
  vertical-align: top;
}

.staff-display-cell span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

th {
  position: relative;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.column-resize-handle {
  position: absolute;
  top: 8px;
  right: -3px;
  width: 7px;
  height: calc(100% - 16px);
  cursor: col-resize;
  z-index: 5;
  border-right: 2px solid transparent;
  touch-action: none;
}

.column-resize-handle:hover,
.column-resize-handle.is-dragging {
  border-right-color: rgba(226, 94, 39, 0.78);
}

body.is-resizing-columns {
  cursor: col-resize;
  user-select: none;
}

.table-actions {
  flex-wrap: wrap;
}

.maintenance-order-import {
  align-items: end;
  justify-content: flex-start;
  margin-top: -4px;
}

.maintenance-order-import label {
  flex: 1 1 360px;
  max-width: 560px;
}

.maintenance-order-import select {
  width: 100%;
}

.table-scroll td .table-actions {
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
    overflow: visible;
    padding-bottom: 2px;
    width: max-content;
    min-width: 0;
}

.table-scroll td .table-actions button {
  flex: 0 0 auto;
  min-width: 68px;
  min-height: 34px;
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.1;
    white-space: nowrap;
}

.table-scroll td .table-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  box-shadow: none;
}

.document-status-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.document-lock-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border: 1px solid rgba(226, 94, 39, 0.24);
  border-radius: 999px;
  background: rgba(226, 94, 39, 0.08);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.document-lock-action {
  min-height: 36px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(242, 106, 27, 0.12);
  background: rgba(242, 106, 27, 0.08);
  color: var(--accent);
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.document-lock-action:hover {
  background: rgba(242, 106, 27, 0.12);
  box-shadow: 0 8px 18px rgba(242, 106, 27, 0.12);
}

.document-lock-readonly {
  border-style: dashed;
  border-color: rgba(106, 116, 128, 0.24);
  background: rgba(106, 116, 128, 0.08);
  color: #5f6873;
}

.payment-status-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 150px;
  white-space: nowrap;
}

.payment-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  min-width: 64px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(106, 116, 128, 0.22);
  background: rgba(106, 116, 128, 0.08);
  color: #5f6873;
  font-size: 12px;
  font-weight: 900;
}

button.payment-status-badge {
  cursor: pointer;
  font-family: inherit;
}

button.payment-status-badge:hover {
  box-shadow: 0 8px 18px rgba(242, 106, 27, 0.12);
  transform: translateY(-1px);
}

.payment-status-badge.paid {
  border-color: rgba(48, 130, 76, 0.24);
  background: rgba(48, 130, 76, 0.1);
  color: #267146;
}

.payment-status-badge.unpaid {
  border-color: rgba(226, 94, 39, 0.22);
  background: rgba(226, 94, 39, 0.08);
  color: var(--accent-strong);
}

.payment-status-badge.partial {
  border-color: rgba(183, 124, 20, 0.26);
  background: rgba(245, 166, 35, 0.12);
  color: #9a640f;
}

.payment-status-action {
  display: none !important;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(242, 106, 27, 0.14);
  background: rgba(242, 106, 27, 0.08);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.payment-status-action:hover {
  background: rgba(242, 106, 27, 0.14);
}

.invoice-register-money-cell {
  display: grid;
  gap: 3px;
  min-width: 120px;
  line-height: 1.25;
  white-space: nowrap;
}

.invoice-register-money-cell span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.invoice-register-money-cell strong {
  color: var(--text);
  font-size: 13px;
}

.table-scroll th:last-child,
.table-scroll td:last-child {
    min-width: 220px;
}

.doc-actions-inline {
  justify-content: flex-start;
  align-items: start;
}

.doc-actions-inline button {
  min-height: 38px;
  padding: 7px 10px;
  border-radius: 14px;
  font-size: 12px;
  line-height: 1.25;
  white-space: nowrap;
}

.sales-order-action-groups {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
  width: 390px;
  min-width: 390px;
}

.table-scroll td .sales-order-action-groups.action-grid-balanced {
  display: flex !important;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
  width: 390px;
  min-width: 390px;
}

.sales-order-action-groups .action-group {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.sales-order-action-groups .action-group-generate {
  flex-wrap: nowrap;
}

.sales-order-action-groups .action-group button {
  flex: 0 0 auto;
  justify-content: center;
}

.sales-order-action-groups .action-group-plain button {
  min-width: 72px;
}

.sales-order-action-groups .action-group-generate button {
  min-width: 82px;
  color: #e85f23;
  background: rgba(242, 106, 27, 0.09);
  border-color: rgba(242, 106, 27, 0.12);
}

.table-scroll td:has(.sales-order-action-groups) {
  min-width: 420px;
}

.user-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(89, 90, 94, 0.12);
  border-radius: 18px;
  background: rgba(250, 250, 249, 0.92);
  position: relative;
  overflow: hidden;
}

.account-user-layout {
  display: grid;
  gap: 16px;
}

.user-new-editor {
  display: grid;
}

.user-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(172px, 1fr));
  gap: 12px;
  align-items: stretch;
  padding: 0;
  background: transparent;
  overflow: visible;
}

.user-wall .user-row {
  grid-column: 1 / -1;
}

.user-name-card {
  min-height: 86px;
  display: grid;
  align-content: center;
  gap: 5px;
  position: relative;
  padding: 12px 16px;
  border: 1px solid rgba(89, 90, 94, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 24px rgba(55, 43, 35, 0.04);
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.user-name-card:hover,
.user-name-card:focus-visible {
  border-color: rgba(232, 95, 35, 0.36);
  box-shadow: 0 14px 30px rgba(55, 43, 35, 0.08);
  outline: none;
  transform: translateY(-1px);
}

.user-name-card-no {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 800;
}

.user-name-card strong {
  color: var(--text);
  font-size: 16px;
  line-height: 1.2;
  text-shadow: none;
}

.user-name-card-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.user-puzzle-empty {
  display: none;
}

.new-user-row {
  background: rgba(255, 248, 242, 0.76);
}

.user-collapse-btn {
  min-height: 28px;
  padding: 4px 12px;
  font-size: 12px;
}

.user-row::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, rgba(242, 106, 27, 0.85), rgba(217, 75, 39, 0.75));
}

.user-row:nth-child(even) {
  background: rgba(250, 250, 249, 0.92);
}

.user-row:nth-child(odd) {
  background: rgba(250, 250, 249, 0.92);
}

.user-row-header {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 2px 2px 8px 6px;
  border-bottom: 1px solid rgba(89, 90, 94, 0.08);
}

.user-row-title {
  display: grid;
  gap: 2px;
}

.user-row-index {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

.user-row-title strong {
  font-size: 16px;
}

.user-row-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.user-row-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(89, 90, 94, 0.08);
}

.user-row-badge.role,
.user-row-badge.status {
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
}

.user-field {
  padding: 10px 12px 12px;
  border-radius: 16px;
  border: 1px solid rgba(89, 90, 94, 0.08);
}

.user-field.identity,
.user-field.security,
.user-field.control,
.user-field.permission {
  background: rgba(255, 255, 255, 0.9);
}

.user-field input,
.user-field select,
.user-field textarea,
.user-field .permission-dropdown {
  margin-top: 8px;
}

.user-password-field small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.password-edit-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.user-field .password-edit-control input {
  margin-top: 0;
}

.password-toggle-btn {
  min-height: 42px;
  padding: 0 14px;
  white-space: nowrap;
}

.permission-block {
  grid-column: auto;
  padding: 0;
}

.permission-title {
  margin-bottom: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
}

.permission-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.permission-dropdown {
  border: 1px solid rgba(89, 90, 94, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  overflow: hidden;
}

.permission-dropdown summary {
  list-style: none;
  cursor: pointer;
  min-height: 46px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 600;
  color: var(--text);
}

.permission-dropdown summary span {
  font-size: 0.92rem;
}

.permission-dropdown summary::-webkit-details-marker {
  display: none;
}

.permission-dropdown summary::after {
  content: "";
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.18s ease;
  flex: 0 0 auto;
  margin-left: auto;
}

.permission-dropdown[open] summary::after {
  transform: rotate(-135deg) translateY(-1px);
}

.permission-dropdown .permission-grid {
  padding: 0;
  border-top: 1px solid rgba(89, 90, 94, 0.12);
}

.permission-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 16px;
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid rgba(89, 90, 94, 0.1);
  background: #fff;
  cursor: pointer;
}

.permission-grid .permission-chip:last-child {
  border-bottom: 0;
}

.permission-chip input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.permission-chip span {
  font-size: 0.92rem;
  color: var(--text);
}

.empty,
.fatal {
  text-align: center;
  color: var(--muted);
}

.fatal {
  margin: 24px auto;
  width: min(840px, calc(100vw - 30px));
  padding: 28px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  padding: 12px 16px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border-radius: 14px;
  color: white;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 20;
}

.toast-action {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.14);
  color: white;
  box-shadow: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.preview-overlay {
  position: fixed;
  inset: 0;
  background: rgba(33, 35, 40, 0.36);
  display: flex;
  justify-content: flex-end;
  z-index: 40;
  backdrop-filter: blur(6px);
}

.preview-drawer {
  width: min(980px, 94vw);
  height: 100vh;
  background: #f3f3f1;
  padding: 20px;
  overflow: auto;
  box-shadow: -20px 0 40px rgba(0, 0, 0, 0.12);
}

.preview-drawer-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
}

.table-link-cell {
  display: inline-block;
  max-width: 280px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  text-align: left;
  line-height: 1.55;
  white-space: normal;
  word-break: break-word;
  cursor: pointer;
}

.table-link-cell:hover {
  color: var(--accent);
  text-decoration: underline;
}

.detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  justify-content: flex-end;
  background: rgba(33, 35, 40, 0.32);
  backdrop-filter: blur(6px);
}

.detail-drawer {
  width: min(780px, 94vw);
  height: 100vh;
  overflow: auto;
  padding: 22px;
  background: var(--bg);
  box-shadow: -20px 0 42px rgba(0, 0, 0, 0.14);
}

.detail-drawer-head,
.detail-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.button-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.icon-only {
  width: 44px;
  min-width: 44px;
  padding-inline: 0;
}

.detail-drawer-head {
  margin-bottom: 16px;
}

.detail-drawer-head h3 {
  margin: 4px 0 0;
}

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

.finance-receivable-detail-form {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-strong);
}

.receipt-drawer {
  width: min(1220px, 96vw);
  background: #f6f8fb;
}

.receipt-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 34px;
  margin: 0 0 12px;
  padding: 0 18px;
  border-radius: 999px;
  background: #244fdd;
  color: #fff;
  font-weight: 800;
}

.receipt-head-card {
  display: grid;
  grid-template-columns: minmax(170px, 0.7fr) minmax(260px, 1fr);
  gap: 12px 36px;
  padding: 16px;
  border: 1px solid #d9e0eb;
  border-radius: 10px;
  background: #fff;
}

.receipt-head-card .wide {
  grid-column: 1 / -1;
}

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

.receipt-tools .ghost.active {
  border-color: #244fdd;
  background: #edf2ff;
  color: #1f45bd;
  font-weight: 900;
}

.receipt-info-panel {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid #dbe1ea;
  border-radius: 10px;
  background: #fff;
}

.receipt-info-panel div,
.receipt-info-panel label {
  min-width: 0;
}

.receipt-info-panel span {
  display: block;
  color: #6b7280;
  font-size: 12px;
  font-weight: 800;
}

.receipt-info-panel strong {
  display: block;
  margin-top: 4px;
  color: #1f2937;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.receipt-agent-panel {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.finance-group-detail {
  display: grid;
  gap: 10px;
}

.finance-group-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid #dbe1ea;
  border-radius: 10px;
  background: #fff;
}

.finance-group-summary div {
  min-width: 0;
}

.finance-group-summary span {
  display: block;
  color: #6b7280;
  font-size: 12px;
  font-weight: 800;
}

.finance-group-summary strong {
  display: block;
  margin-top: 4px;
  color: #1f2937;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.finance-group-title {
  margin: 2px 0 0;
}

.finance-group-table-scroll {
  max-height: 260px;
  border: 1px solid #dbe1ea;
  border-radius: 10px;
  background: #fff;
}

.finance-group-table {
  min-width: 820px;
}

.finance-group-table th,
.finance-group-table td {
  white-space: nowrap;
}

.finance-group-total-row td {
  background: #f7f8fa;
  font-weight: 900;
}

.finance-group-hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.receipt-table-scroll {
  overflow: auto;
  max-height: min(68vh, 720px);
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  border: 1px solid #d5dce7;
  background: #fff;
}

.receipt-table {
  min-width: 1120px;
  border-collapse: collapse;
}

.receipt-table th,
.receipt-table td {
  border: 1px solid #dbe1ea;
  padding: 0;
  text-align: center;
  vertical-align: middle;
}

.receipt-table th {
  height: 48px;
  background: #f4f6f9;
  color: #111827;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.receipt-table td {
  height: 54px;
  background: #fff;
}

.receipt-table input {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: center;
}

.receipt-table input:focus {
  background: #fffaf7;
  outline: 2px solid rgba(230, 94, 35, 0.22);
  outline-offset: -2px;
}

.receipt-row-no {
  width: 34px;
  color: var(--muted);
  font-weight: 800;
}

.receipt-total-row td {
  height: 44px;
  background: #f7f8fa;
  font-weight: 900;
}

.detail-actions {
  margin-top: 4px;
}

.preview-sheet-wrap {
  background: white;
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.08);
}

.preview-page {
  background: white;
  break-inside: avoid-page;
  page-break-inside: avoid;
}

.preview-doc-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.preview-doc-title h2 {
  margin: 0;
  font-size: 36px;
  line-height: 1.02;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: #878d99;
  text-transform: uppercase;
}

.preview-doc-brand {
  display: flex;
  gap: 18px;
  align-items: center;
}

.preview-doc-brand img {
  width: 260px;
  max-width: 100%;
  height: auto;
}

.preview-doc-title p,
.preview-doc-brand p,
.preview-box p {
  margin-top: 8px;
}

.preview-box {
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 18px;
}

.preview-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}

.preview-table th,
.preview-table td {
  border: 1px solid #ddd;
  padding: 10px;
  text-align: left;
  vertical-align: middle;
}

.preview-table th {
  background: #f5f5f5;
  text-align: center;
}

.preview-totals {
  margin-top: 16px;
  width: 320px;
  margin-left: auto;
}

.preview-totals div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 4px 0;
  border-bottom: 1px solid #111;
}

.preview-totals span {
  min-width: 110px;
  text-align: right;
}

.preview-totals strong {
  min-width: 140px;
  text-align: right;
}

.preview-totals-final {
  font-weight: 700;
}

.preview-totals-deposit strong {
  color: #d94827;
}

.preview-page-so {
  font-size: 12px;
  color: #222;
}

.preview-so-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 10px;
}

.preview-so-header-compact {
  margin-bottom: 6px;
}

.preview-so-header-compact .preview-so-docmeta {
  margin-top: 0;
}

.preview-so-brand img {
  width: min(84mm, 100%);
  max-width: 100%;
  height: auto;
  display: block;
}

.preview-so-docmeta {
  min-width: 148px;
  font-size: 12px;
  line-height: 1.45;
  text-align: right;
  margin-top: 38px;
}

.preview-so-next-note {
  color: #777;
  font-size: 10px;
  margin-bottom: 2px;
}

.preview-so-doclabel {
  font-weight: 900;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
  font-size: 31px;
  line-height: 1.05;
  color: #b3b8c2;
  text-transform: uppercase;
}

.preview-do-doclabel {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  line-height: 1.08;
}

.preview-po-doclabel {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  line-height: 1.08;
}

.preview-so-page-mark {
  color: #666;
  font-size: 12px;
}

.preview-so-company-block {
  margin-bottom: 10px;
  line-height: 1.45;
}

.preview-so-company-name {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 2px;
}

.preview-page-po {
  font-size: 12px;
  color: #222;
}

.preview-page-do {
  font-size: 12px;
  color: #222;
}

.preview-po-order-table,
.preview-po-items-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 10px;
  table-layout: fixed;
}

.preview-po-order-table th,
.preview-po-order-table td,
.preview-po-items-table th,
.preview-po-items-table td {
  border: 1px solid #d5d5d5;
  padding: 6px 8px;
  vertical-align: top;
}

.preview-po-order-table th,
.preview-po-items-table th {
  background: #f3f4f6;
  font-weight: 700;
  text-align: left;
  color: #7d6b50;
  letter-spacing: 0.06em;
  vertical-align: middle;
}

.preview-po-items-table th {
  text-align: center;
  vertical-align: middle;
}

.preview-po-order-table th {
  width: 18%;
  font-size: 11px;
}

.preview-po-order-table td {
  font-size: 11px;
  line-height: 1.28;
}

.preview-po-order-table td:nth-child(2) {
  width: 40%;
}

.preview-po-order-table td:nth-child(4) {
  width: 24%;
}

.preview-po-items-table th:nth-child(1),
.preview-po-items-table td:nth-child(1) {
  width: 7%;
  text-align: center;
}

.preview-po-items-table th:nth-child(2),
.preview-po-items-table td:nth-child(2) {
  width: 18%;
}

.preview-po-items-table th:nth-child(3),
.preview-po-items-table td:nth-child(3) {
  width: 20%;
}

.preview-po-items-table th:nth-child(4),
.preview-po-items-table td:nth-child(4) {
  width: 26%;
}

.preview-po-items-table th:nth-child(5),
.preview-po-items-table td:nth-child(5) {
  width: 6%;
  text-align: center;
}

.preview-po-items-table th:nth-child(6) {
  width: 11%;
  text-align: center;
}

.preview-po-items-table td:nth-child(6) {
  width: 11%;
  text-align: right;
}

.preview-po-items-table th:nth-child(7) {
  width: 12%;
  text-align: center;
}

.preview-po-items-table td:nth-child(7) {
  width: 12%;
  text-align: right;
}

.preview-po-items-table thead {
  display: table-header-group;
}

.preview-po-remarks-title {
  margin: 14px 0 8px;
  font-weight: 800;
  color: #222;
}

.preview-do-order-table,
.preview-do-items-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 10px;
  table-layout: fixed;
}

.preview-do-order-table th,
.preview-do-order-table td,
.preview-do-items-table th,
.preview-do-items-table td {
  border: 1px solid #d5d5d5;
  padding: 6px 8px;
  vertical-align: top;
}

.preview-do-order-table th,
.preview-do-items-table th {
  background: #f3f4f6;
  font-weight: 700;
  text-align: left;
  color: #7d6b50;
  letter-spacing: 0.06em;
  vertical-align: middle;
}

.preview-do-items-table th {
  text-align: center;
  vertical-align: middle;
}

.preview-do-order-table th {
  width: 18%;
  font-size: 11px;
}

.preview-do-order-table td {
  font-size: 11px;
  line-height: 1.28;
}

.preview-do-order-table td:nth-child(2) {
  width: 40%;
}

.preview-do-order-table td:nth-child(4) {
  width: 24%;
}

.preview-do-items-table th:nth-child(1),
.preview-do-items-table td:nth-child(1) {
  width: 7%;
  text-align: center;
}

.preview-do-items-table th:nth-child(2),
.preview-do-items-table td:nth-child(2) {
  width: 22%;
}

.preview-do-items-table th:nth-child(3),
.preview-do-items-table td:nth-child(3) {
  width: 23%;
}

.preview-do-items-table th:nth-child(4),
.preview-do-items-table td:nth-child(4) {
  width: 36%;
}

.preview-do-items-table th:nth-child(5),
.preview-do-items-table td:nth-child(5) {
  width: 12%;
  text-align: center;
}

.preview-do-items-table thead {
  display: table-header-group;
}

.preview-do-remarks-title {
  margin: 28px 0 12px;
  font-weight: 800;
  color: #f26a1b;
}

.preview-do-terms {
  line-height: 1.5;
}

.preview-do-term-row {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 8px;
  margin-bottom: 4px;
}

.preview-so-order-table,
.preview-so-items-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 10px;
  table-layout: fixed;
}

.preview-so-order-table th,
.preview-so-order-table td,
.preview-so-items-table th,
.preview-so-items-table td {
  border: 1px solid #d5d5d5;
  padding: 6px 7px;
  vertical-align: top;
}

.preview-so-order-table th,
.preview-so-items-table th {
  background: #f3f4f6;
  font-weight: 700;
  text-align: left;
  vertical-align: middle;
}

.preview-so-items-table th {
  text-align: center;
  vertical-align: middle;
}

.preview-so-order-table th {
  font-size: 11px;
  line-height: 1.15;
  letter-spacing: 0.07em;
}

.preview-so-order-table td {
  font-size: 11px;
  line-height: 1.2;
}

.preview-so-order-table th:nth-child(1) {
  width: 14%;
}

.preview-so-order-table td:nth-child(2) {
  width: 44%;
}

.preview-so-order-table th:nth-child(3) {
  width: 18%;
}

.preview-so-order-table td:nth-child(4) {
  width: 24%;
}

.preview-so-items-table th:nth-child(1),
.preview-so-items-table td:nth-child(1) {
  width: 7%;
}

.preview-so-items-table th:nth-child(2),
.preview-so-items-table td:nth-child(2) {
  width: 17%;
}

.preview-so-items-table th:nth-child(3),
.preview-so-items-table td:nth-child(3) {
  width: 36%;
}

.preview-so-items-table th:nth-child(4),
.preview-so-items-table td:nth-child(4) {
  width: 7%;
}

.preview-so-items-table th:nth-child(5),
.preview-so-items-table td:nth-child(5) {
  width: 14%;
}

.preview-so-items-table th:nth-child(6),
.preview-so-items-table td:nth-child(6) {
  width: 19%;
}

.preview-so-items-table td:nth-child(1),
.preview-so-items-table td:nth-child(4) {
  text-align: center;
}

.preview-so-items-table td:nth-child(5),
.preview-so-items-table td:nth-child(6) {
  text-align: right;
}

.preview-so-totals {
  margin-left: auto;
  width: min(72mm, 100%);
  margin-bottom: 14px;
}

.preview-so-totals div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 3px 0;
  border-bottom: 1px solid #111;
}

.preview-so-totals span {
  min-width: 26mm;
  text-align: right;
}

.preview-so-totals strong {
  min-width: 34mm;
  text-align: right;
}

.preview-so-total-row {
  font-weight: 700;
}

.preview-so-deposit-row strong {
  color: #d94827;
}

.preview-so-section-title {
  color: var(--accent);
  font-weight: 800;
  margin-bottom: 6px;
}

.preview-so-terms,
.preview-so-confirmation,
.preview-so-payment {
  margin-bottom: 12px;
}

.preview-so-terms {
  line-height: 1.45;
}

.preview-so-payment-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #d5d5d5;
}

.preview-so-payment-table th,
.preview-so-payment-table td {
  padding: 8px 10px;
  font-size: 11px;
  line-height: 1.35;
  vertical-align: top;
  text-align: left;
  border: 1px solid #d5d5d5;
}

.preview-so-payment-table th {
  width: 160px;
  font-weight: 400;
  background: #f3f4f6;
}

.preview-so-payment-table td {
  background: #ffffff;
}

.preview-so-acknowledge-grid {
  display: grid;
  grid-template-columns: 58mm 1fr 58mm;
  gap: 24px;
  align-items: end;
  margin-top: 22px;
}

.preview-so-acknowledge-col {
  width: 58mm;
  min-height: 45mm;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.preview-so-acknowledge-col-sign {
  grid-column: 3;
  align-items: flex-end;
}

.preview-so-acknowledge-col-sign .preview-so-ack-signature,
.preview-so-acknowledge-col-sign .preview-so-ack-line,
.preview-so-acknowledge-col-sign .preview-so-ack-company,
.preview-so-acknowledge-col-sign .preview-so-ack-title {
  width: 100%;
  margin-left: auto;
}

.preview-so-ack-line {
  border-top: 1px solid #999;
  height: 0;
  margin-bottom: 6px;
}

.preview-so-ack-title {
  font-weight: 700;
  color: #222;
}

.preview-so-ack-subtitle {
  margin-top: 2px;
  font-weight: 700;
  color: #222;
}

.preview-so-ack-company {
  margin-top: 4px;
  color: #222;
}

.preview-so-ack-signature {
  min-height: 32mm;
  height: 32mm;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.preview-so-ack-signature-empty {
  visibility: hidden;
}

.preview-so-ack-signature .preview-so-sign-image {
  margin-bottom: 2px;
}

.preview-so-note {
  margin: 2px 0 10px;
  font-size: 11px;
  color: #444;
}

.preview-so-signature {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-top: 22px;
  break-inside: avoid-page;
  page-break-inside: avoid;
}

.preview-so-company {
  color: #666;
  font-weight: 600;
  text-align: center;
}

.preview-so-company-left {
  flex: 1 1 auto;
  text-align: left;
  padding-bottom: 2px;
}

.preview-so-signbox {
  flex: 0 0 auto;
  width: 80mm;
  max-width: 80mm;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.preview-so-signbox-right {
  margin-left: auto;
}

.preview-so-sign-image {
  display: block;
  max-width: 60mm;
  max-height: 24mm;
  object-fit: contain;
  margin: 0 auto;
}

.preview-so-signline {
  width: 100%;
  border-top: 1px solid #999;
  padding-top: 2px;
  margin-top: -2px;
  color: #555;
  font-weight: 700;
  text-align: center;
}

.preview-generic-signature {
  margin-top: 18px;
}

.preview-so-continued {
  margin-top: 10px;
  text-align: right;
  color: #666;
  font-size: 11px;
}

.toast-info {
  background: #46637b;
}

.toast-success {
  background: #1f745d;
}

.toast-error {
  background: var(--danger);
}

.contact-ledger-layout {
  grid-template-columns: minmax(0, 1fr);
}

.customer-ledger-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.customer-stat-card {
  min-height: 70px;
  padding: 15px 16px;
  border: 1px solid rgba(89, 90, 94, 0.12);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(250, 250, 249, 0.88));
  box-shadow: 0 10px 26px rgba(27, 31, 35, 0.04);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  position: relative;
  overflow: hidden;
}

.customer-stat-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 999px;
  background: var(--accent);
}

.customer-stat-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.customer-stat-card strong {
  color: var(--accent-deep);
  font-size: 24px;
  line-height: 1;
}

.customer-ledger-filter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-bottom: 14px;
}

.customer-ledger-scroll {
  width: 100%;
  overflow: auto;
  max-height: min(68vh, 720px);
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 30px rgba(27, 31, 35, 0.04);
}

.customer-ledger-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.customer-ledger-table th,
.customer-ledger-table td {
  min-width: 120px;
  max-width: 260px;
  padding: 13px 12px;
  border-right: 1px solid rgba(89, 90, 94, 0.1);
  border-bottom: 1px solid rgba(89, 90, 94, 0.1);
  vertical-align: top;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
}

.customer-ledger-table th {
  background:
    linear-gradient(180deg, rgba(255, 248, 242, 0.96), rgba(250, 250, 249, 0.96));
  color: var(--accent-deep);
  font-weight: 800;
  white-space: nowrap;
  font-size: 12px;
  letter-spacing: 0.02em;
}

.customer-ledger-table tbody tr {
  cursor: pointer;
}

.customer-ledger-table tbody tr:nth-child(even) {
  background: rgba(89, 90, 94, 0.025);
}

.customer-ledger-table tbody tr:hover,
.customer-ledger-table tbody tr.active {
  background: var(--accent-soft);
}

.customer-ledger-table th:first-child,
.customer-ledger-table td:first-child {
  min-width: 48px;
  width: 48px;
  text-align: center;
}

.customer-ledger-table .company-cell {
  min-width: 220px;
  color: var(--text);
  font-weight: 700;
}

.customer-ledger-table .code-cell {
  min-width: 150px;
  color: var(--accent-deep);
  font-weight: 700;
}

.customer-ledger-table .wide-cell {
  min-width: 250px;
}

.customer-ledger-table .customer-level-cell {
  color: var(--accent-2);
  font-weight: 900;
}

.product-wide-panel {
  grid-column: 1 / -1;
}

.content-grid:has(#productForm),
.content-grid:has(.product-wide-panel) {
  min-width: 0;
  overflow-x: hidden;
}

.content-grid:has(#productForm) > .panel,
.content-grid:has(.product-wide-panel) > .panel {
  min-width: 0;
  overflow: hidden;
}

.compact-product-form {
  gap: 12px;
  min-width: 0;
  overflow: hidden;
}

.product-form-grid {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 0.8fr);
  gap: 12px;
  align-items: end;
  min-width: 0;
}

.product-form-grid label {
  gap: 7px;
  min-width: 0;
}

.product-form-grid input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
}

.embedded-product-query {
  margin-top: 2px;
  padding: 12px 14px 14px;
  border: 1px solid rgba(190, 197, 208, 0.34);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  min-width: 0;
  overflow: hidden;
}

.embedded-product-query .section-head {
  margin-bottom: 8px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.embedded-product-query .table-scroll {
  max-height: 360px;
  overflow-x: hidden;
  overflow-y: auto;
}

.product-import-box p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.customer-import-box {
  padding: 14px 16px;
  border: 1px solid rgba(232, 95, 35, 0.16);
  border-radius: 16px;
  background: rgba(255, 248, 242, 0.7);
}

.customer-import-box p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.inline-import-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.inline-import-actions input[type="file"] {
  flex: 1 1 260px;
}

.product-search-actions {
  align-items: center;
  flex: 1 1 360px;
  justify-content: flex-end;
  min-width: 0;
  flex-wrap: wrap;
}

.product-search-actions input {
  flex: 1 1 280px;
  min-width: 0;
  max-width: 440px;
}

.product-count {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 12px;
  border: 1px solid rgba(232, 95, 35, 0.14);
  border-radius: 999px;
  color: var(--accent);
  background: rgba(255, 248, 242, 0.82);
  font-weight: 900;
}

.product-analysis-sections {
  display: grid;
  gap: 16px;
}

.product-analysis-block {
  border: 1px solid rgba(232, 95, 35, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  overflow: hidden;
}

.product-analysis-block .section-head {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(89, 90, 94, 0.1);
  background: linear-gradient(180deg, rgba(255, 248, 242, 0.9), rgba(250, 250, 249, 0.86));
}

.product-analysis-list {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.product-analysis-item {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.9fr);
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid rgba(89, 90, 94, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
}

.product-analysis-item div {
  min-width: 0;
}

.product-analysis-item strong {
  display: block;
  color: var(--text);
}

.product-analysis-item span {
  display: inline-block;
  margin: 3px 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.product-analysis-table {
  width: 100%;
  border-collapse: collapse;
}

.product-analysis-table th {
  text-align: center;
  vertical-align: middle;
}

.product-analysis-table td {
  vertical-align: middle;
}

.product-analysis-table td:nth-child(3),
.product-analysis-table td:nth-child(4),
.product-analysis-table td:nth-child(5),
.product-analysis-table td:nth-child(6) {
  text-align: right;
}

.product-table th {
  text-align: center;
  vertical-align: middle;
}

.product-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

.product-table th,
.product-table td {
  vertical-align: middle;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
  line-height: 1.35;
}

.product-table th:nth-child(1),
.product-table td:nth-child(1) {
  width: 14%;
}

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

.product-table th:nth-child(3),
.product-table td:nth-child(3) {
  width: 34%;
}

.product-table th:nth-child(4),
.product-table td:nth-child(4) {
  width: 11%;
}

.product-table th:nth-child(5),
.product-table td:nth-child(5) {
  width: 9%;
}

.product-table th:nth-child(6),
.product-table td:nth-child(6) {
  width: 4%;
}

.table-scroll .product-table th,
.table-scroll .product-table td {
  min-width: 0;
}

.table-scroll .product-table th:last-child,
.table-scroll .product-table td:last-child {
  min-width: 0;
}

.product-table td:nth-child(4) {
  text-align: right;
  white-space: nowrap;
}

.product-table td:nth-child(5) {
  font-size: 12px;
}

.product-table td:nth-child(6) .ghost {
  min-width: 0;
  padding-inline: 8px;
}

.product-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.product-stat-card {
  padding: 16px;
  border: 1px solid rgba(232, 95, 35, 0.12);
  border-radius: 16px;
  background: rgba(255, 252, 249, 0.88);
}

.product-stat-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.product-stat-card strong {
  color: var(--accent-deep);
  font-size: 20px;
}

.row-index {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(89, 90, 94, 0.18);
  border-radius: 6px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.9);
}

.mini-action {
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 8px;
  white-space: nowrap;
  box-shadow: none;
}

.danger-action {
  color: var(--danger);
}

.collapsed-customer-detail {
  min-height: 140px;
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 22px;
  border: 1px dashed rgba(89, 90, 94, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.55);
}

.collapsed-customer-detail strong {
  display: block;
  color: var(--text);
  font-size: 18px;
}

.collapsed-customer-detail span,
.collapsed-customer-detail p {
  color: var(--muted);
}

.collapsed-customer-detail p {
  margin: 0;
}

@media (max-width: 1200px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .split-main,
  .split-main.split-resizable,
  .two-col,
  .shell,
  .shell.split-resizable,
  .login-shell,
  .detail-grid {
    grid-template-columns: 1fr !important;
  }

  .split-resizer {
    display: none;
  }

  .shell.split-resizable,
  .split-main.split-resizable {
    gap: 18px;
  }
}

@media (max-width: 860px) {
  .project-report-dashboard,
  .summary-report-dashboard,
  .summary-report-board,
  .project-report-board {
    grid-template-columns: 1fr;
  }

  .project-report-mini-grid,
  .project-report-stats,
  .summary-money-grid,
  .summary-doc-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-report-card-head,
  .project-report-project-head,
  .project-report-progress-line > div {
    align-items: flex-start;
    flex-direction: column;
  }

  .contractor-overview-head,
  .contractor-card-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .contractor-card-meta {
    grid-template-columns: 1fr;
  }

  .detail-drawer {
    width: 100vw;
    padding: 16px;
  }

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

  .detail-drawer-head,
  .detail-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .receipt-head-card {
    grid-template-columns: 1fr;
  }

  .receipt-info-panel,
  .receipt-agent-panel,
  .finance-group-summary {
    grid-template-columns: 1fr;
  }

  .receipt-tools,
  .button-row {
    align-items: stretch;
    flex-direction: column;
  }

  .shell,
  .login-shell {
    width: min(calc(100vw - 18px), 1440px);
    padding-top: 12px;
  }

  .brand-card,
  .panel,
  .topbar-card {
    padding: 16px;
    border-radius: 16px;
  }

  .brand-card {
    gap: 10px;
    display: flex;
    align-items: center;
  }

  .brand-logo {
    width: min(132px, 44vw);
    max-width: 132px;
    margin-bottom: 0;
    flex: 0 0 auto;
  }

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

  .nav-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .nav-list::-webkit-scrollbar {
    display: none;
  }

  .nav-group {
    display: flex;
    flex: 0 0 auto;
    gap: 6px;
    align-items: stretch;
    scroll-snap-align: start;
  }

  .nav-group.expanded .subnav-list {
    display: flex;
  }

  .subnav-list {
    padding-left: 0;
    gap: 6px;
  }

  .subnav-btn::before {
    display: none;
  }

  .nav-btn,
  .subnav-btn {
    white-space: nowrap;
  }

  .nav-btn[data-nav="dashboard"] {
    display: none;
  }

  .nav-btn,
  button,
  .button-link {
    border-radius: 12px;
    padding: 10px 12px;
  }

  .sidebar-foot {
    gap: 8px;
  }

  .user-chip {
    padding: 10px 12px;
    border-radius: 14px;
  }

  .topbar-card,
  .section-head,
  .items-header,
  .totals-box {
    flex-direction: column;
    align-items: flex-start;
  }

  .form-grid,
  .user-row,
  .items-table-head,
  .items-row {
    grid-template-columns: 1fr;
    min-width: 0;
  }

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

  .sales-order-grid .span-2 {
    grid-column: span 2;
  }

  .sales-order-textareas {
    grid-template-columns: 1fr;
  }

  .sales-order-textareas .span-2 {
    grid-column: span 1;
  }

  .dashboard-insight-grid {
    grid-template-columns: 1fr;
  }

  .project-stats-filter {
    grid-template-columns: 1fr;
  }

  .customer-ledger-stats,
  .customer-ledger-filter {
    grid-template-columns: 1fr;
  }

  .task-ledger-dashboard,
  .task-ledger-meta,
  .project-init-stats,
  .project-init-task-counts,
  .project-init-search {
    grid-template-columns: 1fr;
  }

  .task-ledger-main,
  .task-row-actions,
  .task-compact-actions,
  .task-project-lock {
    align-items: flex-start;
    flex-direction: column;
  }

  .task-project-lock span {
    text-align: left;
  }

  .project-stats-filter-actions {
    width: 100%;
  }

  .project-stats-filter-actions button {
    flex: 1;
  }

  .project-opportunity-grid {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .project-opportunity-filter,
  .project-opportunity-row,
  .project-opportunity-quick,
  .project-opportunity-detail {
    grid-template-columns: 1fr;
  }

  .project-opportunity-filter-actions {
    width: 100%;
  }

  .project-opportunity-filter-actions button,
  .project-opportunity-actions button {
    flex: 1;
  }

  .product-stats-grid {
    grid-template-columns: 1fr;
  }

  .product-search-actions,
  .product-search-actions input {
    width: 100%;
  }

  .project-opportunity-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .project-opportunity-detail .span-2 {
    grid-column: span 1;
  }

  .confirmed-project-hero,
  .confirmed-project-board,
  .confirmed-project-metrics,
  .confirmed-project-key-grid,
  .confirmed-project-info-grid,
  .confirmed-project-form-grid,
  .confirmed-project-form-notes {
    grid-template-columns: 1fr;
  }

  .confirmed-project-hero {
    padding: 18px;
  }

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

  .confirmed-project-list {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .confirmed-project-focus-head,
  .confirmed-project-form-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .confirmed-project-actions,
  .confirmed-project-actions button,
  .confirmed-project-form-actions,
  .confirmed-project-form-actions button {
    width: 100%;
  }

  .solution-version-body,
  .solution-form-grid {
    grid-template-columns: 1fr;
  }

  .solution-reference-prompt,
  .solution-reference-active,
  .solution-form-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-bars {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .topbar-rate-field {
    justify-items: start;
    text-align: left;
  }

  .topbar-rate-field input {
    max-width: none;
    text-align: left;
    font-size: 20px;
  }

  .login-shell {
    min-height: 100svh;
    padding: 12px 0 22px;
    align-content: start;
    align-items: stretch;
    justify-content: stretch;
    gap: 10px;
  }

  .login-panel {
    border-radius: 16px;
  }

  .hero-panel {
    padding: 14px 16px;
  }

  .login-topbar {
    justify-content: flex-end;
    margin-bottom: 6px;
  }

  .hero-logo {
    width: min(260px, 78vw);
    margin-bottom: 0;
  }

  .form-panel {
    padding: 18px 16px;
  }

  .form-panel h2 {
    font-size: 24px;
    line-height: 1.18;
    margin: 4px 0 14px;
  }

  .form-panel .stack {
    gap: 12px;
    max-width: none;
  }

  .form-panel input {
    min-height: 46px;
  }

  .form-panel button.primary {
    width: 100%;
    min-height: 46px;
  }

  .login-hint {
    margin-top: 12px;
    font-size: 12px;
    line-height: 1.45;
  }

  .preview-doc-head,
  .preview-doc-brand,
  .preview-drawer-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-outing-layout,
  .site-outing-layout-resizable {
    grid-template-columns: 1fr !important;
  }

  .sales-order-compact,
  .sales-order-compact form,
  .document-item-import,
  .sales-order-grid,
  .sales-order-textareas,
  .items-header,
  .totals-box {
    min-width: 0;
    max-width: 100%;
  }

  .document-item-import {
    grid-template-columns: 1fr;
  }

  .purchase-attachment-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .purchase-attachment-head > span {
    text-align: left;
  }

  .purchase-attachment-grid {
    grid-template-columns: 1fr;
  }

  .sales-order-compact .items-table {
    display: grid;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .sales-order-compact .items-table-head {
    display: none;
  }

  .sales-order-compact .items-row {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) minmax(0, 1fr) !important;
    grid-template-areas:
      "serial part model"
      "feature feature feature"
      "qty price total"
      "delete delete delete";
    gap: 8px;
    width: 100%;
    min-width: 0;
    padding: 10px;
    border: 1px solid rgba(232, 95, 35, 0.16);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 8px 18px rgba(43, 35, 24, 0.04);
  }

  .sales-order-compact .items-row > input,
  .sales-order-compact .items-row > .line-total,
  .sales-order-compact .items-row > button {
    width: 100%;
    height: 42px;
    min-height: 42px;
    margin: 0;
    border: 1px solid rgba(89, 90, 94, 0.12);
    border-radius: 10px;
    padding: 8px 10px;
    background: #fff;
    font-size: 14px;
    line-height: 1.2;
    box-shadow: none;
  }

  .sales-order-compact .items-row > input[name^="item-serialNo-"] {
    grid-area: serial;
    text-align: center;
    font-weight: 800;
  }

  .sales-order-compact .items-row > input[name^="item-partNumber-"] {
    grid-area: part;
  }

  .sales-order-compact .items-row > input[name^="item-model-"] {
    grid-area: model;
  }

  .sales-order-compact .items-row > input[name^="item-feature-"] {
    grid-area: feature;
  }

  .sales-order-compact .items-row > input[name^="item-quantity-"] {
    grid-area: qty;
  }

  .sales-order-compact .items-row > input[name^="item-unitPrice-"] {
    grid-area: price;
  }

  .sales-order-compact .items-row > .line-total {
    grid-area: total;
    align-items: center;
    justify-content: flex-end;
    color: #2f343c;
    font-weight: 800;
    background: #fff8f2;
  }

  .sales-order-compact .items-row > button[data-remove-item] {
    grid-area: delete;
    justify-self: end;
    width: auto;
    min-width: 88px;
    color: #c84f1e;
    background: rgba(255, 248, 242, 0.86);
  }

  .site-outing-resizer,
  .column-resize-handle {
    display: none;
  }

  .page-accent-hero {
    left: 24px;
    top: 88px;
    height: 58px;
  }
}

@media (max-width: 430px) {
  .login-shell {
    width: calc(100vw - 12px);
    padding-top: max(8px, env(safe-area-inset-top));
    padding-bottom: max(14px, env(safe-area-inset-bottom));
  }

  .hero-panel {
    padding: 12px;
  }

  .form-panel {
    padding: 16px 14px;
  }

  .hero-logo {
    width: min(220px, 72vw);
  }

  .lang-switch {
    width: 100%;
    justify-content: stretch;
  }

  .lang-switch button {
    flex: 1;
    min-width: 0;
    padding-left: 8px;
    padding-right: 8px;
  }

  .exchange-grid,
  .sales-order-grid,
  .finance-ledger-grid,
  .finance-statement-grid,
  .site-outing-form-grid {
    grid-template-columns: 1fr;
  }

  .sales-order-grid .span-2 {
    grid-column: span 1;
  }

  .table-scroll td .table-actions {
    flex-wrap: wrap;
    width: min(100%, 320px);
  }

  .sales-order-action-groups,
  .table-scroll td .sales-order-action-groups.action-grid-balanced {
    width: min(320px, calc(100vw - 64px));
    min-width: 0;
  }

  .sales-order-action-groups .action-group,
  .sales-order-action-groups .action-group-generate {
    flex-wrap: wrap;
  }
}
