:root {
  --color-green: #6FA46F;
  --color-green-dark: #4C7A4C;
  --color-brown: #8B5E3C;
  --color-brown-dark: #5E3F25;
  --color-gold: #E6B450;
  --color-gold-soft: #F2C97D;
  --color-cream: #F8F5EE;
  --color-cream-soft: #F2EDE1;
  --color-ink: #2F2A25;
  --color-muted: #6F665B;
  --brand-radius: 18px;
  --brand-shadow: 0 18px 32px rgba(139, 94, 60, 0.12);
  --brand-border: 1px solid rgba(139, 94, 60, 0.18);
  --brand-border-strong: 1px solid rgba(139, 94, 60, 0.32);
  --brand-gradient: linear-gradient(135deg, rgba(111, 164, 111, 0.18), rgba(230, 180, 80, 0.18));
  font-family: "Nunito", "Poppins", "Segoe UI", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
}

body.brand-hobbit-style {
  margin: 0;
  background: var(--color-cream);
  color: var(--color-ink);
  font-family: "Nunito", "Poppins", "Segoe UI", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.brand-hobbit-style a {
  color: var(--color-green-dark);
  text-decoration: none;
}

.brand-hobbit-style a:hover {
  color: var(--color-brown);
}

.comteo-topbar {
  position: sticky;
  top: 0;
  z-index: 800;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  background: var(--color-cream);
  border-bottom: var(--brand-border);
  box-shadow: 0 10px 24px rgba(47, 42, 37, 0.04);
}

.comteo-topbar--subtle {
  position: static;
  padding: 10px 16px;
  border-radius: 0 0 calc(var(--brand-radius) - 6px) calc(var(--brand-radius) - 6px);
}

.comteo-topbar__brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--color-brown);
  font-weight: 700;
  font-size: 1.35rem;
}

.comteo-topbar__brand:hover {
  opacity: 0.9;
}

.comteo-topbar__logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--brand-gradient);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  box-shadow: 0 10px 18px rgba(111, 164, 111, 0.22);
}

.comteo-topbar__logo img {
  display: block;
  width: 32px;
  height: 32px;
}

.comteo-topbar__context {
  font-size: 0.95rem;
  color: var(--color-muted);
}

.comteo-topbar__spacer {
  flex: 1;
}

.comteo-topbar__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-card,
.brand-hobbit-style .card {
  background: #fff !important;
  border-radius: var(--brand-radius) !important;
  border: var(--brand-border) !important;
  box-shadow: var(--brand-shadow) !important;
  color: var(--color-ink) !important;
}

.brand-card[data-tone="warm"] {
  background: linear-gradient(145deg, rgba(248, 245, 238, 0.88), rgba(230, 180, 80, 0.12));
}

.brand-panel {
  background: rgba(255, 255, 255, 0.78) !important;
  border-radius: calc(var(--brand-radius) - 4px) !important;
  border: var(--brand-border) !important;
  box-shadow: 0 14px 22px rgba(139, 94, 60, 0.08) !important;
}

.brand-hobbit-style .btn,
.brand-button-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--color-green) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 999px !important;
  padding: 10px 18px !important;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
  box-shadow: 0 12px 20px rgba(111, 164, 111, 0.24);
}

.brand-hobbit-style .btn:hover,
.brand-button-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(111, 164, 111, 0.32);
}

.brand-hobbit-style .btn:active,
.brand-button-primary:active {
  transform: translateY(0);
  box-shadow: 0 8px 16px rgba(111, 164, 111, 0.26);
}

.brand-button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(111, 164, 111, 0.12) !important;
  color: var(--color-brown) !important;
  border: 1px solid rgba(111, 164, 111, 0.45) !important;
  border-radius: 999px !important;
  padding: 10px 18px !important;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
}

.brand-button-secondary:hover {
  background: rgba(111, 164, 111, 0.2);
}

.brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(230, 180, 80, 0.18);
  color: var(--color-brown);
  font-size: 0.9rem;
}

.brand-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 12px;
  background: rgba(111, 164, 111, 0.15);
  border: 1px solid rgba(111, 164, 111, 0.35);
  color: var(--color-brown);
  font-size: 0.85rem;
}

.brand-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(139, 94, 60, 0.12) !important;
  color: var(--color-brown) !important;
  font-weight: 600 !important;
  font-size: 0.82rem !important;
}

.brand-hobbit-style input,
.brand-hobbit-style select,
.brand-hobbit-style textarea {
  font-family: inherit !important;
  background: rgba(255, 255, 255, 0.92) !important;
  border: 1px solid rgba(139, 94, 60, 0.22) !important;
  border-radius: 14px !important;
  padding: 10px 14px !important;
  color: var(--color-ink) !important;
  transition: border 0.12s ease, box-shadow 0.12s ease;
}

.brand-hobbit-style input:focus,
.brand-hobbit-style select:focus,
.brand-hobbit-style textarea:focus {
  outline: none !important;
  border-color: rgba(111, 164, 111, 0.6) !important;
  box-shadow: 0 0 0 4px rgba(111, 164, 111, 0.22) !important;
}

.brand-section-title {
  margin: 0 0 12px;
  color: var(--color-brown);
  font-size: 1.25rem;
  font-weight: 700;
}

.brand-muted {
  color: var(--color-muted);
}

.brand-surface {
  background: rgba(255, 255, 255, 0.82);
  border-radius: calc(var(--brand-radius) - 6px);
  border: 1px solid rgba(139, 94, 60, 0.12);
  box-shadow: 0 18px 26px rgba(139, 94, 60, 0.08);
}

.brand-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--color-muted);
}

.brand-breadcrumbs a {
  color: inherit;
}

.brand-hobbit-style table {
  background: rgba(255, 255, 255, 0.86);
  border-radius: calc(var(--brand-radius) - 6px);
  overflow: hidden;
}

.brand-hobbit-style th {
  background: rgba(139, 94, 60, 0.08);
  color: var(--color-brown);
}

.brand-hobbit-style tr:nth-child(even) {
  background: rgba(248, 245, 238, 0.55);
}

.brand-hobbit-style .badge,
.brand-hobbit-style .chip {
  background: rgba(230, 180, 80, 0.16) !important;
  border: 1px solid rgba(230, 180, 80, 0.32) !important;
  color: var(--color-brown) !important;
  border-radius: 999px !important;
  padding: 4px 10px !important;
}

.brand-hobbit-style .muted,
.brand-muted {
  color: var(--color-muted);
}

.brand-hobbit-style .surface-soft {
  background: rgba(255, 255, 255, 0.74);
  border-radius: calc(var(--brand-radius) - 8px);
  border: 1px solid rgba(139, 94, 60, 0.1);
}

@media (max-width: 720px) {
  .comteo-topbar {
    padding: 12px 16px;
    gap: 14px;
    flex-direction: column;
    align-items: stretch;
  }
  .comteo-topbar__brand {
    font-size: 1.1rem;
    justify-content: center;
  }
  .comteo-topbar__logo {
    width: 38px;
    height: 38px;
    padding: 5px;
  }
  .comteo-topbar__logo img {
    width: 28px;
    height: 28px;
  }
  .comteo-topbar__context {
    text-align: center;
  }
  .comteo-topbar__actions {
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
  }
  .comteo-topbar__actions .btn,
  .comteo-topbar__actions button,
  .comteo-topbar__actions a {
    width: 100%;
    justify-content: center;
  }
  .comteo-topbar__spacer {
    display: none;
  }
}

.brand-hobbit-style footer,
.brand-footer {
  padding: 24px 16px;
  border-top: 1px solid rgba(139, 94, 60, 0.18);
  color: var(--color-muted);
  background: rgba(255, 255, 255, 0.6);
}

.brand-kicker {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-green-dark);
}

.brand-hobbit-style .pill-success {
  background: rgba(111, 164, 111, 0.18);
  border: 1px solid rgba(111, 164, 111, 0.35);
  color: var(--color-green-dark);
}

.brand-hobbit-style .pill-warning {
  background: rgba(230, 180, 80, 0.2);
  border: 1px solid rgba(230, 180, 80, 0.35);
  color: var(--color-brown-dark);
}

.brand-hobbit-style .pill-info {
  background: rgba(108, 160, 160, 0.18);
  border: 1px solid rgba(108, 160, 160, 0.35);
  color: #456873;
}

.brand-inline-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: var(--brand-gradient);
  box-shadow: 0 10px 20px rgba(111, 164, 111, 0.24);
}

.brand-inline-logo img {
  width: 22px;
  height: 22px;
  display: block;
  filter: none;
}

/* Legacy dashboard & marketplace overrides */
body.brand-hobbit-style .app-topbar,
body.brand-hobbit-style .topbar,
body.brand-hobbit-style header.topbar {
  background: var(--color-cream) !important;
  color: var(--color-brown) !important;
  border-bottom: var(--brand-border) !important;
  box-shadow: 0 12px 22px rgba(139, 94, 60, 0.12);
}

body.brand-hobbit-style .app-brand,
body.brand-hobbit-style .topbar-title {
  color: var(--color-brown) !important;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700 !important;
}

body.brand-hobbit-style .app-topbar .app-burger,
body.brand-hobbit-style .topbar .burger,
body.brand-hobbit-style #menuBtn {
  background: rgba(111, 164, 111, 0.15) !important;
  border: 1px solid rgba(111, 164, 111, 0.35) !important;
  border-radius: 12px !important;
  padding: 6px 10px !important;
}

body.brand-hobbit-style .app-topbar .app-burger span,
body.brand-hobbit-style .topbar .burger span {
  background: var(--color-green-dark) !important;
}

body.brand-hobbit-style .app-sidebar,
body.brand-hobbit-style .drawer,
body.brand-hobbit-style #settings-drawer,
body.brand-hobbit-style .settings-panel,
body.brand-hobbit-style .side-card,
body.brand-hobbit-style .side,
body.brand-hobbit-style .main .card,
body.brand-hobbit-style .card.toolbar {
  background: rgba(255, 255, 255, 0.92) !important;
  color: var(--color-ink) !important;
  border-color: rgba(139, 94, 60, 0.22) !important;
  box-shadow: var(--brand-shadow) !important;
}

body.brand-hobbit-style .app-sidebar a,
body.brand-hobbit-style .drawer a,
body.brand-hobbit-style .nav .nav-item,
body.brand-hobbit-style .tab,
body.brand-hobbit-style .tabs a {
  color: var(--color-brown) !important;
}

body.brand-hobbit-style .app-sidebar a:hover,
body.brand-hobbit-style .drawer a:hover,
body.brand-hobbit-style .nav .nav-item:hover,
body.brand-hobbit-style .tab.on,
body.brand-hobbit-style .tab.active,
body.brand-hobbit-style .tabs .tab.active,
body.brand-hobbit-style .tabs .tab.on {
  background: rgba(111, 164, 111, 0.18) !important;
  color: var(--color-brown) !important;
  border-color: rgba(111, 164, 111, 0.3) !important;
}

body.brand-hobbit-style .muted,
body.brand-hobbit-style .drawer .muted,
body.brand-hobbit-style .nav .muted,
body.brand-hobbit-style .meta {
  color: var(--color-muted) !important;
}

body.brand-hobbit-style .grid,
body.brand-hobbit-style .layout,
body.brand-hobbit-style .client-layout {
  gap: 20px !important;
}

body.brand-hobbit-style .qr,
body.brand-hobbit-style .qr-wrap {
  background: #fff !important;
  border: 1px solid rgba(139, 94, 60, 0.18) !important;
  border-radius: 16px !important;
  box-shadow: 0 12px 24px rgba(47, 42, 37, 0.08) !important;
}

body.brand-hobbit-style .tabs,
body.brand-hobbit-style .toolbar,
body.brand-hobbit-style .filters,
body.brand-hobbit-style .actions,
body.brand-hobbit-style .row {
  gap: 12px !important;
}

body.brand-hobbit-style .tab,
body.brand-hobbit-style .toolbar button,
body.brand-hobbit-style .toolbar select,
body.brand-hobbit-style .toolbar input,
body.brand-hobbit-style .filters select {
  border-radius: 14px !important;
  border: 1px solid rgba(139, 94, 60, 0.24) !important;
  background: rgba(255, 255, 255, 0.9) !important;
}

body.brand-hobbit-style .tab.on,
body.brand-hobbit-style .tab.active {
  background: rgba(111, 164, 111, 0.2) !important;
  border-color: rgba(111, 164, 111, 0.4) !important;
}

body.brand-hobbit-style .btn-ghost,
body.brand-hobbit-style .btn-secondary,
body.brand-hobbit-style .ghost {
  background: rgba(230, 180, 80, 0.12) !important;
  border: 1px solid rgba(230, 180, 80, 0.28) !important;
  color: var(--color-brown) !important;
}
