/* ==========================================================================
   SightWatch Forms — admin panel styles
   Self-contained: no CDN, no font download, no build step.
   ========================================================================== */

:root {
  --brand: #ed492e;
  --brand-dark: #c9381f;
  --brand-soft: #ff7a5c;
  --brand-tint: #fdeeeb;

  --ink: #101828;
  --ink-soft: #475467;
  --ink-faint: #98a2b3;

  --line: #e4e7ec;
  --line-soft: #f0f2f5;
  --surface: #ffffff;
  --canvas: #f5f6f8;
  --shell: #151b28;
  --shell-line: rgba(255, 255, 255, 0.08);

  --ok: #067647;
  --ok-tint: #ecfdf3;
  --ok-line: #abefc6;
  --warn: #b54708;
  --warn-tint: #fffaeb;
  --warn-line: #fedf89;
  --bad: #d92d20;
  --bad-tint: #fef3f2;
  --bad-line: #fecdca;
  --info: #175cd3;
  --info-tint: #eff4ff;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
  --shadow-lift: 0 4px 8px -2px rgba(16, 24, 40, 0.08), 0 2px 4px -2px rgba(16, 24, 40, 0.05);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.015em; }

/* --- shell ---------------------------------------------------------------- */

.topbar {
  background: var(--shell);
  color: #fff;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 60px;
  flex-wrap: wrap;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
}
.topbar-brand:hover { text-decoration: none; }

.topbar-logo { height: 34px; width: auto; display: block; }

.topbar-brand-sub {
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #8f9aa6;
  border-left: 1px solid var(--shell-line);
  padding-left: 12px;
}

.topbar-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-soft) 100%);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 2px 6px rgba(237, 73, 46, 0.45);
}

.topbar-nav { display: flex; gap: 6px; margin-left: auto; align-items: center; }

.topbar-nav a {
  color: #aeb6c2;
  font-size: 13px;
  font-weight: 550;
  padding: 7px 13px;
  border-radius: 8px;
  transition: background 0.12s, color 0.12s;
}
.topbar-nav a:hover { background: var(--shell-line); color: #f66a4d; text-decoration: none; }
.topbar-nav a.is-active { background: rgba(237, 73, 46, 0.18); color: #ffb4a4; }

.topbar-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-soft) 100%);
  color: #fff;
  display: inline-grid;
  place-items: center;
  font-size: 12.5px;
  font-weight: 700;
  flex: 0 0 auto;
}

/* --- profile dropdown ----------------------------------------------------- */

.user-menu { position: relative; margin-left: 10px; }

.user-menu > summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  padding: 5px 10px 5px 6px;
  border-radius: 999px;
  border: 1px solid var(--shell-line);
  color: #aeb6c2;
  font-size: 13px;
  transition: background 0.12s, border-color 0.12s;
  user-select: none;
}
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu > summary strong { color: #e8ebef; font-weight: 600; }
.user-menu > summary:hover,
.user-menu[open] > summary { background: var(--shell-line); border-color: rgba(255, 255, 255, 0.14); }

.user-menu-chevron { width: 14px; height: 14px; opacity: 0.7; transition: transform 0.15s; }
.user-menu[open] .user-menu-chevron { transform: rotate(180deg); }

.user-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 236px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px -6px rgba(16, 24, 40, 0.22), 0 4px 10px -4px rgba(16, 24, 40, 0.12);
  padding: 6px;
  z-index: 50;
  animation: menu-in 0.14s ease-out;
}
@keyframes menu-in {
  from { opacity: 0; transform: translateY(-5px); }
  to   { opacity: 1; transform: translateY(0); }
}

.user-menu-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px 12px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 6px;
}
.user-menu-head .topbar-avatar { width: 36px; height: 36px; font-size: 14px; }
.user-menu-name { font-weight: 650; font-size: 13.5px; line-height: 1.3; }
.user-menu-email { font-size: 12px; color: var(--ink-faint); }

.user-menu-form { margin: 0; }

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  font-size: 13.5px;
  font-weight: 550;
  /* Sign out is a <button> inside a POST form (CSRF-protected), so it needs
     the anchor styling reset onto it. */
  width: 100%;
  border: none;
  background: none;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: none;
}
.user-menu-item svg { width: 16px; height: 16px; color: var(--ink-faint); }
.user-menu-item:hover { background: #f5f6f8; color: var(--ink); text-decoration: none; }
.user-menu-item.is-danger { color: var(--bad); }
.user-menu-item.is-danger svg { color: var(--bad); }
.user-menu-item.is-danger:hover { background: var(--bad-tint); color: var(--bad); }

.wrap { margin: 0 auto; padding: 30px 24px 70px; }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.page-head h1 { font-size: 22px; }
.page-head p { margin: 5px 0 0; color: var(--ink-soft); font-size: 13.5px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* --- stat tiles ----------------------------------------------------------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.stat {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}

.stat-icon {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
}
.stat-icon svg { width: 21px; height: 21px; }
.stat-icon-total  { background: var(--brand-tint); color: var(--brand-dark); }
.stat-icon-today  { background: var(--info-tint);  color: var(--info); }
.stat-icon-failed { background: var(--bad-tint);   color: var(--bad); }
.stat.is-ok .stat-icon-failed { background: var(--ok-tint); color: var(--ok); }

.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-faint);
  font-weight: 650;
}
.stat-value {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-top: 2px;
}
.stat.is-bad .stat-value { color: var(--bad); }

/* Per-form breakdown strip */
/* Compact stats in the page head (replaces the two full-width tiles). */
.head-stat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.head-stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  font-weight: 650;
}
.head-stat-value { font-size: 16px; font-weight: 700; }

/* Two-column submissions layout: form filters as a left sidebar,
   submission details on the right. */
.subs-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.form-side {
  flex: 0 0 250px;
  position: sticky;
  top: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px;
}

.form-side-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-faint);
  font-weight: 650;
  padding: 2px 8px 10px;
}

.subs-main {
  flex: 1;
  min-width: 0;
}

/* Collapsible category groups inside the Forms sidebar. Each group is a
   tinted box so its boundary reads at a glance. */
.form-side-details {
  background: var(--canvas);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 4px;
}

.form-side-group {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 10px;
  border-radius: 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-soft);
  font-weight: 650;
  cursor: pointer;
  user-select: none;
  transition: background 0.12s, color 0.12s;
}
.form-side-group::-webkit-details-marker { display: none; }
.form-side-group:hover { background: var(--line-soft); color: var(--ink); }

.form-side-group-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.form-side-chevron {
  width: 15px;
  height: 15px;
  color: var(--ink-faint);
  transition: transform 0.15s;
}
.form-side-details[open] .form-side-chevron { transform: rotate(180deg); }

.form-side-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 2px 6px 8px;
}
.form-side-items .form-tab {
  background: var(--surface);
  border-color: var(--line);
}
.form-side-items .form-tab:hover { background: var(--line-soft); }
.form-side-items .form-tab.is-active { background: var(--brand); border-color: var(--brand); }

/* Vertical filter list. */
.form-tabs {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-tab {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--canvas);
  color: var(--ink-soft);
  font-size: 14.5px;
  font-weight: 550;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.form-tab:hover {
  background: #e9edf2;
  border-color: var(--line);
  color: var(--ink);
  text-decoration: none;
}
.form-tab.is-active {
  background: var(--brand);
  color: #fff;
  font-weight: 650;
  box-shadow: 0 2px 8px rgba(237, 73, 46, 0.35);
}

.form-tab-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 650;
}

.form-tab-count {
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 650;
  text-align: center;
}
.form-tab.is-active .form-tab-count {
  background: rgba(255, 255, 255, 0.25);
  border-color: transparent;
  color: #fff;
}

.form-tab-sub {
  font-size: 12.5px;
  font-weight: 450;
  color: var(--ink-faint);
  line-height: 1.35;
  white-space: break-spaces;
}
.form-tab.is-active .form-tab-sub { color: rgba(255, 255, 255, 0.85); }

/* Narrow screens: sidebar becomes a wrapping row above the table. */
@media (max-width: 980px) {
  .subs-layout { display: block; }
  .form-side { position: static; margin-bottom: 16px; }
  .form-tabs { flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .form-tab { flex: 1 1 200px; }
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card + .card { margin-top: 20px; }

.card-head {
  padding: 14px 20px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.card-head h2 { font-size: 14.5px; }
.card-head .muted { font-size: 12px; color: var(--ink-faint); }

.card-body { padding: 20px; }

/* --- filters -------------------------------------------------------------- */

.filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
  padding: 16px 20px;
  background: #fafbfc;
  border-bottom: 1px solid var(--line-soft);
}
.filters .field { display: flex; flex-direction: column; gap: 5px; flex: 1 1 140px; min-width: 130px; }
.filters .field-grow { flex: 2 1 240px; }
.filters label {
  font-size: 11px;
  font-weight: 650;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.filters .filter-actions { display: flex; gap: 8px; flex: 0 0 auto; }

input[type="text"],
input[type="search"],
input[type="email"],
input[type="password"],
input[type="date"],
select {
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid #d0d5dd;
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  min-width: 0;
  width: 100%;
  transition: border-color 0.12s, box-shadow 0.12s;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(237, 73, 46, 0.12);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  border: 1px solid #d0d5dd;
  background: #fff;
  color: var(--ink-soft);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s;
}
.btn:hover { background: #f8f9fb; color: var(--ink); text-decoration: none; }

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 1px 2px rgba(237, 73, 46, 0.35);
}
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }

.btn-danger { background: #fff; border-color: var(--bad-line); color: var(--bad); }
.btn-danger:hover { background: var(--bad-tint); color: var(--bad); }

.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }

.btn-link {
  border: none;
  background: none;
  color: var(--brand);
  padding: 0;
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
  box-shadow: none;
}
.btn-link:hover { text-decoration: underline; background: none; }

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

.table-scroll { overflow-x: auto; }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
table.data th {
  text-align: left;
  padding: 11px 16px;
  background: #fafbfc;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  font-weight: 700;
  white-space: nowrap;
}
table.data td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
table.data tbody tr { transition: background 0.1s; }
table.data tbody tr:hover { background: #fafbfd; }
table.data tbody tr:last-child td { border-bottom: none; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .nowrap { white-space: nowrap; }
table.data .actions { text-align: right; white-space: nowrap; }

.cell-title { font-weight: 600; color: var(--ink); }
.cell-sub { font-size: 12px; color: var(--ink-faint); margin-top: 2px; }

.row-deleted td { background: #fcfafa; }
.row-deleted .cell-title { color: var(--ink-faint); text-decoration: line-through; }

.empty {
  padding: 56px 20px;
  text-align: center;
  color: var(--ink-faint);
}
.empty svg { width: 44px; height: 44px; color: #d0d5dd; margin-bottom: 10px; }
.empty strong { display: block; color: var(--ink-soft); margin-bottom: 4px; font-size: 15px; }

/* --- badges --------------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.75;
}

.badge-form { background: var(--brand-tint); color: var(--brand-dark); }
.badge-form1 { background: var(--brand-tint); color: var(--brand-dark); }
.badge-form2 { background: var(--info-tint);  color: var(--info); }
.badge-form3 { background: var(--ok-tint);    color: var(--ok); }
.badge-form4 { background: #f5f0ff;           color: #6941c6; }
.badge-form5 { background: var(--warn-tint);  color: var(--warn); }
.badge-form6 { background: #fff7ed;           color: #c2410c; }
.badge-form7 { background: #ecfeff;           color: #0e7490; }

.badge-sent    { background: var(--ok-tint);   color: var(--ok); }
.badge-pending { background: var(--warn-tint); color: var(--warn); }
.badge-failed  { background: var(--bad-tint);  color: var(--bad); }
.badge-skipped { background: #f2f4f7; color: var(--ink-soft); }
.badge-deleted { background: #f2f4f7; color: var(--ink-soft); }

/* --- pagination ----------------------------------------------------------- */

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-top: 1px solid var(--line-soft);
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--ink-soft);
}
.pager-links { display: flex; gap: 6px; flex-wrap: wrap; }
.pager-links a, .pager-links span {
  min-width: 34px;
  text-align: center;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink-soft);
  font-weight: 550;
}
.pager-links a:hover { background: #f8f9fb; text-decoration: none; }
.pager-links .is-current { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }
.pager-links .is-disabled { color: #c9cfd8; }

/* --- detail view ---------------------------------------------------------- */

.detail-section + .detail-section { margin-top: 20px; }

table.kv { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.kv th {
  width: 40%;
  text-align: left;
  padding: 10px 16px;
  background: #fafbfc;
  border: 1px solid var(--line-soft);
  font-weight: 600;
  color: var(--ink-soft);
  vertical-align: top;
}
table.kv td {
  padding: 10px 16px;
  border: 1px solid var(--line-soft);
  vertical-align: top;
  word-break: break-word;
}
table.kv td.is-empty { color: var(--ink-faint); }

.sub-table-label {
  font-weight: 650;
  color: var(--ink-soft);
  margin: 18px 0 8px;
  font-size: 13px;
}

table.sub { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.sub th {
  text-align: left;
  padding: 8px 13px;
  background: #f2f4f7;
  border: 1px solid var(--line-soft);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  font-weight: 700;
}
table.sub td { padding: 8px 13px; border: 1px solid var(--line-soft); }

.secret { display: inline-flex; align-items: center; gap: 9px; }
.secret code {
  background: #f2f4f7;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12.5px;
  letter-spacing: 0.06em;
}

pre.payload {
  margin: 0;
  padding: 15px;
  background: #151b28;
  color: #d7e0ea;
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.6;
  overflow-x: auto;
  max-height: 460px;
}

details.raw > summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink-soft);
  padding: 4px 0;
}

/* --- alerts --------------------------------------------------------------- */

.alert {
  border-radius: var(--radius-sm);
  padding: 12px 15px;
  font-size: 13.5px;
  margin-bottom: 18px;
  border: 1px solid transparent;
}
.alert-ok   { background: var(--ok-tint);   border-color: var(--ok-line);   color: var(--ok); }
.alert-bad  { background: var(--bad-tint);  border-color: var(--bad-line);  color: #b42318; }
.alert-info { background: var(--info-tint); border-color: #c7d7fe;          color: var(--info); }

/* --- login page ----------------------------------------------------------- */

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(237, 73, 46, 0.28), transparent 60%),
    radial-gradient(700px 420px at -10% 110%, rgba(23, 92, 211, 0.18), transparent 60%),
    linear-gradient(165deg, #141a26 0%, #1d2635 60%, #232b3a 100%);
}
.login-box { width: 100%; max-width: 392px; }

.login-logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
}
.login-logo { height: 58px; width: auto; }
.login-logo-sub {
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: rgba(255, 255, 255, 0.55);
}

.login-card {
  width: 100%;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(5, 9, 16, 0.45);
  padding: 30px 32px 26px;
}
.login-title { font-size: 19px; margin-bottom: 4px; }
.login-card p.sub { margin: 0 0 22px; color: var(--ink-faint); font-size: 13.5px; }
.login-card .field { margin-bottom: 15px; }
.login-card .field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.login-card input { padding: 10px 12px; }
.login-card .btn-primary { width: 100%; padding: 10px; font-size: 14px; margin-top: 4px; }
.login-hint {
  margin: 20px 0 0;
  font-size: 12px;
  color: var(--ink-faint);
  border-top: 1px solid var(--line-soft);
  padding-top: 14px;
  line-height: 1.65;
}

/* --- misc ----------------------------------------------------------------- */

.muted { color: var(--ink-faint); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.inline-form { display: inline; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 15px;
  max-width: 640px;
}
.form-grid .field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

@media (max-width: 640px) {
  .wrap { padding: 20px 14px 50px; }
  .topbar { padding: 8px 14px; }
  .topbar-user strong { display: none; }
  table.kv th { width: 46%; }
}

/* --- change-password card ------------------------------------------------ */
/* Match one column of .form-grid, so "Current password" lines up with the
   "New password" field directly below it instead of stretching full width. */
.pw-current { max-width: calc((640px - 15px) / 2); }

.pw-new { margin-top: 15px; }

.field-hint { margin: 6px 0 0; }
.field-hint.is-bad { color: var(--bad); }
.field-hint.is-ok  { color: var(--ok); }

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

/* --- submissions rework (skill pass): data rows are the hero ------------- */

/* Quiet, single-line toolbar. */
.filters { padding: 12px 16px; gap: 10px; align-items: center; }
.filters .field-date { flex: 0 0 150px; min-width: 140px; }
.filter-sep { color: var(--ink-faint); }
.filter-reset {
  color: var(--ink-soft);
  font-size: 13px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
}
.filter-reset:hover { background: var(--line-soft); color: var(--ink); text-decoration: none; }

/* Denser, readable rows. */
table.data th { font-size: 10.5px; }
table.data td { padding: 12px 14px; }
table.data .cell-title { font-weight: 600; }
table.data .badge { font-size: 12px; padding: 4px 10px; }

/* View is the primary row action; Delete stays quiet until hovered. */
.data .btn-danger {
  background: transparent;
  border-color: transparent;
  color: var(--ink-faint);
  box-shadow: none;
}
.data .btn-danger:hover {
  background: var(--bad-tint);
  border-color: var(--bad-line);
  color: var(--bad);
}
