/* General */
html, body {
  background-color: #f9f6ee;
  margin: 5px 0 5px 2px;
  padding: 5px 0 5px 2px;
  overflow: hidden;
  height: 100%;
}

:root {
  --footer-h: 48px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --footer-pad: max(var(--safe-bottom), 8px);
}

section {
  display: flex;
  flex-flow: column;
  height: calc(100vh - 20px);
  min-height: calc(100dvh - 20px);
  position: relative;
}

section::after {
  content: "";
  display: block;
  height: calc(var(--footer-h) + var(--footer-pad));
  flex: 0 0 auto;
}

.appHeader { flex: 0 0 auto; }

.tab-content {
  flex: 1 1 auto;
  overflow-y: scroll;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-bottom: 8px;
}

tr { cursor: default; }
.myBtn { width: 70px; }
.table { margin-bottom: 0; }

.tab-content table tbody tr > * { padding-top: .9rem; padding-bottom: .9rem; }
.tab-content table tbody tr:last-child td { border-bottom: 0; }

/* Toasts */
.cd-toasts {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 2147483646;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cd-toast {
  min-width: 260px;
  max-width: 360px;
  padding: 12px 14px;
  border-radius: 10px;
  color: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,.15);
  font: 500 14px/1.35 system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Arial;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  opacity: 0;
  transform: translateY(-6px);
  transition: .25s;
}
.cd-toast.show { opacity: 1; transform: translateY(0); }
.cd-toast .cd-msg { margin: 0; white-space: pre-wrap; }
.cd-toast button {
  appearance: none;
  border: 0;
  background: transparent;
  color: #fff;
  opacity: .9;
  cursor: pointer;
  margin-left: auto;
  font-size: 18px;
  line-height: 1;
}
.cd-toast-success { background: #16a34a; }
.cd-toast-error   { background: #dc2626; }
.cd-toast-info    { background: #2563eb; }
.cd-toast-warn    { background: #d97706; }

/* Tables */
#personnelTable thead th:nth-child(2),
#personnelTable thead th:nth-child(3),
#personnelTable thead th:nth-child(4),
#personnelTable thead th:nth-child(5),
#personnelTable tbody td:nth-child(2),
#personnelTable tbody td:nth-child(3),
#personnelTable tbody td:nth-child(4),
#personnelTable tbody td:nth-child(5) { display: table-cell; }

@media (max-width: 768px) {
  #personnelTable thead th:nth-child(2),
  #personnelTable thead th:nth-child(3),
  #personnelTable thead th:nth-child(4),
  #personnelTable thead th:nth-child(5),
  #personnelTable tbody td:nth-child(2),
  #personnelTable tbody td:nth-child(3),
  #personnelTable tbody td:nth-child(4),
  #personnelTable tbody td:nth-child(5) { display: none; }
}

/* Footer */
footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: #f9f6ee;
  min-height: var(--footer-h);
  padding-bottom: var(--footer-pad);
  border-top: 1px solid rgba(0,0,0,.1);
  z-index: 2147483645;
  text-align: center;
  font-weight: bold;
}
footer p { margin-bottom: 0; }

/* Fallback */
@supports not (min-height: 100dvh) {
  section { height: 100vh; }
}
