/* Reset */
html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  overflow: hidden;
}

/* Filters */
#filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;

  padding: 10px;
  background-color: white;
  border-bottom: 1px solid #ccc;
}

#auth-bar {
  margin-left: auto;     /* pushes it all the way to the right */
  display: flex;
  align-items: center;
  gap: 8px;
}

#auth-user {
  color: #444;
  font-size: 13px;
}

#auth-logout {
  font-size: 12px;
  padding: 2px 6px;
  cursor: pointer;
}

/* Scrollable container below filters */
.table-wrapper {
  position: absolute;
  top: 40px; /* Height of filters */
  bottom: 0;
  left: 0;
  right: 0;
  overflow-y: auto;
}

/* Layout for fixed + scrollable tables */
.table-container {
  display: flex;
  max-width: 100%;
  overflow-x: hidden; /* prevent a second horizontal scrollbar */
}

.fixed-columns,
.scrollable-columns {
  display: inline-block;
}

.fixed-columns {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 3;
  background-color: white;
}

.scrollable-columns {
  overflow-x: auto; /* the only place with horizontal scroll */
  position: relative;
  max-width: 100%;
}

/* Table structure */
table {
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  border: 1px solid #ccc;
  padding: 6px 10px;
  text-align: center;
  white-space: nowrap;
}

/* ✅ Sticky header support */
.fixed-columns thead,
.scrollable-columns thead {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: #f0f0f0;
  border-bottom: 1px solid #ccc;
}

.fixed-columns thead th,
.scrollable-columns thead th {
  position: sticky;
  top: 0;
  background-color: #d9ead3;
  z-index: 5;
}

/* Header label formatting */
.header-label {
  font-weight: bold;
  line-height: 1.2;
}

.sub-label {
  font-weight: normal;
  font-size: 11px;
  line-height: 1;
}

.header-row {
  height: 46px;
}

/* Highlighted rows and sections */
.section-header {
  background-color: #fac78d;
  font-weight: bold;
  text-align: center;
}

.month-cell {
  background-color: #e6f2ff;
}

.current-month {
  background-color: #b3d1ff !important;
  font-weight: bold;
  color: #003366;
}

.current-month-marker {
  position: absolute;
  top: 0;
  height: 100%;
  width: 2px;
  background-color: #007bff;
  z-index: 10;
}

.hidden-group {
  display: none;
}

.ex-consultant-row {
  background-color: #eeecec;
}

.ex-consultant-header {
  background-color: #d9d9d9;
  font-weight: bold;
  text-align: center;
}

/* Sticky button */
.goto-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 10px 14px;
  font-size: 14px;
  z-index: 1000;
}

.ex-header-cell {
  background-color: #d9d9d9;
  font-weight: bold;
  text-align: center;
}

#dynamic-months-header th {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: #f9f9f9;
}

/* === Column widths === */

/* Fixed/info columns: auto width (let content decide) */
.fixed-columns table {
  table-layout: auto;
}

/* Scrollable months: fixed layout, controlled by CSS */
.scrollable-columns table {
  table-layout: fixed;
  width: 100%;
  box-sizing: border-box;
}

/* Only month columns get hard widths */
.scrollable-columns th.month-cell,
.scrollable-columns td.month-cell {
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* highlight the consultant's working period (start → today) */
.month-cell.working {
  background-color: #e6f7e9; /* soft green */
}

/* range borders */
.month-cell.range-start {
  border-left: 2px solid #2db47c;
}

.month-cell.range-end {
  border-right: 2px solid #2db47c;
}

/* optional: make the text stand out slightly */
.month-cell.working {
  font-weight: 500;
}
.month-cell.agr-red {
  background-color: #ffd6d6 !important; /* soft red */
}

.month-cell.agr-grey {
  background-color: #ececec !important; /* distinct grey (not same as ex-consultants) */
}
/* Country / Position column (3rd column on the fixed side) */
.fixed-columns thead th:nth-child(4),
#fixed-body tr td:nth-child(4),
#fixed-body tr.section-header td:nth-child(4) {
  width: 170px !important;
  min-width: 170px !important;
  max-width: 170px !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fixed-columns .onb-col {
  width: 20px !important;
  min-width: 20px !important;
  max-width: 20px !important;
  text-align: center;
  padding: 0;
}

.onb-link {
  display: inline-block;
  text-decoration: none;
  font-weight: bold;
  line-height: 1;
}
.onb-col {
  text-align: center;
  font-size: 14px;
  color: #000;
  vertical-align: middle;
}
.timeline-link {
  color: #000;
  text-decoration: underline;
  text-decoration-color: #999;
  text-underline-offset: 2px;
  cursor: pointer;
}
.timeline-link:hover {
  text-decoration-color: #333;
}
.timeline-currency {
  color: #275683;
  font-weight: 500;
}

.hidden-ex { display: none !important; }
.ex-header-cell { cursor: pointer; user-select: none; }

/* Make timeline grey for ex-consultants */
.scrollable-columns tr.ex-consultant-row td.month-cell {
  background-color: #eeecec !important;
}

/* Override working-period green for ex-consultants */
.scrollable-columns tr.ex-consultant-row td.month-cell.working {
  background-color: #eeecec !important;
}

/* Override agreement colors for ex-consultants */
.scrollable-columns tr.ex-consultant-row td.month-cell.agr-red,
.scrollable-columns tr.ex-consultant-row td.month-cell.agr-grey {
  background-color: #eeecec !important;
}
