:root {
  color-scheme: light;
  font-family: Arial, Helvetica, sans-serif;
  background: #f4f7fb;
  color: #1d2733;
}

* { box-sizing: border-box; }
body { margin: 0; }

.shell {
  width: min(1240px, calc(100% - 32px));
  margin: 26px auto 60px;
}

.topbar,
.dashboard-title,
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar { margin-bottom: 22px; }

.top-actions,
.modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.eyebrow {
  margin: 0 0 6px;
  color: #52708f;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

h1, h2, h3 { margin: 0; }
h1 { font-size: 32px; }
h3 { margin-bottom: 14px; }

.panel,
.table-panel,
.stats div {
  background: #ffffff;
  border: 1px solid #dde7f0;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(29, 39, 51, 0.06);
}

.panel { padding: 18px; margin-bottom: 14px; }
.login-panel { max-width: 420px; padding: 24px; }

.form-grid {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }

label {
  display: grid;
  gap: 7px;
  font-weight: 700;
  color: #33465c;
}

input, select {
  height: 42px;
  border: 1px solid #c9d6e2;
  border-radius: 6px;
  padding: 0 12px;
  font: inherit;
  background: #ffffff;
  min-width: 0;
}

button {
  height: 40px;
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  background: #136f63;
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
}

button.ghost {
  background: transparent;
  color: #136f63;
  border: 1px solid #136f63;
}

button.small {
  height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.message {
  min-height: 22px;
  color: #a43b3b;
}

.hidden { display: none !important; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.stats div { padding: 18px; }
.stats span {
  display: block;
  font-size: 30px;
  font-weight: 900;
  color: #136f63;
}
.stats small { color: #52677d; font-weight: 800; }

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.tabs button {
  background: #e7eef5;
  color: #274158;
}

.tabs button.active {
  background: #136f63;
  color: #ffffff;
}

.table-panel {
  overflow: auto;
  padding: 0;
}

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

th, td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid #e8eef4;
  vertical-align: top;
  font-size: 14px;
}

th {
  background: #f8fafc;
  color: #43586f;
  font-size: 13px;
}

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 9px;
  background: #e8f4f1;
  color: #136f63;
  font-weight: 800;
  font-size: 12px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 30, 45, 0.48);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(1120px, 100%);
  height: min(820px, calc(100vh - 40px));
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(12, 24, 38, 0.28);
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

.modal-header {
  padding: 16px 18px;
  border-bottom: 1px solid #dce7f0;
  background: #f8fafc;
}

#printFrame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #ffffff;
}

@media (max-width: 900px) {
  .form-grid.three,
  .form-grid.four,
  .stats {
    grid-template-columns: 1fr;
  }

  .topbar,
  .dashboard-title,
  .modal-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .modal { padding: 8px; }
  .modal-panel { height: calc(100vh - 16px); }
}
