/* ============================================================
   PTAS FARMS PORTAL — Shared Stylesheet
   Inherits the brand language from index.html:
   forest-green / gold / cream, Fraunces + Manrope + Caveat
   ============================================================ */

:root {
  --green-deep: #1f3833;
  --green-forest: #2d473e;
  --green-vivid: #6faa2e;
  --green-soft: #8fbf52;
  --gold: #d49100;
  --gold-soft: #e8a829;
  --cream: #faf5e8;
  --cream-warm: #f3ead4;
  --paper: #fffcf3;
  --ink: #15211e;
  --muted: #6b7670;
  --line: #e6dec5;
  --danger: #b8351b;
  --warn: #c97300;
  --ok: #4d8b1f;
  --info: #2c6691;
  --shadow-sm: 0 1px 2px rgba(31,56,51,.06), 0 2px 8px rgba(31,56,51,.04);
  --shadow-md: 0 6px 18px rgba(31,56,51,.08), 0 12px 40px rgba(31,56,51,.05);
  --shadow-lg: 0 20px 50px rgba(31,56,51,.18);
  --r-sm: 10px;
  --r-md: 18px;
  --r-lg: 28px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Manrope', sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
  opacity: .35;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.12  0 0 0 0 0.22  0 0 0 0 0.20  0 0 0 0 0.06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

img { max-width: 100%; display: block; }
a { color: var(--green-deep); text-decoration: none; }
a:hover { color: var(--gold); }
button { font: inherit; cursor: pointer; border: none; background: none; }

h1, h2, h3, h4, h5 {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.1;
  color: var(--green-deep);
}
h1 { font-size: clamp(1.9rem, 3vw, 2.6rem); }
h2 { font-size: clamp(1.5rem, 2.4vw, 1.95rem); }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.05rem; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--green-vivid);
}
.eyebrow::before {
  content: "";
  width: 28px; height: 1.5px;
  background: var(--green-vivid);
}

.script {
  font-family: 'Caveat', cursive;
  font-weight: 600;
  color: var(--gold);
}

/* ============================================================
   AUTH SHELL (login + register)
   ============================================================ */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  position: relative;
  z-index: 1;
}
.auth-side {
  background: var(--green-deep);
  color: var(--cream);
  padding: 56px 60px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.auth-side::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(212,145,0,.10) 1px, transparent 2px);
  background-size: 32px 32px;
  pointer-events: none;
}
.auth-side > * { position: relative; z-index: 1; }
.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.auth-brand img { width: 80px; height: 80px; }
.auth-brand-name {
  font-family: 'Fraunces', serif;
  font-size: 1.4rem;
  color: var(--cream);
  line-height: 1;
}
.auth-brand-name small {
  display: block;
  font-family: 'Caveat', cursive;
  font-size: 1rem;
  color: var(--gold-soft);
  margin-top: 2px;
}
.auth-quote {
  margin-top: auto;
  margin-bottom: 30px;
}
.auth-quote .mark {
  font-family: 'Fraunces', serif;
  font-size: 5rem;
  line-height: 1;
  color: var(--gold);
  opacity: .4;
}
.auth-quote blockquote {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 1.6rem;
  line-height: 1.3;
  color: var(--cream);
  margin-top: -20px;
  margin-bottom: 24px;
}
.auth-quote cite {
  font-style: normal;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(250,245,232,.6);
}
.auth-quote cite strong { color: var(--gold-soft); }
.auth-side-foot {
  font-family: 'Caveat', cursive;
  font-size: 1.3rem;
  color: var(--gold-soft);
}

.auth-form-wrap {
  padding: 56px 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--cream);
  position: relative;
  z-index: 1;
}
.auth-form-wrap .auth-eyebrow {
  margin-bottom: 16px;
}
.auth-form-wrap h1 {
  font-size: clamp(2rem, 3.4vw, 2.8rem);
  margin-bottom: 12px;
  font-weight: 400;
}
.auth-form-wrap h1 em { color: var(--green-vivid); font-style: italic; font-weight: 300; }
.auth-form-wrap > p.lede {
  color: var(--muted);
  margin-bottom: 36px;
  max-width: 460px;
}

.auth-form { max-width: 460px; width: 100%; }

.auth-foot {
  margin-top: 28px;
  font-size: 0.92rem;
  color: var(--muted);
}
.auth-foot a {
  font-weight: 600;
  color: var(--green-deep);
  border-bottom: 1.5px solid var(--gold);
}
.auth-foot a:hover { color: var(--gold); }

@media (max-width: 880px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-side { padding: 40px 28px; }
  .auth-form-wrap { padding: 40px 28px; }
  .auth-quote { display: none; }
}

/* ============================================================
   FORMS (shared everywhere)
   ============================================================ */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green-forest);
  margin-bottom: 8px;
}
.form-group label .opt {
  color: var(--muted);
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  margin-left: 4px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--paper);
  font: inherit;
  color: var(--ink);
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--green-vivid);
  background: white;
  box-shadow: 0 0 0 4px rgba(111, 170, 46, .12);
}
.form-group textarea { resize: vertical; min-height: 100px; }
.form-group .hint {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 6px;
}
.form-group .err {
  font-size: 0.8rem;
  color: var(--danger);
  margin-top: 6px;
  display: none;
}
.form-group.has-err input,
.form-group.has-err select,
.form-group.has-err textarea {
  border-color: var(--danger);
  background: #fef5f3;
}
.form-group.has-err .err { display: block; }

.input-icon {
  position: relative;
}
.input-icon svg {
  position: absolute;
  left: 16px; top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  stroke: var(--muted);
  fill: none;
  stroke-width: 2;
  pointer-events: none;
}
.input-icon input { padding-left: 44px; }

.password-toggle {
  position: absolute;
  right: 14px; top: 50%;
  transform: translateY(-50%);
  width: 28px; height: 28px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  transition: color .2s;
}
.password-toggle:hover { color: var(--green-deep); }
.password-toggle svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.93rem;
  letter-spacing: -0.005em;
  transition: transform .25s cubic-bezier(.2,.7,.3,1.4), box-shadow .25s, background .2s, color .2s, border-color .2s;
  white-space: nowrap;
  border: 1.5px solid transparent;
  cursor: pointer;
}
.btn-primary {
  background: var(--green-deep);
  color: var(--cream);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(31,56,51,.25); background: var(--green-forest); }
.btn-gold { background: var(--gold); color: white; }
.btn-gold:hover { transform: translateY(-2px); background: var(--gold-soft); box-shadow: 0 10px 24px rgba(212,145,0,.35); }
.btn-ghost {
  background: transparent;
  color: var(--green-deep);
  border-color: var(--green-deep);
}
.btn-ghost:hover { background: var(--green-deep); color: var(--cream); }
.btn-link {
  padding: 8px 12px;
  background: transparent;
  color: var(--green-deep);
  border-radius: 8px;
}
.btn-link:hover { background: rgba(31,56,51,.06); }
.btn-block { width: 100%; padding: 16px 24px; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #9a2814; transform: translateY(-2px); }
.btn .arrow { transition: transform .25s; }
.btn:hover .arrow { transform: translateX(4px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ============================================================
   PORTAL APP SHELL
   ============================================================ */
.app {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.sidebar {
  background: var(--green-deep);
  color: var(--cream);
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(212,145,0,.06) 1px, transparent 2px);
  background-size: 32px 32px;
  pointer-events: none;
}
.sidebar > * { position: relative; z-index: 1; }
.sb-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 4px 28px;
  border-bottom: 1px solid rgba(250,245,232,.12);
  margin-bottom: 24px;
}
.sb-brand img { width: 80px; height: 80px; }
.sb-brand-name {
  font-family: 'Fraunces', serif;
  font-size: 1.15rem;
  color: var(--cream);
  line-height: 1;
}
.sb-brand-name small {
  display: block;
  font-family: 'Caveat', cursive;
  font-size: 0.85rem;
  color: var(--gold-soft);
  margin-top: 2px;
}

.sb-section {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-soft);
  padding: 16px 12px 8px;
}

.sb-nav { list-style: none; }
.sb-nav li { margin-bottom: 2px; }
.sb-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  color: rgba(250,245,232,.75);
  font-size: 0.92rem;
  font-weight: 500;
  transition: background .2s, color .2s;
}
.sb-link:hover { background: rgba(250,245,232,.06); color: var(--cream); }
.sb-link.is-active {
  background: var(--green-forest);
  color: var(--cream);
  box-shadow: inset 3px 0 0 var(--gold);
}
.sb-link svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; flex-shrink: 0; }

.sb-foot {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid rgba(250,245,232,.12);
}
.sb-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 6px;
  margin-bottom: 8px;
}
.sb-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--green-deep);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.sb-user-info {
  min-width: 0;
}
.sb-user-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--cream);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sb-user-email {
  font-size: 0.75rem;
  color: rgba(250,245,232,.5);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sb-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  width: 100%;
  border-radius: 10px;
  color: rgba(250,245,232,.65);
  font-size: 0.88rem;
  text-align: left;
}
.sb-logout:hover { background: rgba(250,245,232,.06); color: var(--cream); }
.sb-logout svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }

/* ============================================================
   MAIN VIEW
   ============================================================ */
.view {
  padding: 40px 56px 80px;
  max-width: 1280px;
  width: 100%;
}

.view-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 32px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}
.view-head .head-text { flex: 1 1 auto; min-width: 0; }
.view-head h1 {
  font-weight: 400;
  margin-top: 8px;
  letter-spacing: -0.02em;
}
.view-head h1 em { font-style: italic; color: var(--green-vivid); font-weight: 300; }
.view-head .lede {
  color: var(--muted);
  margin-top: 8px;
  max-width: 560px;
}
.view-actions {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

/* ============================================================
   CARDS / PANELS
   ============================================================ */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 26px;
  box-shadow: var(--shadow-sm);
}
.card.compact { padding: 20px; }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}
.card-head h3 {
  font-size: 1.15rem;
  font-weight: 500;
}
.card-head .meta {
  color: var(--muted);
  font-size: 0.85rem;
}

/* ============================================================
   STATS GRID (dashboard)
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 22px;
  position: relative;
  overflow: hidden;
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--gold);
}
.stat-card::before {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  background: radial-gradient(circle at 100% 0, var(--accent, var(--gold-soft)), transparent 70%);
  opacity: .25;
  pointer-events: none;
}
.stat-card[data-tone="gold"]   { --accent: var(--gold); }
.stat-card[data-tone="green"]  { --accent: var(--green-vivid); }
.stat-card[data-tone="forest"] { --accent: var(--green-deep); }
.stat-card[data-tone="warn"]   { --accent: var(--warn); }

.stat-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--cream-warm);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
  color: var(--accent, var(--green-deep));
}
.stat-icon svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; }
.stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.stat-num {
  font-family: 'Fraunces', serif;
  font-size: 2.2rem;
  font-weight: 500;
  color: var(--green-deep);
  letter-spacing: -0.02em;
  line-height: 1;
  margin: 8px 0 6px;
}
.stat-trend {
  font-size: 0.82rem;
  color: var(--muted);
}
.stat-trend strong { color: var(--green-vivid); font-weight: 600; }

/* Two-column dashboard split */
.split-2 {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 22px;
  margin-bottom: 26px;
}
@media (max-width: 980px) { .split-2 { grid-template-columns: 1fr; } }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--paper);
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
table.data thead th {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 14px 18px;
  background: var(--cream-warm);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data tbody td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: var(--cream); }
table.data .id {
  font-family: ui-monospace, 'Roboto Mono', monospace;
  font-size: 0.82rem;
  color: var(--muted);
}
table.data .num {
  font-family: 'Fraunces', serif;
  font-size: 1rem;
  color: var(--green-deep);
  font-weight: 500;
}

.table-empty {
  padding: 56px 20px;
  text-align: center;
  color: var(--muted);
}
.table-empty .ico {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--cream-warm);
  margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  color: var(--gold);
}
.table-empty .ico svg { width: 26px; height: 26px; stroke: currentColor; fill: none; stroke-width: 2; }
.table-empty p {
  font-family: 'Fraunces', serif;
  font-size: 1.1rem;
  color: var(--green-deep);
  margin-bottom: 4px;
}

/* ============================================================
   DATATABLES THEMING — match brand
   ============================================================ */
.dt-container {
  font-family: 'Manrope', sans-serif;
}
.dt-container .dt-layout-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 14px 0;
}
.dt-container .dt-layout-row.dt-layout-table { margin: 0; }
.dt-container .dt-layout-cell { flex: 0 0 auto; }
.dt-container .dt-layout-cell.dt-end { margin-left: auto; }
.dt-container .dt-layout-cell.dt-full { flex: 1 1 100%; }

/* Search & length */
.dt-container .dt-search,
.dt-container .dt-length {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--muted);
}
.dt-container .dt-search label,
.dt-container .dt-length label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green-forest);
  margin: 0;
}
.dt-container .dt-search input {
  padding: 9px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--paper);
  font: inherit;
  color: var(--ink);
  min-width: 220px;
  transition: border-color .2s, box-shadow .2s;
}
.dt-container .dt-search input:focus {
  outline: none;
  border-color: var(--green-vivid);
  box-shadow: 0 0 0 4px rgba(111,170,46,.12);
}
.dt-container .dt-length select {
  padding: 7px 10px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--paper);
  font: inherit;
  color: var(--ink);
  cursor: pointer;
}
.dt-container .dt-length select:focus {
  outline: none;
  border-color: var(--green-vivid);
}

/* The data table itself — already styled via table.data above. Just tweaks: */
.dt-container table.data { margin: 0; }
.dt-container table.dataTable thead th {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 32px;
}
.dt-container table.dataTable thead th.dt-orderable-none { cursor: default; padding-right: 18px; }
.dt-container table.dataTable thead th .dt-column-order {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 16px;
  opacity: .35;
}
.dt-container table.dataTable thead th .dt-column-order::before,
.dt-container table.dataTable thead th .dt-column-order::after {
  position: absolute;
  left: 0; right: 0;
  font-size: 0.7rem;
  line-height: 1;
  font-family: monospace;
  color: var(--green-deep);
}
.dt-container table.dataTable thead th .dt-column-order::before { top: 0; content: "▲"; }
.dt-container table.dataTable thead th .dt-column-order::after { bottom: 0; content: "▼"; }
.dt-container table.dataTable thead th.dt-ordering-asc .dt-column-order::before,
.dt-container table.dataTable thead th.dt-ordering-desc .dt-column-order::after { color: var(--gold); }
.dt-container table.dataTable thead th.dt-ordering-asc,
.dt-container table.dataTable thead th.dt-ordering-desc {
  background: var(--cream);
  color: var(--green-deep);
}
.dt-container table.dataTable thead th.dt-ordering-asc .dt-column-order,
.dt-container table.dataTable thead th.dt-ordering-desc .dt-column-order { opacity: 1; }

/* Info text */
.dt-container .dt-info {
  font-size: 0.82rem;
  color: var(--muted);
}

/* Pagination */
.dt-container .dt-paging {
  display: flex;
  gap: 4px;
}
.dt-container .dt-paging-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--green-forest);
  background: transparent;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.dt-container .dt-paging-button:hover:not(.disabled):not(.current) {
  background: var(--cream);
  border-color: var(--line);
}
.dt-container .dt-paging-button.current {
  background: var(--green-deep);
  color: var(--cream);
  border-color: var(--green-deep);
}
.dt-container .dt-paging-button.disabled {
  opacity: .35;
  cursor: not-allowed;
}
.dt-container .dt-paging-button.dt-ellipsis {
  cursor: default;
  border: none;
}

/* Empty/processing rows */
.dt-container table.dataTable tbody td.dt-empty {
  text-align: center;
  padding: 48px 20px;
  font-style: italic;
  color: var(--muted);
}

/* When DataTable wraps a .table-wrap, reduce double border */
.table-wrap.has-dt {
  border: none;
  background: transparent;
  overflow: visible;
}
.table-wrap.has-dt table.data {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  overflow: hidden;
}

/* ============================================================
   STATUS PILLS
   ============================================================ */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.pill::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.pill-pending  { background: rgba(201,115,0,.12);   color: var(--warn); }
.pill-approved { background: rgba(44,102,145,.12);  color: var(--info); }
.pill-ready    { background: rgba(212,145,0,.14);   color: var(--gold); }
.pill-fulfilled,
.pill-resolved { background: rgba(77,139,31,.12);   color: var(--ok); }
.pill-cancelled,
.pill-closed   { background: rgba(184,53,27,.12);   color: var(--danger); }
.pill-open     { background: rgba(44,102,145,.12);  color: var(--info); }
.pill-progress { background: rgba(212,145,0,.14);   color: var(--gold); }

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,21,19,.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--paper);
  border-radius: var(--r-lg);
  padding: 32px;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform .3s cubic-bezier(.2,.8,.3,1.2);
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal h3 { margin-bottom: 8px; }
.modal p { color: var(--muted); margin-bottom: 22px; }
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ============================================================
   TOASTS
   ============================================================ */
.toast-stack {
  position: fixed;
  top: 24px; right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  background: var(--green-deep);
  color: var(--cream);
  padding: 14px 18px;
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
  max-width: 380px;
  animation: toastIn .35s cubic-bezier(.2,.8,.3,1.2);
  pointer-events: auto;
}
.toast.success { background: var(--ok); }
.toast.error   { background: var(--danger); }
.toast.warn    { background: var(--warn); }
.toast.leaving { animation: toastOut .25s ease forwards; }
@keyframes toastIn  { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(20px); } }
.toast svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; flex-shrink: 0; }

/* ============================================================
   ACCORDION (FAQ)
   ============================================================ */
.accordion {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.acc-item {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}
.acc-item.open {
  border-color: var(--gold);
  box-shadow: var(--shadow-sm);
}
.acc-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  text-align: left;
  padding: 22px 26px;
  background: transparent;
  font-family: 'Fraunces', serif;
  font-size: 1.08rem;
  font-weight: 500;
  color: var(--green-deep);
  letter-spacing: -0.005em;
}
.acc-trigger .chev {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--cream-warm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-left: 16px;
  transition: background .2s, transform .25s;
}
.acc-trigger .chev svg { width: 14px; height: 14px; stroke: var(--green-deep); fill: none; stroke-width: 2.5; transition: transform .25s; }
.acc-item.open .chev { background: var(--gold); }
.acc-item.open .chev svg { stroke: white; transform: rotate(180deg); }
.acc-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .3s ease;
}
.acc-item.open .acc-body { grid-template-rows: 1fr; }
.acc-body-inner {
  overflow: hidden;
  padding: 0 26px;
  color: var(--muted);
}
.acc-item.open .acc-body-inner { padding: 0 26px 24px; }
.faq-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 26px;
}
.faq-cat {
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--green-forest);
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s;
}
.faq-cat:hover { border-color: var(--green-deep); }
.faq-cat.is-active {
  background: var(--green-deep);
  color: var(--cream);
  border-color: var(--green-deep);
}

/* ============================================================
   MISC
   ============================================================ */
.divider {
  height: 1px;
  background: var(--line);
  margin: 24px 0;
}
.muted { color: var(--muted); }
.text-sm { font-size: 0.88rem; }
.text-xs { font-size: 0.8rem; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-2 { margin-top: 12px; }
.mt-4 { margin-top: 24px; }
.mb-2 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 24px; }

/* Recent activity feed */
.feed {
  display: flex;
  flex-direction: column;
}
.feed-item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.feed-item:last-child { border-bottom: none; }
.feed-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--cream-warm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--gold);
}
.feed-icon svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
.feed-icon.ok    { color: var(--ok); }
.feed-icon.warn  { color: var(--warn); }
.feed-icon.info  { color: var(--info); }
.feed-body { min-width: 0; flex: 1; }
.feed-title { font-weight: 600; font-size: 0.93rem; color: var(--green-deep); }
.feed-meta  { font-size: 0.8rem; color: var(--muted); }

/* Profile / settings layout */
.settings-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
}
@media (max-width: 880px) { .settings-grid { grid-template-columns: 1fr; } }
.settings-aside .avatar-large {
  width: 110px; height: 110px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--green-deep);
  font-family: 'Fraunces', serif;
  font-size: 2.6rem;
  font-weight: 500;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
  box-shadow: var(--shadow-md);
}

/* Mobile sidebar toggle */
.mobile-bar {
  display: none;
}
@media (max-width: 880px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    inset: 0;
    z-index: 150;
    transform: translateX(-100%);
    transition: transform .3s ease;
    width: 280px;
    height: 100vh;
  }
  .sidebar.open { transform: translateX(0); }
  .mobile-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 100;
  }
  .mobile-bar .brand-mini {
    display: flex; align-items: center; gap: 10px;
    font-family: 'Fraunces', serif;
    color: var(--green-deep);
  }
  .mobile-bar .brand-mini img { width: 32px; height: 32px; }
  .menu-btn {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px;
    color: var(--green-deep);
  }
  .menu-btn:hover { background: var(--cream); }
  .menu-btn svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; }
  .view { padding: 24px 20px 60px; }
}
.scrim {
  position: fixed;
  inset: 0;
  background: rgba(15,21,19,.5);
  z-index: 140;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.scrim.show { opacity: 1; pointer-events: auto; }
