/* Shared building blocks for inner pages, on top of dashboard.css. Page styles stay in <page>.css. */

/* A card that holds a page section and does not lift on hover */
.panel {
  margin-bottom: 2rem;
}

.panel:hover {
  transform: none;
}

.panel label {
  font-size: 0.9rem;
  color: #4a5568;
  margin-bottom: 0.35rem;
  font-weight: 500;
}

.panel .form-input {
  font-family: inherit;
}

.panel textarea {
  resize: vertical;
}

/* A row of buttons */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.actions-end {
  justify-content: flex-end;
  margin-bottom: 1rem;
}

/* Lists of records: one row each, details on the left, buttons on the right */
.item-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.item-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-radius: 10px;
  background: white;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.item-name {
  font-weight: 600;
  color: #2d3748;
}

.item-details {
  font-size: 0.9rem;
  color: #718096;
  margin-top: 0.2rem;
}

.item-note {
  font-size: 0.9rem;
  color: #4a5568;
  margin-top: 0.35rem;
  white-space: pre-wrap;
}

.item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.empty-state {
  text-align: center;
  color: #718096;
  padding: 1.5rem;
}

/* Small labels next to a name */
.badges {
  display: inline-flex;
  gap: 0.4rem;
  margin-left: 0.5rem;
  vertical-align: middle;
}

.badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: #edf2f7;
  color: #4a5568;
}

.badge-success {
  background: #c6f6d5;
  color: #22543d;
}

.badge-info {
  background: #bee3f8;
  color: #2a4365;
}

@media (max-width: 640px) {
  .item-row {
    grid-template-columns: 1fr;
  }

  .item-actions {
    justify-content: flex-start;
  }
}

/* Hides Alpine content until Alpine has started */
[x-cloak] {
  display: none !important;
}

.badge-warning {
  background: #fefcbf;
  color: #744210;
}

.actions-center {
  justify-content: center;
  margin-top: 1rem;
}

/* Search field with buttons next to it, above a list */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.toolbar .form-input {
  flex: 1 1 220px;
}

.toolbar .btn {
  margin-top: 0;
}

/* "(12)" next to a title */
.count {
  color: #718096;
  font-weight: 500;
}
