/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --page: #f7f5ef;
  --surface: #fffbf2;
  --surface-soft: #fbf6ec;
  --field: #fffdf7;
  --line: #ddd6c9;
  --line-soft: #e8dfd0;
  --ink: #071633;
  --ink-muted: #394862;
  --ink-soft: #657189;
  background: var(--page);
  color: var(--ink);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100dvh;
  margin: 0;
  background: var(--page);
  color: var(--ink);
  display: flex;
  flex-direction: column;
}

label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
  font-weight: 600;
}

a {
  color: inherit;
}

.page-content {
  flex: 1 0 auto;
}

.site-footer {
  flex: 0 0 auto;
  width: 100%;
  margin-top: auto;
  padding: 1.5rem 1rem;
  color: var(--ink-soft);
  font-size: 0.85rem;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

.shell {
  width: min(72rem, calc(100% - 2rem));
  margin: 0 auto;
  padding: 3rem 0 4rem;
}

.shell.narrow {
  width: min(48rem, calc(100% - 2rem));
}

.home-shell {
  width: min(52rem, calc(100% - 2rem));
}

.topbar {
  background: rgba(247, 245, 239, 0.94);
  position: sticky;
  top: 0;
  backdrop-filter: blur(8px);
}

.topbar-inner {
  display: grid;
  grid-template-columns: minmax(10rem, 1fr) auto minmax(10rem, 1fr);
  align-items: center;
  justify-content: center;
  gap: 1rem;
  width: 100%;
  margin: 0;
  padding-left: 1rem;
  padding-right: 1rem;
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: clamp(4.25rem, 8vw, 5.5rem);
  height: auto;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  font-weight: 600;
}

.topnav a:not(.button) {
  color: var(--ink);
  text-decoration: none;
}

.topnav a:not(.button):hover,
.topnav a:not(.button):focus-visible {
  color: #1d4ed8;
  outline: none;
}

.topnav-vestai {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.topnav-primary {
  justify-content: center;
}

.topnav-account {
  justify-content: flex-end;
}

.topnav form {
  margin: 0;
}

.topnav-label {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.flash-stack {
  padding-top: 1rem;
}

.flash {
  margin-bottom: 0.75rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: var(--surface);
}

.flash.notice {
  border-color: #93c5fd;
}

.flash.alert {
  border-color: #fca5a5;
}

.hero {
  margin-bottom: 2rem;
}

.hero-home {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(18rem, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.hero.compact {
  margin-bottom: 1.5rem;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--ink-soft);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  color: var(--ink);
}

h1 {
  font-size: clamp(2.25rem, 5vw, 4.5rem);
  line-height: 0.95;
}

h2 {
  font-size: 1.5rem;
}

.lede {
  max-width: 42rem;
  margin: 1rem 0 0;
  color: var(--ink-muted);
  font-size: 1.1rem;
  line-height: 1.6;
}

.actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.action-card,
.account-prompt {
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface);
}

.action-card {
  display: block;
  padding: 1.25rem;
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
}

.action-card-rich {
  min-height: 12.5rem;
}

.action-card-rich h3 {
  margin: 0.2rem 0 0;
  font-size: 1.15rem;
  line-height: 1.25;
}

.action-card-rich p {
  margin: 0.7rem 0 0;
  color: var(--ink-muted);
  font-size: 0.98rem;
}

.action-card-kicker {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.action-card:hover,
.action-card:focus-visible {
  border-color: #2563eb;
  outline: none;
}

.account-prompt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem;
}

.account-prompt p {
  margin: 0.5rem 0 0;
  color: var(--ink-muted);
  line-height: 1.6;
}

.account-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.button,
.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  text-decoration: none;
}

.button {
  min-height: 2.75rem;
  padding: 0 1rem;
  border: 1px solid var(--line);
  background: transparent;
  font-weight: 600;
  cursor: pointer;
}

.button-small {
  min-height: 2.2rem;
  padding: 0 0.85rem;
}

.button:hover,
.button:focus-visible,
.back-link:hover,
.back-link:focus-visible {
  border-color: #2563eb;
  outline: none;
}

.button-primary {
  border-color: #2563eb;
  color: #1d4ed8;
}

.button-danger {
  border-color: #fca5a5;
  color: #b91c1c;
}

.back-link {
  margin-bottom: 1rem;
  color: var(--ink-muted);
}

.panel {
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface);
}

.compact-panel {
  padding: 1.25rem;
}

.section-block {
  margin-bottom: 2rem;
}

.section-heading {
  margin-bottom: 1rem;
}

.section-heading h2 {
  font-size: 1.35rem;
}

.section-heading p {
  margin: 0.45rem 0 0;
  color: var(--ink-muted);
  line-height: 1.6;
}

.split-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.compact-heading h2 {
  font-size: 1.2rem;
}

.title-bar {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.title-bar p {
  margin: 0 0 0.55rem;
  color: var(--ink-muted);
  line-height: 1.5;
}

.title-bar h1 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
}

.title-bar a {
  color: inherit;
  text-decoration: none;
}

.title-bar a:hover,
.title-bar a:focus-visible {
  color: #1d4ed8;
  outline: none;
}

.form-panel {
  padding: 1.75rem;
}

.stack > * + * {
  margin-top: 1rem;
}

.form-grid,
.filter-grid,
.detail-grid,
.dashboard-grid {
  display: grid;
  gap: 1rem;
}

.form-grid,
.detail-grid,
.dashboard-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(18rem, 1fr);
  gap: 1rem;
  align-items: stretch;
}

.project-board {
  max-width: 68rem;
  margin: 0 auto 1.5rem;
  padding: 1.35rem;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background: var(--surface);
}

.community-board {
  margin-top: 1.5rem;
}

.project-board-header {
  margin-bottom: 1.35rem;
  padding: 0.4rem 0.35rem 1rem;
  border-bottom: 1px solid var(--line-soft);
}

.project-board-header h2 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: -0.04em;
}

.project-board-header p:last-child {
  max-width: 38rem;
  margin: 0.55rem 0 0;
  color: var(--ink-muted);
  line-height: 1.55;
}

.project-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.project-card {
  display: block;
  min-height: 11rem;
  padding: 1rem;
  border: 1px solid var(--line-soft);
  border-radius: 0.7rem;
  background: var(--field);
  color: inherit;
  text-decoration: none;
}

.project-card:hover,
.project-card:focus-visible {
  border-color: #2563eb;
  outline: none;
}

.project-card-muted {
  background: var(--surface-soft);
}

.project-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.project-card-heading h3 {
  margin: 0;
  color: #9f1d12;
  font-size: 0.95rem;
  line-height: 1.25;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.project-card-action {
  text-decoration: none;
}

.project-card-action {
  color: var(--ink-soft);
  font-size: 0.85rem;
  font-weight: 600;
}

.project-card-action:hover,
.project-card-action:focus-visible {
  color: #1d4ed8;
  outline: none;
}

.project-card-copy {
  margin: 0;
  color: var(--ink-muted);
  line-height: 1.55;
}

.project-card-list {
  display: grid;
  gap: 0.55rem;
}

.project-filter {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.project-filter .field {
  min-height: 2.35rem;
  padding: 0.55rem 0.65rem;
  border-radius: 0.65rem;
  font-size: 0.9rem;
}

.project-filter .button {
  width: auto;
  justify-self: start;
}

.project-list-item {
  display: grid;
  gap: 0.2rem;
  color: inherit;
  text-decoration: none;
}

.project-list-item span {
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.35;
}

.project-list-item:not(.static):hover strong,
.project-list-item:not(.static):focus-visible strong {
  color: #1d4ed8;
}

.dashboard-card {
  display: flex;
  flex-direction: column;
}

.dashboard-card-wide {
  min-width: 0;
}

.stacked-actions {
  align-items: flex-start;
}

.community-preview-list {
  display: grid;
  gap: 0.75rem;
}

.community-preview {
  display: grid;
  gap: 0.25rem;
  padding: 0 0 0.55rem;
  border-bottom: 1px solid var(--line-soft);
  text-decoration: none;
}

.community-preview:hover,
.community-preview:focus-visible {
  color: #1d4ed8;
  outline: none;
}

.community-preview span {
  color: var(--ink-muted);
  font-size: 0.95rem;
}

.filter-grid {
  grid-template-columns: 2fr repeat(3, minmax(0, 1fr)) auto;
  align-items: end;
}

.field {
  width: 100%;
  min-height: 2.8rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: var(--field);
  color: var(--ink);
  font: inherit;
}

.field-hint {
  margin: 0.45rem 0 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

textarea.field {
  min-height: auto;
}

.field:focus {
  outline: 2px solid #93c5fd;
  border-color: #2563eb;
}

.errors {
  padding: 1rem;
  border: 1px solid #fca5a5;
  border-radius: 0.85rem;
  background: #fde1df;
  color: #991b1b;
}

.simple-table {
  width: 100%;
  border-collapse: collapse;
}

.table-wrap {
  overflow-x: auto;
}

.simple-table th,
.simple-table td {
  padding: 0.85rem 0.75rem;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
}

.simple-table th {
  color: var(--ink-soft);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.directory-table td {
  min-width: 12rem;
}

.communities-table td:first-child {
  min-width: 16rem;
}

.phone-routing-list {
  margin-top: 0.75rem;
  color: var(--ink-muted);
}

.community-contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
}

.community-contact-grid p {
  margin: 0;
  color: var(--ink-muted);
}

.resident-list {
  display: grid;
  gap: 0.6rem;
}

.resident-contact {
  display: block;
  margin-top: 0.2rem;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.list-item + .list-item {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line-soft);
}

.request-card {
  padding: 1rem 1.1rem;
  border: 1px solid var(--line-soft);
  border-radius: 0.9rem;
  background: var(--surface-soft);
}

.mini-card {
  padding: 0.95rem 1rem;
  border: 1px solid var(--line-soft);
  border-radius: 0.9rem;
  background: var(--surface);
}

.mini-card h3 {
  margin: 0;
  font-size: 1rem;
}

.mini-card p {
  margin: 0.45rem 0 0;
  color: var(--ink-muted);
  line-height: 1.55;
}

.account-card h3 {
  font-size: 0.98rem;
}

.detail-copy {
  color: var(--ink-muted);
  line-height: 1.6;
}

.home-grid,
.auth-grid {
  align-items: start;
}

.request-card + .request-card {
  margin-top: 0.9rem;
}

.request-card-dense {
  background: var(--surface);
}

.request-card-header,
.request-card-footer,
.badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.request-card-footer {
  margin-top: 0.8rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.hero-badges {
  margin-top: 1rem;
  justify-content: flex-start;
}

.badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 600;
}

.badge-info {
  border-color: #93c5fd;
  color: #1d4ed8;
  background: #eff6ff;
}

.badge-success {
  border-color: #86efac;
  color: #166534;
  background: #f0fdf4;
}

.badge-warning {
  border-color: #fcd34d;
  color: #92400e;
  background: #fae9bb;
}

.badge-danger {
  border-color: #fca5a5;
  color: #b91c1c;
  background: #fde1df;
}

.badge-muted {
  border-color: var(--line);
  color: var(--ink-muted);
  background: var(--surface-soft);
}

.resident-stats .stat-value-text {
  font-size: 1.15rem;
  line-height: 1.35;
}

.stacked-cards {
  display: grid;
  gap: 0.9rem;
}

.timeline-card.resident-visible {
  border-color: #bfdbfe;
}

.timeline-card.internal-note {
  border-style: dashed;
  border-color: var(--line);
  background: var(--surface-soft);
}

.list-item h3 {
  margin: 0;
  font-size: 1.05rem;
}

.list-item p {
  margin: 0.45rem 0 0;
  color: var(--ink-muted);
  line-height: 1.6;
}

.list-item-meta {
  color: var(--ink-soft);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.chat-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1;
  min-height: 0;
  margin-bottom: 0;
}

.chat-shell {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 4.5rem);
  min-height: 32rem;
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.chat-shell .hero {
  flex: 0 0 auto;
}

.messages-list {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 0.35rem;
}

.chat-form {
  flex: 0 0 auto;
}

.typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--ink-muted);
}

.thinking-dots {
  display: inline-flex;
  align-items: center;
  gap: 0.18rem;
  min-width: 2.25rem;
}

.thinking-dots span {
  width: 0.32rem;
  height: 0.32rem;
  border-radius: 999px;
  background: currentColor;
  animation: thinking-dot 1.4s infinite ease-in-out both;
}

.thinking-dots span:nth-child(2) {
  animation-delay: 0.14s;
}

.thinking-dots span:nth-child(3) {
  animation-delay: 0.28s;
}

.thinking-dots span:nth-child(4) {
  animation-delay: 0.42s;
}

.thinking-dots span:nth-child(5) {
  animation-delay: 0.56s;
}

@keyframes thinking-dot {
  0%,
  70%,
  100% {
    opacity: 0;
    transform: scale(0);
  }

  20%,
  55% {
    opacity: 1;
    transform: scale(1);
  }
}

.chat-bubble {
  max-width: 36rem;
  padding: 1rem 1.1rem;
  border-radius: 1rem;
}

.message-content + .message-meta {
  margin-top: 0.7rem;
}

.message-meta {
  display: flex;
}

.message-meta time {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  background: rgba(255, 253, 247, 0.72);
  color: var(--ink-soft);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
}

.user-bubble .message-meta {
  justify-content: flex-end;
}

.chat-bubble p {
  margin: 0;
  line-height: 1.6;
}

.chat-bubble p + p {
  margin-top: 0.75rem;
}

.bot-bubble {
  background: var(--surface-soft);
}

.user-bubble {
  margin-left: auto;
  background: #dfead4;
}

.chat-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.inline-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.checkbox-row label {
  margin: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface);
}

.stat-label {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-value {
  margin: 0.5rem 0 0;
  color: var(--ink);
  font-size: 2rem;
  font-weight: 700;
}

.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding-top: 0.5rem;
}

.quick-reply-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  border: none;
  border-radius: 0.5rem;
  background: #3d4f65;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.3;
}

.quick-reply-pill:hover,
.quick-reply-pill:focus-visible {
  background: #2a3a4d;
  outline: none;
}

.aging-critical {
  background: #fde1df;
}

.aging-warning {
  background: #fae9bb;
}

.aging-ok {
  background: #f0fdf4;
}

@media (max-width: 720px) {
  .shell {
    padding-top: 2rem;
  }

  .hero-home {
    grid-template-columns: 1fr;
  }

  .topbar-inner,
  .topnav {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-inner {
    display: flex;
  }

  .account-prompt {
    flex-direction: column;
    align-items: flex-start;
  }

  .form-grid,
  .filter-grid,
  .detail-grid,
  .dashboard-grid,
  .dashboard-row,
  .project-card-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .split-heading {
    display: block;
  }

  .account-actions {
    width: 100%;
  }

  .button {
    width: 100%;
  }
}
