.user-menu[hidden] {
  display: none;
}

.user-menu-label {
  font-weight: 400;
}

/* Right group: header nav + user menu, pushed against the right edge */
.header-right {
  display: flex;
  align-self: stretch;
  align-items: center;
  gap: 8px;
}

/* Header nav (Feedbacks / Users) — lives in the dark blue header */
.header-nav {
  display: flex;
  align-self: stretch;
  align-items: stretch;
  margin: -10px 0;
}

.header-nav[hidden] {
  display: none;
}

.header-nav-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, 0.7);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 400;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease;
}

.header-nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.header-nav-item:hover,
.header-nav-item:focus-visible,
.header-nav-item.is-active {
  color: #ffffff;
  background: var(--airbus-blue-soft);
}

.header-nav-item:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: -4px;
}

.header-nav-item.is-active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: #ffffff;
    border-radius: 0;
}

/* Service typology chips + Export CSV at the right edge */
.service-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px clamp(24px, 3vw, 30px);
  border-bottom: 1px solid var(--line);
  background: #f8fafd;
  flex-wrap: wrap;
}

.service-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.service-chip {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 16px;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.service-chip:hover {
  border-color: var(--airbus-blue-soft);
  color: var(--airbus-blue);
  background: #ffffff;
}

.service-chip:focus-visible {
  outline: 2px solid var(--airbus-blue-soft);
  outline-offset: 2px;
}

.service-chip.is-active {
  background: var(--airbus-blue);
  border-color: var(--airbus-blue);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(0, 32, 91, 0.18);
}

/* Users placeholder */
.users-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 72px clamp(24px, 3vw, 30px);
  color: var(--text);
}

.users-placeholder-icon {
  width: 72px;
  height: 72px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #eaf0f8;
  color: var(--airbus-blue);
}

.users-placeholder-icon svg {
  width: 36px;
  height: 36px;
}

.users-placeholder h2 {
  margin: 0;
  font-size: clamp(1.4rem, 1.5vw, 1.7rem);
  color: var(--airbus-blue);
}

.users-placeholder p {
  max-width: 540px;
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.5;
  color: var(--muted);
}

.users-placeholder-note {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: #eaf0f8;
  color: var(--airbus-blue);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  align-self: center;
}

.admin-login-form {
  padding-top: 24px;
}

.admin-login-form input[type="password"] {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid #b8c3d2;
  border-radius: 3px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
}

.admin-login-form input[type="password"]:focus {
  border-color: var(--airbus-blue-soft);
  outline: 3px solid rgba(106, 168, 255, 0.28);
}

.form-message--error {
  border-color: #f1bdba;
  border-left-color: var(--score-red);
  background: #fdecea;
  color: #8b1a14;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  padding: 24px clamp(24px, 3vw, 30px);
  border-bottom: 1px solid var(--line);
  background: #f8fafd;
}

.admin-stat {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 3px;
  min-width: 0;
}

.admin-stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.admin-stat-value {
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--airbus-blue);
  line-height: 1;
}

.admin-stat-value--red    { color: var(--score-red); }
.admin-stat-value--orange { color: var(--score-orange); }
.admin-stat-value--green  { color: var(--score-green); }

.admin-stat-gauge {
  width: 100%;
  height: 8px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 4px;
}

.admin-stat-gauge-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 240ms ease;
}

.admin-stat-gauge-fill--red    { background: var(--score-red); }
.admin-stat-gauge-fill--orange { background: var(--score-orange); }
.admin-stat-gauge-fill--green  { background: var(--score-green); }

.admin-stat-sub {
  font-size: 0.8rem;
  color: var(--muted);
}

.admin-filters {
  display: grid;
  grid-template-columns:
    minmax(140px, 0.8fr)
    minmax(180px, 1.2fr)
    minmax(280px, 1.3fr)
    auto;
  gap: 14px;
  padding: 20px clamp(24px, 3vw, 30px);
  border-bottom: 1px solid var(--line);
  align-items: end;
  position: sticky;
  top: var(--header-height);
  background: #ffffff;
  z-index: 10;
}


.admin-filters label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
  min-width: 0;
}

.admin-filters input {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid #b8c3d2;
  border-radius: 3px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-weight: 400;
}

.admin-filters input:focus {
  border-color: var(--airbus-blue-soft);
  outline: 3px solid rgba(106, 168, 255, 0.28);
}

/* Date range picker (replaces From + To) */
.date-range-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.date-range-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
}

.date-range-picker {
  position: relative;
}

.date-range-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  background: #ffffff;
  border: 1px solid #b8c3d2;
  border-radius: 3px;
  color: var(--text);
  font: inherit;
  font-weight: 400;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.date-range-trigger:hover {
  border-color: var(--airbus-blue-soft);
}

.date-range-trigger:focus-visible {
  border-color: var(--airbus-blue-soft);
  outline: 3px solid rgba(106, 168, 255, 0.28);
}

.date-range-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--muted);
}

.date-range-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.date-range-text.is-default {
  color: var(--muted);
}

.date-range-chevron {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--muted);
  transition: transform 160ms ease;
}

.date-range-picker.is-open .date-range-chevron {
  transform: rotate(180deg);
}

.date-range-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  min-width: 260px;
  padding: 6px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 14px 32px rgba(0, 32, 91, 0.18);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.date-range-popover[hidden] {
  display: none;
}

.date-range-custom-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 4px;
}

.date-range-custom-row label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
}

.date-range-custom-row input {
  min-height: 34px;
  padding: 4px 8px;
  border: 1px solid #b8c3d2;
  border-radius: 3px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-weight: 400;
}

.admin-filter-actions {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: nowrap;
}

.admin-filter-actions .button {
  min-width: 90px;
  flex: 0 0 auto;
}

.admin-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px clamp(24px, 3vw, 30px) clamp(24px, 3vw, 30px);
  flex-wrap: wrap;
}

.page-size-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 500;
}

.page-size-control select {
  min-height: 34px;
  padding: 4px 28px 4px 10px;
  border: 1px solid #b8c3d2;
  border-radius: 3px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.page-size-control select:focus {
  border-color: var(--airbus-blue-soft);
  outline: 3px solid rgba(106, 168, 255, 0.28);
}

.export-csv-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--score-green);
  border-radius: 3px;
  background: #ffffff;
  color: var(--score-green);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.export-csv-link:hover,
.export-csv-link:focus-visible {
  background: var(--score-green);
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(33, 140, 90, 0.22);
}

.export-csv-link:focus-visible {
  outline: 3px solid rgba(33, 140, 90, 0.32);
  outline-offset: 2px;
}

.export-csv-icon {
  width: 18px;
  height: 18px;
  color: var(--score-green);
  flex-shrink: 0;
  transition: color 160ms ease;
}

.export-csv-link:hover .export-csv-icon,
.export-csv-link:focus-visible .export-csv-icon {
  color: #ffffff;
}

.admin-table-wrap {
  padding: 0 clamp(24px, 3vw, 30px);
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  margin-top: 24px;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.admin-table th,
.admin-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.admin-table th {
  background: #f4f7fb;
  color: var(--airbus-blue);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}

.admin-table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: background 160ms ease;
}

.admin-table th.sortable:hover {
  background: #e9eff7;
}

.sort-indicator {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  vertical-align: middle;
}

.sort-indicator svg {
  width: 12px;
  height: 12px;
  display: block;
}

.sort-arrow {
  opacity: 0.35;
  transition: opacity 160ms ease;
}

.admin-table th.sortable.is-sorted-asc .sort-arrow-up,
.admin-table th.sortable.is-sorted-desc .sort-arrow-down {
  opacity: 1;
}

.admin-table th.sortable.is-sorted-asc,
.admin-table th.sortable.is-sorted-desc {
  color: var(--airbus-blue);
}

/* Score cell: pill on top, mini-bar gauge underneath */
.score-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.mini-bar {
  display: block;
  width: 56px;
  height: 8px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 0;
}

.mini-bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width 240ms ease;
}

.mini-bar-fill--red    { background: var(--score-red); }
.mini-bar-fill--orange { background: var(--score-orange); }
.mini-bar-fill--green  { background: var(--score-green); }

/* Loading state: keep existing rows visible but dimmed during fetch */
.admin-table tbody.is-loading {
  opacity: 0.55;
  transition: opacity 150ms ease;
  pointer-events: none;
}

/* Skeleton loader (only shown for slow loads, defer'd 250ms) */
.skeleton-row td {
  padding: 14px;
}

.skeleton-block {
  display: block;
  height: 14px;
  border-radius: 3px;
  background: linear-gradient(90deg, #eef2f8 0%, #f8fafd 50%, #eef2f8 100%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.4s linear infinite;
}

.skeleton-block--short { width: 50%; }
.skeleton-block--mid   { width: 75%; }
.skeleton-block--full  { width: 100%; }

@keyframes skeletonShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.admin-table th.num,
.admin-table td.num {
  text-align: center;
  white-space: nowrap;
}

.admin-table tbody tr:hover {
  background: #f8fafd;
}

.score-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 0;
  background: transparent;
  border-radius: 0;
  color: var(--text);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
}

.score-pill--red    { color: var(--score-red); }
.score-pill--orange { color: var(--score-orange); }
.score-pill--green  { color: var(--score-green); }

.opportunity-id {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.85rem;
  color: var(--airbus-blue);
}

/* Salesforce sync status */
.sf-cell {
  white-space: nowrap;
}

.sf-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sf-status svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.sf-status--ok      { background: #e8f7ef; color: #1f7a47; }
.sf-status--pending { background: #fdf1e7; color: #b8590a; }
.sf-status--error   { background: #fdecea; color: var(--score-red); }

.sf-link-arrow {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
  opacity: 0.65;
  margin-left: 1px;
  transition: opacity 140ms ease, transform 140ms ease;
}

.sf-status-link {
  text-decoration: none;
  outline: none;
}

/* CSS tooltip — appears instantly, no native browser delay */
.has-tooltip {
  position: relative;
}

.has-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 10px;
  background: #1f2937;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease;
  z-index: 100;
}

.has-tooltip::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 1px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #1f2937;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
  z-index: 100;
}

.has-tooltip:hover::after,
.has-tooltip:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, -2px);
}

.has-tooltip:hover::before,
.has-tooltip:focus-visible::before {
  opacity: 1;
}

.sf-status-link:hover .sf-status--ok,
.sf-status-link:focus-visible .sf-status--ok {
  background: #d6efe2;
  box-shadow: 0 0 0 1px #1f7a47 inset;
}

.sf-status-link:hover .sf-link-arrow,
.sf-status-link:focus-visible .sf-link-arrow {
  opacity: 1;
  transform: translate(1px, -1px);
}

.sf-retry-btn {
  margin-left: 6px;
  padding: 2px 8px;
  background: #ffffff;
  border: 1px solid var(--score-red);
  color: var(--score-red);
  border-radius: 3px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}

.sf-retry-btn:hover:not(:disabled) {
  background: var(--score-red);
  color: #ffffff;
}

.sf-retry-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.service-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.service-badge--mms         { background: #000000;                                    color: #ffffff; }
.service-badge--print       { background: #00aec7;                                    color: #ffffff; }
.service-badge--docland     { background: linear-gradient(135deg, #b0dc38, #e468bd); color: #ffffff; }
.service-badge--translation { background: #005587;                                    color: #ffffff; }

.requester-link {
  color: var(--airbus-blue);
  text-decoration: none;
  border-bottom: 1px dotted rgba(0, 32, 91, 0.3);
  transition: color 160ms ease, border-color 160ms ease;
}

.requester-link:hover,
.requester-link:focus-visible {
  color: var(--airbus-blue-soft);
  border-bottom-color: var(--airbus-blue-soft);
}

.project-cell {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.comments-cell {
  max-width: 360px;
  white-space: pre-wrap;
  color: var(--text);
}

.comments-cell--empty {
  color: var(--muted);
  font-style: italic;
}

.admin-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 48px 16px;
  text-align: center;
  color: var(--muted);
}

.admin-empty[hidden] {
  display: none;
}

.admin-empty p {
  margin: 0;
  font-size: 0.95rem;
}


.admin-pagination {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-pagination[hidden] {
  display: none;
}

.admin-pagination-status {
  color: var(--muted);
  font-size: 0.88rem;
}

@media (max-width: 1080px) {
  .admin-filters {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .admin-filter-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
    flex-wrap: wrap;
  }
}

@media (max-width: 780px) {
  .admin-bottom-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-pagination {
    justify-content: space-between;
    width: 100%;
  }

  .admin-filter-actions {
    justify-content: stretch;
  }

  .admin-filter-actions .button,
  .admin-filter-actions .export-csv-link {
    flex: 1;
    min-width: 0;
    justify-content: center;
  }

  .project-cell,
  .comments-cell {
    max-width: 220px;
  }
}
