/* Shared, hand-written styles for the admin/editor pages (editliter, feedsAdmin).
   Written as plain CSS rather than Tailwind utility classes because
   output.css is a pre-purged build with no config/build step in this repo -
   any *new* Tailwind class used in a template has no guarantee of actually
   being compiled in. Classes below are prefixed "au-" (admin ui) to avoid
   clashing with anything Tailwind generates. */

:root {
  --au-primary: #2563eb;
  --au-primary-dark: #1d4ed8;
  --au-secondary-dark: #4b5563;
  --au-danger: #dc2626;
  --au-danger-dark: #b91c1c;
  --au-border: #e2e8f0;
  --au-bg-soft: #f8fafc;
  --au-text-muted: #64748b;
}

.au-page {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.au-page h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #475569;
  margin: 0;
}

/* ---- tab / top nav buttons ---- */

.au-topnav {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  background: #fff;
  border: 1px solid var(--au-border);
  border-radius: .5rem;
  padding: .5rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
}

.au-tab {
  padding: .5rem 1rem;
  border-radius: .375rem;
  color: var(--au-primary);
  text-decoration: none;
  font-weight: 500;
  font-size: .9rem;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: background-color .15s, color .15s;
}

.au-tab:hover:not(:disabled):not(.au-active) {
  background: var(--au-bg-soft);
}

.au-tab.au-active {
  background: var(--au-primary);
  color: #fff;
}

.au-tab:disabled {
  opacity: .4;
  cursor: not-allowed;
}

/* ---- buttons ---- */

.au-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .45rem .9rem;
  border-radius: .375rem;
  border: 1px solid transparent;
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color .15s, opacity .15s;
  line-height: 1.2;
}

.au-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.au-btn-primary {
  background: var(--au-primary);
  color: #fff;
}

.au-btn-primary:hover:not(:disabled) {
  background: var(--au-primary-dark);
}

.au-btn-secondary {
  background: #fff;
  color: var(--au-secondary-dark);
  border-color: var(--au-border);
}

.au-btn-secondary:hover:not(:disabled) {
  background: var(--au-bg-soft);
}

.au-btn-danger {
  background: var(--au-danger);
  color: #fff;
}

.au-btn-danger:hover:not(:disabled) {
  background: var(--au-danger-dark);
}

.au-btn-sm {
  padding: .25rem .6rem;
  font-size: .78rem;
}

/* ---- cards / sections ---- */

.au-card {
  background: #fff;
  border: 1px solid var(--au-border);
  border-radius: .5rem;
  padding: 1rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}

/* ---- tables ---- */

.au-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--au-border);
  border-radius: .5rem;
}

.au-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
  background: #fff;
}

.au-table th,
.au-table td {
  border-bottom: 1px solid var(--au-border);
  padding: .5rem .6rem;
  text-align: left;
  vertical-align: middle;
}

.au-table thead th {
  position: sticky;
  top: 0;
  background: var(--au-bg-soft);
  z-index: 1;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--au-text-muted);
  border-bottom: 2px solid var(--au-border);
  white-space: nowrap;
}

.au-table tbody tr:hover {
  background: #f9fafb;
}

.au-table tbody tr.au-row-selected {
  background: #eff6ff;
}

.au-table td.au-num,
.au-table th.au-num {
  text-align: right;
}

.au-table td.au-center,
.au-table th.au-center {
  text-align: center;
}

.au-table input,
.au-table select,
.au-table textarea {
  width: 100%;
  padding: .3rem .4rem;
  border: 1px solid var(--au-border);
  border-radius: .25rem;
  font-size: .82rem;
  font-family: inherit;
}

.au-checkbox-col {
  width: 2rem;
}

/* ---- bulk action toolbar ---- */

.au-bulkbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: .5rem;
  padding: .6rem .9rem;
}

.au-bulkbar strong {
  color: var(--au-primary-dark);
}

.au-bulkbar label {
  display: flex;
  align-items: center;
  gap: .3rem;
  font-size: .82rem;
  color: var(--au-text-muted);
}

.au-bulkbar input[type="number"],
.au-bulkbar input[type="text"],
.au-bulkbar select {
  padding: .3rem .5rem;
  border: 1px solid var(--au-border);
  border-radius: .25rem;
  font-size: .82rem;
}

/* ---- small helpers ---- */

.au-badge {
  display: inline-block;
  padding: .1rem .5rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
}

.au-badge-success {
  background: #dcfce7;
  color: #166534;
}

.au-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .5rem;
}

.au-row {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
}

.au-muted {
  color: var(--au-text-muted);
  font-size: .82rem;
}

.au-field label {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  font-size: .82rem;
  color: #334155;
}

.au-field input,
.au-field select,
.au-field textarea {
  padding: .45rem .55rem;
  border: 1px solid var(--au-border);
  border-radius: .375rem;
  font-size: .85rem;
  font-family: inherit;
}

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