/* Admin-only styles. Loaded after styles.css, which supplies the palette,
   buttons, tabs, sheet and toast. */

.login-wrap { display: grid; place-items: center; padding: 80px 20px; }
/* display:grid outranks the UA stylesheet's [hidden]{display:none}, so without
   this the login card stays on screen behind the signed-in panel. */
.login-wrap[hidden] { display: none; }
.login-card {
  width: 100%; max-width: 380px; background: var(--card);
  border: 1px solid var(--line); border-radius: 16px;
  padding: 30px; box-shadow: var(--shadow-md);
}
.login-card h1 { margin: 0 0 6px; font-family: var(--serif); font-size: 21px; font-weight: 700; color: var(--navy); }
.login-card p { margin: 0 0 22px; font-size: 14px; color: var(--muted); line-height: 1.55; }
.login-card label {
  display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 7px;
}
.login-card input {
  width: 100%; font: inherit; font-size: 15px; padding: 11px 13px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--slate-50); margin-bottom: 16px;
}
.btn-block { width: 100%; }

.admin { max-width: 1240px; margin: 0 auto; padding: 34px 24px 70px; }
.admin-head { margin-bottom: 22px; }
.admin-head h1 { margin: 0 0 5px; font-family: var(--serif); font-size: 28px; font-weight: 700; color: var(--navy); }
.admin-head p { margin: 0; font-size: 14px; color: var(--muted); }
.admin-head a { color: var(--navy); }

.section-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.section-bar h2 { margin: 0; font-size: 17px; font-weight: 700; color: var(--navy); }

.table-wrap {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow-x: auto; box-shadow: var(--shadow-sm);
}
.grid { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 860px; }
.grid th {
  text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
  padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--slate-50);
  white-space: nowrap;
}
.grid td { padding: 13px 14px; border-bottom: 1px solid var(--slate-100); vertical-align: middle; }
.grid tr:last-child td { border-bottom: 0; }
.grid tr:hover td { background: var(--slate-50); }
.grid .num { text-align: right; }

.cell-name { display: flex; align-items: center; gap: 11px; }
.cell-icon {
  flex: none; width: 32px; height: 32px; border-radius: 9px;
  background: var(--slate-100); color: var(--navy); display: grid; place-items: center;
}
.cell-icon svg { width: 17px; height: 17px; }
.cell-title { font-weight: 700; color: var(--navy); }
.cell-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

.chip {
  display: inline-block; font-size: 11.5px; font-weight: 600; color: var(--navy);
  background: var(--blue-50); border-radius: 20px; padding: 3px 9px; margin: 2px 3px 2px 0;
}
.chip-none { background: var(--slate-100); color: var(--muted); }

.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; }
.status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-live { color: var(--ok-fg); }
.status-hidden { color: var(--slate-400); }

.link-cell {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px; color: var(--navy);
  max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.link-cell a { color: inherit; }

.row-actions { display: flex; gap: 6px; justify-content: flex-end; white-space: nowrap; }
.btn-sm {
  font-size: 12.5px; padding: 6px 11px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--card); color: var(--navy);
  font-weight: 600; cursor: pointer; font-family: inherit;
}
.btn-sm:hover { background: var(--slate-100); }
.btn-danger { color: var(--red-dark); border-color: #fee2e2; }
.btn-danger:hover { background: #fee2e2; }

.sheet-wide { max-width: 620px; max-height: 88vh; overflow-y: auto; }

.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 18px 0 4px; }
.field { display: flex; flex-direction: column; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field > span {
  font-size: 11.5px; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--muted);
}
.field input[type="text"], .field input[type="number"], .field textarea, .field select {
  font: inherit; font-size: 14px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--slate-50);
  color: var(--ink); width: 100%;
}
.field textarea { resize: vertical; }
.field small { font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.field small code { font-size: 11px; }

.check-row { flex-direction: row; align-items: center; gap: 9px; }
.check-row input { width: 17px; height: 17px; accent-color: var(--navy); }
.check-row span {
  text-transform: none; letter-spacing: 0; font-size: 14px;
  font-weight: 500; color: var(--ink);
}

.checks {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px;
  border: 1px solid var(--line); border-radius: 9px; padding: 11px; background: var(--slate-50);
}
.checks label { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.checks input { width: 16px; height: 16px; accent-color: var(--navy); }
.checks .checks-empty { font-size: 13px; color: var(--muted); grid-column: 1 / -1; }

.form-error {
  margin: 14px 0 0; font-size: 13.5px; font-weight: 600;
  color: var(--red-dark); background: #fee2e2;
  border-radius: 9px; padding: 10px 12px;
}

#toolForm .sheet-actions, #industryForm .sheet-actions { margin-top: 20px; }

button.nav-link { font-family: inherit; font-size: 14px; cursor: pointer; background: none; }

@media (max-width: 640px) {
  .field-grid { grid-template-columns: 1fr; }
  .admin { padding: 24px 16px 60px; }
}
