:root {
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  color: #172542;
  background: #f3f5fa;
  line-height: 1.5;
  font-synthesis: none;
  --blue: #3157c7;
  --line: #dce3ef;
  --muted: #54627a;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  background: var(--blue);
  color: #fff;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 0.7rem 1rem;
  min-height: 44px;
  font-weight: 650;
  cursor: pointer;
}
button:hover {
  filter: brightness(0.95);
}
button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}
button.secondary {
  background: #fff;
  color: #263d70;
  border-color: #c9d4e8;
}
button.danger {
  background: #fff;
  color: #a02031;
  border-color: #e2b5bc;
}
a {
  color: var(--blue);
}
:focus-visible {
  outline: 3px solid #d88a00;
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
h1,
h2,
p {
  margin-top: 0;
}
h1 {
  font-size: clamp(1.65rem, 4vw, 2.35rem);
  letter-spacing: -0.04em;
  line-height: 1.2;
  margin-bottom: 0.65rem;
}
h2 {
  font-size: 1.2rem;
  letter-spacing: -0.015em;
}
p {
  color: var(--muted);
}
.topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 1.25rem;
  font-weight: 750;
  color: #172542;
  text-decoration: none;
  white-space: nowrap;
}
.brand span {
  background: var(--blue);
  color: #fff;
  border-radius: 11px;
  padding: 0.4rem 0.7rem;
}
.topbar p {
  display: none;
  margin: 0;
}
.topbar button {
  margin-left: auto;
}
main {
  max-width: 1160px;
  margin: auto;
  padding: 1.5rem 1rem 3rem;
}
.login {
  max-width: 440px;
  margin: 7vh auto;
}
.login button {
  width: 100%;
  margin-top: 0.5rem;
}
.eyebrow {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  color: var(--blue);
  margin-bottom: 0.8rem;
}
nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 2rem;
}
.heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.heading p:last-child {
  margin: 0;
}
.card {
  padding: 1.2rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 15px;
  margin-bottom: 1.3rem;
  box-shadow: 0 5px 20px #1e335b04;
}
label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #33415c;
  margin-bottom: 1rem;
}
input,
select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #b9c6dc;
  border-radius: 8px;
  background: #fff;
  color: #172542;
  min-height: 44px;
}
.form-grid {
  display: grid;
  gap: 0 1.2rem;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 1rem 0;
}
.search {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-bottom: 1.25rem;
}
.search label {
  flex: 1;
  min-width: 190px;
  margin: 0;
}
.table-scroll {
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.92rem;
}
caption {
  text-align: left;
  color: var(--muted);
  padding: 0.7rem 0;
}
th,
td {
  padding: 1rem 0.65rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}
thead th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5a6982;
  background: #f7f9fc;
  white-space: nowrap;
}
td small {
  display: block;
  color: var(--muted);
  margin-top: 0.2rem;
}
.row-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.row-actions button {
  padding: 0.4rem 0.6rem;
  font-size: 0.8rem;
}
.badge {
  display: inline-block;
  font-size: 0.78rem;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  background: #edf1f8;
  color: #4d5b75;
}
.badge.active {
  background: #e5f6ee;
  color: #216044;
}
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 1rem;
}
.pager span {
  font-size: 0.8rem;
  color: var(--muted);
}
.notice {
  border: 1px solid #cad6ef;
  border-left: 4px solid var(--blue);
  border-radius: 10px;
  padding: 1rem 1.2rem;
  background: #edf2ff;
  margin-bottom: 1.3rem;
}
.notice p {
  font-size: 0.88rem;
  margin: 0.3rem 0 0;
}
.muted {
  font-size: 0.85rem;
}
.history {
  display: grid;
  gap: 0.6rem;
}
.history button {
  text-align: left;
  background: #f6f8fd;
  color: #21355b;
  border-color: var(--line);
}
progress {
  width: 100%;
  height: 12px;
  accent-color: var(--blue);
  margin: 0.5rem 0 1rem;
}
.site-footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  padding: 1.2rem;
}
#feedback:not(:empty) {
  padding: 0.9rem 1rem;
  background: #e8f5ee;
  border: 1px solid #a9d6bc;
  border-radius: 9px;
  margin-bottom: 1rem;
}
#feedback.error {
  background: #fff1f1;
  border-color: #e4b1b1;
  color: #8b202c;
}
.spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid #c6d0e8;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
}
.skip {
  position: absolute;
  top: -100px;
  left: 1rem;
  padding: 1rem;
  background: #fff;
  z-index: 2;
}
.skip:focus {
  top: 1rem;
}
.receipt {
  background: #fff;
  max-width: 850px;
  padding: 2rem;
  margin: 2rem auto;
  border: 1px solid var(--line);
}
.receipt header {
  border-bottom: 2px solid #172542;
  margin-bottom: 1.5rem;
}
.receipt td {
  white-space: nowrap;
}
.net {
  background: #edf2ff;
  padding: 1rem;
  margin-top: 1.3rem;
  font-size: 1.15rem;
  color: #172542;
}
.signature {
  margin-top: 3rem;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (min-width: 720px) {
  main {
    padding: 2rem 2rem 4rem;
  }
  .card {
    padding: 1.7rem;
  }
  .form-grid {
    grid-template-columns: 1fr 1fr;
  }
  .topbar p {
    display: block;
    border-left: 1px solid var(--line);
    padding-left: 1rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation: none;
  }
}
@media print {
  @page {
    size: A4;
    margin: 15mm;
  }
  body {
    background: #fff;
    color: #000;
    font-size: 10pt;
  }
  .no-print,
  .skip {
    display: none !important;
  }
  .receipt {
    border: 0;
    margin: 0;
    padding: 0;
    max-width: none;
  }
  .receipt p {
    color: #000;
  }
  .receipt table {
    font-size: 10pt;
  }
  .receipt th,
  .receipt td {
    padding: 3mm 2mm;
  }
  .receipt tr {
    break-inside: avoid;
  }
  .receipt header,
  .signature {
    break-inside: avoid;
  }
  .net {
    border: 1px solid #000;
    background: #fff;
  }
}
