/* Login, password reset and admin pages. Loaded after inventory.css,
   which provides the palette, top bar and toast. */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 16px; border-radius: var(--radius);
  border: 1px solid var(--channel); background: var(--channel); color: #fff;
  font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: #0b5f68; }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-quiet { background: var(--sand); color: var(--laguna); border-color: var(--line); }
.btn-quiet:hover { background: var(--shallows); }
.btn-danger { background: var(--sand); color: var(--out); border-color: #e2b7b2; }
.btn-danger:hover { background: var(--out-bg); }
.btn-sm { height: 32px; padding: 0 10px; font-size: 13px; }

.link-btn {
  border: 0; background: none; padding: 0; cursor: pointer;
  color: var(--channel); font-weight: 600; text-decoration: underline;
}

/* ---------- Top bar session area ---------- */
.session { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px 12px; font-size: 14px; color: #cfe2e0; }
.session a, .session button {
  color: #e7f1f0; background: none; border: 1px solid rgba(231, 241, 240, .35);
  border-radius: var(--radius-sm); padding: 4px 10px; cursor: pointer; text-decoration: none; font-size: 13px;
}
.session a:hover, .session button:hover { background: rgba(231, 241, 240, .12); }
.topbar-right { display: flex; align-items: center; gap: 20px; }

/* ---------- Centered card (login, reset) ---------- */
.auth-page { min-height: 100vh; display: flex; flex-direction: column; }
.auth-main { flex: 1; display: grid; place-items: center; padding: 32px 16px; }
.card {
  width: min(420px, 100%); background: var(--sand);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 28px;
}
.card-wide { width: min(560px, 100%); }
.card h1 { margin: 0 0 4px; font: 700 26px/1.2 var(--font-head); }
.card .lead { margin: 0 0 20px; color: var(--muted); }

.form { display: grid; gap: 14px; }
.field { display: grid; gap: 4px; }
.field label { font-size: 13px; font-weight: 600; }
.field .hint { font-size: 12px; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; height: 42px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--sand);
}
.field textarea { height: auto; min-height: 72px; padding: 10px 12px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--channel); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.notice {
  margin: 0 0 14px; padding: 10px 12px; border-radius: var(--radius);
  background: var(--shallows); color: var(--laguna); font-size: 14px;
}
.notice.is-error { background: var(--out-bg); color: var(--out); }
.notice.is-ok { background: #e2f1e6; color: #1f6b3a; }

/* ---------- Admin page ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs button {
  border: 0; background: none; padding: 10px 14px; cursor: pointer;
  font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.tabs button[aria-selected="true"] { color: var(--laguna); border-bottom-color: var(--channel); }

.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.panel-head h2 { margin: 0; font: 700 20px/1.2 var(--font-head); }

.simple-table { width: 100%; border-collapse: collapse; background: var(--sand); }
.simple-table th, .simple-table td { padding: 9px 12px; border-bottom: 1px solid #e6eeec; text-align: left; vertical-align: middle; }
.simple-table th { background: #e8f0ef; font-size: 13px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.simple-table td.num, .simple-table th.num { text-align: right; }
.simple-table .actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.table-box { background: var(--sand); border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; }

.pill {
  display: inline-block; padding: 1px 8px; border-radius: 10px;
  font-size: 12px; font-weight: 600; background: #e8f0ef; color: var(--muted);
}
.pill.ok { background: #e2f1e6; color: #1f6b3a; }
.pill.warn { background: var(--low-bg); color: var(--low); }
.pill.bad { background: var(--out-bg); color: var(--out); }
.muted { color: var(--muted); }

dialog.modal {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 24px;
  width: min(480px, calc(100vw - 32px)); color: var(--laguna);
}
dialog.modal::backdrop { background: rgba(18, 50, 61, .35); }
dialog.modal h2 { margin: 0 0 12px; font: 700 20px/1.2 var(--font-head); }

.copy-box { display: flex; gap: 8px; }
.copy-box input { flex: 1; min-width: 0; height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 13px; }

@media (max-width: 560px) {
  .field-row { grid-template-columns: 1fr; }
  .card { padding: 20px; }
  .session span { display: none; }
}
