:root {
  --teal: #0f7c5e;
  --teal-light: #1aaf87;
  --teal-pale: #e0f5ef;
  --teal-mid: #c0ead9;
  --navy: #0f2540;
  --navy-mid: #1d3a5f;
  --amber: #c97b1a;
  --amber-light: #f5a623;
  --amber-pale: #fef3dc;
  --coral: #d64b2a;
  --coral-pale: #fdeee9;
  --sand: #f8f5ef;
  --sand-dark: #ede8df;
  --text: #1a1a18;
  --text-mid: #4a4a44;
  --text-muted: #888880;
  --white: #ffffff;
  --border: #ddd8cc;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow-lg: 0 8px 40px rgba(15, 37, 64, 0.14);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "DM Sans", sans-serif;
  background: var(--sand);
  color: var(--text);
  min-height: 100vh;
}

.app-header {
  background: linear-gradient(120deg, #0c1c33 0%, #112848 45%, #0f2540 100%);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 100;
  overflow: hidden;
  isolation: isolate;
  box-shadow:
    inset 0 -1px 0 rgba(255, 255, 255, 0.08),
    0 8px 30px rgba(12, 28, 51, 0.35);
}

.app-header::before,
.app-header::after {
  content: "";
  position: absolute;
  inset: -120% -10%;
  pointer-events: none;
  z-index: 0;
}

.app-header::before {
  background:
    radial-gradient(42% 38% at 20% 35%, rgba(26, 175, 135, 0.35), transparent 72%),
    radial-gradient(35% 30% at 80% 25%, rgba(245, 166, 35, 0.24), transparent 70%),
    radial-gradient(34% 36% at 50% 72%, rgba(214, 75, 42, 0.2), transparent 74%);
  filter: blur(24px) saturate(120%);
  animation: appHeaderGlowDrift 15s ease-in-out infinite alternate;
}

.app-header::after {
  background: linear-gradient(
    115deg,
    transparent 10%,
    rgba(255, 255, 255, 0.09) 32%,
    rgba(26, 175, 135, 0.1) 54%,
    rgba(245, 166, 35, 0.09) 76%,
    transparent 92%
  );
  filter: blur(18px);
  animation: appHeaderSheen 9s linear infinite;
}

.app-header > * {
  position: relative;
  z-index: 1;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-mark {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--teal-light), var(--teal));
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.logo-text {
  font-family: "DM Serif Display", serif;
  font-size: 20px;
  color: white;
  letter-spacing: 0.01em;
}

.logo-badge {
  font-size: 10px;
  font-weight: 600;
  color: var(--teal-light);
  background: rgba(26, 175, 135, 0.12);
  border: 1px solid rgba(26, 175, 135, 0.3);
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-tabs {
  display: flex;
  gap: 4px;
}

.nav-tab {
  padding: 6px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  transition: all 0.18s;
}

.nav-tab:hover {
  color: white;
  background: rgba(255, 255, 255, 0.06);
}

.nav-tab.active {
  color: var(--teal-light);
  background: rgba(26, 175, 135, 0.2);
}

.main {
  display: flex;
  min-height: calc(100vh - 64px);
}

.sidebar {
  width: 240px;
  background: var(--white);
  border-right: 1px solid var(--border);
  padding: 1.5rem 1rem;
  flex-shrink: 0;
}

.sidebar-section {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 8px;
  margin: 1rem 0 0.5rem;
}

.sidebar-section:first-child {
  margin-top: 0;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 400;
  color: var(--text-mid);
  text-decoration: none;
  transition: all 0.15s;
}

.sidebar-item:hover {
  background: var(--sand);
  color: var(--text);
}

.sidebar-item.active {
  background: var(--teal-pale);
  color: var(--teal);
  font-weight: 500;
}

.sidebar-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.content {
  flex: 1;
  padding: 2rem;
  overflow: auto;
}

.page-title {
  font-family: "DM Serif Display", serif;
  font-size: 26px;
  color: var(--navy);
  margin-bottom: 0.25rem;
}

.page-sub {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.card-sm {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.card-no-padding {
  padding: 0;
}

.overflow-hidden {
  overflow: hidden;
}

.card-head-row {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-head-title {
  font-weight: 600;
  font-size: 15px;
  color: var(--navy);
}

.space-bottom {
  margin-bottom: 1rem;
}

.top-space {
  margin-top: 1.5rem;
}

.card-divider {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.stat-card.teal::before {
  background: var(--teal-light);
}

.stat-card.amber::before {
  background: var(--amber-light);
}

.stat-card.coral::before {
  background: var(--coral);
}

.stat-card.navy::before {
  background: var(--navy-mid);
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.stat-value {
  font-size: 28px;
  font-weight: 600;
  color: var(--navy);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-delta {
  font-size: 12px;
  color: var(--teal);
  font-weight: 500;
}

.two-column-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.match-log-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.match-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.match-icon.match {
  background: var(--teal-pale);
}

.match-icon.pending {
  background: var(--amber-pale);
}

.match-info {
  flex: 1;
}

.match-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
}

.match-detail {
  font-size: 12px;
  color: var(--text-muted);
}

.match-status {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}

.match-status.matched {
  background: var(--teal-pale);
  color: var(--teal);
}

.match-status.waiting {
  background: var(--amber-pale);
  color: var(--amber);
}

.score-dist-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.score-dist-row {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  margin-bottom: 4px;
}

.score-label-teal {
  color: var(--teal);
  font-weight: 600;
}

.score-label-amber {
  color: var(--amber);
  font-weight: 600;
}

.score-label-coral {
  color: #d64b2a;
  font-weight: 600;
}

.score-meta {
  color: var(--text-muted);
}

.bar-track {
  background: var(--sand-dark);
  border-radius: 4px;
  height: 10px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 4px;
}

.bar-fill.teal {
  background: var(--teal);
}

.bar-fill.amber {
  background: var(--amber-light);
}

.bar-fill.coral {
  background: #d64b2a;
}

.mini-heading {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.7rem;
}

.price-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.price-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.price-text {
  font-weight: 600;
  color: var(--teal);
}

.demo-notice {
  background: var(--amber-pale);
  border: 1px solid #f5c842;
  border-radius: 9px;
  padding: 10px 16px;
  font-size: 12.5px;
  color: var(--amber);
  margin-bottom: 1.5rem;
}

.komoditas-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.komoditas-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.18s, box-shadow 0.18s;
}

.komoditas-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.komoditas-img {
  width: 100%;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 52px;
  background: linear-gradient(135deg, var(--teal-pale), #f4fbf8);
}

.komoditas-body {
  padding: 1rem;
}

.komoditas-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--navy);
  margin-bottom: 4px;
}

.komoditas-farmer {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.komoditas-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--teal);
  margin-bottom: 4px;
}

.komoditas-stock {
  font-size: 12px;
  color: var(--text-mid);
}

.komoditas-footer {
  padding: 10px 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.match-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  background: var(--teal-pale);
  color: var(--teal);
}

.match-badge.new {
  background: var(--amber-pale);
  color: var(--amber);
}

.toolbar-row {
  display: flex;
  gap: 8px;
  margin-bottom: 1.25rem;
  align-items: center;
}

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

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.commodity-table {
  min-width: 640px;
}

.price-history-table {
  min-width: 700px;
}

.data-table th {
  background: var(--navy);
  color: white;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 10px 14px;
  text-align: left;
}

.data-table tbody tr {
  transition: background-color 0.15s ease;
}

.data-table tbody tr:nth-child(even) {
  background: rgba(243, 239, 226, 0.36);
}

.data-table tbody tr:hover {
  background: rgba(122, 172, 144, 0.08);
}

.data-table td {
  padding: 12px 14px;
  font-size: 13.5px;
  border-bottom: 1px solid var(--border);
  color: var(--text-mid);
}

.data-table td:last-child,
.data-table th:last-child {
  white-space: nowrap;
}

.commodity-table-head {
  align-items: flex-start;
}

.commodity-table-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.commodity-table-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--teal-pale);
  color: var(--teal);
  font-size: 12px;
  font-weight: 600;
}

.commodity-row-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.commodity-row-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.commodity-row-icon img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.commodity-row-name {
  font-weight: 600;
  color: var(--navy);
}

.commodity-row-sub {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-muted);
}

.commodity-price-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--sand);
  color: var(--navy);
  font-weight: 600;
}

.commodity-price-pill small {
  color: var(--text-muted);
  font-weight: 500;
}

.commodity-updated {
  line-height: 1.35;
}

.commodity-updated small {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
}

.commodity-table-actions {
  text-align: right;
}

.price-history-empty {
  color: var(--text-muted);
  font-weight: 600;
}

.mobile-field-label {
  display: none;
}

.price-change-pill {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.price-change-pill.up {
  background: var(--teal-pale);
  color: var(--teal);
}

.price-change-pill.down {
  background: var(--coral-pale);
  color: var(--coral);
}

.price-change-pill.steady {
  background: var(--amber-pale);
  color: var(--amber);
}

.score-pill {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  gap: 4px;
}

.score-pill.high {
  background: var(--teal-pale);
  color: var(--teal);
}

.score-pill.mid {
  background: var(--amber-pale);
  color: var(--amber);
}

.score-pill.low {
  background: var(--coral-pale);
  color: var(--coral);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.dot.high {
  background: var(--teal);
}

.dot.mid {
  background: var(--amber);
}

.dot.low {
  background: var(--coral);
}

.empty-table {
  text-align: center;
  color: var(--text-muted);
  padding: 16px;
}

.onboarding-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.5rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  margin-bottom: 1.1rem;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-mid);
  margin-bottom: 6px;
  display: block;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.form-group input,
.form-group select,
.form-group textarea,
.form-input,
.form-select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  outline: none;
  transition: border-color 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.form-input:focus,
.form-select:focus {
  border-color: var(--teal-light);
}

.form-actions {
  margin-top: 0.5rem;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.callout-success {
  background: var(--teal-pale);
  border-color: var(--teal-mid);
}

.callout-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-mid);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.18s;
  font-family: inherit;
  text-decoration: none;
}

.btn-primary {
  background: var(--teal);
  color: white;
}

.btn-primary:hover {
  background: var(--teal-light);
}

.btn-outline {
  background: transparent;
  color: var(--teal);
  border: 1.5px solid var(--teal);
}

.btn-outline:hover {
  background: var(--teal-pale);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
  border-radius: 7px;
}

.empty-state {
  padding: 20px;
  color: var(--text-muted);
}

.bot-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 2rem;
  align-items: start;
}

.bot-guide-card {
  margin-bottom: 1rem;
}

.guide-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.guide-row {
  display: flex;
  gap: 10px;
  font-size: 13px;
  align-items: center;
}

.guide-row code {
  background: var(--sand);
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 12px;
}

.guide-row span {
  color: var(--text-mid);
}

.phone-frame {
  width: 360px;
  background: #e5ddd5;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--shadow-lg), 0 0 0 8px var(--navy);
  margin: 0 auto;
}

.phone-bar {
  background: #1e8a6e;
  padding: 12px 16px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.phone-avatar {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #0f7c5e, #1aaf87);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.phone-bar-info {
  flex: 1;
}

.phone-bar-name {
  font-weight: 600;
  color: white;
  font-size: 15px;
}

.phone-bar-status {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.chat-window {
  height: 460px;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #e5ddd5;
}

.msg {
  max-width: 78%;
}

.msg.bot {
  align-self: flex-start;
}

.msg.user {
  align-self: flex-end;
}

.msg-bubble {
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.msg.bot .msg-bubble {
  background: white;
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.msg.user .msg-bubble {
  background: #d9fdd3;
  color: var(--text);
  border-bottom-right-radius: 4px;
}

.msg-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  padding: 0 4px;
}

.msg.user .msg-time {
  text-align: right;
}

.bot-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.bot-btn {
  background: #e8f7f3;
  border: 1px solid #a8ddd0;
  color: #0f7c5e;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
}

.chat-input-row {
  background: #f0f0f0;
  padding: 8px 10px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.chat-input {
  flex: 1;
  background: white;
  border: none;
  border-radius: 20px;
  padding: 9px 14px;
  font-size: 13.5px;
  outline: none;
  font-family: inherit;
}

.chat-send {
  width: 36px;
  height: 36px;
  background: #1e8a6e;
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.typing-indicator {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 10px 14px;
  background: white;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  width: fit-content;
}

.typing-dot {
  width: 7px;
  height: 7px;
  background: #aaa;
  border-radius: 50%;
  animation: typing 1.2s infinite;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

.score-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
}

.score-display {
  text-align: center;
}

.score-meta-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.score-meta-label span {
  color: var(--navy);
}

.score-ring {
  width: 160px;
  height: 160px;
  position: relative;
  margin: 0 auto 1rem;
}

.score-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.score-ring circle {
  fill: none;
  stroke-width: 12;
  stroke-linecap: round;
}

.score-bg {
  stroke: var(--sand-dark);
}

.score-fill {
  stroke: var(--teal-light);
  transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.score-fill.warning {
  stroke: var(--amber-light);
}

.score-fill.danger {
  stroke: var(--coral);
}

.score-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.score-num {
  font-size: 38px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
}

.score-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.score-badge {
  font-size: 13px;
  font-weight: 600;
  padding: 6px 20px;
  border-radius: 20px;
  display: inline-block;
}

.score-badge.layak {
  background: var(--teal-pale);
  color: var(--teal);
}

.score-badge.pending {
  background: var(--amber-pale);
  color: var(--amber);
}

.score-badge.belum {
  background: var(--coral-pale);
  color: var(--coral);
}

.score-desc {
  margin-top: 1.2rem;
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.6;
}

.formula-note {
  font-size: 12.5px;
  color: var(--text-muted);
  margin: 8px 0 1.25rem;
}

.section-subtitle {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: 0.7rem;
}

.benchmark-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 1rem;
}

.benchmark-grid.compact {
  margin-bottom: 0.65rem;
}

.benchmark-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.benchmark-label {
  font-size: 11px;
  color: var(--text-muted);
}

.benchmark-note {
  margin: -2px 0 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.benchmark-scope {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--navy);
  background: #e8eef6;
  margin-right: 6px;
}

.global-settings-title {
  color: var(--navy);
  margin-bottom: 6px;
}

.compact-actions {
  gap: 8px;
  margin-top: 2px;
}

.metric-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(170px, 220px) minmax(160px, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.metric-value {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--navy);
  text-align: right;
  white-space: nowrap;
}

.hbar {
  width: 100%;
  height: 10px;
  background: var(--sand-dark);
  border-radius: 999px;
  overflow: hidden;
}

.hbar-fill {
  width: 0;
  height: 100%;
  border-radius: 999px;
  transition: width 0.35s ease;
  background: linear-gradient(90deg, #19a17c, #61cfb1);
}

.hbar-fill.normalized {
  background: linear-gradient(90deg, #0f2540, #2d5e93);
}

.var-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.var-row:last-child {
  border-bottom: none;
}

.var-desc {
  flex: 1;
}

.var-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
}

.var-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.var-weight {
  font-size: 11px;
  font-weight: 600;
  color: var(--teal);
  background: var(--teal-pale);
  padding: 2px 7px;
  border-radius: 20px;
}

.var-slider {
  flex: 2;
  accent-color: var(--teal);
}

.var-val {
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  width: 32px;
  text-align: right;
}

.score-breakdown {
  margin-top: 1.2rem;
  padding: 1.1rem;
  background: var(--sand);
  border-radius: 10px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  text-align: center;
}

.comp-num {
  font-size: 18px;
  font-weight: 700;
  color: var(--teal);
}

.total-line {
  margin-top: 10px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.total-line strong {
  color: var(--navy);
  font-size: 16px;
}

.save-feedback {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.last-saved-at {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.save-feedback.success {
  color: var(--teal);
}

.save-feedback.error {
  color: var(--coral);
}

.row-updated {
  animation: rowFlash 1.6s ease;
}

@keyframes rowFlash {
  0% {
    background-color: #fff6d6;
  }
  65% {
    background-color: #fff9e7;
  }
  100% {
    background-color: transparent;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes appHeaderGlowDrift {
  0% {
    transform: translate3d(-2%, -2%, 0) scale(1);
  }
  50% {
    transform: translate3d(2%, 2%, 0) scale(1.06);
  }
  100% {
    transform: translate3d(-1%, 1%, 0) scale(1.02);
  }
}

@keyframes appHeaderSheen {
  0% {
    transform: translateX(-22%) rotate(0.001deg);
    opacity: 0.45;
  }
  50% {
    opacity: 0.8;
  }
  100% {
    transform: translateX(22%) rotate(0.001deg);
    opacity: 0.45;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-header::before,
  .app-header::after {
    animation: none;
  }
}

.page.active {
  animation: fadeInUp 0.3s ease;
}

@media (max-width: 1100px) {
  .two-column-grid,
  .onboarding-grid,
  .score-layout,
  .bot-layout {
    grid-template-columns: 1fr;
  }

  .komoditas-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .app-header {
    padding: 0 1rem;
  }

  .main {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .content {
    padding: 1rem;
  }

  .benchmark-grid {
    grid-template-columns: 1fr;
  }

  .metric-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .metric-value {
    text-align: left;
    white-space: normal;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .commodity-table-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .commodity-table-head .btn {
    width: 100%;
    justify-content: center;
  }

  .price-history-toolbar {
    flex-wrap: wrap;
    margin-bottom: 0;
  }

  .price-history-toolbar .form-select {
    max-width: none !important;
    flex: 1 1 100%;
  }

  .price-history-toolbar .btn {
    flex: 1 1 calc(33.333% - 6px);
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 680px) {
  .logo-badge,
  .nav-tabs {
    display: none;
  }

  .phone-frame {
    width: 100%;
    box-shadow: none;
    border-radius: 18px;
  }

  .stat-grid,
  .komoditas-grid {
    grid-template-columns: 1fr;
  }

  .data-table {
    font-size: 12px;
  }

  .commodity-table-note {
    font-size: 11px;
  }

  .price-history-toolbar .btn {
    flex: 1 1 100%;
  }

  .price-history-table {
    min-width: 0;
  }

  .price-history-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
  }

  .price-history-table tbody {
    display: grid;
    gap: 10px;
    padding: 10px;
  }

  .price-history-table tbody tr {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas:
      "time"
      "name"
      "prev"
      "new";
    gap: 6px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    padding: 10px;
  }

  .price-history-table tbody tr.price-history-empty-row {
    display: block;
    border: none;
    padding: 0;
  }

  .price-history-table tbody tr.price-history-empty-row td {
    border: 1px dashed var(--border);
    border-radius: 12px;
    background: var(--sand);
  }

  .price-history-table tbody td {
    border-bottom: none;
    padding: 0;
    white-space: normal;
  }

  .price-history-table tbody td:nth-child(1) {
    grid-area: time;
  }

  .price-history-table tbody td:nth-child(2) {
    grid-area: name;
  }

  .price-history-table tbody td:nth-child(3) {
    grid-area: prev;
  }

  .price-history-table tbody td:nth-child(4) {
    grid-area: new;
  }

  .price-history-table .commodity-price-pill {
    margin-right: 6px;
  }

  .price-history-table .mobile-field-label {
    display: block;
    margin-bottom: 4px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
  }

  .price-history-table td:last-child {
    white-space: normal;
  }

  .price-change-pill {
    margin-left: 0;
    margin-top: 6px;
  }

  .commodity-table {
    min-width: 0;
  }

  .commodity-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
  }

  .commodity-table tbody {
    display: grid;
    gap: 10px;
    padding: 10px;
  }

  .commodity-table tbody tr {
    display: grid;
    grid-template-columns: 54px 1fr;
    grid-template-areas:
      "icon name"
      "icon price"
      "icon updated"
      "action action";
    gap: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    padding: 10px;
  }

  .commodity-table tbody tr.commodity-empty-row {
    display: block;
    border: none;
    padding: 0;
  }

  .commodity-table tbody tr.commodity-empty-row td {
    border: 1px dashed var(--border);
    border-radius: 12px;
    background: var(--sand);
  }

  .commodity-table tbody td {
    border-bottom: none;
    padding: 0;
  }

  .commodity-table tbody td:nth-child(1) {
    grid-area: icon;
    width: auto !important;
  }

  .commodity-table tbody td:nth-child(2) {
    grid-area: name;
  }

  .commodity-table tbody td:nth-child(3) {
    grid-area: price;
  }

  .commodity-table tbody td:nth-child(4) {
    grid-area: updated;
  }

  .commodity-table tbody td:nth-child(5) {
    grid-area: action;
  }

  .commodity-table .commodity-row-sub {
    margin-top: 0;
  }

  .commodity-table .commodity-table-actions {
    text-align: left;
    margin-top: 4px;
  }

  .commodity-table .commodity-table-actions .btn {
    width: 100%;
    justify-content: center;
  }
}
