/* App styles on top of AdminLTE (loaded after adminlte.min.css in fragments/common.html). */

/* Hints under fields, placeholders and "(optional)" in labels: lighter and italic, so they are not mistaken for
   values or labels. */
.form-text {
  font-style: italic;
  color: var(--bs-tertiary-color);
}
.form-control::placeholder,
.form-select::placeholder {
  font-style: italic;
  color: var(--bs-tertiary-color);
  opacity: 1;
}
.form-label .text-secondary,
.form-check-label .text-secondary {
  font-style: italic;
  color: var(--bs-tertiary-color) !important;
}

/* Action bar of long forms: fixed to the bottom of the window, over the content area only (app/js/action-bar.js
   sets left / width to match .app-main and pads the content so nothing hides under the bar). position: sticky does
   not work here: .app-main has overflow: auto in AdminLTE but the page scrolls on <body>. */
.app-action-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1031;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background-color: var(--bs-body-bg);
  border-top: 1px solid var(--bs-border-color);
  box-shadow: 0 -0.25rem 0.75rem rgba(0, 0, 0, 0.08);
}

/* User avatar in the header (layout/main.html): first letter of the username in a circle, coloured by role like
   the role badges of the Users page (ADMIN red, EDITOR blue, VIEWER grey). */
.app-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 600;
  line-height: 1;
  user-select: none;
  background-color: var(--bs-secondary);
}
.user-menu .user-image.app-avatar {
  font-size: 1rem;
}
.app-avatar-lg {
  width: 90px;
  height: 90px;
  font-size: 2.5rem;
  border: 3px solid rgba(255, 255, 255, 0.7);
}
.app-avatar-admin {
  background-color: var(--bs-danger);
}
.app-avatar-editor {
  background-color: var(--bs-primary);
}
.app-avatar-viewer {
  background-color: var(--bs-secondary);
}

/* Dashboard "Emails per day" chart (templates/dashboard/email.html): plain HTML stacked columns, heights in % */
.send-chart {
  --chart-sent: var(--bs-success);
  --chart-failed: var(--bs-danger);
  --chart-config: var(--bs-warning);
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  grid-template-rows: 180px auto;
  column-gap: 0.5rem;
}
.send-chart-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: right;
  line-height: 1;
}
.send-chart-plot {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  border-bottom: 1px solid var(--bs-border-color);
  background-image: linear-gradient(var(--bs-border-color-translucent) 1px, transparent 1px);
  background-size: 100% 50%;
}
.send-chart-col {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  border-radius: 4px 4px 0 0;
  outline: none;
}
.send-chart-col:hover,
.send-chart-col:focus-visible {
  background-color: var(--bs-tertiary-bg);
}
.send-chart-stack {
  width: 70%;
  max-width: 28px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-radius: 4px 4px 0 0;
  overflow: hidden;
}
.send-chart-stack .seg {
  flex-basis: 0;
  min-height: 2px;
}
.send-chart .seg.sent,
.send-chart-swatch.sent {
  background-color: var(--chart-sent);
}
.send-chart .seg.failed,
.send-chart-swatch.failed {
  background-color: var(--chart-failed);
}
.send-chart .seg.config,
.send-chart-swatch.config {
  background-color: var(--chart-config);
}
.send-chart-labels {
  display: flex;
  gap: 2px;
  padding-top: 4px;
}
/* One slot per column (same width as the columns, min-width 0); a label wider than its slot spills over the empty
   neighbours, centred, except the first / last, which stay inside the chart so nothing sticks out of the card. */
.send-chart-labels > span {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  justify-content: center;
  white-space: nowrap;
  font-size: 0.75rem;
}
.send-chart-labels > span:first-child {
  justify-content: flex-start;
}
.send-chart-labels > span:last-child {
  justify-content: flex-end;
}

/* Dashboard tabs (index.html): Email sending / Crawl */
.dashboard-tabs .nav-link {
  font-weight: 500;
}
.dashboard-tabs .nav-link:not(.active) {
  color: var(--bs-secondary-color);
}
.send-chart-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 2px;
  vertical-align: baseline;
}
