.button {
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-small);
  font-weight: 700;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    transform 0.15s ease;
}

.button:active {
  transform: translateY(1px);
}

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

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

.button--secondary {
  color: var(--text-primary);
  border-color: var(--border);
  background: var(--surface);
}

.button--secondary:hover {
  background: var(--surface-muted);
}

.project-card {
  display: flex;
  flex-direction: column;
  min-height: 210px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-medium);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.project-card__title {
  margin-bottom: 8px;
  font-size: 20px;
}

.project-card__meta {
  margin-bottom: 8px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.project-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 18px;
}

.project-card__date {
  color: var(--text-secondary);
  font-size: 13px;
}

.project-card__delete {
  padding: 0;
  border: 0;
  color: var(--danger);
  background: transparent;
  font-weight: 700;
}

.empty-state {
  padding: 48px 24px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-medium);
  color: var(--text-secondary);
  background: var(--surface);
  text-align: center;
}

.empty-state[hidden] {
  display: none;
}

.empty-state h3 {
  margin-bottom: 8px;
  color: var(--text-primary);
}

.dialog {
  width: min(100% - 24px, 680px);
  padding: 0;
  border: 0;
  border-radius: var(--radius-large);
  background: transparent;
}

.dialog::backdrop {
  background: rgba(10, 18, 28, 0.55);
}

.dialog__content {
  padding: 24px;
  border-radius: var(--radius-large);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.dialog__header h2 {
  margin-bottom: 0;
}

.dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

.icon-button {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-primary);
  background: var(--surface);
  font-size: 28px;
  line-height: 1;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field__label {
  font-size: 14px;
  font-weight: 700;
}

.field input,
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  color: var(--text-primary);
  background: var(--surface);
  outline: none;
}

.field textarea {
  min-height: 120px;
  line-height: 1.5;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(18, 104, 214, 0.12);
}

@media (max-width: 640px) {
  .dialog__content {
    padding: 20px;
  }

  .dialog__actions {
    flex-direction: column-reverse;
  }

  .dialog__actions .button {
    width: 100%;
  }
}


.project-card__open {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-small);
  color: var(--accent);
  background: transparent;
  font-weight: 700;
}

.project-card__open:hover {
  color: #ffffff;
  background: var(--accent);
}

.project-card__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.estimate-placeholder {
  padding: 36px 28px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-medium);
  background: var(--surface);
  color: var(--text-secondary);
}

.estimate-placeholder h3 {
  margin-bottom: 8px;
  color: var(--text-primary);
}

.estimate-placeholder p {
  max-width: 760px;
  margin-bottom: 0;
  line-height: 1.6;
}


.estimate-add-form {
  margin-bottom: 22px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-medium);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.estimate-add-form__grid {
  display: grid;
  grid-template-columns: minmax(240px, 2fr) 120px 130px 150px auto;
  align-items: end;
  gap: 14px;
}

.estimate-add-form__button {
  white-space: nowrap;
}

.field select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  color: var(--text-primary);
  background: var(--surface);
  outline: none;
}

.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(18, 104, 214, 0.12);
}

.estimate-table-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-medium);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.estimate-table-scroll {
  overflow-x: auto;
}

.estimate-table {
  width: 100%;
  border-collapse: collapse;
}

.estimate-table th,
.estimate-table td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.estimate-table th {
  color: var(--text-secondary);
  background: var(--surface-muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.estimate-table__input,
.estimate-table__select {
  width: 100%;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text-primary);
  background: transparent;
  outline: none;
}

.estimate-table__input:hover,
.estimate-table__select:hover {
  border-color: var(--border);
  background: var(--surface);
}

.estimate-table__input:focus,
.estimate-table__select:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(18, 104, 214, 0.1);
}

.estimate-table__input--name {
  min-width: 240px;
}

.estimate-table__input--number {
  min-width: 92px;
}

.estimate-table__select {
  min-width: 105px;
}

.estimate-table__sum {
  min-width: 120px;
  font-weight: 700;
  white-space: nowrap;
}

.estimate-table__actions {
  width: 1%;
  text-align: right;
  white-space: nowrap;
}

.estimate-table__delete {
  padding: 7px 9px;
  border: 0;
  color: var(--danger);
  background: transparent;
  font-weight: 700;
}

.estimate-empty {
  padding: 36px 24px;
  color: var(--text-secondary);
  text-align: center;
}

.estimate-empty[hidden] {
  display: none;
}

.estimate-empty h3 {
  margin-bottom: 8px;
  color: var(--text-primary);
}

.estimate-empty p {
  margin-bottom: 0;
}

.estimate-summary {
  padding: 22px;
  background: var(--surface-muted);
}

.estimate-summary__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.estimate-summary__heading h3 {
  margin-bottom: 0;
  font-size: 22px;
}

.estimate-summary__eyebrow {
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.estimate-summary__note {
  max-width: 420px;
  margin-bottom: 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
  text-align: right;
}

.estimate-summary__grid {
  width: min(100%, 620px);
  margin-left: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  background: var(--surface);
  overflow: hidden;
}

.estimate-summary__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  min-height: 58px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.estimate-summary__row:last-child {
  border-bottom: 0;
}

.estimate-summary__label {
  color: var(--text-secondary);
  font-weight: 700;
}

.estimate-summary__adjustment {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto;
  align-items: center;
  gap: 20px;
}

.estimate-summary__mode-note {
  display: block;
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 12px;
}

.estimate-summary__controls {
  display: grid;
  grid-template-columns: 130px 170px;
  gap: 10px;
}

.estimate-summary__input-group {
  display: block;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  background: var(--surface);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.estimate-summary__input-group.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(18, 104, 214, 0.08);
}

.estimate-summary__input-label {
  display: block;
  margin-bottom: 5px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.estimate-summary__input-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-weight: 700;
}

.estimate-summary__input-field input {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  background: var(--surface);
  outline: none;
  text-align: right;
}

.estimate-summary__input-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(18, 104, 214, 0.1);
}

.estimate-summary__input-field--money {
  grid-template-columns: minmax(85px, 1fr) auto;
}

.estimate-summary__row--total {
  background: var(--surface-muted);
}

.estimate-summary__total-label {
  font-size: 18px;
  font-weight: 800;
}

.estimate-summary__value {
  font-size: 26px;
  white-space: nowrap;
}

@media (max-width: 980px) {
  .estimate-add-form__grid {
    grid-template-columns: minmax(240px, 2fr) repeat(3, minmax(110px, 1fr));
  }

  .estimate-add-form__button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .estimate-add-form {
    padding: 16px;
  }

  .estimate-add-form__grid {
    grid-template-columns: 1fr 1fr;
  }

  .estimate-add-form__name,
  .estimate-add-form__button {
    grid-column: 1 / -1;
  }

  .estimate-table thead {
    display: none;
  }

  .estimate-table,
  .estimate-table tbody,
  .estimate-table tr,
  .estimate-table td {
    display: block;
    width: 100%;
  }

  .estimate-table tr {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
  }

  .estimate-table td {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border: 0;
  }

  .estimate-table td::before {
    content: attr(data-label);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
  }

  .estimate-table__input--name,
  .estimate-table__input--number,
  .estimate-table__select {
    min-width: 0;
  }

  .estimate-table__sum {
    min-width: 0;
  }

  .estimate-table__actions {
    display: flex !important;
    justify-content: flex-end;
  }

  .estimate-table__actions::before {
    display: none;
  }

  .estimate-summary {
    padding: 16px;
  }

  .estimate-summary__heading {
    flex-direction: column;
    gap: 8px;
  }

  .estimate-summary__note {
    text-align: left;
  }

  .estimate-summary__grid {
    width: 100%;
  }

  .estimate-summary__row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .estimate-summary__adjustment {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 12px;
  }

  .estimate-summary__controls {
    grid-template-columns: 1fr 1fr;
  }

  .estimate-summary__row--total {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .estimate-summary__value {
    font-size: 21px;
  }
}


.work-catalog {
  margin-bottom: 28px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-medium);
  background: var(--surface);
  box-shadow: var(--shadow);
}

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

.work-catalog__header h3,
.manual-estimate-heading h3 {
  margin-bottom: 6px;
  font-size: 22px;
}

.work-catalog__eyebrow,
.manual-estimate-heading__eyebrow {
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.work-catalog__notice {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--text-secondary);
  line-height: 1.5;
}

.work-catalog__filters {
  display: grid;
  grid-template-columns: minmax(240px, 2fr) minmax(210px, 1fr);
  gap: 14px;
  margin-bottom: 12px;
}

.work-catalog__status {
  min-height: 20px;
  margin-bottom: 12px;
  color: var(--text-secondary);
  font-size: 13px;
}

.work-catalog__status--error {
  color: var(--danger);
}

.work-catalog__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: 460px;
  padding-right: 4px;
  overflow-y: auto;
}

.work-catalog-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  background: var(--surface);
}

.work-catalog-item__content {
  min-width: 0;
}

.work-catalog-item__category {
  display: block;
  margin-bottom: 4px;
  color: var(--text-secondary);
  font-size: 12px;
}

.work-catalog-item__title {
  margin-bottom: 5px;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.work-catalog-item__meta {
  margin-bottom: 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.work-catalog-item__button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 7px 12px;
}

.work-catalog-item__button:disabled {
  cursor: default;
  opacity: 0.7;
}

.manual-estimate-heading {
  margin-bottom: 12px;
}

@media (max-width: 820px) {
  .work-catalog__list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .work-catalog {
    padding: 16px;
  }

  .work-catalog__filters {
    grid-template-columns: 1fr;
  }

  .work-catalog__list {
    max-height: 520px;
  }

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

  .work-catalog-item__button {
    width: 100%;
  }
}


.button--danger-outline {
  color: var(--danger);
  border-color: rgba(201, 52, 52, 0.35);
  background: var(--surface);
}

.button--danger-outline:hover {
  border-color: var(--danger);
  background: rgba(201, 52, 52, 0.06);
}

.dialog--wide {
  width: min(100% - 24px, 940px);
}

.dialog__description {
  max-width: 680px;
  margin: 8px 0 0;
  color: var(--text-secondary);
  line-height: 1.5;
}

.dialog__actions--spread {
  align-items: center;
  justify-content: space-between;
}

.dialog__actions-group {
  display: flex;
  gap: 12px;
}

.price-settings__filters {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) minmax(220px, 1fr);
  gap: 14px;
  margin-bottom: 12px;
}

.price-settings__status {
  min-height: 20px;
  margin-bottom: 12px;
  color: var(--text-secondary);
  font-size: 13px;
}

.price-settings__status--error {
  color: var(--danger);
}

.price-settings__list {
  display: grid;
  gap: 8px;
  max-height: 520px;
  padding-right: 4px;
  overflow-y: auto;
}

.price-settings-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px;
  align-items: center;
  gap: 18px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  background: var(--surface);
}

.price-settings-item__content {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 3px;
}

.price-settings-item__category,
.price-settings-item__meta {
  color: var(--text-secondary);
  font-size: 12px;
}

.price-settings-item__title {
  overflow-wrap: anywhere;
}

.price-settings-item__field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.price-settings-item__field input {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  color: var(--text-primary);
  background: var(--surface);
  outline: none;
}

.price-settings-item__field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(18, 104, 214, 0.12);
}

.price-settings-item__field input[aria-invalid="true"] {
  border-color: var(--danger);
}

.price-settings-item__currency {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
}

@media (max-width: 640px) {
  .price-settings__filters {
    grid-template-columns: 1fr;
  }

  .price-settings-item {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .dialog__actions--spread {
    align-items: stretch;
    flex-direction: column;
  }

  .dialog__actions-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .dialog__actions-group .button,
  .button--danger-outline {
    width: 100%;
  }
}


@media (max-width: 430px) {
  .estimate-summary__controls {
    grid-template-columns: 1fr;
  }

  .estimate-summary__row--total {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}


.estimate-header__content {
  min-width: 0;
}

.estimate-header__notes {
  max-width: 820px;
  margin: 14px 0 0;
  padding: 12px 14px;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-small) var(--radius-small) 0;
  color: var(--text-secondary);
  background: var(--surface);
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.estimate-header__notes[hidden] {
  display: none;
}

@media (max-width: 640px) {
  .estimate-header {
    flex-direction: column;
  }

  #edit-project-details-button {
    width: 100%;
  }

  .form-grid__full {
    grid-column: auto;
  }
}


.estimate-header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

@media (max-width: 640px) {
  .estimate-header__actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .estimate-header__actions .button {
    width: 100%;
  }
}


.estimate-bottom-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 22px;
}

.estimate-bottom-actions__button {
  min-width: 190px;
}

@media (max-width: 640px) {
  .estimate-bottom-actions {
    display: block;
  }

  .estimate-bottom-actions__button {
    width: 100%;
  }
}


.project-tabs{display:flex;gap:8px;margin-bottom:24px;padding:5px;border:1px solid var(--border);border-radius:var(--radius-medium);background:var(--surface)}.project-tabs__button{flex:1;min-height:44px;padding:9px 16px;border:0;border-radius:var(--radius-small);color:var(--text-secondary);background:transparent;font-weight:800}.project-tabs__button.is-active{color:#fff;background:var(--accent)}
.material-catalog{margin-bottom:28px;padding:22px;border:1px solid var(--border);border-radius:var(--radius-medium);background:var(--surface);box-shadow:var(--shadow)}.material-catalog__header h3{margin-bottom:6px;font-size:22px}.material-catalog__eyebrow{margin-bottom:4px;color:var(--accent);font-size:12px;font-weight:700;letter-spacing:.08em;text-transform:uppercase}.material-catalog__notice{margin-bottom:0;color:var(--text-secondary);line-height:1.5}.material-catalog__filters{display:grid;grid-template-columns:minmax(240px,2fr) minmax(210px,1fr);gap:14px;margin-top:18px;margin-bottom:12px}.material-catalog__status{min-height:20px;margin-bottom:12px;color:var(--text-secondary);font-size:13px}.material-catalog__status--error{color:var(--danger)}.material-catalog__list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;max-height:460px;padding-right:4px;overflow-y:auto}.material-catalog-item{display:flex;align-items:center;justify-content:space-between;gap:14px;min-width:0;padding:14px;border:1px solid var(--border);border-radius:var(--radius-small)}.material-catalog-item__content{min-width:0}.material-catalog-item__category{display:block;margin-bottom:4px;color:var(--text-secondary);font-size:12px}.material-catalog-item__title{margin-bottom:5px;font-size:15px;overflow-wrap:anywhere}.material-catalog-item__meta{margin-bottom:0;color:var(--text-secondary);font-size:13px}.material-catalog-item__button{flex:0 0 auto;min-height:38px;padding:7px 12px}
.material-add-form{margin-bottom:22px;padding:20px;border:1px solid var(--border);border-radius:var(--radius-medium);background:var(--surface);box-shadow:var(--shadow)}.material-add-form__grid{display:grid;grid-template-columns:minmax(220px,2fr) 105px 115px 130px 150px auto;align-items:end;gap:12px}.material-add-form__button{white-space:nowrap}.material-table-card{overflow:hidden;border:1px solid var(--border);border-radius:var(--radius-medium);background:var(--surface);box-shadow:var(--shadow)}.material-table-scroll{overflow-x:auto}.material-table{width:100%;border-collapse:collapse}.material-table th,.material-table td{padding:12px 10px;border-bottom:1px solid var(--border);text-align:left;vertical-align:middle}.material-table th{color:var(--text-secondary);background:var(--surface-muted);font-size:12px;white-space:nowrap}.material-table__input,.material-table__select{width:100%;min-height:38px;padding:7px 8px;border:1px solid transparent;border-radius:6px;color:var(--text-primary);background:transparent;outline:none}.material-table__input:hover,.material-table__select:hover,.material-table__input:focus,.material-table__select:focus{border-color:var(--border);background:var(--surface)}.material-table__input--name{min-width:220px}.material-table__input--number{min-width:90px}.material-table__select{min-width:92px}.material-table__sum{min-width:125px;font-weight:800;white-space:nowrap}.material-table__actions{width:1%;white-space:nowrap}.material-table__delete{padding:7px 8px;border:0;color:var(--danger);background:transparent;font-weight:700}
.materials-summary{width:min(100%,620px);margin-left:auto;padding:18px 20px;background:var(--surface-muted)}.materials-summary__row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:18px;padding:7px 0}.materials-summary__row--profit{margin-top:6px;padding-top:12px;border-top:1px solid var(--border);font-size:17px}.materials-summary__value--negative{color:var(--danger)}
.project-total-card{display:grid;grid-template-columns:minmax(0,1fr) minmax(320px,520px);gap:24px;align-items:start;margin-top:28px;padding:22px;border:1px solid var(--border);border-radius:var(--radius-medium);background:var(--surface);box-shadow:var(--shadow)}.project-total-card h3{margin-bottom:0;font-size:23px}.project-total-card__eyebrow{margin-bottom:4px;color:var(--accent);font-size:12px;font-weight:700;letter-spacing:.08em;text-transform:uppercase}.project-total-card__rows{overflow:hidden;border:1px solid var(--border);border-radius:var(--radius-small)}.project-total-card__row{display:grid;grid-template-columns:1fr auto;gap:20px;padding:12px 14px;border-bottom:1px solid var(--border)}.project-total-card__row:last-child{border-bottom:0}.project-total-card__row--total{background:var(--surface-muted);font-size:20px;font-weight:800}.print-estimate{position:fixed;left:-20000px;top:0;width:686px;min-height:1px;background:#fff;z-index:-1}
@media(max-width:980px){.material-add-form__grid{grid-template-columns:minmax(220px,2fr) repeat(4,minmax(105px,1fr))}.material-add-form__button{grid-column:1/-1}.project-total-card{grid-template-columns:1fr}}@media(max-width:820px){.material-catalog__list{grid-template-columns:1fr}}@media(max-width:640px){.project-tabs{position:sticky;top:0;z-index:5}.material-catalog{padding:16px}.material-catalog__filters,.material-add-form__grid{grid-template-columns:1fr 1fr}.material-add-form__name,.material-add-form__button{grid-column:1/-1}.material-catalog-item{align-items:stretch;flex-direction:column}.material-catalog-item__button{width:100%}.material-table thead{display:none}.material-table,.material-table tbody,.material-table tr,.material-table td{display:block;width:100%}.material-table tr{padding:14px 16px;border-bottom:1px solid var(--border)}.material-table td{display:grid;grid-template-columns:110px minmax(0,1fr);align-items:center;gap:10px;padding:6px 0;border:0}.material-table td::before{content:attr(data-label);color:var(--text-secondary);font-size:12px;font-weight:700}.material-table__input--name,.material-table__input--number,.material-table__select,.material-table__sum{min-width:0}.material-table__actions{display:flex!important;justify-content:flex-end}.material-table__actions::before{display:none}.materials-summary{width:100%}}


.project-card__actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.project-card__duplicate {
  padding: 0;
  border: 0;
  color: var(--text-secondary);
  background: transparent;
  font-weight: 700;
}

.project-card__duplicate:hover {
  color: var(--accent);
}

.backup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.backup-card {
  display: flex;
  flex-direction: column;
  min-height: 360px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-medium);
  background: var(--surface);
}

.backup-card h3 {
  margin-bottom: 10px;
  font-size: 21px;
}

.backup-card p {
  color: var(--text-secondary);
  line-height: 1.5;
}

.backup-card > .button {
  margin-top: auto;
}

.backup-card__eyebrow {
  margin-bottom: 4px !important;
  color: var(--accent) !important;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.backup-file {
  display: block;
  margin: 4px 0 8px;
}

.backup-file input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.backup-file .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.backup-file__name {
  min-height: 20px;
  margin-bottom: 14px !important;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.backup-modes {
  display: grid;
  gap: 9px;
  margin: 0 0 16px;
  padding: 0;
  border: 0;
}

.backup-modes legend {
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 800;
}

.backup-modes label {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  cursor: pointer;
}

.backup-modes input {
  margin-top: 3px;
}

.backup-modes span {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.backup-modes small {
  color: var(--text-secondary);
  line-height: 1.35;
}

.backup-status {
  min-height: 22px;
  margin: 16px 0 0;
  color: var(--text-secondary);
}

.backup-status--error {
  color: var(--danger);
}

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

  .backup-card {
    min-height: 0;
  }

  .backup-card > .button {
    margin-top: 18px;
  }
}


.project-card__photo {
  position: relative;
  width: calc(100% + 40px);
  height: 150px;
  margin: -20px -20px 18px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-medium) var(--radius-medium) 0 0;
  background: var(--surface-muted);
}

.project-card__photo[hidden] {
  display: none;
}

.project-card__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.project-card__photo:hover img {
  transform: scale(1.025);
}

.project-card__photo-count {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 5px 9px;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(10, 18, 28, 0.76);
  font-size: 12px;
  font-weight: 800;
}

.project-photos {
  min-height: 300px;
}

.project-photos__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 12px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-medium);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.project-photos__header h3 {
  margin-bottom: 7px;
  font-size: 24px;
}

.project-photos__header p:last-child {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--text-secondary);
  line-height: 1.5;
}

.project-photos__eyebrow {
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-photos__upload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  cursor: pointer;
}

.project-photos__upload.is-disabled {
  cursor: wait;
  opacity: 0.65;
}

.project-photos__upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.project-photo-status {
  min-height: 22px;
  margin: 14px 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.project-photo-status--error {
  color: var(--danger);
}

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

.project-photo-card {
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-medium);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.project-photo-card__button {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-small);
  background: var(--surface-muted);
}

.project-photo-card__button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.project-photo-card__overlay {
  position: absolute;
  inset: auto 8px 8px;
  padding: 5px 8px;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(10, 18, 28, 0.72);
  font-size: 11px;
  font-weight: 800;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.project-photo-card__button:hover img {
  transform: scale(1.035);
}

.project-photo-card__button:hover .project-photo-card__overlay {
  opacity: 1;
}

.project-photo-card__caption {
  margin: 9px 2px 3px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.project-photo-card__date {
  margin-inline: 2px;
  color: var(--text-secondary);
  font-size: 11px;
}

.photo-viewer-dialog {
  width: min(100% - 24px, 1080px);
  max-height: calc(100vh - 24px);
  padding: 0;
  border: 0;
  border-radius: var(--radius-large);
  background: transparent;
}

.photo-viewer-dialog::backdrop {
  background: rgba(5, 10, 16, 0.86);
}

.photo-viewer {
  max-height: calc(100vh - 24px);
  padding: 20px;
  overflow-y: auto;
  border-radius: var(--radius-large);
  background: var(--surface);
}

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

.photo-viewer__header h2 {
  margin-bottom: 5px;
}

.photo-viewer__meta {
  margin-bottom: 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.photo-viewer__image-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  max-height: 64vh;
  overflow: hidden;
  border-radius: var(--radius-medium);
  background: #0b1016;
}

.photo-viewer__image {
  display: block;
  max-width: 100%;
  max-height: 64vh;
  object-fit: contain;
}

.photo-viewer__nav {
  position: absolute;
  z-index: 2;
  top: 50%;
  width: 48px;
  height: 64px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-small);
  color: #ffffff;
  background: rgba(0, 0, 0, 0.48);
  font-size: 42px;
  line-height: 1;
  transform: translateY(-50%);
}

.photo-viewer__nav:disabled {
  display: none;
}

.photo-viewer__nav--previous {
  left: 12px;
}

.photo-viewer__nav--next {
  right: 12px;
}

.photo-viewer__caption-field {
  margin-top: 16px;
}

.photo-viewer__actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

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

@media (max-width: 720px) {
  .project-photos__header {
    flex-direction: column;
  }

  .project-photos__upload {
    width: 100%;
  }

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

  .photo-viewer__actions {
    flex-direction: column-reverse;
  }

  .photo-viewer__actions .button {
    width: 100%;
  }
}

@media (max-width: 430px) {
  .project-photo-gallery {
    grid-template-columns: 1fr;
  }

  .photo-viewer {
    padding: 14px;
  }

  .photo-viewer__image-wrap,
  .photo-viewer__image {
    max-height: 56vh;
  }
}
