/* app.css — shared styles for authenticated app pages (dashboard/admin/history/login) */

.page {
  margin-top: 14px;
}

/* Header / top row */
.topRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.pageTitle {
  margin: 0 0 6px 0;
}

.subTitle {
  margin: 0;
  color: var(--muted);
}

.actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.small {
  font-size: 12px;
  color: #667085;
}

#msg {
  margin-top: 8px;
}

/* Forms */
.formRow {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.formRow label {
  min-width: 120px;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
}

/* Subtle text-button links (used for row actions like Delete) */
.linkBtn {
  background: transparent;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--primary);
  cursor: pointer;
  font-weight: 700;
  line-height: 1.2;
  border-radius: 0;
}

/* IMPORTANT: override global button:hover styles */
.linkBtn:hover {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--accent);
  text-decoration: underline;
}

.linkBtn:active {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.linkBtn:focus {
  outline: none;
}

/* Nice keyboard focus without changing hover look */
.linkBtn:focus-visible {
  outline: 3px solid rgba(0, 166, 200, 0.25);
  outline-offset: 3px;
  border-radius: 6px;
}

.linkBtn.danger {
  color: #b00020;
}

.linkBtn.danger:hover {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: #8a0018;
}

.linkBtn.danger:active {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

/* Simple modal (used for Delete confirmations) */
.modalOverlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 9999;
}

.modalOverlay.open { display: flex; }

.modal {
  width: 100%;
  max-width: 520px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.modalTitle {
  margin: 0 0 6px 0;
  font-size: 18px;
  font-weight: 900;
}

.modalBody { color: var(--muted); }

.modalActions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 14px;
  flex-wrap: wrap;
}

.dangerBtn {
  border-color: #b00020;
  background: #b00020;
}

.dangerBtn:hover {
  border-color: #8a0018;
  background: #8a0018;
}

.btnLike {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--primary);
  font-weight: 800;
  cursor: pointer;
}

.btnLike:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Early access banner on dashboard */
.noticeCard {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 14px 16px;
  background: #FAFCFF;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="number"],
select {
  padding: 10px;
  font-size: 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  outline: none;
}

input:focus, select:focus {
  border-color: rgba(0, 166, 200, 0.5);
  box-shadow: 0 0 0 4px rgba(0, 166, 200, 0.12);
}

button {
  padding: 10px 14px;
  font-size: 16px;
  cursor: pointer;
  border-radius: 12px;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}

button:hover {
  background: var(--primaryHover);
  border-color: var(--primaryHover);
}

button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Mini button (used in slow threshold) */
.miniBtn {
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 10px;
}

/* Cards */
.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 16px;
}

/* NEW: two-column cards on wider screens (plan + feedback side-by-side) */
@media (min-width: 860px) {
  .cards {
    grid-template-columns: 1fr 1fr;
  }
}

.cardTitle {
  margin: 0 0 6px 0;
  font-size: 14px;
}

.cardValue {
  font-size: 18px;
  font-weight: 800;
  margin: 2px 0;
}

.cardHint {
  font-size: 12px;
  color: #667085;
  margin-top: 6px;
}

/* NEW: feedback link styling in nav */
.navlinks a.feedbackLink {
  color: var(--primary);
  border: 1px solid var(--border);
  background: #FAFCFF;
  padding: 6px 10px;
  border-radius: 999px;
}

.navlinks a.feedbackLink:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

/* Status text helpers */
.ok {
  color: #0a7a2f;
  font-weight: 700;
}

.warn, .err {
  color: #b00020;
  font-weight: 800;
}

/* Tables */
.tableWrap {
  margin-top: 12px;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}

th, td {
  text-align: left;
  padding: 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  background: #F1F5F9;
  color: #334155;
  font-size: 13px;
  letter-spacing: .2px;
}

tr:last-child td {
  border-bottom: 0;
}

/* Pills */
.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 12px;
  border: 1px solid var(--border);
}

.up { background: #EAF7F1; color: #0a7a2f; }
.down { background: #FFECEC; color: #b00020; }
.unknown { background: #F3F4F6; color: #374151; }

/* Toggles */
.toggle {
  display: flex;
  gap: 8px;
  align-items: center;
  user-select: none;
}

/* Mono */
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* Slow threshold editor layout */
.rt { display:flex; flex-direction:column; gap:6px; }
.rtRow { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.rt input[type="number"] { width: 120px; padding: 8px; font-size: 14px; }

.tag {
  display:inline-block;
  padding:2px 8px;
  border-radius:999px;
  font-size:12px;
  font-weight:800;
  border: 1px solid var(--border);
}

.tagSlow { background:#FFF3CD; color:#7A5D00; }

/* Login / Signup layout */
.authBox {
  max-width: 520px;
}

.authHeader{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.authAlt{
  display:flex;
  align-items:center;
  gap: 10px;
}

.authInfo{
  margin-top: 14px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #FAFCFF;
}

.authInfoTitle{
  font-weight: 800;
}

.secondaryBtn{
  background: transparent;
  color: var(--primary);
}

.secondaryBtn:hover{
  border-color: var(--accent);
  color: var(--accent);
  background: transparent;
}

.formGrid {
  margin: 18px 0 0;
  display: grid;
  gap: 10px;
}

.authError {
  margin-top: 10px;
  color: #b00020;
  font-weight: 700;
}

/* Code styling (admin page) */
code {
  background:#F1F5F9;
  padding:2px 6px;
  border-radius:8px;
  border:1px solid #E2E8F0;
}
