:root {
  --sidebar-bg: #1c2b24;
  --sidebar-accent: #c4a35a;
  --app-bg: #f3f0e8;
  --surface: #fffcf6;
  --ink: #1a1f1c;
}

body.bg-app {
  background:
    radial-gradient(circle at top left, rgba(196, 163, 90, 0.18), transparent 40%),
    linear-gradient(160deg, #f3f0e8 0%, #e8ebe4 55%, #dfe8e1 100%);
  color: var(--ink);
  min-height: 100vh;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
}

.bg-sidebar,
.sidebar,
.offcanvas.bg-sidebar {
  background: linear-gradient(180deg, #1c2b24 0%, #243830 100%);
}

.sidebar {
  width: 250px;
  min-height: 100vh;
  position: sticky;
  top: 0;
}

.nav-sidebar .nav-link {
  color: rgba(255, 255, 255, 0.82);
  border-radius: 0.4rem;
  padding: 0.55rem 0.75rem;
}

.nav-sidebar .nav-link:hover,
.nav-sidebar .btn-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.nav-sidebar .btn-link {
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
}

.main-content {
  min-width: 0;
}

.card-surface {
  background: var(--surface);
  border: 1px solid rgba(28, 43, 36, 0.08);
  border-radius: 0.75rem;
  box-shadow: 0 8px 24px rgba(28, 43, 36, 0.04);
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.stat-label {
  color: #5c6b63;
  font-size: 0.9rem;
}

.bar-track {
  height: 0.45rem;
  background: rgba(28, 43, 36, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--sidebar-accent);
}

.table > :not(caption) > * > * {
  background: transparent;
}

.login-card {
  max-width: 420px;
  margin: 0 auto;
}

.chat-layout {
  min-height: calc(100vh - 8rem);
}

.chat-thread-wrap {
  min-height: 70vh;
}

.chat-messages {
  max-height: calc(70vh - 9rem);
  overflow-y: auto;
}

.chat-msg-user .chat-bubble {
  background: rgba(28, 43, 36, 0.08);
  border-radius: 0.75rem 0.75rem 0.2rem 0.75rem;
  margin-left: 2rem;
}

.chat-msg-assistant .chat-bubble {
  background: var(--surface);
  border: 1px solid rgba(28, 43, 36, 0.08);
  border-radius: 0.75rem 0.75rem 0.75rem 0.2rem;
  margin-right: 2rem;
}

.chat-composer.sticky-bottom {
  position: sticky;
  bottom: 0;
}

.htmx-indicator {
  display: none;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
  display: inline;
}

.toast-container .app-toast {
  min-width: 16rem;
  max-width: min(24rem, calc(100vw - 1.5rem));
  background: rgba(255, 252, 246, 0.96);
  border: 1px solid rgba(28, 43, 36, 0.1);
  border-left-width: 3px;
  border-radius: 0.55rem;
  box-shadow: 0 10px 28px rgba(28, 43, 36, 0.1);
  color: var(--ink);
  font-size: 0.9rem;
}

.toast-container .app-toast .toast-body {
  padding: 0.7rem 0.85rem;
}

.toast-container .app-toast-success {
  border-left-color: #5a8f6d;
}

.toast-container .app-toast-error,
.toast-container .app-toast-danger {
  border-left-color: #b15b55;
}

.toast-container .app-toast-warning {
  border-left-color: #c4a35a;
}

.toast-container .app-toast-info,
.toast-container .app-toast-debug {
  border-left-color: #5c7a8a;
}

