:root {
  --navy: #07182d;
  --navy-2: #0d2542;
  --blue: #1765ad;
  --blue-2: #0d4f90;
  --white: #ffffff;
  --ink: #13233a;
  --muted: #627084;
  --line: #dbe5f1;
  --surface: #f5f8fc;
  --soft-blue: #edf5fd;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

a {
  color: var(--blue);
}

.admin-header {
  background: var(--navy);
  color: var(--white);
  border-bottom: 4px solid var(--blue);
}

.admin-header__inner {
  width: min(1180px, calc(100% - 40px));
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.admin-brand {
  color: var(--white);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.admin-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-nav a {
  color: var(--white);
  text-decoration: none;
  font-weight: 700;
  padding: 8px 10px;
  border-radius: 6px;
}

.admin-nav a:hover {
  background: rgba(255, 255, 255, 0.12);
}

.admin-main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.page-title {
  margin-bottom: 22px;
}

.page-title h1,
.panel h1,
.print-header h1 {
  margin: 0 0 8px;
  color: var(--navy);
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.08;
}

h2 {
  margin: 0 0 14px;
  color: var(--navy);
  font-size: 20px;
}

p {
  margin: 0 0 12px;
}

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

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.panel,
.metric-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 36px rgba(7, 24, 45, 0.07);
}

.panel {
  padding: 22px;
}

.dashboard-panel {
  margin-bottom: 22px;
}

.panel-heading,
.page-actions,
.row-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.panel-heading {
  justify-content: space-between;
  margin-bottom: 16px;
}

.page-actions {
  margin-top: 16px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.metric-card {
  padding: 22px;
}

.metric-card span,
.field-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  margin-top: 6px;
  color: var(--navy);
  font-size: 36px;
  line-height: 1.1;
}

.metric-card__date {
  font-size: 18px !important;
}

.button,
button.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  padding: 10px 15px;
  background: var(--blue);
  color: var(--white);
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  background: var(--blue-2);
}

.button--secondary {
  background: var(--navy);
}

.button--small {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 13px;
}

.text-link {
  font-weight: 800;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--soft-blue);
  color: var(--navy);
  font-size: 12px;
  font-weight: 800;
}

.type-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 6px;
  background: #e9f7f0;
  color: #0d5132;
  font-size: 12px;
  font-weight: 800;
}

.notice-banner {
  margin-bottom: 16px;
  padding: 11px 12px;
  border: 1px solid #b8d7ff;
  border-radius: 6px;
  background: #eef6ff;
  color: var(--navy);
  font-weight: 800;
}

.filters {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}

.inline-form,
.note-row,
.status-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.note-row {
  margin-top: 8px;
}

.note-row input {
  min-width: 220px;
}

.note-form {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.notes-list,
.file-list {
  display: grid;
  gap: 10px;
}

.note-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfdff;
  padding: 12px;
}

.note-card strong {
  display: block;
  color: var(--navy);
  margin-bottom: 4px;
}

.note-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.pipeline-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(220px, 1fr));
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.pipeline-column {
  min-height: 280px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  padding: 14px;
}

.pipeline-column h2 {
  font-size: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.pipeline-card {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfdff;
}

.pipeline-card strong {
  color: var(--navy);
}

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

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

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
}

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

th {
  background: var(--soft-blue);
  color: var(--navy);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.detail-panel {
  display: grid;
  gap: 24px;
}

.detail-section {
  break-inside: avoid;
}

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

.field-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfdff;
}

.field-card strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(0, 103, 216, 0.18), rgba(0, 0, 0, 0) 42%),
    radial-gradient(circle at 50% 24%, rgba(23, 101, 173, 0.28), transparent 34%),
    #05070a;
}

.login-shell {
  width: min(460px, 100%);
  display: grid;
  gap: 18px;
  justify-items: center;
}

.login-logo {
  width: min(250px, 74vw);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 18px 36px rgba(0, 0, 0, 0.38));
}

.login-card {
  width: 100%;
  padding: 32px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}

.login-card h1 {
  margin: 0 0 8px;
  color: var(--navy);
  font-size: 34px;
  line-height: 1.05;
}

.login-card .eyebrow {
  color: var(--blue);
}

.login-card .button {
  width: 100%;
  min-height: 46px;
  margin-top: 4px;
}

label {
  display: block;
  margin-bottom: 14px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  margin-top: 5px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
}

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

.alert {
  margin: 16px 0;
  padding: 11px 12px;
  border: 1px solid #efb3b3;
  border-radius: 6px;
  background: #fff1f1;
  color: #8d1f1f;
  font-weight: 700;
}

.print-body {
  background: #eef3f8;
}

.print-toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  background: var(--navy);
  color: var(--white);
}

.print-toolbar div {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.print-page {
  width: min(920px, calc(100% - 32px));
  margin: 24px auto;
  padding: 34px;
  border: 1px solid var(--line);
  background: var(--white);
}

.print-header {
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 3px solid var(--blue);
}

@media (max-width: 800px) {
  .admin-header__inner,
  .admin-main {
    width: min(100% - 28px, 1180px);
  }

  .admin-header__inner {
    min-height: auto;
    padding: 16px 0;
    align-items: flex-start;
    flex-direction: column;
  }

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

  .panel {
    padding: 16px;
  }

  th,
  td {
    padding: 10px 9px;
  }

  .print-page {
    width: 100%;
    margin: 0;
    padding: 22px;
    border: 0;
  }
}

@media print {
  body,
  .print-body {
    background: var(--white);
  }

  .admin-header,
  .print-toolbar,
  .page-actions {
    display: none !important;
  }

  .admin-main,
  .print-page {
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
  }

  .panel {
    border: 0;
    box-shadow: none;
    padding: 0;
  }

  .detail-section,
  .field-card {
    break-inside: avoid;
  }

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

  @page {
    margin: 0.5in;
  }
}
