/* ============================================================
   The Shepherd's Bridge — Shared Stylesheet
   Brand tokens, typography, layout primitives, and shared UI
   ============================================================ */

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

/* Brand tokens */
:root {
  --navy: #1B365D;
  --navy-light: #2A4A7A;
  --navy-dark: #11233F;
  --orange: #FFA82E;
  --orange-hover: #E8961F;
  --emerald: #2D8B55;
  --emerald-light: #E7F3EC;
  --cream: #F5F1EA;
  --cream-deep: #EDE5D6;
  --charcoal: #2C2C2C;
  --white: #FFFFFF;
  --grey: #6B7280;
  --grey-light: #D0CCC4;
  --border-subtle: rgba(27,54,93,0.08);
  --border-muted: #D0CCC4;
}

/* Base */
body {
  font-family: 'Lato', sans-serif;
  font-weight: 300;
  color: var(--charcoal);
  background: var(--cream);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Typography */
h1, h2, h3, h4 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.2;
}

h1 { font-size: 36px; margin-bottom: 12px; }
h2 { font-size: 22px; margin: 24px 0 10px; }
h3 { font-size: 18px; margin: 20px 0 8px; }

p { font-size: 15px; line-height: 1.7; margin-bottom: 12px; }

.muted { color: #888; font-size: 14px; }
.small-muted { color: #666; font-size: 13px; }

/* ------------------------------------------------------------
   Layout
   ------------------------------------------------------------ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.container.narrow {
  max-width: 1000px;
}

.card {
  background: var(--white);
  border-radius: 12px;
  padding: 40px;
  box-shadow: 0 2px 20px rgba(27,54,93,0.08);
}

/* ------------------------------------------------------------
   Nav
   ------------------------------------------------------------ */
nav.app-nav {
  background: var(--navy);
  padding: 16px 0;
}

nav.app-nav .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-name {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 600;
  font-size: 26px;
  color: var(--white);
  text-decoration: none;
  letter-spacing: 0.02em;
  /* Bridge mark + wordmark layout (per Mark's website implementation brief) */
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
}

.brand-mark {
  height: 1.05em;
  width: auto;
  flex-shrink: 0;
  display: block;
}

.brand-name-text {
  display: inline;
}

.brand-block {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-tagline {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 400;
  font-style: italic;
  font-size: 13px;
  color: var(--orange);
  margin-top: 2px;
  letter-spacing: 0.06em;
}

.admin-badge {
  background: var(--orange);
  color: var(--navy);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-left: 12px;
  display: inline-block;
  vertical-align: middle;
}

/* ------------------------------------------------------------
   Buttons
   ------------------------------------------------------------ */
.btn {
  display: inline-block;
  font-family: 'Lato', sans-serif;
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 10px 20px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}

.btn-primary {
  background: var(--orange);
  color: var(--navy);
  box-shadow: 0 2px 10px rgba(255,168,46,0.3);
}

.btn-primary:hover {
  background: var(--orange-hover);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  border: 1.5px solid var(--white);
  color: var(--white);
  padding: 8px 18px;
  font-size: 13px;
}

.btn-ghost:hover {
  background: rgba(255,255,255,0.1);
}

.btn-block {
  display: block;
  width: 100%;
  padding: 14px;
  font-size: 14px;
  letter-spacing: 0.08em;
  margin-top: 8px;
}

.logout-form { margin: 0; }

/* ------------------------------------------------------------
   Forms
   ------------------------------------------------------------ */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--navy);
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border-muted);
  border-radius: 6px;
  font-family: 'Lato', sans-serif;
  font-size: 15px;
  color: var(--charcoal);
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(27,54,93,0.1);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  font-size: 14px;
  color: #555;
}

.checkbox-row label {
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
  margin: 0;
  font-size: 14px;
  color: #555;
}

.helper-text {
  font-size: 12px;
  color: #888;
  margin-top: 4px;
}

/* ------------------------------------------------------------
   Auth card
   ------------------------------------------------------------ */
body.auth {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  background: var(--white);
  max-width: 480px;
  width: 100%;
  border-radius: 12px;
  padding: 40px 36px;
  box-shadow: 0 2px 24px rgba(27,54,93,0.08);
}

.brand-header {
  text-align: center;
  margin-bottom: 32px;
}

.brand-header .brand-name {
  color: var(--navy);
  font-size: 30px;
}

.brand-header .brand-tagline {
  font-size: 16px;
  margin-top: 4px;
}

.auth-card h1 {
  font-size: 26px;
  margin-bottom: 8px;
  text-align: center;
}

.auth-card .subtitle {
  text-align: center;
  color: #666;
  font-size: 14px;
  margin-bottom: 28px;
}

.auth-links {
  margin-top: 22px;
  text-align: center;
  font-size: 13px;
  color: #666;
}

.auth-links a {
  color: var(--navy);
  text-decoration: none;
  font-weight: 700;
}

.auth-links a:hover {
  text-decoration: underline;
}

/* ------------------------------------------------------------
   Alerts & messages
   ------------------------------------------------------------ */
.validation-errors {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 20px;
}

.validation-errors p {
  font-weight: 700;
  font-size: 13px;
  color: #991B1B;
  margin-bottom: 6px;
}

.validation-errors ul {
  list-style: disc;
  padding-left: 20px;
  margin: 0;
}

.validation-errors li {
  font-size: 13px;
  color: #B91C1C;
  margin-bottom: 2px;
}

.status-message {
  background: #ECFDF5;
  border: 1px solid #6EE7B7;
  color: #065F46;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 18px;
  font-size: 14px;
}

/* ------------------------------------------------------------
   Portal / Admin specifics
   ------------------------------------------------------------ */
.page-container {
  max-width: 1000px;
  margin: 48px auto;
  padding: 0 24px;
}

.page-container.wide {
  max-width: 1200px;
}

.meta-row {
  display: flex;
  gap: 32px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
  font-size: 13px;
  color: #666;
  flex-wrap: wrap;
}

.meta-row strong {
  color: var(--navy);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 11px;
  display: block;
  margin-bottom: 2px;
}

.feature-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
}

.feature-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 14px;
  color: #555;
  display: flex;
  align-items: center;
  gap: 10px;
}

.feature-list li:last-child {
  border-bottom: none;
}

.feature-list li::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #C0BAB0;
  flex-shrink: 0;
}

/* ============================================================
   Admin Console — sub-nav, tables, status pills, stat cards,
   health dots. Used only on /admin/* pages.
   ============================================================ */

.admin-subnav {
  background: #fff;
  border-bottom: 1px solid rgba(27,54,93,0.08);
  padding: 0;
}
.admin-subnav .container {
  display: flex;
  gap: 4px;
  padding: 0 24px;
}
.admin-subnav-link {
  display: inline-block;
  padding: 14px 18px;
  text-decoration: none;
  color: #555;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 3px solid transparent;
  transition: color 120ms ease, border-color 120ms ease;
}
.admin-subnav-link:hover { color: var(--navy); }
.admin-subnav-link.is-active {
  color: var(--navy);
  border-bottom-color: var(--orange);
}

/* Stat cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.stat-card {
  background: #FAFAFA;
  border: 1px solid rgba(27,54,93,0.08);
  border-radius: 10px;
  padding: 16px 18px;
}
.stat-card-warn { background: #FFF6E5; border-color: #F2C57A; }
.stat-card-good { background: #E8F4EB; border-color: #9DCAA9; }
.stat-card-bad  { background: #FBE8E4; border-color: #DC9D8E; }
.stat-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6b7e8a;
  margin-bottom: 6px;
}
.stat-value {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 36px;
  font-weight: 600;
  color: var(--navy);
  line-height: 1;
}
.stat-sub {
  font-size: 12px;
  color: #888;
  margin-top: 6px;
}

/* Tables */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}
.admin-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #6b7e8a;
  padding: 12px 10px;
  border-bottom: 1px solid rgba(27,54,93,0.08);
}
.admin-table td {
  padding: 14px 10px;
  border-bottom: 1px solid rgba(27,54,93,0.05);
  font-size: 14px;
  vertical-align: top;
}
.admin-table tbody tr:hover { background: #FAFAFA; }

/* Status pills */
.status-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: capitalize;
  background: #EEE;
  color: #555;
  white-space: nowrap;
}
.status-pill-pending,
.status-pill-discovering,
.status-pill-processing,
.status-pill-transcribing,
.status-pill-drafting,
.status-pill-qa { background: #E5EEF7; color: #1B365D; }
.status-pill-awaiting_review { background: #FFF6E5; color: #8A5A00; }
.status-pill-approved,
.status-pill-delivering { background: #E8F0FB; color: var(--navy); }
.status-pill-completed { background: #E8F4EB; color: #1B5A2B; }
.status-pill-failed { background: #FBE8E4; color: #8A2A19; }
.status-pill-info { background: #F0F0F0; color: #555; }

/* Filter / search row */
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 18px 0 10px;
}
.filter-pill {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: capitalize;
  text-decoration: none;
  background: #F0EEE9;
  color: #555;
  border: 1px solid transparent;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.filter-pill:hover { background: #E5E0D5; color: var(--navy); }
.filter-pill.is-active {
  background: var(--navy);
  color: #fff;
}
.filter-search {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.filter-search-input {
  flex: 1;
  min-width: 240px;
  padding: 10px 14px;
  border: 1px solid var(--border-muted, #D0CCC4);
  border-radius: 6px;
  font: inherit;
}
.filter-search-input:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(27,54,93,0.10);
}

/* Submission detail meta grid */
.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(27,54,93,0.08);
}
.meta-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6b7e8a;
  margin-bottom: 4px;
}
.meta-value { font-size: 14px; color: var(--charcoal, #2C2C2C); line-height: 1.5; word-break: break-word; }

/* Card-inset for content blocks inside cards */
.card-inset {
  background: #FAFAFA;
  border: 1px solid rgba(27,54,93,0.06);
  border-radius: 8px;
  padding: 16px 18px;
  font-size: 14px;
  line-height: 1.65;
  color: #3a3a3a;
}
.card-inset h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 8px 0;
  letter-spacing: 0.02em;
}
.card-inset p { margin: 0 0 10px 0; }
.card-inset p:last-child { margin-bottom: 0; }

/* Side-by-side AI vs edited */
.diff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
  margin-top: 12px;
}

/* Rerun button row */
.rerun-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.rerun-btn {
  text-transform: capitalize;
  font-size: 13px;
  padding: 8px 14px;
  letter-spacing: 0;
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--navy);
}
.rerun-btn:hover { background: var(--navy); color: #fff; }

/* Failed-job reason cell */
.failed-reason {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  color: #8a2a19;
  background: #FBE8E4;
  border: 1px solid #DC9D8E;
  border-radius: 4px;
  padding: 6px 8px;
  max-width: 480px;
  white-space: pre-wrap;
}

/* Health page */
.health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 24px;
}
.health-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 10px;
  border: 1px solid rgba(27,54,93,0.08);
  background: #FAFAFA;
}
.health-card-ok { background: #E8F4EB; border-color: #9DCAA9; }
.health-card-down { background: #FBE8E4; border-color: #DC9D8E; }
.health-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #999;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.6);
}
.health-card-ok .health-dot { background: var(--emerald); }
.health-card-down .health-dot { background: #C53030; }
.health-label {
  font-weight: 700;
  font-size: 13px;
  color: var(--navy);
  margin-bottom: 2px;
}
.health-detail {
  font-size: 12px;
  color: #555;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.6;
}
.alert-success { background: #E8F4EB; border: 1px solid #9DCAA9; color: #1B5A2B; }
.alert-error { background: #FBE8E4; border: 1px solid #DC9D8E; color: #8A2A19; }

/* Inline link button */
.btn-link {
  background: transparent;
  border: none;
  padding: 0;
  color: var(--navy);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
}
.btn-link:hover { color: var(--orange-hover, #E8961F); text-decoration: underline; }

/* ------------------------------------------------------------
   Pagination (custom text-only view at resources/views/pagination/simple.blade.php)
   ------------------------------------------------------------ */
.pagination { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 24px 0 8px; }
.pagination-list { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 0; margin: 0; }
.pagination-item a,
.pagination-item span {
  display: inline-block;
  min-width: 36px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  color: var(--navy);
  background: var(--white);
  border: 1px solid var(--border-muted);
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}
.pagination-item a:hover { background: var(--navy); color: var(--white); border-color: var(--navy); }
.pagination-item.active span { background: var(--navy); color: var(--white); border-color: var(--navy); }
.pagination-item.disabled span { color: #BBB; background: #F5F5F2; cursor: not-allowed; }
.pagination-item svg { display: none; }
.pagination-meta { font-size: 12px; color: #888; margin: 0; }
