:root {
  --bg: #f6f3ee;
  --surface: #ffffff;
  --text: #1e1b18;
  --muted: #6b6156;
  --accent: #e56b4c;
  --accent-2: #f0c27b;
  --border: #e8ded2;
  --shadow: 0 10px 30px rgba(30, 27, 24, 0.08);
}

html[data-theme="dark"] {
  --bg: #151311;
  --surface: #201d1a;
  --text: #f2ede7;
  --muted: #a39586;
  --accent: #f3a447;
  --accent-2: #6ee7b7;
  --border: #2d2925;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

html[data-theme="sunset"] {
  --bg: #fff1e6;
  --surface: #ffffff;
  --text: #2b1b12;
  --muted: #8d6a55;
  --accent: #f27f65;
  --accent-2: #ffd166;
  --border: #f1d8c6;
  --shadow: 0 10px 30px rgba(70, 33, 15, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  background: radial-gradient(circle at top left, #fff, var(--bg));
  color: var(--text);
}

h1, h2, h3, h4 {
  font-family: "Fraunces", serif;
  margin: 0 0 0.5rem 0;
}

p {
  margin: 0 0 1rem 0;
  color: var(--muted);
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(1120px, 92%);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 0.75);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}

html[data-theme="dark"] .site-header {
  background: rgba(21, 19, 17, 0.85);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  gap: 1rem;
}

.brand {
  font-weight: 700;
  font-size: 1.2rem;
}

.nav {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  align-items: center;
}

.auth-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.menu-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.menu-btn {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 0.4rem 0.5rem;
  border-radius: 10px;
  cursor: pointer;
}

.menu-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 999px;
}

.menu-panel {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(280px, 90vw);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  border-radius: 16px;
  z-index: 20;
}

.menu-panel.is-open {
  display: block;
}

.menu-links {
  display: grid;
  gap: 0.4rem;
  padding: 0.8rem;
}

.menu-links .nav-link {
  display: inline-flex;
  padding: 0.6rem 0.9rem;
}

.nav-link {
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  font-weight: 600;
  color: var(--muted);
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  border: 1px solid transparent;
  position: relative;
}

.nav-link:hover {
  color: var(--text);
  border-color: var(--border);
  background: rgba(229, 107, 76, 0.12);
  transform: translateY(-1px);
}

.nav-link.is-active {
  color: #2b1b12;
  background: linear-gradient(135deg, rgba(229, 107, 76, 0.18), rgba(240, 194, 123, 0.22));
  border-color: rgba(229, 107, 76, 0.25);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 16%;
  right: 16%;
  bottom: -6px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  opacity: 0;
  transform: scaleX(0.6);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.nav-link:hover::after,
.nav-link.is-active::after {
  opacity: 1;
  transform: scaleX(1);
}

.user-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-weight: 600;
}

.btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  box-shadow: var(--shadow);
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(0.98);
}

.btn:active {
  transform: translateY(0);
  filter: brightness(0.95);
}

.btn:focus-visible {
  outline: 2px solid rgba(229, 107, 76, 0.35);
  outline-offset: 2px;
}

.btn.ghost:hover {
  background: rgba(229, 107, 76, 0.08);
  border-color: rgba(229, 107, 76, 0.3);
}

.btn.ghost:active {
  background: rgba(229, 107, 76, 0.15);
}

.link {
  color: var(--accent);
  font-weight: 600;
}

.alert {
  background: var(--accent-2);
  color: #2b1b12;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  font-weight: 600;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: #f1e7db;
  color: #2b1b12;
  font-size: 0.85rem;
  font-weight: 600;
  margin-left: 0.4rem;
}

.badge.mini {
  margin-left: 0.35rem;
  padding: 0.08rem 0.45rem;
  font-size: 0.72rem;
}

.badge.danger {
  background: #f8d7d0;
  color: #7c2d1b;
}

.category-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #fff3e8;
  margin-right: 0.4rem;
  font-size: 1rem;
}

.cta-row {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  align-items: center;
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  align-items: end;
}

.filter-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.hero {
  padding: 5rem 0 2rem 0;
}

.hero-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  align-items: center;
}

.tag {
  display: inline-block;
  background: var(--accent-2);
  color: #2b1b12;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-weight: 600;
  margin-bottom: 1rem;
}

.chip {
  display: inline-flex;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  background: var(--accent-2);
  color: #2b1b12;
  font-weight: 600;
  margin-bottom: 1rem;
}

.lead {
  font-size: 1.1rem;
}

.hero-card {
  background: var(--surface);
  padding: 2rem;
  border-radius: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.spark-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.spark {
  height: 40px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 12px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1rem auto;
  align-items: start;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin: 1rem auto;
  align-items: start;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 16px;
  align-items: start;
  margin: 1rem auto;
}

.metrics-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.dashboard .grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
}

@media (min-width: 1024px) {
  .grid-2.equal-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.collapsible summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  margin-bottom: 1rem;
  list-style: none;
}

.collapsible summary::-webkit-details-marker {
  display: none;
}

.collapsible .chevron {
  transition: transform 0.2s ease;
}

.collapsible[open] .chevron {
  transform: rotate(180deg);
}

.history-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.history-controls label {
  font-size: 0.9rem;
}

.history-search {
  flex: 1 1 180px;
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 0.5rem 0.9rem;
  background: #fff;
  font-family: "Space Grotesk", sans-serif;
}

.history-controls select {
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
}

.mark {
  background: rgba(240, 194, 123, 0.45);
  padding: 0 0.2rem;
  border-radius: 6px;
}

.card {
  background: var(--surface);
  padding: 1.5rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  min-height: 0;
}

.card-header {
  margin-bottom: 16px;
}

.dashboard h1 {
  font-size: 34px;
  font-weight: 700;
}

.dashboard h2 {
  font-size: 22px;
  font-weight: 600;
}

.dashboard .card-header p {
  font-size: 14px;
  opacity: 0.6;
}

.score-card {
  gap: 0.8rem;
  min-height: 0;
}

.score-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.score-radial-wrap {
  position: relative;
  width: 110px;
  height: 110px;
}

.score-radial {
  width: 110px !important;
  height: 110px !important;
}

.score-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.score-center strong {
  font-size: 1.4rem;
  line-height: 1;
}

.score-center small {
  opacity: 0.6;
}

.score-delta {
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-weight: 700;
  font-size: 0.82rem;
}

.score-delta.is-up {
  background: rgba(34, 197, 94, 0.14);
  color: #166534;
}

.score-delta.is-down {
  background: rgba(239, 68, 68, 0.14);
  color: #b91c1c;
}

.score-status {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid var(--border);
}

.score-status.score-ok {
  background: rgba(34, 197, 94, 0.14);
  color: #166534;
}

.score-status.score-warning {
  background: rgba(245, 158, 11, 0.16);
  color: #92400e;
}

.score-status.score-risk {
  background: rgba(239, 68, 68, 0.16);
  color: #991b1b;
}

.score-sparkline-wrap {
  position: relative;
  height: 86px;
}

.score-sparkline {
  width: 100% !important;
  height: 100% !important;
}

.score-breakdown {
  display: grid;
  gap: 0.45rem;
}

.score-break-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.3rem 0.6rem;
  align-items: center;
}

.score-break-row small {
  grid-column: 1 / -1;
  opacity: 0.68;
}

.score-break-bar {
  grid-column: 1 / -1;
  height: 7px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.score-break-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3b82f6, #22c55e);
}

.score-reasons {
  display: grid;
  gap: 0.25rem;
  margin-top: 0.35rem;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

.dashboard .card {
  background: #ffffff;
  border-radius: 24px;
  padding: 22px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 0;
}

.summary-card {
  display: grid;
  gap: 0.4rem;
  align-content: start;
}

.summary-actions {
  margin-top: 0.6rem;
  display: flex;
  justify-content: flex-start;
}

.card.highlight {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #2b1b12;
}

.agent-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  align-items: center;
  margin: 4rem auto;
}

.agent-cards {
  display: grid;
  gap: 1rem;
}

.agent-card {
  background: var(--surface);
  padding: 1rem 1.2rem;
  border-radius: 16px;
  border: 1px dashed var(--border);
}

.agent-callout {
  background: var(--surface);
  padding: 1.5rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  margin-top: 2rem;
}

.agent-callout.agent-loading {
  opacity: 0.7;
  pointer-events: none;
}

.agent-callout.agent-confirmed {
  border-color: rgba(46, 125, 50, 0.4);
}

.agent-callout.agent-error {
  border-color: rgba(183, 28, 28, 0.4);
}

.agent-feedback {
  margin-top: 0.8rem;
  padding: 0.6rem 0.9rem;
  border-radius: 12px;
  background: #e8f5e9;
  color: #1b5e20;
  font-weight: 600;
}

.agent-callout.agent-error .agent-feedback {
  background: #ffebee;
  color: #b71c1c;
}

.notification-item.agent-confirmed {
  border-color: rgba(46, 125, 50, 0.45);
}

.notification-item.agent-error {
  border-color: rgba(183, 28, 28, 0.45);
}

.notification-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.notification-card.has-unread {
  border-color: rgba(229, 107, 76, 0.55);
  background: linear-gradient(135deg, rgba(229, 107, 76, 0.07), rgba(240, 194, 123, 0.08));
}

.notification-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.icon-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  padding: 0;
  margin-top: 0;
}

.icon-button > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  line-height: 1;
}

.notification-bell {
  font-size: 1.05rem;
  position: relative;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0;
}

.notification-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.notification-modal {
  width: min(720px, 92%);
}

.notif-filter.is-active {
  background: rgba(229, 107, 76, 0.12);
  border-color: rgba(229, 107, 76, 0.35);
}

.notification-item.status-aceito {
  border-color: rgba(46, 125, 50, 0.5);
}

.notification-item.status-remarcado {
  border-color: rgba(255, 193, 7, 0.7);
}

.notification-item.status-em_andamento {
  border-color: rgba(25, 118, 210, 0.6);
}

.notification-item.status-concluido {
  border-color: rgba(46, 125, 50, 0.6);
}

.notification-item.status-cancelado {
  border-color: rgba(183, 28, 28, 0.5);
}
.notification-item.status-ignorado {
  border-color: rgba(148, 163, 184, 0.6);
  background: rgba(148, 163, 184, 0.12);
}

.notification-item.status-recusado {
  border-color: rgba(183, 28, 28, 0.5);
}

.notification-item.status-pendente,
.notification-item.status-aguardando {
  border-color: rgba(120, 120, 120, 0.4);
}

.notification-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.status-pill {
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: capitalize;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(120, 120, 120, 0.15);
}

.status-pill.status-aceito {
  background: rgba(46, 125, 50, 0.18);
  border-color: rgba(46, 125, 50, 0.4);
  color: #1b5e20;
}

.status-pill.status-remarcado {
  background: rgba(255, 193, 7, 0.2);
  border-color: rgba(255, 193, 7, 0.6);
  color: #7a5b00;
}

.status-pill.status-em_andamento {
  background: rgba(25, 118, 210, 0.18);
  border-color: rgba(25, 118, 210, 0.5);
  color: #0d47a1;
}

.status-pill.status-concluido {
  background: rgba(46, 125, 50, 0.18);
  border-color: rgba(46, 125, 50, 0.5);
  color: #1b5e20;
}

.status-pill.status-recusado {
  background: rgba(183, 28, 28, 0.15);
  border-color: rgba(183, 28, 28, 0.4);
  color: #7f1d1d;
}

.status-pill.status-proposed {
  background: rgba(251, 191, 36, 0.2);
  border-color: rgba(251, 191, 36, 0.55);
  color: #7a5b00;
}

.status-pill.status-pending_approval,
.status-pill.status-reschedule_proposed,
.status-pill.status-reschedule_requested {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.5);
  color: #92400e;
}

.status-pill.status-confirmed,
.status-pill.status-accepted {
  background: rgba(34, 197, 94, 0.16);
  border-color: rgba(22, 163, 74, 0.45);
  color: #166534;
}

.status-pill.status-cancelled,
.status-pill.status-declined {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(220, 38, 38, 0.4);
  color: #991b1b;
}

.status-pill.status-cancelado {
  background: rgba(183, 28, 28, 0.12);
  border-color: rgba(183, 28, 28, 0.4);
  color: #7f1d1d;
}
.status-pill.status-ignorado {
  background: rgba(148, 163, 184, 0.2);
  border-color: rgba(148, 163, 184, 0.4);
  color: #64748b;
}

.status-pill.status-pendente,
.status-pill.status-aguardando {
  background: rgba(120, 120, 120, 0.15);
  border-color: rgba(120, 120, 120, 0.35);
  color: #4b4b4b;
}

.list-item.status-aceito {
  border-color: rgba(46, 125, 50, 0.5);
}

.list-item.status-remarcado {
  border-color: rgba(255, 193, 7, 0.7);
}

.list-item.status-em_andamento {
  border-color: rgba(25, 118, 210, 0.6);
}

.list-item.status-concluido {
  border-color: rgba(46, 125, 50, 0.5);
}

.list-item.status-cancelado {
  border-color: rgba(183, 28, 28, 0.5);
}
.list-item.status-ignorado {
  border-color: rgba(148, 163, 184, 0.45);
}

.list-item.status-recusado {
  border-color: rgba(183, 28, 28, 0.5);
}

.list-item.status-proposed {
  border-color: rgba(251, 191, 36, 0.6);
}

.list-item.status-pending_approval,
.list-item.status-reschedule_proposed,
.list-item.status-reschedule_requested {
  border-color: rgba(245, 158, 11, 0.55);
}

.list-item.status-confirmed,
.list-item.status-accepted {
  border-color: rgba(34, 197, 94, 0.5);
}

.list-item.status-cancelled,
.list-item.status-declined {
  border-color: rgba(239, 68, 68, 0.5);
}

.list-item.status-pendente,
.list-item.status-aguardando {
  border-color: rgba(120, 120, 120, 0.4);
}

.list-item .status-pill {
  margin-left: auto;
}

.list-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.list-item .status-pill {
  align-self: flex-start;
}

.notif-count {
  position: absolute;
  top: -6px;
  right: -6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
}

.notif-count.is-pulse {
  animation: notifPulse 1.8s ease-in-out infinite;
}

@keyframes notifPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.list {
  margin-top: 1rem;
}

.list-item {
  padding: 0.8rem 1rem;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 0.6rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
  overflow-wrap: anywhere;
}

.list-item:hover {
  border-color: rgba(229, 107, 76, 0.4);
  transform: translateY(-1px);
}

.compact-list .list-item {
  padding: 0.6rem 0.8rem;
}

.compact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.compact-list {
  max-height: 460px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0.4rem;
}

.compact-list .list-item {
  margin-bottom: 0.4rem;
}

.calendar-cell.has-suggestions {
  border-color: rgba(229, 107, 76, 0.6);
  background: rgba(229, 107, 76, 0.08);
}

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

.inline-meta {
  font-size: 0.9rem;
  color: var(--muted);
  white-space: normal;
}

.row-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.6rem;
}

.section-split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.free-slot {
  align-items: center;
  justify-content: space-between;
}

.slot-btn {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  font-weight: 600;
}

.shared-page .card {
  padding: 1.2rem;
}

.suggestions-grid .list-item {
  align-items: center;
}

html[data-compact="true"] .card {
  padding: 1rem;
}

html[data-compact="true"] .list-item {
  padding: 0.5rem 0.7rem;
}

html[data-compact="true"] .page-header {
  margin-bottom: 1rem;
}

html[data-compact="true"] .grid-3,
html[data-compact="true"] .grid-2 {
  margin: 1rem auto;
}

.btn.is-loading {
  opacity: 0.7;
  pointer-events: none;
}

.section-block {
  margin: 1.2rem 0;
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 1.4rem;
}

.section-head h2 {
  margin: 0;
}

.finance-page .grid-3,
.finance-page .grid-2 {
  margin: 1.5rem auto;
}

.finance-page .dashboard-grid {
  margin: 1.25rem auto;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

.finance-page .dashboard-grid > .card {
  min-width: 0;
}

.finance-page .dashboard-grid > *:not(.col-12):not(.col-8):not(.col-6):not(.col-4):not(.col-3) {
  grid-column: span 6;
}

.finance-page .chart-container {
  min-width: 0;
}

.finance-top-toolbar {
  position: sticky;
  top: 78px;
  z-index: 8;
  backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 0.92);
}

.finance-top-toolbar .filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
}

.finance-goal-form {
  margin-top: 0.75rem;
}

.finance-goal-form .filter-row small {
  display: block;
  color: var(--muted);
}

.financial-targets-form small {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.35;
}

.toggle-group {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.toggle-group .btn.is-active {
  background: rgba(229, 107, 76, 0.16);
  border-color: rgba(229, 107, 76, 0.45);
}

.finance-hero-grid {
  grid-template-columns: minmax(280px, 1fr) minmax(380px, 1.2fr) minmax(320px, 1fr);
}

.finance-invest-grid {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.finance-kpi-grid {
  gap: 0.9rem;
  margin: 0;
}

.finance-kpi-card .summary-card {
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.65);
}

.finance-kpi-card .summary-card small {
  opacity: 0.7;
}

.finance-kpi-card .summary-card strong {
  font-size: 1.05rem;
}

.finance-hero-score .chart-container {
  height: 160px;
  min-height: 160px;
  max-height: 160px;
}

.finance-hero-score .chart-container canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

#financeDrilldownCard {
  margin-top: 1rem;
}

#fields-rf,
#fields-rv,
#fields-reserve {
  padding: 0.75rem;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.table th,
.table td {
  border-bottom: 1px solid var(--border);
  padding: 0.55rem 0.45rem;
  text-align: left;
  white-space: nowrap;
}

.table th {
  font-weight: 700;
}

.portfolio-header {
  display: grid;
  grid-template-columns: 2fr 0.8fr 0.8fr 1.2fr 0.8fr 1fr 0.8fr 1fr 0.8fr 0.8fr;
  gap: 18px;
  padding: 10px 20px;
  font-size: 12px;
  text-transform: uppercase;
  color: #888;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.portfolio-row {
  display: grid;
  grid-template-columns: 2fr 0.8fr 0.8fr 1.2fr 0.8fr 1fr 0.8fr 1fr 0.8fr 0.8fr;
  align-items: center;
  gap: 18px;
  padding: 18px 20px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
  margin-bottom: 12px;
  transition: 0.2s ease;
}

.portfolio-row:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

.portfolio-asset {
  font-weight: 600;
  font-size: 15px;
}

.text-right {
  text-align: right;
}

.badge-ok {
  background: #e8f7ee;
  color: #1e7d4f;
  padding: 6px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.btn-edit {
  background: transparent;
  border: 1px solid #e6d5c9;
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 13px;
  cursor: pointer;
  transition: 0.2s;
}

.btn-edit:hover {
  background: #f7efea;
}

.btn-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid #e6d5c9;
  background: transparent;
  cursor: pointer;
  transition: 0.2s;
}

.btn-icon:hover {
  background: #f7efea;
}

.performance.positive {
  color: #16a34a;
  font-weight: 600;
}

.performance.negative {
  color: #dc2626;
  font-weight: 600;
}

.performance.neutral {
  color: #777;
  font-weight: 600;
}

.portfolio-expand {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.portfolio-expand.open {
  max-height: 520px;
}

.portfolio-expand-inner {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr);
  gap: 14px;
  margin: -4px 0 14px 0;
  padding: 10px;
}

.portfolio-expand-details {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
}

.portfolio-expand-details p {
  margin: 0.32rem 0;
}

.insight-chip {
  margin-top: 0.75rem;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(20, 184, 166, 0.12);
  border: 1px solid rgba(20, 184, 166, 0.35);
  color: #0f766e;
  font-size: 0.9rem;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 998;
}

.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  right: -480px;
  width: 480px;
  max-width: 92vw;
  height: 100vh;
  background: #fff;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.1);
  transition: right 0.3s ease;
  padding: 24px;
  z-index: 999;
  overflow-y: auto;
}

.drawer.open {
  right: 0;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  margin-bottom: 1rem;
}

.finance-entry-grid .card,
.finance-history-grid .card {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.finance-entry-grid {
  grid-template-columns: minmax(320px, 1.15fr) minmax(300px, 1fr) minmax(280px, 0.9fr);
  align-items: start;
}

.finance-income-card .stack-divider {
  height: 1px;
  background: var(--border);
  margin: 0.35rem 0 0.25rem;
}

.finance-page .card h3 {
  margin-top: 0;
}

.progress {
  height: 10px;
  background: #f1e7db;
  border-radius: 999px;
  overflow: hidden;
  margin: 0.6rem 0 0.4rem 0;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.item-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 0.6rem;
}

.installment-panel {
  margin-top: 0.55rem;
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.75);
}

.installment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.9rem;
}

.installment-progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #ece4d8;
  overflow: hidden;
  margin: 0.5rem 0;
}

.installment-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #f97316, #fb923c);
}

.installment-meta {
  display: grid;
  gap: 0.3rem;
  font-size: 0.84rem;
  color: var(--muted);
}

.card-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 0.8rem;
}

.card-kpi-grid-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.card-controls {
  margin-top: 0.4rem;
}

.card-controls .btn.is-active {
  background: rgba(229, 107, 76, 0.14);
  border-color: rgba(229, 107, 76, 0.55);
  color: var(--text);
}

.goals-top-grid {
  grid-template-columns: minmax(420px, 2fr) minmax(260px, 1fr) minmax(260px, 1fr);
}

.goals-page .goal-smart-card .chart-container {
  margin-top: 0.6rem;
}

.goals-page .goal-smart-card .insight-chip {
  margin-top: 0.6rem;
}

.text-warning {
  color: #b45309;
}

.goals-page {
  max-width: 1160px;
  margin: 0 auto;
  padding: 28px 18px;
}

.goals-page .page-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-end;
  margin-bottom: 16px;
}

.goals-page .page-head h1 {
  font-size: 40px;
  margin: 0;
}

.goals-page .page-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.goals-page .head-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.goals-page .kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.goals-page .kpi .kpi-title {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.goals-page .kpi .kpi-value {
  font-size: 26px;
  font-weight: 800;
  margin-top: 6px;
}

.goals-page .kpi .kpi-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.goals-page .btn-primary {
  background: linear-gradient(180deg, #f07456, #f7b35b);
  border-color: transparent;
  color: #fff;
}

.goals-page .btn-ghost {
  background: #fff;
}

.goals-page .chart-card .card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.goals-page .chart-card h2 {
  margin: 0;
  font-size: 18px;
}

.goals-page .chart-card p {
  margin: 6px 0 0;
  color: var(--muted);
}

.goals-page .filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.goals-page .chart-wrap {
  height: 320px;
  margin-top: 12px;
}

.goals-page .chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

.goals-page .goals-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 14px;
}

.goals-page .goal-card .goal-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.goals-page .goal-progress .numbers {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}

.goals-page .goal-progress small {
  color: var(--muted);
}

.goals-page .badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 800;
  background: #fff;
  font-size: 12px;
}

.goals-page .badge.ok {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.08);
}

.goals-page .badge.warn {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.08);
}

.goals-page .badge.bad {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.08);
}

.goals-page .progress {
  height: 10px;
  border-radius: 999px;
  background: rgba(240, 210, 195, 0.45);
  overflow: hidden;
  margin: 10px 0 8px;
}

.goals-page .progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #f07456, #f7b35b);
  width: 0;
}

.goals-page .goal-progress .bar .fill {
  width: 0;
}

.goals-page .meta-actions {
  display: flex;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.goals-page .btn-outline {
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid #d6c4b8;
  background: #fff;
  color: #2a211d;
  font-weight: 600;
  cursor: pointer;
}

.goals-page .btn-outline:hover {
  background: #f5efe9;
}

.goals-page .meta-actions .btn-primary {
  padding: 10px 18px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #ff7a4d, #ff5c2c);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(255, 120, 80, 0.3);
}

.goals-page .drawer {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
}

.goals-page .drawer.open {
  display: block;
}

.goals-page .drawer-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
}

.goals-page .drawer-panel {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: min(520px, 92vw);
  background: #fff;
  border-left: 1px solid #f0d6c8;
  box-shadow: -24px 0 60px rgba(0, 0, 0, 0.12);
  border-top-left-radius: 18px;
  border-bottom-left-radius: 18px;
  padding: 18px;
  overflow: auto;
}

.goals-page .drawer-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.goals-page .drawer-body {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.goals-page .kpis {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.goals-page .drawer-body .kpi {
  border: 1px solid #f6d3c2;
  border-radius: 14px;
  padding: 10px;
  background: #fff;
}

.goals-page .drawer-body .kpi span {
  display: block;
  color: #8a5a44;
  font-size: 12px;
}

.goals-page .drawer-body .kpi strong {
  display: block;
  margin-top: 4px;
  font-size: 1rem;
}

.goals-page .chart-box {
  border: 1px solid #f6d3c2;
  border-radius: 16px;
  padding: 12px;
  background: #fff;
}

.goals-page .actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 2px 0;
}

.goals-page .btn.warning {
  background: #ffb020;
  border-color: #ffb020;
  color: #2b1b14;
}

.goals-page .btn.success {
  background: #22c55e;
  border-color: #22c55e;
}

.goals-page .hidden {
  display: none;
}

.goals-page .turbo {
  border: 1px solid #f6d3c2;
  border-radius: 16px;
  padding: 12px;
  background: #fff;
}

.goals-page .turbo-section {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #f6d3c2;
}

.goals-page .turbo-footer {
  margin-top: 12px;
  display: flex;
  gap: 10px;
}

.goals-page .row input {
  flex: 1;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid #f6d3c2;
}

.goals-page .subtle {
  box-shadow: none;
  background: #fffdfa;
}

@media (max-width: 980px) {
  .goals-page .kpi-grid,
  .goals-page .goals-grid {
    grid-template-columns: 1fr;
  }
}

.badge.success {
  background: #e8f7ee;
  color: #1e7d4f;
}

.badge.warning {
  background: #fff4e5;
  color: #9a5a0a;
}

.badge.total {
  background: #efe7df;
  color: #4a352a;
}

.bills-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.bills-summary .badge {
  margin-left: 0;
}

.inline {
  display: inline-block;
}

.legend {
  margin-top: 1rem;
  display: grid;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.35);
}

.modal {
  border: none;
  border-radius: 20px;
  padding: 1.5rem;
  width: min(480px, 92%);
  box-shadow: var(--shadow);
}

.auth, .onboarding {
  padding: 4rem 0;
}

.auth-card, .onboarding-card {
  background: var(--surface);
  padding: 2.5rem;
  border-radius: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  max-width: 720px;
  margin: 0 auto;
}

.stack {
  display: grid;
  gap: 0.8rem;
}

input {
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
}

select {
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
}

.select-card,
.radio-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  cursor: pointer;
  background: var(--surface);
}

.page {
  padding: 2rem 0;
}

.page-header {
  margin-bottom: 1.2rem;
}

.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.dashboard-filters {
  margin-top: 1.5rem;
}

.dashboard-filters .filter-row {
  align-items: flex-end;
}

.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
  gap: 0.4rem;
  margin-top: 1rem;
}

.heatmap-day {
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.2s ease;
}

.heatmap-day:hover {
  transform: translateY(-1px);
  border-color: rgba(229, 107, 76, 0.6);
}

.heatmap-day.is-low {
  background: rgba(34, 197, 94, 0.12);
}

.heatmap-day.is-mid {
  background: rgba(251, 191, 36, 0.18);
}

.heatmap-day.is-high {
  background: rgba(239, 68, 68, 0.2);
}

.simulator-row {
  display: grid;
  gap: 0.5rem;
  margin-top: 1rem;
}

.card--chart .chart-container {
  position: relative;
  height: 280px;
  min-height: 280px;
  max-height: 280px;
  width: 100%;
  overflow: hidden;
}

.chart-container.chart-lg {
  height: 320px;
  min-height: 320px;
  max-height: 320px;
}

.chart-container.chart-md {
  height: 260px;
  min-height: 260px;
  max-height: 260px;
}

.chart-container.chart-sm {
  height: 180px;
  min-height: 180px;
  max-height: 180px;
}

.card--chart .chart-container canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.card-controls select {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  background: #fff;
  min-width: 220px;
}

@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .card-kpi-grid {
    grid-template-columns: 1fr;
  }
  .card-kpi-grid-5 {
    grid-template-columns: 1fr;
  }
  .finance-hero-grid {
    grid-template-columns: 1fr;
  }
  .finance-top-toolbar {
    position: static;
  }
  .portfolio-header {
    display: none;
  }
  .portfolio-row {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 14px;
  }
  .portfolio-row .portfolio-asset {
    grid-column: 1 / -1;
  }
  .portfolio-expand-inner {
    grid-template-columns: 1fr;
  }
  .drawer {
    width: 100vw;
    right: -100vw;
  }
  .card--chart .chart-container,
  .chart-container.chart-lg,
  .chart-container.chart-md {
    height: 220px;
    min-height: 220px;
    max-height: 220px;
  }
  .finance-page .dashboard-grid > * {
    grid-column: 1 / -1;
  }
  .finance-entry-grid {
    grid-template-columns: 1fr;
  }
  .card-controls select {
    min-width: 100%;
  }
}

@media (max-width: 1180px) {
  .finance-entry-grid {
    grid-template-columns: repeat(2, minmax(280px, 1fr));
  }

  .finance-entry-grid .card:last-child {
    grid-column: 1 / -1;
  }
}

.chart-subtitle {
  display: block;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.trend-row {
  margin-top: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.trend-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.78rem;
  font-weight: 700;
}

.trend-chip.is-positive {
  background: rgba(22, 163, 74, 0.12);
  color: #166534;
  border-color: rgba(22, 163, 74, 0.35);
}

.trend-chip.is-warning {
  background: rgba(245, 158, 11, 0.12);
  color: #92400e;
  border-color: rgba(245, 158, 11, 0.35);
}

.trend-chip.is-negative {
  background: rgba(220, 38, 38, 0.12);
  color: #991b1b;
  border-color: rgba(220, 38, 38, 0.35);
}

.risk-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.risk-pill {
  border-radius: 999px;
  padding: 0.18rem 0.6rem;
  border: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 700;
}

.risk-pill.risk-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #b91c1c;
  border-color: rgba(239, 68, 68, 0.35);
}

.risk-pill.risk-warning {
  background: rgba(245, 158, 11, 0.16);
  color: #92400e;
  border-color: rgba(245, 158, 11, 0.35);
}

.risk-pill.risk-ok {
  background: rgba(34, 197, 94, 0.16);
  color: #166534;
  border-color: rgba(34, 197, 94, 0.35);
}

.risk-bar {
  height: 8px;
  width: 100%;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  overflow: hidden;
  margin-top: 0.45rem;
}

.risk-fill {
  height: 100%;
  border-radius: inherit;
}

.risk-fill.risk-danger {
  background: #ef4444;
}

.risk-fill.risk-warning {
  background: #f59e0b;
}

.risk-fill.risk-ok {
  background: #22c55e;
}

.theme-options {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.theme-btn {
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
}

.bar-chart,
.mini-chart,
.line-chart {
  width: 100%;
  height: 140px;
  margin-top: 1rem;
}

.chart-caption {
  display: block;
  margin-top: 0.6rem;
  color: var(--muted);
}

.site-footer {
  margin-top: 4rem;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

@media (max-width: 720px) {
  .dash-header {
    flex-direction: column;
    align-items: flex-start;
  }
}


.log-box {
  white-space: pre-wrap;
  background: #f6efe6;
  padding: 0.8rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  color: var(--text);
}


.favorites-list {
  display: grid;
  gap: 0.8rem;
}

.draggable {
  cursor: grab;
}

.draggable.dragging {
  opacity: 0.6;
  transform: scale(0.98);
}


.is-default {
  border: 2px solid var(--accent);
}


.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip-btn {
  border: 1px solid var(--border);
  background: transparent;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  cursor: pointer;
}

.risk-bars {
  display: grid;
  gap: 0.6rem;
}

.risk-row {
  display: grid;
  grid-template-columns: 140px 1fr 40px;
  align-items: center;
  gap: 0.6rem;
}

.risk-bar {
  height: 10px;
  background: #f1e7db;
  border-radius: 999px;
  overflow: hidden;
}

.risk-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.mini-calendar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.8rem;
}

.mini-day {
  padding: 0.8rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.calendar {
  display: grid;
  gap: 0.4rem;
}

.calendar-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.4rem;
}

.calendar-cell {
  padding: 0.6rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  text-align: center;
  font-weight: 600;
  color: var(--muted);
}

.calendar-cell.in-month {
  color: var(--text);
}

.calendar-cell.is-selected {
  background: linear-gradient(135deg, rgba(229, 107, 76, 0.18), rgba(240, 194, 123, 0.22));
  border-color: rgba(229, 107, 76, 0.25);
}

.calendar-cell.is-today {
  border-color: var(--accent);
}

.calendar-cell small {
  display: block;
  font-weight: 500;
  color: var(--muted);
  margin-top: 0.2rem;
}

.free-slot {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  justify-content: space-between;
}

.slot-btn {
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  font-weight: 600;
}

.help-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  background: var(--accent);
  color: #fff;
  padding: 0.8rem 1.1rem;
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-weight: 600;
  border: 1px solid transparent;
}

.help-fab:hover {
  filter: brightness(0.98);
}

.help-modal {
  width: min(720px, 92%);
}

.help-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.help-body {
  display: grid;
  gap: 1rem;
}

.chat-log {
  max-height: 260px;
  overflow: auto;
  display: grid;
  gap: 0.8rem;
  background: #f6efe6;
  border-radius: 12px;
  padding: 1rem;
  border: 1px solid var(--border);
}

.chat-msg {
  padding: 0.6rem 0.8rem;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.chat-msg.user {
  background: #fff6ee;
  border-color: rgba(229, 107, 76, 0.2);
}

.chat-input {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.tutorial-format {
  display: grid;
  gap: 0.6rem;
}

.tutorial-preview {
  display: grid;
  gap: 0.8rem;
}

.tutorial-cards {
  display: grid;
  gap: 0.6rem;
}

.tutorial-card {
  padding: 0.8rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.tutorial-prints {
  display: grid;
  gap: 0.6rem;
}

.print-step {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.print-step span {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.print-box {
  flex: 1;
  height: 80px;
  border-radius: 12px;
  border: 1px dashed var(--border);
  background: linear-gradient(135deg, rgba(229, 107, 76, 0.08), rgba(240, 194, 123, 0.12));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-weight: 600;
}

.qa-debug-panel {
  position: fixed;
  right: 12px;
  bottom: 12px;
  width: min(360px, 92vw);
  max-height: 42vh;
  background: rgba(20, 20, 20, 0.92);
  color: #fff;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  z-index: 99999;
  overflow: hidden;
}

.qa-debug-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.qa-debug-log {
  max-height: calc(42vh - 34px);
  overflow: auto;
  padding: 6px 8px;
  display: grid;
  gap: 4px;
}

.qa-log {
  font-size: 11px;
  line-height: 1.3;
  opacity: 0.95;
}

.qa-log.qa-ok { color: #86efac; }
.qa-log.qa-warn { color: #fde68a; }
.qa-log.qa-err { color: #fca5a5; }

button.qa-failed {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25) !important;
}

button.qa-dead-btn {
  outline: 2px dashed rgba(245, 158, 11, 0.65);
  outline-offset: 2px;
}

