:root {
  --ink: #18332f;
  --muted: #5e6f6b;
  --accent: #08786d;
  --line: #dce5df;
  --canvas: #f3f6f3;
  --white: #fff;
  --danger: #9b2c26;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font: 15px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

button,.button {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  padding: 11px 17px;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
}

button:hover,.button:hover {
  background: #075b53;
}

button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible {
  outline: 3px solid #e9a735;
  outline-offset: 3px;
}

header {
  max-width: 1440px;
  margin: auto;
  padding: 24px 40px;
  display: flex;
  align-items: center;
  gap: 32px;
  border-bottom: 1px solid var(--line);
}

.brand {
  font-size: 26px;
  font-weight: 750;
  letter-spacing: -1px;
  text-decoration: none;
  color: var(--ink);
}

.brand span {
  display: block;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted);
}

nav {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}

nav a {
  font-weight: 600;
  text-decoration: none;
  font-size: 14px;
}

.identity {
  margin-left: auto;
  text-align: right;
  font-size: 12px;
  color: var(--muted);
}

.text-button {
  background: none;
  border: 0;
  color: var(--accent);
  padding: 3px 0;
  font-weight: 500;
  text-decoration: underline;
}

.text-button:hover {
  background: none;
  color: var(--ink);
}

.demo {
  background: #d8eee6;
  color: #15483e;
  text-align: center;
  padding: 9px 20px;
  font-size: 13px;
}

main {
  max-width: 1360px;
  margin: auto;
  padding: 32px 40px 60px;
  min-height: 70vh;
}

.page-heading {
  margin-bottom: 26px;
}

.eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.8px;
  color: var(--muted);
  margin: 0 0 8px;
}

h1 {
  font-size: 32px;
  letter-spacing: -.8px;
  line-height: 1.2;
  margin: 0;
}

h2 {
  font-size: 19px;
  letter-spacing: -.3px;
  margin: 0 0 15px;
}

h3 {
  font-size: 14px;
  margin: 18px 0 6px;
}

p {
  margin: 8px 0 18px;
}

.muted,.hint,small {
  color: var(--muted);
}

.hint {
  font-size: 12px;
  margin-top: 6px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  padding: 26px;
  margin: 20px 0;
}

.narrow {
  max-width: 720px;
}

.controls {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 12px;
  margin-bottom: 28px;
}

.control {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 9px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
}

.control strong {
  font-size: 30px;
  color: var(--ink);
}

.control span {
  font-size: 13px;
  color: var(--muted);
}

.toolbar {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin: 18px 0;
}

.toolbar>.button {
  white-space: nowrap;
  margin-left: auto;
}

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

.filters a {
  padding: 6px 10px;
  border-radius: 5px;
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
}

.filters a.selected {
  background: #dcece5;
  color: #095c50;
  font-weight: 650;
}

.table-panel {
  padding: 0;
  overflow: hidden;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th {
  padding: 13px 18px;
  font-size: 11px;
  letter-spacing: .4px;
  color: var(--muted);
  background: #f9fbf9;
  font-weight: 650;
}

td {
  padding: 18px;
  border-top: 1px solid var(--line);
  vertical-align: top;
  font-size: 13px;
}

td:first-child {
  min-width: 250px;
  width: 38%;
}

td small {
  display: block;
  margin-top: 4px;
  font-size: 11px;
}

.request-link {
  font-weight: 700;
  text-decoration: none;
}

.description-preview {
  margin-top: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 430px;
  word-break: break-word;
}

.badge {
  display: inline-block;
  border-radius: 5px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
  background: #e7eceb;
  color: #40564e;
}

.badge.new {
  background: #edf0fd;
  color: #4156a2;
}

.badge.in_progress {
  background: #d8eee7;
  color: #14624e;
}

.badge.waiting {
  background: #fff1cd;
  color: #785713;
}

.badge.done {
  background: #e4f1df;
  color: #416236;
}

.badge.cancelled {
  background: #f3e7e5;
  color: #8b5249;
}

.empty {
  padding: 46px;
  text-align: center;
  color: var(--muted);
}

.empty h2 {
  color: var(--ink);
}

label {
  display: block;
  font-size: 13px;
  font-weight: 650;
  margin: 18px 0 6px;
}

input:not([type=hidden]):not([type=checkbox]),textarea,select {
  display: block;
  width: 100%;
  border: 1px solid #b9c9c2;
  border-radius: 6px;
  background: #fff;
  padding: 10px 12px;
  color: var(--ink);
}

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

input[type=file] {
  font-size: 12px;
}

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

.actions {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-top: 24px;
}

.secondary-action {
  margin-top: 20px;
}

.check {
  font-weight: 400;
}

.check input {
  margin-right: 7px;
}

.role-list {
  display: grid;
  gap: 12px;
}

.role-button {
  background: #f7faf8;
  color: var(--ink);
  border: 1px solid var(--line);
  text-align: left;
  width: 100%;
  padding: 18px;
}

.role-button span {
  float: right;
  color: var(--accent);
}

.role-button:hover {
  background: #e9f4ed;
}

.alert,.success {
  border-radius: 8px;
  padding: 16px 20px;
  margin: 20px 0;
}

.alert {
  border: 1px solid #ebc2bc;
  background: #fff2ef;
  color: var(--danger);
}

.success {
  border: 1px solid #bddbca;
  background: #eaf6ee;
  color: #22573c;
}

.card-grid {
  display: grid;
  grid-template-columns: minmax(0,1.5fr) minmax(310px,1fr);
  gap: 22px;
}

.card-grid>.panel {
  margin-bottom: 0;
}

.section-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  font-size: 12px;
  margin-bottom: 20px;
}

.prose {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

dl {
  display: grid;
  grid-template-columns: 160px minmax(0,1fr);
  gap: 12px 20px;
  margin: 25px 0;
  font-size: 13px;
}

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

dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.result {
  background: #eff7f1;
  padding: 4px 18px 1px;
  border-radius: 6px;
}

.photo {
  max-width: 100%;
  max-height: 480px;
  border-radius: 7px;
  margin-top: 12px;
}

.delivery-note {
  border-top: 1px solid var(--line);
  margin-top: 25px;
  font-size: 12px;
}

.delivery-note p {
  margin: 6px 0;
}

.history>ol {
  list-style: none;
  padding: 0;
  margin: 0;
}

.history>ol>li {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.history .section-top {
  margin-bottom: 4px;
}

.history ul {
  padding-left: 20px;
  font-size: 13px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.history p {
  margin: 5px 0;
}

.messages li {
  padding: 15px;
  border-bottom: 1px solid var(--line);
}

.back {
  font-size: 13px;
  text-decoration: none;
}

footer {
  max-width: 1280px;
  margin: auto;
  padding: 24px 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  display: flex;
  justify-content: space-between;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
}

.skip {
  position: absolute;
  left: 10px;
  top: -60px;
  background: white;
  padding: 10px;
  z-index: 5;
}

.skip:focus {
  top: 10px;
}

@media(max-width:900px) {
  header {
    padding: 20px;
    flex-wrap: wrap;
    gap: 18px;
  }
  nav {
    order: 3;
    width: 100%;
    gap: 15px;
  }
  .identity {
    max-width: 180px;
  }
  main {
    padding: 26px 20px;
  }
  .controls {
    grid-template-columns: repeat(2,1fr);
  }
  .card-grid {
    grid-template-columns: 1fr;
  }
  .toolbar {
    flex-direction: column;
  }
  .toolbar>.button {
    margin-left: 0;
  }
  .panel {
    padding: 20px;
  }
  .table-panel {
    padding: 0;
  }
  footer {
    padding: 20px;
    gap: 20px;
  }
}

@media(max-width:480px) {
  h1 {
    font-size: 27px;
  }
  .brand span {
    display: none;
  }
  .form-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .control {
    padding: 12px;
    gap: 10px;
  }
  .control strong {
    font-size: 24px;
  }
  .control span {
    font-size: 11px;
  }
  dl {
    grid-template-columns: 1fr;
    gap: 3px;
  }
  dd {
    margin-bottom: 10px;
  }
  .actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }
}
