body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
  background: #0b1020;
  color: #f5f5f5;
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: 0.5rem;
  z-index: 1000;
  padding: 0.35rem 0.6rem;
  border: 1px solid #4b8cff;
  background: #0b1020;
  color: #9cf;
  text-decoration: none;
  transform: translateY(-160%);
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #8ab4f8;
  outline-offset: 2px;
}

header {
  background: #141a33;
  border-bottom: 1px solid #242a44;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

header h1 {
  font-size: 1.1rem;
  margin: 0;
}

nav a {
  margin-right: 1rem;
  color: #9cf;
  text-decoration: none;
  font-size: 0.9rem;
}

nav a:last-child {
  margin-right: 0;
}

nav a:hover {
  text-decoration: underline;
}

main {
  padding: 1.5rem;
}

.card {
  background: #141a33;
  border: 1px solid #242a44;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.field {
  margin-bottom: 0.75rem;
  display: flex;
  flex-direction: column;
}

.field.inline {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

label {
  font-size: 0.85rem;
  margin-bottom: 0.2rem;
  color: #c7d0ff;
}

input, button {
  font: inherit;
}

input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea {
  padding: 0.3rem 0.4rem;
  border-radius: 4px;
  border: 1px solid #313959;
  background: #0b1020;
  color: #f5f5f5;
}

button {
  margin-top: 0.5rem;
  padding: 0.4rem 0.9rem;
  border-radius: 4px;
  border: 1px solid #4b8cff;
  background: #2b3a70;
  color: #f5f5f5;
  cursor: pointer;
}

button:hover {
  background: #3654a0;
}

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

.result h2 {
  margin-top: 0;
}

.notes {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #a0a9d5;
}

.info {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 6px;
  color: #888;
  font-size: 13px;
  font-weight: normal;
  line-height: 14px;
  text-align: center;
  cursor: help;
  user-select: none;
  position: relative;
}

/* Beautiful tooltip on hover */
.info:hover::after {
  content: attr(title);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 120%;
  background: #333;
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  white-space: pre-line;
  z-index: 1000;
  width: max-content;
  max-width: 280px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  pointer-events: none;
}

.info:hover::before {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 110%;
  border: 6px solid transparent;
  border-top-color: #333;
  z-index: 1000;
}

/* ===== Employees Excel Grid ===== */
.employees-card { padding: 12px 12px 10px; }
.employees-form { margin: 0; }

.gridbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.gridbar__title {
  font-weight: 700;
  letter-spacing: .2px;
}
.gridbar__meta { display: flex; gap: 8px; align-items: center; }
.gridbar__right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.badge {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid #313959;
  background: rgba(255,255,255,.04);
  font-size: 12px;
  margin-left: 6px;
}

.gridpager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.gridpager__status { font-size: 12.5px; }

.mini {
  height: 30px;
  padding: 5px 8px;
  border-radius: 7px;
  border: 1px solid #242a44;
  background: #0b1020;
  color: inherit;
  outline: none;
  font-size: 13px;
}
.mini:focus { border-color: #313959; box-shadow: 0 0 0 2px rgba(49,57,89,0.35); }
.mini.num { text-align: right; width: 74px; font-variant-numeric: tabular-nums; }

.btn { height: 30px; padding: 0 10px; border-radius: 7px; }
.btn--primary { font-weight: 650; }

.grid-wrap {
  border: 1px solid #242a44;
  border-radius: 0;
  overflow: auto;
  background: transparent;
  max-height: calc(100dvh - 260px);
}

/* Table */
.grid.excel {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
  line-height: 1.2;
  min-width: 1650px;
}
.grid.excel th,
.grid.excel td {
  padding: 6px 8px;
  border-right: 1px solid #242a44;
  border-bottom: 1px solid #242a44;
  white-space: nowrap;
  vertical-align: middle;
}
.grid.excel th:last-child,
.grid.excel td:last-child { border-right: 0; }

.grid.excel thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #0b1020;
}
.grid.excel thead tr.filters th {
  top: 32px; /* fixed header row height */
  z-index: 6;
  background: #090f1e;
}

/* Sticky first 2 columns */
.grid.excel .sticky.c1 {
  position: sticky;
  left: 0;
  z-index: 8;
  background: inherit;
  box-shadow: 1px 0 0 #242a44;
}
.grid.excel .sticky.c2 {
  position: sticky;
  left: 110px; /* must match .col-empnr width */
  z-index: 8;
  background: inherit;
  box-shadow: 1px 0 0 #242a44;
}

/* Header sort buttons */
.grid.excel th .sort {
  all: unset;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  font-weight: 650;
  padding: 6px 6px;
  width: 100%;
}
.grid.excel th .sort:hover { background: rgba(255,255,255,.03); border-radius: 6px; }
.grid.excel th .arrow { opacity: .65; font-size: 11px; }

/* Filter row inputs */
.grid.excel .f {
  width: 100%;
  height: 26px;
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px solid #242a44;
  background: #0b1020;
  color: inherit;
  outline: none;
  font-size: 12.5px;
}
.grid.excel .f:focus { border-color: #313959; box-shadow: 0 0 0 2px rgba(49,57,89,0.35); }
.grid.excel .f.num { text-align: right; font-variant-numeric: tabular-nums; }

.row:hover td { background: rgba(255,255,255,.035); }
.muted { opacity: .78; }
.sep { opacity: .35; }
.mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; }
.num { text-align: right; }

.notes {
  max-width: 520px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cell-ellipsis {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.empty { padding: 14px 10px; text-align: center; opacity: .85; }

.toast-banner {
  display: none;
  margin-top: 0.6rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid #2f4f8e;
  background: #12214a;
  color: #dce7ff;
  border-radius: 4px;
}

.toast-banner.is-visible {
  display: block;
}

/* Column widths (keep in sync with sticky offsets) */
.col-empnr { width: 110px; }
.col-name  { width: 240px; }
.col-fac   { width: 110px; }
.col-inst  { width: 210px; }
.col-lead  { width: 170px; }
.col-role  { width: 220px; }
.col-pct   { width: 70px; }
.col-perm  { width: 70px; }
.col-base  { width: 96px; }
.col-age   { width: 70px; }
.col-out   { width: 86px; }
.col-notes { width: 520px; }
