:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #172033;
  --muted: #6b7280;
  --border: #dfe5ef;
  --primary: #2cb1cc;
  --primary-dark: #178da5;
  --sync: #405cf5;
  --sync-dark: #2f45c7;
  --shadow: 0 18px 45px rgba(23, 32, 51, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  scrollbar-gutter: stable;
  overflow-y: scroll;

  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  min-height: 100vh;

  background:
    radial-gradient(circle at top left,
        rgba(44,177,204,.16),
        transparent 38%),

    radial-gradient(circle at bottom left,
        rgba(44,177,204,.12),
        transparent 35%),

    radial-gradient(circle at top right,
        rgba(44,177,204,.08),
        transparent 40%),

    linear-gradient(135deg,
        #f7fbff 0%,
        var(--bg) 100%);
}

.page {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 54px 0;
}

.hero {
  background: linear-gradient(135deg, #172033 0%, #22304a 100%);
  color: white;
  border-radius: 28px;
  padding: 42px;
  margin-bottom: 28px;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 10px;
  color: #9ee8f4;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(36px, 5vw, 58px);
  line-height: 1;
}

.subtitle {
  max-width: 720px;
  margin: 18px 0 0;
  color: #d7deea;
  font-size: 17px;
  line-height: 1.6;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}

.panel {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: 26px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.panel-header {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 22px;
}

.icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  background: #eef7fa;
  border-radius: 16px;
  font-size: 24px;
}

h2 {
  margin: 0;
  font-size: 24px;
}

.panel-header p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.4;
}

.button-list {
  display: grid;
  gap: 14px;
}

.action-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
}

.primary-btn,
.secondary-btn {
  border: 0;
  border-radius: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.primary-btn {
  width: 100%;
  min-height: 48px;
  padding: 13px 18px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--primary);
  font-size: 15px;
  text-align: left;
  box-shadow: 0 8px 20px rgba(44, 177, 204, 0.10);
}

.primary-btn:hover {
  background: #ffffff;
  color: var(--primary-dark);
  transform: translateY(-1px);
}

.primary-btn.sync {
  background: rgba(255, 255, 255, 0.92);
  color: var(--primary);
  box-shadow: 0 8px 20px rgba(64, 92, 245, 0.10);
}

.primary-btn.sync:hover {
  background: #ffffff;
  color: var(--primary-dark);
}

.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 16px;
  background: white;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
  width: 110px;
}

.secondary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(23, 32, 51, 0.08);
}

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

@media (max-width: 560px) {
  .page {
    width: min(100% - 24px, 1180px);
    padding: 24px 0;
  }

  .hero,
  .panel {
    padding: 24px;
    border-radius: 22px;
  }

  .action-card {
    grid-template-columns: 1fr;
  }

  .primary-btn {
    text-align: center;
  }
}

.status-window {
  background: rgba(8, 12, 18, 0.35);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.status-window-header {
  background: rgba(44,177,204,0.15);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 12px 18px;
  font-weight: 700;
  backdrop-filter: blur(8px);
}

.status-window.idle .status-window-header {
  background: rgba(255,255,255,0.08);
}

.status-window.running .status-window-header {
  background: rgba(255, 193, 7, 0.14);
}

.status-window.success .status-window-header {
  background: rgba(68, 201, 130, 0.14);
}

.status-window.failure .status-window-header {
  background: rgba(255, 105, 97, 0.14);
}

.status-grid {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 8px 16px;
  padding: 18px;
}

.status-grid .label {
  opacity: 0.65;
  font-weight: 600;
}

.status-divider {
  border-top: 1px solid rgba(255,255,255,0.08);
}

.status-progress {
  padding: 18px;
}

.status-progress h4 {
  margin: 0 0 12px 0;
}

.status-error {
  padding: 18px;
  color: #ffb4ad;
}

.milestone-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.milestone-list li {
  padding: 6px 0;
}

.portal-locked {
    opacity: 0.6;
    cursor: not-allowed;
}

.info-btn {
    width: 24px;
    height: 24px;

    border-radius: 50%;

    background: transparent;
    border: 1px solid rgba(39, 170, 225, 0.35);

    color: #27aae1;

    font-size: 12px;
    font-weight: 700;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: help;

    transition: all 0.2s ease;
}

.info-btn:hover {
    background: rgba(39, 170, 225, 0.08);
    border-color: #27aae1;
}

.tooltip-section-title {
    font-weight: 700;
    margin-bottom: 4px;
}

.primary-btn.portal-locked {
  opacity: 0.62;
  cursor: not-allowed;
  filter: grayscale(0.15);
}

.primary-btn.job-running {
  opacity: 0.82;
  cursor: wait;
}

.primary-btn.job-running .btn-label::before {
  content: "⏳ ";
}

/* ================================
   Passkey Modal Styling
   Scoped to modal classes only
================================ */

#passkey-modal {
  border: none;
  padding: 0;
  background: transparent;
  overflow: visible;
}

#passkey-modal::backdrop {
  background: rgba(7, 12, 20, 0.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-card {
  width: min(440px, 100%);
  padding: 30px 30px 26px;

  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.14);

  background:
    radial-gradient(circle at top left, rgba(44, 177, 204, 0.20), transparent 42%),
    linear-gradient(145deg, rgba(21, 34, 54, 0.98), rgba(10, 16, 27, 0.98));

  color: #ffffff;
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);

  transform: translateY(0) scale(1);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.modal-overlay.hidden .modal-card {
  transform: translateY(10px) scale(0.96);
}

.modal-card h3 {
  margin: 0 0 8px;

  font-size: 1.35rem;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.modal-card p {
  margin: 0 0 20px;

  color: rgba(255, 255, 255, 0.72);
  font-size: 0.95rem;
  line-height: 1.5;
}

.modal-card input[type="password"] {
  width: 100%;
  box-sizing: border-box;

  margin: 2px 0 22px;
  padding: 14px 16px;

  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);

  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;

  font-size: 1rem;
  outline: none;

  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.modal-card input[type="password"]::placeholder {
  color: rgba(255, 255, 255, 0.42);
}

.modal-card input[type="password"]:focus {
  border-color: rgba(44, 177, 204, 0.85);
  background: rgba(255, 255, 255, 0.11);
  box-shadow: 0 0 0 4px rgba(44, 177, 204, 0.16);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.modal-actions button {
  min-width: 112px;
  padding: 12px 16px;

  border-radius: 999px;
  border: 1px solid transparent;

  font-weight: 800;
  font-size: 0.92rem;

  cursor: pointer;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease,
    border-color 0.16s ease;
}

.modal-actions button:hover {
  transform: translateY(-1px);
}

.modal-actions button:active {
  transform: translateY(0);
}

#cancel-passkey {
  background: lightgray;
  color: black;
  border-color: rgba(255, 255, 255, 0.14);
  margin-top: 20px;
}

#cancel-passkey:hover {
  box-shadow: 0 16px 34px rgba(44, 177, 204, 0.38);
}

#confirm-passkey {
  background: linear-gradient(135deg, #2CB1CC, #35C6DF);
  color: #07121f;
  box-shadow: 0 12px 28px rgba(44, 177, 204, 0.28);
  margin-top: 20px;
}

#confirm-passkey:hover {
  box-shadow: 0 16px 34px rgba(44, 177, 204, 0.38);
}

/* ================================
  Consolidated inline portal styles
================================ */

.primary-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.primary-btn .btn-label {
  flex: 1;
  text-align: left;
  pointer-events: none;
  font-size: 14px;
}

.primary-btn .info-icon {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(39, 170, 225, 0.35);
  color: #27aae1;
  background: rgba(39, 170, 225, 0.05);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  cursor: help;
  pointer-events: auto;
  transition: all 0.2s ease;
}

.primary-btn .info-icon:hover {
  background: rgba(39, 170, 225, 0.12);
  border-color: #27aae1;
  transform: translateY(-1px);
}

.primary-btn .brp-tooltip-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  width: 280px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #172238;
  color: #ffffff;
  box-shadow: 0 14px 35px rgba(15, 23, 42, 0.22);
  text-align: left;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  z-index: 20;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.primary-btn .info-icon:hover + .brp-tooltip-panel {
  opacity: 1;
  transform: translateY(0);
}

.brp-tooltip-title {
  font-weight: 800;
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}

.brp-tooltip-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px;
  margin: 2px 0;
}

.brp-tooltip-label {
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
}

.brp-tooltip-value {
  font-weight: 400;
  color: rgba(255, 255, 255, 0.92);
}

.brp-tooltip-divider {
  height: 1px;
  margin: 10px 0;
  background: rgba(255, 255, 255, 0.16);
}

.brp-tooltip-muted {
  font-weight: 400;
  color: rgba(255, 255, 255, 0.78);
}

.primary-btn.portal-locked .info-icon {
  opacity: 0.7;
}

.primary-btn .intranet-mode-pill {
  flex: 0 0 auto;
  min-width: 62px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: #27aae1;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
  user-select: none;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.16);
}

.primary-btn .intranet-mode-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.22);
}

.primary-btn .intranet-mode-chevron {
  font-size: 9px;
  opacity: 0.8;
}

.primary-btn .intranet-mode-menu {
  position: absolute;
  right: 42px;
  bottom: calc(100% + 10px);
  min-width: 112px;
  padding: 7px;
  border-radius: 12px;
  background: #172238;
  color: #ffffff;
  box-shadow: 0 14px 35px rgba(15, 23, 42, 0.22);
  text-align: left;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  z-index: 25;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.primary-btn .intranet-mode-menu.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.primary-btn .intranet-mode-option {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 9px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
  user-select: none;
}

.primary-btn .intranet-mode-option:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.primary-btn .intranet-mode-option.is-selected {
  color: #ffffff;
  background: rgba(39, 170, 225, 0.16);
}

.primary-btn .intranet-mode-check {
  width: 12px;
  color: #27aae1;
  font-size: 11px;
  font-weight: 900;
}

/* ================================
  Job Status Elements 
================================ */

.job-status-dot {
  position: relative;
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
}

.job-status-dot.status-success {
  background: #2ecc71;
}

.job-status-dot.status-failed {
  background: #ff4d4f;
}

.job-status-dot.status-unknown {
  background: rgba(255, 255, 255, 0.35);
}

.job-status-dot.status-running {
  background: #f5b942;
}

.job-status-dot.status-running::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid rgba(245, 185, 66, 0.45);
  animation: statusPulse 1.8s infinite;
}

@keyframes statusPulse {
  0% {
      transform: scale(0.85);
      opacity: 0.75;
  }

  70% {
      transform: scale(1.8);
      opacity: 0;
  }

  100% {
      transform: scale(1.8);
      opacity: 0;
  }
}

/* ================================
  Navigation Tab
================================ */

.portal-tabs {
  display: inline-flex;
  align-items: center;
  gap: 6px;

  margin-bottom: 18px;
  padding: 6px;

  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(23, 32, 51, 0.08);
  backdrop-filter: blur(12px);
}

.portal-tab {
  padding: 11px 18px;
  border-radius: 11px;

  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;

  transition:
    color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.portal-tab:hover {
  color: var(--primary-dark);
  background: rgba(44, 177, 204, 0.08);
}

.portal-tab.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 6px 16px rgba(44, 177, 204, 0.25);
}

@media (max-width: 560px) {
  .portal-tabs {
    display: flex;
    width: 100%;
  }

  .portal-tab {
    flex: 1;
    text-align: center;
  }
}

/* ================================
  Portal Version
================================ */

.portal-version {
    position: fixed;
    bottom: 16px;
    left: 16px;

    padding: 6px 10px;
    border-radius: 999px;

    background: rgba(255,255,255,0.75);
    backdrop-filter: blur(8px);

    border: 1px solid rgba(0,0,0,0.08);

    font-size: 12px;
    font-weight: 700;
    color: var(--muted);

    z-index: 1000;
}

/* ================================
  Upload Panel
================================ */

.upload-panel {
  margin-top: 28px;
}

.excel-drop-zone {
  display: grid;
  place-items: center;
  min-height: 240px;
  padding: 36px;

  border: 2px dashed rgba(44, 177, 204, 0.45);
  border-radius: 20px;

  background: rgba(44, 177, 204, 0.04);
  text-align: center;
  cursor: pointer;

  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    transform 0.18s ease;
}

.excel-drop-zone:hover,
.excel-drop-zone:focus-visible,
.excel-drop-zone.is-dragging {
  border-color: var(--primary);
  background: rgba(44, 177, 204, 0.09);
  outline: none;
}

.excel-drop-zone.is-dragging {
  transform: scale(1.005);
}

.upload-icon {
  margin-bottom: 12px;
  font-size: 34px;
}

.excel-drop-zone h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.excel-drop-zone p {
  margin: 0 0 10px;
  color: var(--muted);
}

.excel-drop-zone small {
  color: var(--muted);
}

.browse-link {
  color: var(--primary-dark);
  font-weight: 700;
  text-decoration: underline;
}

.selected-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;

  margin-top: 16px;
  padding: 14px 16px;

  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.selected-file div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.selected-file span {
  color: var(--muted);
  font-size: 13px;
}

.selected-file button {
  border: 0;
  background: transparent;
  color: #c0392b;
  font-weight: 700;
  cursor: pointer;
}

.upload-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.upload-excel-button,
.run-comparison-button {
  min-width: 150px;
  padding: 13px 20px;

  border: 0;
  border-radius: 14px;

  background: var(--primary);
  color: white;

  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.upload-excel-button:hover:not(:disabled),
.run-comparison-button:hover:not(:disabled) {
  background: var(--primary-dark);
}

.upload-excel-button:disabled,
.run-comparison-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.upload-message {
  margin-top: 14px;
  min-height: 20px;
  font-size: 14px;
  font-weight: 700;
}

.upload-message.success {
  color: #218c54;
}

.upload-message.error {
  color: #c0392b;
}

@media (max-width: 560px) {
  .excel-drop-zone {
    min-height: 200px;
    padding: 24px;
  }

  .selected-file {
    align-items: flex-start;
    flex-direction: column;
  }

  .upload-excel-button,
  .run-comparison-button {
    width: 100%;
  }
}

/* ================================
  Portal Page Control
================================ */

.portal-page {
  display: none;
  min-height: calc(100vh - 160px);
}

.portal-page.active {
  display: block;
}

.portal-page[hidden] {
  display: none;
}

/* ================================
  Roster Comparison
================================ */

.roster-step-panel,
.roster-results-panel {
  margin-top: 24px;
}

.roster-run-panel {
  padding-top: 22px;
  padding-bottom: 22px;
}

.roster-run-panel .panel-header {
  margin-bottom: 14px;
}

.roster-run-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.roster-run-content .run-comparison-button {
  align-self: flex-end;
}

.roster-change-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.roster-change-pill {
  display: grid;
  grid-template-columns:
    minmax(180px, 0.8fr)
    minmax(300px, 2fr)
    auto;
  align-items: center;
  gap: 20px;
  padding: 14px 16px 14px 20px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  transition:
    opacity 0.4s ease,
    transform 0.4s ease,
    background-color 0.3s ease,
    border-color 0.3s ease;
}

.roster-change-identity {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.roster-employee-id {
  margin-top: 3px;
  font-size: 0.8rem;
  opacity: 0.65;
}

.roster-change-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.roster-change-detail {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 7px;
  font-size: 0.88rem;
}

.roster-old-value {
  text-decoration: line-through;
  opacity: 0.6;
}

.roster-change-arrow {
  opacity: 0.55;
}

.roster-new-value {
  font-weight: 600;
}

.roster-change-actions {
  display: flex;
  gap: 8px;
}

.roster-change-button {
  min-height: 34px;
  padding: 7px 13px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
}

.roster-change-button.dismiss {
  background: #e5e5e5;
  color: #000;
  border-color: #cfcfcf;
}

.roster-change-button.dismiss:hover {
  background: #d9d9d9;
}

.roster-results-empty {
  padding: 28px;
  text-align: center;
  opacity: 0.7;
}

@media (max-width: 900px) {
  .roster-change-pill {
    grid-template-columns: 1fr;
    border-radius: 22px;
  }

  .roster-change-actions {
    justify-content: flex-end;
  }
}

.roster-job-status-panel {
  margin-top: 24px;
}

.roster-change-button.notion,
.roster-change-button.notion:visited {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: var(--primary);
  color: #fff;
}

.roster-change-button.notion:hover,
.roster-change-button.notion:visited:hover {
  background: var(--primary-dark);
  color: #fff;
}

.roster-change-pill.unmatched {
  background: rgba(245, 185, 66, 0.12);
  border-color: rgba(245, 185, 66, 0.45);
}

.roster-change-pill.notion-action {
  background: rgba(245, 185, 66, 0.14);
  border-color: rgba(245, 185, 66, 0.62);
}

.roster-change-pill.notion-action
.roster-employee-name {
  color: #8a6100;
}

.roster-change-button.accept {
  background: #218c54;
  color: #fff;
}

.roster-change-button.accept:hover:not(:disabled) {
  background: #187544;
}

.roster-change-button.accept.is-error {
  background: #c0392b;
}

.roster-change-pill.accepted {
  border-color: #218c54;
  background: #eefaf2;
}

.roster-change-button.undo {
  background: #f5b942;
  color: #172033;
}

.roster-change-button.undo:disabled {
  opacity: 0.7;
  cursor: wait;
}

.roster-change-button.undo:hover:not(:disabled) {
  background: #e7aa2c;
}

/* ================================
  Roster Category
================================ */

.roster-category {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.roster-category + .roster-category {
  margin-top: 18px;
}

.roster-category-header {
  width: 100%;
  padding: 12px 16px;

  border: 1px solid var(--border);
  border-radius: 14px;

  background: rgba(255, 255, 255, 0.72);
  color: var(--text);

  font: inherit;
  font-weight: 800;
  text-align: left;

  cursor: pointer;
}

.roster-category-header:hover {
  background: #fff;
}

.roster-category-label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.roster-category-chevron {
  width: 14px;
  color: var(--muted);
  font-size: 0.75rem;
}

.roster-category-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-width: 28px;
  height: 24px;
  margin-left: auto;
  padding: 0 8px;

  border-radius: 999px;

  background: #e9eef5;
  color: var(--text);

  font-size: 0.78rem;
  font-weight: 800;
}

.roster-category-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.roster-category-content[hidden] {
  display: none;
}

.roster-category.missing-relations
.roster-category-header {
  border-color: rgba(245, 185, 66, 0.55);
  background: rgba(245, 185, 66, 0.10);
}

/* ================================
  Roster Progress Bar
================================ */

.roster-progress-panel {
  margin: 18px 0 24px;
  padding: 18px;

  border: 1px solid var(--border);
  border-radius: 16px;

  background: rgba(255,255,255,.72);
}

.roster-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;

  margin-bottom: 10px;
}

.roster-progress-track {
  height: 12px;

  border-radius: 999px;

  overflow: hidden;

  background: #e7edf4;
}

.roster-progress-fill {
  width: 0%;
  height: 100%;

  border-radius: inherit;

  background: linear-gradient(
    90deg,
    #2cb1cc,
    #218c54
  );

  transition: width .35s ease;
}

.roster-progress-stats {
  margin-top: 10px;

  color: var(--muted);

  font-size: .9rem;
}

.roster-progress-percent {
  font-weight: 800;
}

.roster-progress-percent.bump {
    animation: progress-bump 0.25s ease;
}

@keyframes progress-bump {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.15);
        opacity: 0.8;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ================================
   Roster Subtabs
================================ */

.roster-subtabs {
    display: inline-flex;

    gap: 6px;

    margin-bottom: 22px;
    padding: 6px;

    border: 1px solid var(--border);
    border-radius: 14px;

    background: rgba(255,255,255,.75);
}

.roster-subtab {
    padding: 10px 18px;

    border: 0;
    border-radius: 10px;

    background: transparent;

    font: inherit;
    font-weight: 700;

    color: var(--muted);

    cursor: pointer;

    transition: .15s;
}

.roster-subtab:hover {
    background: rgba(44,177,204,.08);
}

.roster-subtab.active {
    background: var(--primary);

    color: white;
}

.roster-subpage[hidden] {
    display: none;
}

/* ================================
   Roster Audit History
================================ */

.roster-history-table-wrapper {
  width: 100%;
  overflow-x: auto;

  border: 1px solid var(--border);
  border-radius: 16px;
}

.roster-history-table {
  width: 100%;
  min-width: 900px;

  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.72);
}

.roster-history-table th,
.roster-history-table td {
  padding: 14px 16px;

  border-bottom: 1px solid var(--border);

  text-align: left;
  vertical-align: top;
}

.roster-history-table th {
  background: #f8fafc;
  color: var(--muted);

  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.roster-history-table td {
  color: var(--text);
  font-size: 0.9rem;
}

.roster-history-table tbody tr:last-child td {
  border-bottom: 0;
}

.roster-history-table tbody tr:hover {
  background: rgba(44, 177, 204, 0.05);
}

.roster-history-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-width: 82px;
  padding: 6px 10px;

  border-radius: 999px;

  font-size: 0.76rem;
  font-weight: 800;
}

.roster-history-action.is-accept {
  background: #eefaf2;
  color: #187544;
}

.roster-history-action.is-undo {
  background: rgba(245, 185, 66, 0.18);
  color: #7a5500;
}

.roster-history-action.is-dismiss {
  background: #eef1f5;
  color: #4b5563;
}

.roster-history-loading,
.roster-history-empty,
.roster-history-error {
  padding: 34px;

  border: 1px solid var(--border);
  border-radius: 16px;

  background: rgba(255, 255, 255, 0.72);

  text-align: center;
  color: var(--muted);
}

.roster-history-error {
  color: #c0392b;
}

/* ================================
   Expandable History Rows
================================ */

.roster-history-summary-row {
  cursor: pointer;

  transition:
    background 0.16s ease,
    box-shadow 0.16s ease;
}

.roster-history-summary-row:hover {
  background: rgba(44, 177, 204, 0.07);

  box-shadow: inset 0 0 0 9999px rgba(44,177,204,.05);
}

.roster-history-summary-row:focus-visible {
  position: relative;
  z-index: 1;

  outline: 3px solid rgba(44, 177, 204, 0.25);
  outline-offset: -3px;
}

.roster-history-summary-row.is-expanded {
  background: rgba(44, 177, 204, 0.08);
}

.roster-history-timestamp {
  display: flex;
  align-items: center;
  gap: 9px;

  white-space: nowrap;
}

.roster-history-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 14px;

  color: var(--primary-dark);

  font-size: 0.7rem;
  font-weight: 900;
}

.roster-history-field-summary {
  color: var(--muted);
  font-weight: 600;
}

.roster-history-detail-row[hidden] {
  display: none;
}

.roster-history-detail-row td {
  padding: 0;

  background:
    linear-gradient(
      135deg,
      rgba(44, 177, 204, 0.045),
      rgba(33, 140, 84, 0.035)
    );
}

.roster-history-detail-content {
  display: grid;
  gap: 12px;

  padding: 18px 20px 20px 46px;

  border-bottom: 1px solid var(--border);
}

.roster-history-detail-card {
  padding: 15px 16px;

  border: 1px solid var(--border);
  border-radius: 14px;

  background: rgba(255, 255, 255, 0.82);
}

.roster-history-detail-label {
  display: block;

  margin-bottom: 11px;

  color: var(--text);
  font-size: 0.88rem;
}

.roster-history-detail-values {
  display: grid;
  grid-template-columns:
    minmax(0, 1fr)
    auto
    minmax(0, 1fr);

  align-items: center;
  gap: 14px;
}

.roster-history-detail-value {
  display: flex;
  flex-direction: column;
  gap: 5px;

  min-width: 0;
  padding: 11px 13px;

  border-radius: 11px;

  overflow-wrap: anywhere;
}

.roster-history-detail-value.is-old {
  background: rgba(192, 57, 43, 0.07);
  color: #8f3025;
}

.roster-history-detail-value.is-new {
  background: rgba(33, 140, 84, 0.09);
  color: #176b40;
}

.roster-history-detail-caption {
  color: var(--muted);

  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.roster-history-detail-arrow {
  color: var(--muted);

  font-size: 1.15rem;
  font-weight: 800;
}

.roster-history-detail-empty {
  padding: 12px;

  color: var(--muted);
  text-align: center;
}

@media (max-width: 700px) {
  .roster-history-detail-content {
    padding-left: 20px;
  }

  .roster-history-detail-values {
    grid-template-columns: 1fr;
  }

  .roster-history-detail-arrow {
    transform: rotate(90deg);
    text-align: center;
  }
}

.roster-history-relative-time {
  border-bottom: 1px dotted transparent;

  transition:
    color 0.15s ease,
    border-color 0.15s ease;
}

.roster-history-timestamp:hover
.roster-history-relative-time {
  color: var(--primary-dark);
  border-bottom-color: var(--primary-dark);
}

/* ================================
   Roster History Search
================================ */

.roster-history-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;

  margin-bottom: 16px;
}

.roster-history-search-field {
  display: flex;
  flex-direction: column;
  gap: 7px;

  width: min(520px, 100%);
}

.roster-history-search-label {
  color: var(--muted);

  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.roster-history-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.roster-history-search-icon {
  position: absolute;
  left: 14px;

  color: var(--muted);
  font-size: 1rem;

  pointer-events: none;
}

.roster-history-search-input {
  width: 100%;
  min-height: 44px;

  padding:
    10px
    42px
    10px
    40px;

  border: 1px solid var(--border);
  border-radius: 13px;

  background: rgba(255, 255, 255, 0.82);
  color: var(--text);

  font: inherit;
  font-size: 0.9rem;

  outline: none;

  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}

.roster-history-search-input::placeholder {
  color: #929baa;
}

.roster-history-search-input:hover {
  background: #fff;
}

.roster-history-search-input:focus {
  border-color: var(--primary);

  background: #fff;

  box-shadow:
    0 0 0 4px
    rgba(44, 177, 204, 0.13);
}

.roster-history-search-input::-webkit-search-cancel-button {
  cursor: pointer;
}

.roster-history-search-count {
  padding-bottom: 12px;

  color: var(--muted);

  font-size: 0.82rem;
  font-weight: 700;

  white-space: nowrap;
}

.roster-history-summary-row[hidden] {
  display: none;
}

.roster-history-no-matches {
  padding: 34px;

  border: 1px solid var(--border);
  border-radius: 16px;

  background: rgba(255, 255, 255, 0.72);

  color: var(--muted);
  text-align: center;
}

.roster-history-no-matches[hidden] {
  display: none;
}

@media (max-width: 700px) {
  .roster-history-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .roster-history-search-field {
    width: 100%;
  }

  .roster-history-search-count {
    padding-bottom: 0;
  }
}

/* ================================
   Roster History Action Filter
================================ */

.roster-history-toolbar-controls {
  display: flex;
  align-items: flex-end;
  gap: 12px;

  width: min(700px, 100%);
}

.roster-history-toolbar-controls
.roster-history-search-field {
  flex: 1;
  width: auto;
}

.roster-history-filter-field {
  display: flex;
  flex-direction: column;
  gap: 7px;

  flex: 0 0 170px;
}

.roster-history-action-filter {
  width: 100%;
  min-height: 44px;

  padding: 10px 36px 10px 13px;

  border: 1px solid var(--border);
  border-radius: 13px;

  background-color: rgba(
    255,
    255,
    255,
    0.82
  );

  color: var(--text);

  font: inherit;
  font-size: 0.9rem;

  cursor: pointer;
  outline: none;

  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}

.roster-history-action-filter:hover {
  background-color: #fff;
}

.roster-history-action-filter:focus {
  border-color: var(--primary);

  background-color: #fff;

  box-shadow:
    0 0 0 4px
    rgba(44, 177, 204, 0.13);
}

@media (max-width: 700px) {
  .roster-history-toolbar-controls {
    align-items: stretch;
    flex-direction: column;

    width: 100%;
  }

  .roster-history-filter-field {
    flex-basis: auto;
    width: 100%;
  }
}

/* ================================
   Roster History Employee Filter
================================ */

.roster-history-employee-filter-field {
  flex-basis: 210px;
}

.roster-history-employee-filter {
  width: 100%;
  min-height: 44px;

  padding: 10px 13px;

  border: 1px solid var(--border);
  border-radius: 13px;

  background: rgba(
    255,
    255,
    255,
    0.82
  );

  color: var(--text);

  font: inherit;
  font-size: 0.9rem;

  outline: none;

  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}

.roster-history-employee-filter::placeholder {
  color: #929baa;
}

.roster-history-employee-filter:hover {
  background: #fff;
}

.roster-history-employee-filter:focus {
  border-color: var(--primary);

  background: #fff;

  box-shadow:
    0 0 0 4px
    rgba(44, 177, 204, 0.13);
}

@media (max-width: 900px) {
  .roster-history-toolbar-controls {
    flex-wrap: wrap;
  }

  .roster-history-toolbar-controls
  .roster-history-search-field {
    flex-basis: 100%;
  }

  .roster-history-filter-field {
    flex-grow: 1;
  }

  .roster-history-employee-filter-field {
    flex-basis: 210px;
  }
}

@media (max-width: 700px) {
  .roster-history-employee-filter-field {
    width: 100%;
  }
}

/* ================================
   Roster History Toolbar
================================ */

.roster-history-toolbar-meta {
  display: flex;
  justify-content: flex-end;
  flex: 1;
}

.roster-history-action-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.roster-history-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.roster-history-refresh-button,
.roster-history-export-button {
  min-width: 92px;
  min-height: 40px;
  padding: 9px 14px;

  border: 1px solid var(--border);
  border-radius: 12px;

  background: rgba(255, 255, 255, 0.82);
  color: var(--primary-dark);

  font: inherit;
  font-size: 0.84rem;
  font-weight: 800;

  cursor: pointer;

  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

.roster-history-refresh-button:hover:not(:disabled) {
  background: #fff;
  border-color: rgba(44, 177, 204, 0.45);

  box-shadow:
    0 8px 18px
    rgba(23, 32, 51, 0.08);

  transform: translateY(-1px);
}

.roster-history-refresh-button:disabled {
  opacity: 0.65;
  cursor: wait;
}

@media (max-width: 700px) {
  .roster-history-toolbar-meta {
    justify-content: space-between;
    width: 100%;
  }
}

/* ================================
   Roster History Pagination
================================ */

.roster-history-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;

  margin-top: 16px;
}

.roster-history-page-button {
  min-height: 38px;
  padding: 8px 13px;

  border: 1px solid var(--border);
  border-radius: 11px;

  background: rgba(
    255,
    255,
    255,
    0.82
  );

  color: var(--primary-dark);

  font: inherit;
  font-size: 0.8rem;
  font-weight: 800;

  cursor: pointer;

  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

.roster-history-page-button:hover:not(:disabled) {
  background: #fff;

  border-color:
    rgba(44, 177, 204, 0.45);

  box-shadow:
    0 8px 18px
    rgba(23, 32, 51, 0.08);

  transform: translateY(-1px);
}

.roster-history-page-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.roster-history-page-status {
  min-width: 100px;

  color: var(--muted);

  font-size: 0.82rem;
  font-weight: 700;

  text-align: center;
}

@media (max-width: 560px) {
  .roster-history-pagination {
    justify-content: space-between;
  }

  .roster-history-page-status {
    min-width: auto;
  }
}

/* ==========================================
   Roster History Export Menu
========================================== */

.roster-history-export {
  position: relative;
}

.roster-history-export-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.roster-history-export-button:hover:not(:disabled) {
  background: #ffffff;

  border-color: rgba(44, 177, 204, 0.45);

  box-shadow:
    0 8px 18px
    rgba(23, 32, 51, 0.08);

  transform: translateY(-1px);
}

.roster-history-export-button:active {
  transform: translateY(0);
}

.roster-history-export-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;

  min-width: 185px;

  padding: 8px;

  border: 1px solid rgba(32, 46, 66, 0.08);
  border-radius: 14px;

  background: #ffffff;

  box-shadow:
    0 16px 34px rgba(23, 32, 51, 0.14);

  z-index: 100;

  animation: rosterExportMenu 0.18s ease;
}

.roster-history-export-option {
  display: flex;
  align-items: center;

  width: 100%;

  padding: 10px 12px;

  border: none;
  border-radius: 10px;

  background: transparent;
  color: var(--primary-dark);

  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;

  text-align: left;

  cursor: pointer;

  transition:
    background 0.16s ease,
    color 0.16s ease;
}

.roster-history-export-option:hover {
  background: rgba(44, 177, 204, 0.08);
}

.roster-history-export-option:active {
  background: rgba(44, 177, 204, 0.16);
}

@keyframes rosterExportMenu {
  from {
    opacity: 0;
    transform:
      translateY(-6px)
      scale(0.98);
  }

  to {
    opacity: 1;
    transform:
      translateY(0)
      scale(1);
  }
}