:root {
  --ink: #1c1915;
  --muted: #5e584f;
  --paper: #fffdf8;
  --sand: #f3efe6;
  --line: #e4dccf;
  --forest: #145c45;
  --forest-deep: #0d3d2e;
  --clay: #c4622d;
  --urgent: #9d2c20;
  --shadow: 0 12px 30px rgba(28, 25, 21, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(196, 98, 45, 0.08), transparent 28rem),
    var(--sand);
  font-family: "Segoe UI", system-ui, sans-serif;
  line-height: 1.5;
}

h1, h2, .brand strong {
  font-family: Palatino, "Palatino Linotype", Georgia, serif;
  letter-spacing: -0.02em;
}

a { color: var(--forest); }

.site-header {
  background: linear-gradient(135deg, var(--forest-deep), var(--forest));
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 4.4rem;
  padding: 0.7rem 0;
}

.brand {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  color: #fff;
  text-decoration: none;
  margin-right: auto;
}

.brand small, .muted { color: var(--muted); display: block; }
.brand small { color: rgba(255, 255, 255, 0.75); }

.brand-logo {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.7rem;
  object-fit: cover;
  background: #fff;
}

.brand-mark {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.7rem;
  background:
    linear-gradient(#fff, #fff) center 62% / 46% 8% no-repeat,
    linear-gradient(#fff, #fff) center 78% / 22% 18% no-repeat,
    linear-gradient(135deg, transparent 48%, #fff 48% 58%, transparent 58%) center 28% / 70% 42% no-repeat,
    #e7c9a4;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35);
}

.header-nav {
  display: flex;
  gap: 0.9rem;
  overflow: auto;
  padding-bottom: 0.75rem;
  font-size: 0.92rem;
}
.header-nav a { white-space: nowrap; }
.header-actions { display: flex; gap: 0.6rem; align-items: center; }
.header-user { display: none; }
.header-nav a, .header-actions a { color: #fff; text-decoration: none; }
.header-actions .btn-light { color: var(--forest-deep); }
.header-actions form { margin: 0; }

body.has-tabbar { padding-bottom: 5.5rem; }
.page { padding-top: 1.25rem; padding-bottom: 2rem; }

.urgent-banner {
  display: block;
  background: #fff4ef;
  color: var(--urgent);
  text-decoration: none;
  border-bottom: 1px solid #f0c7bc;
  padding: 0.75rem 1rem;
  text-align: center;
}

.hero {
  display: grid;
  gap: 1.25rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 1.4rem;
  padding: 1.4rem;
  box-shadow: var(--shadow);
}

.hero h1 { font-size: clamp(2rem, 5vw, 3.4rem); margin: 0 0 0.6rem; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  color: var(--clay);
  font-weight: 700;
}

.panel, .feed-card, .stat {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 1rem;
  box-shadow: var(--shadow);
}

.panel { padding: 1.1rem; }
.feed-card { padding: 1rem 1.1rem; display: block; color: inherit; text-decoration: none; height: 100%; }
.feed-card h2, .feed-card h3 { font-size: 1.25rem; margin: 0.35rem 0; }
.feed-card:hover { border-color: #c9b89a; }

.chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  background: #efe7da;
  color: var(--forest-deep);
  font-size: 0.78rem;
  font-weight: 700;
}

.chip.urgent { background: #f8d7d2; color: var(--urgent); }
.chip.status-new { background: #f6e7c8; }
.chip.status-in_progress { background: #d9ebe4; }
.chip.status-resolved { background: #e7efe4; }
.chip.status-rejected { background: #f3d9d5; }

.filters { display: flex; gap: 0.4rem; overflow: auto; padding-bottom: 0.2rem; }
.filters a {
  white-space: nowrap;
  text-decoration: none;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
}
.filters a.active { background: var(--forest); color: #fff; border-color: var(--forest); }

.prose { white-space: pre-wrap; }
.comment, .chat-bubble {
  border-top: 1px solid var(--line);
  padding: 0.8rem 0;
}
.chat-bubble.staff { background: #f4faf7; border: 1px solid #d5e8df; border-radius: 0.8rem; padding: 0.8rem; margin: 0.5rem 0; }
.ticket-photo { width: 100%; max-height: 24rem; object-fit: contain; border-radius: 0.8rem; background: #fff; }

.bottom-nav {
  position: fixed;
  left: 0.6rem;
  right: 0.6rem;
  bottom: 0.6rem;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: var(--forest-deep);
  border-radius: 1rem;
  z-index: 30;
  box-shadow: 0 10px 24px rgba(13, 61, 46, 0.25);
}
.bottom-nav a {
  color: #fff;
  text-align: center;
  text-decoration: none;
  font-size: 0.72rem;
  padding: 0.75rem 0.2rem;
}

.stat { padding: 1rem; }
.stat b { display: block; font-size: 1.8rem; font-family: Palatino, Georgia, serif; }
.contact-row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.75rem 0; border-bottom: 1px solid var(--line); }
.contact-row a { font-weight: 700; text-decoration: none; }

.btn-forest {
  background: var(--forest);
  border-color: var(--forest);
  color: #fff;
}
.btn-forest:hover { background: var(--forest-deep); color: #fff; }

.badge-count {
  display: inline-block;
  min-width: 1.2rem;
  margin-left: 0.25rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--clay);
  color: #fff;
  font-size: 0.75rem;
  text-align: center;
}

.offline-body { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.offline-card { max-width: 28rem; background: var(--paper); padding: 1.5rem; border-radius: 1rem; }

@media (min-width: 992px) {
  body.has-tabbar { padding-bottom: 0; }
  .bottom-nav { display: none; }
  .header-user { display: inline; }
  .site-header .container.header-row { padding-bottom: 0; }
  .hero { grid-template-columns: 1.4fr 0.8fr; align-items: end; padding: 2rem; }
}
