/*
 * The shared controls of every app screen: cards, the stats strip, buttons, chips, status
 * pills, form fields and lists. Linked right after base.css (views/sheets.ts).
 */

/* Cards ---------------------------------------------------------------------------------- */

.card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.card--link {
  transition:
    border-color 0.15s ease,
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.card--link:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(27, 28, 34, 0.06);
}

.card__head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--hairline-soft);
}

.note {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border: 1px dashed var(--indigo);
  border-radius: var(--radius-inner);
  background: var(--surface-tint);
}

.empty {
  margin: 0;
  padding: 40px;
  border: 1px dashed var(--border-control);
  border-radius: var(--radius-card);
  color: var(--muted);
  text-align: center;
}

/* Stats strip ---------------------------------------------------------------------------- */

.stats {
  display: flex;
  flex-wrap: wrap;
  border: 1px solid var(--hairline);
  border-radius: 18px;
}

.stats__item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 22px;
  border-right: 1px solid var(--hairline);
}

.stats__item:last-child {
  border-right: 0;
}

/* Buttons -------------------------------------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--control-height);
  padding: 0 20px;
  border: 1px solid var(--border-control);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease;
}

.button:hover {
  color: var(--ink);
  border-color: var(--indigo);
}

.button--primary {
  border-color: var(--indigo);
  background: var(--indigo);
  color: #ffffff;
}

.button--primary:hover {
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px var(--indigo-shadow);
}

.button--outline {
  border-color: var(--indigo);
  color: var(--indigo-text);
}

.button--danger {
  border-color: var(--red-border);
  color: var(--red);
}

.button--danger:hover {
  border-color: var(--red-border);
  background: var(--red-tint);
  color: var(--red);
}

.button--small {
  min-height: 36px;
  padding: 0 14px;
  font-size: 13px;
}

.button:disabled,
.button[aria-disabled="true"] {
  cursor: not-allowed;
  border-color: var(--hairline);
  background: var(--surface-muted);
  color: var(--muted);
  transform: none;
  box-shadow: none;
}

/* Chips (filter toggles) ----------------------------------------------------------------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--border-control);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.chip:hover {
  border-color: var(--indigo);
}

.chip[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: #ffffff;
}

.chip__count {
  font-size: 12px;
  opacity: 0.8;
}

/* Status pills --------------------------------------------------------------------------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border: 1px solid var(--border-control);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  background: var(--surface);
}

.pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.pill--plain::before {
  content: none;
}

.pill--good {
  color: var(--green);
  border-color: var(--green-border);
}

.pill--warn {
  color: var(--amber);
  border-color: var(--amber-border);
}

.pill--bad {
  color: var(--red);
  border-color: var(--red-border);
}

.pill--active {
  color: var(--indigo-text);
  border-color: var(--indigo);
  background: var(--surface-tint);
}

/* Form fields ---------------------------------------------------------------------------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 16px;
  border: 1px solid var(--border-field);
  border-radius: var(--radius-field);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.field:focus-within {
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px var(--indigo-ring);
}

.field__label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.field__input {
  width: 100%;
  min-width: 0;
  padding: 4px 0;
  border: 0;
  background: transparent;
  font-size: 16px;
  color: var(--ink);
}

.field__input:focus-visible {
  outline: none;
}

.field[aria-invalid="true"],
.field--invalid {
  border-color: var(--red);
}

.field__error {
  font-size: 13px;
  color: var(--red);
}

.field__help {
  font-size: 12px;
  color: var(--muted);
}

/* Lists ---------------------------------------------------------------------------------- */

.list-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 8px;
  border-top: 1px solid var(--hairline-soft);
  border-radius: 12px;
  transition: background 0.15s ease;
}

.list-row:hover {
  background: var(--surface-hover);
}
