:root {
  --ink: #17201d;
  --muted: #69756f;
  --brand: #21624f;
  --brand-dark: #15483b;
  --brand-hover: var(--brand-dark);
  --accent: #d99b45;
  --paper: #ffffff;
  --canvas: #f1f4f1;
  --line: #dce5df;
  --blue: #315e83;
  --danger: #9e472d;
  --danger-soft: #fff3ef;
  --success-soft: #eef7f2;
  --shadow: 0 10px 28px rgba(23,45,37,.08);
  --content-overlap: 22px;
  --content-width: 1100px;
  --panel-gap: 20px;
  --panel-padding: 22px;
  --panel-radius: 22px;
  --control-height: 47px;
  --control-radius: 13px;
}

.section.communications .icon {
  color: #76538f;
  background: #f4eef8;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

html {
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas) radial-gradient(circle at 92% 8%, rgba(217,155,69,.12), transparent 56%) fixed;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
}

button,
input,
textarea,
select {
  font: inherit;
}

input[type="search"]::-webkit-search-cancel-button {
  display: none;
  -webkit-appearance: none;
  appearance: none;
}

input[type="search"]::-ms-clear {
  display: none;
  width: 0;
  height: 0;
}

button,
a,
label {
  touch-action: manipulation;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.app-header {
  padding: max(18px, env(safe-area-inset-top)) 22px 44px;
  color: #ffffff;
  background: linear-gradient(135deg, #142c25 0%, var(--brand) 58%, #315d4e 100%);
}

.header-inner,
.workspace {
  width: min(var(--content-width), 100%);
  margin: 0 auto;
}

.app-header + .workspace,
.app-header + .content {
  position: relative;
  z-index: 1;
  margin-top: calc(-1 * var(--content-overlap));
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 40px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 12px;
  color: #ffffff !important;
  background: rgba(255,255,255,.09);
  text-decoration: none;
  font-size: 14px;
  font-weight: 650;
  text-shadow: none !important;
}

.nav-btn:hover,
.nav-btn:focus {
  color: #ffffff !important;
  background: rgba(255,255,255,.15);
  outline: none;
}

.page-heading {
  margin-top: 34px;
}

.eyebrow {
  margin: 0 0 7px;
  color: #c7d9d1;
  font-size: 14px;
}

.page-heading h1 {
  margin: 0;
  font-size: clamp(27px, 5vw, 44px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.035em;
}

.app-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.app-status {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.app-status-created {
  color: #315e83;
  background: #e9f2f8;
}

.app-status-posted {
  color: #236040;
  background: #e5f4eb;
}

.subtitle {
  margin: 11px 0 0;
  color: #d4e0dc;
}

.app-workspace {
  padding: 0 22px max(38px, env(safe-area-inset-bottom));
}

.app-panel {
  margin-bottom: var(--panel-gap);
  padding: var(--panel-padding);
  border: 1px solid rgba(223,230,225,.9);
  border-radius: var(--panel-radius);
  background: rgba(255,255,255,.97);
  box-shadow: var(--shadow);
}

.app-panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 17px;
}

.app-panel-title h2 {
  margin: 0;
  font-size: 19px;
}

.app-subtle {
  color: var(--muted);
  font-size: 13px;
}

.app-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 12px;
}

.app-info-card {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfcfb;
}

.app-label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.app-value {
  font-size: 15px;
  font-weight: 750;
  line-height: 1.35;
}

.app-value.app-value-total {
  color: var(--brand);
  font-size: 23px;
}

.app-tabs {
  display: flex;
  gap: 8px;
  margin: -2px -2px 16px;
  padding: 2px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.app-tabs-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
}

.app-tab {
  min-height: 40px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: #ffffff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
}

.app-tab.active {
  border-color: var(--brand);
  color: #ffffff;
  background: var(--brand);
}

.app-control {
  width: 100%;
  height: var(--control-height);
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  color: var(--ink);
  background: #f9fbfa;
  outline: none;
}

.app-control:focus {
  border-color: #8eaa9e;
  box-shadow: 0 0 0 3px rgba(33,98,79,.09);
}

textarea.app-control {
  height: 92px;
  padding: 12px;
  resize: vertical;
}

.app-button {
  min-height: 47px;
  padding: 0 16px;
  border-radius: 13px;
  cursor: pointer;
  font-weight: 800;
}

.app-button-primary {
  border: 1px solid var(--brand);
  color: #ffffff;
  background: var(--brand);
}

.app-button-primary:hover,
.app-button-primary:focus-visible {
  background: var(--brand-hover);
}

.app-button-secondary {
  border: 1px solid #afc2b9;
  color: var(--brand);
  background: #ffffff;
}

.app-button-danger {
  border: 1px solid #e1b4a5;
  color: var(--danger);
  background: #ffffff;
}

.app-upload {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 8px;
  padding: 10px 8px;
  border: 1px dashed #afc2b9;
  border-radius: 13px;
  color: var(--brand);
  background: #f5f9f7;
  cursor: pointer;
  text-align: center;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.3;
}

.app-file-list {
  display: grid;
  gap: 8px;
}

.app-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: inherit;
  background: #fbfcfb;
  text-decoration: none;
}

.app-file-name {
  min-width: 0;
  overflow: hidden;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-file-type {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
}

.app-upload-file {
  display: flex;
  align-items: stretch;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfb;
}

.app-upload-file-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  flex: 1;
  padding: 11px 12px;
  color: inherit;
  text-decoration: none;
}

.app-upload-file-main:not([href]) {
  cursor: default;
}

.app-upload-file-delete {
  flex: 0 0 44px;
  border: 0;
  border-left: 1px solid var(--line);
  color: var(--danger);
  background: #ffffff;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.app-upload-file-delete:hover,
.app-upload-file-delete:focus-visible {
  background: var(--danger-soft);
}

.app-footer {
  padding: 5px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

@media (max-width: 640px) {
  .app-header {
    padding: max(14px, env(safe-area-inset-top)) 16px 38px;
  }

  .nav-btn {
    width: 42px;
    height: auto;
    min-width: 42px;
    min-height: 40px;
    padding: 0;
    border-radius: 12px;
  }

  .nav-btn .nav-text,
  .nav-btn .home-text {
    display: none;
  }

  .page-heading {
    margin-top: 31px;
  }
}

@media (max-width: 540px) {
  .app-title-row {
    gap: 8px;
  }

  .app-status {
    padding: 5px 8px;
  }

  .app-workspace {
    padding: 0 8px 28px;
  }

  .app-panel {
    margin-bottom: 12px;
    padding: 16px 12px;
    border-radius: 17px;
  }

  .app-panel-title {
    align-items: flex-start;
    margin-bottom: 14px;
  }

  .app-panel-title h2 {
    font-size: 18px;
  }

  .app-panel-title .app-subtle {
    max-width: 45%;
    text-align: right;
    font-size: 11px;
  }

  .app-info-grid {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .app-info-card {
    padding: 13px;
    border-radius: 14px;
  }

  .app-value.app-value-total {
    font-size: 20px;
  }

  .app-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    margin: 0 0 14px;
    padding: 0;
    overflow: visible;
  }

  .app-tabs-grid {
    grid-template-columns: 1fr 1fr;
  }

  .app-tab {
    min-width: 0;
    padding: 10px 7px;
    white-space: normal;
    overflow-wrap: anywhere;
    font-size: 12px;
  }

  .app-button {
    min-height: 50px;
  }

  .app-file {
    align-items: flex-start;
    padding: 10px;
  }

  .app-file-name {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .app-file-type {
    padding-top: 2px;
  }

  .app-upload {
    min-height: 46px;
  }

  .app-footer {
    padding-top: 10px;
  }
}

/* Approved controls from Installation templates. */
.field { min-width: 0; }
.field label { display: block; margin: 0 0 7px; color: var(--muted); font-size: 13px; font-weight: 700; }
.field input, .search-control input {
  width: 100%; height: 47px; margin: 0; padding: 0 13px; border: 1px solid var(--line) !important;
  border-radius: 13px !important; background: #f9fbfa !important; box-shadow: none !important; color: var(--ink); font: inherit;
}
.field input:focus, .search-control input:focus { border-color: #9fb7ad !important; outline: none; background: #fff !important; }
.job-card { margin-bottom: 11px; border: 1px solid var(--line); border-radius: 17px; background: var(--paper); overflow: hidden; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.job-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 12px; }
.job-number { font-size: 16px; font-weight: 800; }
.status { display: inline-flex; padding: 4px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; }
.status-payment-pending { color: #815514; background: #fff2dd; }
.status-paid { color: #286044; background: #e7f4ec; }
.action{min-height:47px;padding:0 16px;border-radius:13px;cursor:pointer;font-weight:800}
.save{border:1px solid #afc2b9;color:var(--brand);background:#fff}
.finish{border:0;color:#fff;background:var(--brand)}
