/* RentFlow -- one stylesheet, no build step.
   The palette is carried over from the original Tailwind config so the app
   still looks like itself: warm paper ground, near-black warm ink, terracotta
   accent, calm green and brass for secondary signals. */

:root {
  --ink: #1C2321;
  --paper: #FAF8F4;
  --clay: #B5652F;
  --clay-dark: #8E4E24;
  --moss: #4A5D4E;
  --brass: #C9A24B;
  --line: #E4DFD4;
  --alert: #B23B3B;
  --white: #FFFFFF;

  --muted: rgba(28, 35, 33, 0.6);
  --faint: rgba(28, 35, 33, 0.42);
  --hairline: rgba(228, 223, 212, 0.75);

  --radius-sm: 4px;
  --radius-md: 10px;
  --shadow-card: 0 1px 2px rgba(28, 35, 33, 0.05), 0 4px 16px rgba(28, 35, 33, 0.06);
  --shadow-lift: 0 2px 4px rgba(28, 35, 33, 0.07), 0 10px 28px rgba(28, 35, 33, 0.10);

  --font-display: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;

  --sidebar-width: 232px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; text-wrap: balance; margin: 0; }
h1 { font-size: 1.75rem; letter-spacing: -0.02em; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }

a { color: inherit; }
p { margin: 0 0 0.75rem; }
p:last-child { margin-bottom: 0; }

table { font-variant-numeric: tabular-nums; }

:focus-visible { outline: 2px solid var(--clay); outline-offset: 2px; border-radius: 2px; }

@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ============================================================ layout: staff app */

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width);
  flex: 0 0 var(--sidebar-width);
  background: var(--ink);
  color: var(--paper);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 1.15rem 1.15rem 1rem;
  text-decoration: none;
  border-bottom: 1px solid rgba(250, 248, 244, 0.1);
}
.sidebar-mark {
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  background: var(--clay); color: var(--paper);
  display: grid; place-items: center;
  font: 700 14px/1 var(--font-display);
  flex: 0 0 auto;
}
.sidebar-name { font: 600 1.05rem/1.2 var(--font-display); letter-spacing: -0.01em; }

.sidebar-nav { padding: 0.75rem 0.6rem 1.5rem; flex: 1; }
.nav-group-label {
  font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.09em;
  color: rgba(250, 248, 244, 0.38);
  padding: 0.9rem 0.55rem 0.35rem;
  font-weight: 600;
}
.nav-link {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  padding: 0.42rem 0.55rem;
  border-radius: var(--radius-sm);
  color: rgba(250, 248, 244, 0.68);
  text-decoration: none;
  font-size: 0.875rem;
  transition: background-color 0.15s, color 0.15s;
}
.nav-link:hover { background: rgba(250, 248, 244, 0.06); color: var(--paper); }
.nav-link.is-active { background: rgba(250, 248, 244, 0.12); color: var(--paper); font-weight: 500; }
.nav-count {
  background: var(--clay); color: var(--paper);
  border-radius: 999px; padding: 0 0.4rem;
  font-size: 0.7rem; font-weight: 600; line-height: 1.4;
}

.sidebar-foot {
  border-top: 1px solid rgba(250, 248, 244, 0.1);
  padding: 0.85rem 1.15rem;
  font-size: 0.8rem;
  color: rgba(250, 248, 244, 0.6);
}
.sidebar-foot strong { color: var(--paper); font-weight: 500; display: block; }
.sidebar-foot form { margin-top: 0.35rem; }
.linkish {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: inherit; font: inherit; text-decoration: underline; text-underline-offset: 2px;
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: none;
  align-items: center; justify-content: space-between; gap: 0.75rem;
  background: var(--ink); color: var(--paper);
  padding: 0.6rem 1rem;
  position: sticky; top: 0; z-index: 20;
}
.topbar a { text-decoration: none; }
.menu-toggle {
  background: rgba(250, 248, 244, 0.1); border: 0; color: var(--paper);
  border-radius: var(--radius-sm); padding: 0.4rem 0.7rem; font-size: 1.1rem; cursor: pointer;
}

.content { padding: 1.75rem 1.5rem 4rem; max-width: 1180px; width: 100%; }

.page-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.4rem;
}
.page-head .sub { color: var(--muted); font-size: 0.875rem; margin-top: 0.15rem; }
.page-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.breadcrumb { font-size: 0.8rem; color: var(--faint); margin-bottom: 0.3rem; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--clay); text-decoration: underline; }

/* ============================================================ cards & grids */

.card {
  background: var(--white);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-card);
  animation: rise 0.3s ease both;
}
.card + .card { margin-top: 1rem; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  margin-bottom: 0.9rem;
}
.card-head h2 { font-size: 1.02rem; }
.card-tight { padding: 0; overflow: hidden; }
.card-tight .card-head { padding: 1.1rem 1.25rem 0; margin-bottom: 0.6rem; }

.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-sidebar { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }

.stat {
  background: var(--white);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; gap: 0.15rem;
  animation: rise 0.3s ease both;
  text-decoration: none;
}
a.stat:hover { border-color: var(--clay); box-shadow: var(--shadow-lift); }
.stat-value {
  font: 600 1.85rem/1.1 var(--font-display);
  letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
}
.stat-value .of { font-size: 1rem; color: var(--faint); }
.stat-label {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--faint); font-weight: 600;
}
.stat-note { font-size: 0.78rem; color: var(--muted); }
.is-clay { color: var(--clay); }
.is-alert { color: var(--alert); }
.is-moss { color: var(--moss); }

/* ============================================================ tables */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table.data { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
table.data th {
  text-align: left; font-weight: 600; font-size: 0.7rem;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint);
  padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data td { padding: 0.7rem 0.75rem; border-bottom: 1px solid var(--hairline); vertical-align: top; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: rgba(250, 248, 244, 0.7); }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data .shrink { width: 1%; white-space: nowrap; }
table.data a { color: var(--ink); text-decoration: none; font-weight: 500; }
table.data a:hover { color: var(--clay); text-decoration: underline; }
.row-muted td { color: var(--muted); }

.list { list-style: none; margin: 0; padding: 0; }
.list > li {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 0.7rem 0; border-bottom: 1px solid var(--hairline);
}
.list > li:last-child { border-bottom: 0; padding-bottom: 0; }
.list > li:first-child { padding-top: 0; }
.list .title { font-weight: 500; font-size: 0.9rem; }
.list .meta { font-size: 0.8rem; color: var(--muted); }

/* ============================================================ buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.55rem 0.95rem;
  border-radius: var(--radius-sm);
  font: 500 0.875rem/1.2 var(--font-body);
  text-decoration: none; cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 0.18s, border-color 0.18s, color 0.18s, box-shadow 0.18s, transform 0.1s;
  white-space: nowrap;
}
.btn:active { transform: scale(0.985); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }

.btn-primary { background: var(--clay); color: var(--paper); }
.btn-primary:hover { background: var(--ink); box-shadow: var(--shadow-lift); }

.btn-secondary { background: var(--white); border-color: var(--line); color: var(--ink); }
.btn-secondary:hover { border-color: var(--clay); color: var(--clay); }

.btn-ghost { background: transparent; color: var(--muted); padding: 0.35rem 0.5rem; }
.btn-ghost:hover { color: var(--clay); background: rgba(181, 101, 47, 0.07); }

.btn-danger { background: var(--white); border-color: rgba(178, 59, 59, 0.35); color: var(--alert); }
.btn-danger:hover { background: var(--alert); color: var(--white); border-color: var(--alert); }

.btn-wa { background: #25D366; color: #06301A; border-color: #1FB958; font-weight: 600; }
.btn-wa:hover { background: #1FB958; color: #fff; }

.btn-sm { padding: 0.32rem 0.6rem; font-size: 0.8rem; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.45rem; }

/* ============================================================ forms */

.field { margin-bottom: 0.9rem; }
.label {
  display: block; margin-bottom: 0.3rem;
  font-size: 0.7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted);
}
.input, .select, .textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--clay);
  box-shadow: 0 0 0 3px rgba(181, 101, 47, 0.12);
}
.textarea { min-height: 5.5rem; resize: vertical; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%231C2321' d='M1 1l5 5 5-5' stroke='%231C2321' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.65rem center;
  padding-right: 2rem;
}
.hint { font-size: 0.78rem; color: var(--faint); margin-top: 0.28rem; }

.check { display: flex; align-items: flex-start; gap: 0.5rem; font-size: 0.875rem; margin-bottom: 0.5rem; }
.check input { margin-top: 0.22rem; accent-color: var(--clay); flex: 0 0 auto; }

.field-row { display: grid; gap: 0.75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

fieldset { border: 0; padding: 0; margin: 0 0 1.25rem; }
legend {
  font: 600 0.72rem/1 var(--font-body); text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--faint); padding: 0 0 0.6rem;
}

/* Disclosure panels used for "add" forms so pages open calm and uncluttered. */
details.panel { margin-bottom: 1rem; }
details.panel > summary {
  cursor: pointer; list-style: none;
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.55rem 0.95rem;
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.875rem; font-weight: 500;
}
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary:hover { border-color: var(--clay); color: var(--clay); }
details.panel > summary::before { content: "+"; font-weight: 600; }
details.panel[open] > summary::before { content: "-"; }
details.panel[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
details.panel .panel-body {
  border: 1px solid var(--line); border-top: 0;
  border-radius: 0 var(--radius-md) var(--radius-md) var(--radius-md);
  background: var(--white); padding: 1.15rem;
}

/* ============================================================ badges & pills */

.badge {
  display: inline-flex; align-items: center;
  padding: 0.12rem 0.45rem;
  border-radius: var(--radius-sm);
  font-size: 0.72rem; font-weight: 600; white-space: nowrap;
}
.badge-good { background: rgba(74, 93, 78, 0.15); color: var(--moss); }
.badge-warn { background: rgba(201, 162, 75, 0.22); color: #6E5518; }
.badge-bad { background: rgba(178, 59, 59, 0.12); color: var(--alert); }
.badge-info { background: rgba(181, 101, 47, 0.14); color: var(--clay-dark); }
.badge-muted { background: rgba(28, 35, 33, 0.07); color: var(--muted); }

.pill-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }
.pill {
  padding: 0.32rem 0.7rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--white);
  font-size: 0.8rem; text-decoration: none; color: var(--muted);
}
.pill:hover { border-color: var(--clay); color: var(--clay); }
.pill.is-active { background: var(--ink); border-color: var(--ink); color: var(--paper); font-weight: 500; }

.tag {
  display: inline-block; padding: 0.1rem 0.4rem; margin: 0 0.25rem 0.25rem 0;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-sm); font-size: 0.75rem; color: var(--muted);
}

/* ============================================================ feedback */

.flash-stack { margin-bottom: 1.2rem; display: flex; flex-direction: column; gap: 0.5rem; }
.flash {
  padding: 0.7rem 0.95rem;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--moss);
  background: rgba(74, 93, 78, 0.1);
  font-size: 0.88rem;
  animation: rise 0.25s ease both;
}
.flash-error { border-left-color: var(--alert); background: rgba(178, 59, 59, 0.09); }
.flash-info { border-left-color: var(--clay); background: rgba(181, 101, 47, 0.09); }

.empty {
  text-align: center; padding: 2rem 1rem; color: var(--muted); font-size: 0.9rem;
}
.empty p { margin-bottom: 0.85rem; }

.note {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 0.75rem 0.9rem;
  font-size: 0.85rem; color: var(--muted);
}

/* ============================================================ auth screens */

.auth-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 1.5rem;
  background:
    radial-gradient(60rem 30rem at 50% -10%, rgba(181, 101, 47, 0.08), transparent 70%),
    var(--paper);
}
.auth-card {
  width: 100%; max-width: 24rem;
  background: var(--white); border: 1px solid var(--hairline);
  border-radius: var(--radius-md); padding: 2rem 1.75rem;
  box-shadow: var(--shadow-card);
  animation: rise 0.35s ease both;
}
.auth-mark {
  width: 42px; height: 42px; border-radius: var(--radius-sm);
  background: var(--clay); color: var(--paper);
  display: grid; place-items: center;
  font: 700 20px/1 var(--font-display); margin-bottom: 1rem;
}
.auth-card h1 { font-size: 1.4rem; margin-bottom: 0.3rem; }
.auth-card .sub { color: var(--muted); font-size: 0.875rem; margin-bottom: 1.4rem; }
.auth-alt {
  margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--hairline);
  font-size: 0.85rem; color: var(--muted); text-align: center;
}
.auth-alt a { color: var(--clay); }

/* ============================================================ portals (tenant / owner) */

.portal-header {
  background: var(--ink); color: var(--paper);
  padding: 0.85rem 1.25rem;
  position: sticky; top: 0; z-index: 20;
}
.portal-header-inner {
  max-width: 60rem; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.portal-nav { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.portal-main { max-width: 60rem; margin: 0 auto; padding: 1.75rem 1.25rem 4rem; }

/* ============================================================ public site */

.public-header {
  background: var(--white); border-bottom: 1px solid var(--line);
  padding: 1rem 1.25rem;
}
.public-header-inner {
  max-width: 68rem; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.public-brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.public-main { max-width: 68rem; margin: 0 auto; padding: 2rem 1.25rem 4rem; }
.public-hero { text-align: center; padding: 1rem 0 2rem; }
.public-hero h1 { font-size: 2.1rem; margin-bottom: 0.4rem; }
.public-hero p { color: var(--muted); }
.public-foot {
  border-top: 1px solid var(--line); margin-top: 3rem; padding: 1.5rem 1.25rem;
  text-align: center; color: var(--faint); font-size: 0.82rem;
}

.listing-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.listing-card {
  background: var(--white); border: 1px solid var(--hairline);
  border-radius: var(--radius-md); overflow: hidden;
  box-shadow: var(--shadow-card); text-decoration: none;
  display: flex; flex-direction: column;
  transition: box-shadow 0.2s, transform 0.2s;
}
.listing-card:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.listing-photo {
  aspect-ratio: 4 / 3; background: var(--paper);
  display: grid; place-items: center; overflow: hidden;
  color: var(--faint); font-size: 0.85rem;
}
.listing-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.listing-body { padding: 0.9rem 1rem 1.1rem; flex: 1; display: flex; flex-direction: column; gap: 0.3rem; }
.listing-rent { font: 600 1.15rem/1.2 var(--font-display); color: var(--clay); }
.listing-title { font-weight: 600; font-size: 0.95rem; }
.listing-meta { font-size: 0.82rem; color: var(--muted); }

.gallery { display: grid; gap: 0.6rem; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.gallery img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: var(--radius-sm); border: 1px solid var(--hairline); display: block;
}
.gallery-lead { grid-column: span 2; grid-row: span 2; }
.photo-thumb { position: relative; }
.photo-thumb form { position: absolute; top: 0.3rem; right: 0.3rem; }

/* ============================================================ misc components */

.kv { display: grid; grid-template-columns: auto 1fr; gap: 0.4rem 1rem; font-size: 0.875rem; }
.kv dt { color: var(--faint); }
.kv dd { margin: 0; font-weight: 500; }

.money-in { color: var(--moss); font-weight: 600; }
.money-out { color: var(--alert); font-weight: 600; }

.trend { display: flex; align-items: flex-end; gap: 0.5rem; height: 90px; margin-top: 0.5rem; }
.trend-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 0.3rem; text-align: center; }
.trend-bar { background: var(--clay); border-radius: 2px 2px 0 0; min-height: 2px; opacity: 0.85; }
.trend-label { font-size: 0.68rem; color: var(--faint); }

.copy-link {
  display: flex; gap: 0.4rem; align-items: center;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 0.35rem 0.5rem;
  font-family: var(--font-mono); font-size: 0.75rem;
  word-break: break-all;
}

.divider { height: 1px; background: var(--hairline); margin: 1.25rem 0; border: 0; }

.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.tiny { font-size: 0.75rem; }
.strong { font-weight: 600; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.gap-1 { gap: 0.5rem; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }

/* ============================================================ print */

.print-sheet {
  max-width: 48rem; margin: 2rem auto; background: var(--white);
  border: 1px solid var(--hairline); border-radius: var(--radius-md);
  padding: 2.25rem; box-shadow: var(--shadow-card);
}
.print-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 1.5rem;
  border-bottom: 2px solid var(--ink); padding-bottom: 1rem; margin-bottom: 1.5rem;
}
.print-title { font: 600 1.5rem/1.2 var(--font-display); }
.print-agency { font: 600 1.05rem/1.3 var(--font-display); }
.print-meta { font-size: 0.82rem; color: var(--muted); text-align: right; }
.print-total {
  border-top: 2px solid var(--ink); margin-top: 1rem; padding-top: 0.75rem;
  display: flex; justify-content: space-between; align-items: baseline;
  font: 600 1.25rem/1.2 var(--font-display);
}
.print-foot {
  margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--hairline);
  font-size: 0.78rem; color: var(--faint); text-align: center;
}
.print-actions { max-width: 48rem; margin: 1.5rem auto 0; display: flex; gap: 0.5rem; justify-content: center; }
.sign-row { display: flex; gap: 3rem; margin-top: 3rem; }
.sign-line { flex: 1; border-top: 1px solid var(--ink); padding-top: 0.4rem; font-size: 0.8rem; color: var(--muted); }

@media print {
  body { background: var(--white); }
  .no-print, .sidebar, .topbar, .print-actions, .portal-header, .public-header, .public-foot { display: none !important; }
  .print-sheet { max-width: none; margin: 0; border: 0; box-shadow: none; padding: 0; border-radius: 0; }
  .card { box-shadow: none; border-color: var(--line); break-inside: avoid; }
  a { text-decoration: none; color: inherit; }
  table.data { font-size: 11px; }
  table.data th { color: var(--ink); }
  .content { padding: 0; }
  @page { margin: 14mm; }
}

/* ============================================================ responsive */

@media (max-width: 1080px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .listing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .grid-sidebar, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gallery-lead { grid-column: span 3; grid-row: auto; }
}

@media (max-width: 760px) {
  .app { display: block; }
  .topbar { display: flex; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 40;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: var(--shadow-lift);
    height: 100dvh;
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after {
    content: ""; position: fixed; inset: 0; z-index: 30;
    background: rgba(28, 35, 33, 0.45);
  }
  .content { padding: 1.25rem 1rem 3.5rem; }
  .grid-2, .grid-4, .listing-grid, .field-row, .field-row-3 { grid-template-columns: minmax(0, 1fr); }
  h1 { font-size: 1.45rem; }
  .stat-value { font-size: 1.6rem; }
  .page-head { align-items: flex-start; }
  .print-sheet { padding: 1.25rem; margin: 1rem; }
  .sign-row { flex-direction: column; gap: 1.75rem; }
}

@media (max-width: 520px) {
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery-lead { grid-column: span 2; }
  .btn { padding: 0.5rem 0.8rem; }
}
