/* styles.css — HeritageLinc Administration */

:root {
  --ink: #14201d;
  --ink-soft: #47564f;
  --ink-faint: #7d8b84;
  --teal: #0c4a46;
  --teal-deep: #08312e;
  --teal-lift: #14625a;
  --paper: #edf0ec;
  --paper-raised: #f7f9f6;
  --line: #d5ddd7;
  --gold: #b8862b;
  --gold-wash: #f3e9d4;
  --red: #a3382f;
  --red-wash: #f6e6e4;
  --green: #2f6b4f;
  --green-wash: #e2eee8;

  --serif: 'Newsreader', Georgia, serif;
  --sans: 'Karla', system-ui, -apple-system, sans-serif;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  font-size: 15px;
  min-height: 100vh;
}

/* ==================================================== LANDING / AUTH */

.split { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; }

.panel-dark {
  background: var(--teal-deep);
  color: #e8f0ed;
  padding: 56px 56px 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

/* Faint lattice, echoing the capiz-window motif in the mobile app.
   Decoration is confined to this one surface. */
.panel-dark::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(45deg, rgba(255,255,255,.045) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,.045) 0 1px, transparent 1px 34px);
  mask-image: linear-gradient(to bottom, #000 0%, transparent 70%);
  pointer-events: none;
}

.panel-dark > * { position: relative; }

.panel-light { padding: 56px; display: flex; align-items: center; justify-content: center; }
.form-wrap { width: 100%; max-width: 380px; }

.wordmark {
  font-family: var(--serif);
  font-size: 15px;
  color: var(--gold);
  margin-bottom: 72px;
}

.lede {
  font-family: var(--serif);
  font-size: clamp(34px, 4.2vw, 50px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -.015em;
  max-width: 12ch;
  margin-bottom: 26px;
}

.lede em { font-style: italic; color: var(--gold); }

.blurb { font-size: 15px; color: rgba(232,240,237,.72); max-width: 40ch; margin-bottom: 40px; }

.duties { list-style: none; max-width: 42ch; }

.duties li {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 12px;
  padding: 13px 0;
  border-top: 1px solid rgba(255,255,255,.11);
  font-size: 14px;
  color: rgba(232,240,237,.82);
}

.duties svg { width: 16px; height: 16px; margin-top: 3px; stroke: var(--gold); }

.fineprint { font-size: 12.5px; color: rgba(232,240,237,.42); max-width: 44ch; }

/* ============================================================= FORMS */

h1.form-title {
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 500;
  letter-spacing: -.01em;
  margin-bottom: 6px;
}

.form-sub { color: var(--ink-soft); font-size: 14px; margin-bottom: 30px; }

.field { margin-bottom: 17px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }

.field input,
.field select,
.field textarea {
  width: 100%;
  font-family: var(--sans);
  font-size: 14.5px;
  color: var(--ink);
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 13px;
  transition: border-color .15s, box-shadow .15s;
}

.field textarea { resize: vertical; min-height: 90px; }

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(12,74,70,.12);
}

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { font-size: 12.5px; color: var(--ink-faint); margin-top: 6px; }

/* =========================================================== BUTTONS */

.btn {
  font-family: var(--sans);
  font-size: 14.5px;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  padding: 12px 18px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}

.btn:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

.btn-primary { background: var(--teal); color: #fff; width: 100%; }
.btn-primary:hover:not(:disabled) { background: var(--teal-lift); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }

.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--teal); }

.btn-approve { background: var(--green); color: #fff; }
.btn-approve:hover:not(:disabled) { background: #275a42; }
.btn-reject { background: transparent; border-color: var(--red); color: var(--red); }
.btn-reject:hover:not(:disabled) { background: var(--red-wash); }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.linkbtn {
  background: none; border: none;
  font-family: var(--sans);
  font-size: 14px; color: var(--teal); font-weight: 600;
  cursor: pointer; padding: 0;
  text-decoration: underline; text-underline-offset: 3px;
}

.swap {
  margin-top: 26px; padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 14px; color: var(--ink-soft);
}

/* =========================================================== NOTICES */

.notice {
  border-radius: var(--r-md);
  padding: 13px 15px;
  font-size: 13.5px;
  line-height: 1.5;
  margin-bottom: 20px;
  display: none;
}

.notice.show { display: block; }
.notice-error { background: var(--red-wash); color: var(--red); }
.notice-info { background: var(--gold-wash); color: #7a5c12; }
.notice-ok { background: var(--green-wash); color: var(--green); }
.notice strong { display: block; margin-bottom: 3px; }

/* ========================================================= DASHBOARD */

.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }

.sidebar {
  background: var(--teal-deep);
  color: #e8f0ed;
  padding: 26px 18px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar .wordmark { margin-bottom: 30px; padding-left: 12px; }

.nav { list-style: none; flex: 1; }

.nav button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  background: none;
  border: none;
  border-radius: var(--r-md);
  color: rgba(232,240,237,.72);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 12px;
  margin-bottom: 3px;
  cursor: pointer;
  text-align: left;
  transition: background .15s, color .15s;
}

.nav button:hover { background: rgba(255,255,255,.06); color: #e8f0ed; }
.nav button[aria-current='true'] { background: rgba(255,255,255,.11); color: #fff; font-weight: 600; }
.nav svg { width: 17px; height: 17px; flex-shrink: 0; }

.nav .count {
  margin-left: auto;
  background: var(--gold);
  color: var(--teal-deep);
  font-size: 11px;
  font-weight: 700;
  border-radius: 20px;
  padding: 1px 7px;
  min-width: 20px;
  text-align: center;
}

.nav .count:empty, .nav .count[data-n='0'] { display: none; }

.who { border-top: 1px solid rgba(255,255,255,.12); padding-top: 16px; font-size: 13px; }
.who .name { font-weight: 600; margin-bottom: 2px; }
.who .mail { color: rgba(232,240,237,.5); font-size: 12px; margin-bottom: 12px; word-break: break-all; }

.who button {
  background: none;
  border: 1px solid rgba(255,255,255,.2);
  color: rgba(232,240,237,.8);
  border-radius: var(--r-sm);
  font-family: var(--sans);
  font-size: 12.5px;
  padding: 7px 12px;
  cursor: pointer;
  width: 100%;
}

.who button:hover { border-color: rgba(255,255,255,.45); color: #fff; }

.main { padding: 40px 44px 70px; max-width: 900px; }

.page-title {
  font-family: var(--serif);
  font-size: 31px;
  font-weight: 500;
  letter-spacing: -.015em;
  margin-bottom: 6px;
}

.page-sub { color: var(--ink-soft); font-size: 14.5px; margin-bottom: 32px; max-width: 62ch; }

/* --------------------------------------------------------- overview */

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

.stat {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 20px;
}

.stat .n {
  font-family: var(--serif);
  font-size: 34px;
  line-height: 1;
  margin-bottom: 5px;
}

.stat .k { font-size: 12.5px; color: var(--ink-soft); }
.stat.urgent { border-color: var(--gold); background: var(--gold-wash); }
.stat.urgent .n { color: #7a5c12; }

/* ------------------------------------------------------------ queue */

.queue { display: flex; flex-direction: column; gap: 14px; }

.card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px 22px;
}

.card-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 16px; }

.card-head h3 {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 500;
  line-height: 1.25;
  margin-bottom: 3px;
}

.card-head .meta { font-size: 12.5px; color: var(--ink-faint); }

.tag {
  font-size: 11px;
  font-weight: 700;
  border-radius: 20px;
  padding: 3px 9px;
  white-space: nowrap;
}

.tag-gold { background: var(--gold-wash); color: #7a5c12; }
.tag-green { background: var(--green-wash); color: var(--green); }
.tag-red { background: var(--red-wash); color: var(--red); }
.tag-grey { background: #e4e9e5; color: var(--ink-soft); }

.facts { display: grid; grid-template-columns: 132px 1fr; gap: 2px 16px; font-size: 13.5px; margin-bottom: 16px; }
.facts dt { color: var(--ink-faint); padding: 5px 0; }
.facts dd { padding: 5px 0; }
.facts dd.blank { color: var(--ink-faint); font-style: italic; }

.quote {
  border-left: 3px solid var(--gold);
  background: #fff;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  padding: 12px 15px;
  font-size: 13.5px;
  line-height: 1.6;
  margin-bottom: 16px;
}

.evidence { margin-bottom: 16px; }

.evidence a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  color: var(--teal);
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 9px 13px;
  background: #fff;
}

.evidence a:hover { border-color: var(--teal); }
.evidence svg { width: 15px; height: 15px; }

.actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ------------------------------------------------------------ empty */

.empty {
  border: 1px dashed var(--line);
  border-radius: var(--r-lg);
  padding: 46px 30px;
  text-align: center;
}

.empty h3 { font-family: var(--serif); font-size: 20px; font-weight: 500; margin-bottom: 7px; }
.empty p { color: var(--ink-soft); font-size: 14px; max-width: 44ch; margin: 0 auto; }

/* ----------------------------------------------------------- dialog */

.veil {
  position: fixed;
  inset: 0;
  background: rgba(20,32,29,.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 50;
}

.veil.show { display: flex; }

.dialog {
  background: var(--paper-raised);
  border-radius: var(--r-lg);
  padding: 28px;
  width: 100%;
  max-width: 440px;
}

.dialog h2 { font-family: var(--serif); font-size: 22px; font-weight: 500; margin-bottom: 8px; }
.dialog p { font-size: 14px; color: var(--ink-soft); margin-bottom: 20px; }
.dialog .actions { justify-content: flex-end; margin-top: 20px; }

/* -------------------------------------------------------- utilities */

.hidden { display: none !important; }

.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
  vertical-align: -3px;
}

.spinner-dark { border-color: rgba(20,32,29,.2); border-top-color: var(--teal); }

@keyframes spin { to { transform: rotate(360deg); } }

.loading { text-align: center; padding: 50px; color: var(--ink-faint); font-size: 14px; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ------------------------------------------------------------ mobile */

@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  .panel-dark { padding: 36px 26px 30px; }
  .wordmark { margin-bottom: 34px; }
  .lede { font-size: 32px; max-width: none; }
  .duties, .fineprint { display: none; }
  .panel-light { padding: 34px 26px 60px; }

  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 18px 16px; }
  .sidebar .wordmark { margin-bottom: 16px; }
  .nav { display: flex; gap: 4px; overflow-x: auto; }
  .nav button { white-space: nowrap; }
  .nav .label { display: none; }
  .who { margin-top: 14px; }
  .main { padding: 26px 20px 60px; }
  .facts { grid-template-columns: 1fr; gap: 0; }
  .facts dt { padding-bottom: 0; }
}

/* ================================================ SIDEBAR COLLAPSE */

.hamburger {
  background: none;
  border: none;
  color: rgba(232, 240, 237, .75);
  cursor: pointer;
  padding: 8px;
  margin: 0 0 14px 4px;
  border-radius: var(--r-sm);
  display: flex;
}

.hamburger:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.hamburger svg { width: 19px; height: 19px; }

.shell.tight { grid-template-columns: 68px 1fr; }
.shell.tight .label,
.shell.tight .wordmark,
.shell.tight .who .name,
.shell.tight .who .mail { display: none; }
.shell.tight .nav button { justify-content: center; padding: 11px 0; }
.shell.tight .nav .count {
  position: absolute;
  transform: translate(13px, -11px);
  margin: 0;
}
.shell.tight .nav li { position: relative; }
.shell.tight .who button { font-size: 0; padding: 9px 0; }
.shell.tight .who button::before { content: '\2192'; font-size: 15px; }

/* ========================================================= CATALOGUE */

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.toolbar input[type="search"] {
  flex: 1;
  min-width: 200px;
  font-family: var(--sans);
  font-size: 14.5px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 11px 13px;
  color: var(--ink);
}

.toolbar input[type="search"]:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(12, 74, 70, .12);
}

.site-row {
  display: grid;
  grid-template-columns: 84px 1fr auto;
  gap: 16px;
  align-items: center;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 12px 16px 12px 12px;
  margin-bottom: 10px;
}

.site-row.retired { opacity: .55; }

.thumb {
  width: 84px;
  height: 62px;
  border-radius: var(--r-md);
  object-fit: cover;
  background: #dfe6e1;
  display: block;
}

.thumb-blank {
  width: 84px;
  height: 62px;
  border-radius: var(--r-md);
  background: #e2e8e4;
  display: grid;
  place-items: center;
  color: var(--ink-faint);
  font-size: 11px;
}

.site-row h4 {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.25;
  margin-bottom: 3px;
}

.site-row .meta { font-size: 12.5px; color: var(--ink-faint); }

.site-row .snippet {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================================================ EDITOR */

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

.dropzone {
  border: 1px dashed var(--line);
  border-radius: var(--r-md);
  padding: 18px;
  text-align: center;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s;
}

.dropzone:hover { border-color: var(--teal); }
.dropzone p { font-size: 13px; color: var(--ink-soft); margin: 0; }

.preview-img {
  width: 100%;
  max-height: 190px;
  object-fit: cover;
  border-radius: var(--r-md);
  margin-bottom: 10px;
  display: block;
}

.dialog .field-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.checkline {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  margin-bottom: 18px;
}

.checkline input { width: auto; }

@media (max-width: 860px) {
  .shell.tight { grid-template-columns: 1fr; }
  .site-row { grid-template-columns: 64px 1fr; }
  .site-row .actions { grid-column: 1 / -1; }
  .thumb, .thumb-blank { width: 64px; height: 48px; }
  .dialog .field-row-3 { grid-template-columns: 1fr; }
}