/* Dense filter bar (Requests page style) */

.dense-bar {
  flex-shrink: 0;
  border-radius: 6px;
  padding: 0.55rem 0.85rem;
  margin-bottom: 0.5rem;
}

.dense-bar__row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.field--dense {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
}

.field--dense span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.field--dense input {
  height: 2rem;
  padding: 0.3rem 0.5rem;
  border: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  color: var(--text);
  font-size: 0.85rem;
}

.field--dense input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
}

.dense-bar__row .live-poll-toggle input {
  width: 15px;
  height: 15px;
  margin: 0;
}

.date-quick-picks {
  display: flex;
  gap: 0.4rem;
}

.dense-bar__title {
  flex-shrink: 0;
  margin: 0 0.25rem 0 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.stat-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.45rem;
  border-top: 1px solid color-mix(in srgb, var(--text) 8%, transparent);
  padding-top: 0.55rem;
}

.stat-chip {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.4rem;
  flex: 1 1 0;
  padding: 0.3rem 0.75rem;
  border: 1px solid color-mix(in srgb, var(--chip-color, var(--accent)) 30%, transparent);
  border-radius: 6px;
  background: color-mix(in srgb, var(--chip-color, var(--accent)) 8%, transparent);
}

button.stat-chip {
  font: inherit;
}

.stat-chip--clickable {
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.stat-chip--clickable:hover {
  background: color-mix(in srgb, var(--chip-color, var(--accent)) 16%, transparent);
  border-color: color-mix(in srgb, var(--chip-color, var(--accent)) 55%, transparent);
}

.stat-chip--active {
  background: color-mix(in srgb, var(--chip-color, var(--accent)) 22%, transparent);
  border-color: var(--chip-color, var(--accent));
}

.stat-chip--accent { --chip-color: var(--accent); }
.stat-chip--good { --chip-color: var(--good); }
.stat-chip--warn { --chip-color: var(--warn); }
.stat-chip--bad { --chip-color: var(--bad); }

.stat-chip__value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--chip-color, var(--text));
}

.stat-chip__label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

.stat-chip--flash .stat-chip__value {
  animation: stat-chip-flash 1.6s ease-in-out infinite;
}

@keyframes stat-chip-flash {
  0%, 100% {
    color: var(--chip-color, var(--text));
  }
  50% {
    color: var(--text);
  }
}

@media (prefers-reduced-motion: reduce) {
  .stat-chip--flash .stat-chip__value {
    animation: none;
  }
}

.stat-chip--pulse {
  animation: stat-chip-pulse-ring 1s ease-out;
}

@keyframes stat-chip-pulse-ring {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--live-pulse, #3b82f6) 55%, transparent);
  }
  100% {
    box-shadow: 0 0 0 8px color-mix(in srgb, var(--live-pulse, #3b82f6) 0%, transparent);
  }
}

@media (prefers-reduced-motion: reduce) {
  .stat-chip--pulse {
    animation: none;
  }
}

.metrics-toolbar {
  margin-bottom: 1.25rem;
}

.metrics-toolbar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.metrics-toolbar__header .card-heading {
  margin: 0;
}

.metrics-toolbar__heading-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.info-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  border: 1px solid var(--text-muted);
  color: var(--text-muted);
  font-size: 0.7rem;
  font-style: italic;
  line-height: 1;
  cursor: help;
}

.info-icon::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 0.4rem);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 220px;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  background: var(--text);
  color: var(--surface);
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease;
  pointer-events: none;
  z-index: 20;
}

.info-icon:hover::after,
.info-icon:focus-visible::after {
  opacity: 1;
  visibility: visible;
}

.metrics-toolbar__note {
  margin: -0.5rem 0 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.metrics-toolbar__controls {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.live-poll-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
}

.live-poll-toggle input {
  accent-color: var(--accent);
}

.metrics-window {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.metrics-window select,
.filter-panel select,
.filter-panel input {
  height: 2.35rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  color: var(--text);
  font-size: 0.85rem;
  line-height: 1.35rem;
}

.metrics-window select,
.filter-panel select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23808080' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  padding-right: 1.75rem;
}

.metrics-window select:focus,
.filter-panel select:focus,
.filter-panel input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
}

.day-toggle {
  display: inline-flex;
  gap: 0.2rem;
  padding: 0.2rem;
  border: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 60%, transparent);
}

.day-toggle__btn {
  font: inherit;
  height: 1.9rem;
  padding: 0 0.65rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.day-toggle__btn:hover {
  color: var(--text);
}

.day-toggle__btn--active {
  background: var(--accent);
  color: var(--surface);
}

.metrics-strip {
  margin-bottom: 0;
}

.requests-toolbar .metrics-strip {
  margin-bottom: 1.1rem;
}

/* Dashboard */

.dashboard-live-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1.1rem;
  margin-bottom: 2rem;
}

.dashboard-live-grid .metrics-toolbar {
  margin-bottom: 0;
}

.dashboard-recent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1.1rem;
}

.card-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.card-heading-row .card-heading {
  margin: 0;
}

.card-heading-link {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
}

.card-heading-link:hover {
  text-decoration: underline;
}

/* Requests — filter panel */

.requests-toolbar__row {
  display: flex;
}

.unified-toolbar__row {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1.1rem;
  margin-bottom: 1.1rem;
}

.unified-toolbar__row .field--inline {
  min-width: 150px;
}

.unified-toolbar__row .field--inline input {
  height: 2.35rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  color: var(--text);
  font-size: 0.85rem;
}

.unified-toolbar__row .field--inline input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
}

.unified-toolbar__row .live-poll-toggle {
  padding-bottom: 0.6rem;
}

.unified-toolbar__row .requests-search {
  flex: 1 1 320px;
  margin-left: auto;
}

.requests-search {
  flex: 1;
  display: flex;
  gap: 0.75rem;
}

.filter-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  border: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
  background: color-mix(in srgb, var(--surface) 50%, transparent);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.filter-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-toggle svg {
  transition: transform 0.15s ease;
}

.filter-toggle--open svg {
  transform: rotate(180deg);
}

.filter-panel {
  margin-top: 1.1rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border);
}

.filter-panel__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.9rem;
}

.field--inline {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0;
}

.field--inline span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.filter-panel__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.1rem;
}

.filter-panel__actions .btn {
  width: auto;
  padding: 0.6rem 1.25rem;
}

.filter-panel__actions .btn--secondary {
  width: auto;
  margin-top: 0;
  padding: 0.6rem 1.25rem;
}

/* Requests — pagination */

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.75rem;
  border-top: 1px solid var(--border);
}

.pagination__status {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.pagination__btn {
  padding: 0.5rem 1rem;
  border: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
  background: color-mix(in srgb, var(--surface) 50%, transparent);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.pagination__btn:hover:not(:disabled):not([aria-disabled="true"]) {
  border-color: var(--accent);
  color: var(--accent);
}

.pagination__btn:disabled,
.pagination__btn[aria-disabled="true"] {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Users admin page */

.user-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.5rem;
}

.user-list__empty {
  text-align: center;
  color: var(--text-muted);
  padding: 2.5rem 0;
}

.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0.75rem;
  border-radius: 10px;
  transition: background-color 0.15s ease;
}

.user-row:hover {
  background: color-mix(in srgb, var(--text) 4%, transparent);
}

.user-row__info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.user-row__avatar {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-contrast);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 700;
}

.user-row__name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.92rem;
}

.user-row__you {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--text) 10%, transparent);
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
}

.user-row__meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.user-row__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.role-badge {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.role-badge:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.role-badge:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.role-badge--good {
  background: var(--good-soft);
  color: var(--good);
}

.role-badge--accent {
  background: var(--accent-soft);
  color: var(--accent);
}

.role-badge--off {
  background: color-mix(in srgb, var(--text-muted) 14%, transparent);
  color: var(--text-muted);
  border-color: color-mix(in srgb, var(--text) 12%, transparent);
}

/* Non-interactive status indicators — same pill shape as .role-badge, no
   hover/press affordance since these are just labels now (editing happens
   in the permissions modal via .icon-btn). */
.status-label {
  display: inline-block;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.status-label--good {
  background: var(--good-soft);
  color: var(--good);
}

.status-label--accent {
  background: var(--accent-soft);
  color: var(--accent);
}

.status-label--off {
  background: color-mix(in srgb, var(--text-muted) 14%, transparent);
  color: var(--text-muted);
  border-color: color-mix(in srgb, var(--text) 12%, transparent);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.icon-btn:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.skel-avatar {
  width: 38px;
  height: 38px;
  border-radius: 999px;
}

/* Confirmation modal — reuses .picker-modal's overlay/panel shell. */

.confirm-modal__panel {
  width: min(380px, calc(100vw - 2rem));
  gap: 0.5rem;
}

.confirm-modal__body {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.confirm-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 0.4rem;
}

.confirm-modal__actions .btn,
.confirm-modal__actions .btn--secondary {
  width: auto;
  margin-top: 0;
  padding: 0.5rem 1rem;
}

.confirm-modal__actions .btn--danger {
  background: var(--bad);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--bad) 35%, transparent);
}

.confirm-modal__actions .btn--danger:hover {
  box-shadow: 0 6px 18px color-mix(in srgb, var(--bad) 42%, transparent);
}

/* Permissions modal — reuses .picker-modal's overlay/panel shell and
   .confirm-modal__actions for the Cancel/Save row. */

.permissions-modal__panel {
  width: min(420px, calc(100vw - 2rem));
  gap: 0.5rem;
}

.permissions-modal__panel .picker-modal__header {
  align-items: flex-start;
}

.permissions-modal__email {
  margin-top: 0.15rem;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-muted);
}

.permissions-modal__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0;
  border-top: 1px solid var(--border);
  cursor: pointer;
}

.permissions-modal__row:first-of-type {
  border-top: none;
}

.permissions-modal__row--disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.pill-toggle {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
  width: 40px;
  height: 24px;
  margin-top: 0.2rem;
  appearance: none;
  -webkit-appearance: none;
  background: var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.pill-toggle::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease;
}

.pill-toggle:checked {
  background: var(--accent);
}

.pill-toggle:checked::before {
  transform: translateX(16px);
}

.pill-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.pill-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.permissions-modal__label {
  font-size: 0.88rem;
  font-weight: 600;
}

.permissions-modal__hint {
  margin-top: 0.15rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}
