:root {
  --ink: #111214;
  --muted: #5b5f66;
  --paper: #f6f2ee;
  --accent: #f4b04f;
  --accent-2: #e36d4c;
  --surface: #ffffff;
  --line: rgba(17, 18, 20, 0.12);
  --shadow: 0 16px 40px rgba(17, 18, 20, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: #f7f7f7;
  min-height: 100vh;
}

h1,
h2,
h3 {
  font-family: "Fraunces", serif;
  margin: 0 0 0.4rem;
}

p {
  margin: 0;
  color: #5b5f66;
  line-height: 1.5;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  margin-bottom: 16px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.7rem;
  color: var(--accent-2);
  font-weight: 600;
  margin-bottom: 12px;
}

.subhead {
  font-size: 1.05rem;
  max-width: 520px;
}

.panel {
  background: #ffffff;
  border: 1px solid #d9d9d9;
  padding: 10px;
  border-radius: 12px;
  box-shadow: none;
  display: grid;
  gap: 6px;
}

.table-panel {
  margin-top: 12px;
}

.file {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #111;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  justify-content: center;
}

.file.secondary {
  background: #f3f3f3;
  color: #111;
  border: 1px solid #cfcfcf;
}

.file input {
  display: none;
}

.controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 6px;
  align-items: end;
}

.controls label {
  display: grid;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #5b5f66;
}

.controls-secondary {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.hidden {
  display: none;
}

.hidden-inputs {
  display: none;
}

.state-label {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 4px 8px;
  border: 1px solid #cfcfcf;
  border-radius: 8px;
  background: #f7f7f7;
  color: #111;
  font-weight: 600;
}

.stats {
  display: grid;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px dashed #d9d9d9;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  align-items: center;
}

.stats-row.compact {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.stat {
  display: grid;
  gap: 4px;
  font-size: 0.8rem;
  color: #333;
}

.stat-label {
  font-weight: 600;
  color: #555;
}

.stat-value {
  font-size: 1rem;
  font-weight: 700;
}

.stat-diff {
  font-size: 0.75rem;
  color: #555;
}

.stat-note {
  font-size: 0.75rem;
  color: #666;
}

.scale-bar {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: #e5e5e5;
  overflow: visible;
}

.scale-bar.shifts {
  background: linear-gradient(
    to right,
    #d9534f 0%,
    #d9534f 42.86%,
    #f0ad4e 42.86%,
    #f0ad4e 57.14%,
    #5cb85c 57.14%,
    #5cb85c 71.43%,
    #5bc0de 71.43%,
    #5bc0de 85.71%,
    #d9534f 85.71%,
    #d9534f 100%
  );
}

.scale-bar.hours {
  background: linear-gradient(
    to right,
    #d9534f 0%,
    #d9534f 66.67%,
    #5bc0de 66.67%,
    #5bc0de 80%,
    #d9534f 80%,
    #d9534f 100%
  );
}

.scale-marker {
  position: absolute;
  top: -12px;
  width: 3px;
  height: 32px;
  background: #111;
  border-radius: 2px;
  box-shadow: 0 0 0 1px #ffffff;
}

.scale-marker.compare {
  background: #5bc0de;
}


select {
  padding: 4px 6px;
  border-radius: 8px;
  border: 1px solid #cfcfcf;
  background: #ffffff;
  color: #111;
  font-size: 0.8rem;
}

.segmented {
  display: flex;
  gap: 6px;
}

.segmented button {
  border: 1px solid #cfcfcf;
  background: #f3f3f3;
  color: #111;
  padding: 4px 8px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.75rem;
}

.radio-option {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
}

.radio-option input {
  margin: 0;
}

.segmented button.active {
  background: #111;
  color: #fff;
  border-color: #111;
}

.segmented button:disabled,
.segmented button.disabled {
  background: #efefef;
  color: #9a9a9a;
  border-color: #d5d5d5;
  cursor: not-allowed;
}

.status {
  font-size: 0.75rem;
  color: #5b5f66;
}

.status-block {
  display: grid;
  gap: 6px;
}

.status-row {
  display: grid;
  grid-template-columns: 80px 1fr 28px 28px;
  gap: 6px;
  align-items: center;
  font-size: 0.75rem;
  color: #5b5f66;
}

.status-label {
  font-weight: 600;
  color: #333;
}

.status-text {
  color: #5b5f66;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button {
  border: 1px solid #cfcfcf;
  background: #f5f5f5;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 0.8rem;
  line-height: 1;
}

.content {
  display: grid;
  gap: 16px;
  background: #ffffff;
  border-radius: 10px;
  padding: 12px;
  border: 1px solid #e2e2e2;
}

.location {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.location h2 {
  font-size: 1.05rem;
  margin-bottom: 6px;
  color: #111;
}

table.excel{
  border-collapse: collapse;
  width: 100%;
  font-family: Calibri, Arial, sans-serif;
  font-size: 13px;
  table-layout: fixed;
}

table.excel th,
table.excel td{
  padding: 2px 4px;
  white-space: nowrap;
  border: none;
  font-weight: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: box-shadow 120ms ease, background-color 120ms ease;
}

table.excel thead th{
  background: transparent;
  border-bottom: 1px solid #bfbfbf;
}

table.excel th:nth-child(1),
table.excel td:nth-child(1){ text-align: right; }

table.excel th:nth-child(2),
table.excel td:nth-child(2),
table.excel th:nth-child(3),
table.excel td:nth-child(3){ text-align: left; }

table.excel th:nth-child(n+4),
table.excel td:nth-child(n+4){ text-align: center; }

.dept-row td {
  background: #f7f7f7;
  font-weight: 600;
  text-align: left;
  padding: 3px 6px;
}

.th-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.th-filter {
  border: 1px solid #cfcfcf;
  background: #f3f3f3;
  border-radius: 6px;
  width: 20px;
  height: 20px;
  font-size: 0.7rem;
  cursor: pointer;
}

.th-filter.active {
  background: #dbeafe;
  border-color: #7aa7e0;
  color: #1f3b64;
}

.th-filter.active {
  background: #d7e9ff;
  border-color: #8db8f0;
  color: #1f4b87;
}

.filter-menu {
  position: absolute;
  z-index: 999;
  background: #ffffff;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  padding: 8px;
  min-width: 200px;
  max-height: 260px;
  overflow: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  font-size: 0.75rem;
}

.filter-title {
  font-weight: 600;
  margin: 6px 0 4px;
  color: #444;
}

.filter-option {
  display: flex;
  gap: 6px;
  align-items: center;
  margin: 2px 0;
}

.filter-btn {
  width: 100%;
  border: 1px solid #cfcfcf;
  background: #f3f3f3;
  border-radius: 6px;
  padding: 4px 6px;
  margin: 2px 0;
  text-align: left;
  cursor: pointer;
}

.filter-btn.active {
  background: #dbeafe;
  border-color: #7aa7e0;
  color: #1f3b64;
}

.filter-search {
  width: 100%;
  border: 1px solid #cfcfcf;
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 0.75rem;
  margin: 4px 0 6px;
}

.filter-list {
  display: grid;
  gap: 2px;
}

.filter-radio {
  display: grid;
  gap: 4px;
  margin-bottom: 6px;
}

.sort-toggle {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-bottom: 6px;
}
.filter-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

table.excel th:nth-child(1),
table.excel td:nth-child(1){ width: 36px; }

table.excel th:nth-child(2),
table.excel td:nth-child(2){ width: 190px; }

table.excel th:nth-child(3),
table.excel td:nth-child(3){ width: 130px; }

table.excel th:nth-child(n+4),
table.excel td:nth-child(n+4){ width: 110px; }

table.excel tbody tr:hover{
  background: #eaf3ff;
}

table.excel td.shift-cell,
table.excel td.compare-cell {
  overflow: visible;
}

.column-highlight {
  box-shadow: inset 0 0 0 9999px rgba(234, 243, 255, 0.2);
}

.shift {
  display: grid;
  gap: 1px;
  background: transparent;
  border-radius: 0;
  padding: 0;
  border: none;
  position: relative;
}

.util-bar {
  height: 2px;
  background: #e5e5e5;
  border-radius: 999px;
  margin-top: 2px;
  overflow: hidden;
}

.util-fill {
  display: block;
  height: 100%;
  background: #5bc0de;
}

.util-low {
  background: #d9534f;
}

.util-mid {
  background: #5cb85c;
}

.util-high {
  background: #5bc0de;
}

.util-over {
  background: #d9534f;
}

.stats-off .util-bar {
  display: none;
}

.stats-off .stats {
  display: none;
}

.shift .time {
  font-weight: normal;
  color: #111;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0 12px;
  box-sizing: border-box;
}

.shift-time-text {
  display: block;
  line-height: 1.1;
  text-align: center;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
}

.shift-accessory {
  position: absolute;
  top: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  min-height: 12px;
  gap: 2px;
  transform: translateY(-50%);
}

.shift-accessory-left {
  left: 0;
}

.shift-accessory-right {
  right: 0;
}

.shift-marker {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  line-height: 1;
  color: #111;
  transform: translateY(-0.02em);
  text-align: center;
  user-select: none;
  -webkit-user-select: none;
}

.off-cell {
  color: #111;
}

.shift-cell {
  color: #111;
}

.ob {
  background-color: #A6C9EC;
  color: #153D64;
}

.ib {
  background-color: #CEEED0;
  color: #285F17;
}

.compare-note {
  margin-top: 4px;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #666;
}

.compare-detail {
  margin-top: 2px;
  font-size: 0.7rem;
  color: #808080;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.compare-cell {
  position: relative;
  padding-left: 18px;
}

.shift-cell {
  position: relative;
}

.diff {
  background: #fff8d6;
}

.compare-icon {
  position: absolute;
  left: 4px;
  top: 4px;
  font-size: 0.75rem;
  line-height: 1;
  color: #6b6b6b;
}

.gap-icon {
  position: absolute;
  top: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #d33a2c;
  color: #fff;
  cursor: help;
  vertical-align: middle;
  flex: 0 0 auto;
  z-index: 4;
}

.gap-icon::before {
  content: "!";
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 1;
}

.gap-icon::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  min-width: 170px;
  max-width: 220px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(17, 18, 20, 0.96);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1.4;
  white-space: pre-line;
  text-align: left;
  box-shadow: 0 10px 28px rgba(17, 18, 20, 0.22);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 120ms ease, transform 120ms ease;
  z-index: 20;
}

.gap-icon[data-side="before"]::after {
  left: 0;
}

.gap-icon[data-side="after"]::after {
  right: 0;
}

.gap-icon[data-side="before"] {
  left: -4px;
  transform: translate(-50%, -50%);
}

.gap-icon[data-side="after"] {
  right: -4px;
  transform: translate(50%, -50%);
}

.gap-icon:hover::after,
.gap-icon:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.empty {
  text-align: center;
  padding: 60px 16px;
  background: #ffffff;
  border-radius: 16px;
  border: 1px dashed #cfcfcf;
  color: #5b5f66;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }
}
