:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f3f6f9;
  color: #14213d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
}

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

button {
  border: 0;
  border-radius: 9px;
  background: #0b6b56;
  color: #fff;
  cursor: pointer;
  font-weight: 650;
  padding: 0.7rem 1rem;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

button.secondary {
  background: #e4ece9;
  color: #174b40;
}

button.ghost {
  background: transparent;
  color: #3b5266;
}

button.danger {
  background: #a52d38;
}

input,
select,
textarea {
  border: 1px solid #cbd5df;
  border-radius: 8px;
  background: #fff;
  color: #14213d;
  padding: 0.65rem 0.75rem;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 3px solid rgba(11, 107, 86, 0.22);
  outline-offset: 2px;
}

.shell {
  margin: 0 auto;
  max-width: 1500px;
  padding: 2rem;
}

.login-card {
  background: #fff;
  border: 1px solid #dbe3e8;
  border-radius: 16px;
  box-shadow: 0 16px 45px rgba(21, 45, 58, 0.09);
  margin: 8vh auto 0;
  max-width: 430px;
  padding: 2rem;
}

.login-card form {
  display: grid;
  gap: 0.75rem;
}

.eyebrow {
  color: #0b6b56;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  margin: 0 0 0.35rem;
}

h1,
h2 {
  margin: 0;
}

.muted {
  color: #607285;
}

.error {
  color: #a52d38;
  min-height: 1.3rem;
}

.topbar,
.section-heading,
.toolbar,
.pager,
.dialog-heading,
.dialog-actions,
.topbar-actions {
  align-items: center;
  display: flex;
  gap: 0.8rem;
}

.topbar,
.section-heading,
.dialog-heading {
  justify-content: space-between;
}

.topbar {
  border-bottom: 1px solid #dbe3e8;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
}

.section-heading {
  margin: 1rem 0;
}

.section-heading p {
  margin: 0.35rem 0 0;
}

.cards {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
}

.card {
  background: #fff;
  border: 1px solid #dbe3e8;
  border-left: 4px solid #0b6b56;
  border-radius: 10px;
  padding: 1rem;
}

.card-label {
  color: #607285;
  display: block;
  font-size: 0.8rem;
}

.card-value {
  display: block;
  font-size: 1.55rem;
  font-weight: 750;
  margin-top: 0.25rem;
}

.resource-section {
  margin-top: 2.3rem;
}

.toolbar {
  background: #fff;
  border: 1px solid #dbe3e8;
  border-radius: 10px;
  flex-wrap: wrap;
  padding: 0.85rem;
}

.toolbar label {
  color: #526577;
  font-size: 0.8rem;
  font-weight: 700;
}

.status {
  color: #526577;
  min-height: 1.4rem;
}

.table-wrap {
  background: #fff;
  border: 1px solid #dbe3e8;
  border-radius: 10px;
  overflow: auto;
}

table {
  border-collapse: collapse;
  min-width: 850px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid #edf1f3;
  max-width: 420px;
  overflow: hidden;
  padding: 0.7rem;
  text-align: left;
  text-overflow: ellipsis;
  vertical-align: top;
  white-space: nowrap;
}

th {
  background: #f7f9fa;
  color: #44596b;
  font-size: 0.78rem;
  text-transform: uppercase;
}

td.actions {
  display: flex;
  gap: 0.45rem;
}

td.actions button {
  font-size: 0.8rem;
  padding: 0.42rem 0.6rem;
}

.pager {
  justify-content: flex-end;
  margin-top: 0.8rem;
}

dialog {
  border: 0;
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(10, 28, 38, 0.3);
  max-height: 90vh;
  max-width: 760px;
  overflow: auto;
  padding: 0;
  width: min(760px, 94vw);
}

dialog::backdrop {
  background: rgba(13, 31, 41, 0.55);
}

#record-form {
  padding: 1.4rem;
}

.icon-button {
  font-size: 1.7rem;
  padding: 0.2rem 0.6rem;
}

.form-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 1.2rem;
}

.field {
  display: grid;
  gap: 0.35rem;
}

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

.field small {
  color: #6a7c8c;
}

.field textarea {
  min-height: 115px;
  resize: vertical;
}

.checkbox-field {
  align-items: center;
  display: flex;
  gap: 0.6rem;
}

.dialog-actions {
  justify-content: flex-end;
  margin-top: 1rem;
}

@media (max-width: 720px) {
  .shell {
    padding: 1rem;
  }

  .topbar,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

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