:root {
  color-scheme: light;
  font-family: 'DM Sans', 'Segoe UI', sans-serif;
  color: #1d1d1d;
  background: #edf9f0;
  --green: #2d7a4a;
  --green-dark: #123d32;
  --green-light: #edf9f0;
  --border: #d4ecdc;
  --muted: #606b65;
}

* { box-sizing: border-box; }
body { min-width: 320px; margin: 0; padding: 24px; background: #edf9f0; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.login-view { display: grid; min-height: calc(100vh - 48px); place-items: center; }
.login-card { width: min(440px, 100%); padding: 36px; border: 1px solid var(--border); border-radius: 18px; background: #fff; box-shadow: 0 12px 36px rgba(23, 86, 65, .12); }
.login-logo { display: block; width: 150px; height: auto; margin: 0 auto 24px; object-fit: contain; }
.login-card h1 { margin: 0 0 8px; color: var(--green-dark); font-size: 24px; text-align: center; }
.login-card > p { margin: 0 0 24px; color: var(--muted); text-align: center; }
.login-card form { display: grid; gap: 10px; }
.login-card label { margin-top: 6px; font-size: 14px; font-weight: 700; }
.login-card input { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; }
.primary-button, .secondary-button, .text-button { min-height: 40px; padding: 8px 14px; border-radius: 8px; font-weight: 700; }
.primary-button { border: 1px solid var(--green); background: var(--green); color: #fff; }
.primary-button:hover { background: #24633d; }
.secondary-button { border: 1px solid #8bd8a5; background: #edf9f0; color: var(--green); }
.secondary-button:hover { background: #e6f8eb; }
.text-button { border: 0; background: transparent; color: var(--green); }
.text-button:hover { text-decoration: underline; }
.login-message { min-height: 20px; margin: 0; color: #a3332d; font-size: 13px; }

.table-view { width: min(1600px, 100%); margin: 0 auto; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.page-header h1 { margin: 0 0 4px; color: var(--green-dark); font-size: clamp(24px, 4vw, 32px); }
.page-header p { margin: 0; color: var(--muted); }
.table-card { padding: 20px; border: 1px solid var(--border); border-radius: 16px; background: #fff; box-shadow: 0 4px 12px rgba(23, 86, 65, .08); }
.toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(220px, 320px) auto; gap: 10px; margin-bottom: 16px; }
.toolbar input, .toolbar textarea { width: 100%; min-width: 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; }
.toolbar textarea { resize: vertical; }
.top-scroll { height: 17px; margin-bottom: 4px; overflow-x: auto; overflow-y: hidden; border: 1px solid var(--border); border-radius: 8px; background: #f7fbf8; }
.top-scroll > div { height: 1px; }
.top-scroll:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.table-scroll { max-height: 62vh; overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
table { width: max-content; min-width: 2250px; table-layout: auto; border-collapse: collapse; font-size: 11px; }
th, td { padding: 7px 6px; border: 1px solid var(--border); text-align: center; vertical-align: middle; white-space: nowrap; overflow-wrap: normal; word-break: normal; }
th { position: sticky; top: 0; z-index: 1; background: var(--green-light); }
td:nth-child(13), td:nth-child(15) { white-space: pre; text-align: left; vertical-align: top; }
th:nth-child(1), td:nth-child(1) { width: 48px; }
th:nth-child(2), td:nth-child(2) { width: 36px; }
th:nth-child(3), td:nth-child(3) { width: 150px; }
th:nth-child(4), td:nth-child(4) { width: 75px; }
th:nth-child(5), td:nth-child(5) { width: 85px; }
th:nth-child(6), td:nth-child(6) { width: 100px; }
th:nth-child(7), td:nth-child(7) { width: 130px; }
th:nth-child(8), td:nth-child(8) { width: 175px; }
th:nth-child(9), td:nth-child(9) { width: 145px; }
th:nth-child(10), td:nth-child(10) { width: 100px; }
th:nth-child(11), td:nth-child(11) { width: 85px; }
th:nth-child(12), td:nth-child(12) { width: 155px; }
th:nth-child(13), td:nth-child(13), th:nth-child(15), td:nth-child(15) { width: 190px; }
th:nth-child(14), td:nth-child(14), th:nth-child(16), td:nth-child(16) { width: 100px; }
th:nth-child(17), td:nth-child(17) { width: 125px; }
th:nth-child(18), td:nth-child(18) { width: 80px; }
th:nth-child(19), td:nth-child(19) { width: 90px; }
th:nth-child(20), td:nth-child(20) { width: 70px; }
.record-select { width: 17px; height: 17px; accent-color: #d9534f; }
.download-button { min-height: 26px; padding: 4px 7px; border: 1px solid var(--green); border-radius: 5px; background: var(--green); color: white; font-size: 10px; font-weight: 700; white-space: nowrap; }
.table-pagination, .table-actions { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.table-pagination { justify-content: center; }
.table-actions { justify-content: flex-start; }
.table-actions input[type="date"] { min-height: 40px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px; }
.delete-button { min-height: 40px; padding: 8px 14px; border: 1px solid #f1a4a4; border-radius: 8px; background: #fff4f4; color: #b94141; font-weight: 700; }
.delete-button:disabled { cursor: not-allowed; opacity: .55; }
.table-status { min-height: 20px; margin: 12px 0 0; color: var(--muted); font-size: 13px; }

@media (max-width: 700px) {
  body { padding: 12px; }
  .login-card { padding: 24px 18px; }
  .page-header { align-items: flex-start; }
  .page-header .secondary-button { flex: 0 0 auto; }
  .table-card { padding: 12px; }
  .toolbar { grid-template-columns: 1fr; }
  .toolbar .secondary-button { width: 100%; }
  .table-actions { flex-wrap: wrap; }
  .table-actions label { flex-basis: auto; }
}
