/* components.css — shared component styles. */

/* Card */
.card {
  background: var(--color-bg-elev);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
}
.card.placeholder { color: var(--color-muted); font-style: italic; }
.card h2, .card h3 { margin-top: 0; }

/* Inline helpers */
.muted   { color: var(--color-muted); }
.right   { text-align: right; }
.row     { display: flex; gap: .75rem; align-items: center; }
.row > * { min-width: 0; }
.stack > * + * { margin-top: .75rem; }

/* Buttons */
.btn {
  display: inline-block;
  min-height: 44px;
  padding: .5rem 1rem;
  border: 1px solid var(--color-primary);
  background: var(--color-primary);
  color: #fff;
  border-radius: 6px;
  font: inherit;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--ghost {
  background: transparent;
  color: var(--color-primary);
}
.btn--danger {
  border-color: var(--color-error);
  background: var(--color-error);
}
.btn--full { width: 100%; display: block; }

/* Form inputs */
.input, .select, .textarea {
  width: 100%;
  min-height: 44px;
  padding: .5rem .75rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-bg);
  color: inherit;
  font: inherit;
}
.textarea { min-height: 96px; resize: vertical; }
.field    { margin-bottom: 1rem; }
.field label {
  display: block;
  font-weight: 600;
  margin-bottom: .25rem;
}
.field .hint {
  font-size: .85rem;
  color: var(--color-muted);
  margin-top: .25rem;
}

/* Alerts / banners */
.alert {
  border-left: 4px solid var(--color-warn);
  padding-left: .75rem;
  background: var(--color-warn-bg);
}
.alert--error   { border-left-color: var(--color-error);   background: var(--color-error-bg); }
.alert--success { border-left-color: var(--color-success); background: var(--color-success-bg); }

/* List items */
.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .75rem 0;
  border-bottom: 1px solid var(--color-divider);
  gap: .75rem;
}
.list-item:last-child { border-bottom: none; }
.list-item a { color: inherit; text-decoration: none; }

/* Pills / badges */
.pill {
  display: inline-block;
  padding: .15rem .5rem;
  border-radius: 999px;
  font-size: .75rem;
  background: var(--color-bg-soft);
  color: var(--color-muted);
}
.pill--success { background: var(--color-success-bg); color: var(--color-success); }
.pill--warn    { background: var(--color-warn-bg);    color: var(--color-warn); }
.pill--draft   { background: var(--color-bg-soft);    color: var(--color-muted); }
.pill--signed  { background: var(--color-success-bg); color: var(--color-success); }
.pill--pending { background: var(--color-warn-bg);    color: var(--color-warn); }

/* Progress */
.progress {
  height: 6px;
  background: var(--color-bg-soft);
  border-radius: 3px;
  overflow: hidden;
}
.progress > span {
  display: block;
  height: 100%;
  background: var(--color-primary);
  transition: width .2s;
}
.progress-tile {
  background: var(--color-bg-elev);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: .75rem 1rem;
}
.progress-tile .label { font-size: .85rem; color: var(--color-muted); }
.progress-tile .count { font-size: 1.25rem; font-weight: 600; }

/* Floating action button */
.fab {
  position: fixed;
  right: 1rem;
  bottom: 4.5rem;
  width: 56px; height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--color-primary);
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 50;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
@media (min-width: 768px) {
  .fab { bottom: 1rem; }
}

/* Segmented control (used for mode toggles, sub-tabs) */
.segmented {
  display: inline-flex;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  overflow: hidden;
}
.segmented button {
  border: none;
  background: var(--color-bg);
  color: var(--color-fg);
  padding: .5rem 1rem;
  cursor: pointer;
  min-height: 40px;
  font: inherit;
}
.segmented button[aria-pressed="true"] {
  background: var(--color-primary);
  color: #fff;
}

/* Locked banner */
.locked-banner {
  background: var(--color-bg-soft);
  border: 1px dashed var(--color-border);
  padding: .75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: .9rem;
  color: var(--color-muted);
}

/* Signature card */
.signature-card .methods {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .5rem;
  margin-top: .75rem;
}
@media (min-width: 768px) {
  .signature-card .methods {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 1em; height: 1em;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Placement-context label in topbar */
.topbar .placement-context {
  display: inline-block;
  padding: .25rem .5rem;
  border-radius: 4px;
  background: rgba(255,255,255,.12);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60vw;
  cursor: pointer;
  font-size: .85rem;
}
.topbar .placement-context:hover, .topbar .placement-context:focus-visible {
  background: rgba(255,255,255,.22);
}

/* Placement switcher menu */
.placement-menu {
  background: var(--color-bg-elev);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
  padding: .25rem;
  display: flex;
  flex-direction: column;
}
.placement-menu__item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--color-fg);
  padding: .65rem .75rem;
  border-radius: 4px;
  font: inherit;
  cursor: pointer;
  min-height: 44px;
}
.placement-menu__item:hover,
.placement-menu__item:focus-visible {
  background: var(--color-bg-soft);
  outline: none;
}
.placement-menu__item.is-active {
  font-weight: 600;
  color: var(--color-primary);
}
.placement-menu__main { flex: 1; }
.placement-menu__meta {
  font-size: .8rem;
  color: var(--color-muted);
}
.placement-menu__item--new {
  margin-top: .25rem;
  border-top: 1px solid var(--color-divider);
  color: var(--color-primary);
}

/* Dashboard */
.dash-tertial {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
  padding: 1rem;
  background: var(--color-bg-soft);
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
}
.dash-tertial h2 {
  margin: 0 0 .25rem;
  font-size: 1.1rem;
}
.dash-tertial .right { text-align: right; }
.dash-tertial .week  {
  font-size: .85rem;
  color: var(--color-muted);
  margin-top: .25rem;
}

.dash-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .75rem;
  margin-bottom: 1rem;
}
@media (min-width: 768px) {
  .dash-grid { grid-template-columns: repeat(4, 1fr); }
}
.progress-tile-link {
  text-decoration: none;
  color: inherit;
}
.progress-tile-link:hover .progress-tile {
  border-color: var(--color-primary);
}

/* Missing list */
.missing-list .list-item .pill { margin-right: .5rem; }
.missing-list .list-item:hover  { background: var(--color-bg-soft); }

/* Inbox list */
.inbox-list .list-item:hover { background: var(--color-bg-soft); }
