* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f5f7fb;
  color: #0f172a;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 42px;
}

.shell.wide {
  width: min(1420px, calc(100% - 32px));
}

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

.head-actions {
  display: flex;
  align-items: stretch;
  gap: 12px;
}

.nav-link {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #cfd8e3;
  border-radius: 8px;
  background: #fff;
  color: #0f766e;
  font-weight: 800;
  padding: 0 16px;
  text-decoration: none;
  box-shadow: 0 14px 32px rgba(15, 23, 42, .04);
}

.nav-link:hover {
  background: #f8fafc;
}

.eyebrow {
  margin: 0 0 8px;
  color: #0f766e;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: #0f172a;
  font-size: 34px;
  line-height: 1.08;
  letter-spacing: 0;
}

.intro {
  margin: 10px 0 0;
  color: #52627a;
  max-width: 720px;
  line-height: 1.5;
}

.status-panel {
  min-width: 220px;
  border: 1px solid #dce3ec;
  border-radius: 8px;
  background: #fff;
  padding: 16px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, .06);
}

.status-panel span {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.status-panel strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
}

.contract-form {
  display: grid;
  gap: 16px;
}

.form-section {
  border: 1px solid #dce3ec;
  border-radius: 8px;
  background: #fff;
  padding: 20px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, .05);
}

.section-head {
  margin-bottom: 16px;
}

h2 {
  margin: 0;
  font-size: 18px;
  color: #111827;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px;
}

.lookup-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 14px;
  align-items: end;
}

.lookup-message {
  min-height: 20px;
  margin-top: 10px;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

.lookup-message.success {
  color: #0f766e;
}

.lookup-message.error {
  color: #b91c1c;
}

.field {
  display: grid;
  gap: 7px;
}

.field.wide {
  grid-column: 1 / -1;
}

.field span {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #cfd8e3;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  font: inherit;
  font-size: 14px;
  padding: 11px 12px;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .12);
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border: 1px solid #dce3ec;
  border-radius: 8px;
  background: #fff;
  padding: 16px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, .05);
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: #0f766e;
  color: #fff;
  font: inherit;
  font-weight: 800;
  padding: 0 18px;
  cursor: pointer;
}

button:hover {
  background: #0d5c56;
}

button.secondary {
  border: 1px solid #cfd8e3;
  background: #fff;
  color: #334155;
}

button.secondary:hover {
  background: #f8fafc;
}

.notice {
  border: 1px solid #67e8f9;
  border-radius: 8px;
  background: #ecfeff;
  color: #155e75;
  font-weight: 700;
  padding: 12px 14px;
  margin-bottom: 16px;
}

.log-panel {
  border: 1px solid #dce3ec;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(15, 23, 42, .05);
  overflow: hidden;
}

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

.log-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1180px;
}

.log-table th,
.log-table td {
  vertical-align: top;
  text-align: left;
  border-bottom: 1px solid #e5eaf0;
  padding: 13px 14px;
  font-size: 13px;
}

.log-table th {
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.log-table strong,
.log-table span {
  display: block;
}

.log-table span {
  color: #64748b;
  margin-top: 3px;
}

.inline-form,
.log-table form {
  margin: 0;
}

.status-select {
  min-width: 118px;
  padding: 8px 10px;
  font-weight: 800;
  text-transform: capitalize;
}

.status-select.definite {
  border-color: #99f6e4;
  background: #f0fdfa;
  color: #0f766e;
}

.status-select.tentative {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.small-btn {
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
  margin-bottom: 6px;
  width: 100%;
}

.secondary-mini {
  border: 1px solid #cfd8e3;
  background: #fff;
  color: #334155;
}

.secondary-mini:hover {
  background: #f8fafc;
}

.empty-state {
  padding: 34px;
  text-align: center;
}

.empty-state h2 {
  margin: 0 0 8px;
}

.empty-state p {
  margin: 0 auto 18px;
  max-width: 560px;
  color: #64748b;
}

@media (max-width: 760px) {
  .page-head {
    flex-direction: column;
  }

  .head-actions {
    width: 100%;
    flex-direction: column;
  }

  .status-panel {
    width: 100%;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .lookup-row {
    grid-template-columns: 1fr;
  }

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

  button {
    width: 100%;
  }
}
