/* ───────────────────────────────────────────────────────────────────────────
 * PageShield Portal — main.css (Batch 1)
 *
 * Slim version of the marketing-site CSS. Batch 1 only needs: nav, footer,
 * a simple hero for the placeholder/404/500 pages. Batch 2 adds signup,
 * login forms, etc.
 *
 * Design tokens exactly mirror the marketing site — same colours, same
 * fonts, same spacing. The PageShield design system is one thing, the
 * portal is a different surface that happens to wear the same clothes.
 * ────────────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ─── SELF-HOSTED FONTS ─────────────────────────────────────────────── */
@font-face {
  font-family: "Instrument Serif";
  font-style: normal; font-weight: 400; font-display: swap;
  src: url("/static/fonts/instrument-serif-v5-latin-regular.woff2") format("woff2");
}
@font-face {
  font-family: "Instrument Serif";
  font-style: italic; font-weight: 400; font-display: swap;
  src: url("/static/fonts/instrument-serif-v5-latin-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Geist";
  font-style: normal; font-weight: 300; font-display: swap;
  src: url("/static/fonts/geist-v4-latin-300.woff2") format("woff2");
}
@font-face {
  font-family: "Geist";
  font-style: normal; font-weight: 400; font-display: swap;
  src: url("/static/fonts/geist-v4-latin-regular.woff2") format("woff2");
}
@font-face {
  font-family: "Geist";
  font-style: normal; font-weight: 500; font-display: swap;
  src: url("/static/fonts/geist-v4-latin-500.woff2") format("woff2");
}
@font-face {
  font-family: "Geist";
  font-style: normal; font-weight: 600; font-display: swap;
  src: url("/static/fonts/geist-v4-latin-600.woff2") format("woff2");
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal; font-weight: 400; font-display: swap;
  src: url("/static/fonts/geist-mono-v4-latin-regular.woff2") format("woff2");
}

/* ─── DESIGN TOKENS ──────────────────────────────────────────────────── */
:root {
  --white:  #FAFAF8;
  --off:    #F2F0EC;
  --rule:   #DDDAD4;
  --mid:    #6E6B65;
  --body:   #2E2C29;
  --ink:    #0F0E0C;
  --teal:   #1A4A4A;
  --teal-d: #0F3333;
  --pop:    #2D7A6A;
  --glow:   #3ABFA0;

  --serif: "Instrument Serif", Georgia, serif;
  --sans:  "Geist", system-ui, Arial, sans-serif;
  --mono:  "Geist Mono", Consolas, monospace;
}

/* ─── BASE ────────────────────────────────────────────────────────────── */
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  font-weight: 300;
  color: var(--body);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; padding-top: 56px; /* account for fixed nav */ }

a { color: inherit; text-decoration: none; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 0.5rem 1rem;
  background: var(--ink);
  color: var(--white);
}
.skip-link:focus { left: 0; z-index: 999; }

/* ─── NAV ─────────────────────────────────────────────────────────────── */
nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 200;
  height: 56px;
  background: rgba(250,250,248,0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--rule);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.logo-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--glow);
  display: inline-block;
}
.nav-r { display: flex; align-items: center; gap: 1.5rem; }
.nav-link {
  font-size: 0.8rem;
  color: var(--mid);
  letter-spacing: 0.01em;
}
.nav-link:hover { color: var(--ink); }

/* ─── HERO-SIMPLE (placeholder / 404 / 500) ──────────────────────────── */
.hero-simple {
  padding: 7rem 0 5rem;
  min-height: calc(100vh - 56px - 120px);  /* fill space above footer */
  display: flex;
  align-items: center;
}
.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2.5rem;
  width: 100%;
}

.lbl {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.lbl::after {
  content: "";
  width: 3rem;
  height: 1px;
  background: var(--rule);
}

.h1 {
  font-family: var(--serif);
  font-size: clamp(2.5rem, 4.5vw, 4.5rem);
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.022em;
  line-height: 1.05;
  margin-bottom: 2rem;
  max-width: 640px;
}
.h1 em {
  font-style: italic;
  color: var(--pop);
}

.lead {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 1rem;
  color: var(--mid);
  max-width: 540px;
  margin-bottom: 1.25rem;
  line-height: 1.7;
}

.text-link {
  color: var(--teal);
  border-bottom: 1px solid var(--rule);
  transition: border-color 0.2s ease;
}
.text-link:hover {
  border-bottom-color: var(--teal);
}

/* ─── FOOTER ──────────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--rule);
  padding: 2rem 0;
  margin-top: auto;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
}
.footer-copy,
.footer-link {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--mid);
}
.footer-link:hover { color: var(--ink); }
.footer-sep { color: var(--rule); font-size: 0.72rem; }

/* ─── RESPONSIVE ──────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .nav-inner { padding: 0 1.5rem; }
  .wrap { padding: 0 1.5rem; }
  .hero-simple { padding: 5rem 0 3rem; }
  .footer-inner {
    padding: 0 1.5rem;
    flex-direction: column;
    gap: 0.5rem;
  }
  .footer-sep { display: none; }
}
/* ───────────────────────────────────────────────────────────────────────────
 * PageShield Portal — main.css (Batch 2 additions)
 *
 * New styles for: auth forms, flash messages, TOTP enrolment layout,
 * backup code display, dashboard cards, rate-limit page.
 *
 * Appended to the Batch 1 main.css during deploy. Design tokens
 * (colours, fonts) are inherited from Batch 1.
 * ────────────────────────────────────────────────────────────────────── */

/* ─── AUTH LAYOUT ─────────────────────────────────────────────────────── */
.auth-section {
  padding: 5rem 0 4rem;
  min-height: calc(100vh - 56px - 120px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.auth-wrap {
  width: 100%;
  max-width: 440px;
  padding: 0 2rem;
}

.auth-h1 {
  font-family: var(--serif);
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.022em;
  line-height: 1.05;
  margin-bottom: 1.25rem;
}
.auth-h1 em {
  font-style: italic;
  color: var(--pop);
}

.auth-form {
  margin-top: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ─── FIELDS ──────────────────────────────────────────────────────────── */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field label {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mid);
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"] {
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--ink);
  background: var(--off);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.72rem 0.85rem;
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(26, 74, 74, 0.1);
}

.field .muted {
  color: var(--mid);
  font-weight: 300;
  text-transform: none;
  letter-spacing: 0;
}

.field-check label {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 300;
  text-transform: none;
  letter-spacing: 0;
  color: var(--body);
  line-height: 1.6;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  cursor: pointer;
}
.field-check input[type="checkbox"] {
  margin-top: 0.18rem;
  accent-color: var(--teal);
  flex-shrink: 0;
}

.code-input {
  font-family: var(--mono);
  font-size: 1.4rem !important;
  letter-spacing: 0.4em;
  text-align: center;
  padding: 0.9rem !important;
}
.code-input-wide {
  font-family: var(--mono);
  font-size: 1.1rem !important;
  letter-spacing: 0.2em;
  text-align: center;
  padding: 0.9rem !important;
}

.err {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: #B42828;
  background: rgba(180, 40, 40, 0.06);
  border: 1px solid rgba(180, 40, 40, 0.15);
  border-radius: 3px;
  padding: 0.4rem 0.6rem;
  margin: 0.25rem 0 0;
}

/* ─── BUTTONS ─────────────────────────────────────────────────────────── */
.btn-primary {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: #FFFFFF;
  background: var(--teal);
  border: none;
  border-radius: 4px;
  padding: 0.85rem 1.5rem;
  cursor: pointer;
  transition: background 0.15s ease;
  margin-top: 0.25rem;
}
.btn-primary:hover { background: var(--teal-d); }

.btn-secondary {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--body);
  background: none;
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.78rem 1.5rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-secondary:hover {
  background: var(--ink);
  color: #FFFFFF;
  border-color: var(--ink);
}

.inline-form { display: inline-block; }

/* ─── AUTH LINKS ──────────────────────────────────────────────────────── */
.auth-links {
  margin-top: 1.5rem;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 300;
  color: var(--mid);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.auth-links a {
  color: var(--teal);
  border-bottom: 1px solid var(--rule);
  transition: border-color 0.15s ease;
}
.auth-links a:hover { border-bottom-color: var(--teal); }
.auth-links .sep { color: var(--rule); }

.helper {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--mid);
}

/* ─── FLASH MESSAGES ──────────────────────────────────────────────────── */
.flashes {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1rem 0 1.5rem;
}
.flash {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 300;
  line-height: 1.5;
  padding: 0.75rem 1rem;
  border-radius: 3px;
  border: 1px solid;
}
.flash-info {
  background: rgba(26, 74, 74, 0.05);
  border-color: rgba(26, 74, 74, 0.2);
  color: var(--teal);
}
.flash-warning {
  background: rgba(217, 119, 6, 0.06);
  border-color: rgba(217, 119, 6, 0.2);
  color: #92400E;
}
.flash-error {
  background: rgba(180, 40, 40, 0.06);
  border-color: rgba(180, 40, 40, 0.15);
  color: #B42828;
}

/* ─── TOTP ENROLMENT ──────────────────────────────────────────────────── */
.totp-enrol {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 2rem;
  align-items: start;
  margin: 2rem 0;
  padding: 2rem;
  background: var(--off);
  border: 1px solid var(--rule);
  border-radius: 4px;
}
.totp-qr svg {
  width: 180px;
  height: 180px;
  background: #FFFFFF;
  padding: 0.5rem;
  border-radius: 3px;
}
.totp-info p {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--body);
  margin-bottom: 0.5rem;
  line-height: 1.6;
}
.totp-info .step-label {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--glow);
  margin-top: 1rem;
  margin-bottom: 0.25rem;
}
.totp-info .step-label:first-child { margin-top: 0; }
.totp-secret {
  font-family: var(--mono) !important;
  font-size: 1rem !important;
  letter-spacing: 0.1em;
  background: #FFFFFF;
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.5rem 0.75rem;
  word-break: break-all;
  color: var(--ink) !important;
}
.totp-info .small { font-size: 0.75rem !important; color: var(--mid); }
.totp-info .muted { color: var(--mid); }

.step-label {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--glow);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

/* ─── BACKUP CODES ────────────────────────────────────────────────────── */
.backup-codes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--off);
  border: 1px solid var(--rule);
  border-radius: 4px;
}
.backup-code {
  font-family: var(--mono);
  font-size: 1rem;
  letter-spacing: 0.1em;
  color: var(--ink);
  background: #FFFFFF;
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.75rem 1rem;
  text-align: center;
}

/* ─── DASHBOARD ───────────────────────────────────────────────────────── */
.dash-section {
  padding: 5rem 0 4rem;
  min-height: calc(100vh - 56px - 120px);
}

.dash-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 4px;
  margin: 2.5rem 0 2rem;
}

.dash-card {
  background: var(--white);
  padding: 2rem;
}

.dash-lbl {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--glow);
  margin-bottom: 0.75rem;
}

.dash-val {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 0.4rem;
  line-height: 1.3;
  word-break: break-word;
}
.dash-val-ok { color: var(--pop); }
.dash-val-warn { color: #92400E; }

.dash-sub {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 300;
  color: var(--mid);
  line-height: 1.6;
}

.dash-actions { margin-top: 2rem; }

/* ─── NAV USER MENU (when logged in) ─────────────────────────────────── */
.nav-user {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--mid);
  display: flex;
  align-items: center;
  gap: 1rem;
}
.nav-user-email {
  color: var(--body);
}

/* ─── RESPONSIVE ──────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .auth-section { padding: 3rem 0 2rem; }
  .auth-wrap { padding: 0 1.5rem; }
  .totp-enrol {
    grid-template-columns: 1fr;
    padding: 1.25rem;
  }
  .totp-qr svg { width: 160px; height: 160px; margin: 0 auto; display: block; }
  .dash-grid { grid-template-columns: 1fr; }
  .backup-codes { grid-template-columns: 1fr; }
}

/* Nav logout button — look like an inline link, not a button */
.nav-logout-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.01em;
  color: var(--mid);
  transition: color 0.15s ease;
}
.nav-logout-btn:hover { color: var(--ink); }
/* ───────────────────────────────────────────────────────────────────────────
 * PageShield Portal — main.css (Batch 3 additions)
 *
 * New styles for: multi-link nav, users table, role/status pills, inline
 * action forms, account overview, admin dashboard, audit log table,
 * Google SSO button, search forms, danger zone.
 *
 * Appended to the existing main.css during deploy. Design tokens inherited
 * from Batch 1/2.
 * ────────────────────────────────────────────────────────────────────── */

/* ─── NAV MULTI-LINK ──────────────────────────────────────────────────── */
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-right: 1.5rem;
}
.nav-link-active {
  color: var(--ink);
  border-bottom: 1px solid var(--teal);
  padding-bottom: 2px;
}

/* ─── H1 / H2 DASHBOARD STYLES ────────────────────────────────────────── */
.h1 {
  font-family: var(--serif);
  font-size: clamp(2.5rem, 4vw, 3.5rem);
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.022em;
  line-height: 1.05;
  margin-bottom: 2rem;
}
.h1 em { font-style: italic; color: var(--pop); }

.h2 {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.018em;
  line-height: 1.15;
  margin: 3rem 0 1.5rem;
}
.h2 em { font-style: italic; color: var(--pop); }
.h2-admin { margin-top: 3.5rem; }

.dash-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 960px) {
  .dash-grid-4 { grid-template-columns: 1fr 1fr; }
}

/* ─── USERS TABLE ─────────────────────────────────────────────────────── */
.users-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2rem;
  margin-top: 2rem;
}
.users-list { min-width: 0; }
@media (max-width: 1100px) {
  .users-layout { grid-template-columns: 1fr; }
  .users-invite { order: -1; }
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
  font-size: 0.85rem;
}
.users-table thead th {
  background: var(--off);
  color: var(--mid);
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--rule);
}
.users-table tbody td {
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--rule);
  vertical-align: top;
  color: var(--body);
}
.users-table tbody tr:first-child td { border-top: none; }
.users-table .user-name { font-weight: 400; color: var(--ink); margin-bottom: 2px; }
.users-table .user-email { color: var(--mid); font-size: 0.8rem; font-family: var(--mono); }
.users-table .col-actions { text-align: right; white-space: nowrap; }

/* ─── PILLS ───────────────────────────────────────────────────────────── */
.role-pill, .status-pill {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.55rem;
  border-radius: 2px;
  border: 1px solid var(--rule);
  color: var(--body);
}
.role-agency_owner { background: rgba(26, 74, 74, 0.08); border-color: rgba(26, 74, 74, 0.25); color: var(--teal); }
.role-agency_admin { background: rgba(58, 191, 160, 0.08); border-color: rgba(58, 191, 160, 0.25); color: #1B7964; }
.role-agency_viewer { background: var(--off); }
.role-company_owner { background: var(--ink); border-color: var(--ink); color: #fff; }
.role-company_admin { background: rgba(15, 14, 12, 0.08); }
.role-self {
  font-family: var(--mono);
  font-size: 0.6rem;
  color: var(--mid);
  margin-left: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status-active { background: rgba(5, 150, 105, 0.08); border-color: rgba(5, 150, 105, 0.25); color: #047857; }
.status-pending { background: rgba(217, 119, 6, 0.08); border-color: rgba(217, 119, 6, 0.25); color: #92400E; }
.status-disabled { background: rgba(180, 40, 40, 0.06); border-color: rgba(180, 40, 40, 0.2); color: #B42828; }

.ok-dot { color: var(--pop); font-size: 0.7rem; }
.muted-dot { color: var(--rule); font-size: 0.7rem; }

/* ─── INLINE ACTION BUTTONS ──────────────────────────────────────────── */
.btn-mini {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--body);
  background: none;
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.35rem 0.75rem;
  margin: 0 0.15rem 0.15rem 0;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}
.btn-mini:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-mini.btn-danger { color: #B42828; border-color: rgba(180, 40, 40, 0.25); }
.btn-mini.btn-danger:hover { background: #B42828; color: #fff; border-color: #B42828; }
.btn-mini.btn-warning { color: #92400E; border-color: rgba(217, 119, 6, 0.25); }
.btn-mini.btn-warning:hover { background: #92400E; color: #fff; border-color: #92400E; }

.btn-secondary.btn-danger {
  color: #B42828;
  border-color: rgba(180, 40, 40, 0.25);
}
.btn-secondary.btn-danger:hover { background: #B42828; color: #fff; border-color: #B42828; }

.btn-primary.btn-danger {
  background: #B42828;
}
.btn-primary.btn-danger:hover { background: #8C1515; }

/* ─── ROLE SELECT (inline dropdown in users table) ────────────────────── */
.role-form { margin: 0; }
.role-select {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.55rem;
  border-radius: 2px;
  border: 1px solid var(--rule);
  background: var(--white);
  color: var(--body);
  cursor: pointer;
}
.role-select:focus { outline: none; border-color: var(--teal); }

/* ─── INVITE CARD ─────────────────────────────────────────────────────── */
.invite-card {
  background: var(--off);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1.75rem;
}
.invite-card .lbl { margin-bottom: 0.75rem; }
.invite-card .auth-form { margin-top: 1rem; gap: 1rem; }
.invite-card .btn-primary { width: 100%; }

/* ─── ACCOUNT PAGE ────────────────────────────────────────────────────── */
.account-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 4px;
  margin: 2.5rem 0;
}
.account-card {
  background: var(--white);
  padding: 1.75rem;
}
.account-val {
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--ink);
  margin: 0.5rem 0 0.75rem;
  line-height: 1.3;
  word-break: break-word;
}
@media (max-width: 960px) {
  .account-grid { grid-template-columns: 1fr; }
}

/* ─── GOOGLE SSO BUTTON ───────────────────────────────────────────────── */
.oauth-divider {
  text-align: center;
  font-family: var(--mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--mid);
  margin: 1.5rem 0 1rem;
  position: relative;
}
.oauth-divider::before, .oauth-divider::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 42%;
  height: 1px;
  background: var(--rule);
}
.oauth-divider::before { left: 0; }
.oauth-divider::after { right: 0; }

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--body);
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-google:hover { background: var(--off); border-color: var(--mid); }

/* ─── SEARCH FORM ─────────────────────────────────────────────────────── */
.search-form {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin: 1.5rem 0 1rem;
  flex-wrap: wrap;
}
.search-input, .search-select {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--ink);
  background: var(--off);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.5rem 0.75rem;
}
.search-input { min-width: 220px; }
.search-input:focus, .search-select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(26, 74, 74, 0.1);
}

/* ─── ADMIN DETAILS / COLLAPSIBLE ACTION FORMS ────────────────────────── */
.action-details, .danger-zone {
  display: inline-block;
  margin: 0 0.15rem 0.15rem 0;
}
.action-details summary, .danger-zone summary {
  cursor: pointer;
  list-style: none;
}
.action-details summary::-webkit-details-marker,
.danger-zone summary::-webkit-details-marker { display: none; }

.inline-action-form {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.5rem;
  padding: 0.75rem;
  background: var(--off);
  border: 1px solid var(--rule);
  border-radius: 3px;
  min-width: 260px;
  max-width: 320px;
  position: absolute;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.small-input, .small-textarea {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.4rem 0.6rem;
  width: 100%;
  box-sizing: border-box;
}
.small-textarea { resize: vertical; min-height: 60px; font-family: var(--sans); }

.danger-zone { display: block; margin-top: 2rem; }
.danger-zone[open] summary { margin-bottom: 1rem; }
.danger-body {
  background: rgba(180, 40, 40, 0.03);
  border: 1px solid rgba(180, 40, 40, 0.2);
  border-radius: 4px;
  padding: 1.5rem;
  margin-top: 0.75rem;
}
.danger-body .auth-form { margin-top: 1rem; }

/* ─── AUDIT TABLE (denser) ─────────────────────────────────────────────── */
.audit-table {
  font-size: 0.8rem;
}
.audit-table td.mono { font-family: var(--mono); }
.audit-table td.small { font-size: 0.72rem; }

/* ─── UTILITIES ───────────────────────────────────────────────────────── */
.mono { font-family: var(--mono); }
.small { font-size: 0.78rem !important; }
.text-link {
  color: var(--teal);
  border-bottom: 1px solid var(--rule);
  transition: border-color 0.15s ease;
  text-decoration: none;
}
.text-link:hover { border-bottom-color: var(--teal); }

/* ─── RESPONSIVE ──────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .nav-links { display: none; }  /* on mobile hide main nav; keep logo + logout */
  .users-table { font-size: 0.8rem; }
  .users-table th:nth-child(5),
  .users-table td:nth-child(5) { display: none; }  /* hide last login on mobile */
  .search-input { min-width: 0; width: 100%; }
  .inline-action-form { position: static; }
}
