:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --panel: #ffffff;
  --ink: #162027;
  --muted: #65727a;
  --line: #dce4e8;
  --soft: #edf3f5;
  --accent: #14766d;
  --accent-dark: #0d5c55;
  --gold: #b97918;
  --danger: #b42318;
  --shadow: 0 10px 28px rgba(22, 32, 39, 0.08);
}

* {
  box-sizing: border-box;
}

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

[hidden] {
  display: none !important;
}

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

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

button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  padding: 0 13px;
  font-weight: 700;
}

button:hover {
  border-color: var(--accent);
}

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

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

.primary-button:hover {
  background: var(--accent-dark);
}

.danger-button {
  border-color: rgba(180, 35, 24, 0.25);
  color: var(--danger);
}

.wide {
  width: 100%;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  font-size: 1.45rem;
}

h2 {
  font-size: 1.35rem;
}

h3 {
  font-size: 1rem;
}

.muted,
.section-heading p,
.form-message {
  color: var(--muted);
  line-height: 1.5;
}

.login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(20, 118, 109, 0.11), transparent 34%),
    linear-gradient(315deg, rgba(185, 121, 24, 0.14), transparent 30%),
    var(--bg);
}

.login-panel {
  width: min(440px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  padding: 28px;
}

.app-logo-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1060 / 965;
  background: #fff;
}

.app-logo-frame img {
  position: absolute;
  top: -13%;
  left: -10.4%;
  width: 118.3%;
  max-width: none;
}

.app-logo-login {
  width: min(195px, 61.5%);
  margin: -8px auto 10px;
}

.login-panel > .muted {
  max-width: 350px;
  margin-inline: auto;
  text-align: center;
}

.login-form,
.form-grid {
  display: grid;
  gap: 14px;
}

.parameter-list {
  display: none;
}

.login-form {
  margin-top: 22px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

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

input,
select {
  min-height: 40px;
}

textarea {
  min-height: 82px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
  font-weight: 400;
  opacity: 0.78;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(20, 118, 109, 0.14);
  outline: none;
}

.app {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 22px;
  border-right: 1px solid var(--line);
  background: #fff;
  padding: 22px 16px;
}

.brand {
  display: grid;
  place-items: center;
  padding: 0 6px 16px;
  border-bottom: 1px solid var(--line);
}

.app-logo-sidebar {
  width: min(118.75px, 62.5%);
}

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

.nav-button,
.nav-group-toggle {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  border-color: transparent;
  background: transparent;
  text-align: left;
}

.nav-label {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.nav-label svg {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  stroke-width: 2;
}

.nav-label span {
  min-width: 0;
}

.nav-button.active,
.nav-group-toggle.active {
  border-color: rgba(20, 118, 109, 0.25);
  background: #eaf7f5;
  color: var(--accent-dark);
}

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

.nav-group[hidden] {
  display: none;
}

.nav-group-toggle {
  position: relative;
  padding-right: 36px;
}

.nav-group-toggle::after {
  position: absolute;
  top: 50%;
  right: 16px;
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  content: "";
  transform: translateY(-70%) rotate(45deg);
  transition: transform 160ms ease;
}

.nav-group-toggle[aria-expanded="false"]::after {
  transform: translateY(-50%) rotate(-45deg);
}

.nav-submenu {
  display: grid;
  gap: 4px;
  margin-left: 18px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
}

.nav-submenu[hidden] {
  display: none;
}

.nav-sub-button {
  min-height: 38px;
  padding-block: 8px;
  color: var(--muted);
  font-size: 0.91rem;
}

.nav-sub-button .nav-label {
  gap: 10px;
}

.nav-sub-button .nav-label svg {
  width: 17px;
  height: 17px;
  flex-basis: 17px;
}

.nav-sub-button.active {
  color: var(--accent-dark);
}

.user-box {
  display: grid;
  gap: 5px;
  margin-top: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.user-box span {
  color: var(--muted);
  font-size: 0.84rem;
}

.workspace {
  display: grid;
  align-content: start;
  gap: 18px;
  min-width: 0;
  padding: 20px clamp(16px, 3vw, 34px) 34px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
}

.topbar-actions,
.toolbar-actions,
.action-row,
.row-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.api-status {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  align-self: center;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #d33c32;
  box-shadow: 0 0 0 1px rgba(145, 31, 24, 0.3);
  cursor: help;
}

.api-status.connected {
  background: #20a464;
  box-shadow: 0 0 0 1px rgba(13, 116, 67, 0.32);
}

.api-status::after {
  position: absolute;
  z-index: 30;
  top: calc(100% + 10px);
  right: -8px;
  width: max-content;
  max-width: 230px;
  padding: 7px 9px;
  border-radius: 5px;
  background: #172027;
  color: #fff;
  content: attr(data-tooltip);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-3px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.api-status:hover::after,
.api-status:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.api-status:focus-visible {
  outline: 3px solid rgba(20, 118, 109, 0.2);
  outline-offset: 3px;
}

.view {
  display: none;
  min-width: 0;
}

.view.active {
  display: grid;
  gap: 18px;
}

.panel,
.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.panel {
  min-width: 0;
  padding: 18px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

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

.summary-grid.small {
  margin-bottom: 14px;
}

.metric {
  display: grid;
  gap: 8px;
  min-height: 88px;
  padding: 15px;
}

.metric span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.metric strong {
  font-size: clamp(1.05rem, 2vw, 1.38rem);
}

.metric.total {
  border-color: rgba(20, 118, 109, 0.32);
  background: #eaf7f5;
}

.metric.mdu-metric {
  border-color: rgba(39, 116, 174, 0.3);
  background: #edf5fa;
}

.dashboard-filter-bar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding: 0 0 14px;
}

.dashboard-filter-bar > div {
  display: grid;
  gap: 4px;
}

.dashboard-filter-bar > div span,
.dashboard-filter-bar label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.dashboard-filter-bar label {
  display: grid;
  min-width: 190px;
  gap: 6px;
}

.dashboard-filter-controls,
.dashboard-custom-range {
  display: flex;
  align-items: end;
  gap: 10px;
}

.dashboard-custom-range[hidden] {
  display: none;
}

.dashboard-custom-range label {
  min-width: 155px;
}

.dashboard-custom-range input {
  min-height: 42px;
}

.dashboard-custom-range button {
  min-height: 42px;
}

.dashboard-filter-bar select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 0 34px 0 11px;
  font-weight: 700;
}

.dashboard-chart-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 0.85fr);
  gap: 18px;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

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

.chart-legend i,
.status-legend i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-rab {
  background: var(--accent);
}

.legend-realization {
  background: #2774ae;
}

.trend-chart-wrap {
  overflow-x: auto;
  padding: 6px 0 2px;
}

.trend-chart {
  display: flex;
  align-items: end;
  min-width: 100%;
  height: 220px;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 8px 8px 0;
}

.trend-column {
  display: grid;
  grid-template-rows: 22px 150px 34px;
  flex: 1 0 58px;
  min-width: 58px;
  max-width: 100px;
  align-items: end;
  text-align: center;
}

.trend-values,
.trend-bars {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 5px;
}

.trend-values span {
  width: 20px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
}

.trend-bar {
  display: block;
  width: 20px;
  border-radius: 3px 3px 0 0;
}

.trend-bar.rab {
  background: var(--accent);
}

.trend-bar.realization {
  background: #2774ae;
}

.trend-column small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.67rem;
  line-height: 1.2;
}

.status-chart-layout {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  min-height: 220px;
  gap: 14px;
}

.status-donut {
  position: relative;
  display: grid;
  width: 140px;
  height: 140px;
  place-content: center;
  border-radius: 50%;
  text-align: center;
  justify-self: center;
}

.status-donut::after {
  position: absolute;
  inset: 26px;
  border-radius: 50%;
  background: #fff;
  content: "";
}

.status-donut strong,
.status-donut span {
  position: relative;
  z-index: 1;
}

.status-donut strong {
  font-size: 1.45rem;
}

.status-donut span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.status-legend {
  display: grid;
  gap: 9px;
}

.status-legend > div {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
}

.vendor-dashboard-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(0, 1.35fr);
  gap: 22px;
  align-items: start;
}

.vendor-chart {
  display: grid;
  max-height: 360px;
  overflow-y: auto;
  gap: 13px;
  padding: 4px 4px 4px 0;
}

.vendor-chart-row {
  display: grid;
  gap: 6px;
}

.vendor-chart-row > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.78rem;
}

.vendor-chart-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vendor-chart-row span {
  flex: 0 0 auto;
  color: var(--muted);
  font-weight: 800;
}

.vendor-bar-track {
  height: 12px;
  overflow: hidden;
  border-radius: 3px;
  background: #eef0e8;
}

.vendor-bar-track i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: #b97918;
}

.dashboard-vendor-table {
  max-height: 360px;
  overflow: auto;
}

.dashboard-vendor-table table {
  min-width: 520px;
}

.dashboard-vendor-table thead {
  position: sticky;
  z-index: 1;
  top: 0;
}

.mdu-dashboard-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(0, 1.35fr);
  gap: 22px;
  align-items: start;
}

.mdu-chart {
  display: grid;
  max-height: 510px;
  overflow-y: auto;
  gap: 13px;
  padding: 4px 4px 4px 0;
}

.mdu-chart-row {
  display: grid;
  gap: 6px;
}

.mdu-chart-row > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.75rem;
}

.mdu-chart-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mdu-chart-row span {
  flex: 0 0 auto;
  color: var(--muted);
  font-weight: 800;
}

.mdu-bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 3px;
  background: #e7edf0;
}

.mdu-bar-track i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: #2774ae;
}

.dashboard-mdu-table {
  max-height: 510px;
  overflow: auto;
}

.dashboard-mdu-table table {
  min-width: 520px;
}

.dashboard-mdu-table thead {
  position: sticky;
  z-index: 1;
  top: 0;
}

.numeric-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.dashboard-empty {
  display: grid;
  min-height: 150px;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.dashboard-empty.compact {
  min-height: 80px;
}

.list,
.category-list,
.worktype-list {
  display: grid;
  gap: 8px;
}

.list-item,
.select-item {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  text-align: left;
}

.select-item.active {
  border-color: rgba(20, 118, 109, 0.42);
  background: #eaf7f5;
}

.managed-select-item {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.managed-select-item.active {
  border-color: rgba(20, 118, 109, 0.42);
  background: #eaf7f5;
}

.managed-select-main {
  display: grid;
  width: 100%;
  min-height: 0;
  gap: 5px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 12px;
  text-align: left;
}

.managed-select-main:hover {
  background: rgba(20, 118, 109, 0.05);
}

.managed-select-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  padding: 0 10px 10px;
}

.managed-select-actions button {
  min-height: 32px;
  padding-inline: 10px;
  font-size: 0.82rem;
}

.item-meta {
  color: var(--muted);
  font-size: 0.82rem;
}

.master-grid {
  display: grid;
  grid-template-columns: 320px 360px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.master-construction-search {
  width: min(680px, 100%);
}

.search-dropdown-wrap {
  position: relative;
}

.search-dropdown-results {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 420px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: var(--shadow);
}

.search-dropdown-option {
  display: grid;
  width: 100%;
  gap: 3px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  padding: 11px 12px;
  text-align: left;
}

.search-dropdown-option:last-child {
  border-bottom: 0;
}

.search-dropdown-option:hover,
.search-dropdown-option:focus-visible {
  background: var(--soft);
}

.search-dropdown-option span,
.search-dropdown-option small {
  color: var(--muted);
  font-size: 0.78rem;
}

.search-dropdown-option small {
  color: var(--accent-dark);
}

.search-dropdown-empty {
  color: var(--muted);
  padding: 12px;
  font-size: 0.86rem;
}

.users-layout {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.price-master-panel {
  min-width: 0;
}

.price-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
}

.price-items-table {
  min-width: 1180px;
}

.price-items-table td:first-child {
  min-width: 300px;
}

.price-items-table td:nth-child(2) {
  min-width: 210px;
}

.price-items-table td:nth-child(3),
.price-items-table td:nth-child(4) {
  min-width: 130px;
}

.price-items-table td:nth-child(5) {
  min-width: 150px;
}

.price-value {
  text-align: right;
  font-weight: 800;
  white-space: nowrap;
}

.usage-count {
  text-align: center;
  font-weight: 800;
}

.price-row-actions {
  display: flex;
  gap: 7px;
  min-width: 140px;
}

.kkf-settings-form {
  display: grid;
  gap: 22px;
}

.settings-section {
  min-width: 0;
  border: 0;
  border-top: 1px solid var(--line);
  padding: 18px 0 0;
}

.settings-section legend {
  color: var(--ink);
  padding-right: 14px;
  font-size: 1rem;
  font-weight: 900;
}

.settings-section > p {
  margin: 0 0 12px;
  color: var(--muted);
}

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

.settings-grid input:disabled {
  background: var(--soft);
  color: var(--muted);
}

.kkf-tariff-table {
  min-width: 900px;
}

.kkf-tariff-table th:first-child,
.kkf-tariff-table td:first-child {
  min-width: 330px;
}

.kkf-tariff-table input {
  min-width: 150px;
  text-align: right;
}

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

.user-add-panel {
  width: min(620px, 100%);
}

.checkbox-label,
.table-checkbox {
  display: flex;
  align-items: center;
  gap: 9px;
}

.checkbox-label input,
.table-checkbox input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--accent);
}

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

.users-table td:first-child {
  min-width: 170px;
}

.users-table td:nth-child(2) {
  min-width: 210px;
}

.users-table td:nth-child(3) {
  min-width: 220px;
}

.users-table td:nth-child(4) {
  min-width: 150px;
}

.user-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 128px;
}

.password-dialog {
  width: min(440px, calc(100% - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(22, 32, 39, 0.22);
  padding: 22px;
}

.password-dialog::backdrop {
  background: rgba(22, 32, 39, 0.45);
}

.password-dialog form {
  display: grid;
  gap: 14px;
}

.project-history-dialog {
  width: min(920px, calc(100% - 32px));
}

.project-history-table-wrap {
  max-height: min(62vh, 560px);
  overflow: auto;
}

.project-history-table {
  min-width: 720px;
}

.project-history-table td {
  vertical-align: top;
}

.history-change {
  display: grid;
  gap: 3px;
}

.history-change small {
  color: var(--muted);
}

.template-item-dialog {
  width: min(580px, calc(100% - 32px));
}

.template-price-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 9px;
}

.template-item-actions {
  display: flex;
  min-width: 132px;
  gap: 7px;
}

.template-item-actions button {
  min-height: 32px;
  padding-inline: 10px;
  font-size: 0.82rem;
}

.create-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1.15fr) minmax(280px, 0.85fr);
  gap: 14px;
  align-items: start;
}

.wizard-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.project-form-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}

.project-form-tabs button {
  min-height: 42px;
  justify-content: center;
  background: #fff;
  color: var(--muted);
}

.project-form-tabs button.active {
  border-color: rgba(20, 118, 109, 0.38);
  background: #eaf7f5;
  color: var(--accent-dark);
}

.project-form-page {
  display: none;
  gap: 14px;
}

.project-form-page.active {
  display: grid;
}

.step-pill {
  min-height: 46px;
  justify-content: center;
  background: #fff;
  color: var(--muted);
}

.step-pill.active {
  border-color: rgba(20, 118, 109, 0.38);
  background: #eaf7f5;
  color: var(--accent-dark);
}

.wizard-page {
  display: none;
}

.wizard-page.active {
  display: block;
}

.realization-wizard-steps {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.realization-step-pill {
  min-height: 46px;
  justify-content: center;
  background: #fff;
  color: var(--muted);
}

.realization-step-pill.active {
  border-color: rgba(20, 118, 109, 0.38);
  background: #eaf7f5;
  color: var(--accent-dark);
}

.realization-wizard-page {
  display: none;
}

.realization-wizard-page.active {
  display: block;
}

.realization-search {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}

.realization-history-heading {
  margin-top: 28px;
}

.realization-comparison-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.realization-comparison-card {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.realization-comparison-card span,
.realization-comparison-card small {
  display: block;
  color: var(--muted);
}

.realization-comparison-card strong {
  display: block;
  margin: 6px 0;
  font-size: 1.15rem;
}

.realization-summary-table {
  min-width: 1640px;
}

.realization-summary-table input {
  min-width: 120px;
}

.realization-summary-table input:disabled {
  color: var(--text);
  background: #eef2f3;
  opacity: 1;
}

.realization-delta-positive {
  color: var(--danger);
}

.realization-delta-negative {
  color: var(--accent-dark);
}

@media (max-width: 900px) {
  .realization-wizard-steps,
  .realization-comparison-grid {
    grid-template-columns: 1fr 1fr;
  }

  .realization-search {
    grid-template-columns: 1fr;
  }
}

.survey-photo-counter {
  flex: 0 0 auto;
  color: var(--muted);
  font-weight: 700;
}

.survey-upload-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: stretch;
}

.survey-upload-dropzone {
  display: flex;
  min-height: 96px;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 18px;
  border: 1px dashed rgba(20, 118, 109, 0.55);
  border-radius: 6px;
  background: #f5fbfa;
  color: var(--accent-dark);
}

.survey-upload-dropzone:hover,
.survey-upload-dropzone:focus-within {
  border-style: solid;
  background: #eaf7f5;
}

.survey-upload-dropzone span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 400;
}

.survey-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.survey-photo-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.survey-photo-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #edf2f4;
}

.survey-photo-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 10px;
}

.survey-photo-name {
  min-width: 0;
}

.survey-photo-name strong,
.survey-photo-name span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.survey-photo-name strong {
  font-size: 0.86rem;
}

.survey-photo-name span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.75rem;
}

.survey-photo-empty {
  grid-column: 1 / -1;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  text-align: center;
}

.construction-picker {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 130px 52px;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}

.add-button {
  width: 52px;
  min-height: 40px;
  padding: 0;
  font-size: 1.35rem;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.action-row {
  justify-content: flex-end;
  margin-top: 14px;
}

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

.divider {
  height: 1px;
  border: 0;
  background: var(--line);
  margin: 14px 0;
}

.selected-work-list {
  display: grid;
  gap: 8px;
}

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

.selected-work-item strong {
  display: block;
  margin-bottom: 4px;
  line-height: 1.35;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  color: var(--muted);
  padding: 12px;
  font-size: 0.9rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
  background: #fff;
}

.compact table {
  min-width: 680px;
}

.rab-summary-table {
  min-width: 1280px;
  border: 2px solid #1a1f24;
}

.result-panel .rab-summary-table {
  min-width: 2000px;
}

.result-panel .rab-summary-table td:nth-child(1) {
  min-width: 64px;
}

.result-panel .rab-summary-table td:nth-child(2) {
  min-width: 460px;
}

.result-panel .rab-summary-table td:nth-child(3) {
  min-width: 130px;
}

.result-panel .rab-summary-table td:nth-child(4) {
  min-width: 110px;
}

.result-panel .rab-summary-table td:nth-child(5) {
  width: 130px;
  min-width: 130px;
  max-width: 130px;
}

.result-panel .rab-summary-table td:nth-child(6) {
  min-width: 190px;
}

.result-panel .rab-summary-table td:nth-child(7),
.result-panel .rab-summary-table td:nth-child(8),
.result-panel .rab-summary-table td:nth-child(9),
.result-panel .rab-summary-table td:nth-child(10) {
  min-width: 165px;
}

.result-panel .rab-summary-table td:nth-child(11) {
  min-width: 180px;
}

.result-panel .rab-summary-table td:nth-child(3) input,
.result-panel .rab-summary-table td:nth-child(4) input,
.result-panel .rab-summary-table td:nth-child(5) input {
  text-align: center;
}

.rab-summary-table th,
.rab-summary-table td {
  border: 1px solid #1a1f24;
}

.rab-summary-table th {
  background: #fff;
  color: #111820;
  text-align: center;
  vertical-align: middle;
}

.rab-summary-table td {
  background: #fff;
}

.summary-category-row td {
  border-top-width: 2px;
  font-weight: 900;
}

.summary-category-row td:nth-child(2) {
  font-size: 1.02rem;
}

.summary-worktype-row td {
  font-weight: 800;
}

.summary-uraian {
  min-width: 360px;
}

.rab-summary-table .item-no,
.rab-summary-table td:nth-child(3),
.rab-summary-table td:nth-child(4),
.rab-summary-table td:nth-child(5) {
  text-align: center;
}

.rab-summary-table td:nth-child(6),
.rab-summary-table td:nth-child(7),
.rab-summary-table td:nth-child(8),
.rab-summary-table td:nth-child(9),
.rab-summary-table td:nth-child(10) {
  text-align: right;
  white-space: nowrap;
}

.rab-summary-table input {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.rab-summary-table .summary-qty input,
.rab-summary-table .summary-price input {
  border-color: var(--line);
  background: #fff;
  text-align: right;
  font-weight: 800;
}

.rab-summary-table input:focus {
  border-color: var(--accent);
  background: #fff;
}

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

th {
  background: var(--soft);
  color: #40515b;
  font-size: 0.76rem;
  text-transform: uppercase;
}

td input {
  min-height: 34px;
  padding: 7px 8px;
}

.row-total {
  min-width: 130px;
  font-weight: 800;
  white-space: nowrap;
}

.project-row {
  cursor: pointer;
}

.project-row:hover td {
  background: #f7fbfa;
}

.project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 260px;
}

.project-actions button {
  min-height: 34px;
  padding-inline: 11px;
}

.empty-table-cell {
  color: var(--muted);
  padding: 28px 12px;
  text-align: center;
}

.result-panel {
  min-width: 0;
}

.generate-box {
  display: grid;
  gap: 6px;
}

.generate-box > span {
  color: var(--muted);
}

.pdf-preview-section {
  margin: 14px 0 10px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.pdf-preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.pdf-preview-heading > div {
  display: grid;
  gap: 3px;
}

.pdf-preview-heading span {
  color: var(--muted);
  font-size: 0.86rem;
}

.pdf-preview-frame-wrap {
  min-height: 560px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
}

.pdf-preview-frame {
  display: block;
  width: 100%;
  height: clamp(560px, 68vh, 760px);
  border: 0;
  background: #fff;
}

.pdf-preview-status {
  display: grid;
  min-height: 560px;
  place-items: center;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.final-rab-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.final-rab-heading > div:first-child {
  display: grid;
  gap: 4px;
}

.final-rab-heading span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.final-rab-heading strong {
  font-size: 1.24rem;
}

.final-rab-heading p {
  color: var(--muted);
}

.final-rab-tabs {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 14px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--soft);
}

.final-rab-tabs button {
  min-width: 130px;
  border-color: transparent;
  background: transparent;
}

.final-rab-tabs button.active {
  border-color: rgba(20, 118, 109, 0.32);
  background: #fff;
  color: var(--accent-dark);
  box-shadow: 0 1px 3px rgba(15, 33, 39, 0.1);
}

.pricing-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.realization-recap-grid {
  display: grid;
  grid-template-columns:
    repeat(3, minmax(130px, 0.55fr))
    repeat(2, minmax(340px, 1.45fr));
  gap: 12px;
  margin-bottom: 16px;
}

.realization-recap-grid > .metric {
  min-width: 0;
}

.realization-recap-grid > .realization-count-metric strong {
  min-width: 0;
  font-size: 1.4rem;
}

.realization-recap-grid > .realization-currency-metric strong {
  display: block;
  min-width: 0;
  white-space: nowrap;
  font-size: 1.3rem;
  font-variant-numeric: tabular-nums;
}

.data-search-toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto auto;
  align-items: end;
  gap: 10px;
  margin-bottom: 14px;
}

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 42px;
  margin-top: 14px;
}

.pagination-summary {
  color: var(--muted);
  font-size: 0.9rem;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pagination-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  min-width: 38px;
  padding: 0;
  place-items: center;
}

.pagination-button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.pagination-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.pagination-ellipsis {
  display: inline-grid;
  width: 24px;
  height: 38px;
  place-items: center;
  color: var(--muted);
}

.vendor-excluded-row td {
  background: #f6f8f9;
  color: var(--muted);
}

.final-calculation-row td:first-child {
  text-align: center;
  font-weight: 800;
}

.final-calculation-row.subtotal td:first-child {
  text-indent: -3ch;
}

.final-calculation-row td:nth-last-child(-n + 4) {
  text-align: right;
  font-weight: 800;
  white-space: nowrap;
}

.final-calculation-row.total td {
  border-top-width: 2px;
  background: #eaf7f5;
  color: var(--accent-dark);
  font-size: 1rem;
  font-weight: 900;
}

.final-slo-row td {
  font-weight: 700;
}

.final-terbilang-row td {
  height: 64px;
  text-align: left;
  vertical-align: top;
  font-style: italic;
  font-weight: 800;
}

.final-rab-table td:nth-child(2) {
  min-width: 320px;
}

.final-rab-table td:nth-child(n + 5) {
  text-align: right;
  white-space: nowrap;
}

.final-download-actions {
  flex-wrap: wrap;
}

@media (max-width: 1160px) {
  .master-grid,
  .create-grid,
  .users-layout {
    grid-template-columns: 1fr;
  }

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

  .dashboard-chart-grid,
  .vendor-dashboard-layout,
  .mdu-dashboard-layout {
    grid-template-columns: 1fr;
  }
}

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

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .app-logo-sidebar {
    width: 100px;
  }

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

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

  .construction-picker,
  .price-toolbar,
  .data-search-toolbar,
  .template-price-search {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 620px) {

  .table-pagination {
    align-items: flex-start;
    flex-direction: column;
  }

  .pagination-controls {
    max-width: 100%;
    overflow-x: auto;
  }

  .realization-recap-grid {
    grid-template-columns: 1fr;
  }
  .topbar,
  .section-heading,
  .topbar-actions,
  .toolbar-actions,
  .action-row,
  .pdf-preview-heading,
  .final-rab-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-filter-bar,
  .status-chart-layout {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .dashboard-filter-bar {
    display: grid;
  }

  .dashboard-filter-controls,
  .dashboard-custom-range {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .dashboard-filter-controls label,
  .dashboard-custom-range label,
  .dashboard-custom-range button {
    width: 100%;
  }

  .status-donut {
    justify-self: center;
  }

  .summary-grid,
  .two-col,
  .pricing-summary-grid,
  .survey-upload-row,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .wizard-steps {
    grid-template-columns: 1fr;
  }

  .project-form-tabs {
    grid-template-columns: 1fr;
  }

  .final-rab-tabs {
    display: grid;
  }

  .selected-work-item {
    align-items: stretch;
    flex-direction: column;
  }
}

@media print {
  .login-screen,
  .sidebar,
  .topbar,
  .toolbar-actions,
  .action-row,
  .row-actions {
    display: none;
  }

  .app {
    display: block;
  }

  .workspace {
    padding: 0;
  }

  .panel,
  .metric {
    box-shadow: none;
  }
}
