/* ── THE BENCH — SHARED STYLES ───────────────────────────────────────────── */
/* Linked by every module page. When embedding modules into a single file,
   paste these once into the top-level <style> block and remove the <link>. */

@import url('https://fonts.googleapis.com/css2?family=Aptos:wght@300;400;700;900&display=swap');

/* ── TOKENS ── */
:root {
  --green:       #73bf43;
  --green-dark:  #5a9e32;
  --green-light: #e9f5df;
  --green-xlight:#f4faf0;
  --grey:        #58585a;
  --grey-light:  #e8e8e8;
  --grey-xlight: #f5f5f5;
  --white:       #ffffff;
  --text:        #2d2d2e;
  --text-muted:  #6b6b6d;
  --border:      #d4d4d4;
  --radius:      10px;
  --radius-sm:   6px;
  --shadow:      0 2px 12px rgba(0,0,0,0.07);
  --shadow-hover:0 6px 24px rgba(0,0,0,0.13);
}

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

/* ── BASE ── */
body {
  font-family: 'Aptos', 'Calibri', sans-serif;
  background: var(--grey-xlight);
  background-image: url('background.png');
  background-size: 100% 100vh;
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
}

/* ── HEADER ── */
header {
  background: var(--white);
  border-bottom: 2.5px solid var(--green);
  padding: 0 2rem;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  color: var(--grey);
  text-decoration: none;
  flex-shrink: 0;
}
.logo-img {
  height: 38px;
  width: auto;
  display: block;
  object-fit: contain;
}
.logo-mark {
  width: 32px;
  height: 32px;
  background: var(--green);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 900;
  font-size: 15px;
  flex-shrink: 0;
}

.header-divider {
  width: 1px;
  height: 22px;
  background: var(--border);
  flex-shrink: 0;
}

.header-module-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-left: auto;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color .15s;
  margin-bottom: .85rem;
  width: fit-content;
}
.back-link:hover { color: var(--green-dark); }
.back-link svg { width: 14px; height: 14px; }

.user-badge {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.user-role {
  background: var(--green-light);
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── LAYOUT ── */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.page-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.page-header h1 {
  font-size: 22px;
  font-weight: 700;
  flex: 1;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: .5rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
  border: none;
  font-family: inherit;
  white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.btn-primary { background: var(--green); color: white; }
.btn-primary:hover { background: var(--green-dark); }
.btn-secondary { background: var(--white); color: var(--text); border: 1.5px solid var(--border); }
.btn-secondary:hover { border-color: var(--green); color: var(--green-dark); }
.btn-ghost { background: none; color: var(--text-muted); }
.btn-ghost:hover { color: var(--green-dark); background: var(--green-xlight); }
.btn-sm { padding: .3rem .75rem; font-size: 12.5px; }

.link-btn {
  background: none;
  border: none;
  color: var(--green-dark);
  font-size: 12px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  text-decoration: none;
}
.link-btn:hover { text-decoration: underline; }
.link-btn svg { width: 12px; height: 12px; }

/* ── BADGES ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
}
.badge-green { background: var(--green-light); color: var(--green-dark); }
.badge-grey  { background: var(--grey-light);  color: var(--grey); }
.badge-orange{ background: #fff3e0; color: #e65100; }
.badge-blue  { background: #e3f0ff; color: #1a5fbd; }

/* ── CARD ── */
.card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

/* ── STATUS DOTS ── */
.sdot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
}
.sdot::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sdot.new::before      { background: var(--green); }
.sdot.reviewed::before { background: #f59e0b; }
.sdot.approved::before { background: #2563eb; }
.sdot.declined::before { background: #dc2626; }

/* ── DATA TABLE ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th {
  text-align: left;
  padding: .6rem .85rem;
  font-weight: 700;
  font-size: 11.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 1.5px solid var(--border);
  background: var(--grey-xlight);
  white-space: nowrap;
}
.data-table td {
  padding: .7rem .85rem;
  border-bottom: 1px solid var(--grey-xlight);
  color: var(--text);
  vertical-align: middle;
}
.data-table tr:hover td { background: var(--green-xlight); }
.data-table tr:last-child td { border-bottom: none; }

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}
.empty-state svg {
  width: 40px;
  height: 40px;
  margin: 0 auto .75rem;
  display: block;
  opacity: .3;
}
.empty-state p { font-size: 13.5px; }

/* ── MODAL ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.modal-backdrop.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--white);
  border-radius: var(--radius);
  width: 100%;
  max-width: 540px;
  box-shadow: 0 12px 40px rgba(0,0,0,.2);
  transform: translateY(20px);
  transition: transform .2s;
}
.modal-backdrop.open .modal { transform: translateY(0); }
.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: .75rem;
}
.modal-header h2 { font-size: 16px; font-weight: 700; flex: 1; }
.modal-body {
  padding: 1.25rem 1.5rem;
  max-height: 65vh;
  overflow-y: auto;
}
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: .75rem;
  justify-content: flex-end;
  align-items: center;
}

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--text);
  color: white;
  padding: .75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
  transform: translateY(80px);
  opacity: 0;
  transition: all .25s;
  z-index: 999;
  max-width: 320px;
}
.toast.show  { transform: translateY(0); opacity: 1; }
.toast.success { background: var(--green-dark); }
.toast svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ── FORM INPUTS (shared) ── */
.form-group { margin-bottom: 1rem; }
.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.form-input,
.form-select {
  width: 100%;
  padding: .55rem .8rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  outline: none;
  transition: border-color .12s;
}
.form-input:focus,
.form-select:focus { border-color: var(--green); }
.form-select { cursor: pointer; }

/* ── DESCRIPTOR BOX ── */
.descriptor-box {
  background: var(--green-xlight);
  border: 1.5px solid var(--green-light);
  border-radius: var(--radius);
  padding: 1rem 1.35rem;
  margin-bottom: 1.5rem;
  font-size: 15px;
  color: var(--text);
  line-height: 1.7;
  width: 100%;
}

/* ── SETTINGS BUTTON ── */
.settings-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  transition: all .15s;
  flex-shrink: 0;
  border: none;
  background: none;
  cursor: pointer;
}
.settings-btn:hover { background: var(--grey-light); color: var(--text); }
.settings-btn svg { width: 18px; height: 18px; }

/* ── DARK MODE ── */
html.dark-mode {
  --white:       #1e1f22;
  --grey-xlight: #2b2d30;
  --grey-light:  #3c3f44;
  --border:      #4a4d52;
  --text:        #dfe1e5;
  --text-muted:  #8a8f99;
  --green-light: #1e3a14;
  --green-xlight:#172610;
}
html.dark-mode body {
  background: #16171a;
  background-image: none;
  color: var(--text);
}
html.dark-mode header,
html.dark-mode .modal,
html.dark-mode .toast { background: var(--white); }
html.dark-mode .data-table th { background: var(--grey-xlight); }
html.dark-mode .form-input,
html.dark-mode .form-select { background: var(--white); }

/* ── PAGE TRANSITION ──────────────────────────────────────────────────────────
   A full-screen overlay coloured to match the page background (white in light
   mode, near-black grey in dark mode). On load it fades out, so each page fades
   in. nav.js adds .tb-leaving to <html> on nav clicks to fade it back in before
   navigating, giving a smooth cross-fade between pages. */
html::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #f5f5f5;
  pointer-events: none;
  opacity: 0;
  animation: tb-page-fade-in .28s ease-out;
}
html.dark-mode::before { background: #16171a; }

@keyframes tb-page-fade-in {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* Fade the overlay back in while navigating away */
html.tb-leaving::before {
  animation: none;
  opacity: 1;
  pointer-events: all;
  transition: opacity .2s ease-in;
}

@media (prefers-reduced-motion: reduce) {
  html::before { animation: none; opacity: 0; }
  html.tb-leaving::before { transition: none; opacity: 0; }
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  header { padding: 0 1rem; }
  main { padding: 1rem; }
  .header-module-name { display: none; }
}
